浏览代码

eval in plugin code causes browser-policy warning #704

Robin Herbots 11 年之前
父节点
当前提交
579f230242
共有 5 个文件被更改,包括 13 次插入12 次删除
  1. 3 3
      Gruntfile.js
  2. 2 1
      dist/inputmask/jquery.inputmask.js
  3. 2 1
      dist/jquery.inputmask.bundle.js
  4. 3 2
      dist/jquery.inputmask.bundle.min.js
  5. 3 5
      js/jquery.inputmask.js

+ 3 - 3
Gruntfile.js

@@ -18,7 +18,7 @@ module.exports = function (grunt) {
             uglifyConfig[dstFile] = {
                 dest: 'dist/inputmask/' + dstFile,
                 src: "build/" + dstFile,
-                options: { banner: createBanner(dstFile), beautify: true, mangle: false }
+                options: { banner: createBanner(dstFile), beautify: true, mangle: false, preserveComments: "some" }
             };
         }
 
@@ -28,13 +28,13 @@ module.exports = function (grunt) {
             files: {
                 'dist/<%= pkg.name %>.bundle.js': srcFiles
             },
-            options: { banner: createBanner('<%= pkg.name %>.bundle'), beautify: true, mangle: false }
+            options: { banner: createBanner('<%= pkg.name %>.bundle'), beautify: true, mangle: false, preserveComments: "some" }
         }
         uglifyConfig["inputmaskbundlemin"] = {
             files: {
                 'dist/<%= pkg.name %>.bundle.min.js': srcFiles
             },
-            options: { banner: createBanner('<%= pkg.name %>.bundle') }
+            options: { banner: createBanner('<%= pkg.name %>.bundle'), preserveComments: "some" }
         }
         return uglifyConfig;
     }

文件差异内容过多而无法显示
+ 2 - 1
dist/inputmask/jquery.inputmask.js


文件差异内容过多而无法显示
+ 2 - 1
dist/jquery.inputmask.bundle.js


文件差异内容过多而无法显示
+ 3 - 2
dist/jquery.inputmask.bundle.min.js


+ 3 - 5
js/jquery.inputmask.js

@@ -1,5 +1,5 @@
 /*
-* @license Input Mask plugin for jquery
+* Input Mask plugin for jquery
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
@@ -307,9 +307,7 @@
             return ms;
         }
 
-        var msie1x = typeof ScriptEngineMajorVersion === "function"
-                ? ScriptEngineMajorVersion() //IE11 detection
-                : new Function("/*@cc_on return @_jscript_version; @*/")() >= 10, //conditional compilation from mickeysoft trick
+        var msie1x = typeof ScriptEngineMajorVersion === "function" ? ScriptEngineMajorVersion() >= 10 : /*@cc_on (@_jscript_version >= 10) ||@*/false, //IEx detection
             ua = navigator.userAgent,
             iphone = ua.match(new RegExp("iphone", "i")) !== null,
             android = ua.match(new RegExp("android.*safari.*", "i")) !== null,
@@ -317,7 +315,7 @@
             androidfirefox = ua.match(new RegExp("android.*firefox.*", "i")) !== null,
             kindle = /Kindle/i.test(ua) || /Silk/i.test(ua) || /KFTT/i.test(ua) || /KFOT/i.test(ua) || /KFJWA/i.test(ua) || /KFJWI/i.test(ua) || /KFSOWI/i.test(ua) || /KFTHWA/i.test(ua) || /KFTHWI/i.test(ua) || /KFAPWA/i.test(ua) || /KFAPWI/i.test(ua),
             PasteEventType = isInputEventSupported('paste') ? 'paste' : isInputEventSupported('input') ? 'input' : "propertychange";
-
+			
         //if (androidchrome) {
         //    var browser = navigator.userAgent.match(new RegExp("chrome.*", "i")),
         //        version = parseInt(new RegExp(/[0-9]+/).exec(browser));