User Tools

Site Tools


pf:prpldocs:vars_and_functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
pf:prpldocs:vars_and_functions [2016/06/23 09:20] virgilwpf:prpldocs:vars_and_functions [2016/06/23 12:48] (current) virgilw
Line 1: Line 1:
-<html><div id="editor"></html>+<html> 
 +<script type="text/javascript"> 
 +    function selectText(containerid) { 
 +        if (document.selection) { 
 +            var range = document.body.createTextRange(); 
 +            range.moveToElementText(document.getElementById(containerid)); 
 +            range.select(); 
 +        } else if (window.getSelection) { 
 +            var range = document.createRange(); 
 +            range.selectNode(document.getElementById(containerid)); 
 +            window.getSelection().addRange(range); 
 +        } 
 +    } 
 +</script> 
 + 
 +<a href="#" onclick="selectText('selectable')">Select All</a><br/> 
 +Save the contents to "Vars and Functions.txt" 
 + 
 +<div id="selectable"> 
 +</html>
 <code> <code>
 =CMD =CMD
Line 183: Line 202:
 </code> </code>
 <html></div></html> <html></div></html>
- 
-<html> 
-    <script type="text/javascript"> 
- 
- 
-            // Wait for the page to load first 
-            window.onload = function() { 
- 
-              //Get a reference to the link on the page 
-              // with an id of "exportxt" 
-              var a = document.getElementById("exportxt"); 
- 
-              //Set code to run when the link is clicked 
-              // by assigning a function to "onclick" 
-              a.onclick = function() { 
- 
-                // Your code here... 
- 
- 
-    function downloadInnerHtml(filename, elId, mimeType) { 
-        var elHtml = document.getElementById(elId).innerHTML; 
-        var link = document.createElement('a'); 
-        mimeType = mimeType || 'text/plain'; 
-        link.setAttribute('download', filename); 
-        link.setAttribute('href', 'data:' + mimeType  +  ';charset=utf-8,' + encodeURIComponent(elHtml)); 
-        link.click();  
-    } 
-    var fileName =  'myexportedhtml.txt'; // You can use the .txt extension if you want 
-    downloadInnerHtml(fileName, 'editor','text/plain'); 
-                //If you don't want the link to actually  
-                // redirect the browser to another page, then 
-                // return false at the end of this block. 
-                // Note that this also prevents event bubbling, 
-                // which is probably what we want here, but won' 
-                // always be the case. 
-                return false; 
-              } 
-            } 
- 
-    </script> 
- 
- 
-    <a id="exportxt" href="#">SAVE AS TXT FILE</a>  
- 
- 
-</html> 
pf/prpldocs/vars_and_functions.1466688013.txt.gz · Last modified: 2016/06/23 09:20 by virgilw