summaryrefslogtreecommitdiff
path: root/post.js
diff options
context:
space:
mode:
authorPaul Kocialkowski2014-01-17 20:25:41 +0100
committerPaul Kocialkowski2014-01-17 20:25:41 +0100
commitdc1fbc29226b64168e8ae01bf42cf81e690d87dd (patch)
treedab6fac19a0f316f80095321a560b5de216d469f /post.js
Initial commit
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'post.js')
-rwxr-xr-xpost.js27
1 files changed, 27 insertions, 0 deletions
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 '<a href="http://photos.paulk.fr/index.php?photos_album_id='+src[0]+'&photo_file='+src[1]+'"><img src="http://photos.paulk.fr/thumbnails/'+src[0]+'/'+src[1]+'" alt="" /></a>';
+});
+}
+};
+
+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]+']';
+});
+}
+};