static/script.js in olelo-0.9.8 vs static/script.js in olelo-0.9.9

- old
+ new

@@ -292,14 +292,12 @@ s.value,value:s.value||s.label},s)})},_suggest:function(n){var s=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(s,n);this.menu.refresh();s.show();this._resizeMenu();s.position(i.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var n=this.menu.element;n.outerWidth(Math.max(n.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(n,s){var z=this;i.each(s,function(r,o){z._renderItemData(n, o)})},_renderItemData:function(n,s){return this._renderItem(n,s).data("ui-autocomplete-item",s)},_renderItem:function(n,s){return i("<li>").append(i("<a>").text(s.label)).appendTo(n)},_move:function(n,s){if(this.menu.element.is(":visible"))if(this.menu.isFirstItem()&&/^previous/.test(n)||this.menu.isLastItem()&&/^next/.test(n)){this._value(this.term);this.menu.blur()}else this.menu[n](s);else this.search(null,s)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element, arguments)},_keyEvent:function(n,s){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(n,s);s.preventDefault()}}});i.extend(i.ui.autocomplete,{escapeRegex:function(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(n,s){var z=RegExp(i.ui.autocomplete.escapeRegex(s),"i");return i.grep(n,function(r){return z.test(r.label||r.value||r)})}});i.widget("ui.autocomplete",i.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(n){return n+ (n>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(n){this._superApply(arguments);this.options.disabled||this.cancelSearch||this.liveRegion.text(n&&n.length?this.options.messages.results(n.length):this.options.messages.noResults)}})})(jQuery);(function(i){function v(o){if(typeof o!="string"&&typeof o!="number")throw new TypeError("Key name must be string or numeric");}function n(){try{s.oleloStorage=JSON.stringify(z)}catch(o){}}var s={},z={};try{if(window.localStorage)s=window.localStorage;if(s.oleloStorage)z=JSON.parse(s.oleloStorage)}catch(r){}i.storage={set:function(o,x){v(o);z[o]=x;n();return x},get:function(o,x){v(o);if(o in z)return z[o];return typeof x=="undefined"?null:x},remove:function(o){v(o);if(o in z){delete z[o];n();return true}return false}}})(jQuery);(function(i){function v(z,r){var o=s[z];return o&&o[r]}var n=null,s={};i.translations=function(z){for(var r in z)if(s[r])for(var o in z[r])s[r][o]=z[r][o];else s[r]=z[r]};i.t=function(z,r){if(!n){var o=i("html");n=o.attr("lang")||o.attr("xml:lang")||"en"}var x;o=v(n,z);if(!o&&(x=n.indexOf("-")))o=v(n.substr(0,x),z);if(o){for(var E in r)o=o.replace(RegExp("#{"+E+"}","g"),r[E]);return o}return"#"+z}})(jQuery);(function(i){function v(){var z=false;switch(this.type){case "checkbox":case "radio":z=this.checked!=this.defaultChecked;break;case "hidden":case "password":case "text":case "textarea":case "file":z=this.value!=this.defaultValue;break;case "select-one":case "select-multiple":for(var r=0;r<this.options.length&&!z;++r)z=this.options[r].selected!=this.options[r].defaultSelected;break}i("label[for="+this.id+"]").toggleClass("unsaved",z);i(this).toggleClass("unsaved",z)}function n(z){i("input.observe, textarea.observe, select.observe").each(function(){v.call(this)}); return i(".unsaved",z).size()!==0}i.translations({en:{confirmUnsaved:"The page was not saved. Continue?",pageUnsaved:"The page was not saved."},de:{confirmUnsaved:"Die Seite wurde nicht gespeichert. Fortsetzen?",pageUnsaved:"Die Seite wurde nicht gespeichert."},cs:{confirmUnsaved:"Str\u00e1nka nebyla ulo\u017eena. Pokra\u010dovat?",pageUnsaved:"Str\u00e1nka nebyla ulo\u017eena."},fr:{confirmUnsaved:"La page n'a pas \u00e9t\u00e9 enregistr\u00e9e. Voulez vous continuer ?",pageUnsaved:"La page n'a pas \u00e9t\u00e9 enregistr\u00e9e."}}); -i.fn.confirmUnsaved=function(){return!n(this)||confirm(i.t("confirmUnsaved"))};i(document).on("change autocompletechange","input.observe, textarea.observe, select.observe",v);var s=false;i(document).on("submit","form",function(){s=true}).bind("reset",function(){i(".unsaved",this).removeClass("unsaved")});i(window).bind("beforeunload",function(){if(!s&&n(document))return i.t("pageUnsaved")})})(jQuery);(function(i){i.fn.historyTable=function(){function v(){var o=[];z.each(function(){this.checked&&o.push(this.name)});return o}i("thead tr",this).prepend('<th class="compare"><button>&#177;</button></th>');i("tbody tr",this).each(function(){var o=i(this).attr("id").substr(8);i(this).prepend('<td class="compare"><input type="checkbox" name="'+o+'"/></td>')});var n=i.storage.get("historyTable");if(n)for(var s=0;s<n.length;++s)i("input[name="+n[s]+"]").attr("checked","checked");var z=i("tbody input",this), -r=i("th button",this);r.click(function(){var o=v();i.storage.set("historyTable",o);location.href=location.pathname.replace("/history","/compare/"+o[o.length-1]+"..."+o[0])});i("td input",this).change(function(){v().length>1?r.removeAttr("disabled"):r.attr("disabled","disabled")}).change()}})(jQuery);(function(i){i.fn.pagination=function(v){function n(z){s.load(z+(z.indexOf("?")<0?"?":"&")+"no_layout=1",function(){s.trigger("pageLoaded",[z])})}var s=this;i(document).on("click",v,function(){i(this).addClass("loading");History.enabled?History.pushState(null,document.title,this.href):n(this.href);return false});i(window).bind("statechange",function(){var z=History.getState();n(z.url)})}})(jQuery);(function(i){i.fn.tabWidget=function(v){var n=v&&v.store,s=null;i("> a[href^='#']",this).click(function(){if(s.data("tab")==i(this).data("tab"))return false;if(!s.data("tab").confirmUnsaved())return false;s.data("tab").hide();s.parent().removeClass("selected");s=i(this);s.data("tab").show();s.parent().addClass("selected");n&&i.storage.set(n,s.data("tab").attr("id"));return false}).each(function(){var z=i(this.href.match(/(#.*)$/)[1]);z.hide();i(this).data("tab",z)});if(n)if(v=i.storage.get(n))s=i("> a[href='#"+ +i.fn.confirmUnsaved=function(){return!n(this)||confirm(i.t("confirmUnsaved"))};i(document).on("change autocompletechange","input.observe, textarea.observe, select.observe",v);var s=false;i(document).on("submit","form",function(){s=true}).bind("reset",function(){i(".unsaved",this).removeClass("unsaved")});i(window).bind("beforeunload",function(){if(!s&&n(document))return i.t("pageUnsaved")})})(jQuery);(function(i){i.fn.pagination=function(v){function n(z){s.load(z+(z.indexOf("?")<0?"?":"&")+"no_layout=1",function(){s.trigger("pageLoaded",[z])})}var s=this;i(document).on("click",v,function(){i(this).addClass("loading");History.enabled?History.pushState(null,document.title,this.href):n(this.href);return false});i(window).bind("statechange",function(){var z=History.getState();n(z.url)})}})(jQuery);(function(i){i.fn.tabWidget=function(v){var n=v&&v.store,s=null;i("> a[href^='#']",this).click(function(){if(s.data("tab")==i(this).data("tab"))return false;if(!s.data("tab").confirmUnsaved())return false;s.data("tab").hide();s.parent().removeClass("selected");s=i(this);s.data("tab").show();s.parent().addClass("selected");n&&i.storage.set(n,s.data("tab").attr("id"));return false}).each(function(){var z=i(this.href.match(/(#.*)$/)[1]);z.hide();i(this).data("tab",z)});if(n)if(v=i.storage.get(n))s=i("> a[href='#"+ v+"']",this);if(!s||s.size()===0)s=i(this).filter(".selected").find("> a[href^='#']");if(!s||s.size()===0)s=i(this).filter(":first").find("> a[href^='#']");if(s&&s.data("tab")){s.parent().addClass("selected");s.data("tab").show()}}})(jQuery);(function(i){function v(n){n=Math.floor(((new Date).getTime()-new Date(n*1E3))/6E4);if(n<=0)return i.t("less_than_a_minute_ago");if(n==1)return i.t("a_minute_ago");if(n<45)return i.t("n_minutes_ago",{n:n});if(n<90)return i.t("one_hour_ago");if(n<1440)return i.t("n_hours_ago",{n:Math.round(n/60)});if(n<2880)return i.t("one_day_ago");if(n<43200)return i.t("n_days_ago",{n:Math.round(n/1440)});if(n<86400)return i.t("one_month_ago");if(n<525960)return i.t("n_months_ago",{n:Math.round(n/43200)});if(n<1051920)return i.t("one_year_ago"); return i.t("over_n_years_ago",{n:Math.round(n/525960)})}i.translations({en:{less_than_a_minute_ago:"less than a minute ago",a_minute_ago:"a minute ago",n_minutes_ago:"#{n} minutes ago",one_hour_ago:"1 hour ago",n_hours_ago:"#{n} hours ago",one_day_ago:"1 day ago",n_days_ago:"#{n} days ago",one_month_ago:"1 month ago",n_months_ago:"#{n} months ago",one_year_ago:"1 year ago",over_n_years_ago:"over #{n} years ago"},de:{less_than_a_minute_ago:"vor weniger als einer Minute",a_minute_ago:"vor einer Minute", n_minutes_ago:"vor #{n} Minuten",one_hour_ago:"vor einer Stunde",n_hours_ago:"vor #{n} Stunden",one_day_ago:"vor einem Tag",n_days_ago:"vor #{n} Tagen",one_month_ago:"vor einem Monat",n_months_ago:"vor #{n} Monaten",one_year_ago:"vor einem Jahr",over_n_years_ago:"vor \u00fcber #{n} Jahren"},cs:{less_than_a_minute_ago:"m\u00e9n\u011b ne\u017e 1 minuta",a_minute_ago:"p\u0159ed minutou",n_minutes_ago:"p\u0159ed #{n} minutami",one_hour_ago:"p\u0159ed hodinou",n_hours_ago:"p\u0159ed #{n} hodinami",one_day_ago:"jeden den", n_days_ago:"p\u0159ed #{n} dny",one_month_ago:"jeden m\u011bs\u00edc",n_months_ago:"p\u0159ed #{n} m\u011bs\u00edci",one_year_ago:"1 rok",over_n_years_ago:"p\u0159ed #{n} lety"},fr:{less_than_a_minute_ago:"il y a moins d'une minute",a_minute_ago:"il y a une minute",n_minutes_ago:"il y a #{n} minutes",one_hour_ago:"il y a 1 heure",n_hours_ago:"il y a #{n} heures",one_day_ago:"il y a 1 jour",n_days_ago:"il y a #{n} jours",one_month_ago:"il y a 1 mois",n_months_ago:"il y a #{n} mois",one_year_ago:"il y a 1 an", -over_n_years_ago:"il y a plus de #{n} ans"}});i.fn.timeAgo=function(){this.each(function(){var n=i(this),s=n.data("epoch");s&&n.attr("title",n.text()).html(v(s))})}})(jQuery);(function(i){i.extend(i.fn,{underlineText:function(v){this.each(function(){var n=i(this),s,z;if(n.children().size()===0){s=n.text();z=s.toLowerCase().indexOf(v.toLowerCase());z>=0&&n.html(s.substr(0,z)+'<span style="text-decoration: underline">'+s.substr(z,v.length)+"</span>"+s.substr(z+v.length))}else n.children().underlineText(v)})},underlineAccessKey:function(){this.each(function(){var v=i(this).attr("accesskey");v&&i(this).underlineText(v)})}})})(jQuery);(function(i){i.widget("ui.combobox",{_create:function(){var v=this.element;v.autocomplete({delay:0,minLength:0,source:this.options.source}).click(function(){v.autocomplete("widget").is(":visible")?v.autocomplete("close"):v.autocomplete("search",this.value)});i('<button class="ui-combo-button"/>').attr("tabIndex",-1).insertAfter(v).click(function(n){n.preventDefault();if(v.autocomplete("widget").is(":visible"))v.autocomplete("close");else{v.autocomplete("search","");v.focus()}})}})})(jQuery);$(function(){function i(){$("#upload-path",this).each(function(){var v=this,n=v.value,s=v.value;if(s.length===0||s.match(/\/$/))$("#upload-file").change(function(){if(v.value==n){v.value=s+this.value;n=v.value}})});$("label, #menu, .tabhead, .pagination, .button-bar",this).disableSelection();$("#history-table",this).historyTable();$(".date",this).timeAgo();$(".tabs",this).each(function(){$("> li",this).tabWidget()});$("*[accesskey]",this).underlineAccessKey()}$("html").removeClass("no-js").addClass("js"); -$("#content").pagination(".pagination a");$("#content").bind("pageLoaded",i);i.apply($(document));$("button[data-target]").live("click",function(){var v=$(this),n=$(this.form);v.addClass("loading");$.ajax({type:n.attr("method")||"get",url:n.attr("action")||window.location.href,data:n.serialize()+"&"+v.attr("name")+"="+v.attr("value")+"&no_layout=1",success:function(s){$("#"+v.data("target")).html(s);v.removeClass("loading");window.MathJax&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,v.data("target")])}}); -return false})}); +over_n_years_ago:"il y a plus de #{n} ans"}});i.fn.timeAgo=function(){this.each(function(){var n=i(this),s=n.data("epoch");s&&n.attr("title",n.text()).html(v(s))})}})(jQuery);(function(i){i.extend(i.fn,{underlineText:function(v){this.each(function(){var n=i(this),s,z;if(n.children().size()===0){s=n.text();z=s.toLowerCase().indexOf(v.toLowerCase());z>=0&&n.html(s.substr(0,z)+'<span style="text-decoration: underline">'+s.substr(z,v.length)+"</span>"+s.substr(z+v.length))}else n.children().underlineText(v)})},underlineAccessKey:function(){this.each(function(){var v=i(this).attr("accesskey");v&&i(this).underlineText(v)})}})})(jQuery);(function(i){i.widget("ui.combobox",{_create:function(){var v=this.element;v.autocomplete({delay:0,minLength:0,source:this.options.source}).click(function(){v.autocomplete("widget").is(":visible")?v.autocomplete("close"):v.autocomplete("search",this.value)});i('<button class="ui-combo-button"/>').attr("tabIndex",-1).insertAfter(v).click(function(n){n.preventDefault();if(v.autocomplete("widget").is(":visible"))v.autocomplete("close");else{v.autocomplete("search","");v.focus()}})}})})(jQuery);$(function(){function i(){$("#upload-path",this).each(function(){var v=this,n=v.value,s=v.value;if(s.length===0||s.match(/\/$/))$("#upload-file").change(function(){if(v.value==n){v.value=s+this.value;n=v.value}})});$("label, #menu, .tabhead, .pagination, .button-bar",this).disableSelection();$(".date",this).timeAgo();$(".tabs",this).each(function(){$("> li",this).tabWidget()});$("*[accesskey]",this).underlineAccessKey()}$("html").removeClass("no-js").addClass("js");$("#content").pagination(".pagination a"); +$("#content").bind("pageLoaded",i);i.apply($(document));$("button[data-target]").live("click",function(){var v=$(this),n=$(this.form);v.addClass("loading");$.ajax({type:n.attr("method")||"get",url:n.attr("action")||window.location.href,data:n.serialize()+"&"+v.attr("name")+"="+v.attr("value")+"&no_layout=1",success:function(s){$("#"+v.data("target")).html(s);v.removeClass("loading");window.MathJax&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,v.data("target")])}});return false})});