Edit D:\AVA\AVAStandard\AVA.ResourcesPlatform.WebUI\CSS\zh-CN\NewtonTheme\assets\wcweb\crossbrowers.js
// by ?????? https://github.com/RubyLouvre/mass-Framework/blob/master/browers/lang.js var DONT_ENUM = "propertyIsEnumerable, isPrototypeOf, hasOwnProperty, toLocaleString, toString, valueOf, constructor".split(","), hasOwn = ({}).hasOwnProperty; for (var i in { toString: 1 }){ DONT_ENUM =false; } Object.keys = Object.keys || function(obj){ var result =[]; for(var key in obj) if(hasOwn.call(obj, key)){ result.push(key) } if(DONT_ENUM && obj){ for(var i = 0; key = DONT_ENUM[i++];){ if(hasOwn.call(obj, key)){ reslut.push(key); } } } return result; }; function PostMan(config) { var win = config.target; if (typeof win == "string") { win = $(win).get(0); if (win && win.tagName === "IFRAME") { win = win.contentWindow; } } else { win = parent; } this.win = win; this._callbacks = []; var mode = document.documentMode; if (mode === 8 || mode === 9) { this.hack = true; } if (typeof config.onmessage === "function") { this.receive(config.onmessage); } this.init(); }; PostMan.prototype = { init: function () { var me = this; me._callback = function (event) { if (event.originalEvent.source != me.win) { return; } var data = event.originalEvent.data; //event.originalEvent.data for jquery when event is postMessage if (typeof data === "string" && data.indexOf("__hack__") === 0) { data = data.replace("__hack__", ""); data = JSON.parse(data, function (k, v) { if (v.indexOf && v.indexOf('function') > -1) { return eval("(function(){return " + v + "})()"); } return v; }); } for (var i = 0, fn; fn = me._callbacks[i++];) { fn.call(me, data); } } //$(window).on("message", me._callback); $(window).bind( "message", me._callback); }, receive: function (fn) { fn.win = this.win; this._callbacks.push(fn); }, send: function (data) { var str = data, hack = false; if (!this.hack && typeof data == "object") { for (var i in data) { if (data.hasOwnProperty(i) && typeof data[i] === "function") { hack = true break; } } } if (hack || (this.hack && typeof str !== "string")) { str = JSON.stringify(str, function (k, v) { if (typeof v === 'function') { return v + ''; } return v; }); data = "__hack__" + str; } console.log("send message ", data); this.win.postMessage(data, '*');//* targetOrgin URI }, destroy: function () { if (this._callback) { $.unbind(this.win, "message", this._callback); } if (document.detachEvent && this._dataavailable) { document.detachEvent('ondataavailable', this._dataavailable); } for (var p in this) { if (this.hasOwnProperty(p)) { delete this[p]; } } navigator.messages = void 0; } }; if (!"1"[0]) {// ie6 ,ie7 PostMan.prototype.init = function () { var isSameOrigin = false; try { isSameOrigin = !!this.win.locaction.href; } catch (e) { } if (isSameOrigin) { this.initForSameOrigin(); } else { this.initForCrossDomain(); } }; PostMan.prototype.initForCrossDomain = function () { var fns = navigator.messages = navigator.messages || []; var me = this; for (var i = 0, fn; fn = this._callbacks[i++];) { fns.push(fn); } this.receive = function (fn) { fn.win = this.win; fns.push(fn); }; this.send = function (data) { setTimeout(function () { for (var i = 0, fn; fn = fns[i++];) { if (fn.win != me.win) { fn.call(me.data); } } }); }; }; PostMan.prototype.initForSameOrigin = function () { var me = this; this.send = function (data) { setTimeout(function () { var event = me.win.document.createEventObject(); event.eventType = 'message'; event.eventSource = window; event.eventData = data; me.win.document.fireEvent('ondataavailable', event); }); }; this._dataavailable = function (event) { if (event.eventType !== 'message' || event.eventSource != me.win) { return; } for (var i = 0, fn; fn = me._callbacks[i++];) { fn.call(me, event.eventData); } }; document.attachEvent('ondataavailable', this._dataavailable); } }; // use es5-shim Function.prototype.bind in ie8 work! // // Tell IE9 to use its built-in console // if (Function.prototype.bind && console && typeof console.log == "object") { // ["log","info","warn","error","assert","dir","clear","profile","profileEnd"] // .forEach(function (method) { // console[method] = this.call(console[method], console); // }, Function.prototype.bind); // } // log() -- The complete, cross-browser (we don't judge!) console.log wrapper for his or her logging pleasure if (!window.log) { window.log = function () { log.history = log.history || []; // store logs to an array for reference log.history.push(arguments); // Modern browsers if (typeof console != 'undefined' && typeof console.log == 'function') { // Opera 11 if (window.opera) { var i = 0; while (i < arguments.length) { console.log("Item " + (i+1) + ": " + arguments[i]); i++; } } // All other modern browsers else if ((Array.prototype.slice.call(arguments)).length == 1 && typeof Array.prototype.slice.call(arguments)[0] == 'string') { console.log( (Array.prototype.slice.call(arguments)).toString() ); } else { console.log( Array.prototype.slice.call(arguments) ); } } // IE8 else if (!Function.prototype.bind && typeof console != 'undefined' && typeof console.log == 'object') { Function.prototype.call.call(console.log, console, Array.prototype.slice.call(arguments)); } // IE7 and lower, and other old browsers else { // Inject Firebug lite if (!document.getElementById('firebug-lite')) { // Include the script var script = document.createElement('script'); script.type = "text/javascript"; script.id = 'firebug-lite'; // If you run the script locally, point to /path/to/firebug-lite/build/firebug-lite.js script.src = 'https://getfirebug.com/firebug-lite.js'; // If you want to expand the console window by default, uncomment this line //document.getElementsByTagName('HTML')[0].setAttribute('debug','true'); document.getElementsByTagName('HEAD')[0].appendChild(script); setTimeout(function () { log( Array.prototype.slice.call(arguments) ); }, 2000); } else { // FBL was included but it hasn't finished loading yet, so try again momentarily setTimeout(function () { log( Array.prototype.slice.call(arguments) ); }, 500); } } } } var tid = null; window.flashq = function flashq(str, status) { var delay = 1000; // single tid = null; // var temp = $(".flash_messages"); //$(".flash_messages").children("p").html(str); // mutiply instant var temp = $(".flash_messages").last().clone(true); $(temp).children().filter("p").html(str); $(".flash_messages").last().before( $(temp) ); switch (status) { case "error": $(temp).addClass("alert-danger"); break; case "info": $(temp).addClass("alert-info"); delay = 300; break; case "error": $(temp).addClass("alert-error"); break; case "success": // $(temp).addClass("alert-success"); break; default: return; } $(temp).fadeIn(300); tid = setTimeout(function () { tid = null; $(temp).remove(); }, delay); } $(function(){ $("img").lazyload({ threshold: 100, event: "updateImg", effect: 'fadeIn', failure_limit: 999 }); $(document).on("domChange", function (e) { $("img").lazyload({ threshold: 100, event: "updateImg", effect: 'fadeIn', failure_limit: 999 });; }) $(document).on("click.tab.data-api", function (e) { $("img").trigger("updateImg"); }) $(window).on("scroll", function () { $("img").trigger("updateImg"); }) $(document).on("shown","#sharedModal",function(e){ $(document).trigger("domChange"); }) }) $(function () { if ((/MSIE/g).test(window.navigator.userAgent)) { if (document.documentElement.clientWidth < 1200) { // IE ignores the scale factor; i.e. always pretends it?? 1. Buggy $('meta[name=viewport]').attr("content", "width=1200,user-scalable=yes"); // IE: screen.width > document.documentElement.clientWidth $("body").width(1250); } } else { if (document.documentElement.clientWidth < 1200) { // Chrome do not reconize target-desitydpi but android does. $('meta[name=viewport]').attr("content", "width=1200, initial-scale=0.8,target-densitydpi=high-dpi,user-scalable=yes"); } } }) ;
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de