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 | <!DOCTYPE html> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <link id="siteicon" rel="icon" href="./icon.png"/> |
michael@0 | 5 | <title>Demo Mark Window</title> |
michael@0 | 6 | <script type="text/javascript"> |
michael@0 | 7 | window.addEventListener("socialFrameShow", function(e) { |
michael@0 | 8 | var port = navigator.mozSocial.getWorker().port; |
michael@0 | 9 | port.postMessage({topic: "status-panel-visibility", result: "shown"}); |
michael@0 | 10 | }, false); |
michael@0 | 11 | window.addEventListener("socialFrameHide", function(e) { |
michael@0 | 12 | var port = navigator.mozSocial.getWorker().port; |
michael@0 | 13 | port.postMessage({topic: "status-panel-visibility", result: "hidden"}); |
michael@0 | 14 | }, false); |
michael@0 | 15 | |
michael@0 | 16 | function updateTextNode(parent, text) { |
michael@0 | 17 | var textNode = parent.childNodes[0]; |
michael@0 | 18 | if (textNode) |
michael@0 | 19 | parent.removeChild(textNode); |
michael@0 | 20 | textNode = document.createTextNode(text); |
michael@0 | 21 | parent.appendChild(textNode); |
michael@0 | 22 | } |
michael@0 | 23 | function onLoad() { |
michael@0 | 24 | updateTextNode(document.getElementById("shared"), location.search); |
michael@0 | 25 | socialMarkUpdate(true); |
michael@0 | 26 | } |
michael@0 | 27 | function socialMarkUpdate(isMarked) { |
michael@0 | 28 | var evt = document.createEvent("CustomEvent"); |
michael@0 | 29 | evt.initCustomEvent("socialMarkUpdate", true, true, JSON.stringify({marked: isMarked})); |
michael@0 | 30 | document.documentElement.dispatchEvent(evt); |
michael@0 | 31 | } |
michael@0 | 32 | var shareData; |
michael@0 | 33 | addEventListener("OpenGraphData", function(e) { |
michael@0 | 34 | shareData = JSON.parse(e.detail); |
michael@0 | 35 | updateTextNode(document.getElementById("shared"), shareData.url); |
michael@0 | 36 | socialMarkUpdate(true); |
michael@0 | 37 | }); |
michael@0 | 38 | </script> |
michael@0 | 39 | </head> |
michael@0 | 40 | |
michael@0 | 41 | <body onload="onLoad()"> |
michael@0 | 42 | <div id="content"> |
michael@0 | 43 | <h3>This window shows the mark data</h3> |
michael@0 | 44 | <div>Page Marked: <div id="shared" class="textbox"></div></div> |
michael@0 | 45 | <button id="unmark" onclick="socialMarkUpdate(false); window.close()">Unmark</button> |
michael@0 | 46 | <button onclick="window.close();">Close</button> |
michael@0 | 47 | </div> |
michael@0 | 48 | </body> |
michael@0 | 49 | </html> |