first commit

This commit is contained in:
John McLear 2012-11-10 10:30:50 -08:00
commit d1a0c1e1f0
6 changed files with 106 additions and 0 deletions

1
.ep_initialized Normal file
View file

@ -0,0 +1 @@
done

13
ep.json Normal file
View file

@ -0,0 +1,13 @@
{
"parts": [
{
"name": "page_view",
"client_hooks": {
"postAceInit": "ep_page_view/static/js/page_view:postAceInit"
},
"hooks": {
"eejsBlock_mySettings": "ep_page_view/page_view"
}
}
]
}

42
package.json Normal file
View file

@ -0,0 +1,42 @@
{
"name": "ep_page_view",
"description": "Add support to do 'page view', with a toggle on/off option in Settings",
"homepage": "https://github.com/johnyma22/ep_page_view",
"keywords": [
"page",
"view",
"zoom",
"preview",
"overview"
],
"author": {
"name": "John McLear",
"email": "john@mclear.co.uk",
"url": "http://mclear.co.uk"
},
"version": "0.0.3",
"repository": {
"type": "git",
"url": "git://github.com/johnyma22/ep_page_view.git"
},
"dependencies": {},
"devDependencies": {},
"optionalDependencies": {},
"engines": {
"node": "*"
},
"_id": "ep_page_view@0.0.3",
"_engineSupported": true,
"_npmVersion": "1.1.24",
"_nodeVersion": "v0.8.8",
"_defaultsLoaded": true,
"dist": {
"shasum": "b1c99e29f18a449ee044194aacd5af50c7aeb8a8"
},
"_from": "ep_page_view",
"readme": "ERROR: No README.md file found!",
"_npmUser": {
"name": "johnyma22",
"email": "john@mclear.co.uk"
}
}

7
page_view.js Normal file
View file

@ -0,0 +1,7 @@
var eejs = require('ep_etherpad-lite/node/eejs/');
exports.eejsBlock_mySettings = function (hook_name, args, cb) {
args.content = args.content + eejs.require("ep_page_view/templates/settingsButtons.ejs");
return cb();
}

41
static/js/page_view.js Normal file
View file

@ -0,0 +1,41 @@
var postAceInit = function(hook, context){
/* Check on Init */
if($('#options-pageview').attr('checked')) {
enablePageView();
} else {
disablePageView();
}
/* Check on Cilck */
$('#options-pageview').on('click', function(){
if($('#options-pageview').attr('checked')) {
enablePageView();
} else {
disablePageView();
}
});
function enablePageView(){
$('#sidediv').css("border-right", "1px solid #ccc");
$('#editorcontainer').css("background-color","#f7f7f7");
$('#editorcontainer').css("text-align","center");
$('iframe').css("border", "#CCCCCC solid 1px");
$('iframe').css("position","relative");
$('iframe').css("border-radius", "5px");
$('iframe').css("box-shadow", "0 2px 5px #ddd");
$('iframe').css("width","800px");
$('iframe').css("top","27px");
$('iframe').css("bottom","0px");
}
function disablePageView(){
$('iframe').css("border-radius", "0px");
$('iframe').css("border", "#CCCCCC solid 0px");
$('iframe').css("box-shadow", "0px 0px 0px 0px #ddd");
$('#sidediv').css("border-right", "0px solid #ccc");
$('iframe').css("width","100%");
$('iframe').css("top","0px");
}
};
exports.postAceInit = postAceInit;

View file

@ -0,0 +1,2 @@
<input type="checkbox" id="options-pageview"></input>
<label for="options-pageview">Page View</label>