Skip to content

Commit

Permalink
"MDL-20592, improve advimage plugin in editor"
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongsheng Cai committed Nov 11, 2009
1 parent 1caf890 commit 34f94b7
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 15 deletions.
83 changes: 83 additions & 0 deletions lib/editor/tinymce/extra/patches/tinymce_plugin_advimage.patch
@@ -0,0 +1,83 @@
Index: lib/editor/tinymce/plugins/advimage/image.htm
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/editor/tinymce/plugins/advimage/image.htm,v
retrieving revision 1.1
diff -u -r1.1 image.htm
--- lib/editor/tinymce/plugins/advimage/image.htm 16 May 2009 20:53:41 -0000 1.1
+++ lib/editor/tinymce/plugins/advimage/image.htm 11 Nov 2009 05:18:39 -0000
@@ -26,14 +26,15 @@
<legend>{#advimage_dlg.general}</legend>

<table class="properties">
+ <tr>
+ <td class="column1">&nbsp;</td>
+ <td align="left" id="srcbrowsercontainer">&nbsp;</td>
+ </tr>
<tr>
<td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td>
- <td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input name="src" type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" /></td>
- <td id="srcbrowsercontainer">&nbsp;</td>
- </tr>
- </table></td>
+ <td>
+ <input name="src" type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" />
+ </td>
</tr>
<tr>
<td><label for="src_list">{#advimage_dlg.image_list}</label></td>
@@ -41,12 +42,8 @@
</tr>
<tr>
<td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td>
- <td colspan="2"><input id="alt" name="alt" type="text" value="" /></td>
+ <td><input id="alt" name="alt" type="text" value="" /></td>
</tr>
- <tr>
- <td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td>
- <td colspan="2"><input id="title" name="title" type="text" value="" /></td>
- </tr>
</table>
</fieldset>

@@ -180,10 +177,13 @@

<table border="0" cellpadding="4" cellspacing="0">
<tr>
+ <td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td>
+ <td><input id="title" name="title" type="text" value="" /></td>
+ </tr>
+ <tr>
<td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td>
<td><input id="id" name="id" type="text" value="" /></td>
</tr>
-
<tr>
<td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td>
<td>
Index: lib/editor/tinymce/plugins/advimage/css/advimage.css
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/editor/tinymce/plugins/advimage/css/advimage.css,v
retrieving revision 1.1
diff -u -r1.1 advimage.css
--- lib/editor/tinymce/plugins/advimage/css/advimage.css 16 May 2009 20:54:52 -0000 1.1
+++ lib/editor/tinymce/plugins/advimage/css/advimage.css 11 Nov 2009 05:18:39 -0000
@@ -1,13 +1,15 @@
#src_list, #over_list, #out_list {width:280px;}
.mceActionPanel {margin-top:7px;}
+.moodlebutton {font-size: 1.5em;font-weight:bold;padding: 3px;border:1px solid #ccc;text-decoration:none}
+.moodlebutton:hover {background: #ccc}
.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}
.checkbox {border:0;}
.panel_wrapper div.current {height:305px;}
-#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}
+#prev {margin:0; border:1px solid #000; width:428px; height:180px; overflow:auto;}
#align, #classlist {width:150px;}
#width, #height {vertical-align:middle; width:50px; text-align:center;}
#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}
#class_list {width:180px;}
input {width: 280px;}
#constrain, #onmousemovecheck {width:auto;}
-#id, #dir, #lang, #usemap, #longdesc {width:200px;}
+#id, #title, #dir, #lang, #usemap, #longdesc {width:200px;}
6 changes: 4 additions & 2 deletions lib/editor/tinymce/plugins/advimage/css/advimage.css
@@ -1,13 +1,15 @@
#src_list, #over_list, #out_list {width:280px;}
.mceActionPanel {margin-top:7px;}
.moodlebutton {font-size: 1.5em;font-weight:bold;padding: 3px;border:1px solid #ccc;text-decoration:none}
.moodlebutton:hover {background: #ccc}
.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}
.checkbox {border:0;}
.panel_wrapper div.current {height:305px;}
#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}
#prev {margin:0; border:1px solid #000; width:428px; height:180px; overflow:auto;}
#align, #classlist {width:150px;}
#width, #height {vertical-align:middle; width:50px; text-align:center;}
#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}
#class_list {width:180px;}
input {width: 280px;}
#constrain, #onmousemovecheck {width:auto;}
#id, #dir, #lang, #usemap, #longdesc {width:200px;}
#id, #title, #dir, #lang, #usemap, #longdesc {width:200px;}
24 changes: 12 additions & 12 deletions lib/editor/tinymce/plugins/advimage/image.htm
Expand Up @@ -26,27 +26,24 @@
<legend>{#advimage_dlg.general}</legend>

<table class="properties">
<tr>
<td class="column1">&nbsp;</td>
<td align="left" id="srcbrowsercontainer">&nbsp;</td>
</tr>
<tr>
<td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td>
<td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input name="src" type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" /></td>
<td id="srcbrowsercontainer">&nbsp;</td>
</tr>
</table></td>
<td>
<input name="src" type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" />
</td>
</tr>
<tr>
<td><label for="src_list">{#advimage_dlg.image_list}</label></td>
<td><select id="src_list" name="src_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;ImageDialog.showPreviewImage(this.options[this.selectedIndex].value);"><option value=""></option></select></td>
</tr>
<tr>
<td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td>
<td colspan="2"><input id="alt" name="alt" type="text" value="" /></td>
<td><input id="alt" name="alt" type="text" value="" /></td>
</tr>
<tr>
<td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td>
<td colspan="2"><input id="title" name="title" type="text" value="" /></td>
</tr>
</table>
</fieldset>

Expand Down Expand Up @@ -179,11 +176,14 @@
<legend>{#advimage_dlg.misc}</legend>

<table border="0" cellpadding="4" cellspacing="0">
<tr>
<td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td>
<td><input id="title" name="title" type="text" value="" /></td>
</tr>
<tr>
<td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td>
<td><input id="id" name="id" type="text" value="" /></td>
</tr>

<tr>
<td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td>
<td>
Expand Down
2 changes: 1 addition & 1 deletion lib/editor/tinymce/readme_moodle.txt
Expand Up @@ -12,7 +12,7 @@ Upgrade procedure:
2/ replace tiny_mce*.* files, themes/*, utils/* and plugins/*
(keep dragmath, moodlenolink, spellchecker)
3/ copy tinymce/jscripts/tiny_mce/classes/Popup.js to Popup.js
4/ apply strings & form_utils.js patch
4/ apply strings & form_utils.js & tinymce_plugin_advimage patches
5/ copy yuicompressor.jar from dev package into extra/tools/, use shell
script extra/tools/compress.sh to compress modified files
6/ download all TinyMCE lang files (extra/tools/download_langs.sh)
Expand Down

0 comments on commit 34f94b7

Please sign in to comment.