Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Multibuffer</title>
- </head>
- <body>
- <table width="100%">
- <thead>
- <tr>
- <th>
- Время
- </th>
- <th>
- Содержание
- </th>
- </tr>
- </thead>
- <tbody class="data-time">
- </tbody>
- </table>
- <script>
- var gui = new require('nw.gui');
- var text = '', array=[],clipboard = '',per = 1;
- Array.prototype.in_array = function (p_vai) {
- for(var i = 0, l = this.length; i < l; i++) {
- if (this[1] == p_vai) {
- return true;
- }
- }
- return false;
- };
- function times() {
- var date = new Date();
- var H = date.getHours() < 10 ? "0"+date.getHours() : date.getHours() ,
- I = date.getMinutes() < 10 ? "0"+date.getMinutes() : date.getMinutes(),
- S = date.getSeconds() < 10 ? "0"+date.getSeconds() : date.getSeconds();
- return H+' : '+ I + ' : '+S;
- }
- var id = setInterval(function() {
- clipboard = gui.Clipboard.get();
- text = clipboard.get();
- if(!array.in_array(text.trim())) {
- console.log(text);
- var time = times();
- $(".data-time").append('<tr><td>'+time+'</td><td><span>'+$('div').text(text) .html().trim()+'</span></td></tr>');
- array.push(text.trim());
- }
- },1000);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement