Bläddra i källkod

增加并优化配置项

zxlie 7 år sedan
förälder
incheckning
5907364f26
6 ändrade filer med 46 tillägg och 24 borttagningar
  1. 28 18
      apps/background/index.js
  2. 6 0
      apps/json-diff/index.css
  3. 1 1
      apps/manifest.json
  4. 0 0
      apps/options/index.html
  5. 2 1
      apps/options/settings.js
  6. 9 4
      apps/popup/index.css

+ 28 - 18
apps/background/index.js

@@ -159,24 +159,34 @@ var BgPageInstance = (function () {
      */
     let _openFileAndRun = function (tab, file, txt) {
         chrome.tabs.query({windowId: chrome.windows.WINDOW_ID_CURRENT}, function (tabs) {
-            let isOpened = false;
-            let tabId;
-            let reg = new RegExp("^chrome.*/" + file + "/index.html$", "i");
-            for (let i = 0, len = tabs.length; i < len; i++) {
-                if (reg.test(tabs[i].url)) {
-                    isOpened = true;
-                    tabId = tabs[i].id;
-                    break;
+
+            Settings.getOptsFromBgPage((opts) => {
+                let isOpened = false;
+                let tabId;
+
+                // 允许在新窗口打开
+                if (opts['FORBID_OPEN_IN_NEW_TAB']) {
+                    let reg = new RegExp("^chrome.*/" + file + "/index.html$", "i");
+                    for (let i = 0, len = tabs.length; i < len; i++) {
+                        if (reg.test(tabs[i].url)) {
+                            isOpened = true;
+                            tabId = tabs[i].id;
+                            break;
+                        }
+                    }
                 }
-            }
-            if (!isOpened) {
-                chrome.tabs.create({
-                    url: '' + file + '/index.html',
-                    active: true
-                }, _tabUpdatedCallback(file, txt));
-            } else {
-                chrome.tabs.update(tabId, {highlighted: true}, _tabUpdatedCallback(file, txt));
-            }
+
+                if (!isOpened) {
+                    chrome.tabs.create({
+                        url: '' + file + '/index.html',
+                        active: true
+                    }, _tabUpdatedCallback(file, txt));
+                } else {
+                    chrome.tabs.update(tabId, {highlighted: true}, _tabUpdatedCallback(file, txt));
+                }
+
+            });
+
         });
     };
 
@@ -581,7 +591,7 @@ var BgPageInstance = (function () {
                     Settings.getOptsFromBgPage(opts => {
                         opts.JS_CSS_PAGE_BEAUTIFY && chrome.tabs.sendMessage(tab.id, {
                             type: MSG_TYPE.JS_CSS_PAGE_BEAUTIFY,
-                            content:fileType[0]
+                            content: fileType[0]
                         });
                     });
                 }

+ 6 - 0
apps/json-diff/index.css

@@ -24,6 +24,12 @@ body {
 .wp-json .panel-body {
     padding:15px 0;
 }
+.wp-json .CodeMirror {
+    height: auto;
+}
+.wp-json .CodeMirror-scroll {
+    min-height: 550px;
+}
 
 .box-wrapper-left {
     height: 100%;

+ 1 - 1
apps/manifest.json

@@ -1,6 +1,6 @@
 {
   "name": "WEB前端助手(FeHelper)",
-  "version": "2018.07.1010",
+  "version": "2018.07.1017",
   "manifest_version": 2,
   "default_locale": "zh_CN",
   "description": "FE助手:包括JSON格式化、二维码生成与解码、信息编解码、代码压缩、美化、页面取色、Markdown与HTML互转、网页滚动截屏、正则表达式、时间转换工具、编码规范检测、页面性能检测、Ajax接口调试、密码生成器、JSON比对工具",

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
apps/options/index.html


+ 2 - 1
apps/options/settings.js

@@ -26,7 +26,8 @@ module.exports = (() => {
         'JS_CSS_PAGE_BEAUTIFY',
         'HTML_TO_MARKDOWN',
         'PAGE_CAPTURE',
-        'RANDOM_PASSWORD'
+        'RANDOM_PASSWORD',
+        'FORBID_OPEN_IN_NEW_TAB'
     ];
 
     /**

+ 9 - 4
apps/popup/index.css

@@ -158,7 +158,7 @@ ul.fe-function-list li i {
 .fe-feedback {
     font-size: 12px;
     border-top: 1px dotted #ddd;
-    padding: 5px 10px 5px 10px;
+    padding: 5px 15px 5px 15px;
     line-height: 20px;
     color: #888;
 }
@@ -170,7 +170,7 @@ ul.fe-function-list li i {
 }
 
 .fe-feedback a:hover {
-    color: #a00;
+    color: #c00;
 }
 
 svg:not(:root) {
@@ -184,7 +184,12 @@ svg:not(:root) {
 }
 
 .fe-feedback img {
-    opacity: 0.7;
+    opacity: 0.6;
+    position: relative;
+    top: 1px;
+}
+.fe-feedback a:hover img {
+    opacity: 1.0;
 }
 
 .fe-feedback .x-settings {
@@ -193,6 +198,6 @@ svg:not(:root) {
 }
 
 .fe-feedback .x-settings:hover {
-    color: #a00;
+    color: #c00;
 }
 

Vissa filer visades inte eftersom för många filer har ändrats