Unable to save custom plugins - Better Battlelog Forums #128687

Sitemap
Post edited 1 x times, last by
Topicstarter
Well ....No matter if your plugin works or not (or consider your domchange block is empty)....if it has a unique id ...it should save after clicking Enable plugin...and load up in BBlog control panel after page refresh .....but it doesn't ...


After clicking Enable plugin it shows a green panel ...saying "your plugin has been saved" or something like that


But it doesn't show up in control panel..

So anything I might be doing wrong or its a bug??

I'm using latest dev edition plugin

Also..I'm getting into plugin development and hope to be part of BBlog dev team ...Can I get access to full BBlog source code ....as I can go through it and won't need to start development from scratch..
Plugins only show in bblog options sidebar if they have options (configFlags) to show.
That is a expected behaviour.
Post edited 1 x times, last by
Topicstarter
Well this is what I'm tryin' to make...
A "go to page" option in page navigator.

Am I doing something wrong..

// initialize your plugin
BBLog.handle("add.plugin", {

/**
* The unique, lowercase id of my plugin
* Allowed chars: 0-9, a-z, -
*/
id : "zeharti",

/**
* The name of my plugin, used to show config values in bblog options
* Could also be translated with the translation key "plugin.name" (optional)
*
* @type String
*/
name : "Add page navigator",



configFlags : [
{"key" : "Enabledemo", "init" : 1},


],


init : function(instance){
// some log to the console to show you how the things work
console.log(
"plugin."+instance.id+".init",
instance.t("my.option"),
instance.storage("foo.bar"),
instance.storage("my.option"),
instance.cache("cache.test"),
instance.storage("permanent.test")
);
// testdata
instance.cache("cache.test", Math.random());
instance.storage("permanent.test", Math.random());
},

//This code is supposed to add a "Go to Page" input element and "Go" Button at the Page navigator section in Forums
domchange : function(instance){
var input=document.createElement("input");
input.type="text";
input.id="sad";

var button=document.createElement("button");
button.onclick="gotopage()"
var text=document.createTextNode("Go");
button.appendChild(text);



var a=document.createElement("a");
a.id="mainlink"
var mainlink=document.getElementByClassName("").href;
a.href=mainlink;

var newdiv=document.createElement("div");
newdiv.appendChild(input);
newdiv.appendChild(button);
newdiv.appendChild(a);

var maindiv=document.getElementByClassName("pagination-pagination-right");
maindiv[1].appendChild(newdiv);

function gotopage(){
var input=document.getElementById("sad").value;

document.getElementById("mainlink").href+=input;

document.getElementById("mainlink").click();

}


},



storage : function(key, value){}
});
I highly recommend to learn jQuery syntax.
BBLog and Battlelog is based on this JS framework.

Than most of your questions will be solved.

Best school for that
http://try.jquery.com/
Topicstarter
Ok,many Thanks!!