Rushabh Mehta 11 anni fa
parent
commit
dc00dc0445
1 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  1. +5
    -5
      public/js/wn/ui/editor.js

+ 5
- 5
public/js/wn/ui/editor.js Vedi File

@@ -446,7 +446,7 @@ bsHTMLEditor = Class.extend({
this.modal.addClass("wn-ignore-click");
this.modal.find(".btn-primary").on("click", function() {
var html = me.modal.find("textarea").val();
$.each(me.dataurls, function(key, val) {
$.each(me.editor.dataurls, function(key, val) {
html = html.replace(key, val);
})
me.editor.html(html);
@@ -459,13 +459,13 @@ bsHTMLEditor = Class.extend({
this.modal.modal("show")
var html = me.editor.html();
// pack dataurls so that html display is faster
this.dataurls = {}
this.editor.dataurls = {}
html = html.replace(/<img\s*src=\s*["\'](data:[^,]*),([^"\']*)["\']/g, function(full, g1, g2) {
var key = g2.slice(0,5) + "..." + g2.slice(-5);
me.dataurls[key] = g1 + "," + g2;
me.editor.dataurls[key] = g1 + "," + g2;
return '<img src="'+g1 + "," + key+'"';
})
this.modal.find("textarea").html(html_beautify(html));
});
this.modal.find("textarea").val(html_beautify(html));
}
});



Caricamento…
Annulla
Salva