ep_comments_page
Advanced tools
Comparing version 0.0.9 to 0.0.11
@@ -17,2 +17,3 @@ { | ||
"eejsBlock_scripts": "ep_comments_page/index", | ||
"eejsBlock_mySettings": "ep_comments_page/index", | ||
"eejsBlock_styles": "ep_comments_page/index" | ||
@@ -19,0 +20,0 @@ } |
@@ -59,2 +59,7 @@ var eejs = require('ep_etherpad-lite/node/eejs/'); | ||
exports.eejsBlock_mySettings = function (hook_name, args, cb) { | ||
args.content = args.content + eejs.require("ep_comments_page/templates/settings.ejs"); | ||
return cb(); | ||
}; | ||
exports.eejsBlock_editbarMenuLeft = function (hook_name, args, cb) { | ||
@@ -61,0 +66,0 @@ args.content = args.content + eejs.require("ep_comments_page/templates/commentBarButtons.ejs"); |
{ | ||
"description": "Adds comments on sidebar and link it to the text. Support for Page View, requires ep_page_view", | ||
"name": "ep_comments_page", | ||
"version": "0.0.9", | ||
"version": "0.0.11", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Nicolas Lescop", |
@@ -5,2 +5,4 @@ var _, $, jQuery; | ||
var _ = require('ep_etherpad-lite/static/js/underscore'); | ||
var padcookie = require('ep_etherpad-lite/static/js/pad_cookie').padcookie; | ||
var cssFiles = ['ep_comments_page/static/css/comment.css']; | ||
@@ -103,2 +105,21 @@ | ||
// Enable and handle cookies | ||
if (padcookie.getPref("comments") === false) { | ||
self.container.hide(); | ||
$('#options-comments').attr('checked','unchecked'); | ||
$('#options-comments').attr('checked',false); | ||
}else{ | ||
$('#options-comments').attr('checked','checked'); | ||
} | ||
$('#options-comments').on('click', function() { | ||
if($('#options-comments').is(':checked')) { | ||
padcookie.setPref("comments", true); | ||
self.container.show(); | ||
} else { | ||
padcookie.setPref("comments", false); | ||
self.container.hide(); | ||
} | ||
}); | ||
}; | ||
@@ -128,3 +149,3 @@ | ||
// make sure comments aer visible on the page | ||
container.show(); | ||
// container.show(); | ||
container.addClass("active"); | ||
@@ -131,0 +152,0 @@ self.padInner.contents().find("#innerdocbody").addClass("comments"); |
40862
17
912