Skip to content

Commit

Permalink
replaces pb namespace with visbug namespace
Browse files Browse the repository at this point in the history
removes the old pb namespace and introduces a new and accurate visbug namespace
  • Loading branch information
mikeChatsky committed Jan 29, 2019
1 parent 468fe62 commit af8ebf3
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion app/components/hotkey-map/hotkeys.element.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ export class Hotkeys extends HTMLElement {
}
}

customElements.define('pb-hotkeys', Hotkeys)
customElements.define('visbug-hotkeys', Hotkeys)
2 changes: 1 addition & 1 deletion app/components/metatip/ally.element.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ export class Ally extends Metatip {
}
}

customElements.define('pb-ally', Ally)
customElements.define('visbug-ally', Ally)
2 changes: 1 addition & 1 deletion app/components/metatip/metatip.element.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ export class Metatip extends HTMLElement {
}
}

customElements.define('pb-metatip', Metatip)
customElements.define('visbug-metatip', Metatip)
2 changes: 1 addition & 1 deletion app/components/selection/gridlines.element.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ export class Gridlines extends HTMLElement {
}
}

customElements.define('pb-gridlines', Gridlines)
customElements.define('visbug-gridlines', Gridlines)
4 changes: 2 additions & 2 deletions app/components/selection/handles.element.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class Handles extends HTMLElement {
return `
${this.styles({top,left})}
<svg
class="pb-handles"
class="visbug-handles"
width="${width}" height="${height}"
viewBox="0 0 ${width} ${height}"
version="1.1" xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -69,4 +69,4 @@ export class Handles extends HTMLElement {
}
}

customElements.define('pb-handles', Handles)
customElements.define('visbug-handles', Handles)
2 changes: 1 addition & 1 deletion app/components/selection/label.element.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ export class Label extends HTMLElement {
}
}

customElements.define('pb-label', Label)
customElements.define('visbug-label', Label)
4 changes: 2 additions & 2 deletions app/components/selection/overlay.element.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class Overlay extends HTMLElement {
render({id, top, left, height, width}) {
return `
<svg
class="pb-overlay"
class="visbug-overlay"
overlay-id="${id}"
style="
display:none;
Expand All @@ -51,4 +51,4 @@ export class Overlay extends HTMLElement {
}
}

customElements.define('pb-overlay', Overlay)
customElements.define('visbug-overlay', Overlay)
2 changes: 1 addition & 1 deletion app/components/tool-pallete/toolpallete.element.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default class ToolPallete extends HTMLElement {
render() {
return `
${this.styles()}
<pb-hotkeys></pb-hotkeys>
<visbug-hotkeys></visbug-hotkeys>
<ol>
${Object.entries(this.toolbar_model).reduce((list, [key, tool]) => `
${list}
Expand Down
4 changes: 2 additions & 2 deletions app/features/accessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const tip_map = new Map()

export function Accessibility() {
const template = ({target: el}) => {
let tip = document.createElement('pb-ally')
let tip = document.createElement('visbug-ally')

const contrast_results = determineColorContrast(el)
const ally_attributes = getA11ys(el)
Expand Down Expand Up @@ -181,4 +181,4 @@ export function Accessibility() {
hotkeys.unbind('esc')
hideAll()
}
}
}
4 changes: 2 additions & 2 deletions app/features/guides.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const showGridlines = node => {
gridlines.update = node.getBoundingClientRect()
}
else {
gridlines = document.createElement('pb-gridlines')
gridlines = document.createElement('visbug-gridlines')
gridlines.position = node.getBoundingClientRect()

document.body.appendChild(gridlines)
Expand All @@ -90,4 +90,4 @@ const showGridlines = node => {
const hideGridlines = node => {
if (!gridlines) return
gridlines.style.display = 'none'
}
}
4 changes: 2 additions & 2 deletions app/features/imageswap.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const showOverlay = (node, i) => {
overlay.update = rect
}
else {
overlays[i] = document.createElement('pb-overlay')
overlays[i] = document.createElement('visbug-overlay')
overlays[i].position = rect
document.body.appendChild(overlays[i])
}
Expand All @@ -115,4 +115,4 @@ const findBackgroundImages = el => {

return collection
}, [])
}
}
6 changes: 3 additions & 3 deletions app/features/metatip.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export function MetaTip(selectorEngine) {
el.getAttribute('style') && el.getAttribute('style').includes(style.prop)
? 0
: 1)
let tip = document.createElement('pb-metatip')

