Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <?xml version="1.0"?> |
michael@0 | 2 | |
michael@0 | 3 | <bindings |
michael@0 | 4 | xmlns="http://www.mozilla.org/xbl" |
michael@0 | 5 | xmlns:xbl="http://www.mozilla.org/xbl" |
michael@0 | 6 | xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
michael@0 | 7 | xmlns:html="http://www.w3.org/1999/xhtml"> |
michael@0 | 8 | <binding id="selection-binding"> |
michael@0 | 9 | <content> |
michael@0 | 10 | <html:div flex="1" class="selection-overlay-inner window-width window-height" anonid="selection-overlay-inner"> |
michael@0 | 11 | <xul:stack> |
michael@0 | 12 | <html:div anonid="selection-overlay-debug" class="window-width window-height"/> |
michael@0 | 13 | <xul:toolbarbutton anonid="selectionhandle-mark1" class="selectionhandle" label="^" left="10" top="10" hidden="true"/> |
michael@0 | 14 | <xul:toolbarbutton anonid="selectionhandle-mark2" class="selectionhandle" label="^" left="10" top="10" hidden="true"/> |
michael@0 | 15 | <xul:toolbarbutton anonid="selectionhandle-mark3" class="selectionhandle" label="^" left="10" top="10" hidden="true"/> |
michael@0 | 16 | </xul:stack> |
michael@0 | 17 | </html:div> |
michael@0 | 18 | </content> |
michael@0 | 19 | |
michael@0 | 20 | <implementation implements="nsIDOMEventListener"> |
michael@0 | 21 | <field name="_selectionOverlay" readonly="true">document.getAnonymousElementByAttribute(this, "anonid", "selection-overlay-inner").parentNode;</field> |
michael@0 | 22 | <field name="_selectionDebugOverlay" readonly="true">document.getAnonymousElementByAttribute(this, "anonid", "selection-overlay-debug");</field> |
michael@0 | 23 | |
michael@0 | 24 | <property name="enabled"> |
michael@0 | 25 | <setter> |
michael@0 | 26 | <![CDATA[ |
michael@0 | 27 | if (val) { |
michael@0 | 28 | this._selectionOverlay.setAttribute("class", "selection-overlay window-width window-height"); |
michael@0 | 29 | } else { |
michael@0 | 30 | this._selectionOverlay.setAttribute("class", "selection-overlay-hidden"); |
michael@0 | 31 | } |
michael@0 | 32 | return val; |
michael@0 | 33 | ]]> |
michael@0 | 34 | </setter> |
michael@0 | 35 | <getter> |
michael@0 | 36 | <![CDATA[ |
michael@0 | 37 | return (this._selectionOverlay.getAttribute("class") == "selection-overlay"); |
michael@0 | 38 | ]]> |
michael@0 | 39 | </getter> |
michael@0 | 40 | </property> |
michael@0 | 41 | |
michael@0 | 42 | <property name="displayDebugLayer"> |
michael@0 | 43 | <setter> |
michael@0 | 44 | <![CDATA[ |
michael@0 | 45 | if (val) { |
michael@0 | 46 | this._selectionDebugOverlay.style.display = "block"; |
michael@0 | 47 | this._debugLayerVisible = true; |
michael@0 | 48 | } else { |
michael@0 | 49 | this._selectionDebugOverlay.style.display = "none"; |
michael@0 | 50 | this._debugLayerVisible = false; |
michael@0 | 51 | while(this._selectionDebugOverlay.hasChildNodes()) this._selectionDebugOverlay.removeChild(this._selectionDebugOverlay.firstChild); |
michael@0 | 52 | } |
michael@0 | 53 | return this._debugLayerVisible; |
michael@0 | 54 | ]]> |
michael@0 | 55 | </setter> |
michael@0 | 56 | <getter> |
michael@0 | 57 | <![CDATA[ |
michael@0 | 58 | if (this._debugLayerVisible == "undefined") |
michael@0 | 59 | this._debugLayerVisible = false; |
michael@0 | 60 | return this._debugLayerVisible; |
michael@0 | 61 | ]]> |
michael@0 | 62 | </getter> |
michael@0 | 63 | </property> |
michael@0 | 64 | |
michael@0 | 65 | <method name="getMarker"> |
michael@0 | 66 | <parameter name="aMarkerId"/> |
michael@0 | 67 | <body> |
michael@0 | 68 | <![CDATA[ |
michael@0 | 69 | return document.getAnonymousElementByAttribute(this, "anonid", aMarkerId); |
michael@0 | 70 | ]]> |
michael@0 | 71 | </body> |
michael@0 | 72 | </method> |
michael@0 | 73 | |
michael@0 | 74 | <method name="addDebugRect"> |
michael@0 | 75 | <parameter name="aLeft"/> |
michael@0 | 76 | <parameter name="aTop"/> |
michael@0 | 77 | <parameter name="aRight"/> |
michael@0 | 78 | <parameter name="aBottom"/> |
michael@0 | 79 | <parameter name="aColor"/> |
michael@0 | 80 | <parameter name="aFill"/> |
michael@0 | 81 | <parameter name="aId"/> |
michael@0 | 82 | <body> |
michael@0 | 83 | <![CDATA[ |
michael@0 | 84 | let e = document.createElement("div"); |
michael@0 | 85 | this._selectionDebugOverlay.appendChild(e); |
michael@0 | 86 | e.style.position = "fixed"; |
michael@0 | 87 | e.style.left = aLeft +"px"; |
michael@0 | 88 | e.style.top = aTop +"px"; |
michael@0 | 89 | e.style.right = aRight +"px"; |
michael@0 | 90 | e.style.bottom = aBottom +"px"; |
michael@0 | 91 | e.style.maxWidth = (aRight - aLeft) +"px"; |
michael@0 | 92 | e.style.width = (aRight - aLeft) +"px"; |
michael@0 | 93 | e.style.maxHeight = (aBottom - aTop) +"px"; |
michael@0 | 94 | e.style.height = (aBottom - aTop) +"px"; |
michael@0 | 95 | e.style.pointerEvents = "none"; |
michael@0 | 96 | if (aFill == undefined) { |
michael@0 | 97 | e.style.backgroundColor = aColor; |
michael@0 | 98 | } else { |
michael@0 | 99 | if (aFill) { |
michael@0 | 100 | e.style.backgroundColor = aColor; |
michael@0 | 101 | } else { |
michael@0 | 102 | e.style.border = "2px solid " + aColor; |
michael@0 | 103 | } |
michael@0 | 104 | } |
michael@0 | 105 | e.style.opacity = "0.5"; |
michael@0 | 106 | ]]> |
michael@0 | 107 | </body> |
michael@0 | 108 | </method> |
michael@0 | 109 | </implementation> |
michael@0 | 110 | </binding> |
michael@0 | 111 | </bindings> |