From dc1fbc29226b64168e8ae01bf42cf81e690d87dd Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Fri, 17 Jan 2014 20:25:41 +0100 Subject: Initial commit Signed-off-by: Paul Kocialkowski --- post.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 post.js (limited to 'post.js') diff --git a/post.js b/post.js new file mode 100755 index 0000000..f151bc0 --- /dev/null +++ b/post.js @@ -0,0 +1,27 @@ +jsToolBar.prototype.elements.photospaulkfr={ +type:'button',title:'photos.paulk.fr',icon:'index.php?pf=photos.paulk.fr/photos.paulk.fr.png',album_prompt:'Album :',image_prompt:'Image :',fn:{},prompt:function(){ +album=this.stripBaseURL(window.prompt(this.elements.photospaulkfr.album_prompt)); +image=this.stripBaseURL(window.prompt(this.elements.photospaulkfr.image_prompt)); +if(image.indexOf(".jpg", 0) == -1) + image=image+".jpg"; +return Array(album, image); +} +}; + +jsToolBar.prototype.elements.photospaulkfr.fn.xhtml=function(){ +var src=this.elements.photospaulkfr.prompt.call(this); +if(src){ +this.encloseSelection('','',function(str){ +return ''; +}); +} +}; + +jsToolBar.prototype.elements.photospaulkfr.fn.wiki=function(){ +var src=this.elements.photospaulkfr.prompt.call(this); +if(src){ +this.encloseSelection('','',function(str){ +return '[((http://photos.paulk.fr/thumbnails/'+src[0]+'/'+src[1]+'))|http://photos.paulk.fr/index.php?photos_album_id='+src[0]+'&photo_file='+src[1]+']'; +}); +} +}; -- cgit v1.2.3