diff --git a/src/ellib/js/eldialogform.js b/src/ellib/js/eldialogform.js
index 6d9ff33..8e150ba 100644
--- a/src/ellib/js/eldialogform.js
+++ b/src/ellib/js/eldialogform.js
@@ -35,9 +35,9 @@
*
**/
-function elDialogForm(o) {
+function elDialogForm(o, i18n) {
var self = this;
-
+
var defaults = {
'class' : 'el-dialogform',
submit : function(e, d) { d.close(); },
@@ -53,10 +53,16 @@ function elDialogForm(o) {
modal : true,
resizable : false,
closeOnEscape : true,
- buttons : {
- Cancel : function() { self.close(); },
- Ok : function() { self.form.trigger('submit'); }
- }
+ buttons : [
+ {
+ text: i18n ? i18n.translate('Cancel') : 'Cancel',
+ click: function() { self.close(); }
+ },
+ {
+ text: i18n ? i18n.translate('Ok') : 'Ok',
+ click: function() { self.form.trigger('submit'); }
+ }
+ ]
}
};
diff --git a/src/elrte/js/elRTE.js b/src/elrte/js/elRTE.js
index abdf5e7..10659aa 100644
--- a/src/elrte/js/elRTE.js
+++ b/src/elrte/js/elRTE.js
@@ -328,6 +328,15 @@ elRTE = function(target, opts) {
}
+/**
+ * Return localization
+ *
+ * @return eli18n
+ **/
+elRTE.prototype.getI18n = function() {
+ return this._i18n;
+}
+
/**
* Return message translated to selected language
*
diff --git a/src/elrte/js/ui/about.js b/src/elrte/js/ui/about.js
index b04f1ae..8c7f651 100644
--- a/src/elrte/js/ui/about.js
+++ b/src/elrte/js/ui/about.js
@@ -12,9 +12,12 @@
dialog : {
width : 560,
title : this.rte.i18n('About this software'),
- buttons : {
- Ok : function() { $(this).dialog('destroy'); }
- }
+ buttons : [
+ {
+ text : this.rte.i18n('Ok'),
+ click : function() { $(this).dialog('destroy'); }
+ }
+ ]
}
}
@@ -40,7 +43,7 @@
+'
'
+'';
- d = new elDialogForm(opts);
+ d = new elDialogForm(opts, this.rte.getI18n());
d.append(txt);
d.open();
}
diff --git a/src/elrte/js/ui/anchor.js b/src/elrte/js/ui/anchor.js
index a166d76..9562294 100644
--- a/src/elrte/js/ui/anchor.js
+++ b/src/elrte/js/ui/anchor.js
@@ -26,7 +26,7 @@ elRTE.prototype.ui.prototype.buttons.anchor = function(rte, name) {
!this.rte.selection.collapsed() && this.rte.selection.collapse(false);
this.input.val($(this.anchor).addClass('elrte-anchor').attr('name'));
this.rte.selection.saveIERange();
- var d = new elDialogForm(opts);
+ var d = new elDialogForm(opts, this.rte.getI18n());
d.append([this.rte.i18n('Bookmark name'), this.input], null, true).open();
setTimeout(function() { self.input.focus()}, 20);
}
diff --git a/src/elrte/js/ui/copy.js b/src/elrte/js/ui/copy.js
index 36ddb32..f670fc3 100644
--- a/src/elrte/js/ui/copy.js
+++ b/src/elrte/js/ui/copy.js
@@ -11,7 +11,7 @@
(function($) {
elRTE.prototype.ui.prototype.buttons.copy = function(rte, name) {
this.constructor.prototype.constructor.call(this, rte, name);
-
+
this.command = function() {
if (this.rte.browser.mozilla) {
@@ -27,11 +27,16 @@ elRTE.prototype.ui.prototype.buttons.copy = function(rte, name) {
var opts = {
dialog : {
title : this.rte.i18n('Warning'),
- buttons : { Ok : function() { $(this).dialog('close'); } }
+ buttons : [
+ {
+ text : this.rte.i18n('Ok'),
+ click : function() { $(this).dialog('close'); }
+ }
+ ]
}
}
- var d = new elDialogForm(opts);
+ var d = new elDialogForm(opts, this.rte.getI18n());
d.append(this.rte.i18n('This operation is disabled in your browser on security reason. Use shortcut instead.')+': '+s).open();
}
} else {
diff --git a/src/elrte/js/ui/css.js b/src/elrte/js/ui/css.js
index 42e0a77..ebdf761 100644
--- a/src/elrte/js/ui/css.js
+++ b/src/elrte/js/ui/css.js
@@ -24,7 +24,7 @@
this.cssStyle.val($(n).attr('style'));
this.cssClass.val($(n).attr('class'));
this.elementID.val($(n).attr('id'));
- var d = new elDialogForm(opts);
+ var d = new elDialogForm(opts, this.rte.getI18n());
d.append([this.rte.i18n('Css style'), this.cssStyle], null, true)
d.append([this.rte.i18n('Css class'), this.cssClass], null, true)
d.append([this.rte.i18n('ID'), this.elementID], null, true)
diff --git a/src/elrte/js/ui/flash.js b/src/elrte/js/ui/flash.js
index 8b1ddb8..3c55a8d 100644
--- a/src/elrte/js/ui/flash.js
+++ b/src/elrte/js/ui/flash.js
@@ -100,7 +100,7 @@
title : this.rte.i18n('Flash')
}
}
- var d = new elDialogForm(opts);
+ var d = new elDialogForm(opts, this.rte.getI18n());
if (this.rte.options.fmAllow && this.rte.options.fmOpen) {
var src = $('').append(this.src.url.css('width', '85%'))
diff --git a/src/elrte/js/ui/horizontalrule.js b/src/elrte/js/ui/horizontalrule.js
index 2330b75..a41f817 100644
--- a/src/elrte/js/ui/horizontalrule.js
+++ b/src/elrte/js/ui/horizontalrule.js
@@ -49,7 +49,7 @@ elRTE.prototype.ui.prototype.buttons.horizontalrule = function(rte, name) {
}
}
- var d = new elDialogForm(opts);
+ var d = new elDialogForm(opts, this.rte.getI18n());
d.append([this.rte.i18n('Width'), $('').append(this.src.width).append(this.src.wunit) ], null, true)
.append([this.rte.i18n('Height'), $('').append(this.src.height).append(' px')], null, true)
.append([this.rte.i18n('Border'), this.src.border], null, true)
diff --git a/src/elrte/js/ui/image.js b/src/elrte/js/ui/image.js
index a94e41e..7b6accf 100644
--- a/src/elrte/js/ui/image.js
+++ b/src/elrte/js/ui/image.js
@@ -271,7 +271,7 @@ elRTE.prototype.ui.prototype.buttons.image = function(rte, name) {
}
}
},
- dialog = new elDialogForm(opts),
+ dialog = new elDialogForm(opts, this.rte.getI18n());
fm = !!rte.options.fmOpen,
src = fm
? $('
')
diff --git a/src/elrte/js/ui/link.js b/src/elrte/js/ui/link.js
index b820d7d..b067b08 100644
--- a/src/elrte/js/ui/link.js
+++ b/src/elrte/js/ui/link.js
@@ -156,7 +156,7 @@ elRTE.prototype.ui.prototype.buttons.link = function(rte, name) {
}
}
- d = new elDialogForm(opts);
+ d = new elDialogForm(opts, this.rte.getI18n());
l = $('')
.append( $('').append(this.src.popup.location).append(this.rte.i18n('Location bar')))
diff --git a/src/elrte/js/ui/pasteformattext.js b/src/elrte/js/ui/pasteformattext.js
index a104079..8f0fd21 100644
--- a/src/elrte/js/ui/pasteformattext.js
+++ b/src/elrte/js/ui/pasteformattext.js
@@ -29,7 +29,7 @@ elRTE.prototype.ui.prototype.buttons.pasteformattext = function(rte, name) {
title : this.rte.i18n('Paste formatted text')
}
},
- d = new elDialogForm(opts);
+ d = new elDialogForm(opts, this.rte.getI18n());
d.append(this.iframe).open();
this.doc = this.iframe.get(0).contentWindow.document;
html = this.rte.options.doctype
diff --git a/src/elrte/js/ui/pastetext.js b/src/elrte/js/ui/pastetext.js
index acac7b9..74a585c 100644
--- a/src/elrte/js/ui/pastetext.js
+++ b/src/elrte/js/ui/pastetext.js
@@ -27,7 +27,7 @@ elRTE.prototype.ui.prototype.buttons.pastetext = function(rte, name) {
title : this.rte.i18n('Paste only text')
}
}
- var d = new elDialogForm(opts);
+ var d = new elDialogForm(opts, this.rte.getI18n());
d.append(this.input).open();
}
diff --git a/src/elrte/js/ui/smiley.js b/src/elrte/js/ui/smiley.js
index 20b925b..c37d274 100644
--- a/src/elrte/js/ui/smiley.js
+++ b/src/elrte/js/ui/smiley.js
@@ -41,7 +41,7 @@ elRTE.prototype.ui.prototype.buttons.smiley = function(rte, name) {
buttons : {}
}
}
- d = new elDialogForm(opts);
+ d = new elDialogForm(opts, this.rte.getI18n());
$.each(this.smileys, function(name, img) {
d.append($('
').click(function() { self.set(this.id, d); }));
});
diff --git a/src/elrte/js/ui/table.js b/src/elrte/js/ui/table.js
index 3e1887b..f32aae7 100644
--- a/src/elrte/js/ui/table.js
+++ b/src/elrte/js/ui/table.js
@@ -173,7 +173,7 @@ elRTE.prototype.ui.prototype.buttons.table = function(rte, name) {
title : this.rte.i18n('Table')
}
}
- var d = new elDialogForm(opts);
+ var d = new elDialogForm(opts, this.rte.getI18n());
for (var tab in this.src) {
d.tab(tab, this.rte.i18n(this.labels[tab]));
diff --git a/src/elrte/js/ui/tbcellprops.js b/src/elrte/js/ui/tbcellprops.js
index 515ec5d..abb64a4 100644
--- a/src/elrte/js/ui/tbcellprops.js
+++ b/src/elrte/js/ui/tbcellprops.js
@@ -122,7 +122,7 @@ elRTE.prototype.ui.prototype.buttons.tbcellprops = function(rte, name) {
title : this.rte.i18n('Table cell properties')
}
}
- var d = new elDialogForm(opts);
+ var d = new elDialogForm(opts, this.rte.getI18n());
for (var tab in this.src) {
d.tab(tab, this.rte.i18n(this.labels[tab]));