Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Resources
  • Other Forum Systems
  • [smf] Quickly Enable/Disable eZBlock columns
Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ;)

Interested in joining? Click here.


If you are already a member of ZBCode, feel free to login right here:

Username:   Password:
Add Reply
[smf] Quickly Enable/Disable eZBlock columns
Topic Started: Feb 6 2010, 11:48 AM (105 Views)
Agent Moose Feb 6 2010, 11:48 AM Post #1
Member Avatar
SMF for Free Moderator

Posts:
837
Group:
Former Staff
Member
#14
Joined:
Jul 9, 2008
Coding language
JavaScript
Footers:
Code:
 
<script type="text/javascript">
//Created by Agent Moose (Quick Enable/Disable eZBlock Columns)
$("form[action*='ezportal;sa=blocks']").find("td[colspan='4']").each(function(){
if(this.innerHTML.match(/<font color="#(ff00|00ff)00">(Enabled|Disabled)<\/font>/i)){
this.innerHTML = this.innerHTML.replace(/<font color="#(ff00|00ff)00">(Enabled|Disabled)<\/font>/i,"<a href=\"javascript:void(0);\" onclick=\"ezEnDi('$2',this);\" style=\"color: #" + RegExp.$1 + "00;\">$2</a>");
};});
function ezEnDi(endi,edit){
if(endi == "Enabled"){ edit.innerHTML = "Disabling... <img src='http://i56.photobucket.com/albums/g188/yort124/ajax-loader-1.gif' alt='Loading' />"; edit.style.color = "#ff0000"; };
if(endi == "Disabled"){ edit.innerHTML = "Enabling... <img src='http://i56.photobucket.com/albums/g188/yort124/ajax-loader-1.gif' alt='Loading' />"; edit.style.color = "#00ff00"; };
$.get($(edit).prev().attr("href"),function(test){
var cw = $("input[name='columnwidth']",test).val(), cp = $("input[name='columnpercent']",test).val(), ucc = $("input[name='can_collapse']",test).val(), sc = $("input[name='sc']",test).val(), colm = $("input[name='column']",test).val();
$.post($("#frmeditcolumn",test).attr("action"),{active: (endi == "Enabled") ? 0 : 1, columnwidth: cw, columnpercent: cp, can_collapse: ucc, sc: sc, column: colm},function(){
if(endi == "Enabled"){ edit.innerHTML = "Disabled"; edit.style.color = "#ff0000"; };
if(endi == "Disabled"){ edit.innerHTML = "Enabled"; edit.style.color = "#00ff00"; };
});});};
</script>


---So far this code only works in FireFox---

This code allows you to quickly edit the ezBlock columns just by the click of the mouse. It makes the "Enabled" or "Disabled" Text into a link, and just click them turn them on or off. Simple as that.
You could call me Troy :P | The World of Moosey | Newest Blog: SMF for Free Spam Code

Current Project: Zetaboard Javascript Tester (click on the link in the Submenu)

ZetaBoard Javascript Tester Features:
- Code Test box
- Counts how many open brackets/parentheses and closed brackets/parentheses you have in your code to make sure that your code will work.
- New: Inspect Element
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Other Forum Systems · Next Topic »
Add Reply

Track Topic · E-mail Topic Time: 5:44 PM Sep 3
Hosted for free by ZetaBoards