├── .htaccess
├── LICENSE
├── README.md
├── _notes
└── .htaccess
├── config.php
├── css
├── simple.css
├── simple.min.css
├── styles.css
└── styles.min.css
├── favicon.ico
├── index.php
├── js
├── notelist.js
├── notelist.min.js
├── script.js
├── script.min.js
├── simple.js
└── simple.min.js
├── modules
├── common.php
├── copy.php
├── create_notes_folder.php
├── css
│ ├── lastsaved.css
│ ├── lastsaved.min.css
│ ├── menu.css
│ ├── menu.min.css
│ ├── modal.css
│ └── modal.min.css
├── header.php
├── js
│ ├── copy.js
│ ├── copy.min.js
│ ├── lastsaved.js
│ ├── lastsaved.min.js
│ ├── menu.js
│ ├── menu.min.js
│ ├── modal.js
│ ├── modal.min.js
│ ├── password.js
│ ├── password.min.js
│ ├── tinyago.js
│ ├── tinyago.min.js
│ ├── view.js
│ └── view.min.js
├── lastsaved.php
├── menu.php
├── password.php
├── protect.php
└── protect_form.php
├── nginx.conf.example
├── notelist.php
├── passwordHelp.html
├── setup.php
├── simple.php
└── view.php
/.htaccess:
--------------------------------------------------------------------------------
1 | RewriteEngine On
2 |
3 | #RewriteCond %{HTTPS} off
4 | #RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
5 |
6 | # if there is a view parameter in the querystring then use view.php
7 | RewriteCond %{QUERY_STRING} ^view [NC]
8 | RewriteRule ^([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)$ view.php?note=$1 [L,QSA]
9 | # the [L] flag will stop any futher processing
10 |
11 | RewriteCond %{QUERY_STRING} ^simple [NC]
12 | RewriteRule ^([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)$ simple.php?note=$1 [L,QSA]
13 | # the [L] flag will stop any futher processing
14 |
15 | #allow 0-9 a-z and hyphens/dashes
16 | RewriteRule ^([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)$ index.php?note=$1 [L,QSA]
17 |
18 |
19 | Header set X-Robots-Tag: "noindex, nofollow"
20 |
21 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 domOrielton
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # minimal-web-notepad
3 |
4 | This is a fork of the excellent [pereorga/minimalist-web-notepad](https://github.com/pereorga/minimalist-web-notepad) with additional functionality - the additional code does add size so not minimalist but still minimal at 10kb when minified and gzipped. If you want to go really minimalist then pereorga's implementation is under 3kb and that's not even minified! Password functionality is implemented by adding a header line to the text file which isn't displayed on the note ** be aware this does not encypt the contents, just limits access ** . The only server requirements are an Apache webserver with mod_rewrite enabled or an nginx webserver with ngx_http_rewrite_module and PHP enabled.
5 |
6 | 
7 |
8 | Added functionality to [pereorga's](https://github.com/pereorga/minimalist-web-notepad) original:
9 |
10 | - view option for note with URLs hyperlinked (very useful for mobile)
11 | - password protection with option for read only access
12 | - view only link
13 | - show last saved time of note
14 | - copy note url, view only url and note text to clipboard
15 | - view note in sans-serif or mono font
16 | - ability to download note
17 | - list of available notes
18 | - turn features on and off to reduce page size if needed
19 |
20 | See demo at http://note.rf.gd/ or http://note.rf.gd/some-note-name-here. The demo doesn't have https so you will see password warnings in your browser - *do not* use it for anything other than a test.
21 |
22 | Screenshots
23 | ------------
24 |
25 | **Note in View mode**
26 |
27 | 
28 |
29 | **Responsive menu for mobile compatibility**
30 |
31 |  
32 |
33 | **Mono font**
34 |
35 | 
36 |
37 | **Password protection**
38 |
39 | 
40 |
41 | **Password prompt for protected note**
42 |
43 | 
44 |
45 | The 'View as Read Only' link shows the note text and nothing else
46 |
47 | **Links for copying to clipboard**
48 |
49 | 
50 |
51 | **Note list** - generally only used for a URL that is not public, although the page is password protected
52 |
53 | 
54 |
55 | If you don't want the note list to show then either set the $allow_noteslist parameter to false at the top of index.php or just rename `notelist.php` to something else. The password for the note list page is at the top of `notelist.php` - Protect\with('modules/protect_form.php', 'change the password here');
56 |
57 | **Alternative editing view**
58 |
59 | There is also an alternative editing view that can be accessed by adding ?simple after the note e.g. /quick?simple. I personally find this view very useful for adding very quick notes on my phone - it has a small edit area at the top of the page and when you enter text and hit newline it adds it to the note and moves it to to the view that takes up the rest of the page. This view section shows URLs as clickable links. You can't set passwords on this view but it does honor them.
60 |
61 | 
62 |
63 | Installation
64 | ------------
65 |
66 | No configuration should be needed as long as mod_rewrite is enabled and the web server is allowed to write to the `_notes` data directory. This data directory is set in `config.php` so if you want to change it to the folder used by the original pereorga/minimalist-web-notepad version then change it there. All the notes are stored as text files so a server running Apache (or Nginx) should be enough, no databases required.
67 |
68 | If notes aren't saving then please check the permissions on the `_notes` directory - 0755 or 744 should be all that is needed.
69 |
70 | 
71 |
72 | There is also a `setup.php` page that can be used to check the `_notes` directory exists and can be written to. If you are having difficulty saving notes it may be worth deleting the `_notes` directory and then going to the `setup.php` page to create the folder. If all is working ok then you can delete the `setup.php` file if you wish.
73 |
74 | There may be scenarios where the $base_url variable in `config.php` needs to be replaced with the hardcoded URL path of your installation. If that is the case just replace the line in `config.php` beginning with `$base_url = dirname('//'` with `$base_url ='http://actualURL.com/notes'` replacing actualURL.com/notes with whatever is relevant for your installation.
75 |
76 | ### On Apache
77 |
78 | You may need to enable mod_rewrite and set up `.htaccess` files in your site configuration.
79 | See [How To Set Up mod_rewrite for Apache](https://www.digitalocean.com/community/tutorials/how-to-set-up-mod_rewrite-for-apache-on-ubuntu-14-04).
80 |
81 | ## On nginx
82 |
83 | On nginx, you will need to ensure nginx.conf is configured correctly to ensure the application works as expected.
84 | Please check the nginx.conf.example file or the [view without password issue](https://github.com/domOrielton/minimal-web-notepad/issues/4). Credit to [eonegh](https://github.com/eonegh) for the example file.
85 |
--------------------------------------------------------------------------------
/_notes/.htaccess:
--------------------------------------------------------------------------------
1 | Deny from all
2 |
--------------------------------------------------------------------------------
/config.php:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/css/simple.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | background: #ebeef1;
4 | }
5 |
6 | .container {
7 | position: absolute;
8 | top: 20px;
9 | right: 20px;
10 | bottom: 20px;
11 | left: 20px;
12 | }
13 |
14 | .contentAdd, .content {
15 | font-size: 100%;
16 | margin: 0;
17 | padding: 20px;
18 | overflow-y: auto;
19 | resize: none;
20 | width: 100%;
21 | height: 10%;
22 | min-height: 10%;
23 | -webkit-box-sizing: border-box;
24 | -moz-box-sizing: border-box;
25 | box-sizing: border-box;
26 | border: 1px #ddd solid;
27 | outline: none;
28 | font-family: sans-serif;
29 | }
30 |
31 | .content {
32 | height: 90%;
33 | min-height: 90%;
34 | }
35 |
36 | .content br {
37 | display: block;
38 | line-height: 1.5em;
39 | }
40 |
41 | @media screen and (max-width: 600px) {
42 | .contentAdd {
43 | padding-top: 5px !important;
44 | }
45 | }
46 |
47 | #printable {
48 | display: none;
49 | }
50 |
51 | @media print {
52 | .container {
53 | display: none;
54 | }
55 |
56 | #printable {
57 | display: block;
58 | white-space: pre-wrap;
59 | word-break: break-word;
60 | }
61 | }
62 |
63 | .wordwrap {
64 | /* used for the view functionality */
65 | white-space: pre-wrap;
66 | /* CSS3 */
67 | white-space: -moz-pre-wrap;
68 | /* Firefox */
69 | white-space: -pre-wrap;
70 | /* Opera <7 */
71 | white-space: -o-pre-wrap;
72 | /* Opera 7 */
73 | word-wrap: break-word;
74 | /* IE */
75 | }
76 |
77 | .footer {
78 | font-size: 100%;
79 | font-family: monospace;
80 | position: absolute;
81 | bottom: 0;
82 | left: 20px;
83 | text-align: left;
84 | }
85 |
86 | @media print {
87 | .footer {
88 | display: none;
89 | }
90 | }
91 |
92 | .navbar {
93 | overflow: hidden;
94 | position: fixed;
95 | bottom: 0;
96 | min-width: 100px;
97 | background-color: #ebeef1;
98 | }
99 |
100 | .navbar a {
101 | float: left;
102 | display: block;
103 | color: black;
104 | text-align: center;
105 | padding: 1px 5px;
106 | text-decoration: underline;
107 | }
108 |
109 | .navbar a:hover {
110 | /*background-color: #ddd;*/
111 | color: black;
112 | }
113 |
114 | .navbar a.active {
115 | color: black;
116 | }
117 |
--------------------------------------------------------------------------------
/css/simple.min.css:
--------------------------------------------------------------------------------
1 | body{margin:0;background:#ebeef1}.container{position:absolute;top:20px;right:20px;bottom:20px;left:20px}.contentAdd,.content{font-size:100%;margin:0;padding:20px;overflow-y:auto;resize:none;width:100%;height:10%;min-height:10%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px #ddd solid;outline:0;font-family:sans-serif}.content{height:90%;min-height:90%}.content br{display:block;line-height:1.5em}@media screen and (max-width:600px){.contentAdd{padding-top:5px!important}}#printable{display:none}@media print{.container{display:none}#printable{display:block;white-space:pre-wrap;word-break:break-word}}.wordwrap{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}.footer{font-size:100%;font-family:monospace;position:absolute;bottom:0;left:20px;text-align:left}@media print{.footer{display:none}}.navbar{overflow:hidden;position:fixed;bottom:0;min-width:100px;background-color:#ebeef1}.navbar a{float:left;display:block;color:black;text-align:center;padding:1px 5px;text-decoration:underline}.navbar a:hover{color:black}.navbar a.active{color:black}
--------------------------------------------------------------------------------
/css/styles.css:
--------------------------------------------------------------------------------
1 | /*! Minimalist Web Notepad | https://github.com/pereorga/minimalist-web-notepad */
2 | body {
3 | margin: 0;
4 | background: #ebeef1;
5 | }
6 |
7 | .container {
8 | position: absolute;
9 | top: 20px;
10 | right: 20px;
11 | bottom: 20px;
12 | left: 20px;
13 | }
14 |
15 | .content {
16 | font-size: 100%;
17 | margin: 0;
18 | padding: 20px;
19 | overflow-y: auto;
20 | resize: none;
21 | width: 100%;
22 | height: 100%;
23 | min-height: 100%;
24 | -webkit-box-sizing: border-box;
25 | -moz-box-sizing: border-box;
26 | box-sizing: border-box;
27 | border: 1px #ddd solid;
28 | outline: none;
29 | /* comment font- settings out to return to default monospace font */
30 | font-family: sans-serif;
31 | font-size: medium;
32 | }
33 |
34 | #printable {
35 | display: none;
36 | }
37 |
38 | .hidden {visibility: hidden;}
39 |
40 | a {
41 | cursor: pointer;
42 | color: blue;
43 | }
44 |
45 | a:hover, a.hover {
46 | text-decoration: underline;
47 | }
48 |
49 | @media print {
50 | #content {
51 | display: none;
52 | }
53 |
54 | #printable {
55 | display: block;
56 | white-space: pre-wrap;
57 | word-break: break-word;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/css/styles.min.css:
--------------------------------------------------------------------------------
1 | /*! Minimalist Web Notepad | https://github.com/pereorga/minimalist-web-notepad */body{margin:0;background:#ebeef1}.container{position:absolute;top:20px;right:20px;bottom:20px;left:20px}.content{font-size:100%;margin:0;padding:20px;overflow-y:auto;resize:none;width:100%;height:100%;min-height:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px #ddd solid;outline:0;font-family:sans-serif;font-size:medium}#printable{display:none}.hidden{visibility:hidden}a{cursor:pointer;color:blue}a:hover,a.hover{text-decoration:underline}@media print{#content{display:none}#printable{display:block;white-space:pre-wrap;word-break:break-word}}
2 |
--------------------------------------------------------------------------------
/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/domOrielton/minimal-web-notepad/098fcd6787e20bdf9e16e795c31b778570ffdb6c/favicon.ico
--------------------------------------------------------------------------------
/index.php:
--------------------------------------------------------------------------------
1 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
90 |
91 |
92 |
93 | '.PHP_EOL;
100 | echo "".PHP_EOL;
101 | }
102 | if ($include_Header) { checkHeader($path, null, true); } //check if the removePassword be shown ?>
103 |
104 |
105 |
--------------------------------------------------------------------------------
/js/notelist.js:
--------------------------------------------------------------------------------
1 | // from https://www.w3schools.com/howto/howto_js_sort_table.asp
2 | function sortTable(n) {
3 | var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0;
4 | table = document.getElementById("notelistTable");
5 | switching = true;
6 | //Set the sorting direction to ascending:
7 | dir = "asc";
8 | /*Make a loop that will continue until
9 | no switching has been done:*/
10 | while (switching) {
11 | //start by saying: no switching is done:
12 | switching = false;
13 | rows = table.getElementsByTagName("TR");
14 | /*Loop through all table rows (except the
15 | first, which contains table headers):*/
16 | for (i = 1; i < (rows.length - 1); i++) {
17 | //start by saying there should be no switching:
18 | shouldSwitch = false;
19 | /*Get the two elements you want to compare,
20 | one from current row and one from the next:*/
21 | x = rows[i].getElementsByTagName("TD")[n];
22 | y = rows[i + 1].getElementsByTagName("TD")[n];
23 | /*check if the two rows should switch place,
24 | based on the direction, asc or desc:*/
25 | if (dir == "asc") {
26 | if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) {
27 | //if so, mark as a switch and break the loop:
28 | shouldSwitch = true;
29 | break;
30 | }
31 | } else if (dir == "desc") {
32 | if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase()) {
33 | //if so, mark as a switch and break the loop:
34 | shouldSwitch = true;
35 | break;
36 | }
37 | }
38 | }
39 | if (shouldSwitch) {
40 | /*If a switch has been marked, make the switch
41 | and mark that a switch has been done:*/
42 | rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);
43 | switching = true;
44 | //Each time a switch is done, increase this count by 1:
45 | switchcount++;
46 | } else {
47 | /*If no switching has been done AND the direction is "asc",
48 | set the direction to "desc" and run the while loop again.*/
49 | if (switchcount == 0 && dir == "asc") {
50 | dir = "desc";
51 | switching = true;
52 | }
53 | }
54 | }
55 | }
56 | // from https://www.w3schools.com/howto/howto_js_filter_table.asp
57 | function filterTable() {
58 | // Declare variables
59 | var input, filter, table, tr, td, i;
60 | input = document.getElementById("filterNotes");
61 | filter = input.value.toUpperCase();
62 | table = document.getElementById("notelistTable");
63 | tr = table.getElementsByTagName("tr");
64 |
65 | // Loop through all table rows, and hide those who don't match the search query
66 | for (i = 0; i < tr.length; i++) {
67 | td = tr[i].getElementsByTagName("td")[0];
68 | if (td) {
69 | if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
70 | tr[i].style.display = "";
71 | } else {
72 | tr[i].style.display = "none";
73 | }
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/js/notelist.min.js:
--------------------------------------------------------------------------------
1 | function sortTable(a){var j,k,b,e,h,g,f,c,d=0;j=document.getElementById("notelistTable");b=true;c="asc";while(b){b=false;k=j.getElementsByTagName("TR");for(e=1;e<(k.length-1);e++){f=false;h=k[e].getElementsByTagName("TD")[a];g=k[e+1].getElementsByTagName("TD")[a];if(c=="asc"){if(h.innerHTML.toLowerCase()>g.innerHTML.toLowerCase()){f=true;break}}else{if(c=="desc"){if(h.innerHTML.toLowerCase()-1){e[b].style.display=""}else{e[b].style.display="none"}}}};
--------------------------------------------------------------------------------
/js/script.js:
--------------------------------------------------------------------------------
1 | function uploadContent(force) {
2 |
3 | force = force || false; //force needed to add password even though the text is not changed
4 | // If textarea value changes.
5 | if (content !== textarea.value || force) {
6 | var temp = textarea.value;
7 | var request = new XMLHttpRequest();
8 | var saved = false;
9 | request.open('POST', window.location.href, true);
10 | request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
11 |
12 | request.onreadystatechange = function() {
13 | //if (this.readyState !== 4 || this.status !== 200) {
14 | // saved = "error";
15 | //} // for lastUpdated status
16 | // the password page won't show correctly if the textarea is there and the session has timed out but
17 | // we can still search for text displayed in the form as it is in the responseText
18 | if (this.responseText.search("Invalid password") !== -1) {
19 | location.reload();
20 | }
21 | //if (this.responseText.search("saved") > 0) {
22 | // saved = true;
23 | //}
24 | //} // will give a true here is password is set on blank note as note gets deleted
25 | //if (this.responseText.search("deleted") !== -1) {
26 | // saved = true;
27 | //} // will give a true here is password is set on blank note as note gets deleted
28 | if (typeof lastUpdated === "function" ) {
29 | lastUpdated(this.responseText);
30 | } // check if the lastupdated functions are loaded
31 | };
32 |
33 | request.onload = function() {
34 | if (request.readyState === 4) {
35 |
36 | // Request has ended, check again after 1 second.
37 | content = temp;
38 | setTimeout(uploadContent, 1500); //increased time from 1 to 1.5 seconds to offset header check
39 | }
40 | }
41 |
42 | request.onerror = function() {
43 | //saved = "error"; // for lastUpdated status
44 | // Try again after 1 second
45 | setTimeout(uploadContent, 1000);
46 | }
47 |
48 | // Send the request.
49 | var requestToSend = 'text=' + encodeURIComponent(temp);
50 | if (typeof passwordRequest_Add === "function") {
51 | requestToSend = passwordRequest_Add(requestToSend);
52 | } //check if the password functions are loaded
53 | if (typeof passwordRequest_Remove === "function") {
54 | requestToSend = passwordRequest_Remove(requestToSend);
55 | } //check if the password functions are loaded
56 | request.send(requestToSend);
57 |
58 | // Make the content available to print.
59 | printable.removeChild(printable.firstChild);
60 | printable.appendChild(document.createTextNode(temp));
61 |
62 | if (document.getElementById("contentWithLinks")) {
63 | // used by the simple view
64 | document.getElementById("contentWithLinks").innerHTML = linkify(document.getElementById("printable").innerHTML).replace(/\r\n|\r|\n/g, " ");
65 | var objDiv = document.getElementById("contentWithLinks").scrollHeight; //scroll to bottom as text added there
66 | }
67 |
68 | } else {
69 |
70 | // Content has not changed, check again after 1 second.
71 | setTimeout(uploadContent, 1000);
72 | if (typeof lastSaved === "function") {
73 | lastSaved();
74 | } //check if the lastupdated functions are loaded
75 | }
76 | }
77 |
78 | var textarea = document.getElementById('content');
79 | var printable = document.getElementById('printable');
80 | var content = textarea.value;
81 |
82 | // Make the content available to print.
83 | printable.appendChild(document.createTextNode(content));
84 |
85 | // Enable TABs to indent. Based on https://stackoverflow.com/a/14166052/1391963
86 | textarea.onkeydown = function(e) {
87 | if (e.keyCode === 9 || e.which === 9) {
88 | e.preventDefault();
89 | var s = this.selectionStart;
90 | this.value = this.value.substring(0, this.selectionStart) + '\t' + this.value.substring(this.selectionEnd);
91 | this.selectionEnd = s + 1;
92 | }
93 | }
94 |
95 | textarea.focus();
96 | uploadContent();
97 |
--------------------------------------------------------------------------------
/js/script.min.js:
--------------------------------------------------------------------------------
1 | function uploadContent(f){f=f||false;if(content!==textarea.value||f){var b=textarea.value;var e=new XMLHttpRequest();var d=false;e.open("POST",window.location.href,true);e.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");e.onreadystatechange=function(){if(this.responseText.search("Invalid password")!==-1){location.reload()}if(typeof lastUpdated==="function"){lastUpdated(this.responseText)}};e.onload=function(){if(e.readyState===4){content=b;setTimeout(uploadContent,1500)}};e.onerror=function(){setTimeout(uploadContent,1000)};var c="text="+encodeURIComponent(b);if(typeof passwordRequest_Add==="function"){c=passwordRequest_Add(c)}if(typeof passwordRequest_Remove==="function"){c=passwordRequest_Remove(c)}e.send(c);printable.removeChild(printable.firstChild);printable.appendChild(document.createTextNode(b));if(document.getElementById("contentWithLinks")){document.getElementById("contentWithLinks").innerHTML=linkify(document.getElementById("printable").innerHTML).replace(/\r\n|\r|\n/g," ");var a=document.getElementById("contentWithLinks").scrollHeight}}else{setTimeout(uploadContent,1000);if(typeof lastSaved==="function"){lastSaved()}}}var textarea=document.getElementById("content");var printable=document.getElementById("printable");var content=textarea.value;printable.appendChild(document.createTextNode(content));textarea.onkeydown=function(b){if(b.keyCode===9||b.which===9){b.preventDefault();var a=this.selectionStart;this.value=this.value.substring(0,this.selectionStart)+"\t"+this.value.substring(this.selectionEnd);this.selectionEnd=a+1}};textarea.focus();uploadContent();
--------------------------------------------------------------------------------
/js/simple.js:
--------------------------------------------------------------------------------
1 | var textareaAdd = document.getElementById('contentAdd'); // used by the simple view
2 |
3 | textareaAdd.onkeydown = function(e) {
4 | if (e.keyCode === 9 || e.which === 9) {
5 | e.preventDefault();
6 | var s = this.selectionStart;
7 | this.value = this.value.substring(0, this.selectionStart) + '\t' + this.value.substring(this.selectionEnd);
8 | this.selectionEnd = s + 1;
9 | }
10 | if (e.keyCode === 13 || e.which === 13) {
11 | e.preventDefault();
12 | document.getElementById("content").value += '\n' + textareaAdd.value;
13 | this.value = '';
14 | }
15 | }
16 |
17 | textareaAdd.focus();
18 |
--------------------------------------------------------------------------------
/js/simple.min.js:
--------------------------------------------------------------------------------
1 | var textareaAdd=document.getElementById("contentAdd");textareaAdd.onkeydown=function(b){if(b.keyCode===9||b.which===9){b.preventDefault();var a=this.selectionStart;this.value=this.value.substring(0,this.selectionStart)+"\t"+this.value.substring(this.selectionEnd);this.selectionEnd=a+1}if(b.keyCode===13||b.which===13){b.preventDefault();document.getElementById("content").value+="\n"+textareaAdd.value;this.value=""}};textareaAdd.focus();
--------------------------------------------------------------------------------
/modules/common.php:
--------------------------------------------------------------------------------
1 | console.log( 'Debug Objects: " . date('H:i:s'). " " . $output . "' );".PHP_EOL;
39 | }
40 |
41 | function writeToLog($txt)
42 | {
43 | file_put_contents('log.txt', date('Y-m-d H:i:s'). "\t" .$txt.PHP_EOL, FILE_APPEND | LOCK_EX);
44 | }
45 |
--------------------------------------------------------------------------------
/modules/copy.php:
--------------------------------------------------------------------------------
1 |