Browse Source

fix: mathjax timeout + external link icons

NGPixel 8 years ago
parent
commit
62ca6e55b3

+ 2 - 2
client/scss/components/markdown-content.scss

@@ -136,9 +136,9 @@
 			//align-items: center;
 			//align-items: center;
 
 
 			&:before {
 			&:before {
-				content: $icon-open;
+				content: '\ee70';
 				display: inline-block;
 				display: inline-block;
-				font-family: 'core-icons';
+				font-family: 'Nucleo Outline';
 				font-style: normal;
 				font-style: normal;
 				font-weight: normal;
 				font-weight: normal;
 				text-decoration: none;
 				text-decoration: none;

+ 3 - 3
fuse.js

@@ -114,9 +114,9 @@ globalTasks.then(() => {
     log: true
     log: true
   })
   })
 
 
-  // const bundleVendor = fuse.bundle('vendor').shim(SHIMS).instructions('~ index.js') // eslint-disable-line no-unused-vars
-  // const bundleApp = fuse.bundle('app').instructions('!> [index.js]')
-  const bundleApp = fuse.bundle('app').shim(SHIMS).instructions('> index.js')
+  const bundleVendor = fuse.bundle('vendor').shim(SHIMS).instructions('~ index.js') // eslint-disable-line no-unused-vars
+  const bundleApp = fuse.bundle('app').instructions('!> [index.js]')
+  // const bundleApp = fuse.bundle('app').shim(SHIMS).instructions('> index.js')
   const bundleSetup = fuse.bundle('configure').instructions('> configure.js')
   const bundleSetup = fuse.bundle('configure').instructions('> configure.js')
 
 
   switch (mode) {
   switch (mode) {

+ 0 - 2
package.json

@@ -149,14 +149,12 @@
     "jquery-sticky": "~1.0.4",
     "jquery-sticky": "~1.0.4",
     "lodash-cli": "~4.17.4",
     "lodash-cli": "~4.17.4",
     "lodash-es": "~4.17.4",
     "lodash-es": "~4.17.4",
-    "mathjax": "~2.7.1",
     "node-sass": "~4.5.3",
     "node-sass": "~4.5.3",
     "nodemon": "~1.11.0",
     "nodemon": "~1.11.0",
     "pug-lint": "~2.4.0",
     "pug-lint": "~2.4.0",
     "twemoji-awesome": "~1.0.6",
     "twemoji-awesome": "~1.0.6",
     "typescript": "~2.4.1",
     "typescript": "~2.4.1",
     "uglify-es": "~3.0.24",
     "uglify-es": "~3.0.24",
-    "uglify-js": "~3.0.24",
     "vee-validate": "~2.0.0-rc.6",
     "vee-validate": "~2.0.0-rc.6",
     "vue": "~2.3.4",
     "vue": "~2.3.4",
     "vue-clipboards": "~1.0.2",
     "vue-clipboards": "~1.0.2",

+ 6 - 3
server/libs/markdown.js

@@ -1,5 +1,7 @@
 'use strict'
 'use strict'
 
 
+/* global winston */
+
 const Promise = require('bluebird')
 const Promise = require('bluebird')
 const md = require('markdown-it')
 const md = require('markdown-it')
 const mdEmoji = require('markdown-it-emoji')
 const mdEmoji = require('markdown-it-emoji')
@@ -123,7 +125,6 @@ mathjax.config({
     }
     }
   }
   }
 })
 })
