With Mathieu, I explored the patchseries a bit, and figured out a few interdependencies and tricky bits.
Today back and the office I completed the backport. The main goals are
- series of clean, minimal patches
- TinyMCE working well
- consistent with HEAD (as much as possible)
Many thanks to Mauno and Mathieu for all their work on TinyMCE for 2.0.
The code is on a branch off MOODLE_19_STABLE (from the catalyst repo), right here:
http://dev.laptop.org/git?p=users/martin/moodle.git;a=shortlog;h=mdl19-tinymce
To download, follow the 'tree' link at the top, which will reveal a 'snapshot' link.
To use, set $CFG->defaulthtmleditor='tinymce';
If, like me, you are an avid git user, you can merge from catalyst's MOODLE_19_STABLE import to keep grabbing those good bugfixen from the _STABLE branch, and also merge / pull from that mdl19-tinymce branch for any bugfixes to tinymce. I'll try to defer merging from _STABLE into the -tinymce branch to keep things simple.
This needs your help however, in the form of
- testing
- bugfixes (post your patch right here on this thread or email me)
- polish and enhancements
Note - this is not supported formally. Except when it affects OLPC's XOs... want me to fix a bug that is hurting you? grab an XO test image or a Sugar LiveCD and show me the bug is there too
to tell the truth, I'm not quite sure what to do. When I follow your instructions (klick on link -> klick on tree -> klick on snapshot), I have to download the file moodle.git-mdl19-tinymce.tar.gz. During extraction I am asked twice to overwrite the file editor_plugin_src.js because it already exists. I'm not sure whether that makes sense.
The file/folder structure upon extraction looks like this:
editor_plugin_src.js (only one file, of course, even though the archive contains three files of different sizes)
smiley-embarassed.gif
...
users -> martin -> moodle.git -> admin, auth, ...
- What do I have to do in order to install the TinyMCE backport into my existing Moodle 1.9.2+?
- Did you port TinyMCE2 or TinyMCE3?
Ralf Seliger
I'd say unpack it in a different directory, treat it as a separate install - if you are confident with it, you may point it to the same database and moodledata directory as your 'other' moodle, which should be in sync to the latest moodle.
This is the same tinymce on HEAD/2.0: 3.2.0.1
The reason is that your archive contains three different files of that name with no path information.
Is this the way it is supposed to be?
Edit:
The three files seem to be identical after extraction, but Winzip shows three different file sizes.
tar --strip-components 2 -xvzf /path/to/moodle.git-mdl19-tinymce.tar.gz
But I could not see any issue with editor_plugin_src.js. There are 37 files with that name, but they are all in different directories. I played around with the tar utility to see if it reported any errors, but it handled the file ok.
Perhaps WinZIP is somehow buggy in how it's handling this file? The directory structure is fairly deep -- could that be the problem?
I just used this command line to extract the source and got no warnings about overwriting js files (Ubuntu v7.x server)
However, I must confess to confusion about how to update this using git. Updating a CVS repository is fairly simple; I just use cvs update -dP. But this has me stumped:
"you can merge from catalyst's MOODLE_19_STABLE import to keep grabbing those good bugfixen from the _STABLE branch, and also merge / pull from that mdl19-tinymce branch for any bugfixes to tinymce."
Having expanded the git repository what would be the command line to use to update it (assuming that i've installed git onto Ubuntu)?
TaMark
The tarball is not a git repository. If you want the git repository you do git clone...
A quick workflow...
# clone the repo - will take a few minutes...
git clone git://dev.laptop.org/users/martin/moodle.git
# the "default" branch of this repo is for the
# moodle version we run in the OLPC School Server
# - not what you want - so create a local
# branch to track the mdl19-tinymce branch, and
# switch to it
git checkout -b mdl19-tinymce origin/mdl19-tinymce
# done! so configure and use...
# ... some time later...
# Pull updates from the mdl19-tinymce branch
git pull
Now, I will be regularly merging fixes from MOODLE_19_STABLE so all you need to do is that "git pull" regularly. But perhaps I fall behind, or get rolled over by a bus. If that happens you can merge in updates from the MOODLE_19_STABLE branch without waiting for me...
# Setup a new 'remote' to track the
# MOODLE_19_BRANCH as imported by catalyst
# (you only need to do this step once)
git remote add cat-moodle git://git.catalyst.net.nz/moodle-r2.git
# fetch latest code from the catalyst moodle repo
# (the first time this will take a minute)
git fetch cat-moodle
# before attempting the merge, check that
# your status is "clean" so it's safe to
# later "reset" if the merge goes wrong...
git status
... git will tell you about changed files
# and attempt the merge
git merge cat-moodle/MOODLE_19_STABLE
... some noise from git, hopefully it all
merges ok and no further steps are needed...
# if the merge has conflicts...
# a) learn a bit more about git and how to
# deal with conflict resolution...
# b) cancel the merge like this:
git reset --hard
- On Ubuntu or other Debian systems use sudo apt-get install git-core and sudo apt-get install cogito rather than sudo apt-get install git. The latter installs gitfm which is quite the wrong package!
- Having installed git successfully I follow your instructions above and git clone git://dev.laptop.org/users/martin/moodle.git which takes ages and creates a directory called 'moodle'.
- I cd into moodle and then git checkout -b mdl19-tinymce origin/mdl19-tinymce but I get an error: git checkout: branch mdl19-tinymce already exists.
the Moodle directory looks to be exactly the same as in the tar.gzipped version
git diff catalyst/MOODLE_19_STABLE...olpc/mdl19-tinymce
(note the 3 dots!)
I've attached the patch. It's a patch that contains binary files (a few gifs) so "normal" patch will get confused with it. Install git and use 'git-apply' just like you would use patch. It can behave like a smart version of 'patch' when used in directories you are not tracking with git itself.
If you don't care about the gifs, use patch and ignore the complaint about the gifs!
Edit: too large to attach, even gzipped.Uploaded it to http://dev.laptop.org/~martin/ - grab it from there!
Is there a way to get this adaptation without using git?
I'm running cvs but have not attempted the git thing yet.
Perhaps a full revised version of moodle 1.9.2 or only the parts required, with instructions.
thanks
L
I did a bit of reading on git lately but did not find a nice easy-to-follow tutorial on how to install and use for OS X.
thanks
larry
Note that this is the General Developer Forum.
Above you stated:
" This needs your help however, in the form of
- testing
- bugfixes (post your patch right here on this thread or email me)
- polish and enhancements
and in your last reply, I think you implied that I should not post here.
I'm trying to test it out but not sure where I should reply ... please enlighten me.
2. I did
from the snapshot
- installed it in a parallel directory to a working directory and modded the paths to the folder
- set $CFG->defaulthtmleditor='tinymce'; in config.php on m19g (my new folder)
Where did I screw up?
So it's not quite working for you... perhaps try a few things:
- Does this earlier version work? http://dev.laptop.org/git?p=users/martin/moodle.git;a=snapshot;h=6d823cc8d76ab7a35995d962d7ae1afae6b19ca8
If it still doesn't work...
- turn on debugging, make sure it's sent to a log (not to the browser, as that will definitely break stuff!). Do the logs say anything interesting / out of the ordinary?
- What does firebug tell you?
You solved the issue for me.
I had Developer level debugging turned on and set to display in the browser ... and that's what broke the tinymce editor. I deselected the display in browser option and it now works in both builds cited above.
Now, to teach this old dog new tricks with git! ... lol
Thanks for your time,
larry
git diff cat-moodle/MOODLE_19_STABLE...origin/mdl19-tinymce
Cheers,
Pablo
It looks like the port is no longer available. Is there somewhere I can dowload it?
Scott
Thanks
-eric
$courseid = optional_param('course');
Near the top of lib/editor/tinymce.js.php
Not saying that is the best solution - but it worked...
-Eric
I found the problem - in lib/editor/tinymce.js.php, around line 185, there are two lines:
plugin_insertdate_dateFormat : "$strdate",
plugin_insertdate_timeFormat : "$strtime",
but $strdate and $strtime are undef, and I couldn't figure out if you can get that from Moodle based on user/site settings.
To fix it, just remove/comment out those two lines, and it will use the defaults.
Hopefully this is the last one for now (we are testing this patch for production rollout).
The preview button (next to html view on the third row of buttons) didnt work.
To fix -
In lib/editor/tinymce.js.php, in the block tinyMCE.init around line 172, add
content_css : "/$root/lib/editor/tinymce/moodlecontent.css",
Hope Im not flooding you all too much....
This information would be really great. If I could switch on the Tinymce editor!
I did git clone git://dev.laptop.org/users/martin/moodle.git to get the source but when I installed it together with a working database it updated the database but did not change the editor. The code is there in lib/editor/tinymce, I just can't figure out how to switch it on :-> Any ideas?
Ta
Mark
$CFG->defaulthtmleditor = "tinymce";
Cheers
M
great sleuthing about the fix. I'm finishing off the XS-0.5 release (which is still without these tinymce patches) and will get into integrating your suggestions asap. Thanks!
The spellchecker doesnt work. This is a known bug in the current moodle version of TinyMCE (in Moodle 2). To fix it, you have to download PHP spellchecker from http://tinymce.moxiecode.com/download.php and replace lib/editor/tinymce/jscripts/tiny_mce/plugins/spellcheck with that.
I am getting my knickers in a twist with changing the button bar contents in lib/editor/tinymce.js.php as detailed here.
Basically, although I specified two rows of buttons, a third row appears with some random buttons which I did not specify in the above file (see graphic in page linked above). Any ideas would be gratefully received. This is driving me around the proverbial twist.
Mark
Default settings are defined in advanced theme (most likely ...tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js) to be something like
theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap",
I have not used this clean port integration but in all cases you can remove the 3rd button row with following tags in init code
theme_advanced_buttons3 : "",
Cheers
Mark
and I'm dead chuffed. Thanks for your help Mauno.
My next task is to try to get the Firefox built-in spelling checker to be the spell checker it uses. I have set
gecko_spellcheck : true,
but right-clicking brings up a TinyMCE menu rather than the browser menu. How can I suppress this behaviour in favour of the Firefox right-click menu? I looked in the TinyMCE wiki but didn't find much joy there.
Cheers
Mark
Well this is a little tricky one - again I had not used Firefox built-in spelling checker but had to check it when you asked...
It's plugin contextmenu that you see when you right click in TinyMCE. If you disable contextmenu (take contextmenu away from plugins row) you get normal right click options and can use Firefox built-in spelling checker (+ install languages for spell checking to Firefox with right click).
If you want to keep contextmenu Google spell checking service (default spellchecker in tinyMCE) should work nicely http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker - you just need to make sure that full spellchecker plugin for TinyMCE is downloaded from http://tinymce.moxiecode.com/download.php (PHP Spellchecker) and configured to use Google spell checking service.
So, what's your opinion? Is it better to have spellchecking executed by TinyMCE or by the user's browser?
Pro TinyMCE:
- works the same way independently of browser
- can only use languages that are provided by the Moodle server.
- users can easily change spellcheck language to whatever they want. Eg I would use British English.
- users can save words in the local dictionary
- would need to set up spell check on every machine I use
- saving words in the dictionary requires some faffing about
Mark
Danish
Dutch
English
Finnish
French
German
Italian
Polish
Portuguese
Russian
Spanish
Swedish
I might check either english or finnish ... although I usually just write without spell checker. And context menu can be useful - in my test integrations I had a different custom editor theme and I replaced context menu with custom plugin "standard menu" (with some extra code) and used Google spell checking.
If you need some other languages Firefox really has more alternative dictionaries - some kind of external spell checking page (form or demo editor) might also be possible...
Firefox's built-in spell check can be enabled by changing the following in /lib/editor/tinymce/jscripts/tiny_mce/tiny_mce.js:
Change:
if(!v.gecko_spellcheck){q.getBody().spellcheck=0}
To:
if(!v.gecko_spellcheck){q.getBody().spellcheck=1}
You'll have to do a text search for the first line of code since tiny_mce.js is minified.
I hope this helps someone - it took me a long time to figure out.
If anyone knows of a reason why this would be bad, please post!
Also, is there a way to integrate an if-then statement on the course and/or site level, so that if a teacher or admin can have a choice on which one to use? I added the Drag Math plugin to the HTML editor and didn't want to neglect the users from using it.
In the config.php located in the moodle root.
>Also, is there a way to integrate an if-then statement on the course and/or site level, so that if a teacher or admin can have a choice on which one to use? I added the Drag Math plugin to the HTML editor and didn't want to neglect the users from using it.
If there is it would likely be a site wide setting rather than course wide setting.
Is there no way to have TinyMCE in a 1.9 install besides this patching process? I see that TinyMCE is in the library... why can't I just turn it on?
The integration module is no longer supported (and a link points here).
This guy had a great step-by-step which doesn't work (four javascript errors and no editor).
and he points to this other guy who in turn points to here.
This is very frustrating. Even moreso just to accommodate Safari users, but that's another story.
I just found this post dated a month ago from Mauno Korpelainen:
http://moodle.org/mod/forum/discuss.php?d=116904#p514193
"All version of moodle before 2.0 have an old folder lib/editor/tinymce - Janne Mikkonen added TinyMCE 2 several years ago and some sites may still use integration through weblib.php (or Janne's special cases)
"Also Martín Langhoff made a clean port integration for moodle 1.9 some months ago http://moodle.org/mod/forum/discuss.php?d=107550 , I made some theme based test intgrations about year ago and there may be some other versions and many people use Glen's version... All recent integration are using TinyMCE 3."
So that's a concise history. If I want to use the TinyMCE in the library, how do I do it? If there's a link on the plugin page, I don't see it.
Basically, you install git and follow the instructions that Martin gives above. That's what I did and it works. Moreover, Martin does keep his base repository up to date so you're never out of touch. Unless you want to duplicate what he did to make the integration work this would be the best way. For info on what I did you could take a look at http://www.earlham.edu/markp/miss/#git
Cheers
Mark
Are people merging from _STABLE into my branch successfully? If so, I would love to hear from them, and please do share any fixups.
Is anyone needing this hard enough to be prepared to do (if you're handy with git and moodle internals) or fund (if you have a budget) merge, test and fixup work?
If you code or fund, your contribution it will have a significant positive impact on OLPC! (as well as on your moodle!)
>Are people merging from _STABLE into my branch successfully? If so, I would love to hear from them, and please do share any fixups.
Not now. I have done this successfully a couple of times , but today I get:
$ git merge cat-moodle/~MOODLE_19_STABLE fatal: 'cat-moodle/~MOODLE_19_STABLE' does not point to a commitCheers
Mark
The hackers at Hack-Doc Fest IV implemented TinyMCE and CKEditor into latest weekly 1.95+. Getting ready to publish the patch... only waiting on changing the help files since the hack totally disables htmlarea (which should have happened long ago.
Bob Puffer
Here's a link to photos from my trip to Turkey : http://picasaweb.google.com/markhpearson -- 3 1/2 weeks away from Moodle with fabulous Turkish food
Mark
I'll second that! Have also got nowhere with the git way of doing things and can't wait to test out the TinyMCE 'patch'
As we probably have quite a long wait for the release of stable Moodle 2.0, is there any chance that this could be incorporated into core Moodle code e.g. for 1.9.6 or 1.9.7? I appreciate that major new features are not usually incoporated in minor release versions, but we already have the precedent of the new Gradebook in 1.9.5
Thanks again Bob and fellow hackers!
Although Glen is not upgrading his files anymore it is still possible to use theme based integration as well with the latest code of tinymce and latest code of moodle 1.7-1.9 - if you want to test one version take a look at http://moodle.org/mod/forum/discuss.php?d=121738
Basicly you just need to disable HTMLArea and render TinyMCE (or some other editor) for textareas with a certain class (form-textarea) but moodle has some special features that make integration of editors a little more complicated.
Main problem is to edit init code and to find such settings and plugins that you need on your site...
after setup the Moodle Version 1.9 like Martin described above, everything worked as expected and TinyMCE runs fine.
But when I change the Moodle language to german, everytime I change sites or courses the language switches back to english but in the dropdown menu german is active.
Any ideas or hints?
Best
Andreas
This forum post has been removed
Well... I have some opinions:
- Hacks are always hacks and I don't believe that the patch that Bob mentioned could solve the original problem with "moodle modifications" - multilang, translations, administration of settings etc. With theme based integration it has been possible to use not only tinymce or latest CKEditor but also Xinha, FCKEDitor, YUI RTE and in practise any editor because most javascript based editors are ment to be used the same way - to render some init (configuration code) and then replace textareas/divs or some other elements with editors. The main problem has been upgrading and modified editor settings hardcoded in core code of moodle
- theme based integrations work as workarounds because standard code of editor (HTMLArea) of moodle has not been by default pluggable and changable. In moodle 2.0 this will change - Petr Skoda has rewritten editorlib.php and when version 2.0 is stable it will be possible to change both configurations and to create custom editor integrations easier than before.
- many sites allow students to upload files with editor and all students can upload attachments in core moodle as well. I don't think it is a problem if students can't freely upload all types of files and run any scripts they like. Files can include/inject viruses or hidden scripts even if your students don't know it and in some cases students know more about scripts/cracking than teachers but I suppose in 99.9% of cases allowing students to upload files is safe. You have been able to change role settings or override permissions (capabilities) in all versions of moodle since 1.7
- the clean port that Martin wrote was mostly based on code written by Mathieu and current moodle 2.0 is already using a very different code so I suppose Martin won't write a new version for awhile - maybe never. Many people would be happy to see similar changes in moodle 1.9 when 2.0 is stable but I don't believe it will never happen. Moodle 1.9 will stay the last single-default-editor-moodle forever and moodle 2.0 will be using totally different system.
Any info on installing on windows?
I would like to target different instances of tinyMCE to display in different widths via CSS.
Would anybody know how I can go about doing that?
Thanks so much
Jacques
I am working towards the integration of my GSOC project, PaintWeb, I will be integrating the project in Moodle 1.9 and 2.0.
One of the requirements for my project is TinyMCE 3 which is not available by default in Moodle 1.9.
This thread caught my eye. Thanks Martin for your important work.
I took the liberty to extend/update this work so I can reuse it for PaintWeb. TinyMCE and Moodle are quite old in Martin's repos.
I have forward-ported Martin's patches to the latest the official MOODLE_19_STABLE branch from the Moodle Git repository.
Additionally, I have updated the patches to the latest version of TinyMCE (3.2.5).
Last, but not least, I made the TinyMCE editor work in Opera, Safari and Chrome as well. Moodle 1.9 had a hard-coded whitelist of browsers which support the HTML editor: only MSIE and Gecko were listed.
If anyone is interested, I have uploaded the patches on my server. Download the Moodle 1.9 + TinyMCE 3 patches.
Note that the patches are generated by the git diff --binary command. I don't know if you can use the generic patch program to apply the patch file. I have only tested the git apply --binary command.
I recommend you do:
# clone the Moodle Git repository
git clone git://git.moodle.org/moodle.git ~/src/moodle
cd ~/src/moodle
# checkout the Moodle 1.9 stable branch
git checkout -b MOODLE_19_STABLE origin/MOODLE_19_STABLE
# create a branch for the TinyMCE 3 patch
git branch mdl19-tinymce
# switch to the new branch
git checkout mdl19-tinymce
# apply the downloaded patch
git apply --binary moodle19-tinymce3.patch
When the Moodle 1.9 stable branch is updated, you should be able to simply perform a git rebase, after you update the repository with git pull. I didn't try yet any rebase myself.
As explained by Martin, make sure you update your config.php file to hold:
$CFG->defaulthtmleditor='tinymce';
I would suggest that this kind of code goes into some official Moodle repository, where others can contribute/update the patches when needed. Anyone interested to help with this?
Good luck to everyone!
I used your steps above after confirming the normal patch wouldn't do the job. The editor installed quite well but I am unable to browse for files, either on the Moodle course site or to private, local drives. Any ideas?
Thanks for trying the work I published.
I tried that myself as well, and I can confirm I can't browse for files either. I don't know what's wrong yet.
I can't browse for files in the Git branch Martin has, the one with the older Moodle 1.9, the older TinyMCE. Perhaps this is something that still needed to be worked on / fixed. I simply updated his patches to the latest Moodle 1.9 stable branch.
Given the fact I am working on PaintWeb, I cannot focus on much of the fixes/improvements needed for the TinyMCE 3 integration into Moodle itself. I am currently working on PaintWeb, and fixing the TinyMCE-related things as I march ahead, as needed for PaintWeb. I made this work public so anyone can contribute. ;)
If anyone has some patches/improvements to contribute I would be happy to merge them.
Thanks again!
Also, am I correct in my assumption that the functionality of these editors is driven ultimately by javascript but within moodle is wrapped in a php class that handles some of this? If so, which particular file is it (editorlib.php?) and how can I add custom javascript to do things like turn on/off rows of buttons in the editor or even add a custom button.
The problem is pretty much the same as reported by Bob. Currently I am too focused on the GSOC project. Any patches/improvements are welcome!
It's more complicated. The article editing is ultimately driven by JavaScript on the client-side - in your Web browser. Moodle is the PHP-based platform which glues all the client-side code, and generates most of it dynamically.
Moodle cannot offer the same capabilities from PHP - technically it's not something that can be done (unless someone has a crazy idea). For such editing features, JavaScript is required.
Regarding finding the files responsibile for all of this, I can tell Moodle is organized in the following way:
1. you have the client-side JavaScript code. That's HTMLArea and TinyMCE - the two WYSIWYG editors. You can find them in /lib/editor/htmlarea and /lib/editor/tinymce.
2. you have a PHP library which abstracts away the two editors, in a common API.
3. this common API allows other Moodle developers to easily integrate/use any of the two editors, at any time, without knowing the nitty-gritty details of each implementation.
To achieve all that, there are several PHP files you should look into:
1. weblib.php has the print_textarea() function which is important.
2. moodlelib.php has the can_use_html_editor() and the loadeditor() functions.
3. editorlib.php obviously.
4. then you have several PHP files in the lib/editor/ sub folders. You can look into the glue-code used for each editor.
The story for adding custom functionality to TinyMCE revolves around the TinyMCE 3 API. You should check out:
http://wiki.moxiecode.com/index.php/TinyMCE:API
They provide sufficient API for doing almost anything you want. This is not really much related to Moodle - you just need to add your JavaScript to the list of files needed to be loaded (see tinymce.js.php). Alternatively, you can code your new functionality as TinyMCE plugin - you just add your plugin folder and files, then add the plugin name to the list of plugins needed to be loaded in tinymce.js.php - I do this for PaintWeb.
Good luck!
$courseid = optional_param('course');
Near the top of lib/editor/tinymce.js.php
I'll try this change as well. If it works fine, I will include it in my patches.
This will be part of the next update I'll do for the TinyMCE patches. (some time this week)
http://www.robodesign.ro/moodle/patches/moodle19-tinymce3.tar.bz2
The "insert image" dialog now allows users to nicely browse for files on the Moodle server, using the file picker. Thanks, once again, to Bob and Eric!
I have also included more usage instructions.
Should I follow your directions above? If so, I can't see any step where it points to my current implementation, so how would it know where it exists?
I assume the changes must involve files outside of lib\editor\tinymce ? if not, could you simply supply a zip package with the lib\editor\tinymce directory that I/we could simply replace without having to worry about the rest of my installation and learning git that I am completely unfamiliar with?
Thanks
Craig
Thanks for your reply.
Last Friday I made public a Git repository which holds the TinyMCE 3 and PaintWeb branches I am working on.
You can take a look at some easier Git usage instructions:
http://www.robodesign.ro/mihai/blog/paintweb-and-moodle-git-repository
Basically, you can just do:
git clone git://repo.or.cz/moodle/mihaisucan.git
git checkout -b mdl19-tinymce3 origin/mdl19-tinymce3
And you're done: you have Moodle 1.9 stable + TinyMCE 3.
Currently I do not have time to make an easy to use zip package that people can unpack in their Moodle folder. This work is kind of experimental at the moment.
If you want to get the changes, here's what you can do:
1. You can go to
http://repo.or.cz/w/moodle/mihaisucan.git?a=shortlog;h=refs/heads/mdl19-tinymce3
3. Click the snapshot tar.gz / zip option to download the entire code base of the branch, as an archive. No need for Git - this is the equivalent of using git clone and checkout.
4. Unpack the archive. Now you have Moodle 1.9 stable + TinyMCE 3.
5. To know which files were changed you can see the differences between my branch and the official Moodle 1.9 stable one. Here's the link:
http://tinyurl.com/l9oq7e
6. Add/delete/replace all the files in your Moodle installation folder, as per the differences listed. Even if the diff looks huge, it's manageable. You need to replace the entire lib/editor/tinymce folder, then you also have to upload /lib/editor/common/dragmath. The rest of the files are:
course/editsection.html
lang/en_utf8/tinymce.php
lib/adminlib.php
lib/deprecatedlib.php
lib/editorlib.php
lib/form/htmleditor.php
lib/moodlelib.php
lib/weblib.php
message/send.php
theme/standard/styles_layout.css
That's all.
It should be noted that if your Moodle installation is not a "clean" one, then it is recommended you check the differences before overwriting any files. You can use software like "meld" on Linux and WinMerge on Windows. Make sure you compare the files you got from my branch with those of your Moodle installation.
Good luck!
Personally I would prefer to wait a little if the patches will be included in the near future rather than bother about with patching Moodle Core which will add maintenance headaches etc...
I'll try this today.
Many Thanks
Craig
Hi Mihai et al.
First, a huge thanks for your work on the TinyMCE integration and lucid instructions on how to use Git! It's a superb example of of how the GSOC can help to make things happen. On our Moodle, we are making increasing use of rich text editing for generating learning content, giving feedback and more formal online reporting (e.g. using the ULCC ILP module) so a robust, capable, well-behaving rich text editor is vital.
I can confirm that following the instructions for a local 'git build' and then copying the patched files to a Moodle 1.9.5 server (as described in section 6. above) works rather well.
Here I detail a few other 'tweaks' I had to apply to our setup in case they help others. Note that I didn't use Mihai's latest Git repositories so some or all of these may be already fixed.
1. I removed the iespell plugin and enabled the spellchecker plugin as outlined by Eric Merril in an earlier posting in this thread. We already used Aspell with our Moodle and it was simple to 'point' the spellchecker at that.
See: TinyMCE:Plugins/Spellchecker for more details.
2. To make fonts display consistently, in both edit and display modes, I changed the default TinyMCE font-size to medium (rather than 10pt or 12pt) in the first line of:
/lib/editor/tinymce/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css
Of course, the details of this will depend on which TinyMCE and Moodle Themes you are using.
3. When using Internet Explorer 6 or 7 (or IE 8 in compatibility mode) some TinyMCE toolbar mouse-overs and menu items did not display correctly. For example 'advanced.h1' rather than 'Heading 1'. Other recent browser versions (IE 8, Firefox, Opera, Safari, Chrome) had no problem.
This was fixed by adding the following to the appropiate lang file (in our case en.js) in: /lib/editor/tinymce/jscripts/tiny_mce/langs/
advanced:{
forecolor_desc:"Select text colour",
backcolor_desc:"Select background colour",
paste_desc:"Paste (Ctrl-V)",
copy_desc:"Copy (Ctrl-C)",
cut_desc:"Cut (Ctrl-X)",
undo_desc:"Undo (Ctrl-Z)",
redo_desc:"Redo (Ctrl-Y)",
removeformat_desc:"Remove formatting",
cleanup_desc:"Clean up messy code",
charmap_desc:"Insert custom character",
code_desc:"Edit HTML source",
newdocument_desc:"New document",
fontdefault:"Font family",
font_size:"Font size",
block:"Format",
paragraph:"Paragraph",
address:"Address",
pre:"Preformatted",
h1:"Heading 1",
h2:"Heading 2",
h3:"Heading 3",
h4:"Heading 4",
h5:"Heading 5",
h6:"Heading 6",
bold_desc:"Bold (Ctrl-B)",
italic_desc:"Italic (Ctrl-I)",
underline_desc:"Underline Ctrl-U)",
striketrough_desc:"Strikethrough",
sup_desc:"Superscript",
sub_desc:"Subscript",
justfyleft_desc:"Align left",
justifycenter_desc:"Align Centre",
justifyright_desc:"Align right",
justifyfull_desc:"Align full",
bullist_desc:"Unordered list",
numlist_desc:"Ordered list",
outdent_desc:"Outdent",
indent_desc:"Indent",
blockquote_desc:"Blockquote",
unlink_desc:"Unlink",
anchor_desc:"Insert/Edit anchor",
hr_desc:"Insert horizontal rule"
},
There may be more elegant ways of doing this, but it worked for us.
Thanks again!
Thanks for appreciating my work and for your detailed report of the tweaks implemented. Contributing back to the community is very much appreciated.
I will look into implementing these changes into my TinyMCE Git branch. I did not look into these matters because they do not affect my work on PaintWeb integration.
Regarding problem 3: you are describing something which sounds like the language file of the advanced theme does not load. The strings should be in jscript/tiny_mce/themes/advanced/langs.
Good luck and all the best,
Mihai
Hello everybody!
I try to apply patch to Moodle 1.9.6 and I has done it.
But I had a problem with localization of TinyMCE. There are some remarks:
- Too complex to create localization from XML file which used for language in TinyMCE. It havn't names of modules and plugins. 'create_langfiles.php' useless because localization don't distribute in .js format (maybe I'm wrong?)
- In some cases, language strings takes from .js files even so instead of /langs/minymce.php. For example, for popup windows.
- Variables ($cols, $rows etc.) and date format (like %Y-%m-%d) brings about disappearing of editor if debugging level allow to show warnings and errors.
My offers
I offer next changes which correct this problems:
- Attached XSL file allow to create Moodle's language file from any Tiny's XML language in one click.
- Some changes in php scripts guarantee that all language strings always will get from Moodle's langs.
Install changes
- Apply patch from http://www.robodesign.ro/moodle/patches/moodle19-tinymce3.tar.bz2
- Replace files in /lib/editor from attachment.
- Replace english language file in /lang/en_utf8 from attachment because it has changed format.
Creating new language
- Download XML file from http://tinymce.moxiecode.com/download_i18n.php
- Place file tiny_to_moodle.xsl in same directory as xml.
- Add string <?xml-stylesheet type='text/xsl' href='tiny_to_moodle.xsl'?> on second line of file, right before <language-pack>
- Open your xml file in browser (File->Open) and you will see localization in Moodle format.
- Select all in browser's page, copy, paste in text file and save this as tinymce.php (Be attentive! Save in UTF-8 format without BOM!)
- Place tinymce.php in your lang directory.
I'll be much obliged to Mihai Sucan if he test it and include it in his patch.
Thanks for your work.
Language files are distributed in both formats. In the official page you liked (the one at tinymce.moxiecode.com) you can download languages as .js or as XML.
The create_langfiles.php script is taken from the work did by Martin Langhoff. I only made some small fixes. If I am not mistaken the script works with TinyMCE plugins. My PaintWeb plugin has no issues.
However, it is agreed that parsing the JS files is pretty hackish. This is why in Moodle 2.0 there's a script which imports the strings from the distributed XML files. So, you are correct in your approach.
I recommend you to take a look the Git branch I made public, which holds the latest Moodle 1.9.x with TinyMCE 3 integrated.
http://repo.or.cz/w/moodle/mihaisucan.git/shortlog/refs/heads/mdl19-tinymce3
The archive you linked is rather old. There have been a number of fixes since then. ;)
One problem I saw is that the tiny_mce.js file you provide is uncompressed, it's not minified. This makes it slower to load - the file is quite bigger. TinyMCE is usually distributed in both forms: compressed (tiny_mce.js) and uncompressed (tiny_mce_src.js).
Again, I want to note that my work for TinyMCE 3 integration is limited around my work on PaintWeb integration. I do not have very much time to maintain the TinyMCE 3 branch, due to university studies.
You should make a fork of my Git branch and apply your patches. Link it here, so anyone interested can get it.
Thanks again for your contribution!
I agree your observation about uncompressed .js. Could you prompt me what I can use for compressing, because I didn't do it earlier.
- Google Closure Compiler:
http://code.google.com/closure/compiler/
- Yahoo UI Compressor:
http://developer.yahoo.com/yui/compressor/
Good luck!
I created the patch which include work of Mihai and my changes.
Also this contain XSL file for creating localization for Moodle and Russian language for example.
Be attentive! You should use GIT for applying this patch!
You can get it here: http://train.nspu.ru/course/view.php?id=32
Have you noticed any issues with pasted text and character sets going strange? I've got an issue with pasting text (from any source, not just Word) where text with ASCII (proven with a HEX editor) is pasted into TinyMCE - and on Saving is saving a pile of Unicode. The problem mainly appears to be occuring for spaces in my case, however I have noticed a few other errant characters.
RDBMS is Oracle 10, if that matters; but it doesn't appear to be an issue on my local Oracle XE..
To me it sounds like a Database issue - but have you (or indeed anyone else) noticed anything similar?
Edit: I've just updated a field manually using the same source text as was pasted into TinyMCE and the issue does not present itself. It appears it could be a TinyMCE issue with saving.
If anyone should come across this issue (and for Google indexing) - the issue was that my Red Hat Linux server where Development was occuring did not have the required NLS_LANG Environment Variable set - specifically it needed to be set in the /etc/sysconfig/httpd file with the ORACLE_HOME variable. In my instance I set NLS_LANG to ENGLISH_AUSTRALIA.AL32UTF8 which suits my locale - your's may be different.
I did not have the issue locally with my Oracle XE install on Windows XP - because NLS_LANG was set via the Registry.
PLACE IN YOUR INIT PARAGRAPH:
forced_root_block : false, force_br_newlines : true, force_p_newlines : false,
Having done a bit of tinkering and head-scratching, I now have mixed-feelings about this fix replacing <p></p> tags with <br />. As this TinyMCE FAQ emphasises, this may impact the behaviour of the editor and not be consitent with XHTML. It seems a shame that just as we have a more robust, standards-compliant editor in TinyMCE we have to 'break' it
Instead, something similar to the following tweaks to /theme/standard/styles_layout.css *almost* fixes things.
p {
margin-top: 0;
margin-bottom: 1em;
padding: 0;
}
#course-view .section .spacer {
height:0.5em;
float: left;
}
This gives a one line-space after paragraphs, so there is not too much wasted space.
However, for a label, the indent/outdent arrows only work on the *first line* of the text, which is (perhaps?) slightly less irritating than nudging the label up-and-down the page. The issue is probably more to do with the use of a spacer image to do the nudging rather than TinyMCE itself.
Any CSS gurus with any other ideas how this can be fixed?
That said, I'm 'happily' using <br /> in this HTMLarea-generated posting, so does it really matter?
Have you tried adding to init code just:
forced_root_block : "",
which means that TinyMCE won't add those extra p tags at all...
(without lines force_br_newlines : true and force_p_newlines : false)
Already tried that! Indeed, as you first start typing with that configuration, no opening or closing p tags are present. But, as soon as you press return (i.e. new paragraph!), opening and closing p tags are (quite correctly!) added, which gets you back to 'square one'.
So, unless you force the replacement of all p tags with br tags too (as outlined by Bob), this does not work.
Unless I'm missing something here...
Gosh, you are right...
Does it cause trouble only for labels or have you noticed some other similar effects?
In my hands, a recent download of Moodle 2.0 dev (with built-in TinyMCE) also has the same problem with indenting labels wrapped in p tags.
Indeed, wrapping a label any with any XHTML block-level element (<p>, <div>, <pre>, <h1> etc) will have similar problems as they will all default to a new line rather than being moved sideways by a spacer image. Perhaps, in the longer term, we need to replace the spacer images used by Moodle's indent/outdent functions with mechanisms using CSS margin or padding styles.
/***
*** TinyMCE 3 tweaks
***/
p:first-child,
h1:first-child,
h2:first-child,
h3:first-child,
h4:first-child,
h5:first-child,
h6:first-child,
table:first-child,
blockquote:first-child
{
display: inline;
}
This simply makes the first set of p tags (or other block-level elements) generated by TinyMCE display as an inline element i.e. does *not* start a new line. This eliminates the initial line-space and also makes single line 'labels' responsive to the indent/outdent arrows.
Subsequent paragraphs are displayed with the usual spacing between them. As usual, you can also force a simple <br /> line feed, with no line-spacing, by [Shift][Return/Enter].
With multi-line labels, only the first line is 'nudged' by the indent/outdent arrows, though from MDL-15781 this would seem to be the default behaviour of the existing text-editor, anyway. If you really need a multi-line label to respond to such nudges, you can always wrap it in a single cell table.
Be warned that the above CSS is very general e.g. it identifies the first p tag in *any* parent element, but that's what makes it a convenient fix for wherever TinyMCE is used in Moodle. If you you find, or are concerned about, unwanted side-effects, then you can use more specific CSS.
e.g.
.label>p:first-child
{
display: inline;
}
will specifically target the first <p tag>in labels (i.e. parent elements with class="label"). If necessary, you can hunt down the relevant classes using your browser's view > source code and/or the FireFox Web developer toolbar.
Note that :first-child is a CSS 2.1 pseudoselector so this won't work for Internet Explorer 6 (though the display should still be usable). Recent browser versions, e.g. IE 7 & 8, Firefox, Safari, Opera, Chrome, should be OK.
Feel free to feed any refinements or better solutions back to this forum
I also suspect there are other problem areas that need careful scrutiny. I have noticed that the TinyMCE-generated description for an assignment is displayed inside <p><p>.....</p></p> tags (at least on our Moodle 1.9.5 + TinyMCE); presumably one set from TinyMCE and one set from Moodle.
Starting to see why the Mahara developers opted against the TinyMCE generated <p> tags and have, for the moment, dropped XHTML 1.0 compliance from their roadmap as being 'too invasive'.
Any ideas on how to take this forward ?
Unfortunately, this was not the case with much older WYSIWYG editors which were used inside Moodle 1.9. Thus, developers at that time coded Moodle expecting the lack of paragraphs.
To fix this issue now, it would require us to adjust all the CSS styling, on each Moodle page where texts from such textareas is displayed. Obviously, the issue at hand is related to how CSS margins and paddings work.
It is not a "big deal" per-se, buuut it's indeed "not nice" to have to fix the styling for each page. Nonetheless, this is the only way to correctly fix the issue.
The ugly fix is to tell TinyMCE 3 to not use paragraphs. It is ugly, because the generated content ends up being a big pile of mess, with
tags and such.
The exception is certain places like labels etc. which are usually a single line; if these are indeed a single line, you don't really want a paragraph tag there. It is of course permissible, just becomes inelegant this time!
Without changing TinyMCE settings or the way it works with tags in general, it would be possible to process data received into Moodle at the input (cleaning) stage. For example, you could detect <p>...</p> where the contents don't contain any </p> of its own (= a single paragraph/line) and strip the surrounding <p></p> in this case. This is quite easy to do (but be a bit careful with it as if you mess up, it has a wide effect). I'm not sure whether this is advantageous compared to changing the TinyMCE option.
--sam
I have just realised that labels are defined by <span class="label">. So, if my understanding is correct, as inline elements they should only contain other inline-elements and not block-level elements like <p> <h1> etc. So the TinyMCE option suppressing <p> tags is appropriate in this instance. Of course, this is entirely consistent with labels being designed for (mainly) single-line entries.
However, if more complex multi-line constructs and block-level elements are to be allowed in labels they should probably be redesignated as <div class="label">. Perhaps, their style could be set as display:inline so they still behaved like spans in other respects.
Much other TinyMCE generated content is located in <div> or <td> elements, so in this case <p> and other block-level tags are allowed.
Perhaps we should consider two instances of TinyMCE for Moodle, one (suppressing p tags) for 'simple' cases like labels, messages, emails etc and another (including p tags) for richer more complex content. One concern would be whether end-users would appreciate the subtleties of all this. The editor would behave differently in different contexts e.g. the [Return/Enter] key would generate a <br /> newline in one context and a <p> paragraph and linespace in another. So, perhaps Sam's suggestion that Moodle should do the appropriate tag processing/filtering is the best option.
In the context of my earlier postings, I am now using the following CSS as a 'quick fix' to suppress the opening linespace (e.g. paragraph top margin) caused by content being wrapped in <p></p>, or other block-level tags, by TinyMCE.
div.summary > *:first-child,
div.generalbox > *:first-child,
...any other TinyMCE contexts... > *:first-child,
td.content > *:first-child
{
margin-top: 0;
}
or, if you are feeling brave, just...
*:first-child
{
margin-top: 0;
}
*:last-child and margin-bottom: 0; could be similarly used to suppress the closing linespace though :last-child is not so well supported by browsers.
The following also seems to works for, say, <p> tags within label spans (but as noted above, spans should only contain inline elements, anyway).
span.label > *:first-child
{
display: inline;
margin-top:0;
}
I did see the TinyMCE FAQ (pretty hard to miss as hard as those guys come down on the breaking of XHTML). I still opted for the <br> tag fix since I needed something similar to what our instructors are used to. HTMLArea acts the same way regarding multi-line paragraphs and indenting. Hoping this all gets worked out for 2.0.
Hi Martin..
i'm not using git..how can i install the tinymce on moodle 1.9.5...
need your help..
regards..
any progress on your zip of just the files that need replacing? would really appreciate these
Also, Martin's link at the top appears to be broken.
I downloaded the editor-only install, and copied it over a copy of our current install. Worked great! Just a couple of questions that I am wondering about...
Are you guys using a no-link button at all? Do you know how to add one in? I found http://moodle.org/mod/forum/discuss.php?d=116904 which talks about adding such a button - but I wasn't sure where the init code is in the CLAMP integration.
The other question was to do with fonts - in the editor the font shows up as verdana, but changes after saving to arial - I'm assuming it is because there is not a font selected by default, and it is gaining the arial font from the theme styling (although I tried changing the theme font settings and it didn't seem to change anything - but that is another issue to figure out). Do you know how to make tinymce select a font by default?or what might be the issue?
Thanks!
I'll look into the default font setting.
Bob
I've loaded the Moodle no-link plugin (in editor\tinymce\jscripts\plugins), have loaded it to the toolbar along with a few other buttons - but the search replace button is stubbornly refusing to show... do you know how to find out what the error might be? (I'm curious whether the plugin is loading correctly, but not the image, or whether it simply isn't working at all...)
I was looking at http://corpocrat.com/2007/12/17/changing-default-font-in-tinymce-editor/ to work out how to change the default font, and realised it is controlled by moodlecontent.css in editor\tinymce, rather than editor\tinymce\jscripts\tiny_mce\themes\advanced\css\editorcontent.css. However - after modifying one and then the other,neither change affected the font in the editor... so I am a little confused. (This is my first time messing around with tinymce config).
Thanks so much for your help!
Lael
The other thing I have going on in our install is that the fonts appear larger in IE than they should be (1 size or two points) and the dropdowns for font and size and format are showing advanced.xxxx
Are you experiencing any of these issues?
"Line 12 Char: 1 Expected Identifier, string or number"
"Line 63 Char: 1 Expected Identifier, string or number"
edit: specifically from the two tinymce init calls in the above file.
document_base_url: "$CFG->httpswwwroot",
and
document_base_url: "$CFG->httpswwwroot",
Tiny changed this variable during the switch to 3+. After removing these lines the JS errors go away in IE and the editor seems to function fine.
I did not test on Windows nor Mac. I would expect that TinyMCE would work fine in Safari. Chromium uses Webkit, like Safari does.
I suggest testing the latest code I have in the mdl19-tinymce3 Git branch. If TinyMCE fails for some reason in that code, please copy/paste here the errors from the JavaScript console in Safari.
Having the error message might help me determine the actual problem.
John: if you modified other JS code in the Moodle page, you might have unwillingly tampered with something which breaks the TinyMCE editor. Try a "clean" install and see if that works. Also, make sure your system doesn't have any web page filters (like advert removers) which sometimes break web pages.
This is a quick addendum to WYSIWYG: YMMV. HTH! which did not explain how to convince Moodle that Safari is WYSIWYG-editor-capable. In lib/moodlelib.php find this function:
function can_use_html_editor() {
global $USER, $CFG;
if (!empty($USER->htmleditor) and !empty($CFG->htmleditor)) {
if (check_browser_version('MSIE', 5.5)) {
return 'MSIE';
} else if (check_browser_version('Gecko', 20030516)) {
return 'Gecko';
}
}
return false;
}
and add a check for WebKit > 525:
function can_use_html_editor() {
global $USER, $CFG;
if (!empty($USER->htmleditor) and !empty($CFG->htmleditor)) {
if (check_browser_version('MSIE', 5.5)) {
return 'MSIE';
} else if (check_browser_version('Gecko', 20030516)) {
return 'Gecko';
} else if (check_browser_version('Safari', 525)) {
return 'KHTML';
}
}
return false;
}
Apologies to Mihai for spelling your name wrong,,, your work is greatly appreciated.
Yes, that's the function with the problem. My mdl19-tinymce3 branch has the following function:
function can_use_html_editor() {
global $USER, $CFG;
if (!empty($USER->htmleditor) and !empty($CFG->htmleditor)) {
if (check_browser_version('MSIE', 5.5)) {
return 'MSIE';
} else if (check_browser_version('Gecko', 20030516)) {
return 'Gecko';
} else if (check_browser_version('Opera', 9.0)) {
return 'Gecko'; // Gecko-compatible
} else if (check_browser_version('Safari', 525.13)) {
return 'Gecko'; // Gecko-compatible
}
}
return false;
}
It has the check for Gecko (Firefox and friends), Opera, Safari (and friends), and MSIE.
This code works for me with Chromium, Opera, Firefox, etc.
Please paste here your Safari user agent.
Have fun and a happy new year! ;)
I have followed the posts to modified the weblib.php, moodlelib.php, editorlib.php and etc.
But it shows nothing when I turned it on.
Could somebody help?
I'm a newbie to this, but this is probably where I'll find the answers. First, I can't say how happy I am TinyMCE will be integrated in Moodle 2.0. Second, I literally can't wait, so I'll be testing out integration in 1.9.7. Thanks in advance to all on this thread for the work on this!
Now, I'm not a programmer and have only basic understanding of code, so I usually go on a try and miss basis until it's not a miss anymore ^^
Anyways, before I start on this, I wonder if I could have some enlighted advice. Here's my situation (we use Moodle for language teaching): I developed a plugin for TinyMCE which basically allows a teacher to easily mark up written assignments, adding tags for spelling mistakes, good grammar... At the moment, it's on a different website from our Moodle installation and we basically copy/paste between moodle and that website, which is a drag. From what I've read, integrating custom-made plugins is no problem, but here's the question:
- is it possible to display different configs of the editor across the site? What I'm looking for, specifically, is to have TinyMCE with the "markup" plugin on the feedback for the online text assignment module, and regular TinyMCE elsewhere.
Thanks!
Hello Jean-Luc!
First of all you need to use one of the TinyMCE 3 patches provided in this thread, so you can get it into Moodle 1.9.
Then you need to add your 'markup' plugin. Copy the markup plugin folder into the plugins folder of the TinyMCE editor provided in the newly patched Moodle. This should be in: lib/editor/tinymce/jscripts/tiny_mce/plugins.
Next, you need to configure TinyMCE to use your new plugin.
The TinyMCE configuration can be found in lib/editor/tinymce.js.php. Edit this file to add your 'markup' plugin to the list of automatically-loaded TinyMCE plugins.
The above change will affect all the instances of the TinyMCE editor, across the whole Moodle installation.
If you want to load the 'markup' plugin only for a certain case, then add a configuration variable. Say $CFG->tinymceMarkupPlugin. Only add the plugin to the list of TinyMCE plugins if the said variable is set to true. In your config.php you set the variable by default to false. Then edit the PHP of the module you want to display TinyMCE with the 'markup' plugin, and set the $CFG->tinymceMarkupPlugin variable to true.
I am not sure which PHP is the one you are interested of. It might be in mod/assignment.
If you want to see an example of how I implemented conditional loading of a plugin within TinyMCE 3 for Moodle 1.9, take a look at: tinymce.js.php.
Good luck!
Well, this is exactly the reason for several role, theme, activity and user based editor integration tests during past 3 years. Since the first integrations by Janne Mikkonen it was possible to use different editors in different activities and some people wanted to use different editor configurations only in some activities like Marc Bria et al in Storytelling. It used old tinymce version 2 although default editor was htmlarea.
Some people wanted to use different editors because these editors had some plugins that other editors did not have and we tested at least 3 different kinds of theme based integrations - see for example http://moodle.org/mod/forum/discuss.php?d=76912 and http://moodle.org/mod/forum/discuss.php?d=96160
Originally functions for editor configurations were built in lib files, in theme based tests these functions were moved from weblib.php to theme files and replaced with different functions for each editor, people in OU & Mathieu changed the whole structure of theme based integration for first versions of moodle 2.0 and Martin L made the first clean port version based on this integration.
Later clean port files were upgraded by Mihai but at the same time Petr changed again all integration files of moodle 2.0. and at the same time I had made new testing with math plugins using theme based code that did not require any changes to core files - htmlarea was just disabled in theme config.php and javascripts in theme files made the rest of the work.
At the moment there are 2 main options - 1) to hack some core code or 2) to disable default editor casewise with settings and write all editor code to themes or filters or custom activities. In my opinion both of these are bad options. Hacking core files makes upgrading moodle a pain and many people are afraid to use any extra packages.
Moodle 2.0 editor integration will allow multiple editor configurations but it has still many of the old problems unfinished/unsolved - in administration of non-default settings and possible overriding of default settings with activity, role, theme or user based settings. Petr has been busy with huge amount of changes made to moodle 2.0 - the whole theming system is literally rewritten, the use of javascripts is rewritten, almost all parts of moodle are rewritten...
So if you want to avoid extra work be patient and start testing editors again next summer when Petr has finished most of the current code of moodle 2.0 (themes and editors)
I've been reading about Moodle 2.0 and I can't wait for the first release. I wish I had time to test the beta out
Now I know I should wait for 2.0, but our tutors'd like to see this feature soon, so I'm looking into it. Also, I'm not sure we'll upgrade directly to 2.0 for next academic year for various reasons, and since I'm sure we won't do it in the middle of the year we'll probably postpone it for one year.
So in the current situation, would I be safe to assume that, if I develop a plugin with built-in TinyMCE files & config, there wouldn't be consequences for the whole site? If it proves to be incompatiible, I could just disable it?
Thanks for the reply. I've started working on it and received help from David Smith to duplicate the module (I'm still working on it, but it's more or less functional). Discussion is here
As for the integration of TinyMCE, looking into it at the moment. Our admin won't want to integrate TinyMCE for the whole website, so I'm looking into changing it just for that particular module, possibly including it in the module in a subfolder. Not perfect, I know, but right now it's all I can think of. I have my personal install on which I test things, so no risk for the uni's install
Can't wait for Moodle 2.0
Thanks for all the great work. Was a bit lazy to learn how to use git so I used the clamp editor install, integrated TinyMCE into my test platform and added my plugin, it works like a charm. I now only need to figure out the configuration variable but this is really promising.
As I said in an earlier post, our admin will probably not want to integrate TinyMCE on the production platform, but I'll try to convince him, as I think this solution is way better than integrating a separate instance of the editor in the added module.
Now, just in case, the php I'd need to modify to have a separate instance of TinyMCE is mo/assignment/online/assignment.class.php and it should be on the print_textarea line. "Ideally", the TinyMCE files should be in a subfolder of the mod/assignement/online folder. I know it's not ideal at all, but it'd allow me to have easy integration and disabling of the module if necessary, and avoid headaches on upgrading.. Any idea if this is possible at all?
If not we'll just have to try and convince our admin ^^
Thanks!
You will have to include somewhere (maybe in the module's own folder) your own copy of TinyMCE 3, and just go ahead and use it your self.
Some thoughts: The TinyMCE 3 installation you see in the patches provided in this thread is customized. For your module you might want to consider using a fresh/clean copy of TinyMCE 3 from their official web site.
Additionally, the print_textarea() function probably does more things than you might actually need in your module. Since you don't want to use the old TinyMCE, but you want to use the new one, you don't need to call print_textarea. You just go ahead and output the necessary HTML markup and JS code for having our new TinyMCE 3 load in the page, from your mod folder. The TinyMCE web site does include such examples. If you choose this approach, still take a look into print_textarea and the associated functions.
Good luck!
Now, on my personal site I applied the patch (I really prefer TinyMCE) and created the variable for displaying the plugin only in some instances...
However, I can't get it activated in my module. If I set the variable to true in my config.php, it is applied on all pages of the install, so I guess my variable works. But when I set it to false and try to override it in the assignment module by adding setting the variable to true so it would only display in the feedback field of the tutor, no such luck.. I can't seem to get it activated. I prob put it in the wrong PHP. How can I know where I should put it? (sorry, I know these are probably very basic questions...)
Many thanks again for all the help.
Please tell me what feature are you using? How to repro the usage scenario you have? This would help me pinpoint the precise file which needs edited. I will test in a pristine/clean Moodle 1.9 local installation.
Thanks!
Here is what I'm trying to do:
I want to duplicate the Online Text assignment module (mod\assignement\type\online). It can be added by a teacher by turn editing on>add activity>assignment>online text This allows students to write an online text, to which the teacher can then give feedback. There is a comment inline feature that copies the student's submission into the teacher's feedback field so he can add comments inside the text. The teacher can access the feedback field by clicking "grade" (or "update", once he has already given some feedback and wants to return to it)
Now, I want to create a separate instance of that online text module so English teachers can use TinyMCE + my markup plugin to easily add feedback for students (it has predefined buttons etc..). I can't modify the existing online text module as it is used by instructors "as is", so not for English teaching.
I managed to duplicate the module (attaching it to this post, please note it's not fully functional, just to be added in mod\assignment\type\ - I didn't include a subfolder with TinyMCE as it's not functional yet) thanks to help from David Smith (see discussion here - there are still a few issues that need to be addressed) who helped me to modify the assignement.class.php file in mod\assignement\type\onlineeslfr
Now, in my install, with integrated TinyMCE, I'd need to have the plugin displayed in the text editor for teacher feedback. I don't know where to set the $CFG-> markupeeslfrplugin: true; .
In our uni install, I'd need a separate TinyMCE editor including my plugin to be loaded from a subfolder in the plugin, so that nothing is changed in the Uni config, but that's another problem - once that is sorted, I'll have to make other versions of my plugin for the other languages taught at our institute as well
I hope this is clear enough, if you have any quesiton just ask...
Anyways, thanks for offering your help with this, it's really much appreciated, and I hope I'll be able to return the favour ^^ And if it's too much of a hassle, never mind
Hmm, I just looked through the code, and yes, simply putting the line $CFG->markupeeslfrplugin = true; won't be enough in your assignment type.
Why?
For one, when you work within the assignment module you won't access your assignment type directly. That means there's a bit more code executed before yours.
Additionally, in online assignment class you have the view() method which displays the assignments. There's an invocation of $this->view_header() which in turns invokes print_header() / print_header_simple() from lib/weblib.php. These ultimately end-up including lib/editor/htmlEditor.class.php. Finally, this script tells Moodle to print into the page:
Thanks for the reply! It's not lengthy, rather very instructive
I've quickly tried to implement the integrated solution on my install, but so far, no luck.. I have to get on with some more urgent work so I'll focus back on this later, but just wanted to say thanks!
Now, for the "do-it-yourself" approach, I'm having second thoughts after your comments here, especially as there could be security issues. I'll see if I can put it to some more experienced people, or try to convince our admin.
I'll try some more and come back here if I have more questions. thx for everything
++
Can someone please tell me where I can find a working git repository for the TinyMCE version?
I've installed Git and can get the standard Moodle builds OK but none of the Git URLs here seem to work (they all time out).
Thanks!!
but please be a little more specific as to which files I have to change to make to enable tinymce in mooldle,
PS: thanks in advance, and sorry for my English, is that I speak Spanish and little English
I have also followed the instructions here:
http://web2life.co.nz/content/tinymce-and-moodle-howto
and still cannot get it to even show up in Moodle.
Thanks.
http://www.clamp-it.org/
it was built with tinymce2 installed and working. Then I upgraded to use tinymce3. This was much easier (for me at least) than all of the various other methods mentioned.
Would you be interested in sharing your upgrade diffs? As maintainer of the CLAMP TinyMCE implementation I can certainly guarantee a lot of schools would be appreciative of being able to move to TinyMCE 3.x. We have a new release of the LAE (Liberal Arts Edition of Moodle) coming this Summer and I'd use your code and you could have all the credit.
Thanks, in advance.
I can send you the whole moodle dir. by .zip. I am using tiny 3.25. (although I'm sure this could be upgraded) and 1.95+ from CLAMP. Truthfully, I made so many changes that I don't know where they all are. And some are completely custom (like students being able to upload and insert images/files in Tiny, nangong plugin in Tiny, etc).
The biggest changes I made to the CLAMP version are almost all contained in the /lib/editor directory. But there are a few outside of it as well (mainly to get the nanogong plugin working).
So, I'm not sure how useful it will be to you, but let me know your email address and I will send you the files ASAP.
You've been a great help -- I'm going to check this out and likely use it (with your permission) when we convene in July for our CLAMP Hack-Doc fest (VI). If you've actually got Nanogong working with TinyMCE and aren't getting the kind of errors so prevalent from before, you should toddle over to that discussion and let them know -- everybody wants to use Nanogong but few (if any) seem able to get it to work reliably.
It is a base install with no additional mods and all of my (crazier) hacks removed. I haven't tested it extensively, but it would probably be a better starting point.
here is the link:
http://stabinger.us/moodle198T.zip
I only found one JS error in IE so far, and that is for admins when editing the frontpage settings (but the HTML editor still works, so it is minor).
Let me know if it works for you.
As for nanogong in Tiny: I had to do some hardcoded hacks to get it to work. I will take a look at what I did to get it working. I know I had to edit file.php (in the main moodle dir) among other things. So it is not for the faint of heart...
Download here or use the url from above.
I'm working on getting the tinymce gzip compressor to work, but so far no luck...
Thank you for your work on this. Could you post a diff of your code from Moodle 1.9.8. Or could you post which version of Moodle you based your port off of, e.g., MOODLE_198 or MOODLE_19_WEEKLY from 2010-05-12, so that others could generate the diff.
I think I figured it out. Was it based on MOODLE_19_WEEKLY from 2010-05-12?
Moodle 1.9.8+ (Build: 20100512).
Most of my mods were done in the lib/editor/ directory. Everything else, I tried to follow along with CLAMP's version of moodle/tinymce2. There are very minimal changes outside of the lib/editor folder. Larry notes the changes below.
$CFG->validateforms = 'server';
$CFG->defaulthtmleditor='tinymce';
not sure if this was clear or not...
I downloaded your latest version of moodle198T and did a new install to get a look at the config file.
Then in my near virgin CVS Moodle 1.9.8+ build from last Wednesday, I replaced the following folders and files
/lib/editor/tinymce (entire folder) after renaming the original folder tinymce-old
/lib/adminlib.php
/lib/depreceatedlib.php
/lib/editorlib.php
/lib/moodlelib.php
/lib/weblib.php
/message/send.php
/admin/settings.php
admin/settings/appearance.php
as per your advice.
I also added other files not previously in /lib/editor
I did not find any tinymce lang file in lang/utf-8/ (in moodle198T ) to add in
After adding
$CFG->validateforms = 'server'; ...... (Don't know if I need this one or not)
$CFG->defaulthtmleditor='tinymce';
below
require_once("$CFG->dirroot/lib/setup.php");
in the config.php file, all appears to work (based on limited testing)
My questions:
1. Is there a tinymce lang file that belongs in the lang/utf-8 folder?
2. What impact will performing weekly CVS updates on this build have on the functionality of the editor?
So as not to congest this topic, rather than entering the CVS report results here, I'm attaching them instead. I omitted those lines that had nothing to do with newly modified/added code
The first run of a CVS update resulted in the output displayed in the first part of the attachment.
Discussion:
- The ? files indicate new files and folders that will be ignored by future CVS updates ... GOOD
- The U files in this case are ones that I assume were not in the moodle198T build and will be added (but once) to my CVS version. I conject that these should not impact the running of tinymce 3.
- The C files show scripts that CVS can not replace, perhaps due to permission errors ... GOOD, I think .... I probably do not want them replaced with files that relate to tinymce 2.
- The M file should retain the manually added change in future updates involving this file
The second CVS update that I conducted (also in the attachment) display the ?, C and M entries, but the U's are no longer present.
thanks
larry
There is a tinymce lang file, I must have missed it. I will attach it here and add it to the download. Note, it is from CLAMP's work, I have not done anything with it other than include it (whether it needs to be included or not...).
I don't know enough about the CVS process to help you there. I am a newbie in that area...
Hopefully someone else can chime in on the CVS question
L
There were a couple of issues in testing
When inserting images in Moodle with the TINYMCE 3 adaptation, it tries to find the image at eg /mod/file.php/156/razzie.png instead of at file.php/156/razzie.png ..... It results in a not found on this server error.
The path to the image also appears to have a relative (../) address
Also when trying to add a quicktime movie, it displays a "Selected file is not an image. Please select an image!" error message
Nanogong files are uploaded to a nanogong_files folder in the course moodledata dirs.
Here are the install directions:
Under admin security site policies- enable trusted content
add the nanogong filter to the /filters/ dir. Enable the nanogong filter in admin settings.
copy the nanogong folder into the tinymce plugins folder (/lib/editor/tinymce/jscripts/tiny_mce/plugins/)
replace tinymce.js.php (in /lib/editor/) with the tinymce.js.php in the download.
Let me know how it goes...
Link to zip
I installed the nanogong add-on as described in your previous post onto two moodle instances.
In one install, all works as expected, when a sample webpage was created with a nanogong entry. A folder called nanogong_files gets installed in the moodledata folder and the recorded file (.spx) gets created in the appropriate course number folder.
BTW, the html code for the activity shows reference to a .spx file within a course folder in nanogong_files.
<nanogong url="/2/nanogong_files/2/2010-05-20_164131.spx" caption="Hello World"><img src="http://localhost/m19/lib/editor/tinymce/jscripts/tiny_mce/plugins/nanogong/sound.gif" /></nanogong>
In the other, NO folder called nanogong_files gets installed in the moodledata folder.
Instead of just showing the speaker icon, it displays the login page between 2 copies of the speaker icon. See the attached file for the screenshot and the error message.
A look at the html code indicates that the sound file is not being created in a folder that it can be accessed.
<p><nanogong url="/<!DOCTYPE html PUBLIC ">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
etc.
- I checked permissions and there does not seem to be an issue there.
- I tried with the standard theme ... no difference.
- I also manually created the nanogong_files folder (permissions 777) and that did not do it.
Any ideas?
Take a look at the file record2.php in the nanogong folder (in the tinymce plugins folder). Find:
$dir = "$basedir$wdir";
change this to $dir = "1/nanogon_files";
(where 1 is the hardcoded course number) to test where the error might be. I had to use $SESSION->cal_course_referer; to get the course ID, and this may be the culprit in this instance for some reason...
BTW .. these results are generated when the sample course is accessed using Firefox on a client computer. When the sample course is accessed using Firefox on the server computer, I get a "Failed to initialize audio recorder" error when the record button is pressed on the pop-up recorder. I believe the latter results from this server being a Mac Mini with no sound input capabilities.
Weird indeed!
Anyway, I upgraded to the newest versions of the .jars, and modified the newest version of the filter and fixed the plugin variable issue... Link to files
Give the above zip a try. There were no changes to tinymce.js.php.
... Still the same issue .... It does allow me to perform a recording and play it back before I select Insert. Must be some strange permission issue on the server preventing Moodle from creating the folder and files.
A linux programmer has root access to the server and he may have done something that I'm not aware of that is causing the issue. I do notice a _spotlight hidden user that has custom privileges on the box and this may have something to do with it .... I'll check with him.
Both the working and non-working versions are running MAMP Pro (although the working one is MAMP Pro 1.9 and the non-working one is 1.8.4 ... could also be an issue, but I did not see anything in the log files for the non-working installation to trigger an error.
cheers
larry
So check your server>debugging> and set error reporting to none, and display errors to none.
Your Moodle 1.9.8 + TinyMCE + Nanogong setup is working well for us.
At the risk of stating the obvious, needed to 'Enable Trusted Content' in Administration > Security > Site Policies to stop the link to the Nanogong recording being stripped out on saving.
Thanks again for providing this to the community
Can you get me a screenshot?
You can download at the URL above. For those keeping score at home, the file to change is:
/lib/editor/tinymce/jscripts/tiny_mce/plugins/moodlelink/link.php (attached).
When I try to select a file/URL however, it tells me that the file I have selected is not an Image file.
Any ideas about how to fix this would be appreciated.
As we discussed, your tinymce integration is based on the template integration for older versions. Hope you decide to upgrade to 1.98 and try out the newer integration.
I added filebrowser fix from above into the main package. I also have a student uploading hack (as a separate package). It gives students in a course the ability to upload/select files/images through the filebrowser via a 'student' directory. They cannot get out of this directory or mod/delete files. Nevertheless it probably is risky so test with caution. All of the files are available here:
Link
I have installed your TinyMCE enabled 1.9.8 on my Moodle sandbox and plan to install it on our production server this Thursday. At last! I would like to enable the html button so that those who want to do some code tweaking (read that me) can do so. Can you give me some idea how, or point me in the right direction?
Thanks, and thanks too for making this TinyMCE integration available.
Doug
Here is what I did:
1. I downloaded the 1.9.8 zip provided by John St. at http://www.stabinger.us/moodle198T.zip
2. I consulted the list of folders provided by Larry Elchuck on May 18th and replaced my existing folders with those from the zip file above.
3. I checked, and the TinyMCE editor is now present and functional in my moodle courses.
My questions:
1. I'm noticing that there are a few things not activated or otherwise absent from the editor. Specifically, I went looking for the word count feature and the dragmath integration. I had dragmath functional on the default Moodle editor (htmlArea?). Can anyone direct me on how to utilize DragMath and the Word Count?
2. I assume that I'm using TinyMCE2 - I don't know how to verify this though. When I check the full example found at http://tinymce.moxiecode.com/examples/full.php , I begin to salivate in anticipation. If I am indeed running TinyMCE2, is there any way for me to upgrade to Tiny3? If so, can you provide detailed instructions (I'm very new to this...)?
Many thanks to everyone who has contributed - your time and effort are greatly appreciated.
Dragmath will work. First, replace your /lib/editor/tinymce.js.php with the attached file. Then you can download the tinymce dragmath plugin here.
Unzip and place the plugin in the tinymce plugins folder (lib/editor/tinymce/jscripts/tiny_mce/plugins/).
I don't know of any character counters but take a look at the tinymce forums to see if you can find anything.
That worked wonderfully! I now have TinyMCE, Dragmath, and a wordcount! Once you posted the tinymce.js.php, I was able to look at the file and understand how Dragmath was initiated, and thus was able to simply turn on the wordcount plugin that was already in the lib/editor/tinymce/jscripts/tiny_mce/plugins/ directory. Thank you for your help!
Java Plug-in 1.6.0_20
Using JRE version 1.6.0_20-b02-279-10M3065 Java HotSpot(TM) 64-Bit Server VM
User home directory = /Users/dougloomer
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to
----------------------------------------------------
load: class Display/MainApplet.class not found.
java.lang.ClassNotFoundException: Display.MainApplet.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:219)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:532)
at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:2940)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1444)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.io.IOException: open HTTP connection failed:http://sasoc.saschina.org/lib/editor/common/dragmath/applet/classes/Display/MainApplet/class.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Applet2ClassLoader.java:537)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Applet2ClassLoader.java:51)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Applet2ClassLoader.java:192)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:189)
... 6 more
Exception: java.lang.ClassNotFoundException: Display.MainApplet.class
Also, TinyMCE in Moodle 1.9.8 doesn't work in Opera. Is that expected?
Any thoughts on either issue?
Am watching fervently hoping to get back to testing soon.
It probably isn't production ready, but if anyone here using the moodle198/tinymce integration wants to do some testing with the plugin, please download from below and send me any bug reports/ideas...
Link to zip
I only have access to one google ed domain, so my testing is limited but it seems to work well. Those not using the SSO are not effected by the bug or the fix (but might as well re-download just in case).
I have TinyMCE working in Moodle 1.9.9 and generally everything is working fairly well. I'm running into a bit of a problem with embedded media. Specifically, I'm trying to embed a video from our Cisco Show and Share DMS. The DMS provides an embed code that I can place within a label in Moodle, and the video plays perfectly. The problem occurs when I go in to edit the label text and find that TINYMCE has altered the coding, rendering it useless. I'm really at a loss as to what to do. A tangential question: I've attached a picture of my editor, any thoughts on I control the HTML toggle from the bottom left of the page versus the button that is embedded in the toolbar?
This code:
<script type="text/javascript" src="https://myhost.com/vportal/scripts/videoplayer/DmsEmbedLib.js"></script><script>document.write(dmsEmbed.getSimplePlayer("C-be993db7-af87-45ac-99e6-eca8ae448987:5","https://myhost.com/vportal/VideoPlayer.jsp?ccsid=C-be993db7-af87-45ac-99e6-eca8ae448987:5#","false",480));</script>
Becomes:
<script src="https://myhost.com/vportal/scripts/videoplayer/DmsEmbedLib.js" type="text/javascript"></script>
<script type="text/javascript">// <![CDATA[


document.write(dmsEmbed.getSimplePlayer("C-be993db7-af87-45ac-99e6-eca8ae448987:5","https://myhost.com/vportal/VideoPlayer.jsp?ccsid=C-be993db7-af87-45ac-99e6-eca8ae448987:5#","false",480));


// ]]></script>
As always, thank you!
So, perhaps by modding the allowed tags list in tinymce.js.php we can make the code work.
So, perhaps by modding the allowed tags list in tinymce.js.php we can make the code work.
The problem exists both in IE and FF. The problem exists in Moodle 1.9.7, 1.9.8, and 1.9.9 (the only ones tested). The problem exists with default installations of Moodle, and with TinyMCE modified installations.
As noted by Bob Puffer, when I go into my profile and choose to use standard web forms, the code does not change between edits.
2. Upon closer examination of the problem code, it reveals that the code begins to be re-written with the CData tag only upon the action performed on the invoked javascript. Even more revealing is that the editor uses the // to comment out the operation being performed. In this case, the operation is document.write
Knowing this, it seems to me that this could imply that there is a safety feature of the Moodle editors - when code is brought from that database and put into the control area to be edited, a filter is executed that prevents the running of a javascript action within the area. It then rewrites the information to comment out the potential threat. This would be a logical safety feature as we wouldn't want students to be able to execute remote javascript on our pages.
Since the script almost always works the first time, before an edit occurs, it appears as though the problem originates from the command to bring that cell's data to the control area, or the reading of the data by the editor itself. Whatever the problem is, it can't be a simple "read" problem since the data is only being rewritten when loaded for editing.
Any thoughts?
I have been able to get it all set up and running save for the 'insert/edit image' function. It brings up the dialog box just fine, but when you go to browse you get something like:
Fatal error: Call to undefined function print_string() in /home/---/public_html/lib/editor/tinymce/jscripts/tiny_mce/plugins/moodlelink/link.php on line 1
Thoughts on how to get this functioning?
Thanks
It is easy to add the template plugin button modifying moodle\lib\editor\tinymce\lib.php but the list of templates is blank: in original tinyMCE there's a variable template_external_list_url : "lists/template_list.js" that point to template's list (tinyMCETemplateList variable).
Can I implement template plugin in moodle/tinyMCE ?
Thank you,
Furio
Hi Folks,
At the University of South Australia, we've been using this TinyMCE patch on Moodle 1.9, but recently we ran into the iPad/iPhone issue. We have a number of Staff and Students who are using devices such as these to access our learnonline system but due to how Safari renders TinyMCE, the editor was unfortunately not operational in WYSIWYG mode.
I have generated a patch for Moodle 1.9.9 so that if you have implemented the TinyMCE patch and have users complaining that it doesn't work on their iPad/iPod/iPhone; this patch simply disables the HTML editor from displaying and defaults to a plain-text entry area when a user views Moodle on those devices.
Patch file attached.
Looking hopefully toward November and IOS4 for the iPad.
iOS4 on iPhone doesn't fix the issue, I don't think it will have any effect on the iPad, either.
Recently i made my own Moodle 1.9 + TinyMCE integration version with backward compatiblity to HTMLArea, so you can easly turn off TinyMCE in config.php.
First of all when i took the John St. version, i just couldnt replace my Moodle installation core files, because it would have overwritten my own changes, thats why i made a detailed documentation which core files to edit.
I used mostly the work done by John St, many many Thanks! (Great job!)
Also made some modifications..
I have written about that in my blog post:
http://www.t6nis.com/wp/moodle/moodle-1-9-tinymce-integration-dragmath-nanogong-included/
When you download, read the Readme.txt file before doing anything!
Hope it helps you!
'd like to echo the praise for John St. 's work -- his integration of TinyMCE is in the CLAMP LAE version of Moodle.
Re:Moodle 1.9 + TinyMCE - Spellchecker issues with Internet Explorer
I would also like to thank all those involved in refining the Moodle 1.9 TinyMCE integration.
However, we have identified one particularly frustrating issue and would be grateful for any insights.
Using the spellchecker plugin, with PSpell (ASpell) or PSpellShell, and using Internet Explorer 8, we find that editor content is not saved using e.g. the [Post to...] button at the bottom of the form if the Spellchecker is active (some remaining red squiggles under misspelled words).
This not a problem with Firefox or other browsers. However most of our end-users use IE
The same issue has been documented here:
http://tinymce.moxiecode.com/forum/viewtopic.php?id=23414
Though, I have not yet worked out how to apply suggested fixes in the context of Moodle-TinyMCE PHP/JavaScript.
I have also noticed that the Save (disc icon) plugin added to the TinyMCE toolbar works fine (content is saved in IE even if the spellchecker is active) - just need this working for the form submit button too!
Grateful for any response, even if only to confirm that others see the same issue
Regards Geoff
Re:Moodle 1.9 + TinyMCE - Spellchecker issues with Internet Explorer
Looks as if the same issue occurs in at least some instances with Moodle 2 and TinyMCE
Re:Moodle 1.9 + TinyMCE - Spellchecker issues with Internet Explorer
Just fixed in TinyMCE 3.4b3 and may be backported to TinyMCE 3.3 series
http://tinymce.moxiecode.com/develop/bugtracker_view.php?id=3167
https://github.com/tinymce/tinymce/commit/887084d92132e669b3da8e59da0363f045aa3177
Re:Moodle 1.9 + TinyMCE - Spellchecker issues with Internet Explorer
Great work!
I did. One question, where can I change language into tinyMCE?
Thanks
Little hint for those who don't want to enable trusted content but still want to have Tinymce + nanogong working - also for students!
in lib/weblib.php @ around line 2088
$def = $config->getHTMLDefinition(true);
$def->addElement('nanogong', 'Inline', 'Empty', 'I18N', array('url*'=>'URI', 'caption'=>'Text')); // Add this for Nanogong for moodle
$def->addElement('nolink', 'Block', 'Flow', array()); // skip our filters inside
This modifies the HTML purifier to allow nanogong tags.
I would like to use the Tiny MCE editor in my 1.9 instance, but the link above doesn't seem to work anymore. Can anyone point me to a link that works?
I would like to use the Tiny MCE editor in my 1.9 instance, but the link above doesn't seem to work anymore. Can anyone point me to a link that works?
If desired, refer to the CLAMP postings earlier in this thread... the LAE version uses TinyMCE -- latest release is based off 1.9.11.
I have a custom Moodle instance, I do not wish to use CLAMP's version.