ep_button_link
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -21,3 +21,3 @@ var settings = require('ep_etherpad-lite/node/utils/Settings'); | ||
ep_button_link.before = "#timesliderlink"; | ||
console.warn("No before set for ep_button_link, add ep_button_link.before to settings.json"); | ||
console.info("No before set for ep_button_link, this may be intentional, add ep_button_link.before to settings.json"); | ||
}else{ | ||
@@ -28,6 +28,11 @@ ep_button_link.before = settings.ep_button_link.before; | ||
ep_button_link.classes = "grouped-left"; | ||
console.warn("No classes set for ep_button_link, add ep_button_link.classes to settings.json"); | ||
console.info("No classes set for ep_button_link, this may be intentional, add ep_button_link.classes to settings.json"); | ||
}else{ | ||
ep_button_link.classes = settings.ep_button_link.classes; | ||
} | ||
if(!settings.ep_button_link.after){ | ||
console.info("No after set for ep_button_link, this may be intentional, add ep_button_link.classes to settings.json"); | ||
}else{ | ||
ep_button_link.after = settings.ep_button_link.after; | ||
} | ||
@@ -34,0 +39,0 @@ }else{ |
{ | ||
"name": "ep_button_link", | ||
"description": "Adds a button to the toolbar that links out to a new window", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"author": "johnyma22 (John McLear) <john@mclear.co.uk>", | ||
@@ -6,0 +6,0 @@ "dependencies": {}, |
@@ -14,3 +14,4 @@ # Add a button to the toolbar | ||
classes: "grouped-left", | ||
before: "#timesliderlink" | ||
before: "#timesliderlink", | ||
after: "#timesliderlink" | ||
} | ||
@@ -21,2 +22,5 @@ ``` | ||
classes = the css classes to apply to the button link | ||
before = The element to apply the button before in the DOM | ||
before = The element to drwa the button before in the DOM | ||
after = The element to draw the button after in the DOM | ||
Use either before or after.. |
@@ -6,7 +6,12 @@ exports.postAceInit = function(hook_name, args, cb) { | ||
var before = clientVars.ep_button_link.before; | ||
var after = clientVars.ep_button_link.after; | ||
var classes = clientVars.ep_button_link.classes; | ||
var button = "<li><a class='"+classes+"' target='_blank' href='"+link+"'><span id='ep_button_link_span' class='buttonicon'>" + text + "</span></a></li>"; | ||
$(before).parent().before(button); | ||
if(after){ | ||
$(after).parent().after(button); | ||
}else{ | ||
$(before).parent().before(button); | ||
} | ||
$('#ep_button_link_span').css({"background-image":"none", "width": "auto", "color":"#666", "font-size":"16px", "margin-top":"-3px"}); | ||
} |
4108
74
25