Commits

Donald Stufft  committed 3110c5a

copied in the widgets from cms/plugins/text/widgets/

  • Participants
  • Parent commits ebaa0ff

Comments (0)

Files changed (2)

File cmsplugin_news/widgets/tinymce_widget.py

             'installed_plugins': self.installed_plugins,
         }
         return mark_safe(render_to_string(
-            'cmsplugin_news/widgets/tinymce.html', context))
+            'cms/plugins/widgets/tinymce.html', context))
         
     def _media(self):
         media = super(TinyMCEEditor, self)._media()
         media.add_js([join(settings.CMS_MEDIA_URL, path) for path in (
-                      'js/lib/jquery.js',
+                      'js/tinymce.placeholdereditor.js',
+                      'js/lib/ui.core.js',
+                      'js/placeholder_editor_registry.js',
                       )])
         media.add_css({"all":[join(settings.CMS_MEDIA_URL, path) for path in ('css/jquery/cupertino/jquery-ui.css',
                                                                      'css/tinymce_toolbar.css')]})
         mce_config['mode'] = 'exact'
         mce_config['elements'] = final_attrs['id']
         mce_config['strict_loading_mode'] = 1
-        """
         plugins = mce_config.get("plugins", "")
         if len(plugins):
             plugins += ","
         plugins += "-cmsplugins"
         mce_config['plugins'] = plugins
-        adv2 = mce_config.get('theme_advanced_buttons1', "")
-        if len(adv2):
-            adv2 = "," + adv2
-        adv2 = "cmsplugins,cmspluginsedit" + adv2
-        mce_config['theme_advanced_buttons1'] = adv2
-        """
+        if mce_config['theme'] == "simple":
+            mce_config['theme'] = "advanced"
+        mce_config['theme_advanced_buttons1_add_before'] = "cmsplugins,cmspluginsedit"
         json = simplejson.dumps(mce_config)
-        
         html = [u'<textarea%s>%s</textarea>' % (flatatt(final_attrs), escape(value))]
         if tinymce.settings.USE_COMPRESSOR:
             compressor_config = {

File cmsplugin_news/widgets/wymeditor_widget.py

 from os.path import join
-
+from django.conf import settings
+from django.forms import Textarea
 from django.utils.safestring import mark_safe
 from django.template.loader import render_to_string
-from django.forms import Textarea
 
-from django.conf import settings
 from cms.plugins.text import settings as text_settings
 from django.utils.translation.trans_real import get_language
 
+
 class WYMEditor(Textarea):
     class Media:
         js = [join(settings.CMS_MEDIA_URL, path) for path in (
-            'js/lib/jquery.js',
             'wymeditor/jquery.wymeditor.js',
             'wymeditor/plugins/resizable/jquery.wymeditor.resizable.js',
+            'js/wymeditor.placeholdereditor.js',
+            'js/lib/ui.core.js',
+            'js/placeholder_editor_registry.js',
         )]
-              
+        css = {
+            'all': [join(settings.CMS_MEDIA_URL, path) for path in (
+                        'css/jquery/cupertino/jquery-ui.css',
+                    )],
+        }
+
     def __init__(self, attrs=None, installed_plugins=None):
         """
         Create a widget for editing text + plugins.
             self.attrs.update(attrs)
         super(WYMEditor, self).__init__(attrs)
         self.installed_plugins = installed_plugins
-        
+
     def render_textarea(self, name, value, attrs=None):
         return super(WYMEditor, self).render(name, value, attrs)
 
             'installed_plugins': self.installed_plugins,
         }
         return mark_safe(render_to_string(
-            'cmsplugin_news/widgets/wymeditor.html', context))
+            'cms/plugins/widgets/wymeditor.html', context))
 
     def render(self, name, value, attrs=None):
         return self.render_textarea(name, value, attrs) + \