Member
Member
codedface   2008-01-16, 18:18
#1
Hi Everyone,
I'm not sure how/when this happened but the Options Tab in my Zen Photo is broken. When I click on the tab all I see are the the other four tabs 'admin...', 'gallery...', 'image...', 'theme...'
Any clues?
Member
Member
sbillard   2008-01-16, 18:23
#2
Usually this is caused by not loading the js scripts. Be sure that all the files and folders of the distribution zp-core folder have been uploaded.
Member
Member
codedface   2008-01-16, 18:49
#3
WOW that was fast! Thanks!
I forgot that when I integrated my theme I was getting lots of js errors in admin.js and I commented the fabtabs out. I even added a comment "I dont think I need this", lol
Now I'm back to the error in my theme. I must be missing a js file when it loads the gallery. I'd rather turn fabtabs off if its not needed.

Error:
'Class is not defined'
var Fabtabs = Class.create();
Member
Member
codedface   2008-01-16, 19:01
#4
Looks like its throwing js errors everywhere outside of the Options Tab.
The admin page errors are:

"this.element has no properties"
this.menu = $A(this.element.getElementsByTagName('a'));
Member
Member
codedface   2008-01-16, 19:24
#5
FYI - I fixed it by adding two checks in admin.js lines 293+

if (typeof Class != "undefined"){ <------Added this check
var Fabtabs = Class.create();

Fabtabs.prototype = {
initialize : function(element) {
this.element = $(element);
var options = Object.extend({}, arguments[1] || {});
if(this.element){ <----------- And this one
...
You guys might want to add this as a bugfix (after testing of course Smile)

Thanks for your help on the tabs
Member
Member
sbillard   2008-01-17, 01:31
#6
This looks good. But, some questions:

Where are the close braces for the two lines you added? Maybe the best thing is for you to create a ticket and attach your modified admin.js file. Would you mind doing that?
Member
Member
codedface   2008-01-17, 01:47
#7
Yes those where the only two lines added with proper close brackets Smile

I tried creating a ticket but I did not have privileges

http://www.zenphoto.org/trac/newticket

Here's the whole code for FabTabs in admin.js. Hope this helps

/*
* Fabtabulous! Simple tabs using Prototype
* http://tetlaw.id.au/view/blog/fabtabulous-simple-tabs-using-prototype/
* Andrew Tetlaw
* version 1.1 2006-05-06
* http://creativecommons.org/licenses/by-sa/2.5/
*/

if (typeof Class != "undefined"){
var Fabtabs = Class.create();

Fabtabs.prototype = {
initialize : function(element) {
this.element = $(element);
var options = Object.extend({}, arguments[1] || {});
if(this.element){
this.menu = $A(this.element.getElementsByTagName('a'));
this.show(this.getInitialTab());
this.menu.each(this.setupTab.bind(this));
}
},
setupTab : function(elm) {
Event.observe(elm,'click',this.activate.bindAsEventListener(this),false)
},
activate : function(ev) {
var elm = Event.findElement(ev, "a");
Event.stop(ev);
this.show(elm);
this.menu.without(elm).each(this.hide.bind(this));
},
hide : function(elm) {
$(elm).removeClassName('active-tab');
$(this.tabID(elm)).removeClassName('active-tab-body');
},
show : function(elm) {
$(elm).addClassName('active-tab');
$(this.tabID(elm)).addClassName('active-tab-body');

},
tabID : function(elm) {
return elm.href.match(/#(\w.+)/)[1];
},
getInitialTab : function() {
if(document.location.href.match(/#(\w.+)/)) {
var loc = RegExp.$1;
var elm = this.menu.find(function(value) { return value.href.match(/#(\w.+)/)[1] == loc; });
return elm || this.menu.first();
} else {
return this.menu.first();
}
}
}

Event.observe(window,'load',function(){ new Fabtabs('tabs'); },false);
Member
Member
sbillard   2008-01-17, 03:40
#8
Thanks. This seems to be working.

If you are interested, there is another set of js errors that need to be found and stomped out: http://www.zenphoto.org/trac/ticket/325.

You need to register to be able to create tickets--we were getting too much spam in our tickets! http://www.zenphoto.org/support/topic.php?id=1320&replies=2
Member
Member
codedface   2008-01-17, 05:03
#9
I registered. I'll check them out.
thanx again.
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.