old remove
authorMart Lubbers <mart@martlubbers.net>
Mon, 19 May 2014 14:46:14 +0000 (16:46 +0200)
committerMart Lubbers <mart@martlubbers.net>
Mon, 19 May 2014 14:46:14 +0000 (16:46 +0200)
program/hypfront/sel.js [deleted file]

diff --git a/program/hypfront/sel.js b/program/hypfront/sel.js
deleted file mode 100644 (file)
index a63fede..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-function getSelectionHtml() {
-       var html = "";
-       if (typeof window.getSelection != "undefined") {
-               var sel = window.getSelection();
-               if (sel.rangeCount) {
-                       var container = document.createElement("div");
-                       for (var i = 0, len = sel.rangeCount; i < len; ++i) {
-                               container.appendChild(sel.getRangeAt(i).cloneContents());
-                       }
-                       html = container.innerHTML;
-               }
-       } else if (typeof document.selection != "undefined") {
-               if (document.selection.type == "Text") {
-                       html = document.selection.createRange().htmlText;
-               }
-       }
-       return html;
-}
-
-function stylizeHighlightedString(col) 
-{
-    var range = window.getSelection().getRangeAt(0);
-       console.log(range)
-    var selectionContents = range.extractContents();
-    var span = document.createElement("span");
-    span.appendChild(selectionContents);
-    span.setAttribute("class","uiWebviewHighlight");
-    span.style.backgroundColor = col;
-    span.style.color = "white";
-    range.insertNode(span);
-}
-
-function f_wanneer() {
-       stylizeHighlightedString("red")
-}
-
-function f_wat() {
-       stylizeHighlightedString("green")
-}
-
-function f_waar() {
-       stylizeHighlightedString("blue")
-}
-
-
-window.onload = function() {
-       var box = document.getElementById('htab');
-       box.addEventListener('contextmenu', function(e) {
-               console.log(getSelectionHtml());
-       });
-}
-
-