Recent Topics

AdminEndHtmlHead like function in skin files

Started by on Nov 21, 2010 – Contents updated: Nov 21, 2010

Nov 21, 2010 13:18    

My b2evolution Version: Not Entered

I need to insert and initiate some javascript on the admin side, mainly for enhancing usability and visuals of skin parameters.

Therefore i need a function like AdminEndHtmlHead that exists in plugins or a way to insert and initiate some javascript on the admin side, that i can use in the skin files.

Nov 21, 2010 16:04

class foo_Skin extends Skin{

function foo_Skin( $db_row = NULL, $skin_folder = NULL )
{
  parent::Skin( $db_row, $skin_folder );
  if( param( 'ctrl', 'string' ) == 'coll_settings' && param( 'tab', 'string' ) == 'skin_settings' )
  {
     require_js( 'whatever.js' );
  }
}

¥

Nov 25, 2010 21:08

¥åßßå wrote:

class foo_Skin extends Skin{

function foo_Skin( $db_row = NULL, $skin_folder = NULL )
{
  parent::Skin( $db_row, $skin_folder );
  if( param( 'ctrl', 'string' ) == 'coll_settings' && param( 'tab', 'string' ) == 'skin_settings' )
  {
     require_js( 'whatever.js' );
  }
}

¥

great. just a note the tab will be "skin" instead of "skin_settings"

Nov 28, 2010 01:53

Note: Also need an "AdminEndHtmlBody" function like SkinEndHtmlBody to execute javascripts those have to be right before body.

Nov 30, 2010 17:13

Why? Just use jQuery( document ).ready( function(){}); ?

¥

Nov 30, 2010 20:27

¥åßßå wrote:

Why? Just use jQuery( document ).ready( function(){}); ?

¥

well i have but somehow it did not work unless after it's executed after the selector i want to manipulate

Nov 30, 2010 20:58

Then you have a flaw in your code as the above executes after all "html" is loaded

¥

Nov 30, 2010 21:19

¥åßßå wrote:

Then you have a flaw in your code as the above executes after all "html" is loaded

¥

may be.. i finally got it working after reviewing my code, but it's still weird that it worked until after putting it below

Nov 30, 2010 21:42

Glad you found the flaw ;)

¥


Form is loading...

b2evolution CMS – This forum is powered by b2evolution CMS, a complete engine for your website.