willyb321

Untitled

Sep 24th, 2016
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function readLineMemory() {
  2.     loadFile = dialog.showOpenDialog({properties: ['openFile']})
  3.     const loadPls = loadFile;
  4.     const lr = new LineByLineReader(loadPls[0]);
  5.  
  6.     lr.on('error', err => {
  7.         return console.log(err);
  8.     });
  9.  
  10.     lr.on('line', line => {
  11.         const lineParse = JSON.parse(line);
  12.         JSONParsed.push(lineParse);
  13.         const htmlTabled = tableify(lineParse) + '<hr>';
  14.         html = html && tableify(lineParse);
  15.         html = 'data:text/html,' + encodeURIComponent(html);
  16.         win.loadURL(html);
  17. })
  18.     //  fs.appendFile(`${process.resourcesPath}/index2.html`, htmlTabled, err => {
  19.     //      if (err) {
  20.     //          return console.log(err);
  21.     //      }
  22.     //  });
  23.     // });
  24.     // fs.appendFile(`${process.resourcesPath}/index2.html`, '<script src="https://use.fontawesome.com/a39359b6f9.js"></script><style>body {padding: 0; margin: 0; } body {background-color: #313943; color: #bbc8d8; font-family: \'Lato\'; font-size: 22px; font-weight: 500; line-height: 36px; margin-bottom: 36px; text-align: center; } header {position: absolute; width: 500px; height: 250px; top: 50%; left: 50%; margin-top: -125px; margin-left: -250px; text-align: center; } header h1 {font-size: 60px; font-weight: 100; margin: 0; padding: 0; } #grad {background: -webkit-linear-gradient(left, #5A3F37 , #2C7744); /* For Safari 5.1 to 6.0 */ background: -o-linear-gradient(right, #5A3F37 , #2C7744); /* For Opera 11.1 to 12.0 */ background: -moz-linear-gradient(right,#5A3F37 , #2C7744); /* For Firefox 3.6 to 15 */ background: linear-gradient(to right, #5A3F37 , #2C7744); /* Standard syntax */ } hr {color: red; }</style><link href="https://fonts.googleapis.com/css?family=Lato:400,400italic,700" rel="stylesheet" type="text/css">', err => {
  25.     //  if (err) {
  26.     //      return console.log(err);
  27.     //  }
  28.     // });
  29.     lr.on('end', () => {
  30.         console.log('done!');
  31.         console.log('The file was saved!');
  32.         // win.loadURL(`file://${process.resourcesPath}/index2.html`);
  33.  
  34.     });
  35.     return win;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment