Merge pull request #34 from kasimi/fix-jquery-selector

Fix jquery selector
This commit is contained in:
dmzx committed 2015-12-15 23:03:14 +01:00
commit 940c4d6c22
2 files changed
+5 -5

No files matched your search

+4 -4
View File
@@ -145,7 +145,7 @@ jQuery(function($) {
mChat.interval = setInterval(mChat.refresh, mChat.refreshTime);
}
$("#mChatOkIMG").show();
$("#mChatLoadIMG, #mChatErrorIMG, #mChatPauseIMG").hide();
$("#mChatLoadIMG,#mChatErrorIMG,#mChatPauseIMG").hide();
$("#mChatRefreshText").html(mChat.refreshYes);
$("#mChatMessage").val("").focus();
} else {
@@ -350,7 +350,7 @@ jQuery(function($) {
},
dataType: "html",
beforeSend: function() {
$("#mChatOkIMG, #mChatErrorIMG, #mChatPauseIMG").hide();
$("#mChatOkIMG,#mChatErrorIMG,#mChatPauseIMG").hide();
$("#mChatLoadIMG").show();
},
success: function(html) {
@@ -369,13 +369,13 @@ jQuery(function($) {
mChat.notice();
}
setTimeout(function() {
$("#mChatLoadIMG, #mChatErrorIMG, #mChatPauseIMG").hide();
$("#mChatLoadIMG,#mChatErrorIMG,#mChatPauseIMG").hide();
$("#mChatOkIMG").show();
$("#mChatRefreshText").html(mChat.refreshYes);
}, 500);
},
error: function() {
$("#mChatLoadIMG, #mChatOkIMG, #mChatPauseIMG, #mChatRefreshTextNo, #mChatPauseIMG,").hide();
$("#mChatLoadIMG,#mChatOkIMG,#mChatPauseIMG,#mChatRefreshTextNo").hide();
$("#mChatErrorIMG").show();
mChat.sound(mChat.forumRoot + "ext/dmzx/mchat/sounds/error.swf");
},
+1 -1
View File
@@ -22,4 +22,4 @@
interval:700
});
**/
jQuery(function(t){function e(e,a,s){e='<span style="font-weight:bold; font-size:1.2em;">'+e+"</span>";var o={confirm:!1,verify:!1,input:!1,textarea:!1,animate:!1,textOk:"Ok",textCancel:"Cancel",textYes:"Yes",textNo:"No",position:"center"};if(a)for(var m in o)"undefined"==typeof a[m]&&(a[m]=o[m]);var n=t(document).height(),h=t(document).width(),i=t('<div class="appriseOuter"></div>'),r=t('<div class="appriseOverlay" id="aOverlay"></div>'),l=t('<div class="appriseInner"></div>'),u=t('<div class="aButtons"></div>'),c=300;if(r.css({height:n,width:h}).appendTo("body").fadeIn(100,function(){t(this).css("filter","alpha(opacity=70)")}),i.prependTo("body"),l.append(e).appendTo(i),a&&(a.input&&("string"==typeof a.input?l.append('<div class="aInput"><input type="text" class="aTextbox" t="aTextbox" value="'+a.input+'" /></div>'):l.append('<div class="aInput"><input type="text" class="aTextbox" t="aTextbox" /></div>'),t(".aTextbox").focus()),"string"==typeof a.textarea&&(l.append('<div class="aInput"><textarea name="message" class="aEdit" style="height: 9em;" rows="5" cols="180">'+a.textarea+"</textarea></div>"),t(".aEdit").focus())),l.append(u),a?a.confirm||a.input?(u.append('<button value="ok">'+a.textOk+"</button>"),u.append('<button value="cancel">'+a.textCancel+"</button>")):a.verify?(u.append('<button value="ok">'+a.textYes+"</button>"),u.append('<button value="cancel">'+a.textNo+"</button>")):u.append('<button value="ok">'+a.textOk+"</button>"):u.append('<button value="ok">Ok</button>'),i.css("left",(t(window).width()-t(".appriseOuter").width())/2+t(window).scrollLeft()+"px"),a)if(a.position&&"center"===a.position&&(c=(n-i.height())/2),a.animate){var C=a.animate;isNaN(C)&&(C=400),i.css("top","-200px").show().animate({top:c},C)}else i.css("top",c).fadeIn(200);else i.css("top",c).fadeIn(200);t(document).keydown(function(e){r.is(":visible")&&(e.shiftKey&&13==e.keyCode?t(".aEdit").append("<br />"):13==e.keyCode?t('.aButtons > button[value="ok"]').click():27==e.keyCode&&t('.aButtons > button[value="cancel"]').click())});var d=t(".aTextbox").val();d||(d=!1),t(".aTextbox").bind("keydown blur",function(){d=t(this).val()});var f=t(".aEdit").val();f||(f=!1),t(".aEdit").bind("keydown blur",function(){f=t(this).val()}),t(".aButtons > button").click(function(){if(r.remove(),i.remove(),s){t(this).text("");var e=t(this).attr("value");"ok"==e?(s(a?a.input?d:a.textarea?f:!0:!0),t("#mChatMessage").focus()):"cancel"==e&&(s(!1),t("#mChatMessage").focus())}})}var a=!0;mChat.archiveMode||(mChat.messageTop||t("#mChatmain").animate({scrollTop:t("#mChatmain")[0].scrollHeight},1e3,"swing"),mChat.pause&&t("#mChatMessage").bind("keypress",function(){clearInterval(mChat.interval),t("#mChatLoadIMG,#mChatOkIMG,#mChatErrorIMG").hide(),t("#mChatRefreshText").html(mChat.refreshNo).addClass("mchat-alert"),t("#mChatPauseIMG").show()}),t([window,document]).blur(function(){a=!1}).focus(function(){a=!0}),t.fn.preventDoubleSubmit=function(){var e=!1;return t(this).submit(function(){return e?!1:void(e=!0)})},t.fn.autoGrowInput=function(e){var a=t(".mChatPanel").width();return e=t.extend({maxWidth:a-20,minWidth:0,comfortZone:20},e),this.filter("input:text").each(function(){var a=e.minWidth||t(this).width(),s="",o=t(this),m=t("<div/>").css({position:"absolute",top:-9999,left:-9999,width:"auto",fontSize:o.css("fontSize"),fontFamily:o.css("fontFamily"),fontWeight:o.css("fontWeight"),letterSpacing:o.css("letterSpacing"),whiteSpace:"nowrap"}),n=function(){if(s!==(s=o.val())){var t=s.replace(/&/g,"&amp;").replace(/\s/g," ").replace(/</g,"&lt;").replace(/>/g,"&gt;");m.html(t);var n=m.width(),h=n+e.comfortZone>=a?n+e.comfortZone:a,i=o.width(),r=i>h&&h>=a||h>a&&h<e.maxWidth;r&&o.width(h)}};m.insertAfter(o),t(this).bind("keypress blur change submit focus",n)}),this},t("input.mChatText").autoGrowInput(),t("#postform").preventDoubleSubmit(),mChat.playSound&&"yes"!=t.cookie("mChatNoSound")?(t.cookie("mChatNoSound",null),t("#mChatUseSound").attr("checked","checked")):(t.cookie("mChatNoSound","yes"),t("#mChatUseSound").removeAttr("checked")),t("#mChatUserList").length&&("yes"==t.cookie("mChatShowUserList")||mChat.customPage)&&t("#mChatUserList").show()),t.extend(mChat,{countDown:function(){t("#mChatSessMess").removeClass("mchat-alert"),mChat.sessionTime=mChat.sessionTime-1;var e=Math.floor(mChat.sessionTime),a=Math.floor(e/60),s=Math.floor(a/60);e%=60,9>=e&&(e="0"+e),a%=60,9>=a&&(a="0"+a),s%=60,9>=s&&(s="0"+s);var o=s+":"+a+":"+e;t("#mChatSessMess").html(mChat.sessEnds+" "+o),mChat.sessionTime<=0&&(clearInterval(mChat.counter),t("#mChatSessMess").html(mChat.sessOut).addClass("mchat-alert"))},clear:function(){if(""===t("#mChatMessage").val())return!1;var e=confirm(mChat.reset);e?(t("#mChatRefreshText").removeClass("mchat-alert"),mChat.pause&&(mChat.interval=setInterval(mChat.refresh,mChat.refreshTime)),t("#mChatOkIMG").show(),t("#mChatLoadIMG, #mChatErrorIMG, #mChatPauseIMG").hide(),t("#mChatRefreshText").html(mChat.refreshYes),t("#mChatMessage").val("").focus()):t("#Line truncated
jQuery(function(t){function e(e,a,s){e='<span style="font-weight:bold; font-size:1.2em;">'+e+"</span>";var o={confirm:!1,verify:!1,input:!1,textarea:!1,animate:!1,textOk:"Ok",textCancel:"Cancel",textYes:"Yes",textNo:"No",position:"center"};if(a)for(var m in o)"undefined"==typeof a[m]&&(a[m]=o[m]);var n=t(document).height(),h=t(document).width(),i=t('<div class="appriseOuter"></div>'),r=t('<div class="appriseOverlay" id="aOverlay"></div>'),l=t('<div class="appriseInner"></div>'),u=t('<div class="aButtons"></div>'),c=300;if(r.css({height:n,width:h}).appendTo("body").fadeIn(100,function(){t(this).css("filter","alpha(opacity=70)")}),i.prependTo("body"),l.append(e).appendTo(i),a&&(a.input&&("string"==typeof a.input?l.append('<div class="aInput"><input type="text" class="aTextbox" t="aTextbox" value="'+a.input+'" /></div>'):l.append('<div class="aInput"><input type="text" class="aTextbox" t="aTextbox" /></div>'),t(".aTextbox").focus()),"string"==typeof a.textarea&&(l.append('<div class="aInput"><textarea name="message" class="aEdit" style="height: 9em;" rows="5" cols="180">'+a.textarea+"</textarea></div>"),t(".aEdit").focus())),l.append(u),a?a.confirm||a.input?(u.append('<button value="ok">'+a.textOk+"</button>"),u.append('<button value="cancel">'+a.textCancel+"</button>")):a.verify?(u.append('<button value="ok">'+a.textYes+"</button>"),u.append('<button value="cancel">'+a.textNo+"</button>")):u.append('<button value="ok">'+a.textOk+"</button>"):u.append('<button value="ok">Ok</button>'),i.css("left",(t(window).width()-t(".appriseOuter").width())/2+t(window).scrollLeft()+"px"),a)if(a.position&&"center"===a.position&&(c=(n-i.height())/2),a.animate){var C=a.animate;isNaN(C)&&(C=400),i.css("top","-200px").show().animate({top:c},C)}else i.css("top",c).fadeIn(200);else i.css("top",c).fadeIn(200);t(document).keydown(function(e){r.is(":visible")&&(e.shiftKey&&13==e.keyCode?t(".aEdit").append("<br />"):13==e.keyCode?t('.aButtons > button[value="ok"]').click():27==e.keyCode&&t('.aButtons > button[value="cancel"]').click())});var d=t(".aTextbox").val();d||(d=!1),t(".aTextbox").bind("keydown blur",function(){d=t(this).val()});var f=t(".aEdit").val();f||(f=!1),t(".aEdit").bind("keydown blur",function(){f=t(this).val()}),t(".aButtons > button").click(function(){if(r.remove(),i.remove(),s){t(this).text("");var e=t(this).attr("value");"ok"==e?(s(a?a.input?d:a.textarea?f:!0:!0),t("#mChatMessage").focus()):"cancel"==e&&(s(!1),t("#mChatMessage").focus())}})}var a=!0;mChat.archiveMode||(mChat.messageTop||t("#mChatmain").animate({scrollTop:t("#mChatmain")[0].scrollHeight},1e3,"swing"),mChat.pause&&t("#mChatMessage").bind("keypress",function(){clearInterval(mChat.interval),t("#mChatLoadIMG,#mChatOkIMG,#mChatErrorIMG").hide(),t("#mChatRefreshText").html(mChat.refreshNo).addClass("mchat-alert"),t("#mChatPauseIMG").show()}),t([window,document]).blur(function(){a=!1}).focus(function(){a=!0}),t.fn.preventDoubleSubmit=function(){var e=!1;return t(this).submit(function(){return e?!1:void(e=!0)})},t.fn.autoGrowInput=function(e){var a=t(".mChatPanel").width();return e=t.extend({maxWidth:a-20,minWidth:0,comfortZone:20},e),this.filter("input:text").each(function(){var a=e.minWidth||t(this).width(),s="",o=t(this),m=t("<div/>").css({position:"absolute",top:-9999,left:-9999,width:"auto",fontSize:o.css("fontSize"),fontFamily:o.css("fontFamily"),fontWeight:o.css("fontWeight"),letterSpacing:o.css("letterSpacing"),whiteSpace:"nowrap"}),n=function(){if(s!==(s=o.val())){var t=s.replace(/&/g,"&amp;").replace(/\s/g," ").replace(/</g,"&lt;").replace(/>/g,"&gt;");m.html(t);var n=m.width(),h=n+e.comfortZone>=a?n+e.comfortZone:a,i=o.width(),r=i>h&&h>=a||h>a&&h<e.maxWidth;r&&o.width(h)}};m.insertAfter(o),t(this).bind("keypress blur change submit focus",n)}),this},t("input.mChatText").autoGrowInput(),t("#postform").preventDoubleSubmit(),mChat.playSound&&"yes"!=t.cookie("mChatNoSound")?(t.cookie("mChatNoSound",null),t("#mChatUseSound").attr("checked","checked")):(t.cookie("mChatNoSound","yes"),t("#mChatUseSound").removeAttr("checked")),t("#mChatUserList").length&&("yes"==t.cookie("mChatShowUserList")||mChat.customPage)&&t("#mChatUserList").show()),t.extend(mChat,{countDown:function(){t("#mChatSessMess").removeClass("mchat-alert"),mChat.sessionTime=mChat.sessionTime-1;var e=Math.floor(mChat.sessionTime),a=Math.floor(e/60),s=Math.floor(a/60);e%=60,9>=e&&(e="0"+e),a%=60,9>=a&&(a="0"+a),s%=60,9>=s&&(s="0"+s);var o=s+":"+a+":"+e;t("#mChatSessMess").html(mChat.sessEnds+" "+o),mChat.sessionTime<=0&&(clearInterval(mChat.counter),t("#mChatSessMess").html(mChat.sessOut).addClass("mchat-alert"))},clear:function(){if(""===t("#mChatMessage").val())return!1;var e=confirm(mChat.reset);e?(t("#mChatRefreshText").removeClass("mchat-alert"),mChat.pause&&(mChat.interval=setInterval(mChat.refresh,mChat.refreshTime)),t("#mChatOkIMG").show(),t("#mChatLoadIMG,#mChatErrorIMG,#mChatPauseIMG").hide(),t("#mChatRefreshText").html(mChat.refreshYes),t("#mChatMessage").val("").focus()):t("#mCLine truncated