-mathjax.start()
 
 
 /**
 /**
  * Parse markdown content and build TOC tree
  * Parse markdown content and build TOC tree
@@ -331,12 +332,14 @@ const processMathjax = (content) => {
               format: mode.format,
               format: mode.format,
               speakText: false,
               speakText: false,
               svg: true,
               svg: true,
-              state: mathjaxState
+              state: mathjaxState,
+              timeout: 30 * 1000
             }, result => {
             }, result => {
               if (!result.errors) {
               if (!result.errors) {
                 resolve(result.svg)
                 resolve(result.svg)
               } else {
               } else {
-                reject(new Error(result.errors.join(', ')))
+                resolve(currentMatch[0])
+                winston.warn(result.errors.join(', '))
               }
               }
             })
             })
           })
           })

+ 1 - 1
server/views/auth/login.pug

@@ -18,7 +18,7 @@ html(data-logic='login')
     link(rel='manifest', href='/manifest.json')
     link(rel='manifest', href='/manifest.json')
 
 
     // JS / CSS
     // JS / CSS
-    //- script(type='text/javascript', src=appconfig.host + '/js/vendor.js')
+    script(type='text/javascript', src=appconfig.host + '/js/vendor.js')
     script(type='text/javascript', src=appconfig.host + '/js/app.js')
     script(type='text/javascript', src=appconfig.host + '/js/app.js')
 
 
   body
   body

+ 1 - 1
server/views/configure/index.pug

@@ -13,7 +13,7 @@ html(data-logic='configure')
     script(type='text/javascript').
     script(type='text/javascript').
       var appconfig = !{JSON.stringify(conf)};
       var appconfig = !{JSON.stringify(conf)};
       var runmode = !{JSON.stringify(runmode)};
       var runmode = !{JSON.stringify(runmode)};
-    //- script(type='text/javascript', src='/js/vendor.js')
+    script(type='text/javascript', src='/js/vendor.js')
     script(type='text/javascript', src='/js/configure.js')
     script(type='text/javascript', src='/js/configure.js')
 
 
   body
   body

+ 1 - 1
server/views/error-forbidden.pug

@@ -18,7 +18,7 @@ html(data-logic='error')
     link(rel='manifest', href=appconfig.host + '/manifest.json')
     link(rel='manifest', href=appconfig.host + '/manifest.json')
 
 
     // JS / CSS
     // JS / CSS
-    //- script(type='text/javascript', src=appconfig.host + '/js/vendor.js')
+    script(type='text/javascript', src=appconfig.host + '/js/vendor.js')
     script(type='text/javascript', src=appconfig.host + '/js/app.js')
     script(type='text/javascript', src=appconfig.host + '/js/app.js')
 
 
   body(class='is-forbidden')
   body(class='is-forbidden')

+ 1 - 1
server/views/error-notexist.pug

@@ -18,7 +18,7 @@ html(data-logic='error')
     link(rel='manifest', href=appconfig.host + '/manifest.json')
     link(rel='manifest', href=appconfig.host + '/manifest.json')
 
 
     // JS / CSS
     // JS / CSS
-    //- script(type='text/javascript', src=appconfig.host + '/js/vendor.js')
+    script(type='text/javascript', src=appconfig.host + '/js/vendor.js')
     script(type='text/javascript', src=appconfig.host + '/js/app.js')
     script(type='text/javascript', src=appconfig.host + '/js/app.js')
 
 
   body(class='is-notexist')
   body(class='is-notexist')

+ 1 - 1
server/views/error.pug

@@ -18,7 +18,7 @@ html(data-logic='error')
     link(rel='manifest', href=appconfig.host + '/manifest.json')
     link(rel='manifest', href=appconfig.host + '/manifest.json')
 
 
     // JS / CSS
     // JS / CSS
-    //- script(type='text/javascript', src=appconfig.host + '/js/vendor.js')
+    script(type='text/javascript', src=appconfig.host + '/js/vendor.js')
     script(type='text/javascript', src=appconfig.host + '/js/app.js')
     script(type='text/javascript', src=appconfig.host + '/js/app.js')
 
 
   body(class='is-error')
   body(class='is-error')

+ 1 - 1
server/views/layout.pug

@@ -23,7 +23,7 @@ html
       var siteRoot = '!{appconfig.host}';
       var siteRoot = '!{appconfig.host}';
 
 
     //- JS / CSS
     //- JS / CSS
-    //- script(type='text/javascript', src=appconfig.host + '/js/vendor.js')
+    script(type='text/javascript', src=appconfig.host + '/js/vendor.js')
     script(type='text/javascript', src=appconfig.host + '/js/app.js')
     script(type='text/javascript', src=appconfig.host + '/js/app.js')
 
 
     block head
     block head

+ 2 - 26
yarn.lock

@@ -4262,7 +4262,7 @@ mathjax-node@~1.1.0:
     jsdom "7.0 - 9.8"
     jsdom "7.0 - 9.8"
     mathjax "*"
     mathjax "*"
 
 
-mathjax@*, mathjax@~2.7.1:
+mathjax@*:
   version "2.7.1"
   version "2.7.1"
   resolved "https://registry.yarnpkg.com/mathjax/-/mathjax-2.7.1.tgz#c82d2f853b2f58f738e3355329adf0b2d8f8face"
   resolved "https://registry.yarnpkg.com/mathjax/-/mathjax-2.7.1.tgz#c82d2f853b2f58f738e3355329adf0b2d8f8face"
 
 
@@ -4443,24 +4443,7 @@ mongodb@2.2.27:
     mongodb-core "2.1.14"
     mongodb-core "2.1.14"
     readable-stream "2.2.7"
     readable-stream "2.2.7"
 
 
-mongoose@*:
-  version "4.10.8"
-  resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-4.10.8.tgz#31f44ed7884756f9fd9b7708ddcb3fcb4250f34e"
-  dependencies:
-    async "2.1.4"
-    bson "~1.0.4"
-    hooks-fixed "2.0.0"
-    kareem "1.4.1"
-    mongodb "2.2.27"
-    mpath "0.3.0"
-    mpromise "0.5.5"
-    mquery "2.3.1"
-    ms "2.0.0"
-    muri "1.2.1"
-    regexp-clone "0.0.1"
-    sliced "1.0.1"
-
-mongoose@^4.11.1:
+mongoose@*, mongoose@^4.11.1:
   version "4.11.1"
   version "4.11.1"
   resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-4.11.1.tgz#2560b6d89e744b05857d024cab8b316066716e3e"
   resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-4.11.1.tgz#2560b6d89e744b05857d024cab8b316066716e3e"
   dependencies:
   dependencies:
@@ -6681,13 +6664,6 @@ uglify-js@2.7.5, uglify-js@^2.6, uglify-js@^2.6.1:
     uglify-to-browserify "~1.0.0"
     uglify-to-browserify "~1.0.0"
     yargs "~3.10.0"
     yargs "~3.10.0"
 
 
-uglify-js@~3.0.24:
-  version "3.0.24"
-  resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.0.24.tgz#ee93400ad9857fb7a1671778db83f6a23f033121"
-  dependencies:
-    commander "~2.9.0"
-    source-map "~0.5.1"
-
 uglify-to-browserify@~1.0.0:
 uglify-to-browserify@~1.0.0:
   version "1.0.2"
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7"
   resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7"