Yet Another Full Featured TinyMCE v1.5 for elgg 1.5

Release Notes

You don't need this version except when you:

  • want to have your pages, blogs, groups etc. image/media asset storage separated from your files or you don't have the files plugin or the embed plugin enabled,
  • want to have the possibility to switch the tinymce to fullscreen to have better overview while editing large pages,
  • want to embed flash videos,
  • want to have some of the other features described below.

What does it do?

Tinymce gives you the power of wysiwyg text-editing on fields of type 'longtext' in elgg. Currently enabled features of tinymce in this version are:

  • Text attributes: bold,italic,underline,strikethrough,foregroundcolor,backgroundcolor
  • Text styles: select format,select font,select font size
  • Text alignment: justify left,justify center,justify right,justify full

Other features: inserting bullet lists or numbered lists, inserting and editing tables, direct editing of html-code, outdent or indent text blocks, inserting of smilies, inserting media files with uploading possibility by integrated tinybrowser, elgg language support, switching to fullscreen and back again.

In addition you can now switch between two alternating images like 'hover' using onmouseover/onmouseout and embedded images are scalable with the mouse or by entering dimensions.

The tinybrowser needs a directory '/assets' under your $_SERVER['DOCUMENT_ROOT'], so that you have to create this first and chmod it to '777'. When a user uploads a file, additional subdirectorys based on the loginname of the user will be created in the following form:

/assets
   /loginname
      /img        //store for images
         /_thumbs //store for automatic created thumbnails
      /media      //store for 'swf' files
     
If you want to upload and embed flash videos, you first have to put the *.flv together with a flashplayer into an *.swf. You can do this with a flash toolbox. Otherwise you can embed flash videos from youtube simply by inserting the url of the video.
I've NOT tested inserting media of other formats than flash.

Installation:
Do not overwrite your existing version of tinymce!

  • First disable your existing tinymce plugin in the admin/tools section.
  • Make a backup copy of your existing /mod/tinymce folder and delete it. Insert the tinymce folder from this archive in /mod.
  • Create a folder '/assets' under your $_SERVER['DOCUMENT_ROOT'] and chmod it to '777' (or chown it according to the account of your webserver e.g 'www', 'wwwrun' and give permissions to write - this should work, too).
  • Enable the new tinymce plugin in the admin/tools section.

Although i've tested this plugin on my various systems, there's no warranty. Use it on your own risk.

You will find additional information on the website of the tinymce developers: http://www.moxiecode.com.

Please give me a short response if this plugin works for you with or without restrictions.

