Skip to content

Commit

Permalink
Module default enabled state in DEFAULT_ENABLED = true/false property.
Browse files Browse the repository at this point in the history
isModuleEnabled method expects module (not module name) as an argument.

git-svn-id: https://foxtrick.googlecode.com/svn/trunk@210 1e3807c3-0949-0410-b78e-337b627472c1
  • Loading branch information
kkolman committed Dec 17, 2008
1 parent d354bec commit daaf778
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion content/forum/forummovelinks.js
Expand Up @@ -90,7 +90,7 @@ var FoxtrickMoveLinks = {
cfHeader.childNodes[0].insertBefore(space,authorLink.nextSibling);
}
// If avatar is also hidden, change class of message
if(Foxtrick.isModuleEnabled( FoxtrickHideManagerAvatar.MODULE_NAME )) {
if(Foxtrick.isModuleEnabled( FoxtrickHideManagerAvatar )) {
elems = doc.getElementsByTagName("div");
for(var k=0; k < elems.length; k++) {
if(elems[k].getAttribute("class")=="cfUser") {
Expand Down
7 changes: 4 additions & 3 deletions content/foxtrick.js
Expand Up @@ -40,7 +40,7 @@ var FoxtrickMain = {
var module = Foxtrick.modules[i];
// if module has an init() function and is enabled
if ( module.MODULE_NAME
&& Foxtrick.isModuleEnabled( module.MODULE_NAME )
&& Foxtrick.isModuleEnabled( module )
&& module.init )
{
try {
Expand Down Expand Up @@ -233,9 +233,10 @@ String.prototype.group = function( chr, size )
return this.split( '' ).reverse().join( '' ).replace( new RegExp( "(.{" + size + "})(?!$)", "g" ), "$1" + chr ).split( '' ).reverse().join( '' );
}

Foxtrick.isModuleEnabled = function( module_name ) {
Foxtrick.isModuleEnabled = function( module ) {
try {
return FoxtrickPrefs.getBool( "module." + module_name + ".enabled" );
var val = FoxtrickPrefs.getBool( "module." + module.MODULE_NAME + ".enabled" );
return (val != null) ? val : module.DEFAULT_ENABLED;
} catch( e ) {
return false;
}
Expand Down

0 comments on commit daaf778

Please sign in to comment.