Update version 0.0.12
Update version 0.0.12
This commit is contained in:
1 parent
088308248b
commit
6987d9ed55
22 files changed
+135
-27
No files matched your search
@@ -235,7 +235,7 @@ var mChat={
|
||||
},
|
||||
edit:function(id){
|
||||
var message=$jQ('#edit'+id).val();
|
||||
apprise(mChatEditInfo + ' (Shift and Enter for new line)',{
|
||||
apprise(mChatEditInfo,{
|
||||
'textarea':message,
|
||||
'animate':true,
|
||||
'position':200,
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
*
|
||||
* @package mChat JavaScript Code mini
|
||||
* @version 1.4.4 of 2013-11-03
|
||||
* @copyright (c) 2013 By Rich McGirr (RMcGirr83) http://rmcgirr83.org
|
||||
* @copyright (c) 2009 By Shapoval Andrey Vladimirovich (AllCity) ~ http://allcity.net.ru/
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
Code uses the titlealert jQuery plugin, options are below
|
||||
interva 500 The flashing interval in milliseconds.
|
||||
originalTitleInterval null Time in milliseconds that the original title is diplayed for. If null the time is the same as interval.
|
||||
duration 0 The total lenght of the flashing before it is automatically stopped. Zero means infinite.
|
||||
stopOnFocus true If true, the flashing will stop when the window gets focus.
|
||||
stopOnMouseMove false If true, the flashing will stop when the document recieves a mousemove event (i.e. when the user moves the mouse over the document area, regardless of what window is active).
|
||||
To use find titlealert in the code and make as so
|
||||
$jQ.titleAlert(mChatNewMessageAlert, {
|
||||
requireBlur:false,
|
||||
stopOnFocus:false,
|
||||
duration:4000,
|
||||
interval:700
|
||||
});
|
||||
**/
|
||||
var $jQ=jQuery;var hasFocus=true;$jQ(function(){if(!mChatArchiveMode){if(mChatPause){$jQ("#mChatMessage").bind("keypress",function(){clearInterval(interval);$jQ("#mChatLoadIMG,#mChatOkIMG,#mChatErrorIMG").hide();$jQ("#mChatRefreshText").html(mChatRefreshNo).addClass("mchat-alert");$jQ("#mChatPauseIMG").show()})}$jQ([window,document]).blur(function(){hasFocus=false}).focus(function(){hasFocus=true});$jQ.fn.autoGrowInput=function(e){var t=$jQ(".mChatPanel").width();e=$jQ.extend({maxWidth:t-20,minWidth:0,comfortZone:20},e);this.filter("input:text").each(function(){var t=e.minWidth||$jQ(this).width(),n="",r=$jQ(this),i=$jQ("<div/>").css({position:"absolute",top:-9999,left:-9999,width:"auto",fontSize:r.css("fontSize"),fontFamily:r.css("fontFamily"),fontWeight:r.css("fontWeight"),letterSpacing:r.css("letterSpacing"),whiteSpace:"nowrap"}),s=function(){if(n===(n=r.val())){return}var s=n.replace(/&/g,"&").replace(/\s/g," ").replace(/</g,"<").replace(/>/g,">");i.html(s);var u=i.width(),a=u+e.comfortZone>=t?u+e.comfortZone:t,f=r.width(),l=a<f&&a>=t||a>t&&a<e.maxWidth;if(l){r.width(a)}};i.insertAfter(r);$jQ(this).bind("keypress blur change submit focus",s)});return this};$jQ("input.mChatText").autoGrowInput();if(mChatSound&&$jQ.cookie("mChatNoSound")!="yes"){$jQ.cookie("mChatNoSound",null);$jQ("#mChatUseSound").attr("checked","checked")}else{$jQ.cookie("mChatNoSound","yes");$jQ("#mChatUseSound").removeAttr("checked")}if($jQ("#mChatUserList").length&&($jQ.cookie("mChatShowUserList")=="yes"||mChatCustomPage)){$jQ("#mChatUserList").show()}}$jQ.browser={};$jQ.browser.msie=false;if(navigator.userAgent.match(/MSIE ([0-9]+)\./)||navigator.userAgent.match(/Trident\/7.0; rv 11.0/)){$jQ.browser.msie=true}});var mChat={countDown:function(){if($jQ("#mChatSessMess").hasClass("mchat-alert")){$jQ("#mChatSessMess").removeClass("mchat-alert")}session_time=session_time-1;var e=Math.floor(session_time);var t=Math.floor(e/60);var n=Math.floor(t/60);e=e%60;if(e<=9){e="0"+e}t=t%60;if(t<=9){t="0"+t}n=n%60;if(n<=9){n="0"+n}var r=n+":"+t+":"+e;$jQ("#mChatSessMess").html(mChatSessEnds+" "+r);if(session_time<=0){clearInterval(counter);$jQ("#mChatSessMess").html(mChatSessOut).addClass("mchat-alert")}},clear:function(){if($jQ("#mChatMessage").val()==""){return false}var e=confirm(mChatReset);if(e){if($jQ("#mChatRefreshText").hasClass("mchat-alert")){$jQ("#mChatRefreshText").removeClass("mchat-alert")}if(mChatPause){interval=setInterval(function(){mChat.refresh()},mChatRefresh)}$jQ("#mChatOkIMG").show();$jQ("#mChatLoadIMG, #mChatErrorIMG, #mChatPauseIMG").hide();$jQ("#mChatRefreshText").html(mChatRefreshYes);$jQ("#mChatMessage").val("").focus()}else{$jQ("#mChatMessage").focus()}},sound:function(e){if($jQ.cookie("mChatNoSound")=="yes"){return}if($jQ.browser.msie){$jQ("#mChatSound").html('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" height="0" width="0" type="application/x-shockwave-flash"><param name="movie" value="'+e+'"></object>')}else{$jQ("#mChatSound").html('<embed src="'+e+'" width="0" height="0" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>')}},notice:function(){if(!hasFocus){$jQ.titleAlert(mChatNewMessageAlert,{interval:1e3})}},toggle:function(e){$jQ("#mChat"+e).slideToggle("normal",function(){if($jQ("#mChat"+e).is(":visible")){$jQ.cookie("mChatShow"+e,"yes")}if($jQ("#mChat"+e).is(":hidden")){$jQ.cookie("mChatShow"+e,null)}})},add:function(){if($jQ("#mChatMessage").val()==""){return false}var e=$jQ("#mChatMessage").val().replace(/ /g,"");if(e.length>mChatMssgLngth&&mChatMssgLngth){alert(mChatMssgLngthLong);return}$jQ.ajax({url:mChatFile,timeout:1e4,type:"POST",data:$jQ("#postform").serialize(),async:true,dataType:"text",beforeSend:function(){$jQ("#submit_button").attr("disabled","disabled");if(mChatUserTimeout){clearInterval(activeinterval);clearInterval(counter)}clearInterval(interval)},success:function(){mChat.refresh()},error:function(e){if(e.status==400){alert(mChatFlood)}else if(e.status==403){alert(mChatNoAccess)}else if(e.status==501){alert(mChatNoMessageInput)}},complete:function(){if($jQ("#mChatData").children("#mChatNoMessage :last")){$jQ("#mChatNoMessage").remove()}$jQ("#submit_button").removeAttr("disabled");interval=setInterval(function(){mChat.refresh()},mChatRefresh);if(mChatUserTimeout){session_time=mChatUserTimeout?mChatUserTimeout/1e3:false;counter=setInterval(function(){mChat.countDown()},1e3);activeinterval=setInterval(function(){mChat.active()},mChatUserTimeout)}$jQ("#mChatMessage").val("").focus()}})},edit:function(id){var message=$jQ('#edit'+id).val();apprise(mChatEditInfo,{'textarea':message,'animate':true,'position':200,'confirm':true}, function(r){if(r){$jQ.ajax({url:mChatFile,timeout:10000,type:'POST',data:{mode:'edit',message_id:id,message:r},dataType:'text',beforeSend:function(){clearInterval(interval);if(mChatUserTimeout){clearInterval(actLine truncated
|
||||
function mChatTimeShow(id){var tid = parseInt(id);$(".mchatrow" + id).show();}function mChatTimeHide(id){var tid = parseInt(id);$(".mchatrow" + id).hide();}
|
||||
// Apprise 1.5 by Daniel Raftery
|
||||
// http://thrivingkings.com/apprise
|
||||
//
|
||||
// Button text added by Adam Bezulski
|
||||
//
|
||||
// Cached jQuery variables, position center added by Josiah Ruddell
|
||||
|
||||
function apprise(a,b,c){a='<span style="font-weight:bold; font-size:1.2em;">'+a+"</span>";var d={confirm:false,verify:false,input:false,textarea:false,animate:false,textOk:"Ok",textCancel:"Cancel",textYes:"Yes",textNo:"No",position:"center"};if(b){for(var e in d){if(typeof b[e]=="undefined")b[e]=d[e]}}var f=$(document).height(),g=$(document).width(),h=$('<div class="appriseOuter"></div>'),i=$('<div class="appriseOverlay" id="aOverlay"></div>'),j=$('<div class="appriseInner"></div>'),k=$('<div class="aButtons"></div>'),l=300;i.css({height:f,width:g}).appendTo("body").fadeIn(100,function(){$(this).css("filter","alpha(opacity=70)")});h.prependTo("body");j.append(a).appendTo(h);if(b){if(b["input"]){if(typeof b["input"]=="string"){j.append('<div class="aInput"><input type="text" class="aTextbox" t="aTextbox" value="'+b["input"]+'" /></div>')}else{j.append('<div class="aInput"><input type="text" class="aTextbox" t="aTextbox" /></div>')}$(".aTextbox").focus()}if(typeof b["textarea"]=="string"){j.append('<div class="aInput"><textarea name="message" class="aEdit" style="height: 9em;" rows="5" cols="180">'+b["textarea"]+"</textarea></div>");$(".aEdit").focus()}}j.append(k);if(b){if(b["confirm"]||b["input"]){k.append('<button value="ok">'+b["textOk"]+"</button>");k.append('<button value="cancel">'+b["textCancel"]+"</button>")}else if(b["verify"]){k.append('<button value="ok">'+b["textYes"]+"</button>");k.append('<button value="cancel">'+b["textNo"]+"</button>")}else{k.append('<button value="ok">'+b["textOk"]+"</button>")}}else{k.append('<button value="ok">Ok</button>')}h.css("left",($(window).width()-$(".appriseOuter").width())/2+$(window).scrollLeft()+"px");if(b){if(b["position"]&&b["position"]==="center"){l=(f-h.height())/2}if(b["animate"]){var m=b["animate"];if(isNaN(m)){m=400}h.css("top","-200px").show().animate({top:l},m)}else{h.css("top",l).fadeIn(200)}}else{h.css("top",l).fadeIn(200)}$(document).keydown(function(a){if(i.is(":visible")){if(a.shiftKey&&a.keyCode==13){$(".aEdit").append("<br />")}else if(a.keyCode==13){$('.aButtons > button[value="ok"]').click()}else if(a.keyCode==27){$('.aButtons > button[value="cancel"]').click()}}});var n=$(".aTextbox").val();if(!n){n=false}$(".aTextbox").bind('keydown blur',function(){n=$(this).val()});var o=$(".aEdit").val();if(!o){o=false}$(".aEdit").bind('keydown blur',function(){o=$(this).val()});$(".aButtons > button").click(function(){i.remove();h.remove();if(c){$(this).text("");var a=$(this).attr("value");if(a=="ok"){if(b){if(b["input"]){c(n)}else if(b["textarea"]){c(o)}else{c(true)}}else{c(true)};$('#mChatMessage').focus();}else if(a=="cancel"){c(false);$('#mChatMessage').focus();}}})}
|
||||
@@ -4,7 +4,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<span style="float:left;"><!-- IF not MCHAT_ARCHIVE_MODE and MCHAT_ADD_MESSAGE --><!-- IF MCHAT_ALLOW_BBCODES --><!-- IF mchatrow.MCHAT_USERNAME_COLOR --><a class="mChatScriptLink" href="#" onclick="insert_text('@ [b][color={mchatrow.MCHAT_USERNAME_COLOR}]{mchatrow.MCHAT_USERNAME}[/color][/b], ', false);return false;" title="{L_MCHAT_RESPOND}"><span style="color: {mchatrow.MCHAT_USERNAME_COLOR}"><strong>@</strong></span></a><!-- ELSE --> <a href="#" class="mChatScriptLink" onclick="insert_text('@ [b]{mchatrow.MCHAT_USERNAME}[/b], ', false);return false;" title="{L_MCHAT_RESPOND}"><strong>@</strong></a><!-- ENDIF --><!-- ELSE --> <a href="#" class="mChatScriptLink" onclick="insert_text('@ {mchatrow.MCHAT_USERNAME}, ', false);return false;" title="{L_MCHAT_RESPOND}">@</a><!-- ENDIF --> <!-- ENDIF -->{mchatrow.MCHAT_USERNAME_FULL} <!-- IF mchatrow.U_USER_ID and mchatrow.BOT_USER_ID --><a href="{mchatrow.U_USER_ID}" title="{L_MCHAT_SEND_PM}">{L_MCHAT_PM}</a><!-- ENDIF --> - {mchatrow.MCHAT_TIME}</span>
|
||||
<span style="float:right;"><!-- IF mchatrow.U_USER_ID and mchatrow.BOT_USER_ID --><a href="#" onclick="insert_quote('{mchatrow.MCHAT_USERNAME}','{mchatrow.MCHAT_MESSAGE_EDIT}'); return false;"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/quota.png" alt="{L_REPLY_WITH_QUOTE}" title="{L_REPLY_WITH_QUOTE}" class="mChatImage" /></a><!-- ENDIF --> <!-- IF MCHAT_ALLOW_IP --><a href="{mchatrow.MCHAT_U_WHOIS}" onclick="popup(this.href, 750, 500); return false;"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/ip.gif" alt="{L_MCHAT_IP} {mchatrow.MCHAT_USER_IP}" title="{L_MCHAT_IP} {mchatrow.MCHAT_USER_IP}" class="mChatImage" /></a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_BAN --> <a href="{mchatrow.MCHAT_U_BAN}"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/ban.gif" alt="{L_MCHAT_PERMISSIONS}" title="{L_MCHAT_PERMISSIONS}" class="mChatImage" /></a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_EDIT --> <a href="#" onclick="mChat.edit('{mchatrow.MCHAT_MESSAGE_ID}');return false;"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/edit.gif" alt="{L_MCHAT_EDIT}" title="{L_MCHAT_EDIT}" class="mChatImage" /></a><!-- ENDIF --><input type="hidden" id="edit{mchatrow.MCHAT_MESSAGE_ID}" value="{mchatrow.MCHAT_MESSAGE_EDIT}" /><!-- IF mchatrow.MCHAT_ALLOW_DEL --> <a href="#" onclick="mChat.del('{mchatrow.MCHAT_MESSAGE_ID}');return false;"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/del.gif" alt="{L_MCHAT_DELITE}" title="{L_MCHAT_DELITE}" class="mChatImage" /></a><!-- ENDIF --></span><br /><div class="avatarMessage mChatMessage">{mchatrow.MCHAT_MESSAGE}</div>
|
||||
<span style="float:right;"><!-- IF mchatrow.U_USER_ID and mchatrow.BOT_USER_ID --><a href="#" onclick="insert_like('{mchatrow.MCHAT_USERNAME}','{mchatrow.MCHAT_MESSAGE_EDIT}'); return false;"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/like.png" alt="{L_REPLY_WITH_LIKE}" title="{L_REPLY_WITH_LIKE}" class="mChatImage" /></a><!-- ENDIF --> <!-- IF mchatrow.U_USER_ID and mchatrow.BOT_USER_ID --><a href="#" onclick="insert_quote('{mchatrow.MCHAT_USERNAME}','{mchatrow.MCHAT_MESSAGE_EDIT}'); return false;"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/quota.png" alt="{L_REPLY_WITH_QUOTE}" title="{L_REPLY_WITH_QUOTE}" class="mChatImage" /></a><!-- ENDIF --> <!-- IF MCHAT_ALLOW_IP --><a href="{mchatrow.MCHAT_U_WHOIS}" onclick="popup(this.href, 750, 500); return false;"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/ip.gif" alt="{L_MCHAT_IP} {mchatrow.MCHAT_USER_IP}" title="{L_MCHAT_IP} {mchatrow.MCHAT_USER_IP}" class="mChatImage" /></a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_BAN --> <a href="{mchatrow.MCHAT_U_BAN}"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/ban.gif" alt="{L_MCHAT_PERMISSIONS}" title="{L_MCHAT_PERMISSIONS}" class="mChatImage" /></a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_EDIT --> <a href="#" onclick="mChat.edit('{mchatrow.MCHAT_MESSAGE_ID}');return false;"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/edit.gif" alt="{L_MCHAT_EDIT}" title="{L_MCHAT_EDIT}" class="mChatImage" /></a><!-- ENDIF --><input type="hidden" id="edit{mchatrow.MCHAT_MESSAGE_ID}" value="{mchatrow.MCHAT_MESSAGE_EDIT}" /><!-- IF mchatrow.MCHAT_ALLOW_DEL --> <a href="#" onclick="mChat.del('{mchatrow.MCHAT_MESSAGE_ID}');return false;"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/del.gif" alt="{L_MCHAT_DELITE}" title="{L_MCHAT_DELITE}" class="mChatImage" /></a><!-- ENDIF --></span><br /><div class="avatarMessage mChatMessage">{mchatrow.MCHAT_MESSAGE}</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END mchatrow -->
|
||||
@@ -5,7 +5,11 @@
|
||||
<!-- INCLUDEJS editor.js -->
|
||||
<!-- INCLUDEJS jquery.titlealert.min.js -->
|
||||
<!-- INCLUDEJS jquery_cookie_mini.js -->
|
||||
<!-- IF MCHAT_MESSAGE_TOP -->
|
||||
<!-- INCLUDEJS mchat_ajax_mini.js -->
|
||||
<!-- ELSE -->
|
||||
<!-- INCLUDEJS mchat_ajax_mini_top.js -->
|
||||
<!-- ENDIF -->
|
||||
<!-- INCLUDEJS jquery-1.8.3.min.js -->
|
||||
<!-- INCLUDEJS jquery.maxlength.min.js -->
|
||||
|
||||
@@ -94,24 +98,44 @@
|
||||
var mChatFocusFix = true;
|
||||
<!-- ENDIF -->
|
||||
function insert_quote(user,text)
|
||||
{
|
||||
var quote = decodeURIComponent(text.replace(/\+/g, " "));
|
||||
quote = quote.replace(/</g, "<");
|
||||
quote = quote.replace(/>/g, ">");
|
||||
quote = quote.replace(/:/g, ':');
|
||||
quote = quote.replace(/./g, '.');
|
||||
quote = quote.replace(/&/g, '&');
|
||||
quote = quote.replace(/"/g, '"');
|
||||
var username = decodeURIComponent(user.replace(/\+/g, " "));
|
||||
username = username.replace(/</g, "<");
|
||||
username = username.replace(/>/g, ">");
|
||||
username = username.replace(/:/g, ':');
|
||||
username = username.replace(/./g, '.');
|
||||
username = username.replace(/&/g, '&');
|
||||
username = username.replace(/"/g, '"');
|
||||
document.getElementById('mChatMessage').value += '[quote="' + username + '"]' + ' ' + quote + '[/quote]';
|
||||
document.getElementById('mChatMessage').focus();
|
||||
}
|
||||
{
|
||||
var quote = decodeURIComponent(text.replace(/\+/g, " "));
|
||||
quote = quote.replace(/</g, "<");
|
||||
quote = quote.replace(/>/g, ">");
|
||||
quote = quote.replace(/:/g, ':');
|
||||
quote = quote.replace(/./g, '.');
|
||||
quote = quote.replace(/&/g, '&');
|
||||
quote = quote.replace(/"/g, '"');
|
||||
var username = decodeURIComponent(user.replace(/\+/g, " "));
|
||||
username = username.replace(/</g, "<");
|
||||
username = username.replace(/>/g, ">");
|
||||
username = username.replace(/:/g, ':');
|
||||
username = username.replace(/./g, '.');
|
||||
username = username.replace(/&/g, '&');
|
||||
username = username.replace(/"/g, '"');
|
||||
document.getElementById('mChatMessage').value += '[quote="' + username + '"]' + ' ' + quote + '[/quote]';
|
||||
document.getElementById('mChatMessage').focus();
|
||||
}
|
||||
|
||||
function insert_like(user,text)
|
||||
{
|
||||
var quote = decodeURIComponent(text.replace(/\+/g, " "));
|
||||
quote = quote.replace(/</g, "<");
|
||||
quote = quote.replace(/>/g, ">");
|
||||
quote = quote.replace(/:/g, ':');
|
||||
quote = quote.replace(/./g, '.');
|
||||
quote = quote.replace(/&/g, '&');
|
||||
quote = quote.replace(/"/g, '"');
|
||||
var username = decodeURIComponent(user.replace(/\+/g, " "));
|
||||
username = username.replace(/</g, "<");
|
||||
username = username.replace(/>/g, ">");
|
||||
username = username.replace(/:/g, ':');
|
||||
username = username.replace(/./g, '.');
|
||||
username = username.replace(/&/g, '&');
|
||||
username = username.replace(/"/g, '"');
|
||||
document.getElementById('mChatMessage').value += 'Like\'s this post.[quote="' + username + '"]' + ' ' + quote + '[/quote]';
|
||||
document.getElementById('mChatMessage').focus();
|
||||
}
|
||||
// ]]>
|
||||
</script>
|
||||
<!-- IF not MCHAT_ARCHIVE_MODE -->
|
||||
|
||||
Reference in new issue
Block a user