enjoy it!
Karsten Schulze (2009)

  • This planet really abiliged and greatfull to you like people who are creating ,creating & creating new things for the internet world.

    thanks 

    shyam dash

  • Spellcheck capabilities?

  • Splendid - another bonus is it allows people up update uploaded files :)

  • Works beautifully. However, does this work with the embed feature using the file system in Elgg? I've clicked the embed link which is above the editor, and it won't embed files from it. Anyway to get that to work? I'd rather use TinyMCE anyway, but if thats possible would be nice. Thanks again for TInymce plugin

  • Looks really good.

    Any chance this has a "read more" button for use in the blog section?

    I have been looking at the tinymce used with joomla and they use an editor -xtd

    Todo: Learn php:)

    Thanks.

  • @shogun:
    To embed files with the embed plugin, at the moment you have to temporary disable with 'add/remove editor', embed your file, and enable editor again. The embedded file will be inserted at the end of the text, not at cursor position.

    @sleuth:

    Don't really understand what you mean with read more. If the tinymce window does not show all, switch to fullscreen (icon right of smiley) and/or use the scrollbar on the right.

  • Sry,

     

    what I mean is a button (I think it inserts a </hr> tag) so the portion above the tag shows in the blogs page and the rest shows when you click on the read more link....like in wordpress or joomla.

     

    I think this is the code for it in joomla.

    I'm not asking you to do it or anything but do you think this could be made to work with elgg?

    This website uses it on the "NEWS" page.

    <?php
    // no direct access
    defined( '_JEXEC' ) or die( 'Restricted access' );

    jimport( 'joomla.plugin.plugin' );

    /**
     * Editor Readmore buton
     *
     * @package Editors-xtd
     * @since 1.5
     */
    class plgButtonReadmore extends JPlugin
    {
     /**
      * Constructor
      *
      * For php4 compatability we must not use the __constructor as a constructor for plugins
      * because func_get_args ( void ) returns a copy of all passed arguments NOT references.
      * This causes problems with cross-referencing necessary for the observer design pattern.
      *
      * @param  object $subject The object to observe
      * @param  array  $config  An array that holds the plugin configuration
      * @since 1.5
      */
     function plgButtonReadmore(& $subject, $config)
     {
      parent::__construct($subject, $config);
     }

     /**
      * readmore button
      * @return array A two element array of ( imageName, textToInsert )
      */
     function onDisplay($name)
     {
      global $mainframe;

      $doc   =& JFactory::getDocument();
      $template  = $mainframe->getTemplate();

      // button is not active in specific content components

      $getContent = $this->_subject->getContent($name);
      $present = JText::_('ALREADY EXISTS', true) ;
      $js = "
       function insertReadmore(editor) {
        var content = $getContent
        if (content.match(/<hr\s+id=(\"|')system-readmore(\"|')\s*\/*>/i)) {
         alert('$present');
         return false;
        } else {
         jInsertEditorText('<hr id=\"system-readmore\" />', editor);
        }
       }
       ";

      $doc->addScriptDeclaration($js);

      $button = new JObject();
      $button->set('modal', false);
      $button->set('onclick', 'insertReadmore(\''.$name.'\');return false;');
      $button->set('text', JText::_('Readmore'));
      $button->set('name', 'readmore');
      // TODO: The button writer needs to take into account the javascript directive
      //$button->set('link', 'javascript:void(0)');
      $button->set('link', '#');

      return $button;
     }
    }

     

    Cheers.

  • Hi,

    I have a problem with broken links...when I use Inster/edit link there is no href=" " atribute in html code. How can I fix it?

    Morover, why video URL's are above all site content making it difficult to use the TinyMCE?

    Cheers,

  • Sorry, i really don't understand exactly what you mean (because my english is not so good). Which insert/edit link do you mean? The one from the embed plugin? And what about your video urls?

  • Thanks for your response,

    When I instert a link to my text...in html code it looks like a: <a target="_blank>link name</a>. So there is no href="" attribute and the link doesn't work in that case.

    What about the video. All videos are above the site content: message/error box, and the TinyMCE editor as well. Making it hard to edit another page...

    Cheers,

  • Hi jazzman,

    I think i have found the problem with the 'href' attribute. But i will not upload an update until i know if the following patch does not affect any other behaviour of my tinymce:

    Please open /mod/tinymce/views/default/input/longtext.php with a text editor, go to line 53 (document_base_url ... ) and delete it. Then go to the end of line 52 (relative_urls : false,) and delete the comma, too.

    Save longtext.php and reload the page with the open tinymce (if you apply the patch while running it)

    I cannot reproduce your problem with the videos - do you have modified the theme or any related css?

  • It still doesn't work:(

    Links are broken...but many thanks for help

  • Hi, Karsten!

    I love your pluggin and it works fine with 1.5. But I still have this problem -- the buttons show their code, ie "{#media_dlg.file}" instead of a neat look.

    On a previous post, you suggested I disabled it, reloaded it and re-enabled it. Which I did, to no avail. Would it be that the buttons are pics or are described in some place that, for some reason, Tinymce can't or doesn't reach?

    I'd be delighted to find a fix on this one!

    All the best,

    Isabelle

  • I had the same problem Isabelle, and i fix it ! It's very simple : the plugin configure the buttons's languages throught the elgg site's language. For example, my elgg site is in french, but it doesn't exist french language in the plugin. So, you have just to get a language pack here (http://tinymce.moxiecode.com/download_i18n.php) and to put every files in each folder of the plugin (one by one, not by paste all the files!!). Now, it works great ! Best ;)

  • I've had trouble with zaudio. I can't get an mp3 to embed, or if it does embed, i can't get it to stream. Is it possible that using this TinyMCE plugin would interact differently with zaudio ? Thanks in advance for any advice.

  • Well, I've answered my own question. But as there doesn't seem to be interest I'll share only if requested.

    Thanks all !

  • Karsten, when I go to use TinyBrowser and try to upload an image using TinyBrowser upload, I have a blank menu screen. "Browse" and "Edit" provide familiar content, but "Upload" is a blank box, see below. Any ideas why this would be/how to fix ?

    Thanks very much. This is a greatly enhanced TinyMCE. Love it.

    image

  • When you click to preview your post , you can preview it but after when you return to editor all the formats, additions etc are gone.... only the text remaining.

  • No it seems its working with an extra click inside text area

  • can i publish javascript code? any idea about how can i do that? thanks!

  • TinyMCE problem

    Hello Karsten,

    Thanks for an interesting plugin. However, when I embed a picture (I have embed plugin as well) and set the appearance of the photo to the Right, the picture overlaps whatever is under the message.

    However, if I don't change the appearance, the photo stays where it suppose to stay.

     

Karsten Schulze

Management Consultant, IT Consultant

Stats

  • Category: Uncategorized
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 1824
  • Recommendations: 2

Other Projects

View Karsten Schulze's plugins