Skip to content

Commit

Permalink
[control] image: replace all ocurrences
Browse files Browse the repository at this point in the history
  • Loading branch information
frost-nzcr4 committed Jun 24, 2011
1 parent 40842ed commit afd7c15
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions controls/wysiwyg.image.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
tags: ["img"],
tooltip: "Insert image",
init: function (Wysiwyg) {
var self = this, elements, adialog, dialog, formTextLegend, formImageHtml, dialogReplacements, key, translation,
var self = this, elements, adialog, dialog, formTextLegend, formImageHtml, regexp, dialogReplacements, key, translation,
img = {
alt: "",
self: Wysiwyg.dom ? Wysiwyg.dom.getElement("img") : null, // link to element node
Expand Down Expand Up @@ -85,7 +85,8 @@
dialogReplacements[key] = translation;
}

formImageHtml = formImageHtml.replace("{" + key + "}", dialogReplacements[key]);
regexp = new RegExp("{" + key + "}", "g");
formImageHtml = formImageHtml.replace(regexp, dialogReplacements[key]);
}
formTextLegend = dialogReplacements.legend;

Expand Down

0 comments on commit afd7c15

Please sign in to comment.