User Tools

Site Tools


notes

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
notes [2025/10/07 14:03] adminnotes [2025/10/08 09:59] (current) admin
Line 2: Line 2:
  
 **Description**: Plain text editor / note taker in a browser tab.\\ **Description**: Plain text editor / note taker in a browser tab.\\
-**Functions**: Edit area, open existing file, saving with filename. +**Functions**: Edit area, copy, open existing file, saving with filename.\\ 
 +**Demo**: http://www.custompc.plus.com/webnotes.htm
  
 <code> <code>
Line 13: Line 13:
 *:focus{outline:none} *:focus{outline:none}
 label{font-family:verdana;font-size:12px} label{font-family:verdana;font-size:12px}
 +h2{font-family:verdana;font-size:14px;text-align:center;}
 form{background-color:#f8f8f8;padding:10px 20px 4px 20px} form{background-color:#f8f8f8;padding:10px 20px 4px 20px}
-input[type=submit],input[type=reset],button{cursor:pointer} +button{cursor:pointer;background-color:#fb9a15;color:white;border:solid 4px #fb9a15;} 
-.container{max-width:fit-content;margin-left:auto;margin-right:auto;}+input[type=submit]{cursor:pointer;background-color:#89c108;color:white;border:solid 4px #89c108;} 
 +input[type=reset]{cursor:pointer;background-color:#e6471f;color:white;border:solid 4px #e6471f;
 +.container{max-width:fit-content;margin-left:auto;margin-right:auto;margin-top:4%;}
 </style> </style>
 </head> </head>
 <body> <body>
 <div class="container"> <div class="container">
 +
 <!-- Editor controls --> <!-- Editor controls -->
-<form><input type="file" id="inputfile"></form>+<form><h2>Web Notes</h2> 
 +<input type="file" id="inputfile"></form>
 <form onsubmit="download(this['name'].value, this['text'].value)"> <form onsubmit="download(this['name'].value, this['text'].value)">
 <textarea rows="30" cols="100" name="text" id="editarea"></textarea><p> <textarea rows="30" cols="100" name="text" id="editarea"></textarea><p>
 <label>Save As: </label><input type="text" name="name"><p> <label>Save As: </label><input type="text" name="name"><p>
-<button type="button">Copy</button> <input type="submit" value="Save" id="save"> +<button type="button" title="Copy Text">Copy</button> 
-<input type="reset" value="Clear" id="clear"> +<input type="submit" value="Save" id="save" title="Save Text"> 
 +<input type="reset" value="Clear" id="clear" title="Clear Text"> 
 </form> </form>
 </div> </div>
Line 34: Line 40:
 var control = document.getElementById("inputfile");  var control = document.getElementById("inputfile"); 
     control.addEventListener("change", function(event){      control.addEventListener("change", function(event){ 
-        var reader = new FileReader();      +        var reader = new FileReader();
         reader.onload = function(event){         reader.onload = function(event){
             var contents = event.target.result;                  var contents = event.target.result;     
Line 62: Line 68:
 <!-- Copy all text in editor area --> <!-- Copy all text in editor area -->
 <script language="Javascript" > <script language="Javascript" >
-  const textarea = document.querySelector('textarea'); +document.querySelector("button").onclick = function(){ 
-  const button = document.querySelector('button')+    document.querySelector("textarea").select(); 
-      +    document.execCommand('copy'); 
-      button.addEventListener('click', async () => +}
-      try { +
-      await navigator.clipboard.writeText(textarea.value); +
-      } catch (err) { +
-   console.error(err.name, err.message); +
-  } +
-})+
 </script> </script>
 </body> </body>
 </html> </html>
 +
 </code> </code>
notes.1759845830.txt.gz · Last modified: by admin