]> jfr.im git - irc/h9k/magirc.git/commitdiff
Fixed tables sometimes failing to show data
authorHal9000 <redacted>
Fri, 20 Apr 2012 14:34:13 +0000 (16:34 +0200)
committerHal9000 <redacted>
Fri, 20 Apr 2012 14:34:13 +0000 (16:34 +0200)
js/magirc.js
js/magirc.min.js

index fa6efa2516fb35640ef7feb3bda44fd641be3ccc..f94bdd7b037adf59510eaec9ac3d971971523ef8 100644 (file)
@@ -8,20 +8,20 @@ $(document).ready(function() {
                $.cookie("magirc_locale", $("#locale").val());
                window.location.reload();
        });
-       jQuery.format.date.defaultShortDateFormat = "dd/MM/yyyy";
-       jQuery.format.date.defaultLongDateFormat = "dd/MM/yyyy hh:mm:ss";
-       jQuery(".shortDateFormat").each(function (idx, elem) {
-               if (jQuery(elem).is(":input")) {
-                       jQuery(elem).val(jQuery.format.date(jQuery(elem).val(), jQuery.format.date.defaultShortDateFormat));
+       $.format.date.defaultShortDateFormat = "dd/MM/yyyy";
+       $.format.date.defaultLongDateFormat = "dd/MM/yyyy hh:mm:ss";
+       $(".shortDateFormat").each(function (idx, elem) {
+               if ($(elem).is(":input")) {
+                       $(elem).val($.format.date($(elem).val(), $.format.date.defaultShortDateFormat));
                } else {
-                       jQuery(elem).text(jQuery.format.date(jQuery(elem).text(), jQuery.format.date.defaultShortDateFormat));
+                       $(elem).text($.format.date($(elem).text(), $.format.date.defaultShortDateFormat));
                }
        });
-       jQuery(".longDateFormat").each(function (idx, elem) {
-               if (jQuery(elem).is(":input")) {
-                       jQuery(elem).val(jQuery.format.date(jQuery(elem).val(), jQuery.format.date.defaultLongDateFormat));
+       $(".longDateFormat").each(function (idx, elem) {
+               if ($(elem).is(":input")) {
+                       $(elem).val($.format.date($(elem).val(), $.format.date.defaultLongDateFormat));
                } else {
-                       jQuery(elem).text(jQuery.format.date(jQuery(elem).text(), jQuery.format.date.defaultLongDateFormat));
+                       $(elem).text($.format.date($(elem).text(), $.format.date.defaultLongDateFormat));
                }
        });
        // Datatable default settings
@@ -33,38 +33,38 @@ $(document).ready(function() {
                "sPaginationType": "full_numbers",
                "oLanguage": mLang.DataTables
     });
-       jQuery.fn.dataTableExt.aTypes.unshift(
-               function(sData) {
-                       if (sData !== null && sData.match(/^(0[1-9]|[12][0-9]|3[01])\.(0[1-9]|1[012])\.(19|20|21)\d\d ([01][0-9]|2[0-4])\:([0-5][0-9])\:([0-5][0-9])$/)) {
+       $.fn.dataTableExt.aTypes.unshift(function(sData) {
+               if (sData !== null && typeof(sData)=='string') {
+                       if (sData.match(/^(0[1-9]|[12][0-9]|3[01])\.(0[1-9]|1[012])\.(19|20|21)\d\d ([01][0-9]|2[0-4])\:([0-5][0-9])\:([0-5][0-9])$/)) {
                                return 'date-euro';
-                       } else if (sData !== null && sData.match(/^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[012])\/(19|20|21)\d\d ([01][0-9]|2[0-4])\:([0-5][0-9])\:([0-5][0-9])$/)) {
+                       } else if (sData.match(/^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[012])\/(19|20|21)\d\d ([01][0-9]|2[0-4])\:([0-5][0-9])\:([0-5][0-9])$/)) {
                                return 'date-uk';
                        }
-                       return null;
                }
-       );
+               return null;
+       });
        function calcDate(date, dateSplit) {
                var dtDate = date.split(' ');
                var dtTime = dtDate[1].split(':');
                dtDate = dtDate[0].split(dateSplit);
                return (dtDate[2] + dtDate[1] + dtDate[0] + dtTime[0] + dtTime[1] + dtTime[2]) * 1;
        }
-       jQuery.fn.dataTableExt.oSort['date-euro-asc'] = function(a, b) {
+       $.fn.dataTableExt.oSort['date-euro-asc'] = function(a, b) {
                var x = calcDate(a, '.');
                var y = calcDate(b, '.');
                return ((x < y) ? -1 : ((x > y) ? 1 : 0));
        };
-       jQuery.fn.dataTableExt.oSort['date-euro-desc'] = function(a, b) {
+       $.fn.dataTableExt.oSort['date-euro-desc'] = function(a, b) {
                var x = calcDate(a, '.');
                var y = calcDate(b, '.');
                return ((x < y) ? 1 : ((x > y) ? -1 : 0));
        };
-       jQuery.fn.dataTableExt.oSort['date-uk-asc'] = function(a, b) {
+       $.fn.dataTableExt.oSort['date-uk-asc'] = function(a, b) {
                var x = calcDate(a, '/');
                var y = calcDate(b, '/');
                return ((x < y) ? -1 : ((x > y) ? 1 : 0));
        };
-       jQuery.fn.dataTableExt.oSort['date-uk-desc'] = function(a, b) {
+       $.fn.dataTableExt.oSort['date-uk-desc'] = function(a, b) {
                var x = calcDate(a, '/');
                var y = calcDate(b, '/');
                return ((x < y) ? 1 : ((x > y) ? -1 : 0));
index 46cc6b4551a4b35d2295f85843ed3ff7e78ea7da..e096866b1328de0cd597b5b3bb310e2d6da8fd00 100644 (file)
@@ -1 +1 @@
-function getUserStatus(a){return a.away?'<img src="theme/'+theme+'/img/status/user-away.png" alt="away" title="'+mLang.AwayAs+" "+a.nickname+'" />':a.online?'<img src="theme/'+theme+'/img/status/user-online.png" alt="online" title="'+mLang.OnlineAs+" "+a.nickname+'" />':'<img src="theme/'+theme+'/img/status/user-offline.png" alt="offline" title="'+mLang.Offline+'" />'}function getUserExtra(a){var b="";return a.bot&&(b+=' <img src="theme/'+theme+'/img/status/bot.png" alt="bot" title="'+mLang.Bot+'" />'),a.service&&(b+=' <img src="theme/'+theme+'/img/status/service.png" alt="service" title="'+mLang.Service+'" />'),a.operator&&(b+=' <img src="theme/'+theme+'/img/status/operator.png" alt="oper" title="'+a.operator_level+'" />'),a.helper&&(b+=' <img src="theme/'+theme+'/img/status/help.png" alt="help" title="'+mLang.Helper+'" />'),b}function getCountryFlag(a){return a["country_code"]!=null&&a["country_code"]!=""&&a["country_code"]!="??"&&a["country_code"]!="local"?'<img src="theme/'+theme+"/img/flags/"+a.country_code.toLowerCase()+'.png" alt="'+a.country_code+'" title="'+a.country+'" />':'<img src="theme/'+theme+'/img/flags/unknown.png" alt="Unknown" title="'+mLang.Unknown+'" />'}function getChannelLinks(a){return net_roundrobin||service_webchat?'<button type="button" title="'+mLang.Join+'..." class="chanbutton ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icons" style="height:18px; width:30px; margin:0; vertical-align:middle;"><span class="ui-button-icon-secondary ui-icon ui-icon-triangle-1-s"></span></button>':""}function getTimeElapsed(a){var b=Math.floor(a/86400),c=Math.floor((a-b*86400)/3600),d=Math.floor((a-b*86400-c*3600)/60);return b+" "+mLang.Days+" "+c+" "+mLang.Hours+" "+d+" "+mLang.Minutes}$(document).ready(function(){function a(a,b){var c=a.split(" "),d=c[1].split(":");return c=c[0].split(b),(c[2]+c[1]+c[0]+d[0]+d[1]+d[2])*1}$("#loading").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()}),$("#locale").change(function(a){$.cookie("magirc_locale",$("#locale").val()),window.location.reload()}),jQuery.format.date.defaultShortDateFormat="dd/MM/yyyy",jQuery.format.date.defaultLongDateFormat="dd/MM/yyyy hh:mm:ss",jQuery(".shortDateFormat").each(function(a,b){jQuery(b).is(":input")?jQuery(b).val(jQuery.format.date(jQuery(b).val(),jQuery.format.date.defaultShortDateFormat)):jQuery(b).text(jQuery.format.date(jQuery(b).text(),jQuery.format.date.defaultShortDateFormat))}),jQuery(".longDateFormat").each(function(a,b){jQuery(b).is(":input")?jQuery(b).val(jQuery.format.date(jQuery(b).val(),jQuery.format.date.defaultLongDateFormat)):jQuery(b).text(jQuery.format.date(jQuery(b).text(),jQuery.format.date.defaultLongDateFormat))}),$.extend($.fn.dataTable.defaults,{bProcessing:!0,bServerSide:!1,bJQueryUI:!0,bAutoWidth:!1,sPaginationType:"full_numbers",oLanguage:mLang.DataTables}),jQuery.fn.dataTableExt.aTypes.unshift(function(a){return a!==null&&a.match(/^(0[1-9]|[12][0-9]|3[01])\.(0[1-9]|1[012])\.(19|20|21)\d\d ([01][0-9]|2[0-4])\:([0-5][0-9])\:([0-5][0-9])$/)?"date-euro":a!==null&&a.match(/^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[012])\/(19|20|21)\d\d ([01][0-9]|2[0-4])\:([0-5][0-9])\:([0-5][0-9])$/)?"date-uk":null}),jQuery.fn.dataTableExt.oSort["date-euro-asc"]=function(b,c){var d=a(b,"."),e=a(c,".");return d<e?-1:d>e?1:0},jQuery.fn.dataTableExt.oSort["date-euro-desc"]=function(b,c){var d=a(b,"."),e=a(c,".");return d<e?1:d>e?-1:0},jQuery.fn.dataTableExt.oSort["date-uk-asc"]=function(b,c){var d=a(b,"/"),e=a(c,"/");return d<e?-1:d>e?1:0},jQuery.fn.dataTableExt.oSort["date-uk-desc"]=function(b,c){var d=a(b,"/"),e=a(c,"/");return d<e?1:d>e?-1:0},Highcharts.setOptions({global:{useUTC:!1},chart:{backgroundColor:"transparent",type:"spline",marginRight:10,style:{fontFamily:"Share, cursive"},plotBackgroundColor:null,plotBorderWidth:null,plotShadow:!1},title:{text:null},xAxis:{type:"datetime",tickPixelInterval:150,ordinal:!0},yAxis:{title:{align:"low"},allowDecimals:!1,plotLines:[{value:0,width:1,color:"#808080"}]},rangeSelector:{buttons:[{type:"day",count:1,text:mLang.zoom_1d},{type:"week",count:1,text:mLang.zoom_1w},{type:"month",count:1,text:mLang.zoom_1m},{type:"month",count:3,text:mLang.zoom_3m},{type:"month",count:6,text:mLang.zoom_6m},{type:"year",count:1,text:mLang.zoom_1y},{type:"all",text:mLang.zoom_All}],selected:3},tooltip:{valueDecimals:0,xDateFormat:format_datetime_charts},legend:{enabled:!1},exporting:{enabled:!1},plotOptions:{spline:{lineWidth:2,states:{hover:{lineWidth:3}},marker:{enabled:!1,states:{hover:{enabled:!0,symbol:"circle",radius:5,lineWidth:1}}}},pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!0,color:"#000000",connectorColor:"#000000",formatter:function(){return"<b>"+this.point.name+"</b>: "+Math.round(this.percentage*100)/100+" %"}}},column:{dataLabels:{enabled:!0,rotation:-90,x:3,y:-12}}},rangeSelector:{selected:4},credits:{enabled:!1}});var b=$("#chanmenu").menu({selected:function(a,c){$(this).hide();var d=encodeURIComponent(b.data("channel"));switch(c.item.data("action")){case"irc":location.href="irc://"+net_roundrobin+":"+net_port+"/"+d.replace("%23","");break;case"ircs":location.href="irc://"+net_roundrobin+":+"+net_port_ssl+"/"+d.replace("%23","");break;case"webchat":location.href=service_webchat+d;break;case"mibbit":location.href="http://widget.mibbit.com/?settings="+service_mibbit+"&server="+net_roundrobin+"&channel="+d+"&promptPass=true"}}}).hide().css({position:"absolute",zIndex:1});$(".chanbutton").live("click",function(a){return b.data("channel",$(this).parent().parent().attr("id")),b.is(":visible")?(b.hide(),!1):(b.menu("deactivate").show(),b.position({my:"right top",at:"right bottom",of:this}),$(document).one("click",function(){b.hide()}),!1)}),$(".chanbutton").live({mouseenter:function(){$(this).removeClass("ui-state-default").addClass("ui-state-focus")},mouseleave:function(){$(this).removeClass("ui-state-focus").addClass("ui-state-default")}})})
\ No newline at end of file
+function getUserStatus(a){return a.away?'<img src="theme/'+theme+'/img/status/user-away.png" alt="away" title="'+mLang.AwayAs+" "+a.nickname+'" />':a.online?'<img src="theme/'+theme+'/img/status/user-online.png" alt="online" title="'+mLang.OnlineAs+" "+a.nickname+'" />':'<img src="theme/'+theme+'/img/status/user-offline.png" alt="offline" title="'+mLang.Offline+'" />'}function getUserExtra(a){var b="";return a.bot&&(b+=' <img src="theme/'+theme+'/img/status/bot.png" alt="bot" title="'+mLang.Bot+'" />'),a.service&&(b+=' <img src="theme/'+theme+'/img/status/service.png" alt="service" title="'+mLang.Service+'" />'),a.operator&&(b+=' <img src="theme/'+theme+'/img/status/operator.png" alt="oper" title="'+a.operator_level+'" />'),a.helper&&(b+=' <img src="theme/'+theme+'/img/status/help.png" alt="help" title="'+mLang.Helper+'" />'),b}function getCountryFlag(a){return a["country_code"]!=null&&a["country_code"]!=""&&a["country_code"]!="??"&&a["country_code"]!="local"?'<img src="theme/'+theme+"/img/flags/"+a.country_code.toLowerCase()+'.png" alt="'+a.country_code+'" title="'+a.country+'" />':'<img src="theme/'+theme+'/img/flags/unknown.png" alt="Unknown" title="'+mLang.Unknown+'" />'}function getChannelLinks(a){return net_roundrobin||service_webchat?'<button type="button" title="'+mLang.Join+'..." class="chanbutton ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icons" style="height:18px; width:30px; margin:0; vertical-align:middle;"><span class="ui-button-icon-secondary ui-icon ui-icon-triangle-1-s"></span></button>':""}function getTimeElapsed(a){var b=Math.floor(a/86400),c=Math.floor((a-b*86400)/3600),d=Math.floor((a-b*86400-c*3600)/60);return b+" "+mLang.Days+" "+c+" "+mLang.Hours+" "+d+" "+mLang.Minutes}$(document).ready(function(){function a(a,b){var c=a.split(" "),d=c[1].split(":");return c=c[0].split(b),(c[2]+c[1]+c[0]+d[0]+d[1]+d[2])*1}$("#loading").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()}),$("#locale").change(function(a){$.cookie("magirc_locale",$("#locale").val()),window.location.reload()}),$.format.date.defaultShortDateFormat="dd/MM/yyyy",$.format.date.defaultLongDateFormat="dd/MM/yyyy hh:mm:ss",$(".shortDateFormat").each(function(a,b){$(b).is(":input")?$(b).val($.format.date($(b).val(),$.format.date.defaultShortDateFormat)):$(b).text($.format.date($(b).text(),$.format.date.defaultShortDateFormat))}),$(".longDateFormat").each(function(a,b){$(b).is(":input")?$(b).val($.format.date($(b).val(),$.format.date.defaultLongDateFormat)):$(b).text($.format.date($(b).text(),$.format.date.defaultLongDateFormat))}),$.extend($.fn.dataTable.defaults,{bProcessing:!0,bServerSide:!1,bJQueryUI:!0,bAutoWidth:!1,sPaginationType:"full_numbers",oLanguage:mLang.DataTables}),$.fn.dataTableExt.aTypes.unshift(function(a){if(a!==null&&typeof a=="string"){if(a.match(/^(0[1-9]|[12][0-9]|3[01])\.(0[1-9]|1[012])\.(19|20|21)\d\d ([01][0-9]|2[0-4])\:([0-5][0-9])\:([0-5][0-9])$/))return"date-euro";if(a.match(/^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[012])\/(19|20|21)\d\d ([01][0-9]|2[0-4])\:([0-5][0-9])\:([0-5][0-9])$/))return"date-uk"}return null}),$.fn.dataTableExt.oSort["date-euro-asc"]=function(b,c){var d=a(b,"."),e=a(c,".");return d<e?-1:d>e?1:0},$.fn.dataTableExt.oSort["date-euro-desc"]=function(b,c){var d=a(b,"."),e=a(c,".");return d<e?1:d>e?-1:0},$.fn.dataTableExt.oSort["date-uk-asc"]=function(b,c){var d=a(b,"/"),e=a(c,"/");return d<e?-1:d>e?1:0},$.fn.dataTableExt.oSort["date-uk-desc"]=function(b,c){var d=a(b,"/"),e=a(c,"/");return d<e?1:d>e?-1:0},Highcharts.setOptions({global:{useUTC:!1},chart:{backgroundColor:"transparent",type:"spline",marginRight:10,style:{fontFamily:"Share, cursive"},plotBackgroundColor:null,plotBorderWidth:null,plotShadow:!1},title:{text:null},xAxis:{type:"datetime",tickPixelInterval:150,ordinal:!0},yAxis:{title:{align:"low"},allowDecimals:!1,plotLines:[{value:0,width:1,color:"#808080"}]},rangeSelector:{buttons:[{type:"day",count:1,text:mLang.zoom_1d},{type:"week",count:1,text:mLang.zoom_1w},{type:"month",count:1,text:mLang.zoom_1m},{type:"month",count:3,text:mLang.zoom_3m},{type:"month",count:6,text:mLang.zoom_6m},{type:"year",count:1,text:mLang.zoom_1y},{type:"all",text:mLang.zoom_All}],selected:3},tooltip:{valueDecimals:0,xDateFormat:format_datetime_charts},legend:{enabled:!1},exporting:{enabled:!1},plotOptions:{spline:{lineWidth:2,states:{hover:{lineWidth:3}},marker:{enabled:!1,states:{hover:{enabled:!0,symbol:"circle",radius:5,lineWidth:1}}}},pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!0,color:"#000000",connectorColor:"#000000",formatter:function(){return"<b>"+this.point.name+"</b>: "+Math.round(this.percentage*100)/100+" %"}}},column:{dataLabels:{enabled:!0,rotation:-90,x:3,y:-12}}},rangeSelector:{selected:4},credits:{enabled:!1}});var b=$("#chanmenu").menu({selected:function(a,c){$(this).hide();var d=encodeURIComponent(b.data("channel"));switch(c.item.data("action")){case"irc":location.href="irc://"+net_roundrobin+":"+net_port+"/"+d.replace("%23","");break;case"ircs":location.href="irc://"+net_roundrobin+":+"+net_port_ssl+"/"+d.replace("%23","");break;case"webchat":location.href=service_webchat+d;break;case"mibbit":location.href="http://widget.mibbit.com/?settings="+service_mibbit+"&server="+net_roundrobin+"&channel="+d+"&promptPass=true"}}}).hide().css({position:"absolute",zIndex:1});$(".chanbutton").live("click",function(a){return b.data("channel",$(this).parent().parent().attr("id")),b.is(":visible")?(b.hide(),!1):(b.menu("deactivate").show(),b.position({my:"right top",at:"right bottom",of:this}),$(document).one("click",function(){b.hide()}),!1)}),$(".chanbutton").live({mouseenter:function(){$(this).removeClass("ui-state-default").addClass("ui-state-focus")},mouseleave:function(){$(this).removeClass("ui-state-focus").addClass("ui-state-default")}})})
\ No newline at end of file