diff --git a/settings.json.template b/settings.json.template
index b1c2404fe..897533f51 100644
--- a/settings.json.template
+++ b/settings.json.template
@@ -68,7 +68,7 @@
"maxAge" : 21600, // 60 * 60 * 6 = 6 hours
/* This is the path to the Abiword executable. Setting it to null, disables abiword.
- Abiword is needed to enable the import/export of pads*/
+ Abiword is needed to advanced import/export features of pads*/
"abiword" : null,
/* This setting is used if you require authentication of all users.
diff --git a/src/locales/en.ini b/src/locales/en.ini
index e542594da..82b429f8a 100644
--- a/src/locales/en.ini
+++ b/src/locales/en.ini
@@ -21,6 +21,9 @@ pad.toolbar.showusers.title = Show the users on this pad
pad.colorpicker.save = Save
pad.colorpicker.cancel = Cancel
pad.loading = Loading...
+pad.passwordRequired = You need a password to access this pad
+pad.permissionDenied = You do not have permission to access this pad
+pad.wrongPassword = Your password was wrong
pad.settings.padSettings = Pad Settings
pad.settings.myView = My View
pad.settings.stickychat = Chat always on screen
@@ -41,6 +44,7 @@ pad.importExport.exportword = Microsoft Word
pad.importExport.exportpdf = PDF
pad.importExport.exportopen = ODF (Open Document Format)
pad.importExport.exportdokuwiki = DokuWiki
+pad.importExport.abiword.innerHTML = You only can import from plain text or html formats. For more advanced import features please install abiword.
pad.modals.connected = Connected.
pad.modals.reconnecting = Reconnecting to your pad..
pad.modals.forcereconnect = Force reconnect
diff --git a/src/locales/es.ini b/src/locales/es.ini
index d698b752c..ad8340136 100644
--- a/src/locales/es.ini
+++ b/src/locales/es.ini
@@ -46,6 +46,7 @@ pad.importExport.exportword = Microsoft Word
pad.importExport.exportpdf = PDF
pad.importExport.exportopen = ODF (Open Document Format)
pad.importExport.exportdokuwiki = DokuWiki
+pad.importExport.abiword.innerHTML = Sólo puede importar formatos de texto plano o html. Para funciones más avanzadas instale abiword.
pad.modals.connected = Conectado.
pad.modals.reconnecting = Reconectando a tu pad..
pad.modals.forcereconnect = Reconexión forzosa
diff --git a/src/node/db/SecurityManager.js b/src/node/db/SecurityManager.js
index 59e27b550..4289e39ca 100644
--- a/src/node/db/SecurityManager.js
+++ b/src/node/db/SecurityManager.js
@@ -25,7 +25,7 @@ var async = require("async");
var authorManager = require("./AuthorManager");
var padManager = require("./PadManager");
var sessionManager = require("./SessionManager");
-var settings = require("../utils/Settings")
+var settings = require("../utils/Settings");
var randomString = require('ep_etherpad-lite/static/js/pad_utils').randomString;
/**
@@ -83,7 +83,7 @@ exports.checkAccess = function (padID, sessionCookie, token, password, callback)
// grant access, with author of token
callback(null, statusObject);
}
- })
+ });
//don't continue
return;
@@ -133,10 +133,16 @@ exports.checkAccess = function (padID, sessionCookie, token, password, callback)
var now = Math.floor(new Date().getTime()/1000);
//is it for this group?
- if(sessionInfo.groupID != groupID) return;
+ if(sessionInfo.groupID != groupID) {
+ callback();
+ return;
+ }
//is validUntil still ok?
- if(sessionInfo.validUntil <= now) return;
+ if(sessionInfo.validUntil <= now){
+ callback();
+ return;
+ }
// There is a valid session
validSession = true;
@@ -282,4 +288,4 @@ exports.checkAccess = function (padID, sessionCookie, token, password, callback)
if(ERR(err, callback)) return;
callback(null, statusObject);
});
-}
+};
diff --git a/src/node/eejs/index.js b/src/node/eejs/index.js
index 7b43de634..48185d80b 100644
--- a/src/node/eejs/index.js
+++ b/src/node/eejs/index.js
@@ -28,18 +28,25 @@ var resolve = require("resolve");
exports.info = {
buf_stack: [],
block_stack: [],
- blocks: {},
file_stack: [],
args: []
};
+function getCurrentFile() {
+ return exports.info.file_stack[exports.info.file_stack.length-1];
+}
+
+function createBlockId(name) {
+ return getCurrentFile().path + '|' + name;
+}
+
exports._init = function (b, recursive) {
exports.info.buf_stack.push(exports.info.buf);
exports.info.buf = b;
}
exports._exit = function (b, recursive) {
- exports.info.file_stack[exports.info.file_stack.length-1].inherit.forEach(function (item) {
+ getCurrentFile().inherit.forEach(function (item) {
exports._require(item.name, item.args);
});
exports.info.buf = exports.info.buf_stack.pop();
@@ -59,29 +66,17 @@ exports.end_capture = function () {
}
exports.begin_define_block = function (name) {
- if (typeof exports.info.blocks[name] == "undefined")
- exports.info.blocks[name] = {};
exports.info.block_stack.push(name);
exports.begin_capture();
}
-exports.super = function () {
- exports.info.buf.push('');
-}
-
exports.end_define_block = function () {
content = exports.end_capture();
- var name = exports.info.block_stack.pop();
- if (typeof exports.info.blocks[name].content == "undefined")
- exports.info.blocks[name].content = content;
- else if (typeof exports.info.blocks[name].content.indexOf(''))
- exports.info.blocks[name].content = exports.info.blocks[name].content.replace('', content);
-
- return exports.info.blocks[name].content;
+ return content;
}
exports.end_block = function () {
- var name = exports.info.block_stack[exports.info.block_stack.length-1];
+ var name = exports.info.block_stack.pop();
var renderContext = exports.info.args[exports.info.args.length-1];
var args = {content: exports.end_define_block(), renderContext: renderContext};
hooks.callAll("eejsBlock_" + name, args);
@@ -91,7 +86,7 @@ exports.end_block = function () {
exports.begin_block = exports.begin_define_block;
exports.inherit = function (name, args) {
- exports.info.file_stack[exports.info.file_stack.length-1].inherit.push({name:name, args:args});
+ getCurrentFile().inherit.push({name:name, args:args});
}
exports.require = function (name, args, mod) {
@@ -101,7 +96,7 @@ exports.require = function (name, args, mod) {
var paths = [];
if (exports.info.file_stack.length) {
- basedir = path.dirname(exports.info.file_stack[exports.info.file_stack.length-1].path);
+ basedir = path.dirname(getCurrentFile().path);
}
if (mod) {
basedir = path.dirname(mod.filename);
diff --git a/src/node/handler/ImportHandler.js b/src/node/handler/ImportHandler.js
index 788706ce7..db82eac72 100644
--- a/src/node/handler/ImportHandler.js
+++ b/src/node/handler/ImportHandler.js
@@ -4,6 +4,7 @@
/*
* 2011 Peter 'Pita' Martischka (Primary Technology Ltd)
+ * 2012 Iván Eixarch
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,26 +19,23 @@
* limitations under the License.
*/
-var ERR = require("async-stacktrace");
-var padManager = require("../db/PadManager");
-var padMessageHandler = require("./PadMessageHandler");
-var async = require("async");
-var fs = require("fs");
-var settings = require('../utils/Settings');
-var formidable = require('formidable');
-var os = require("os");
+var ERR = require("async-stacktrace")
+ , padManager = require("../db/PadManager")
+ , padMessageHandler = require("./PadMessageHandler")
+ , async = require("async")
+ , fs = require("fs")
+ , path = require("path")
+ , settings = require('../utils/Settings')
+ , formidable = require('formidable')
+ , os = require("os")
+ , importHtml = require("../utils/ImportHtml");
//load abiword only if its enabled
if(settings.abiword != null)
var abiword = require("../utils/Abiword");
-var tempDirectory = "/tmp/";
-
-//tempDirectory changes if the operating system is windows
-if(os.type().indexOf("Windows") > -1)
-{
- tempDirectory = process.env.TEMP;
-}
+//for node 0.6 compatibily, os.tmpDir() only works from 0.8
+var tmpDirectory = process.env.TEMP || process.env.TMPDIR || process.env.TMP || '/tmp';
/**
* do a requested import
@@ -45,32 +43,28 @@ if(os.type().indexOf("Windows") > -1)
exports.doImport = function(req, res, padId)
{
//pipe to a file
- //convert file to text via abiword
- //set text in the pad
+ //convert file to html via abiword
+ //set html in the pad
- var srcFile, destFile;
- var pad;
- var text;
+ var srcFile, destFile
+ , pad
+ , text;
async.series([
//save the uploaded file to /tmp
- function(callback)
- {
+ function(callback) {
var form = new formidable.IncomingForm();
form.keepExtensions = true;
- form.uploadDir = tempDirectory;
+ form.uploadDir = tmpDirectory;
- form.parse(req, function(err, fields, files)
- {
+ form.parse(req, function(err, fields, files) {
//the upload failed, stop at this point
- if(err || files.file === undefined)
- {
+ if(err || files.file === undefined) {
console.warn("Uploading Error: " + err.stack);
callback("uploadFailed");
}
//everything ok, continue
- else
- {
+ else {
//save the path of the uploaded file
srcFile = files.file.path;
callback();
@@ -80,57 +74,48 @@ exports.doImport = function(req, res, padId)
//ensure this is a file ending we know, else we change the file ending to .txt
//this allows us to accept source code files like .c or .java
- function(callback)
- {
- var fileEnding = (srcFile.split(".")[1] || "").toLowerCase();
- var knownFileEndings = ["txt", "doc", "docx", "pdf", "odt", "html", "htm"];
-
- //find out if this is a known file ending
- var fileEndingKnown = false;
- for(var i in knownFileEndings)
- {
- if(fileEnding == knownFileEndings[i])
- {
- fileEndingKnown = true;
- }
- }
+ function(callback) {
+ var fileEnding = path.extname(srcFile).toLowerCase()
+ , knownFileEndings = [".txt", ".doc", ".docx", ".pdf", ".odt", ".html", ".htm"]
+ , fileEndingKnown = (knownFileEndings.indexOf(fileEnding) > -1);
//if the file ending is known, continue as normal
- if(fileEndingKnown)
- {
+ if(fileEndingKnown) {
callback();
}
//we need to rename this file with a .txt ending
- else
- {
+ else {
var oldSrcFile = srcFile;
- srcFile = srcFile.split(".")[0] + ".txt";
+ srcFile = path.join(path.dirname(srcFile),path.basename(srcFile, fileEnding)+".txt");
fs.rename(oldSrcFile, srcFile, callback);
}
},
- //convert file to text
- function(callback)
- {
+ //convert file to html
+ function(callback) {
var randNum = Math.floor(Math.random()*0xFFFFFFFF);
- destFile = tempDirectory + "eplite_import_" + randNum + ".txt";
- abiword.convertFile(srcFile, destFile, "txt", function(err){
- //catch convert errors
- if(err){
- console.warn("Converting Error:", err);
- return callback("convertFailed");
- } else {
- callback();
- }
- });
+ destFile = path.join(tmpDirectory, "eplite_import_" + randNum + ".htm");
+
+ if (abiword) {
+ abiword.convertFile(srcFile, destFile, "htm", function(err) {
+ //catch convert errors
+ if(err) {
+ console.warn("Converting Error:", err);
+ return callback("convertFailed");
+ } else {
+ callback();
+ }
+ });
+ } else {
+ // if no abiword only rename
+ fs.rename(srcFile, destFile, callback);
+ }
},
//get the pad object
- function(callback)
- {
- padManager.getPad(padId, function(err, _pad)
- {
+ function(callback) {
+ padManager.getPad(padId, function(err, _pad){
if(ERR(err, callback)) return;
pad = _pad;
callback();
@@ -138,52 +123,47 @@ exports.doImport = function(req, res, padId)
},
//read the text
- function(callback)
- {
- fs.readFile(destFile, "utf8", function(err, _text)
- {
+ function(callback) {
+ fs.readFile(destFile, "utf8", function(err, _text){
if(ERR(err, callback)) return;
text = _text;
//node on windows has a delay on releasing of the file lock.
//We add a 100ms delay to work around this
- if(os.type().indexOf("Windows") > -1)
- {
- setTimeout(function()
- {
- callback();
- }, 100);
- }
- else
- {
- callback();
- }
+ if(os.type().indexOf("Windows") > -1){
+ setTimeout(function() {callback();}, 100);
+ } else {
+ callback();
+ }
});
},
//change text of the pad and broadcast the changeset
- function(callback)
- {
- pad.setText(text);
+ function(callback) {
+ var fileEnding = path.extname(srcFile).toLowerCase();
+ if (abiword || fileEnding == ".htm" || fileEnding == ".html") {
+ importHtml.setPadHTML(pad, text);
+ } else {
+ pad.setText(text);
+ }
padMessageHandler.updatePadClients(pad, callback);
},
//clean up temporary files
- function(callback)
- {
+ function(callback) {
+ //for node < 0.7 compatible
+ var fileExists = fs.exists || path.exists;
async.parallel([
- function(callback)
- {
- fs.unlink(srcFile, callback);
+ function(callback){
+ fileExists (srcFile, function(exist) { (exist)? fs.unlink(srcFile, callback): callback(); });
},
- function(callback)
- {
- fs.unlink(destFile, callback);
+ function(callback){
+ fileExists (destFile, function(exist) { (exist)? fs.unlink(destFile, callback): callback(); });
}
], callback);
}
- ], function(err)
- {
+ ], function(err) {
+
var status = "ok";
//check for known errors and replace the status
@@ -196,6 +176,6 @@ exports.doImport = function(req, res, padId)
ERR(err);
//close the connection
- res.send("", 200);
+ res.send("", 200);
});
}
diff --git a/src/node/hooks/express.js b/src/node/hooks/express.js
index 2bbb5eec8..033bd5e36 100644
--- a/src/node/hooks/express.js
+++ b/src/node/hooks/express.js
@@ -66,8 +66,6 @@ exports.restartServer = function () {
} else {
- console.log( "SSL -- not enabled!" );
-
var http = require('http');
server = http.createServer(app);
}
diff --git a/src/node/hooks/express/importexport.js b/src/node/hooks/express/importexport.js
index 9e78f34d7..9754ffa64 100644
--- a/src/node/hooks/express/importexport.js
+++ b/src/node/hooks/express/importexport.js
@@ -28,12 +28,6 @@ exports.expressCreateServer = function (hook_name, args, cb) {
//handle import requests
args.app.post('/p/:pad/import', function(req, res, next) {
- //if abiword is disabled, skip handling this request
- if(settings.abiword == null) {
- next();
- return;
- }
-
hasPadAccess(req, res, function() {
importHandler.doImport(req, res, req.params.pad);
});
diff --git a/src/node/hooks/express/webaccess.js b/src/node/hooks/express/webaccess.js
index 41bf38805..50323ef6f 100644
--- a/src/node/hooks/express/webaccess.js
+++ b/src/node/hooks/express/webaccess.js
@@ -15,8 +15,8 @@ exports.basicAuth = function (req, res, next) {
}
var authorize = function (cb) {
- // Do not require auth for static paths...this could be a bit brittle
- if (req.path.match(/^\/(static|javascripts|pluginfw)/)) return cb(true);
+ // Do not require auth for static paths and the API...this could be a bit brittle
+ if (req.path.match(/^\/(static|javascripts|pluginfw|api)/)) return cb(true);
if (req.path.indexOf('/admin') != 0) {
if (!settings.requireAuthentication) return cb(true);
diff --git a/src/node/hooks/i18n.js b/src/node/hooks/i18n.js
index 4d42de048..a45d46fee 100644
--- a/src/node/hooks/i18n.js
+++ b/src/node/hooks/i18n.js
@@ -1,4 +1,4 @@
-var languages = require('languages')
+var languages = require('languages4translatewiki')
, fs = require('fs')
, path = require('path')
, express = require('express')
@@ -8,22 +8,23 @@ var localesPath = __dirname+"/../../locales";
// Serve English strings directly with /locales.ini
var localeIndex = fs.readFileSync(localesPath+'/en.ini')+'\r\n';
-// add language base 'en' to availableLangs
-exports.availableLangs = {en: languages.getLanguageInfo('en')}
+exports.availableLangs = {'en': {'nativeName': 'English', 'direction': 'ltr'}};
fs.readdir(localesPath, function(er, files) {
files.forEach(function(locale) {
- locale = locale.split('.')[0]
- if(locale.toLowerCase() == 'en') return;
+ var ext = path.extname(locale);
+ locale = path.basename(locale, ext).toLowerCase();
+ if(locale == 'en' || ext != '.ini') return;
// build locale index
localeIndex += '['+locale+']\r\n@import url(locales/'+locale+'.ini)\r\n'
- // add info language {name, nativeName, direction} to availableLangs
+ // add info language {nativeName, direction} to availableLangs
exports.availableLangs[locale]=languages.getLanguageInfo(locale);
})
})
+
exports.expressCreateServer = function(n, args) {
args.app.use('/locales', express.static(localesPath));
diff --git a/src/package.json b/src/package.json
index 8f7620773..d2b03a97a 100644
--- a/src/package.json
+++ b/src/package.json
@@ -11,32 +11,32 @@
{ "name": "Marcel Klehr" }
],
"dependencies" : {
- "yajsml" : "1.1.6",
- "request" : "2.9.100",
- "require-kernel" : "1.0.5",
- "resolve" : "0.2.x",
- "socket.io" : "0.9.x",
- "ueberDB" : "0.1.8",
- "async" : "0.1.x",
- "express" : "3.x",
- "connect" : "2.4.x",
- "clean-css" : "0.3.2",
- "uglify-js" : "1.2.5",
- "formidable" : "1.0.9",
- "log4js" : "0.5.x",
- "jsdom-nocontextifiy" : "0.2.10",
- "async-stacktrace" : "0.0.2",
- "npm" : "1.1.x",
- "npm-registry-client" : "0.2.10",
- "ejs" : "0.6.1",
- "graceful-fs" : "1.1.5",
- "slide" : "1.1.3",
- "semver" : "1.0.13",
- "security" : "1.0.0",
- "tinycon" : "0.0.1",
- "underscore" : "1.3.1",
- "unorm" : "1.0.0",
- "languages" : "0.1.1"
+ "yajsml" : "1.1.6",
+ "request" : "2.9.100",
+ "require-kernel" : "1.0.5",
+ "resolve" : "0.2.x",
+ "socket.io" : "0.9.x",
+ "ueberDB" : "0.1.8",
+ "async" : "0.1.x",
+ "express" : "3.x",
+ "connect" : "2.4.x",
+ "clean-css" : "0.3.2",
+ "uglify-js" : "1.2.5",
+ "formidable" : "1.0.9",
+ "log4js" : "0.5.x",
+ "jsdom-nocontextifiy" : "0.2.10",
+ "async-stacktrace" : "0.0.2",
+ "npm" : "1.1.x",
+ "npm-registry-client" : "0.2.10",
+ "ejs" : "0.6.1",
+ "graceful-fs" : "1.1.5",
+ "slide" : "1.1.3",
+ "semver" : "1.0.13",
+ "security" : "1.0.0",
+ "tinycon" : "0.0.1",
+ "underscore" : "1.3.1",
+ "unorm" : "1.0.0",
+ "languages4translatewiki" : "0.1.3"
},
"bin": { "etherpad-lite": "./node/server.js" },
"devDependencies": {
diff --git a/src/static/css/pad.css b/src/static/css/pad.css
index 64f9f0d44..bb8da99b6 100644
--- a/src/static/css/pad.css
+++ b/src/static/css/pad.css
@@ -22,6 +22,7 @@ iframe {
.readonly .acl-write {
display: none;
}
+
#users {
background: #f7f7f7;
background: -webkit-linear-gradient( #F7F7F7,#EEE);
@@ -190,6 +191,19 @@ a img {
height: 30px;
z-index: 100;
}
+
+#editorloadingbox .passForm{
+ padding:10px;
+}
+
+#editorloadingbox input{
+ padding:10px;
+}
+
+#editorloadingbox button{
+ padding:10px;
+}
+
#editorcontainerbox {
position: absolute;
bottom: 0;
@@ -571,15 +585,20 @@ table#otheruserstable {
#exportdokuwiki {
background-position: 0px -459px
}
-#importstatusball {
- display: none
+
+/* hidden element */
+#importstatusball,
+#importarrow,
+#importmessagesuccess,
+#importmessageabiword {
+ display: none;
}
-#importarrow {
- display: none
-}
-#importmessagesuccess {
- display: none
+
+#importmessageabiword {
+ color: #900;
+ font-size: small;
}
+
#importsubmitinput {
height: 25px;
width: 85px;
@@ -755,7 +774,7 @@ input[type=checkbox] {
border-radius: 3px;
border: 1px solid #ccc;
outline: none;
- min-width: 105px;
+ width: 120px;
}
.column {
float: left;
@@ -878,3 +897,15 @@ input[type=checkbox] {
line-height: 24px
}
}
+
+#passwordRequired{
+ display:none;
+}
+
+#permissionDenied{
+ display:none;
+}
+
+#wrongPassword{
+ display:none;
+}
diff --git a/src/static/js/admin/plugins.js b/src/static/js/admin/plugins.js
index 93acf6ea5..618520282 100644
--- a/src/static/js/admin/plugins.js
+++ b/src/static/js/admin/plugins.js
@@ -113,10 +113,15 @@ $(document).ready(function () {
for (plugin_name in data.results) {
var plugin = data.results[plugin_name];
var row = widget.find(".template tr").clone();
+ var version = '0.0.0';
+ // hack to access "versions" property of the npm package object
+ for (version in data.results[plugin_name].versions) break;
for (attr in plugin) {
row.find("." + attr).html(plugin[attr]);
}
+ row.find(".version").html(version);
+
widget.find(".results").append(row);
}
diff --git a/src/static/js/pad.js b/src/static/js/pad.js
index 34f2a2877..9ad701b38 100644
--- a/src/static/js/pad.js
+++ b/src/static/js/pad.js
@@ -51,18 +51,20 @@ var randomString = require('./pad_utils').randomString;
var hooks = require('./pluginfw/hooks');
-function createCookie(name, value, days, path)
-{
+function createCookie(name, value, days, path){ /* Warning Internet Explorer doesn't use this it uses the one from pad_utils.js */
if (days)
{
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
var expires = "; expires=" + date.toGMTString();
}
- else var expires = "";
+ else{
+ var expires = "";
+ }
- if(!path)
+ if(!path){ // If the path isn't set then just whack the cookie on the root path
path = "/";
+ }
//Check if the browser is IE and if so make sure the full path is set in the cookie
if(navigator.appName=='Microsoft Internet Explorer'){
@@ -202,6 +204,7 @@ function savePassword()
createCookie("password",$("#passwordinput").val(),null,document.location.pathname);
//reload
document.location=document.location;
+ return false;
}
function handshake()
@@ -298,21 +301,25 @@ function handshake()
//the access was not granted, give the user a message
if(!receivedClientVars && obj.accessStatus)
{
+ $('.passForm').submit(require(module.id).savePassword);
+
if(obj.accessStatus == "deny")
{
- $("#editorloadingbox").html("You do not have permission to access this pad");
+ $('#loading').hide();
+ $("#permissionDenied").show();
}
else if(obj.accessStatus == "needPassword")
{
- $("#editorloadingbox").html("You need a password to access this pad
" +
- ""+
- "");
+ $('#loading').hide();
+ $('#passwordRequired').show();
+ $("#passwordinput").focus();
}
else if(obj.accessStatus == "wrongPassword")
{
- $("#editorloadingbox").html("Your password was wrong
" +
- ""+
- "");
+ $('#loading').hide();
+ $('#wrongPassword').show();
+ $('#passwordRequired').show();
+ $("#passwordinput").focus();
}
}
diff --git a/src/static/js/pad_impexp.js b/src/static/js/pad_impexp.js
index 08dd42934..4b4733a56 100644
--- a/src/static/js/pad_impexp.js
+++ b/src/static/js/pad_impexp.js
@@ -218,6 +218,9 @@ var padimpexp = (function()
$("#exporthtmla").attr("href", pad_root_path + "/export/html");
$("#exportplaina").attr("href", pad_root_path + "/export/txt");
$("#exportdokuwikia").attr("href", pad_root_path + "/export/dokuwiki");
+
+ // activate action to import in the form
+ $("#importform").attr('action', pad_root_url + "/import");
//hide stuff thats not avaible if abiword is disabled
if(clientVars.abiwordAvailable == "no")
@@ -225,8 +228,8 @@ var padimpexp = (function()
$("#exportworda").remove();
$("#exportpdfa").remove();
$("#exportopena").remove();
- $(".importformdiv").remove();
- $("#import").html("Import is not available. To enable import please install abiword");
+
+ $("#importmessageabiword").show();
}
else if(clientVars.abiwordAvailable == "withoutPDF")
{
@@ -237,16 +240,12 @@ var padimpexp = (function()
$("#importexport").css({"height":"142px"});
$("#importexportline").css({"height":"142px"});
-
- $("#importform").attr('action', pad_root_url + "/import");
}
else
{
$("#exportworda").attr("href", pad_root_path + "/export/doc");
$("#exportpdfa").attr("href", pad_root_path + "/export/pdf");
$("#exportopena").attr("href", pad_root_path + "/export/odt");
-
- $("#importform").attr('action', pad_root_path + "/import");
}
$("#impexp-close").click(function()
diff --git a/src/static/js/pad_utils.js b/src/static/js/pad_utils.js
index 83ee9aae8..82f7fcada 100644
--- a/src/static/js/pad_utils.js
+++ b/src/static/js/pad_utils.js
@@ -39,20 +39,29 @@ function randomString(len)
return randomstring;
}
-function createCookie(name, value, days, path)
-{
+function createCookie(name, value, days, path){ /* Used by IE */
if (days)
{
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
var expires = "; expires=" + date.toGMTString();
}
- else var expires = "";
+ else{
+ var expires = "";
+ }
- if(!path)
+ if(!path){ // IF the Path of the cookie isn't set then just create it on root
path = "/";
+ }
+
+ //Check if the browser is IE and if so make sure the full path is set in the cookie
+ if(navigator.appName=='Microsoft Internet Explorer'){
+ document.cookie = name + "=" + value + expires + "; path=/"; /* Note this bodge fix for IE is temporary until auth is rewritten */
+ }
+ else{
+ document.cookie = name + "=" + value + expires + "; path=" + path;
+ }
- document.cookie = name + "=" + value + expires + "; path=" + path;
}
function readCookie(name)
diff --git a/src/static/js/pluginfw/installer.js b/src/static/js/pluginfw/installer.js
index d668e549e..e491f0771 100644
--- a/src/static/js/pluginfw/installer.js
+++ b/src/static/js/pluginfw/installer.js
@@ -91,9 +91,12 @@ exports.search = function(query, cache, cb) {
if (er) return cb(er);
var res = {};
var i = 0;
- for (key in data) {
+ for (key in data) { // for every plugin in the data from npm
if ( key.indexOf(plugins.prefix) == 0
- && key.indexOf(query.pattern) != -1) {
+ && key.indexOf(query.pattern) != -1
+ || key.indexOf(plugins.prefix) == 0
+ && data[key].description.indexOf(query.pattern) != -1
+ ) { // If the name contains ep_ and the search string is in the name or description
i++;
if (i > query.offset
&& i <= query.offset + query.limit) {
diff --git a/src/templates/admin/plugins.html b/src/templates/admin/plugins.html
index 3dad3bd01..394cf0e06 100644
--- a/src/templates/admin/plugins.html
+++ b/src/templates/admin/plugins.html
@@ -30,6 +30,7 @@