Browse Source

优化qrcode、html代码美化

zxlie 8 years ago
parent
commit
0ebf6d9ea2

+ 1 - 1
chrome/manifest.json

@@ -1,6 +1,6 @@
 {
     "name": "WEB前端助手(FeHelper)",
-    "version": "10.0",
+    "version": "10.1",
     "manifest_version": 2,
 
     "default_locale": "zh_CN",

+ 1 - 1
chrome/online.manifest.json

@@ -1,6 +1,6 @@
 {
     "name": "WEB前端助手(FeHelper)",
-    "version": "10.0",
+    "version": "10.1",
     "manifest_version": 2,
 
     "default_locale": "zh_CN",

+ 4 - 1
chrome/static/js/codebeautify/codebeautify.js

@@ -28,18 +28,22 @@ var CodeBeautify = (function () {
             $('#jfContent').html(js);
         } else if (codeType == 'CSS') {
             var css = css_beautify($('#codeSource').val());
+            css = css.replace(/>/g, '&gt;').replace(/</g, '&lt;');
             css = '<pre class="brush: css;toolbar:true;">' + css + '</pre>';
             $('#jfContent').html(css);
         } else if (codeType == 'HTML') {
             var html = html_beautify($('#codeSource').val());
+            html = html.replace(/>/g, '&gt;').replace(/</g, '&lt;');
             html = '<pre class="brush: html;toolbar:false;">' + html + '</pre>';
             $('#jfContent').html(html);
         }  else if (codeType == 'XML') {
             var xml = vkbeautify.xml($('#codeSource').val());
+            xml = xml.replace(/>/g, '&gt;').replace(/</g, '&lt;');
             xml = '<pre class="brush: html;toolbar:false;">' + xml + '</pre>';
             $('#jfContent').html(xml);
         } else if (codeType == 'SQL') {
             var sql = vkbeautify.sql($('#codeSource').val(),4);
+            sql = sql.replace(/>/g, '&gt;').replace(/</g, '&lt;');
             sql = '<pre class="brush: sql;toolbar:false;">' + sql + '</pre>';
             $('#jfContent').html(sql);
         }
@@ -63,7 +67,6 @@ var CodeBeautify = (function () {
     var init = function () {
         // 在tab创建或者更新时候,监听事件,看看是否有参数传递过来
         chrome.runtime.onMessage.addListener(function (request, sender, callback) {
-            console.log(request);
             if (request.type == MSG_TYPE.TAB_CREATED_OR_UPDATED && request.event == 'codebeautify') {
                 if (request.content) {
                     document.getElementById('codeSource').value = (request.content);

+ 1 - 1
chrome/static/js/qrcode/fe-qrcode.js

@@ -40,7 +40,7 @@ baidu.qrcode = (function () {
             fill: foreground,
 
             // background color or image element, null for transparent background
-            background: null,
+            background: '#fff',
 
             // corner radius relative to module width: 0.0 .. 0.5
             radius: 0,