Adding Javascript and Getting HelloBar to Work

leogopalleogopal New
edited May 2012 in Vanilla 2.0 - 2.8

Hi guys -

I just purchased hello bar solo -
And am trying to get it to work on my forum -
www.hypnosisforum.co.za

But I can not for the life of me figure out how to get it to work -
I am using the bootstrap theme - http://vanillaforums.org/addon/bootstrap-theme

this is how hello bar asks to be installed >
Step 1 -

[link type="text/css" rel="stylesheet" href="hellobar-solo/hellobar.css" /]
[script type="text/javascript" src="hellobar-solo/hellobar.js"][/script]

[/head]

Step 2

script type="text/javascript"
new HelloBar( "Enter your Hello Bar's message here", {
showWait: 1000
}, 1.0 );
script

[/body]

And finally setting up the specific bar -

No clue where to put the latter code or get any of this working well on my site -

Please Help!

Answers

  • Default.master.php or use pockets plugin.

    There was an error rendering this rich post.

  • I tried that - in the default.master.tpl file - and when I add it before the end body tag i get a bonk error

  • Don't add javascript text in default master and you will get bonk, try to add it in themehooks

  • 422422 MVP
    edited May 2012

    Not sure why that would be the case..perhaps elaborate.

    To the OP.

    download example addon in addon section. You can deploy it that way.

    http://vanillaforums.org/addon/example-plugin

    There was an error rendering this rich post.

  • create a plugin
    
    <?php if (!defined('APPLICATION'))  exit();
    
    
    // Define the plugin:
    $PluginInfo['HelloBar'] = array(
        'Name' => 'HelloBar',
        'Description' => 'HelloBar add-on',
        'Version' => '1.0',
        'RequiredApplications' => FALSE,
        'RequiredTheme' => FALSE,
        'RequiredPlugins' => FALSE,
    
    );
    
    class HelloBarPlugin extends Gdn_Plugin {
    
    
    // change the controller to wherever you want it to appear
    public function Base_Render_Before($Sender) {
            $Sender->AddJsFile('/plugins/HelloBar/js/hellobar.js');
            $Sender->AddJsFile('/plugins/HelloBar/js/hellobar2.js');
            $Sender->AddCssFile('/plugins/HelloBar/design/hellobar.css');
    
    }
    
    
    
    
    
    }
    
    
    
    ---
    
    hellobar2.js
    
    jQuery(document).ready(function($) {
        new HelloBar( "Enter your Hello Bar's message here", {
            showWait: 1000
        }, 1.0 );
    });
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.