Przeglądaj źródła

fix new eslint issues caused by standard-js version upgrade

Artur Paikin 8 lat temu
rodzic
commit
d96a610f7f

+ 2 - 1
src/plugins/Tus10.js

@@ -163,7 +163,8 @@ module.exports = class Tus10 extends Plugin {
 
 
         res.json().then((data) => {
         res.json().then((data) => {
           // get the host domain
           // get the host domain
-          var regex = /^(?:https?:\/\/|\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^\/\n]+)/
+          // var regex = /^(?:https?:\/\/|\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^\/\n]+)/
+          var regex = /^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/
           var host = regex.exec(file.remote.host)[1]
           var host = regex.exec(file.remote.host)[1]
           var socketProtocol = location.protocol === 'https:' ? 'wss' : 'ws'
           var socketProtocol = location.protocol === 'https:' ? 'wss' : 'ws'
 
 

+ 2 - 1
src/uppy-base/src/plugins/Tus10.js

@@ -136,7 +136,8 @@ module.exports = class Tus10 extends EventEmitter {
         res.json()
         res.json()
         .then((data) => {
         .then((data) => {
           // get the host domain
           // get the host domain
-          var regex = /^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)/
+          // var regex = /^(?:https?:\/\/|\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^\/\n]+)/
+          var regex = /^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/
           var host = regex.exec(remoteHost)[1]
           var host = regex.exec(remoteHost)[1]
 
 
           var token = data.token
           var token = data.token

+ 3 - 3
src/uppy-base/src/plugins/Webcam.js

@@ -196,16 +196,16 @@ module.exports = class Webcam {
     // set default swfURL if not explicitly set
     // set default swfURL if not explicitly set
     if (!swfURL) {
     if (!swfURL) {
       // find our script tag, and use that base URL
       // find our script tag, and use that base URL
-      var base_url = ''
+      var baseUrl = ''
       var scpts = document.getElementsByTagName('script')
       var scpts = document.getElementsByTagName('script')
       for (var idx = 0, len = scpts.length; idx < len; idx++) {
       for (var idx = 0, len = scpts.length; idx < len; idx++) {
         var src = scpts[idx].getAttribute('src')
         var src = scpts[idx].getAttribute('src')
         if (src && src.match(/\/webcam(\.min)?\.js/)) {
         if (src && src.match(/\/webcam(\.min)?\.js/)) {
-          base_url = src.replace(/\/webcam(\.min)?\.js.*$/, '')
+          baseUrl = src.replace(/\/webcam(\.min)?\.js.*$/, '')
           idx = len
           idx = len
         }
         }
       }
       }
-      if (base_url) swfURL = base_url + '/webcam.swf'
+      if (baseUrl) swfURL = baseUrl + '/webcam.swf'
       else swfURL = 'webcam.swf'
       else swfURL = 'webcam.swf'
     }
     }
 
 

+ 13 - 7
website/themes/uppy/source/js/common.js

@@ -119,13 +119,19 @@
       var isAPI = document.querySelector('.Content').classList.contains('api')
       var isAPI = document.querySelector('.Content').classList.contains('api')
       if (currentPageAnchor || isAPI) {
       if (currentPageAnchor || isAPI) {
         var sectionContainer
         var sectionContainer
-        if (false && isAPI) {
-          sectionContainer = document.querySelector('.menu-root')
-        } else {
-          sectionContainer = document.createElement('ul')
-          sectionContainer.className = 'menu-sub'
-          currentPageAnchor.parentNode.appendChild(sectionContainer)
-        }
+
+        // if (false && isAPI) {
+        //   sectionContainer = document.querySelector('.menu-root')
+        // } else {
+        //   sectionContainer = document.createElement('ul')
+        //   sectionContainer.className = 'menu-sub'
+        //   currentPageAnchor.parentNode.appendChild(sectionContainer)
+        // }
+
+        sectionContainer = document.createElement('ul')
+        sectionContainer.className = 'menu-sub'
+        currentPageAnchor.parentNode.appendChild(sectionContainer)
+
         var h2s = content.querySelectorAll('h2')
         var h2s = content.querySelectorAll('h2')
         if (h2s.length) {
         if (h2s.length) {
           each.call(h2s, function (h) {
           each.call(h2s, function (h) {