Daniel Scalzi 5 rokov pred
rodič
commit
141a753893
5 zmenil súbory, kde vykonal 351 pridanie a 446 odobranie
  1. 47 49
      app/assets/js/scripts/landing.js
  2. 0 1
      app/assets/js/scripts/uicore.js
  3. 3 0
      index.js
  4. 300 395
      package-lock.json
  5. 1 1
      package.json

+ 47 - 49
app/assets/js/scripts/landing.js

@@ -1076,56 +1076,54 @@ function loadNews(){
         const distroData = DistroManager.getDistribution()
         const newsFeed = distroData.getRSS()
         const newsHost = new URL(newsFeed).origin + '/'
-        $.ajax(
-            {
-                url: newsFeed,
-                success: (data) => {
-                    const items = $(data).find('item')
-                    const articles = []
-
-                    for(let i=0; i<items.length; i++){
-                    // JQuery Element
-                        const el = $(items[i])
-
-                        // Resolve date.
-                        const date = new Date(el.find('pubDate').text()).toLocaleDateString('en-US', {month: 'short', day: 'numeric', year: 'numeric', hour: 'numeric', minute: 'numeric'})
-
-                        // Resolve comments.
-                        let comments = el.find('slash\\:comments').text() || '0'
-                        comments = comments + ' Comment' + (comments === '1' ? '' : 's')
-
-                        // Fix relative links in content.
-                        let content = el.find('content\\:encoded').text()
-                        let regex = /src="(?!http:\/\/|https:\/\/)(.+?)"/g
-                        let matches
-                        while((matches = regex.exec(content))){
-                            content = content.replace(`"${matches[1]}"`, `"${newsHost + matches[1]}"`)
-                        }
-
-                        let link   = el.find('link').text()
-                        let title  = el.find('title').text()
-                        let author = el.find('dc\\:creator').text()
-
-                        // Generate article.
-                        articles.push(
-                            {
-                                link,
-                                title,
-                                date,
-                                author,
-                                content,
-                                comments,
-                                commentsLink: link + '#comments'
-                            }
-                        )
+        $.ajax({
+            url: newsFeed,
+            success: (data) => {
+                const items = $(data).find('item')
+                const articles = []
+
+                for(let i=0; i<items.length; i++){
+                // JQuery Element
+                    const el = $(items[i])
+
+                    // Resolve date.
+                    const date = new Date(el.find('pubDate').text()).toLocaleDateString('en-US', {month: 'short', day: 'numeric', year: 'numeric', hour: 'numeric', minute: 'numeric'})
+
+                    // Resolve comments.
+                    let comments = el.find('slash\\:comments').text() || '0'
+                    comments = comments + ' Comment' + (comments === '1' ? '' : 's')
+
+                    // Fix relative links in content.
+                    let content = el.find('content\\:encoded').text()
+                    let regex = /src="(?!http:\/\/|https:\/\/)(.+?)"/g
+                    let matches
+                    while((matches = regex.exec(content))){
+                        content = content.replace(`"${matches[1]}"`, `"${newsHost + matches[1]}"`)
                     }
-                    resolve({
-                        articles
-                    })
-                },
-                timeout: 2500
-            }
-        ).catch(err => {
+
+                    let link   = el.find('link').text()
+                    let title  = el.find('title').text()
+                    let author = el.find('dc\\:creator').text()
+
+                    // Generate article.
+                    articles.push(
+                        {
+                            link,
+                            title,
+                            date,
+                            author,
+                            content,
+                            comments,
+                            commentsLink: link + '#comments'
+                        }
+                    )
+                }
+                resolve({
+                    articles
+                })
+            },
+            timeout: 2500
+        }).catch(err => {
             resolve({
                 articles: null
             })

+ 0 - 1
app/assets/js/scripts/uicore.js

@@ -34,7 +34,6 @@ remote.getCurrentWebContents().on('devtools-opened', () => {
 // Disable zoom, needed for darwin.
 webFrame.setZoomLevel(0)
 webFrame.setVisualZoomLevelLimits(1, 1)
-webFrame.setLayoutZoomLevelLimits(0, 0)
 
 // Initialize auto updates in production environments.
 let updateCheckListener

+ 3 - 0
index.js

@@ -86,6 +86,9 @@ ipcMain.on('distributionIndexDone', (event, res) => {
 // https://electronjs.org/docs/tutorial/offscreen-rendering
 app.disableHardwareAcceleration()
 
+// https://github.com/electron/electron/issues/18397
+app.allowRendererProcessReuse = true
+
 // Keep a global reference of the window object, if you don't, the window will
 // be closed automatically when the JavaScript object is garbage collected.
 let win

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 300 - 395
package-lock.json


+ 1 - 1
package.json

@@ -41,7 +41,7 @@
   },
   "devDependencies": {
     "cross-env": "^7.0.2",
-    "electron": "^7.1.14",
+    "electron": "^8.1.1",
     "electron-builder": "^22.4.0",
     "eslint": "^6.8.0"
   },

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov