Permalink
Browse files

updated README files, and included the Moodle 2.0 patch file

--HG--
extra : convert_revision : svn%3Afc1ba2b4-ac28-11dd-a772-7fcde58d38e6/trunk%40113
  • Loading branch information...
1 parent c8199bb commit 9106c12f8745f672b571866db599e359b100f09d mihai.sucan committed Aug 14, 2009
Showing with 226 additions and 21 deletions.
  1. +31 −7 README
  2. +33 −10 ext/moodle/README
  3. +135 −0 ext/moodle/moodle20-paintweb.patch
  4. +26 −0 scripts/README
  5. +1 −4 src/interfaces/default/layout.xhtml
View
38 README
@@ -1,11 +1,10 @@
Copyright (C) 2008, 2009 Mihai Şucan
$URL: http://code.google.com/p/paintweb $
-$Date: 2009-07-09 18:38:55 +0300 $
+$Date: 2009-08-14 12:15:41 +0300 $
PaintWeb is a Web application which allows users to draw inside the Web browser
-making use of new Web technologies. The project is undergoing heavy development
-for the purpose of having it integrated into Moodle and TinyMCE.
+making use of new Web technologies.
This folder holds the PaintWeb source code, documentation and the packaged
PaintWeb build.
@@ -17,14 +16,39 @@ Requirements:
Known to work are: Opera 9.5+, Firefox 3+, Safari 3.1+, Konqueror 4.1+.
Each Web browser has its minor quirks.
-Internet Explorer does not support Canvas. This application does not work in this Web browser.
+Internet Explorer does not support Canvas. This application does not work in
+this Web browser.
+You can use PaintWeb inside Moodle, or you may integrate PaintWeb into your
+project via TinyMCE. The "ext" folder holds a TinyMCE plugin which integrates
+PaintWeb into TinyMCE. Please check the documentation for further details:
+
+http://code.google.com/p/paintweb
+
+Files and folders in this package:
+
+build/ - holds the packaged PaintWeb build.
+CHANGES - holds a chronologically ordered list of changes.
+COPYING - the GPLv3 license.
+demos/ - holds usage demos with PaintWeb.
+docs/ - holds project documentation.
+ext/ - holds code for integrating PaintWeb into external projects. For
+ example, there's code for Moodle and TinyMCE integration.
+Makefile - the Makefile script which drives the PaintWeb packaging process.
+README - this file
+scripts/ - holds scripts used for PaintWeb packaging.
+src/ - holds the PaintWeb source code.
+tests/ - holds various tests made during the development of PaintWeb.
+
Get in contact:
-- You can contact me via email at mihai.sucan@gmail.com or via my site www.robodesign.ro. Any feedback is always welcome.
-- I am always looking for volunteers to help me with coding - there's lots of work to do. We can collaborate via Gtalk, Yahoo, IRC, ICQ and anyhow you like.
-- On IRC I'm online everyday on irc.freenode.net. Just /query ROBOd - my nickname.
+- You can contact me via email at mihai.sucan@gmail.com or via my site
+www.robodesign.ro. Any feedback is always welcome.
+- I am always looking for volunteers to help me with coding - there's lots of
+work to do. We can collaborate via Gtalk, Yahoo, IRC, ICQ and anyhow you like.
+- On IRC I'm online everyday on irc.freenode.net. Just /query ROBOd - my
+nickname.
Thank you!
View
@@ -1,9 +1,10 @@
Copyright (C) 2009 Mihai Şucan
$URL: http://code.google.com/p/paintweb $
-$Date: 2009-07-30 22:34:08 +0300 $
+$Date: 2009-08-14 13:18:18 +0300 $
-This folder holds scripts used for integration PaintWeb into Moodle.
+This folder holds scripts used for integration PaintWeb into Moodle 1.9 and
+Moodle 2.0.
=== Files ===
@@ -15,22 +16,31 @@ Moodle PHP language files.
gen_paintweblang.php - allows you to convert Moodle PHP language files to
PaintWeb JSON language files.
-imagesave.php - implements the image save operation of PaintWeb, using the
-Moodle API.
+imagesave19.php - implements the image save operation of PaintWeb, for Moodle
+1.9.
-imageview.php - implements an image file serving mechanism. Images saved are
-stored in the Moodle data dir which is not accessible from the browser, thus
-this script is needed to allow users to view such images from the data dir.
+imagesave20.php - implements the image save operation of PaintWeb, for Moodle
+2.0, using the new File API
+
+imageview19.php - implements an image file serving mechanism for Moodle 1.9.
+Images saved are stored in the Moodle data dir which is not accessible from the
+browser, thus this script is needed to allow users to view such images from the
+data dir.
lang.json.php - the JSON language file loaded by PaintWeb in Moodle. This is
a PHP script which generates the JSON dynamically based on the Moodle PHP
language files.
moodle19-paintweb.patch - the patch you need to apply to Moodle 1.9 to get
PaintWeb working. This is a patch you can apply once you have Moodle 1.9 and
-TinyMCE 3.
+TinyMCE 3. This holds the differences *only* for the Moodle core files.
+
+moodle20-paintweb.patch - the patch you need to apply to Moodle 2.0 to get
+PaintWeb working. This is a patch you can apply once you have Moodle 2.0. This
+holds the differences *only* for the Moodle core files.
+
-=== Usage ===
+=== Usage in Moodle 1.9 ===
If you have no experience with Git, here's what you need to do:
@@ -39,14 +49,27 @@ If you have no experience with Git, here's what you need to do:
cd ~/src/moodle
git checkout -b mdl19-paintweb origin/mdl19-paintweb
-You need to add the following in your Moodle configuration file (config.php):
+You need to add the following in your Moodle 1.9 configuration file
+(config.php):
$CFG->defaulthtmleditor = 'tinymce';
$CFG->tinymcePaintWeb = true;
# The PaintWeb folder used for storing images inside the Moodle data folder.
$CFG->paintwebImagesFolder = 'paintweb-images';
+=== Usage in Moodle 2.0 ===
+
+If you have no experience with Git, here's what you need to do:
+
+# Get the Moodle 2.0 code with PaintWeb integrated:
+ git clone git://repo.or.cz/moodle/mihaisucan.git ~/src/moodle
+ cd ~/src/moodle
+ git checkout -b mdl20-paintweb origin/mdl20-paintweb
+
+There's nothing to configure in your config.php. PaintWeb is ready to use.
+
+
Good luck!
--
@@ -0,0 +1,135 @@
+diff --git a/lang/en_utf8/editor_tinymce.php b/lang/en_utf8/editor_tinymce.php
+index 2748455..9773efd 100644
+--- a/lang/en_utf8/editor_tinymce.php
++++ b/lang/en_utf8/editor_tinymce.php
+@@ -756,3 +756,22 @@ $string['xhtmlxtras_dlg:title_acronym_element'] = 'Acronym Element';
+ $string['xhtmlxtras_dlg:title_cite_element'] = 'Citation Element';
+ $string['xhtmlxtras_dlg:title_del_element'] = 'Deletion Element';
+ $string['xhtmlxtras_dlg:title_ins_element'] = 'Insertion Element';
++$string['paintweb:toolbarButton'] = 'Edit the selected image in PaintWeb. If no image is selected, then you can create a new drawing.';
++$string['paintweb:overlayButton'] = 'Edit';
++$string['paintweb:contextMenuEdit'] = 'Edit the image in PaintWeb';
++$string['paintweb:overlayLoading'] = 'PaintWeb is loading...';
++$string['paintweb:statusImageEditing'] = 'You are editing an image from TinyMCE.';
++$string['paintweb:statusSavingImage'] = 'Saving image changes...';
++$string['paintweb:statusImageSaved'] = 'Image save completed successfully!';
++$string['paintweb:statusImageSaveFailed'] = 'Image save failed!';
++$string['paintweb:imageSaveButton'] = 'Save';
++$string['paintweb:imageSaveButtonTitle'] = 'Save the image and return to TinyMCE.';
++$string['paintweb:cancelButton'] = 'Cancel';
++$string['paintweb:cancelButtonTitle'] = 'Cancel image edits and return to TinyMCE.';
++$string['paintweb_dlg:dlg_title'] = 'Create a new image';
++$string['paintweb_dlg:widthLabel'] = 'Width: ';
++$string['paintweb_dlg:heightLabel'] = 'Height: ';
++$string['paintweb_dlg:bgrColorLabel'] = 'Background color: ';
++$string['paintweb_dlg:imgTitleLabel'] = 'Title: ';
++$string['paintweb_dlg:altTextLabel'] = 'Alternate text: ';
++$string['paintweb_dlg:altTextTitle'] = 'This text is displayed when the image cannot render.';
+diff --git a/lib/editor/tinymce/extra/tools/update_lang_files.php b/lib/editor/tinymce/extra/tools/update_lang_files.php
+index 692f05e..f58cf38 100644
+--- a/lib/editor/tinymce/extra/tools/update_lang_files.php
++++ b/lib/editor/tinymce/extra/tools/update_lang_files.php
+@@ -42,7 +42,7 @@ $langconversion = array(
+ 'zh_tw' => 'zh',
+ );
+
+-$targetlangdir = "$CFG->dirroot/../lang"; // change if needed
++$targetlangdir = "$CFG->dirroot/lang"; // change if needed
+ $tempdir = "$CFG->dirroot/lib/editor/tinymce/extra/tools/temp";
+ $enfile = "$CFG->dirroot/lang/en_utf8/editor_tinymce.php";
+
+@@ -230,4 +230,4 @@ function editor_tinymce_get_all_strings($file) {
+ }
+
+ return $string;
+-}
+\ No newline at end of file
++}
+diff --git a/lib/editor/tinymce/lib.php b/lib/editor/tinymce/lib.php
+index b07e85c..287655e 100644
+--- a/lib/editor/tinymce/lib.php
++++ b/lib/editor/tinymce/lib.php
+@@ -95,6 +95,40 @@ class tinymce_texteditor extends texteditor {
+ $xdragmath = '';
+ }
+
++ // PaintWeb is enabled by default. If the developer wants, he can set
++ // $options['plugin/paintweb'] to false to disable the plugin.
++ if (isset($options['maxfiles']) && $options['maxfiles'] != 0 &&
++ (!isset($options['plugin/paintweb']) || $options['plugin/paintweb'])) {
++
++ $paintwebcontext = get_system_context();
++ $paintwebcontext = !empty($paintwebcontext) ? $paintwebcontext->id : $context->id;
++ $paintwebplugin = 'paintweb,';
++ $paintwebbutton = 'paintwebEdit,';
++
++ $paintwebconfig = array(
++ 'configFile' => '../ext/moodle/config.json',
++ 'lang' => 'moodle',
++ 'moodleServer' => array(
++ 'version' => $CFG->version,
++ 'release' => $CFG->release,
++ 'contextid' => $paintwebcontext
++ ),
++ 'tinymce' => array(
++ 'paintwebFolder' => $CFG->httpswwwroot . '/lib/paintweb/build/',
++ 'imageSaveDataURL' => false,
++ 'imageDataURLfilter' => $CFG->httpswwwroot . '/lib/paintweb/ext/moodle/imagesave20.php',
++ 'overlayButton' => true,
++ 'dblclickHandler' => true,
++ 'contextMenuItem' => true,
++ 'pluginBar' => true
++ ),
++ );
++ } else {
++ $paintwebplugin = '';
++ $paintwebbutton = '';
++ $paintwebconfig = '';
++ }
++
+ $params = array(
+ 'mode' => "exact",
+ 'elements' => $elementid,
+@@ -111,7 +145,7 @@ class tinymce_texteditor extends texteditor {
+ 'apply_source_formatting' => true,
+ 'remove_script_host' => false,
+ 'entity_encoding' => "raw",
+- 'plugins' => "safari,table,style,layer,advhr,advimage,advlink,emotions,inlinepopups,{$xmedia}searchreplace,paste,directionality,fullscreen,moodlenolink,{$xdragmath}nonbreaking,contextmenu,insertdatetime,save,iespell,preview,print,noneditable,visualchars,xhtmlxtras,template,pagebreak",
++ 'plugins' => "safari,table,style,layer,advhr,advimage,advlink,emotions,inlinepopups,{$xmedia}searchreplace,paste,directionality,fullscreen,moodlenolink,{$xdragmath}nonbreaking,contextmenu,{$paintwebplugin}insertdatetime,save,iespell,preview,print,noneditable,visualchars,xhtmlxtras,template,pagebreak",
+ 'theme_advanced_font_sizes' => "1,2,3,4,5,6,7",
+ 'theme_advanced_layout_manager' => "SimpleLayout",
+ 'theme_advanced_toolbar_align' => "left",
+@@ -119,7 +153,7 @@ class tinymce_texteditor extends texteditor {
+ 'theme_advanced_buttons1_add' => "|,undo,redo,|,search,replace,|,fullscreen",
+ 'theme_advanced_buttons2' => "bold,italic,underline,strikethrough,sub,sup,|,justifyleft,justifycenter,justifyright,justifyfull,|,cite,abbr,acronym",
+ 'theme_advanced_buttons2_add' => "|,selectall,cleanup,removeformat,pastetext,pasteword,|,forecolor,backcolor,|,ltr,rtl",
+- 'theme_advanced_buttons3' => "bullist,numlist,outdent,indent,|,link,unlink,moodlenolink,anchor,|,emotions,image,{$xmedia}{$xdragmath}advhr,nonbreaking,charmap",
++ 'theme_advanced_buttons3' => "bullist,numlist,outdent,indent,|,link,unlink,moodlenolink,anchor,|,emotions,image,{$paintwebbutton}{$xmedia}{$xdragmath}advhr,nonbreaking,charmap",
+ 'theme_advanced_buttons3_add' => "|,table,insertlayer,styleprops,visualchars,|,code,preview",
+ 'theme_advanced_fonts' => "Trebuchet=Trebuchet MS,Verdana,Arial,Helvetica,sans-serif;Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;Wingdings=wingdings",
+ 'theme_advanced_resize_horizontal' => true,
+@@ -128,6 +162,10 @@ class tinymce_texteditor extends texteditor {
+ 'theme_advanced_statusbar_location' => "bottom",
+ );
+
++ if (!empty($paintwebconfig)) {
++ $params['paintweb_config'] = $paintwebconfig;
++ }
++
+ if (empty($options['legacy'])) {
+ if (isset($options['maxfiles']) and $options['maxfiles'] != 0) {
+ $params['file_browser_callback'] = "mce_moodlefilemanager";
+diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css
+index f522f24..46fe356 100644
+--- a/theme/standard/styles_layout.css
++++ b/theme/standard/styles_layout.css
+@@ -711,9 +711,6 @@ fieldset.fdate_selector label {
+ text-align:right;
+ }
+
+-.mform input, .mform select {
+- width: auto;
+-}
+ .mform .ftextarea #id_alltext {
+ width: 100%;
+ }
View
@@ -0,0 +1,26 @@
+Copyright (C) 2009 Mihai Şucan
+
+$URL: http://code.google.com/p/paintweb $
+$Date: 2009-08-14 13:03:31 +0300 $
+
+This folder holds scripts used for packaging PaintWeb.
+
+css_images.php modifies CSS files to include the images they reference. Images
+are inlined using data URLs.
+
+jsdoc invokes the jsdoc-toolkit script. This is used by the Makefile to generate
+the API reference.
+
+json_encode.php simply JSON-encodes any input.
+
+xhtml_minify.php does a bit of "minification" for the interface layout XHTML
+file.
+
+yuicompressor invokes the yuicompressor with correct settings for PaintWeb
+packaging.
+
+
+--
+vim:set spell spl=en fenc=utf-8 ff=unix:
+
+
@@ -1,5 +1,5 @@
<div xmlns="http://www.w3.org/1999/xhtml">
- <!-- $Date: 2009-08-13 19:34:24 +0300 $ -->
+ <!-- $Date: 2009-08-14 12:06:05 +0300 $ -->
<h1 class="paintweb_appTitle">PaintWeb</h1>
<!-- All elements with data-pwTabPanel become interactive tabbed panels which
@@ -401,9 +401,6 @@
Public License, version 3">GPLv3</a></li>
</ul>
- <p>The project is currently undergoing heavy development for the purpose of
- integrating it into <a href="http://www.moodle.org">Moodle</a>.</p>
-
<p>For user and developer documentation please check out the <a
href="http://code.google.com/p/paintweb">project site</a>.</p>
</div>

0 comments on commit 9106c12

Please sign in to comment.