Issue 1253: Now, when the submit button is clicked, it becomes disabled for 3 seconds before it's enabled again.

git-svn-id: http://xe-core.googlecode.com/svn/branches/luminous@11135 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
nagoon97 2012-09-03 05:03:06 +00:00
parent 2a71b33df7
commit 0a473d2d63
3 changed files with 33 additions and 3 deletions

View file

@ -189,7 +189,22 @@ jQuery(function($) {
$(this).hide().prev('button').show().parent().next(fold_container).hide();
});
}
jQuery('input[type="submit"]').click(function(ev){
var $el = jQuery(ev.currentTarget);
setTimeout(function(){
return function(){
$el.attr('disabled', 'disabled');
};
}(), 0);
setTimeout(function(){
return function(){
$el.removeAttr('disabled');
};
}(), 3000);
});
});
(function(){ // String extension methods

View file

@ -473,7 +473,22 @@ jQuery(function($) {
$(this).hide().prev('button').show().parent().next(fold_container).hide();
});
}
jQuery('input[type="submit"]').click(function(ev){
var $el = jQuery(ev.currentTarget);
setTimeout(function(){
return function(){
$el.attr('disabled', 'disabled');
};
}(), 0);
setTimeout(function(){
return function(){
$el.removeAttr('disabled');
};
}(), 3000);
});
});
(function(){ // String extension methods

2
common/js/xe.min.js vendored
View file

@ -14,7 +14,7 @@ arguments[0],a.extend(c,arguments[1]||{})}!0==c.doClick&&(c.checked=null);"strin
if("undefined"==typeof g.length||1>g.length)g=Array(g);if(g.length)for(var j=0;j<g.length;j++){var i=g[j].url,l=g[j].str,m=g[j].target,h="";switch(m){case "popup":h=" onclick=\"popopen(this.href,'"+m+"'); return false;\"";break;case "javascript":h=' onclick="'+i+'; return false; "';i="#";break;default:h=' onclick="window.open(this.href); return false;"'}b+='<li ><a href="'+i+'"'+h+">"+l+"</a></li> "}}this.loaded_popup_menus[c]=b}b&&(c=a("#popup_menu_area").html("<ul>"+b+"</ul>"),b=e.page_y,e=e.page_x,
c.outerHeight()+b>a(window).height()+a(window).scrollTop()&&(b=a(window).height()-c.outerHeight()+a(window).scrollTop()),c.outerWidth()+e>a(window).width()+a(window).scrollLeft()&&(e=a(window).width()-c.outerWidth()+a(window).scrollLeft()),c.css({top:b,left:e}).show())}}})(jQuery);
jQuery(function(a){a.browser.msie&&a("select").each(function(a,b){for(var g=!1,d=[],i=0;i<b.options.length;i++)b.options[i].disabled?(b.options[i].style.color="#CCCCCC",g=!0):d[a]=-1<d[a]?d[a]:i;if(g&&(b.oldonchange=b.onchange,b.onchange=function(){this.options[this.selectedIndex].disabled?this.selectedIndex=d[a]:this.oldonchange&&this.oldonchange()},0<=b.selectedIndex&&b.options[b.selectedIndex].disabled))b.onchange()});var b=a(".xe_content .fold_button");if(b.size()){var d=a("div.fold_container",
b);a("button.more",b).click(function(){a(this).hide().next("button").show().parent().next(d).show()});a("button.less",b).click(function(){a(this).hide().prev("button").show().parent().next(d).hide()})}});
b);a("button.more",b).click(function(){a(this).hide().next("button").show().parent().next(d).show()});a("button.less",b).click(function(){a(this).hide().prev("button").show().parent().next(d).hide()})}jQuery('input[type="submit"]').click(function(a){var b=jQuery(a.currentTarget);setTimeout(function(){b.attr("disabled","disabled")},0);setTimeout(function(){b.removeAttr("disabled")},3E3)})});
(function(){var a=Array.isArray||function(a){return"[object Array]"==Object.prototype.toString.call(a)};String.prototype.getQuery=function(a){var d=this.replace(/#.*$/,"")===window.location.href.replace(/#.*$/,"")?current_url:this,c=d.indexOf("?");if(-1==c)return null;var e={};d.substr(c+1,this.length).replace(/([^=]+)=([^&]*)(&|$)/g,function(a,b,c){e[b]=c});a=e[a];"undefined"==typeof a&&(a="");return a};String.prototype.setQuery=function(b,d){var c=this.replace(/#.*$/,"")===window.location.href.replace(/#.*$/,
"")?current_url:this,e=c.indexOf("?"),g=c.replace(/#$/,""),j,i;"undefined"==typeof d&&(d="");if(-1!=e){var l=g.substr(e+1,c.length),m={},h=[],g=c.substr(0,e);l.replace(/([^=]+)=([^&]*)(&|$)/g,function(a,b,c){m[b]=c});m[b]=d;for(var n in m)m.hasOwnProperty(n)&&(i=String(m[n]).trim())&&h.push(n+"="+decodeURI(i));l=h.join("&");g+=l?"?"+l:""}else String(d).trim()&&(g=g+"?"+b+"="+d);e=/^https:\/\/([^:\/]+)(:\d+|)/i;e.test(g)&&(c="http://"+RegExp.$1,window.http_port&&80!=http_port&&(c+=":"+http_port),g=
g.replace(e,c));c=!!window.enforce_ssl;if(!c&&a(window.ssl_actions)&&(j=g.getQuery("act"))){e=0;for(i=ssl_actions.length;e<i;e++)if(ssl_actions[e]===j){c=!0;break}}e=/http:\/\/([^:\/]+)(:\d+|)/i;c&&e.test(g)&&(c="https://"+RegExp.$1,window.https_port&&443!=https_port&&(c+=":"+https_port),g=g.replace(e,c));g=g.replace(/\/(index\.php)?\?/,"/index.php?");return encodeURI(g)};String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")}})();