~ubuntu-branches/debian/sid/wordpress/sid

« back to all changes in this revision

Viewing changes to wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js

  • Committer: Package Import Robot
  • Author(s): Raphaël Hertzog, Raphaël Hertzog, Martin Bagge / brother
  • Date: 2012-06-16 01:19:20 UTC
  • mfrom: (1.2.22)
  • Revision ID: package-import@ubuntu.com-20120616011920-ivqcktmjehq4gpal
Tags: 3.4+dfsg-1
* New upstream release. Closes: #677534

[ Raphaël Hertzog ]
* [a1c0409] Refresh and update all patches to correctly apply on version
  3.4.
* [3804496] Update debian/missing-sources/ to match the current versions of
  embedded javascript and flash files.
* [185b051] Drop the old "default" theme (and its French translation)
* [966ce6c] Grab latest translations
* [1983326] Update Standards-Version to 3.9.3 (no change).
* [29c48b6] Increase debhelper compat level to 9.
* [73e16d0] Replace debian/dh_linktree by the packaged version.
* [359b660] Update debian/wordpress.linktrees to match latest developments.
* [645b650] Let setup-mysql lowercase the FQDN since the configuration
  scheme expects this. Thanks to Chris Butler <chrisb@debian.org> for the
  report (Closes: #658395)
* [5433e90] Fix setup-mysql to avoid creating /srv/www with restricted
  permissions (Closes: #616400)
* [dd2ef1d] Move back wp-config.php to /usr/share/wordpress/ since it's only
  a dispatcher to the real configuration file (Closes: #592502)
* [b602372] Improve wp-config.php so that WordPress works behind an https
  reverse-proxy.
* [ba0b729] Entirely update and rewrite README.debian. (Closes: #575985,
  #639980)
* [683a908] Update wp-config.php to not redefine constants which have
  already been set.  Thanks to Richard van den Berg <richard@vdberg.org> for
  the report. (Closes: #613283)
* [315eb68] Let wordpress-l10n depend on the same version than wordpress.
  (Closes: #623557)
* [a6d0b9f] Default configuration now sets WP_CONTENT_DIR to
  /var/lib/wordpress/wp-content. And the package provides this new directory
  appropriately setup with write rights to www-data on blogs.dir and
  uploads. themes and plugins are root-owned directories with symlinks
  pointing back to the default themes and plugins. (Closes: #675469)
* [4db98c6] Update setup-mysql to use WP_CONTENT_DIR (and no longer use
  $upload_dir). (Closes: #658508)
* [a1970da] Extend debian/wordpress.linktrees to cover swfobject.js.
* [8d46dab] Use dpkg-maintscript-helper to drop obsolete
  /etc/wordpress/wp-config.php

[ Martin Bagge / brother ]
* [56d0a34] Improve the setup script to be able to use a remote MySQL
  server.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
(function(){tinymce.create("tinymce.plugins.wpEditImage",{init:function(a,c){var d=this,b={};d.url=c;d._createButtons();a.addCommand("WP_EditImage",function(){var i=a.selection.getNode(),g=tinymce.DOM.getViewPort(),h=g.h,e=(720<g.w)?720:g.w,f=a.dom.getAttrib(i,"class");if(f.indexOf("mceItem")!=-1||f.indexOf("wpGallery")!=-1||i.nodeName!="IMG"){return}tb_show("",c+"/editimage.html?ver=321&TB_iframe=true");tinymce.DOM.setStyles("TB_window",{width:(e-50)+"px",height:(h-45)+"px","margin-left":"-"+parseInt(((e-50)/2),10)+"px"});if(!tinymce.isIE6){tinymce.DOM.setStyles("TB_window",{top:"20px",marginTop:"0"})}tinymce.DOM.setStyles("TB_iframeContent",{width:(e-50)+"px",height:(h-75)+"px"});tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")});a.onInit.add(function(e){tinymce.dom.Event.add(e.getBody(),"dragstart",function(f){if(!tinymce.isGecko&&f.target.nodeName=="IMG"&&e.dom.getParent(f.target,"dl.wp-caption")){return tinymce.dom.Event.cancel(f)}})});a.onMouseUp.add(function(f,g){if(tinymce.isWebKit||tinymce.isOpera){return}if(b.x&&(g.clientX!=b.x||g.clientY!=b.y)){var h=f.selection.getNode();if("IMG"==h.nodeName){window.setTimeout(function(){var e,i;if(h.width!=b.img_w||h.height!=b.img_h){h.className=h.className.replace(/size-[^ "']+/,"")}if(f.dom.getParent(h,"div.mceTemp")){e=f.dom.getParent(h,"dl.wp-caption");if(e){i=f.dom.getAttrib(h,"width")||h.width;i=parseInt(i,10);f.dom.setStyle(e,"width",10+i);f.execCommand("mceRepaint")}}},100)}}b={}});a.onMouseDown.add(function(f,g){if(g.target&&(g.target.nodeName=="IMG"||(g.target.firstChild&&g.target.firstChild.nodeName=="IMG"))){b={x:g.clientX,y:g.clientY,img_w:g.target.clientWidth,img_h:g.target.clientHeight};if(f.dom.getAttrib(g.target,"class").indexOf("mceItem")==-1){f.plugins.wordpress._showButtons(g.target,"wp_editbtns")}}});a.onKeyPress.add(function(f,j){var k,g,i,h;if(j.keyCode==13){k=f.selection.getNode();g=f.dom.getParent(k,"dl.wp-caption");i=f.dom.getParent(g,"div.mceTemp");if(g&&i){h=f.dom.create("p",{},"&nbsp;");f.dom.insertAfter(h,i);if(h.firstChild){f.selection.select(h.firstChild)}else{f.selection.select(h)}tinymce.dom.Event.cancel(j);return false}}});a.onBeforeSetContent.add(function(e,f){f.content=d._do_shcode(f.content)});a.onPostProcess.add(function(e,f){if(f.get){f.content=d._get_shcode(f.content)}})},_do_shcode:function(a){return a.replace(/(?:<p>)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?[\s\u00a0]*/g,function(g,d,k){var j,f,e,h,i;d=d.replace(/\\'|\\&#39;|\\&#039;/g,"&#39;").replace(/\\"|\\&quot;/g,"&quot;");k=k.replace(/\\&#39;|\\&#039;/g,"&#39;").replace(/\\&quot;/g,"&quot;");j=d.match(/id=['"]([^'"]+)/i);f=d.match(/align=['"]([^'"]+)/i);e=d.match(/width=['"]([0-9]+)/);h=d.match(/caption=['"]([^'"]+)/i);j=(j&&j[1])?j[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";h=(h&&h[1])?h[1]:"";if(!e||!h){return k}i=(f=="aligncenter")?"mceTemp mceIEcenter":"mceTemp";return'<div class="'+i+'" draggable><dl id="'+j+'" class="wp-caption '+f+'" style="width: '+(10+parseInt(e))+'px"><dt class="wp-caption-dt">'+k+'</dt><dd class="wp-caption-dd">'+h+"</dd></dl></div>"})},_get_shcode:function(a){return a.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi,function(g,d,j,h){var i,f,e;i=d.match(/id=['"]([^'"]+)/i);f=d.match(/class=['"]([^'"]+)/i);e=j.match(/width=['"]([0-9]+)/);i=(i&&i[1])?i[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";if(!e||!h){return j}f=f.match(/align[^ '"]+/)||"alignnone";h=h.replace(/<\S[^<>]*>/gi,"").replace(/'/g,"&#39;").replace(/"/g,"&quot;");return'[caption id="'+i+'" align="'+f+'" width="'+e+'" caption="'+h+'"]'+j+"[/caption]"})},_createButtons:function(){var b=this,a=tinyMCE.activeEditor,d=tinymce.DOM,e,c;d.remove("wp_editbtns");d.add(document.body,"div",{id:"wp_editbtns",style:"display:none;"});e=d.add("wp_editbtns","img",{src:b.url+"/img/image.png",id:"wp_editimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.edit_img")});tinymce.dom.Event.add(e,"mousedown",function(g){var f=tinyMCE.activeEditor;f.windowManager.bookmark=f.selection.getBookmark("simple");f.execCommand("WP_EditImage")});c=d.add("wp_editbtns","img",{src:b.url+"/img/delete.png",id:"wp_delimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.del_img")});tinymce.dom.Event.add(c,"mousedown",function(i){var f=tinyMCE.activeEditor,g=f.selection.getNode(),h;if(g.nodeName=="IMG"&&f.dom.getAttrib(g,"class").indexOf("mceItem")==-1){if((h=f.dom.getParent(g,"div"))&&f.dom.hasClass(h,"mceTemp")){f.dom.remove(h)}else{if((h=f.dom.getParent(g,"A"))&&h.childNodes.length==1){f.dom.remove(h)}else{f.dom.remove(g)}}f.execCommand("mceRepaint");return false}})},getInfo:function(){return{longname:"Edit Image",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpeditimage",tinymce.plugins.wpEditImage)})();
 
 
b'\\ No newline at end of file'
 
1
(function(){tinymce.create("tinymce.plugins.wpEditImage",{url:"",editor:{},init:function(a,c){var d=this,b={};d.url=c;d.editor=a;d._createButtons();a.addCommand("WP_EditImage",function(){var i=a.selection.getNode(),g,h,e,f=a.dom.getAttrib(i,"class");if(f.indexOf("mceItem")!=-1||f.indexOf("wpGallery")!=-1||i.nodeName!="IMG"){return}g=tinymce.DOM.getViewPort();h=680<(g.h-70)?680:g.h-70;e=650<g.w?650:g.w;a.windowManager.open({file:c+"/editimage.html",width:e+"px",height:h+"px",inline:true})});a.onInit.add(function(e){e.dom.events.add(e.getBody(),"dragstart",function(g){var f;if(g.target.nodeName=="IMG"&&(f=e.dom.getParent(g.target,"div.mceTemp"))){e.selection.select(f)}})});a.onMouseUp.add(function(f,g){if(tinymce.isWebKit||tinymce.isOpera){return}if(b.x&&(g.clientX!=b.x||g.clientY!=b.y)){var h=f.selection.getNode();if("IMG"==h.nodeName){window.setTimeout(function(){var e=f.dom.getParent(h,"dl.wp-caption"),i;if(h.width!=b.img_w||h.height!=b.img_h){h.className=h.className.replace(/size-[^ "']+/,"")}if(e){i=f.dom.getAttrib(h,"width")||h.width;i=parseInt(i,10);f.dom.setStyle(e,"width",10+i);f.execCommand("mceRepaint")}},100)}}b={}});a.onMouseDown.add(function(f,h){var g=h.target;if(g.nodeName!="IMG"){if(g.firstChild&&g.firstChild.nodeName=="IMG"&&g.childNodes.length==1){g=g.firstChild}else{return}}if(f.dom.getAttrib(g,"class").indexOf("mceItem")==-1){b={x:h.clientX,y:h.clientY,img_w:g.clientWidth,img_h:g.clientHeight};f.plugins.wordpress._showButtons(g,"wp_editbtns")}});a.onKeyPress.add(function(f,j){var k,g,i,h;if(j.keyCode==13){k=f.selection.getNode();g=f.dom.getParent(k,"dl.wp-caption");if(g){i=f.dom.getParent(g,"div.mceTemp")}if(i){h=f.dom.create("p",{},"<br>");f.dom.insertAfter(h,i);f.selection.select(h.firstChild);if(tinymce.isIE){f.selection.setContent("")}else{f.selection.setContent('<br _moz_dirty="">');f.selection.setCursorLocation(h,0)}f.dom.events.cancel(j);return false}}});a.onBeforeSetContent.add(function(e,f){f.content=e.wpSetImgCaption(f.content)});a.onPostProcess.add(function(e,f){if(f.get){f.content=e.wpGetImgCaption(f.content)}});a.wpSetImgCaption=function(e){return d._do_shcode(e)};a.wpGetImgCaption=function(e){return d._get_shcode(e)}},_do_shcode:function(a){return a.replace(/(?:<p>)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g,function(j,i,h){var d,m,k,l,f,g,e=tinymce.trim;d=i.match(/id=['"]([^'"]*)['"] ?/);i=i.replace(d[0],"");m=i.match(/align=['"]([^'"]*)['"] ?/);i=i.replace(m[0],"");k=i.match(/width=['"]([0-9]*)['"] ?/);i=i.replace(k[0],"");h=e(h);g=h.match(/((?:<a [^>]+>)?<img [^>]+>(?:<\/a>)?)([\s\S]*)/i);if(g&&g[2]){l=e(g[2]);g=e(g[1])}else{l=e(i).replace(/caption=['"]/,"").replace(/['"]$/,"");g=h}d=(d&&d[1])?d[1]:"";m=(m&&m[1])?m[1]:"alignnone";k=(k&&k[1])?k[1]:"";if(!k||!l){return h}f="mceTemp";if(m=="aligncenter"){f+=" mceIEcenter"}return'<div class="'+f+'"><dl id="'+d+'" class="wp-caption '+m+'" style="width: '+(10+parseInt(k))+'px"><dt class="wp-caption-dt">'+g+'</dt><dd class="wp-caption-dd">'+l+"</dd></dl></div>"})},_get_shcode:function(a){return a.replace(/<div (?:id="attachment_|class="mceTemp)[^>]*>([\s\S]+?)<\/div>/g,function(d,c){var e=c.replace(/<dl ([^>]+)>\s*<dt [^>]+>([\s\S]+?)<\/dt>\s*<dd [^>]+>([\s\S]*?)<\/dd>\s*<\/dl>/gi,function(i,f,l,j){var k,h,g;g=l.match(/width="([0-9]*)"/);g=(g&&g[1])?g[1]:"";if(!g||!j){return l}k=f.match(/id="([^"]*)"/);k=(k&&k[1])?k[1]:"";h=f.match(/class="([^"]*)"/);h=(h&&h[1])?h[1]:"";h=h.match(/align[a-z]+/)||"alignnone";j=j.replace(/\r\n|\r/g,"\n").replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g,function(b){return b.replace(/[\r\n\t]+/," ")});j=j.replace(/\s*\n\s*/g,"<br />");return'[caption id="'+k+'" align="'+h+'" width="'+g+'"]'+l+" "+j+"[/caption]"});if(e.indexOf("[caption")!==0){e=c.replace(/[\s\S]*?((?:<a [^>]+>)?<img [^>]+>(?:<\/a>)?)(<p>[\s\S]*<\/p>)?[\s\S]*/gi,"<p>$1</p>$2")}return e})},_createButtons:function(){var b=this,a=tinyMCE.activeEditor,d=tinymce.DOM,e,c;d.remove("wp_editbtns");d.add(document.body,"div",{id:"wp_editbtns",style:"display:none;"});e=d.add("wp_editbtns","img",{src:b.url+"/img/image.png",id:"wp_editimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.edit_img")});tinymce.dom.Event.add(e,"mousedown",function(g){var f=tinyMCE.activeEditor;f.windowManager.bookmark=f.selection.getBookmark("simple");f.execCommand("WP_EditImage")});c=d.add("wp_editbtns","img",{src:b.url+"/img/delete.png",id:"wp_delimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.del_img")});tinymce.dom.Event.add(c,"mousedown",function(i){var f=tinyMCE.activeEditor,g=f.selection.getNode(),h;if(g.nodeName=="IMG"&&f.dom.getAttrib(g,"class").indexOf("mceItem")==-1){if((h=f.dom.getParent(g,"div"))&&f.dom.hasClass(h,"mceTemp")){f.dom.remove(h)}else{if((h=f.dom.getParent(g,"A"))&&h.childNodes.length==1){f.dom.remove(h)}else{f.dom.remove(g)}}f.execCommand("mceRepaint");return false}})},getInfo:function(){return{longname:"Edit Image",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpeditimage",tinymce.plugins.wpEditImage)})();
 
 
b'\\ No newline at end of file'