let tip = document.createElement('visbug-metatip')

tip.meta = {
el,
Expand Down Expand Up @@ -210,4 +210,4 @@ export function MetaTip(selectorEngine) {
hotkeys.unbind('esc')
hideAll()
}
}
}
4 changes: 2 additions & 2 deletions app/features/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function queryPage(query, fn) {
if (query == '.' || query == '#' || query.trim().endsWith(',')) return

try {
let matches = $(query + ':not(tool-pallete):not(script):not(hotkey-map):not(.pb-metatip):not(pb-label):not(pb-handles)')
let matches = $(query + ':not(tool-pallete):not(script):not(hotkey-map):not(.visbug-metatip):not(visbug-label):not(visbug-handles)')
if (!matches.length) matches = $(query)
if (!fn) SelectorEngine.unselect_all()
if (matches.length)
Expand All @@ -72,4 +72,4 @@ export function queryPage(query, fn) {
: SelectorEngine.select(el))
}
catch (err) {}
}
}
8 changes: 4 additions & 4 deletions app/features/selectable.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function Selectable() {

document.onkeydown = function(e) {
if (hotkeys.ctrl && selected.length) {
$('pb-handles, pb-label').forEach(el =>
$('visbug-handles, visbug-label').forEach(el =>
el.style.display = 'none')

did_hide = true
Expand All @@ -109,7 +109,7 @@ export function Selectable() {

document.onkeyup = function(e) {
if (did_hide) {
$('pb-handles, pb-label').forEach(el =>
$('visbug-handles, visbug-label').forEach(el =>
el.style.display = null)

did_hide = false
Expand Down Expand Up @@ -379,7 +379,7 @@ export function Selectable() {

const createLabel = (el, text) => {
if (!labels[parseInt(el.getAttribute('data-label-id'))]) {
const label = document.createElement('pb-label')
const label = document.createElement('visbug-label')

label.text = text
label.position = {
Expand Down Expand Up @@ -417,7 +417,7 @@ export function Selectable() {

const createHandle = el => {
if (!handles[parseInt(el.getAttribute('data-label-id'))]) {
const handle = document.createElement('pb-handles')
const handle = document.createElement('visbug-handles')

handle.position = {
boundingRect: el.getBoundingClientRect(),
Expand Down
14 changes: 7 additions & 7 deletions app/utilities/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export const showHideNodeLabel = (el, show = false) => {
return

const nodes = $(`
pb-label[data-label-id="${el.getAttribute('data-label-id')}"],
pb-handles[data-label-id="${el.getAttribute('data-label-id')}"]
visbug-label[data-label-id="${el.getAttribute('data-label-id')}"],
visbug-handles[data-label-id="${el.getAttribute('data-label-id')}"]
`)

nodes.length && show
Expand All @@ -61,9 +61,9 @@ export const isOffBounds = node =>
node.closest &&
(node.closest('tool-pallete')
|| node.closest('hotkey-map')
|| node.closest('pb-metatip')
|| node.closest('pb-ally')
|| node.closest('pb-label')
|| node.closest('pb-handles')
|| node.closest('pb-gridlines')
|| node.closest('visbug-metatip')
|| node.closest('visbug-ally')
|| node.closest('visbug-label')
|| node.closest('visbug-handles')
|| node.closest('visbug-gridlines')
)
6 changes: 3 additions & 3 deletions assets/visbug.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"background": {
"persistent": true,
"scripts": [
"pixelbug.js"
"visbug.js"
]
},
"browser_action": {
Expand Down
File renamed without changes.

0 comments on commit af8ebf3

Please sign in to comment.