Skip to content
Browse files

Work on Moodle 1.9 integration.

Made improvements to the Moodle extension for PaintWeb and fixed the
imagesave19.php script.

--HG--
extra : convert_revision : svn%3Afc1ba2b4-ac28-11dd-a772-7fcde58d38e6/trunk%40146
  • Loading branch information...
1 parent aa680af commit 6129a2149811d5d013bd3b025da002581df2217b mihai.sucan committed Oct 29, 2009
Showing with 31 additions and 22 deletions.
  1. +6 −0 CHANGES
  2. +2 −2 ext/moodle/imagesave19.php
  3. +23 −20 src/extensions/moodle.js
View
6 CHANGES
@@ -1,3 +1,9 @@
+2009-10-29:
+===========
+
+- Work on Moodle 1.9 integration. Made improvements to the Moodle extension for
+PaintWeb and fixed the imagesave19.php script.
+
2009-10-10:
===========
View
4 ext/moodle/imagesave19.php
@@ -18,7 +18,7 @@
* along with PaintWeb. If not, see <http://www.gnu.org/licenses/>.
*
* $URL: http://code.google.com/p/paintweb $
- * $Date: 2009-08-11 14:29:15 +0300 $
+ * $Date: 2009-10-29 14:39:45 +0200 $
*/
// This script performs asynchronous image save in PaintWeb. This is used by the
@@ -70,7 +70,7 @@ function paintweb_send_result($url, $urlnew, $successful, $errormessage=null) {
}
// The PaintWeb image viewer file serve script.
-$pwproxy = dirname(__FILE__) . '/imageview.php';
+$pwproxy = dirname(__FILE__) . '/imageview19.php';
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
die('illegal request');
View
43 src/extensions/moodle.js
@@ -17,7 +17,7 @@
* along with PaintWeb. If not, see <http://www.gnu.org/licenses/>.
*
* $URL: http://code.google.com/p/paintweb $
- * $Date: 2009-08-23 17:36:33 +0300 $
+ * $Date: 2009-10-29 19:05:49 +0200 $
*/
/**
@@ -91,8 +91,8 @@ pwlib.extensions.moodle = function (app) {
}
}
- if (moodleInfo.release >= 2 && typeof window.qf_errorHandler === 'function'
- && config.tinymce && !config.tinymce.onSubmitUnsaved) {
+ if (typeof window.qf_errorHandler === 'function' && config.tinymce &&
+ !config.tinymce.onSubmitUnsaved) {
config.tinymce.onSubmitUnsaved = this.onSubmitUnsaved;
}
@@ -259,10 +259,12 @@ pwlib.extensions.moodle = function (app) {
*/
this.guiShow = function () {
var pNode = config.guiPlaceholder.parentNode,
- elem = pNode.getElementsByClassName(moodleInfo.textareaButtons)[0];
+ textareaButtons
+ = pNode.getElementsByClassName(moodleInfo.textareaButtons)[0];
- if (elem) {
- elem.style.display = 'none';
+ // These show in Moodle 1.9.
+ if (textareaButtons) {
+ textareaButtons.style.display = 'none';
}
qfErrorShown = false;
@@ -312,14 +314,12 @@ pwlib.extensions.moodle = function (app) {
var guiPlaceholder = config.guiPlaceholder,
prevSibling = guiPlaceholder.previousSibling;
pNode = guiPlaceholder.parentNode,
- elem = pNode.getElementsByClassName(moodleInfo.textareaButtons)[0];
+ textareaButtons
+ = pNode.getElementsByClassName(moodleInfo.textareaButtons)[0];
- if (elem) {
- elem.style.display = '';
- }
-
- if (moodleInfo.release < 2) {
- return;
+ // These show in Moodle 1.9.
+ if (textareaButtons) {
+ textareaButtons.style.display = '';
}
var tmce = config.tinymceEditor,
@@ -343,15 +343,18 @@ pwlib.extensions.moodle = function (app) {
}
}
- var fieldname = textarea.name.replace(/\[text\]$/, '');
- if (!fieldname) {
- return;
- }
+ // The format input element only shows in Moodle 2.0.
+ if (moodleInfo.release >= 2) {
+ var fieldname = textarea.name.replace(/\[text\]$/, '');
+ if (!fieldname) {
+ return;
+ }
- var format = frm.elements.namedItem(fieldname + '[format]');
+ var format = frm.elements.namedItem(fieldname + '[format]');
- if (format) {
- format.style.display = '';
+ if (format) {
+ format.style.display = '';
+ }
}
};
};

0 comments on commit 6129a21

Please sign in to comment.
Something went wrong with that request. Please try again.