Mercurial > public > sg101
changeset 7:ca66189c7c44
Added tiny_mce to the GPP_THIRD_PARTY_JS setting. Updated code to use it.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 12 Apr 2009 00:31:36 +0000 |
parents | b6263ac72052 |
children | d6f3c38e8f50 |
files | gpp/bulletins/admin.py gpp/news/admin.py gpp/news/forms.py gpp/settings.py media/js/tiny_mce_init_admin.js media/js/tiny_mce_init_messages.js media/js/tiny_mce_init_std.js |
diffstat | 7 files changed, 15 insertions(+), 46 deletions(-) [+] |
line wrap: on
line diff
--- a/gpp/bulletins/admin.py Sat Apr 11 22:50:56 2009 +0000 +++ b/gpp/bulletins/admin.py Sun Apr 12 00:31:36 2009 +0000 @@ -3,6 +3,8 @@ ''' from django.contrib import admin +from django.conf import settings + from bulletins.models import Bulletin class BulletinAdmin(admin.ModelAdmin): @@ -12,7 +14,7 @@ date_hierarchy = 'start_date' class Media: - js = ('js/tiny_mce/tiny_mce.js', 'js/tiny_mce_init_admin.js') + js = settings.GPP_THIRD_PARTY_JS['tiny_mce'] admin.site.register(Bulletin, BulletinAdmin)
--- a/gpp/news/admin.py Sat Apr 11 22:50:56 2009 +0000 +++ b/gpp/news/admin.py Sun Apr 12 00:31:36 2009 +0000 @@ -3,6 +3,8 @@ """ from django.contrib import admin +from django.conf import settings + from news.models import PendingStory from news.models import Story from news.models import Category @@ -14,7 +16,7 @@ date_hierarchy = 'date_submitted' class Media: - js = ('js/tiny_mce/tiny_mce.js', 'js/tiny_mce_init_admin.js') + js = settings.GPP_THIRD_PARTY_JS['tiny_mce'] class StoryAdmin(admin.ModelAdmin): @@ -24,7 +26,7 @@ date_hierarchy = 'date_published' class Media: - js = ('js/tiny_mce/tiny_mce.js', 'js/tiny_mce_init_admin.js') + js = settings.GPP_THIRD_PARTY_JS['tiny_mce'] admin.site.register(Category)
--- a/gpp/news/forms.py Sat Apr 11 22:50:56 2009 +0000 +++ b/gpp/news/forms.py Sun Apr 12 00:31:36 2009 +0000 @@ -3,6 +3,8 @@ """ from django import forms +from django.conf import settings + from news.models import PendingStory from news.models import Category @@ -18,7 +20,7 @@ exclude = ('submitter', 'date_submitted', 'allow_comments', 'approved', 'tags') class Media: - js = ('js/tiny_mce/tiny_mce.js', 'js/tiny_mce_init_std.js') + js = settings.GPP_THIRD_PARTY_JS['tiny_mce'] class SearchNewsForm(forms.Form): @@ -50,4 +52,3 @@ def name(self): return self.cleaned_data['friend_name'] -
--- a/gpp/settings.py Sat Apr 11 22:50:56 2009 +0000 +++ b/gpp/settings.py Sun Apr 12 00:31:36 2009 +0000 @@ -164,6 +164,10 @@ 'js/markitup/jquery.markitup.pack.js', 'js/markitup/sets/markdown/set.js', ), + 'tiny_mce': ( + 'js/tiny_mce/tiny_mce.js', + 'js/tiny_mce_init_std.js', + ), } GPP_THIRD_PARTY_CSS = { 'jquery-ui': (
--- a/media/js/tiny_mce_init_admin.js Sat Apr 11 22:50:56 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -tinyMCE.init({ - mode : "textareas", - theme : "advanced", - content_css : "css/example.css", - theme_advanced_toolbar_location : "top", - theme_advanced_toolbar_align : "left", - theme_advanced_buttons1 : "fullscreen,|,preview,|,bold,italic,underline,strikethrough,|,bullist,numlist,outdent,indent,|,undo,redo,|,link,unlink,anchor,|,image,media,cleanup,help,|,code", - theme_advanced_buttons2 : "", - theme_advanced_buttons3 : "", - auto_cleanup_word : true, - plugins : "table,advhr,emotions,insertdatetime,preview,searchreplace,print,contextmenu,fullscreen,media", - plugin_insertdate_dateFormat : "%m/%d/%Y", - plugin_insertdate_timeFormat : "%H:%M:%S", - fullscreen_settings : { - theme_advanced_path_location : "top", - theme_advanced_buttons1 : "fullscreen,|,preview,|,cut,copy,paste,|,undo,redo,|,search,replace,|,code,|,cleanup,|,bold,italic,underline,strikethrough,|,forecolor,backcolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,help", - theme_advanced_buttons2 : "removeformat,styleselect,formatselect,fontselect,fontsizeselect,|,bullist,numlist,outdent,indent,|,link,unlink,anchor", - theme_advanced_buttons3 : "sub,sup,|,image,insertdate,inserttime,|,tablecontrols,|,hr,advhr,visualaid,|,charmap,emotions,|,print" - } -});
--- a/media/js/tiny_mce_init_messages.js Sat Apr 11 22:50:56 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -tinyMCE.init({ - mode : "textareas", - theme : "advanced", - content_css : "/static/css/messages.css", - theme_advanced_toolbar_location : "top", - theme_advanced_toolbar_align : "left", - theme_advanced_buttons1 : "fullscreen,|,preview,|,bold,italic,underline,strikethrough,|,bullist,numlist,outdent,indent,|,undo,redo,|,link,unlink,anchor,|,image,media,cleanup,help,|,code", - theme_advanced_buttons2 : "", - theme_advanced_buttons3 : "", - auto_cleanup_word : true, - plugins : "table,advhr,emotions,insertdatetime,preview,searchreplace,print,contextmenu,fullscreen,media", - plugin_insertdate_dateFormat : "%m/%d/%Y", - plugin_insertdate_timeFormat : "%H:%M:%S", - fullscreen_settings : { - theme_advanced_path_location : "top", - theme_advanced_buttons1 : "fullscreen,|,preview,|,cut,copy,paste,|,undo,redo,|,search,replace,|,code,|,cleanup,|,bold,italic,underline,strikethrough,|,forecolor,backcolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,help", - theme_advanced_buttons2 : "removeformat,styleselect,formatselect,fontselect,fontsizeselect,|,bullist,numlist,outdent,indent,|,link,unlink,anchor", - theme_advanced_buttons3 : "sub,sup,|,image,insertdate,inserttime,|,tablecontrols,|,hr,advhr,visualaid,|,charmap,emotions,|,print" - } -});
--- a/media/js/tiny_mce_init_std.js Sat Apr 11 22:50:56 2009 +0000 +++ b/media/js/tiny_mce_init_std.js Sun Apr 12 00:31:36 2009 +0000 @@ -4,7 +4,7 @@ content_css : "css/example.css", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", - theme_advanced_buttons1 : "fullscreen,|,preview,|,bold,italic,underline,strikethrough,|,bullist,numlist,outdent,indent,|,undo,redo,|,link,unlink,anchor,|,image,media,cleanup,help,|,code", + theme_advanced_buttons1 : "fullscreen,|,preview,|,bold,italic,underline,strikethrough,|,bullist,numlist,outdent,indent,|,undo,redo,|,link,unlink,anchor,|,image,cleanup,help,|,code", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "", auto_cleanup_word : true,