relative image url/fix conflict when upload attachment again
This commit is contained in:
1 parent
f49624d3eb
commit
a8dd578624
24 files changed
+130
-106
No files matched your search
@@ -1 +1 @@
|
||||
tinymce.addI18n("de",{Cut:"Ausschneiden","Heading 5":"Überschrift 5","Header 2":"Überschrift 2","Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.":"Ihr Browser unterstützt leider keinen direkten Zugriff auf die Zwischenablage. Bitte benutzen Sie die Strg + X / C / V Tastenkombinationen.","Heading 4":"Überschrift 4",Div:"Textblock","Heading 2":"Überschrift 2",Paste:"Einfügen",Close:"Schließen","Font Family":"Schriftart",Pre:"Vorformatierter Text","Align right":"Rechtsbündig ausrichten","New document":"Neues Dokument",Blockquote:"Zitat","Numbered list":"Nummerierte Liste","Heading 1":"Überschrift 1",Headings:"Überschriften","Increase indent":"Einzug vergrößern",Formats:"Formate",Headers:"Überschriften","Select all":"Alles auswählen","Header 3":"Überschrift 3",Blocks:"Absatzformate",Undo:"Rückgängig",Strikethrough:"Durchgestrichen","Bullet list":"Aufzählung","Header 1":"Überschrift 1",Superscript:"Hochgestellt","Clear formatting":"Formatierung entfernen","Font Sizes":"Schriftgröße",Subscript:"Tiefgestellt","Header 6":"Überschrift 6",Redo:"Wiederholen",Paragraph:"Absatz",Ok:"Ok",Bold:"Fett",Code:"Quelltext",Italic:"Kursiv","Align center":"Zentriert ausrichten","Header 5":"Überschrift 5","Heading 6":"Überschrift 6","Heading 3":"Überschrift 3","Decrease indent":"Einzug verkleinern","Header 4":"Überschrift 4","Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.":"Einfügen ist nun im einfachen Textmodus. Inhalte werden ab jetzt als unformatierter Text eingefügt, bis Sie diese Einstellung wieder ausschalten!",Underline:"Unterstrichen",Cancel:"Abbrechen",Justify:"Blocksatz",Inline:"Zeichenformate",Copy:"Kopieren","Align left":"Linksbündig ausrichten","Visual aids":"Visuelle Hilfen","Lower Greek":"Griechische Kleinbuchstaben",Square:"Quadrat",Default:"Standard","Lower Alpha":"Kleinbuchstaben",Circle:"Kreis",Disc:"Punkt","Upper Alpha":"Großbuchstaben","Upper Roman":"Römische Zahlen (Großbuchstaben)","Lower Roman":"Römische Zahlen (Kleinbuchstaben)",Name:"Name",Anchor:"Textmarke","You have unsaved changes are you sure you want to navigate away?":"Die Änderungen wurden noch nicht gespeichert, sind Sie sicher, dass Sie diese Seite verlassen wollen?","Restore last draft":"Letzten Entwurf wiederherstellen","Special character":"Sonderzeichen","Source code":"Quelltext",B:"B",R:"R",G:"G",Color:"Farbe","Right to left":"Von rechts nach links","Left to right":"Von links nach rechts",Emoticons:"Emoticons",Robots:"Robots","Document properties":"Dokumenteigenschaften",Title:"Titel",Keywords:"Schüsselwörter",Encoding:"Zeichenkodierung",Description:"Beschreibung",Author:"Verfasser",Fullscreen:"Vollbild","Horizontal line":"Horizontale Linie","Horizontal space":"Horizontaler Abstand","Insert/edit image":"Bild einfügen/bearbeiten",General:"Allgemein",Advanced:"Erweitert",Source:"Quelle",Border:"Rahmen","Constrain proportions":"Seitenverhältnis beibehalten","Vertical space":"Vertikaler Abstand","Image description":"Bildbeschreibung",Style:"Stil",Dimensions:"Abmessungen","Insert image":"Bild einfügen","Zoom in":"Ansicht vergrößern",Contrast:"Kontrast",Back:"Zurück",Gamma:"Gamma","Flip horizontally":"Horizontal spiegeln",Resize:"Skalieren",Sharpen:"Schärfen","Zoom out":"Ansicht verkleinern","Image options":"Bildeigenschaften",Apply:"Anwenden",Brightness:"Helligkeit","Rotate clockwise":"Im Uhrzeigersinn drehen","Rotate counterclockwise":"Gegen den Uhrzeigersinn drehen","Edit image":"Bild bearbeiten","Color levels":"Farbwerte",Crop:"Bescheiden",Orientation:"Ausrichtung","Flip vertically":"Vertikal spiegeln",Invert:"Invertieren","Insert date/time":"Datum/Uhrzeit einfügen ","Remove link":"Link entfernen",Url:"URL","Text to display":"Anzuzeigender Text",Anchors:"Textmarken","Insert link":"Link einfügen","New window":"Neues Fenster",None:"Keine","The URL you entered seems to be an external link. Do you want to add the required http:// prefix?":'Diese Adresse scheint ein externer Link zu sein. Möchten Sie das dazu benötigte "http://" voranstellen?',Target:"Ziel","The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?":'Diese Adresse scheint eine E-Mail-Adresse zu sein. Möchten Sie das dazu benötigte "mailto:" voranstellen?',"Insert/edit link":"Link einfügen/bearbeiten","Insert/edit video":"Video einfügen/bearbeiten",Poster:"Poster","Alternative source":"Alternative Quelle","Paste your embed code below:":"Fügen Sie Ihren Einbettungscode hier ein:","Insert video":"Video einfügen",Embed:"Einbetten","Nonbreaking space":"Geschütztes Leerzeichen","Page break":"Seitenumbruch","Paste as text":"Als Text einfügen",Preview:"Vorschau",Print:"Drucken",Save:"Speichern","Could not find the specified string.":"Die Zeichenfolge wurde nicht gefunden.",Replace:"Ersetzen",Next:"Weiter","Whole words":"Nur ganze Wörter","Find and replace":"Suchen undLine truncated
|
||||
tinymce.addI18n("de-de",{"Cut":"Cut","Header 2":"Header 2","Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\\/C\\/V keyboard shortcuts instead.":"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\\/C\\/V keyboard shortcuts instead.","Div":"Div","Paste":"Paste","Close":"Close","Font Family":"Schriftart","Pre":"Pre","Align right":"Align right","New document":"New document","Blockquote":"Blockquote","Numbered list":"Numbered list","Increase indent":"Increase indent","Formats":"Formats","Headers":"Headers","Select all":"Select all","Header 3":"Header 3","Blocks":"Blocks","Undo":"Undo","Strikethrough":"Strike-through","Bullet list":"Bullet list","Header 1":"Header 1","Superscript":"Superscript","Clear formatting":"Clear formatting","Font Sizes":"Font Sizes","Subscript":"Subscript","Header 6":"Header 6","Redo":"Redo","Paragraph":"Paragraph","Ok":"Ok","Bold":"Bold","Code":"Code","Italic":"Italic","Align center":"Align centre","Header 5":"Header 5","Decrease indent":"Decrease indent","Header 4":"Header 4","Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.":"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.","Underline":"Underline","Cancel":"Cancel","Justify":"Justify","Inline":"Inline","Copy":"Copy","Align left":"Align left","Visual aids":"Visual aids","Lower Greek":"Lower Greek","Square":"Square","Default":"Default","Lower Alpha":"Lower Alpha","Circle":"Circle","Disc":"Disc","Upper Alpha":"Upper Alpha","Upper Roman":"Upper Roman","Lower Roman":"Lower Roman","Name":"Name","Anchor":"Anchor","You have unsaved changes are you sure you want to navigate away?":"You have unsaved changes are you sure you want to navigate away?","Restore last draft":"Restore last draft","Special character":"Special character","Source code":"Source code","Right to left":"Right to left","Left to right":"Left to right","Emoticons":"Emoticons","Robots":"Robots","Document properties":"Document properties","Title":"Title","Keywords":"Keywords","Encoding":"Encoding","Description":"Description","Author":"Author","Language":"Language","`ctrl/cmd+shift+c` toggle code":"`ctrl/cmd+shift+c` toggle code","Fullscreen":"Full-screen","Horizontal line":"Horizontal line","Horizontal space":"Horizontal space","Insert\\/edit image":"Insert\\/edit image","General":"General","Advanced":"Advanced","Source":"Source","Border":"Border","Constrain proportions":"Constrain proportions","Vertical space":"Vertical space","Image description":"Image description","Style":"Style","Dimensions":"Dimensions","Insert image":"Insert image","Insert date\\/time":"Insert date\\/time","Remove link":"Remove link","Url":"URL","Text to display":"Text to display","Anchors":"Anchors","Insert link":"Insert link","New window":"New window","None":"None","The URL you entered seems to be an external link. Do you want to add the required http:\\/\\/ prefix?":"The URL you entered seems to be an external link. Do you want to add the required http:\\/\\/ prefix?","Target":"Target","The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","Insert\\/edit link":"Insert\\/edit link","Insert\\/edit video":"Insert\\/edit video","Poster":"Poster","Alternative source":"Alternative source","Paste your embed code below:":"Paste your embed code below:","Insert video":"Insert video","Embed":"Embed","Nonbreaking space":"Non-breaking space","Page break":"Page break","Paste as text":"Paste as text","Preview":"Preview","Print":"Print","Save":"Save","Could not find the specified string.":"Could not find the specified string.","Replace":"Replace","Next":"Next","Whole words":"Whole words","Find and replace":"Find and replace","Replace with":"Replace with","Find":"Find","Replace all":"Replace all","Match case":"Match case","Prev":"Prev","Spellcheck":"Spell-check","Finish":"Finish","Ignore all":"Ignore all","Ignore":"Ignore","Insert row before":"Insert row before","Rows":"Rows","Height":"Height","Paste row after":"Paste row after","Alignment":"Alignment","Column group":"Column group","Row":"Row","Insert column before":"Insert column before","Split cell":"Split cell","Cell padding":"Cell padding","Cell spacing":"Cell spacing","Row type":"Row type","Insert table":"Insert table","Body":"Body","Caption":"Caption","Footer":"Footer","Delete row":"Delete row","Paste row before":"Paste row before","Scope":"Scope","Delete table":"Delete table","Header cell":"Header cell","Column":"Column","Cell":"Cell","Header":"Header","Cell type":"Cell type","Copy row":"Copy row","Row properties":"Row properties","Table properties":"Table properties","Row group":"Row group","Right":"Right","Insert column after":"Insert column after","Cols":"Cols","Insert row after":"Insert row after","Width":"Width","Cell properties":"Line truncated
|
||||
@@ -1 +1 @@
|
||||
tinymce.addI18n("fr-fr",{"Cut":"Cut","Header 2":"Header 2","Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\\/C\\/V keyboard shortcuts instead.":"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\\/C\\/V keyboard shortcuts instead.","Div":"Div","Paste":"Paste","Close":"Close","Font Family":"Font Family","Pre":"Pre","Align right":"Align right","New document":"New document","Blockquote":"Blockquote","Numbered list":"Numbered list","Increase indent":"Increase indent","Formats":"Formats","Headers":"Headers","Select all":"Select all","Header 3":"Header 3","Blocks":"Blocks","Undo":"Undo","Strikethrough":"Strike-through","Bullet list":"Bullet list","Header 1":"Header 1","Superscript":"Superscript","Clear formatting":"Clear formatting","Font Sizes":"Font Sizes","Subscript":"Subscript","Header 6":"Header 6","Redo":"Redo","Paragraph":"Paragraph","Ok":"Ok","Bold":"Bold","Code":"Code","Italic":"Italic","Align center":"Align centre","Header 5":"Header 5","Decrease indent":"Decrease indent","Header 4":"Header 4","Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.":"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.","Underline":"Underline","Cancel":"Cancel","Justify":"Justify","Inline":"Inline","Copy":"Copy","Align left":"Align left","Visual aids":"Visual aids","Lower Greek":"Lower Greek","Square":"Square","Default":"Default","Lower Alpha":"Lower Alpha","Circle":"Circle","Disc":"Disc","Upper Alpha":"Upper Alpha","Upper Roman":"Upper Roman","Lower Roman":"Lower Roman","Name":"Name","Anchor":"Anchor","You have unsaved changes are you sure you want to navigate away?":"You have unsaved changes are you sure you want to navigate away?","Restore last draft":"Restore last draft","Special character":"Special character","Source code":"Source code","Right to left":"Right to left","Left to right":"Left to right","Emoticons":"Emoticons","Robots":"Robots","Document properties":"Document properties","Title":"Title","Keywords":"Keywords","Encoding":"Encoding","Description":"Description","Author":"Author","Language":"Language","`ctrl/cmd+shift+c` toggle code":"`ctrl/cmd+shift+c` toggle code","Fullscreen":"Full-screen","Horizontal line":"Horizontal line","Horizontal space":"Horizontal space","Insert\\/edit image":"Insert\\/edit image","General":"General","Advanced":"Advanced","Source":"Source","Border":"Border","Constrain proportions":"Constrain proportions","Vertical space":"Vertical space","Image description":"Image description","Style":"Style","Dimensions":"Dimensions","Insert image":"Insert image","Insert date\\/time":"Insert date\\/time","Remove link":"Remove link","Url":"URL","Text to display":"Text to display","Anchors":"Anchors","Insert link":"Insert link","New window":"New window","None":"None","The URL you entered seems to be an external link. Do you want to add the required http:\\/\\/ prefix?":"The URL you entered seems to be an external link. Do you want to add the required http:\\/\\/ prefix?","Target":"Target","The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","Insert\\/edit link":"Insert\\/edit link","Insert\\/edit video":"Insert\\/edit video","Poster":"Poster","Alternative source":"Alternative source","Paste your embed code below:":"Paste your embed code below:","Insert video":"Insert video","Embed":"Embed","Nonbreaking space":"Non-breaking space","Page break":"Page break","Paste as text":"Paste as text","Preview":"Preview","Print":"Print","Save":"Save","Could not find the specified string.":"Could not find the specified string.","Replace":"Replace","Next":"Next","Whole words":"Whole words","Find and replace":"Find and replace","Replace with":"Replace with","Find":"Find","Replace all":"Replace all","Match case":"Match case","Prev":"Prev","Spellcheck":"Spell-check","Finish":"Finish","Ignore all":"Ignore all","Ignore":"Ignore","Insert row before":"Insert row before","Rows":"Rows","Height":"Height","Paste row after":"Paste row after","Alignment":"Alignment","Column group":"Column group","Row":"Row","Insert column before":"Insert column before","Split cell":"Split cell","Cell padding":"Cell padding","Cell spacing":"Cell spacing","Row type":"Row type","Insert table":"Insert table","Body":"Body","Caption":"Caption","Footer":"Footer","Delete row":"Delete row","Paste row before":"Paste row before","Scope":"Scope","Delete table":"Delete table","Header cell":"Header cell","Column":"Column","Cell":"Cell","Header":"Header","Cell type":"Cell type","Copy row":"Copy row","Row properties":"Row properties","Table properties":"Table properties","Row group":"Row group","Right":"Right","Insert column after":"Insert column after","Cols":"Cols","Insert row after":"Insert row after","Width":"Width","Cell properties":Line truncated
|
||||
tinymce.addI18n("fr-fr",{"Cut":"Couper","Header 2":"Titre 2","Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\\/C\\/V keyboard shortcuts instead.":"Votre navigateur ne supporte pas l'accès direct au presse-papier. Veuillez utiliser les raccourcis Ctrl+X\\/C\\/V à la place.","Div":"Div","Paste":"Coller","Close":"Fermer","Font Family":"Famille de police","Pre":"Pre","Align right":"Aligné à droite","New document":"Nouveau document","Blockquote":"Bloc de citation","Numbered list":"Liste ordonnée","Increase indent":"Augmenter l'indentation","Formats":"Format","Headers":"En-tête","Select all":"Sélectionner tout","Header 3":"En-tête 3","Blocks":"Blocs","Undo":"Annuler","Strikethrough":"Barrer","Bullet list":"Liste à puces","Header 1":"En-tête 1","Superscript":"Exposant","Clear formatting":"Nettoyer le formatage","Font Sizes":"Taille des Polices","Subscript":"Indice","Header 6":"En-tête 6","Redo":"Reproduire","Paragraph":"Paragraphe","Ok":"Ok","Bold":"Gras","Code":"Code","Italic":"Italique","Align center":"Aligner au centre","Header 5":"En-tête 5","Decrease indent":"Diminuer l'indentation","Header 4":"En-tête 4","Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.":"Coller est en mode texte clair. Les contenus seront collés désormais en clair jusqu'à ce que vous ne désactiviez cette option.","Underline":"Souligner","Cancel":"Annuler","Justify":"Justifier","Inline":"En ligne","Copy":"Copier","Align left":"Aligner à gauche","Visual aids":"Aides visuelles","Lower Greek":"Grec minuscule","Square":"Carré","Default":"Par défaut","Lower Alpha":"Alpha minuscule","Circle":"Cercle","Disc":"Disque","Upper Alpha":"Alpha majuscule","Upper Roman":"Roman majuscule","Lower Roman":"Roman minuscule","Name":"Nom","Anchor":"Ancre","You have unsaved changes are you sure you want to navigate away?":"Des changements n'ont pas été enregistrés, voulez-vous vraiment sortir?","Restore last draft":"Restaurer dernier brouillon","Special character":"Caractère spécial","Source code":"Code Source","Right to left":"De droite à gauche","Left to right":"De gauche à droite","Emoticons":"Emoticones","Robots":"Robots","Document properties":"Propriétés du document","Title":"Titre","Keywords":"Mots-clés","Encoding":"Encodage","Description":"Description","Author":"Auteur","Language":"Langue","`ctrl/cmd+shift+c` toggle code":"inverser le code `ctrl/cmd+shift+c` ","Fullscreen":"Plein écran","Horizontal line":"Ligne horizontal","Horizontal space":"Espace horizontal","Insert\\/edit image":"Insérer\\/éditer image","General":"Général","Advanced":"Avancé","Source":"Source","Border":"Bordure","Constrain proportions":"Conserver proportions","Vertical space":"Espace vertical","Image description":"Description de l'image","Style":"Style","Dimensions":"Dimensions","Insert image":"Insérer image","Insert date\\/time":"Insérer date\\/heure","Remove link":"Enlever le lien","Url":"URL","Text to display":"Texte à afficher","Anchors":"Ancres","Insert link":"Insérer liens","New window":"Nouvelle fenêtre","None":"Aucune","The URL you entered seems to be an external link. Do you want to add the required http:\\/\\/ prefix?":"L'URL que vous avez entré semble être un lien externe. Voulez-vous ajouter le préfixe http:\\/\\/ requis?","Target":"Cible","The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?":"L'URL que vous avez entré semble être une adresse de courriel. Voulez-vous ajouter le préfixe mailto: requis?","Insert\\/edit link":"Insérer\\/éditer le lien","Insert\\/edit video":"Insérer\\/éditer la vidéo","Poster":"Poster","Alternative source":"Source alternative","Paste your embed code below:":"Coller le code intégré ci-dessous:","Insert video":"Insérer video","Embed":"Intégrer","Nonbreaking space":"Espaces insécables","Page break":"Saut de page","Paste as text":"Coller en tant que texte","Preview":"Aperçu","Print":"Imprimer","Save":"Enregistrer","Could not find the specified string.":"Impossible de trouver la chaîne spécifiée.","Replace":"Remplacer","Next":"Suivant","Whole words":"Mots entiers","Find and replace":"Trouver et remplacer","Replace with":"Remplacer par","Find":"Trouver","Replace all":"Tout remplacer","Match case":"Correspondance de la casse","Prev":"Précédent","Spellcheck":"Correcteur d'orthographe","Finish":"Terminer","Ignore all":"Ignorer tout","Ignore":"Ignorer","Insert row before":"Insérer une ligne avant","Rows":"Lignes","Height":"Hauteur","Paste row after":"Coller une ligne après","Alignment":"Alignement","Column group":"Groupe de colonnes","Row":"Ligne","Insert column before":"Insérer une colonne avant","Split cell":"Diviser la cellule","Cell padding":"Marge intérieure de cellule","Cell spacing":"Marge extérieure de cellule","Row type":"Type de ligne","Insert table":"Insérer tableau","Body":"Corps","Caption":"Légende","Footer":"Pied de page","Delete rLine truncated
|
||||
@@ -110,13 +110,8 @@ tinymce.PluginManager.add('leaui_image', function(editor, url) {
|
||||
var data = datas[i];
|
||||
var src = data.src;
|
||||
// the network image
|
||||
var trueSrc;
|
||||
if(src.indexOf("http://") != -1 || src.indexOf("https://") != -1) {
|
||||
trueSrc = src;
|
||||
} else {
|
||||
trueSrc = url + "/" + src;
|
||||
}
|
||||
data.src = trueSrc;
|
||||
var trueSrc = src;
|
||||
data.src = src;
|
||||
|
||||
var renderImage = function(data) {
|
||||
// 这里, 如果图片宽度过大, 这里设置成500px
|
||||
@@ -125,7 +120,7 @@ tinymce.PluginManager.add('leaui_image', function(editor, url) {
|
||||
var imgElm;
|
||||
// 先显示loading...
|
||||
d.id = '__mcenew' + i;
|
||||
d.src = "http://leanote.com/images/loading-24.gif";
|
||||
d.src = "/images/loading-24.gif";
|
||||
imgElm = dom.createHTML('img', d);
|
||||
editor.insertContent(imgElm);
|
||||
imgElm = dom.get(d.id);
|
||||
@@ -164,8 +159,7 @@ tinymce.PluginManager.add('leaui_image', function(editor, url) {
|
||||
(function(data) {
|
||||
ajaxPost("/file/copyImage", {userId: UserInfo.UserId, fileId: fileId, toUserId: curNote.UserId}, function(re) {
|
||||
if(reIsOk(re) && re.Id) {
|
||||
var urlPrefix = UrlPrefix; // window.location.protocol + "//" + window.location.host;
|
||||
data.src = urlPrefix + "/api/file/getImage?fileId=" + re.Id;
|
||||
data.src = "/api/file/getImage?fileId=" + re.Id;
|
||||
}
|
||||
renderImage(data);
|
||||
});
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
var LEAUI_DATAS=[];tinymce.PluginManager.add("leaui_image",function(a,b){function c(a,b){function c(a,c){d.parentNode.removeChild(d),b({width:a,height:c})}var d=document.createElement("img");d.onload=function(){c(d.clientWidth,d.clientHeight)},d.onerror=function(){c()},d.src=a;var e=d.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left=0,e.width=e.height="auto",document.body.appendChild(d)}function d(){function d(){var a='<iframe id="leauiIfr" src="/album/index?'+(new Date).getTime()+'" frameborder="0"></iframe>';return a}var e=a.dom,f=a.selection.getContent(),g=/<img.*?\/>/g,h=f.match(g),i=document.createElement("p"),j=[];for(var k in h){i.innerHTML=h[k];var l=i.firstChild;if(l&&"IMG"==l.nodeName){var m={};m.src=e.getAttrib(l,"data-src")||e.getAttrib(l,"src"),m.width=e.getAttrib(l,"width"),m.height=e.getAttrib(l,"height"),m.title=e.getAttrib(l,"title"),j.push(m)}}LEAUI_DATAS=j;var n=$(document).width()-10;n>805&&(n=805);var o=$(document).height()-100;o>365&&(o=365),win=a.windowManager.open({title:"Image",width:n,height:o,html:d(),buttons:[{text:"Cancel",onclick:function(){this.parent().parent().close()}},{text:"Insert Image",subtype:"primary",onclick:function(d){for(var f=document.getElementById("leauiIfr").contentWindow,g=f.document.getElementById("preview"),h=g.childNodes,i=[],j=0;j<h.length;++j){var d=h[j];if(d.firstChild&&"IMG"==d.firstChild.nodeName){var k=d.firstChild,l={};l.src=k.getAttribute("src"),l.width=k.getAttribute("data-width"),l.height=k.getAttribute("data-height"),l.title=k.getAttribute("data-title"),i.push(l)}}for(var j in i){var m,n=i[j],o=n.src;m=-1!=o.indexOf("http://")||-1!=o.indexOf("https://")?o:b+"/"+o,n.src=m;var p=function(b){var d=function(b,c){var d,f={};return f.id="__mcenew"+c,f.src="http://leanote.com/images/loading-24.gif",d=e.createHTML("img",f),a.insertContent(d),d=e.get(f.id),function(a){a&&a.width&&(a.width>600&&(a.width=600),b.width=a.width),e.setAttrib(d,"src",b.src),e.setAttrib(d,"title",b.title),e.setAttrib(d,"id",null)}}(b,j);c(b.src,d)},q="";if(fileIds=m.split("fileId="),2==fileIds.length&&fileIds[1].length=="53aecf8a8a039a43c8036282".length&&(q=fileIds[1]),q){var r;Note&&Note.getCurNote&&(r=Note.getCurNote()),r&&r.UserId!=UserInfo.UserId?!function(a){ajaxPost("/file/copyImage",{userId:UserInfo.UserId,fileId:q,toUserId:r.UserId},function(b){if(reIsOk(b)&&b.Id){var c=UrlPrefix;a.src=c+"/api/file/getImage?fileId="+b.Id}p(a)})}(n):p(n)}else p(n)}this.parent().parent().close()}}]})}a.addButton("leaui_image",{icon:"image",tooltip:"Insert/edit image",onclick:d,stateSelector:"img:not([data-mind-json])"}),a.addMenuItem("leaui_image",{icon:"image",text:"Insert image",onclick:d,context:"insert",prependToContext:!0});var e=!1;a.on("dragstart",function(a){LEA.readOnly&&(a.preventDefault(),a.stopPropagation()),e=!0}),a.on("dragend",function(a){e=!1}),a.on("dragover",function(a){e&&(a.preventDefault(),a.stopPropagation())})});
|
||||
var LEAUI_DATAS=[];tinymce.PluginManager.add("leaui_image",function(a,b){function c(a,b){function c(a,c){d.parentNode.removeChild(d),b({width:a,height:c})}var d=document.createElement("img");d.onload=function(){c(d.clientWidth,d.clientHeight)},d.onerror=function(){c()},d.src=a;var e=d.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left=0,e.width=e.height="auto",document.body.appendChild(d)}function d(){function b(){var a='<iframe id="leauiIfr" src="/album/index?'+(new Date).getTime()+'" frameborder="0"></iframe>';return a}var d=a.dom,e=a.selection.getContent(),f=/<img.*?\/>/g,g=e.match(f),h=document.createElement("p"),i=[];for(var j in g){h.innerHTML=g[j];var k=h.firstChild;if(k&&"IMG"==k.nodeName){var l={};l.src=d.getAttrib(k,"data-src")||d.getAttrib(k,"src"),l.width=d.getAttrib(k,"width"),l.height=d.getAttrib(k,"height"),l.title=d.getAttrib(k,"title"),i.push(l)}}LEAUI_DATAS=i;var m=$(document).width()-10;m>805&&(m=805);var n=$(document).height()-100;n>365&&(n=365),win=a.windowManager.open({title:"Image",width:m,height:n,html:b(),buttons:[{text:"Cancel",onclick:function(){this.parent().parent().close()}},{text:"Insert Image",subtype:"primary",onclick:function(b){for(var e=document.getElementById("leauiIfr").contentWindow,f=e.document.getElementById("preview"),g=f.childNodes,h=[],i=0;i<g.length;++i){var b=g[i];if(b.firstChild&&"IMG"==b.firstChild.nodeName){var j=b.firstChild,k={};k.src=j.getAttribute("src"),k.width=j.getAttribute("data-width"),k.height=j.getAttribute("data-height"),k.title=j.getAttribute("data-title"),h.push(k)}}for(var i in h){var l=h[i],m=l.src,n=m;l.src=m;var o=function(b){var e=function(b,c){var e,f={};return f.id="__mcenew"+c,f.src="/images/loading-24.gif",e=d.createHTML("img",f),a.insertContent(e),e=d.get(f.id),function(a){a&&a.width&&(a.width>600&&(a.width=600),b.width=a.width),d.setAttrib(e,"src",b.src),d.setAttrib(e,"title",b.title),d.setAttrib(e,"id",null)}}(b,i);c(b.src,e)},p="";if(fileIds=n.split("fileId="),2==fileIds.length&&fileIds[1].length=="53aecf8a8a039a43c8036282".length&&(p=fileIds[1]),p){var q;Note&&Note.getCurNote&&(q=Note.getCurNote()),q&&q.UserId!=UserInfo.UserId?!function(a){ajaxPost("/file/copyImage",{userId:UserInfo.UserId,fileId:p,toUserId:q.UserId},function(b){reIsOk(b)&&b.Id&&(a.src="/api/file/getImage?fileId="+b.Id),o(a)})}(l):o(l)}else o(l)}this.parent().parent().close()}}]})}a.addButton("leaui_image",{icon:"image",tooltip:"Insert/edit image",onclick:d,stateSelector:"img:not([data-mind-json])"}),a.addMenuItem("leaui_image",{icon:"image",text:"Insert image",onclick:d,context:"insert",prependToContext:!0});var e=!1;a.on("dragstart",function(a){LEA.readOnly&&(a.preventDefault(),a.stopPropagation()),e=!0}),a.on("dragend",function(a){e=!1}),a.on("dragover",function(a){e&&(a.preventDefault(),a.stopPropagation())})});
|
||||
@@ -117,4 +117,4 @@
|
||||
writeScripts();
|
||||
})(this);
|
||||
|
||||
// $hash: fb4edcbc9aa7f82a3fc6e0a6a3486fec
|
||||
// $hash: f4f33bf34dc8356762ead5554b3b4576
|
||||
@@ -39899,13 +39899,8 @@ tinymce.PluginManager.add('leaui_image', function(editor, url) {
|
||||
var data = datas[i];
|
||||
var src = data.src;
|
||||
// the network image
|
||||
var trueSrc;
|
||||
if(src.indexOf("http://") != -1 || src.indexOf("https://") != -1) {
|
||||
trueSrc = src;
|
||||
} else {
|
||||
trueSrc = url + "/" + src;
|
||||
}
|
||||
data.src = trueSrc;
|
||||
var trueSrc = src;
|
||||
data.src = src;
|
||||
|
||||
var renderImage = function(data) {
|
||||
// 这里, 如果图片宽度过大, 这里设置成500px
|
||||
@@ -39914,7 +39909,7 @@ tinymce.PluginManager.add('leaui_image', function(editor, url) {
|
||||
var imgElm;
|
||||
// 先显示loading...
|
||||
d.id = '__mcenew' + i;
|
||||
d.src = "http://leanote.com/images/loading-24.gif";
|
||||
d.src = "/images/loading-24.gif";
|
||||
imgElm = dom.createHTML('img', d);
|
||||
editor.insertContent(imgElm);
|
||||
imgElm = dom.get(d.id);
|
||||
@@ -39953,8 +39948,7 @@ tinymce.PluginManager.add('leaui_image', function(editor, url) {
|
||||
(function(data) {
|
||||
ajaxPost("/file/copyImage", {userId: UserInfo.UserId, fileId: fileId, toUserId: curNote.UserId}, function(re) {
|
||||
if(reIsOk(re) && re.Id) {
|
||||
var urlPrefix = UrlPrefix; // window.location.protocol + "//" + window.location.host;
|
||||
data.src = urlPrefix + "/api/file/getImage?fileId=" + re.Id;
|
||||
data.src = "/api/file/getImage?fileId=" + re.Id;
|
||||
}
|
||||
renderImage(data);
|
||||
});
|
||||
|
||||
Vendored
+1
-1
@@ -12,4 +12,4 @@ s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"cent
|
||||
if(!u(t)&&t.keyCode==e.BACKSPACE&&(n=Q.getRng(),r=n.startContainer,i=n.startOffset,o=J.getRoot(),a=r,n.collapsed&&0===i)){for(;a&&a.parentNode&&a.parentNode.firstChild==a&&a.parentNode!=o;)a=a.parentNode;"BLOCKQUOTE"===a.tagName&&(s.formatter.toggle("blockquote",null,a),n=J.createRng(),n.setStart(r,0),n.setEnd(r,0),Q.setRng(n))}})}function S(){function e(){s._refreshContentEditable(),l("StyleWithCSS",!1),l("enableInlineTableEditing",!1),Z.object_resizing||l("enableObjectResizing",!1)}Z.readonly||s.on("BeforeExecCommand MouseDown",e)}function T(){function e(){K(J.select("a"),function(e){var t=e.parentNode,n=J.getRoot();if(t.lastChild===e){for(;t&&!J.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}J.add(t,"br",{"data-mce-bogus":1})}})}s.on("SetContent ExecCommand",function(t){("setcontent"==t.type||"mceInsertLink"===t.command)&&e()})}function R(){Z.forced_root_block&&s.on("init",function(){l("DefaultParagraphSeparator",Z.forced_root_block)})}function A(){s.on("Undo Redo SetContent",function(e){e.initial||s.execCommand("mceRepaint")})}function B(){s.on("keydown",function(e){var t;u(e)||e.keyCode!=G||(t=s.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),s.undoManager.beforeChange(),J.remove(t.item(0)),s.undoManager.add()))})}function D(){var e;c()>=10&&(e="",K("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),s.contentStyles.push(e+"{padding-right: 1px !important}"))}function L(){c()<9&&(ee.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),te.addNodeFilter("noscript",function(e){for(var t=e.length,n,o,a;t--;)n=e[t],o=e[t].firstChild,o?o.value=i.decode(o.value):(a=n.attributes.map["data-mce-innertext"],a&&(n.attr("data-mce-innertext",null),o=new r("#text",3),o.value=a,o.raw=!0,n.append(o)))}))}function M(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),J.unbind(r,"mouseup",n),J.unbind(r,"mousemove",t),a=o=0}var r=J.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,J.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(J.bind(r,"mouseup",n),J.bind(r,"mousemove",t),J.getRoot().focus(),a.select())}})}function H(){s.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||Q.normalize()},!0)}function P(){s.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function O(){s.inline||s.on("keydown",function(){document.activeElement==document.body&&s.getWin().focus()})}function I(){s.inline||(s.contentStyles.push("body {min-height: 150px}"),s.on("click",function(e){if("HTML"==e.target.nodeName){var t;t=s.selection.getRng(),s.getBody().focus(),s.selection.setRng(t),s.selection.normalize(),s.nodeChanged()}}))}function F(){o.mac&&s.on("keydown",function(t){!e.metaKeyPressed(t)||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),s.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","word"))})}function z(){l("AutoUrlDetect",!1)}function W(){s.inline||s.on("focus blur beforegetcontent",function(){var e=s.dom.create("br");s.getBody().appendChild(e),e.parentNode.removeChild(e)},!0)}function V(){s.on("click",function(e){var t=e.target;do if("A"===t.tagName)return void e.preventDefault();while(t=t.parentNode)}),s.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function $(){s.on("touchstart",function(e){var t,n,r,i;t=e.target,n=(new Date).getTime(),i=e.changedTouches,!i||i.length>1||(r=i[0],s.once("touchend",function(e){var i=e.changedTouches[0],o;(new Date).getTime()-n>500||Math.abs(r.clientX-i.clientX)>5||Math.abs(r.clientY-i.clientY)>5||(o={target:t},K("pageX pageY clientX clientY screenX screenY".split(" "),function(e){o[e]=i[e]}),o=s.fire("click",o),o.isDefaultPrevented()||(s.selection.placeCaretAt(i.clientX,i.clientY),s.nodeChanged()))}))})}function U(){s.on("init",function(){s.dom.bind(s.getBody(),"submit",function(e){e.preventDefault()})})}function q(){ee.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"==e[t].attr("class")&&e[t].remove()})}function j(){s.on("dragstart",function(e){d(e)}),s.on("drop",function(e){if(!u(e)){var n=f(e);if(n){e.preventDefault();var r=t.getCaretRangeFromPoint(e.x,e.y,s.getDoc());Q.setRng(r),p(n)}}})}var K=a.each,Y=s.$,G=e.BACKSPACE,X=e.DELETE,J=s.dom,Q=s.selection,Z=s.settings,ee=s.parser,te=s.serializer,ne=o.gecko,re=o.ie,ie=o.webkit,oe="data:text/mce-internal,",ae=re?"Text":"URL";k(),m(),H(),ie&&(h(),v(),C(),R(),U(),_(),q(),$(),o.iOS?(O(),I(),V()):g()),re&&o.ie<11&&(y(),w(),E(),N(),B(),D(),L(),MLine truncated
|
||||
var e,s;if(d.unbind(window,"ready",a),i("onpageload"),t.types)return void p(t.types,function(e){p(d.select(e.selector),function(i){r(n(i),h({},t,e),i)})});if(t.selector)return void p(d.select(t.selector),function(e){r(n(e),t,e)});switch(t.target&&r(n(t.target),t),t.mode){case"exact":e=t.elements||"",e.length>0&&p(f(e),function(e){var n;(n=d.get(e))?r(e,t,n):p(document.forms,function(n){p(n.elements,function(n){n.name===e&&(e="mce_editor_"+m++,d.setAttrib(n,"id",e),r(e,t,n))})})});break;case"textareas":case"specific_textareas":p(d.select("textarea"),function(e){t.editor_deselector&&o(e,t.editor_deselector)||(!t.editor_selector||o(e,t.editor_selector))&&r(n(e),t,e)})}t.oninit&&(e=s=0,p(l,function(t){s++,t.initialized?e++:t.on("init",function(){e++,e==s&&i("oninit")}),e==s&&i("oninit")}))}var s=this,l=[];s.settings=t,d.bind(window,"ready",a)},get:function(e){return arguments.length?e in this.editors?this.editors[e]:null:this.editors},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),t.activeEditor=e,t.fire("AddEditor",{editor:e}),g||(g=function(){t.fire("BeforeUnload")},d.bind(window,"beforeunload",g)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i;{if(e)return"string"==typeof e?(e=e.selector||e,void p(d.select(e),function(e){i=r[e.id],i&&t.remove(i)})):(i=e,r[i.id]?(c(i)&&t.fire("RemoveEditor",{editor:i}),r.length||d.unbind(window,"beforeunload",g),i.remove(),i):null);for(n=r.length-1;n>=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){p(this.editors,function(e){e.save()})},addI18n:function(e,t){s.add(e,t)},translate:function(e){return s.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!=e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},h(v,a),v.setup(),window.tinymce=window.tinyMCE=v,v}),r(ge,[me,d],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(n,r){"html4"===t.settings.schema&&e(r,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(ve,[ce,d],function(e,t){var n={send:function(e){function t(){!e.async||4==r.readyState||i++>1e4?(e.success&&1e4>i&&200==r.status?e.success.call(e.success_scope,""+r.responseText,r,e):e.error&&e.error.call(e.error_scope,i>1e4?"TIMED_OUT":"GENERAL",r,e),r=null):setTimeout(t,10)}var r,i=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async===!1?!1:!0,e.data=e.data||"",r=new XMLHttpRequest){if(r.overrideMimeType&&r.overrideMimeType(e.content_type),r.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(r.withCredentials=!0),e.content_type&&r.setRequestHeader("Content-Type",e.content_type),r.setRequestHeader("X-Requested-With","XMLHttpRequest"),r=n.fire("beforeSend",{xhr:r,settings:e}).xhr,r.send(e.data),!e.async)return t();setTimeout(t,10)}}};return t.extend(n,e),n}),r(ye,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r<t.length;r++)i+=(r>0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(be,[ye,ve,d],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,tLine truncated
|
||||
|
||||
})})},onclick:function(){l(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})}})}),e.addButton("undo",{tooltip:"Undo",onPostRender:o("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:o("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:o("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:o("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:a,cmd:"mceToggleVisualAid"}),s({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:c}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return s(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:l,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",i=[],o=r(e.settings.font_formats||n);return s(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return s(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:c})}var s=r.each;i.on("AddEditor",function(t){t.editor.rtl&&(e.rtl=!0),a(t.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(je,[Ee],function(e){return e.extend({recalc:function(e){var t=e.settings,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v,y,b,C,x,w,_,E=[],N=[],k,S,T,R,A,B;t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e._paddingBox,A="reverseRows"in t?t.reverseRows:e.isRtl(),C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]);for(d=0;r>d;d++)E.push(0);for(f=0;n>f;f++)N.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),k=c.minW,S=c.minH,E[d]=k>E[d]?k:E[d],N[f]=S>N[f]?S:N[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=E[d]+(d>0?y:0),T-=(d>0?y:0)+E[d];for(R=o.innerH-g.top-g.bottom,_=0,f=0;n>f;fLine truncated
|
||||
})})},onclick:function(){l(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})}})}),e.addButton("undo",{tooltip:"Undo",onPostRender:o("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:o("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:o("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:o("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:a,cmd:"mceToggleVisualAid"}),s({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:c}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return s(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:l,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",i=[],o=r(e.settings.font_formats||n);return s(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return s(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:c})}var s=r.each;i.on("AddEditor",function(t){t.editor.rtl&&(e.rtl=!0),a(t.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(je,[Ee],function(e){return e.extend({recalc:function(e){var t=e.settings,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v,y,b,C,x,w,_,E=[],N=[],k,S,T,R,A,B;t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e._paddingBox,A="reverseRows"in t?t.reverseRows:e.isRtl(),C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]);for(d=0;r>d;d++)E.push(0);for(f=0;n>f;f++)N.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),k=c.minW,S=c.minH,E[d]=k>E[d]?k:E[d],N[f]=S>N[f]?S:N[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=E[d]+(d>0?y:0),T-=(d>0?y:0)+E[d];for(R=o.innerH-g.top-g.bottom,_=0,f=0;n>f;fLine truncated
|
||||
Reference in new issue
Block a user