Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9296
Modified Files:
NEWS serendipity_admin_image_selector.php
serendipity_editor.js
Log Message:
RFE #904645 (comment images)
Index: serendipity_editor.js
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_editor.js,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- serendipity_editor.js 23 Mar 2004 15:49:25 -0000 1.7
+++ serendipity_editor.js 13 Apr 2004 11:58:57 -0000 1.8
@@ -5,7 +5,7 @@
Written by chris wetherell
http://www.massless.org
chris [THE AT SIGN] massless.org
-
+
warning: it only works for IE4+/Win and Moz1.1+
feel free to take it for your site
if there are any problems, let chris know.
@@ -128,7 +128,7 @@
document.forms['serendipityEntry']['serendipity[body]'].focus();
}
-function serendipity_imageSelector_done()
+function serendipity_imageSelector_done()
{
var insert = '';
var img = '';
@@ -141,21 +141,32 @@
img = f['imgName'].value;
}
+ if (document.getElementById('serendipity_imagecomment').value != '') {
+ styled = false;
+ } else {
+ styled = true;
+ }
+
+ floating = 'center';
if (XHTML11) {
if (f['serendipity[align]'][0].checked == true) {
- img = "<img style='border: 0px; padding-left: 5px; padding-right: 5px;' src='" + img + "' alt='' />\n";
+ img = "<img " + (styled ? 'style="border: 0px; padding-left: 5px; padding-right: 5px;"' : '') + ' src="' + img + "\" alt=\"\" />\n";
} else if (f['serendipity[align]'][1].checked == true) {
- img = "<img style='border: 0px; padding-left: 5px; padding-right: 5px; float: left; vertical-align: top' src='" + img + "' alt='' />";
+ img = "<img " + (styled ? 'style="float: left; border: 0px; padding-left: 5px; padding-right: 5px;"' : '') + ' src="' + img + "\" alt=\"\" />\n";
+ floating = 'left';
} else if (f['serendipity[align]'][2].checked == true) {
- img = "<img style='border: 0px; padding-left: 5px; padding-right: 5px; float: right; vertical-align: top' src='" + img + "' alt='' />";
+ img = "<img " + (styled ? 'style="float: right; border: 0px; padding-left: 5px; padding-right: 5px;"' : '') + ' src="' + img + "\" alt=\"\" />\n";
+ floating = 'right';
}
} else {
if (f['serendipity[align]'][0].checked == true) {
img = "<img border='0' hspace='5' src='" + img + "' alt='' />\n";
} else if (f['serendipity[align]'][1].checked == true) {
img = "<img border='0' hspace='5' align='left' src='" + img + "' alt='' />";
+ floating = 'left';
} else if (f['serendipity[align]'][2].checked == true) {
img = "<img border='0' hspace='5' align='right' src='" + img + "' alt='' />";
+ floating = 'right';
}
}
@@ -165,10 +176,20 @@
insert = img;
}
+ if (document.getElementById('serendipity_imagecomment').value != '') {
+ comment = f['serendipity[imagecomment]'].value;
+ block = '<div class="serendipity_imageComment_' + floating + '">'
+ + '<div class="serendipity_imageComment_img">' + insert + '</div>'
+ + '<div class="serendipity_imageComment_txt">' + comment.replace("\n", "<br />\n") + '</div>'
+ + '</div>';
+ } else {
+ block = insert;
+ }
+
if (self.opener.editorref) {
- self.opener.editorref.surroundHTML(insert, '');
+ self.opener.editorref.surroundHTML(block, '');
} else {
- self.opener.serendipity_imageSelector_addToBody(insert);
+ self.opener.serendipity_imageSelector_addToBody(block);
}
self.close();
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- NEWS 13 Apr 2004 06:51:58 -0000 1.106
+++ NEWS 13 Apr 2004 11:58:57 -0000 1.107
@@ -3,6 +3,9 @@
Version 0.6.1 ()
------------------------------------------------------------------------
+ * Added possibility to embed a comment to an image when inserting
+ it via the s9y image manager (garvinhicking)
+
* Added czech language (ISO-8859-2 and Win-1250), translated by
Josef Klimosz.
Index: serendipity_admin_image_selector.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_image_selector.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- serendipity_admin_image_selector.php 7 Apr 2004 12:42:42 -0000 1.19
+++ serendipity_admin_image_selector.php 13 Apr 2004 11:58:57 -0000 1.20
@@ -71,6 +71,11 @@
<input type="text" name="serendipity[url]" size="30" value="<?php echo $serendipity['serendipityHTTPPath'] . $serendipity['uploadPath'] . $file['name'] .'.'. $file['extension']; ?>" onfocus="value='';" /><br />
<br />
+ <b><?php echo COMMENT; ?>:</b>
+ <br />
+ <textarea id="serendipity_imagecomment" name="serendipity[imagecomment]" rows="5" cols="40"></textarea>
+ <br />
+
<input type="button" value="<?php echo BACK; ?>" onclick="history.go(-1);" />
<input type="button" value="<?php echo DONE; ?>" onclick="serendipity_imageSelector_done()" />
</div>
|