diff --git a/src/locales/fa.json b/src/locales/fa.json
index 437b8da09..bccc353c2 100644
--- a/src/locales/fa.json
+++ b/src/locales/fa.json
@@ -2,7 +2,8 @@
"@metadata": {
"authors": {
"0": "BMRG14",
- "2": "ZxxZxxZ"
+ "1": "Dalba",
+ "3": "ZxxZxxZ"
}
},
"index.newPad": "\u062f\u0641\u062a\u0631\u0686\u0647 \u06cc\u0627\u062f\u062f\u0627\u0634\u062a \u062a\u0627\u0632\u0647",
@@ -20,7 +21,7 @@
"pad.toolbar.clearAuthorship.title": "\u067e\u0627\u06a9 \u06a9\u0631\u062f\u0646 \u0631\u0646\u06af\u200c\u0647\u0627\u06cc \u0646\u0648\u06cc\u0633\u0646\u062f\u06af\u06cc",
"pad.toolbar.import_export.title": "\u062f\u0631\u0648\u0646\u200c\u0631\u06cc\u0632\u06cc\/\u0628\u0631\u0648\u0646\u200c\u0631\u06cc\u0632\u06cc \u0627\u0632\/\u0628\u0647 \u0642\u0627\u0644\u0628\u200c\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641",
"pad.toolbar.timeslider.title": "\u0627\u0633\u0644\u0627\u06cc\u062f\u0631 \u0632\u0645\u0627\u0646",
- "pad.toolbar.savedRevision.title": "\u0628\u0627\u0632\u0646\u0648\u06cc\u0633\u06cc\u200c\u0647\u0627\u06cc \u0630\u062e\u06cc\u0631\u0647 \u0634\u062f\u0647",
+ "pad.toolbar.savedRevision.title": "\u0630\u062e\u06cc\u0631\u0647\u200c\u0633\u0627\u0632\u06cc \u0646\u0633\u062e\u0647",
"pad.toolbar.settings.title": "\u062a\u0646\u0638\u06cc\u0645\u0627\u062a",
"pad.toolbar.embed.title": "\u062c\u0627\u0633\u0627\u0632\u06cc \u0627\u06cc\u0646 \u062f\u0641\u062a\u0631\u0686\u0647 \u06cc\u0627\u062f\u062f\u0627\u0634\u062a",
"pad.toolbar.showusers.title": "\u0646\u0645\u0627\u06cc\u0634 \u06a9\u0627\u0631\u0628\u0631\u0627\u0646 \u062f\u0631 \u0627\u06cc\u0646 \u062f\u0641\u062a\u0631\u0686\u0647 \u06cc\u0627\u062f\u062f\u0627\u0634\u062a",
@@ -79,6 +80,7 @@
"pad.share.emebdcode": "\u062c\u0627\u0633\u0627\u0632\u06cc \u0646\u0634\u0627\u0646\u06cc",
"pad.chat": "\u06af\u0641\u062a\u06af\u0648",
"pad.chat.title": "\u0628\u0627\u0632\u06a9\u0631\u062f\u0646 \u06af\u0641\u062a\u06af\u0648 \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u062f\u0641\u062a\u0631\u0686\u0647 \u06cc\u0627\u062f\u062f\u0627\u0634\u062a",
+ "pad.chat.loadmessages": "\u0628\u0627\u0631\u06af\u06cc\u0631\u06cc \u067e\u06cc\u0627\u0645\u200c\u0647\u0627\u06cc \u0628\u06cc\u0634\u062a\u0631",
"timeslider.pageTitle": "\u0627\u0633\u0644\u0627\u06cc\u062f\u0631 \u0632\u0645\u0627\u0646 {{appTitle}}",
"timeslider.toolbar.returnbutton": "\u0628\u0627\u0632\u06af\u0634\u062a \u0628\u0647 \u062f\u0641\u062a\u0631\u0686\u0647 \u06cc\u0627\u062f\u062f\u0627\u0634\u062a",
"timeslider.toolbar.authors": "\u0646\u0648\u06cc\u0633\u0646\u062f\u06af\u0627\u0646:",
@@ -100,6 +102,8 @@
"timeslider.month.october": "\u0627\u06a9\u062a\u0628\u0631",
"timeslider.month.november": "\u0646\u0648\u0627\u0645\u0628\u0631",
"timeslider.month.december": "\u062f\u0633\u0627\u0645\u0628\u0631",
+ "timeslider.unnamedauthor": "{{num}} \u0646\u0648\u06cc\u0633\u0646\u062f\u0647\u0654 \u0628\u06cc\u200c\u0646\u0627\u0645",
+ "timeslider.unnamedauthors": "{{num}} \u0646\u0648\u06cc\u0633\u0646\u062f\u0647\u0654 \u0628\u06cc\u200c\u0646\u0627\u0645",
"pad.savedrevs.marked": "\u0627\u06cc\u0646 \u0628\u0627\u0632\u0646\u0648\u06cc\u0633\u06cc \u0647\u0645 \u0627\u06a9\u0646\u0648\u0646 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0630\u062e\u06cc\u0631\u0647 \u0634\u062f\u0647 \u0639\u0644\u0627\u0645\u062a\u200c\u06af\u0630\u0627\u0631\u06cc \u0634\u062f",
"pad.userlist.entername": "\u0646\u0627\u0645 \u062e\u0648\u062f \u0631\u0627 \u0628\u0646\u0648\u06cc\u0633\u06cc\u062f",
"pad.userlist.unnamed": "\u0628\u062f\u0648\u0646 \u0646\u0627\u0645",
diff --git a/src/locales/ia.json b/src/locales/ia.json
index 21b1d2919..e6c5dde11 100644
--- a/src/locales/ia.json
+++ b/src/locales/ia.json
@@ -19,13 +19,16 @@
"pad.toolbar.clearAuthorship.title": "Rader colores de autor",
"pad.toolbar.import_export.title": "Importar\/exportar in differente formatos de file",
"pad.toolbar.timeslider.title": "Glissa-tempore",
- "pad.toolbar.savedRevision.title": "Versiones salveguardate",
+ "pad.toolbar.savedRevision.title": "Version salveguardate",
"pad.toolbar.settings.title": "Configuration",
"pad.toolbar.embed.title": "Incorporar iste pad",
"pad.toolbar.showusers.title": "Monstrar le usatores de iste pad",
"pad.colorpicker.save": "Salveguardar",
"pad.colorpicker.cancel": "Cancellar",
"pad.loading": "Cargamento\u2026",
+ "pad.passwordRequired": "Un contrasigno es necessari pro acceder a iste pad",
+ "pad.permissionDenied": "Tu non ha le permission de acceder a iste pad",
+ "pad.wrongPassword": "Le contrasigno es incorrecte",
"pad.settings.padSettings": "Configuration del pad",
"pad.settings.myView": "Mi vista",
"pad.settings.stickychat": "Chat sempre visibile",
@@ -38,6 +41,7 @@
"pad.settings.language": "Lingua:",
"pad.importExport.import_export": "Importar\/Exportar",
"pad.importExport.import": "Incargar qualcunque file de texto o documento",
+ "pad.importExport.importSuccessful": "Succedite!",
"pad.importExport.export": "Exportar le pad actual como:",
"pad.importExport.exporthtml": "HTML",
"pad.importExport.exportplain": "Texto simple",
@@ -45,9 +49,11 @@
"pad.importExport.exportpdf": "PDF",
"pad.importExport.exportopen": "ODF (Open Document Format)",
"pad.importExport.exportdokuwiki": "DokuWiki",
+ "pad.importExport.abiword.innerHTML": "Tu pote solmente importar files in formato de texto simple o HTML. Pro functionalitate de importation plus extense, installa AbiWord<\/a>.",
"pad.modals.connected": "Connectite.",
"pad.modals.reconnecting": "Reconnecte a tu pad\u2026",
"pad.modals.forcereconnect": "Fortiar reconnexion",
+ "pad.modals.userdup": "Aperte in un altere fenestra",
"pad.modals.userdup.explanation": "Iste pad pare esser aperte in plus de un fenestra de navigator in iste computator.",
"pad.modals.userdup.advice": "Reconnecte pro usar iste fenestra.",
"pad.modals.unauth": "Non autorisate",
@@ -72,11 +78,16 @@
"pad.share.emebdcode": "Codice de incorporation",
"pad.chat": "Chat",
"pad.chat.title": "Aperir le chat pro iste pad.",
+ "pad.chat.loadmessages": "Cargar plus messages",
"timeslider.pageTitle": "Glissa-tempore pro {{appTitle}}",
"timeslider.toolbar.returnbutton": "Retornar al pad",
"timeslider.toolbar.authors": "Autores:",
"timeslider.toolbar.authorsList": "Nulle autor",
+ "timeslider.toolbar.exportlink.title": "Exportar",
"timeslider.exportCurrent": "Exportar le version actual como:",
+ "timeslider.version": "Version {{version}}",
+ "timeslider.saved": "Salveguardate le {{day}} de {{month}} {{year}}",
+ "timeslider.dateformat": "{{year}}-{{month}}-{{day}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.month.january": "januario",
"timeslider.month.february": "februario",
"timeslider.month.march": "martio",
@@ -88,5 +99,22 @@
"timeslider.month.september": "septembre",
"timeslider.month.october": "octobre",
"timeslider.month.november": "novembre",
- "timeslider.month.december": "decembre"
+ "timeslider.month.december": "decembre",
+ "timeslider.unnamedauthor": "{{num}} autor sin nomine",
+ "timeslider.unnamedauthors": "{{num}} autores sin nomine",
+ "pad.savedrevs.marked": "Iste version es ora marcate como version salveguardate",
+ "pad.userlist.entername": "Entra tu nomine",
+ "pad.userlist.unnamed": "sin nomine",
+ "pad.userlist.guest": "Invitato",
+ "pad.userlist.deny": "Refusar",
+ "pad.userlist.approve": "Approbar",
+ "pad.editbar.clearcolors": "Rader le colores de autor in tote le documento?",
+ "pad.impexp.importbutton": "Importar ora",
+ "pad.impexp.importing": "Importation in curso\u2026",
+ "pad.impexp.confirmimport": "Le importation de un file superscribera le texto actual del pad. Es tu secur de voler continuar?",
+ "pad.impexp.convertFailed": "Nos non ha potite importar iste file. Per favor usa un altere formato de documento o copia e colla le texto manualmente.",
+ "pad.impexp.uploadFailed": "Le incargamento ha fallite. Per favor reproba.",
+ "pad.impexp.importfailed": "Importation fallite",
+ "pad.impexp.copypaste": "Per favor copia e colla",
+ "pad.impexp.exportdisabled": "Le exportation in formato {{type}} es disactivate. Per favor contacta le administrator del systema pro detalios."
}
\ No newline at end of file
diff --git a/src/locales/te.json b/src/locales/te.json
index 666a40aa0..955b263ab 100644
--- a/src/locales/te.json
+++ b/src/locales/te.json
@@ -26,6 +26,7 @@
"pad.colorpicker.save": "\u0c2d\u0c26\u0c4d\u0c30\u0c2a\u0c30\u0c1a\u0c41",
"pad.colorpicker.cancel": "\u0c30\u0c26\u0c4d\u0c26\u0c41\u0c1a\u0c47\u0c2f\u0c3f",
"pad.loading": "\u0c32\u0c4b\u0c21\u0c35\u0c41\u0c24\u0c4b\u0c02\u0c26\u0c3f...",
+ "pad.wrongPassword": "\u0c2e\u0c40 \u0c30\u0c39\u0c38\u0c4d\u0c2f\u0c2a\u0c26\u0c02 \u0c24\u0c2a\u0c41",
"pad.settings.padSettings": "\u0c2a\u0c32\u0c15 \u0c05\u0c2e\u0c30\u0c3f\u0c15\u0c32\u0c41",
"pad.settings.myView": "\u0c28\u0c3e \u0c09\u0c26\u0c4d\u0c26\u0c47\u0c36\u0c4d\u0c2f\u0c2e\u0c41",
"pad.settings.stickychat": "\u0c24\u0c46\u0c30\u0c2a\u0c48\u0c28\u0c47 \u0c2e\u0c3e\u0c1f\u0c3e\u0c2e\u0c02\u0c24\u0c3f\u0c28\u0c3f \u0c0e\u0c32\u0c4d\u0c32\u0c2a\u0c41\u0c21\u0c41 \u0c1a\u0c47\u0c2f\u0c41\u0c2e\u0c41",
diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js
index 076f31a58..e44ced051 100644
--- a/src/node/handler/PadMessageHandler.js
+++ b/src/node/handler/PadMessageHandler.js
@@ -567,11 +567,16 @@ function handleUserChanges(client, message)
throw "Attribute pool is missing attribute "+n+" for changeset "+changeset;
}
});
+
+ // Validate all 'author' attribs to be the same value as the current user
+ wireApool.eachAttrib(function(type, value) {
+ if('author' == type && value != thisSession.author) throw "Trying to submit changes as another author"
+ })
}
catch(e)
{
// There is an error in this changeset, so just refuse it
- console.warn("Can't apply USER_CHANGES "+changeset+", because it failed checkRep");
+ console.warn("Can't apply USER_CHANGES "+changeset+", because: "+e);
client.json.send({disconnect:"badChangeset"});
return;
}
diff --git a/src/node/hooks/express/admin.js b/src/node/hooks/express/admin.js
index 766370fc3..70539f0c4 100644
--- a/src/node/hooks/express/admin.js
+++ b/src/node/hooks/express/admin.js
@@ -2,6 +2,7 @@ var eejs = require('ep_etherpad-lite/node/eejs');
exports.expressCreateServer = function (hook_name, args, cb) {
args.app.get('/admin', function(req, res) {
+ if('/' != req.path[req.path.length-1]) return res.redirect('/admin/');
res.send( eejs.require("ep_etherpad-lite/templates/admin/index.html", {}) );
});
}
diff --git a/src/static/js/chat.js b/src/static/js/chat.js
index 2dff2edf3..83a487dee 100644
--- a/src/static/js/chat.js
+++ b/src/static/js/chat.js
@@ -111,7 +111,7 @@ var chat = (function()
var authorName = msg.userName == null ? _('pad.userlist.unnamed') : padutils.escapeHtml(msg.userName);
- var html = "" + authorName + ":" + timeStr + " " + text + "
";
+ var html = "" + authorName + ":" + timeStr + " " + text + "
";
if(isHistoryAdd)
$(html).insertAfter('#chatloadmessagesbutton');
else
diff --git a/src/static/js/pad_userlist.js b/src/static/js/pad_userlist.js
index 962595d2b..c8f8e2c9e 100644
--- a/src/static/js/pad_userlist.js
+++ b/src/static/js/pad_userlist.js
@@ -119,9 +119,9 @@ var paduserlist = (function()
return ['
| ', '', nameHtml, ' | ', '', padutils.escapeHtml(data.activity), ' | '].join('');
}
- function getRowHtml(id, innerHtml)
+ function getRowHtml(id, innerHtml, authorId)
{
- return '' + innerHtml + '
';
+ return '' + innerHtml + '
';
}
function rowNode(row)
@@ -191,18 +191,20 @@ var paduserlist = (function()
domId: domId,
animationPower: animationPower
};
+ var authorId = data.id;
+
handleRowData(row);
rowsPresent.splice(position, 0, row);
var tr;
if (animationPower == 0)
{
- tr = $(getRowHtml(domId, getUserRowHtml(getAnimationHeight(0), data)));
+ tr = $(getRowHtml(domId, getUserRowHtml(getAnimationHeight(0), data), authorId));
row.animationStep = 0;
}
else
{
rowsFadingIn.push(row);
- tr = $(getRowHtml(domId, getEmptyRowHtml(getAnimationHeight(ANIMATION_START))));
+ tr = $(getRowHtml(domId, getEmptyRowHtml(getAnimationHeight(ANIMATION_START)), authorId));
}
handleRowNode(tr, data);
if (position == 0)
diff --git a/tests/frontend/specs/keystroke_alphabet.js b/tests/frontend/specs/alphabet.js
similarity index 100%
rename from tests/frontend/specs/keystroke_alphabet.js
rename to tests/frontend/specs/alphabet.js
diff --git a/tests/frontend/specs/button_bold.js b/tests/frontend/specs/bold.js
similarity index 51%
rename from tests/frontend/specs/button_bold.js
rename to tests/frontend/specs/bold.js
index 1feafe614..2fb6bbfeb 100644
--- a/tests/frontend/specs/button_bold.js
+++ b/tests/frontend/specs/bold.js
@@ -5,7 +5,7 @@ describe("bold button", function(){
this.timeout(60000);
});
- it("makes text bold", function(done) {
+ it("makes text bold on click", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
@@ -33,4 +33,34 @@ describe("bold button", function(){
done();
});
-});
\ No newline at end of file
+
+ it("makes text bold on keypress", function(done) {
+ var inner$ = helper.padInner$;
+ var chrome$ = helper.padChrome$;
+
+ //get the first text element out of the inner iframe
+ var $firstTextElement = inner$("div").first();
+
+ //select this text element
+ $firstTextElement.sendkeys('{selectall}');
+
+ var e = inner$.Event("keydown");
+ e.ctrlKey = true; // Control key
+ e.which = 66; // b
+ inner$("#innerdocbody").trigger(e);
+
+ //ace creates a new dom element when you press a button, so just get the first text element again
+ var $newFirstTextElement = inner$("div").first();
+
+ // is there a element now?
+ var isBold = $newFirstTextElement.find("b").length === 1;
+
+ //expect it to be bold
+ expect(isBold).to.be(true);
+
+ //make sure the text hasn't changed
+ expect($newFirstTextElement.text()).to.eql($firstTextElement.text());
+
+ done();
+ });
+});
diff --git a/tests/frontend/specs/button_italic.js b/tests/frontend/specs/button_italic.js
deleted file mode 100644
index fc2e15a79..000000000
--- a/tests/frontend/specs/button_italic.js
+++ /dev/null
@@ -1,36 +0,0 @@
-describe("italic button", function(){
- //create a new pad before each test run
- beforeEach(function(cb){
- helper.newPad(cb);
- this.timeout(60000);
- });
-
- it("makes text italic", function(done) {
- var inner$ = helper.padInner$;
- var chrome$ = helper.padChrome$;
-
- //get the first text element out of the inner iframe
- var $firstTextElement = inner$("div").first();
-
- //select this text element
- $firstTextElement.sendkeys('{selectall}');
-
- //get the bold button and click it
- var $boldButton = chrome$(".buttonicon-italic");
- $boldButton.click();
-
- //ace creates a new dom element when you press a button, so just get the first text element again
- var $newFirstTextElement = inner$("div").first();
-
- // is there a element now?
- var isItalic = $newFirstTextElement.find("i").length === 1;
-
- //expect it to be bold
- expect(isItalic).to.be(true);
-
- //make sure the text hasn't changed
- expect($newFirstTextElement.text()).to.eql($firstTextElement.text());
-
- done();
- });
-});
diff --git a/tests/frontend/specs/keystroke_chat.js b/tests/frontend/specs/chat.js
similarity index 69%
rename from tests/frontend/specs/keystroke_chat.js
rename to tests/frontend/specs/chat.js
index e49087286..a488193f7 100644
--- a/tests/frontend/specs/keystroke_chat.js
+++ b/tests/frontend/specs/chat.js
@@ -1,4 +1,4 @@
-describe("send chat message", function(){
+describe("Chat messages and UI", function(){
//create a new pad before each test run
beforeEach(function(cb){
helper.newPad(cb);
@@ -64,5 +64,36 @@ describe("send chat message", function(){
});
});
-});
+ it("makes chat stick to right side of the screen", function(done) {
+ var inner$ = helper.padInner$;
+ var chrome$ = helper.padChrome$;
+ //click on the settings button to make settings visible
+ var $settingsButton = chrome$(".buttonicon-settings");
+ $settingsButton.click();
+
+ //get the chat selector
+ var $stickychatCheckbox = chrome$("#options-stickychat");
+
+ //select chat always on screen and fire change event
+ $stickychatCheckbox.attr('selected','selected');
+ $stickychatCheckbox.change();
+ $stickychatCheckbox.click();
+
+ //check if chat changed to get the stickychat Class
+ var $chatbox = chrome$("#chatbox");
+ var hasStickyChatClass = $chatbox.hasClass("stickyChat");
+ expect(hasStickyChatClass).to.be(true);
+
+ //select chat always on screen and fire change event
+ $stickychatCheckbox.attr('selected','selected');
+ $stickychatCheckbox.change();
+ $stickychatCheckbox.click();
+
+ //check if chat changed to remove the stickychat Class
+ var hasStickyChatClass = $chatbox.hasClass("stickyChat");
+ expect(hasStickyChatClass).to.be(false);
+
+ done();
+ });
+});
diff --git a/tests/frontend/specs/chat_always_on_screen.js b/tests/frontend/specs/chat_always_on_screen.js
deleted file mode 100644
index 4873763fe..000000000
--- a/tests/frontend/specs/chat_always_on_screen.js
+++ /dev/null
@@ -1,40 +0,0 @@
-describe("chat always ons creen select", function(){
- //create a new pad before each test run
- beforeEach(function(cb){
- helper.newPad(cb);
- this.timeout(60000);
- });
-
- it("makes chat stick to right side of the screen", function(done) {
- var inner$ = helper.padInner$;
- var chrome$ = helper.padChrome$;
-
- //click on the settings button to make settings visible
- var $settingsButton = chrome$(".buttonicon-settings");
- $settingsButton.click();
-
- //get the chat selector
- var $stickychatCheckbox = chrome$("#options-stickychat");
-
- //select chat always on screen and fire change event
- $stickychatCheckbox.attr('selected','selected');
- $stickychatCheckbox.change();
- $stickychatCheckbox.click();
-
- //check if chat changed to get the stickychat Class
- var $chatbox = chrome$("#chatbox");
- var hasStickyChatClass = $chatbox.hasClass("stickyChat");
- expect(hasStickyChatClass).to.be(true);
-
- //select chat always on screen and fire change event
- $stickychatCheckbox.attr('selected','selected');
- $stickychatCheckbox.change();
- $stickychatCheckbox.click();
-
- //check if chat changed to remove the stickychat Class
- var hasStickyChatClass = $chatbox.hasClass("stickyChat");
- expect(hasStickyChatClass).to.be(false);
-
- done();
- });
-});
diff --git a/tests/frontend/specs/button_clear_authorship_colors.js b/tests/frontend/specs/clear_authorship_colors.js
similarity index 100%
rename from tests/frontend/specs/button_clear_authorship_colors.js
rename to tests/frontend/specs/clear_authorship_colors.js
diff --git a/tests/frontend/specs/keystroke_delete.js b/tests/frontend/specs/delete.js
similarity index 100%
rename from tests/frontend/specs/keystroke_delete.js
rename to tests/frontend/specs/delete.js
diff --git a/tests/frontend/specs/keystroke_enter.js b/tests/frontend/specs/enter.js
similarity index 94%
rename from tests/frontend/specs/keystroke_enter.js
rename to tests/frontend/specs/enter.js
index e46b1d2fe..baafeded2 100644
--- a/tests/frontend/specs/keystroke_enter.js
+++ b/tests/frontend/specs/enter.js
@@ -5,7 +5,7 @@ describe("enter keystroke", function(){
this.timeout(60000);
});
- it("creates a enw line & puts cursor onto a new line", function(done) {
+ it("creates a new line & puts cursor onto a new line", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
diff --git a/tests/frontend/specs/button_indentation.js b/tests/frontend/specs/indentation.js
similarity index 90%
rename from tests/frontend/specs/button_indentation.js
rename to tests/frontend/specs/indentation.js
index 9c8e317e6..06d90aa86 100644
--- a/tests/frontend/specs/button_indentation.js
+++ b/tests/frontend/specs/indentation.js
@@ -5,7 +5,26 @@ describe("indentation button", function(){
this.timeout(60000);
});
- it("indent text", function(done){
+ it("indent text with keypress", function(done){
+ var inner$ = helper.padInner$;
+ var chrome$ = helper.padChrome$;
+
+ //get the first text element out of the inner iframe
+ var $firstTextElement = inner$("div").first();
+
+ //select this text element
+ $firstTextElement.sendkeys('{selectall}');
+
+ var e = inner$.Event("keydown");
+ e.keyCode = 9; // tab :|
+ inner$("#innerdocbody").trigger(e);
+
+ helper.waitFor(function(){
+ return inner$("div").first().find("ul li").length === 1;
+ }).done(done);
+ });
+
+ it("indent text with button", function(done){
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
@@ -176,4 +195,5 @@ describe("indentation button", function(){
expect(isLI).to.be(true);
},1000);
});*/
+
});
diff --git a/tests/frontend/specs/italic.js b/tests/frontend/specs/italic.js
new file mode 100644
index 000000000..052d2df4f
--- /dev/null
+++ b/tests/frontend/specs/italic.js
@@ -0,0 +1,67 @@
+describe("italic some text", function(){
+ //create a new pad before each test run
+ beforeEach(function(cb){
+ helper.newPad(cb);
+ this.timeout(60000);
+ });
+
+ it("makes text italic using button", function(done) {
+ var inner$ = helper.padInner$;
+ var chrome$ = helper.padChrome$;
+
+ //get the first text element out of the inner iframe
+ var $firstTextElement = inner$("div").first();
+
+ //select this text element
+ $firstTextElement.sendkeys('{selectall}');
+
+ //get the bold button and click it
+ var $boldButton = chrome$(".buttonicon-italic");
+ $boldButton.click();
+
+ //ace creates a new dom element when you press a button, so just get the first text element again
+ var $newFirstTextElement = inner$("div").first();
+
+ // is there a element now?
+ var isItalic = $newFirstTextElement.find("i").length === 1;
+
+ //expect it to be bold
+ expect(isItalic).to.be(true);
+
+ //make sure the text hasn't changed
+ expect($newFirstTextElement.text()).to.eql($firstTextElement.text());
+
+ done();
+ });
+
+ it("makes text italic using keypress", function(done) {
+ var inner$ = helper.padInner$;
+ var chrome$ = helper.padChrome$;
+
+ //get the first text element out of the inner iframe
+ var $firstTextElement = inner$("div").first();
+
+ //select this text element
+ $firstTextElement.sendkeys('{selectall}');
+
+ var e = inner$.Event("keydown");
+ e.ctrlKey = true; // Control key
+ e.which = 105; // i
+ inner$("#innerdocbody").trigger(e);
+
+ //ace creates a new dom element when you press a button, so just get the first text element again
+ var $newFirstTextElement = inner$("div").first();
+
+ // is there a element now?
+ var isItalic = $newFirstTextElement.find("i").length === 1;
+
+ //expect it to be bold
+ expect(isItalic).to.be(true);
+
+ //make sure the text hasn't changed
+ expect($newFirstTextElement.text()).to.eql($firstTextElement.text());
+
+ done();
+ });
+
+});
diff --git a/tests/frontend/specs/language.js b/tests/frontend/specs/language.js
index ab7f2b3d7..d607ff982 100644
--- a/tests/frontend/specs/language.js
+++ b/tests/frontend/specs/language.js
@@ -13,7 +13,6 @@ describe("Language select and change", function(){
});
// Destroy language cookies
-
it("makes text german", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
@@ -92,7 +91,7 @@ describe("Language select and change", function(){
var $languageoption = $language.find("[value=ar]");
//select arabic
- $languageoption.attr('selected','selected');
+ // $languageoption.attr('selected','selected'); // Breaks the test..
$language.val("ar");
$languageoption.change();
diff --git a/tests/frontend/specs/button_ordered_list.js b/tests/frontend/specs/ordered_list.js
similarity index 100%
rename from tests/frontend/specs/button_ordered_list.js
rename to tests/frontend/specs/ordered_list.js
diff --git a/tests/frontend/specs/button_redo.js b/tests/frontend/specs/redo.js
similarity index 50%
rename from tests/frontend/specs/button_redo.js
rename to tests/frontend/specs/redo.js
index 3ce69142f..c14972219 100644
--- a/tests/frontend/specs/button_redo.js
+++ b/tests/frontend/specs/redo.js
@@ -4,7 +4,7 @@ describe("undo button then redo button", function(){
this.timeout(60000);
});
- it("undo some typing", function(done){
+ it("redo some typing with button", function(done){
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
@@ -33,5 +33,38 @@ describe("undo button then redo button", function(){
done();
});
});
+
+ it("redo some typing with keypress", function(done){
+ var inner$ = helper.padInner$;
+ var chrome$ = helper.padChrome$;
+
+ // get the first text element inside the editable space
+ var $firstTextElement = inner$("div span").first();
+ var originalValue = $firstTextElement.text(); // get the original value
+ var newString = "Foo";
+
+ $firstTextElement.sendkeys(newString); // send line 1 to the pad
+ var modifiedValue = $firstTextElement.text(); // get the modified value
+ expect(modifiedValue).not.to.be(originalValue); // expect the value to change
+
+ var e = inner$.Event("keydown");
+ e.ctrlKey = true; // Control key
+ e.which = 90; // z
+ inner$("#innerdocbody").trigger(e);
+
+ var e = inner$.Event("keydown");
+ e.ctrlKey = true; // Control key
+ e.which = 121; // y
+ inner$("#innerdocbody").trigger(e);
+
+ helper.waitFor(function(){
+ console.log(inner$("div span").first().text());
+ return inner$("div span").first().text() === newString;
+ }).done(function(){
+ var finalValue = inner$("div").first().text();
+ expect(finalValue).to.be(modifiedValue); // expect the value to change
+ done();
+ });
+ });
});
diff --git a/tests/frontend/specs/button_strikethrough.js b/tests/frontend/specs/strikethrough.js
similarity index 100%
rename from tests/frontend/specs/button_strikethrough.js
rename to tests/frontend/specs/strikethrough.js
diff --git a/tests/frontend/specs/button_timeslider.js b/tests/frontend/specs/timeslider.js
similarity index 100%
rename from tests/frontend/specs/button_timeslider.js
rename to tests/frontend/specs/timeslider.js
diff --git a/tests/frontend/specs/button_undo.js b/tests/frontend/specs/undo.js
similarity index 50%
rename from tests/frontend/specs/button_undo.js
rename to tests/frontend/specs/undo.js
index 412b786be..8ba752ac5 100644
--- a/tests/frontend/specs/button_undo.js
+++ b/tests/frontend/specs/undo.js
@@ -4,7 +4,8 @@ describe("undo button", function(){
this.timeout(60000);
});
- it("undo some typing", function(done){
+/*
+ it("undo some typing by clicking undo button", function(done){
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
@@ -29,5 +30,34 @@ describe("undo button", function(){
done();
});
});
+*/
+
+ it("undo some typing using a keypress", function(done){
+ var inner$ = helper.padInner$;
+ var chrome$ = helper.padChrome$;
+
+ // get the first text element inside the editable space
+ var $firstTextElement = inner$("div span").first();
+ var originalValue = $firstTextElement.text(); // get the original value
+
+ $firstTextElement.sendkeys("foo"); // send line 1 to the pad
+ var modifiedValue = $firstTextElement.text(); // get the modified value
+ expect(modifiedValue).not.to.be(originalValue); // expect the value to change
+
+ var e = inner$.Event("keydown");
+ e.ctrlKey = true; // Control key
+ e.which = 90; // z
+ inner$("#innerdocbody").trigger(e);
+
+ helper.waitFor(function(){
+ return inner$("div span").first().text() === originalValue;
+ }).done(function(){
+ var finalValue = inner$("div span").first().text();
+ expect(finalValue).to.be(originalValue); // expect the value to change
+ done();
+ });
+ });
+
+
});
diff --git a/tests/frontend/specs/keystroke_urls_become_clickable.js b/tests/frontend/specs/urls_become_clickable.js
similarity index 100%
rename from tests/frontend/specs/keystroke_urls_become_clickable.js
rename to tests/frontend/specs/urls_become_clickable.js