Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter
Support for Vanilla Forums Cloud product

In this Discussion

Follow Us


Adding Javascript and Getting HelloBar to Work

leogopalleogopal New
edited May 2012 in Questions

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

  • 422422 Developer MVP

    Default.master.php or use pockets plugin.

    422 Real Estate Australia , now open Check it out

  • 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 Developer 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

    422 Real Estate Australia , now open Check it out

  • 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 );
    });
    

    Monetary Donations will be appreciated if you use my plugins. Thanks in Advance.
    As a waiter gets a tip for a good meal, tips for successful solutions appreciated as well. Peregrine

Sign In or Register to comment.