Edit D:\xinhaisoft\crisis_new\Scripts\jquery.zxxbox.js
/* ! * zxxbox.js * ? 2010-2011 by zhangxinxu http://www.zhangxinxu.com/ * v1.0 2010-03-20 * v1.1 2010-04-03 #?????? * v1.2 2010-07-12 #?????????????????????????? * v2.0 2010-08-01 #???js???????????????? * #?????????????????? * #?????????????????????????????ug???????????????? * v3.0 2010-09-05 #?????????????????? #???????????????????? #???????????????????????? #???Ajax??? #??????CSS3????????????UI #????????????????? * v3.1 2010-11-25 #????????$.noop??? * v3.2 2010-11-26 #?????????????????1.3??? * v3.3 2010-11-30 #??????????????? * v3.4 2011-01-21 #??????????????E???????????????????????ug * v3.5 2011-03-03 #??????api???protect * v3.6 2011-04-06 * v3.7 2012-06-05 #???ajax????????tml?????avaScript????????????bug * v3.8 2012-06-12 #???title???shut?????jax ??????????????? * v4.0 2012-06-13 #???CSS???????? */ (function ($) { // ????????SS??? var LG = 'linear-gradient(top, #fafafa, #eee)', CSS = '<style>' + '#zxxBlank{position:absolute;z-index:2000;left:0;top:0;width:100%;height:0;background:black;}' + '.wrap_out{padding:5px;background:#eee;box-shadow:0 0 6px rgba(0,0,0,.5);position:absolute;z-index:2000;left:-9999px;}' + '.wrap_in{background:#fafafa;border:1px solid #ccc;}' + '.wrap_bar{border-bottom:1px solid #ddd;background:#f0f0f0;background:-moz-' + LG + ';background:-o-' + LG + ';background:-webkit-' + LG + ';background:' + LG + ';}' + '.wrap_title{line-height:24px;padding-left:10px;margin:0;font-weight:normal;font-size:1em;}' + '.wrap_close{position:relative;}' + '.wrap_close a{width:20px;height:20px;text-align:center;margin-top:-22px;color:#34538b;font:bold 1em/20px Tahoma;text-decoration:none;cursor:pointer;position:absolute;right:6px;}' + '.wrap_close a:hover{text-decoration:none;color:#f30;}' + '.wrap_body{background:white;}' + '.wrap_remind{padding:30px 40px;}' + '.wrap_remind p{margin:10px 0 0; text-indent:0;}' + '.submit_btn, .cancel_btn{display:inline-block;padding:3px 12px 1.99px;line-height:16px;border:1px solid;cursor:pointer;overflow:visible;}' + '.submit_btn{background:#486aaa;border-color:#a0b3d6 #34538b #34538b #a0b3d6;color:#f3f3f3;}' + '.submit_btn:hover{text-decoration:none;color:#fff;}' + '.cancel_btn{background:#eee;border-color:#f0f0f0 #bbb #bbb #f0f0f0;color:#333;}' + '</style>' $('head').append(CSS) var WRAP = '<div id="zxxBlank" onselectstart="return false;"></div>' + '<div class="wrap_out" id="wrapOut">' + '<div class="wrap_in" id="wrapIn">' + '<div id="wrapBar" class="wrap_bar" onselectstart="return false;">' + '<h4 id="wrapTitle" class="wrap_title"></h4>' + '<div class="wrap_close"><a href="javasctipt:" id="wrapClose" title="???"></a></div>' + '</div>' + '<div class="wrap_body" id="wrapBody"></div>' + '</div>' + '</div>' $.fn.zxxbox = function (options) { options = options || {} var s = $.extend({}, zxxboxDefault, options) return this.each(function () { var node = this.nodeName.toLowerCase() if (node === 'a' && s.ajaxTagA) { $(this).click(function () { var href = $.trim($(this).attr('href')) if (href && href.indexOf('javascript:') !== 0) { if (href.indexOf('#') === 0) { $.zxxbox($(href), options) } else { // ?????? $.zxxbox.loading() var myImg = new Image(), element myImg.onload = function () { var w = myImg.width, h = myImg.height if (w > 0) { var element = $('<img src="' + href + '" width="' + w + '" height="' + h + '" />') options.protect = false // ???????????????????????????????100??????????????????? var maxw = $(window).width() - 100 var maxh = $(window).height() - 100 if (w > maxw && h < maxh) { element.width(maxw) } else if (w < maxw && h > maxh) { element.height(maxh) } else if (w > maxw && h > maxh) { if ((w - maxw) / maxw > (h - maxh) / maxh) { element.width(maxw) } else { element.height(maxh) } } // ??????????? $.zxxbox(element, options) } } myImg.onerror = function () { // ???????????? $.zxxbox.ajax(href, {}, options) } myImg.src = href } } return false }) } else { $.zxxbox($(this), options) } }) } $.zxxbox = function (elements, options) { if (!elements) { return } var s = $.extend({}, zxxboxDefault, options || {}) // ???????? var eleOut = $('#wrapOut'), eleBlank = $('#zxxBlank') if (eleOut.length) { eleOut.show() eleBlank[s.bg ? 'show' : 'hide']() } else { $('body').append(WRAP) } if (typeof (elements) === 'object') { elements.show() } else { elements = $(elements) } // ?????????? $.o = { s: s, ele: elements, bg: eleBlank.length ? eleBlank : $('#zxxBlank'), out: eleOut.length ? eleOut : $('#wrapOut'), tit: $('#wrapTitle'), bar: $('#wrapBar'), clo: $('#wrapClose'), bd: $('#wrapBody') } // ???????????? $.o.tit.html(s.title) $.o.clo.html(s.shut) // ?????? $.o.bd.empty().append(elements) if ($.isFunction(s.onshow)) { s.onshow() } // ??? $.zxxbox.setSize() // ??? $.zxxbox.setPosition() if (s.fix) { $.zxxbox.setFixed() } if (s.drag) { $.zxxbox.drag() } else { $(window).resize(function () { $.zxxbox.setPosition() }) } if (!s.bar) { $.zxxbox.barHide() } else { $.zxxbox.barShow() } if (!s.bg) { $.zxxbox.bgHide() } else { $.zxxbox.bgShow() } if (!s.btnclose) { $.zxxbox.closeBtnHide() } else { $.o.clo.click(function () { $.zxxbox.hide() return false }) } if (s.bgclose) { $.zxxbox.bgClickable() } if (s.delay > 0) { setTimeout($.zxxbox.hide, s.delay) } } $.extend($.zxxbox, { setSize: function () { if (!$.o.bd.length || !$.o.ele.length || !$.o.bd.length) { return } // ??????????? $.o.out.css({ 'width': $.o.s.width, 'height:': $.o.s.height }) return $.o.out }, setPosition: function (flag) { flag = flag || false if (!$.o.bg.length || !$.o.ele.length || !$.o.out.length) { return } var w = $(window).width(), h = $(window).height(), st = $(window).scrollTop(), ph = $('body').height() if (ph < h) { ph = h } $.o.bg.width(w).height(ph).css('opacity', $.o.s.opacity) // ??????????? // ????????????????? var xh = $.o.out.outerHeight(), xw = $.o.out.outerWidth() var t = st + (h - xh) / 2, l = (w - xw) / 2 if ($.o.s.fix && window.XMLHttpRequest) { t = (h - xh) / 2 } if (flag === true) { $.o.out.animate({ top: t, left: l }) } else { $.o.out.css({ top: t, left: l, zIndex: $.o.s.index }) } return $.o.out }, // ??? setFixed: function () { if (!$.o.out || !$.o.out.length) { return } if (window.XMLHttpRequest) { $.zxxbox.setPosition().css({ position: 'fixed' }) } else { $(window).scroll(function () { $.zxxbox.setPosition() }) } return $.o.out }, // ???????? bgClickable: function () { if ($.o.bg && $.o.bg.length) { $.o.bg.click(function () { $.zxxbox.hide() }) } }, // ?????? bgHide: function () { if ($.o.bg && $.o.bg.length) { $.o.bg.hide() } }, // ???????? bgShow: function () { if ($.o.bg && $.o.bg.length) { $.o.bg.show() } else { $('<div id="zxxBlank"></div>').prependTo('body') } }, // ???????? barHide: function () { if ($.o.bar && $.o.bar.length) { $.o.bar.hide() } }, // ???????? barShow: function () { if ($.o.bar && $.o.bar.length) { $.o.bar.show() } }, // ????????? closeBtnHide: function () { if ($.o.clo && $.o.clo.length) { $.o.clo.hide() } }, // ?????? hide: function () { if ($.o.ele && $.o.out.length && $.o.out.css('display') !== 'none') { $.o.out.fadeOut('fast', function () { if ($.o.s.protect && (!$.o.ele.hasClass('wrap_remind') || $.o.ele.attr('id'))) { $.o.ele.hide().appendTo($('body')) } $(this).remove() if ($.isFunction($.o.s.onclose)) { $.o.s.onclose() } }) if ($.o.bg.length) { $.o.bg.fadeOut('fast', function () { $(this).remove() }) } } return false }, // ??? drag: function () { if (!$.o.out.length || !$.o.bar.length) { $(document).unbind('mouseover').unbind('mouseup') return } var bar = $.o.bar, out = $.o.out var drag = false var currentX = 0, currentY = 0, posX = out.css('left'), posY = out.css('top') bar.mousedown(function (e) { drag = true currentX = e.pageX currentY = e.pageY }).css('cursor', 'move') $(document).mousemove(function (e) { if (drag) { var nowX = e.pageX, nowY = e.pageY var disX = nowX - currentX, disY = nowY - currentY out.css('left', parseInt(posX) + disX).css('top', parseInt(posY) + disY) } }) $(document).mouseup(function () { drag = false posX = out.css('left') posY = out.css('top') }) }, // ??? loading: function () { var element = $('<div class="wrap_remind">?????...</div>') $.zxxbox(element, { bar: false }) }, // ask?????? ask: function (message, sureCall, cancelCall, options) { var element = $('<div class="wrap_remind">' + message + '<p><button id="zxxSureBtn" class="submit_btn">???</button> <button id="zxxCancelBtn" class="cancel_btn">???</button></p></div>') $.zxxbox(element, options) // ?????? $('#zxxSureBtn').click(function () { if ($.isFunction(sureCall)) { sureCall.call(this) } }) $('#zxxCancelBtn').click(function () { if (cancelCall && $.isFunction(cancelCall)) { cancelCall.call(this) } $.zxxbox.hide() }) }, // remind?????? remind: function (message, callback, options) { var element = $('<div class="wrap_remind">' + message + '<p><button id="zxxSubmitBtn" class="submit_btn">???</button</p></div>') $.zxxbox(element, options) $('#zxxSubmitBtn').click(function () { // ?????? if (callback && $.isFunction(callback)) { callback.call(this) } $.zxxbox.hide() }) }, // uri Ajax??? ajax: function (uri, params, options) { if (uri) { $.zxxbox.loading() options = options || {} options.protect = false $.ajax({ url: uri, data: params || {}, success: function (html, other) { $.zxxbox(html, options) }, error: function () { $.zxxbox.remind('?????????????') } }) } } }) var zxxboxDefault = { title: '', // ?????????????????? shut: '?', index: 2000, opacity: 0.5, width: 'auto', height: 'auto', bar: true, // ??????????? bg: true, // ?????????????? btnclose: true, // ???????????? fix: false, // ????????????????? bgclose: false, // ?????????????????????? drag: true, // ????????????????????? ajaxTagA: true, // ???a??????Ajax??? protect: 'auto', // ??????????? onshow: $.noop, // ?????????????? onclose: $.noop, // ?????????????? delay: 0 // ???????????????, 0????????? } })(jQuery) // ?????(QQ33080907)??? $(function () { 'use strict' // ?????? $('a.zxxbox').zxxbox({ bgclose: true, fix: true, btnclose: false }) // ???iframe????????????data-winsize="[650,300]"?????????title='xxx'??? $('a.win').on('click', function () { // console.log(1); var winsize = $(this).data('winsize') var title = $(this).attr('title') if (winsize === undefined) { winsize = [750, 400] } if (title === undefined) { title = $(this).text() || ' ' } $.zxxbox('<iframe id="zxxwin" frameborder="0" width="' + winsize[0] + '" height="' + winsize[1] + '" src="' + $(this).attr('href') + '"></iframe>', { title: title, fix: true, bgclose: true, onclose: function () { $('#zxxwin').remove() } }) return false }) })
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de