Changeset 3014 for trunk


Ignore:
Timestamp:
04/12/10 03:06:19 (10 years ago)
Author:
jukka
Message:

Preparing for new i18n extraction and removing references to kupu, next commit will replace it with tinyMCE.

Location:
trunk
Files:
3 deleted
53 edited

Legend:

Unmodified
Added
Removed
  • trunk/Branchable.py

    r2998 r3014  
    2525from Products.CMFCore.utils import getToolByName 
    2626from Acquisition import aq_inner, aq_parent 
    27 from Products.CMFPlone import PloneMessageFactory as PMF 
     27from messagefactory_ import i18nme as _ 
     28 
    2829 
    2930import re, copy 
     
    105106        new.storeInHistory({}, summary='Copy of %s created' % base_obj.title_or_id()) 
    106107        new.setHistory(new.getHistory()+base_obj.getHistory()+new.getHistory()) 
    107         lt.addPortalMessage('You are editing a copy of the original learning resource.') 
     108        lt.addPortalMessage(_('You are editing a copy of the original learning resource.')) 
    108109        return REQUEST.RESPONSE.redirect('%s/base_edit' % new.absolute_url())         
    109110 
  • trunk/ConfigurationMethods.py

    r3001 r3014  
    460460    ft.manage_setPortalFactoryTypes(None, types_list) 
    461461 
    462 def setupConfigureKupu(self, portal): 
    463     """ configure kupu """ 
    464     k = getToolByName(portal, 'kupu_library_tool') 
    465     k.configure_kupu(1, '',  #linkbyuid, table_classnames 
    466             [   # html exclusion. list tags you don't want to be in HTML code 
    467                 {'tags':(), 
    468                  'attributes':'', 
    469                  'keep':1, 
    470                 }, # list attributes you don't want in HTML code 
    471                 {'tags':'', 
    472                  'attributes':'', 
    473                  'keep':1, 
    474                 }, 
    475             ], 
    476             ['text-align', 'list-style-type'],   # style whitelist 
    477             [],  # class_blacklist 
    478             1,  # install before unload 
    479             ['Heading|h2', 'Code|pre'])   # Kupu can't handle 'code' 
    480     filters={} 
    481     visible=['bg-basicmarkup','bold-button','italic-button','bg-subsuper','subscript-button','superscript-button','bg-list','list-ol-addbutton','list-ul-addbutton','bg-drawers','linkdrawer-button','tabledrawer-button','source','styles'] 
    482  
    483     hidden=['bg-colorchooser','save-button','forecolor-button','hilitecolor-button','bg-justify','justifyleft-button','justifycenter-button','justifyright-button','definitionlist','bg-indent','outdent-button','indent-button','imagelibdrawer-button','linklibdrawer-button','embed-tab','anchors-button','manage-anchors-tab','toc-tab','bg-remove','removeimage-button','removelink-button','bg-undo','undo-button','redo-button','spellchecker','ulstyles','olstyles','zoom'] 
    484     visible=[{'id':button,'visible':True,'override':None} for button in visible] 
    485     hidden=[{'id':button,'visible':False,'override':None} for button in hidden] 
    486     k._setToolbarFilters(visible+hidden, None) 
    487  
    488462 
    489463language_list = ['cs','de','en','es','et','fi','fr','hu','ka','lt','pl','ru','se'] 
  • trunk/FieldsWidgets.py

    r2991 r3014  
    3232from mp3tool import get_length 
    3333from types import ListType, TupleType, StringType, UnicodeType, InstanceType 
    34 from Products.LeMill import LeMillMessageFactory as _ 
    35 from Products.CMFPlone import PloneMessageFactory as PMF 
     34from messagefactory_ import i18nme as _ 
     35 
    3636 
    3737import re 
     
    847847                    # Notice about new piece               
    848848                    if new_piece.isImage(): 
    849                         lt.addPortalMessage('Image uploaded')               
     849                        lt.addPortalMessage(_('Image uploaded'))               
    850850                    elif new_piece.isAudio(): 
    851                         lt.addPortalMessage('Audio clip uploaded')               
     851                        lt.addPortalMessage(_('Audio clip uploaded'))               
    852852                    elif new_piece.isSwf(): 
    853                         lt.addPortalMessage('Flash animation uploaded')               
     853                        lt.addPortalMessage(_('Flash animation uploaded'))               
    854854                    elif new_piece.isMovie(): 
    855                         lt.addPortalMessage('Video clip uploaded')               
     855                        lt.addPortalMessage(_('Video clip uploaded'))               
    856856                    elif new_piece.isFLVVideo(): 
    857                         lt.addPortalMessage('Flash video uploaded')               
     857                        lt.addPortalMessage(_('Flash video uploaded'))               
    858858                    else: 
    859                         lt.addPortalMessage('Cannot display this file type') 
     859                        lt.addPortalMessage(_('Cannot display this file type')) 
    860860                         
    861861            validator=self.chapter_validation.get(chapter_type, self.isString) 
  • trunk/GroupBlog.py

    r2983 r3014  
    2424from Products.CMFCore.utils import getToolByName 
    2525from AccessControl import ClassSecurityInfo, Unauthorized 
    26 from Products.LeMill import LeMillMessageFactory as _ 
     26from messagefactory_ import i18nme as _ 
    2727from LargeSectionFolder import LeMillFolder 
    2828from Products.CMFPlone.PloneBatch import Batch 
     
    350350        ltool= getToolByName(self, 'lemill_tool') 
    351351        if lutool.isAnonymousUser(): 
    352             msg= _(u"You have to be logged in to join a group.") 
    353             ltool.addPortalMessage(u"You have to be logged in to join a group.") 
     352            ltool.addPortalMessage(_("You have to be logged in to join a group.")) 
    354353            return self.REQUEST.RESPONSE.redirect(self.absolute_url())             
    355354        userid = lutool.getAuthenticatedId()                 
    356355        if self.addMember(userid): 
    357             ltool.addPortalMessage("text_message_joined_the_group", default="You have joined the group '${title}'.", mapping={'title':self.title_or_id()}) 
     356            ltool.addPortalMessage(_("text_message_joined_the_group"), default="You have joined the group '${title}'.", mapping={'title':self.title_or_id()}) 
    358357            self.notifyGroupJoin() 
    359358        else: 
    360             ltool.addPortalMessage("You are already member in this group.") 
     359            ltool.addPortalMessage(_("You are already member in this group.")) 
    361360        if redirect: 
    362361            return self.REQUEST.RESPONSE.redirect(self.absolute_url()) 
     
    369368        userid = lutool.getAuthenticatedId()         
    370369        if self.removeMember(userid): 
    371             ltool.addPortalMessage("text_message_left_the_group", default="You have left the group '${title}'." , mapping={'title':self.title_or_id()}) 
     370            ltool.addPortalMessage(_("text_message_left_the_group"), default="You have left the group '${title}'." , mapping={'title':self.title_or_id()}) 
    372371        else: 
    373             ltool.addPortalMessage("You are not member in this group.") 
     372            ltool.addPortalMessage(_("You are not member in this group.")) 
    374373        return REQUEST.RESPONSE.redirect(self.community.absolute_url()) 
    375374 
  • trunk/LeMillTool.py

    r3002 r3014  
    3232import time, re, sys 
    3333import cStringIO 
    34 from Products.LeMill import LeMillMessageFactory as _ 
     34#from Products.LeMill import LeMillMessageFactory as _ 
    3535import ZTUtils 
    3636from Products.PlacelessTranslationService import isRTL 
     
    4343import calendar 
    4444from Products.ZCatalog.Lazy import LazyCat 
     45from messagefactory_ import i18nme as _ 
    4546 
    4647 
     
    157158DANGEROUS_CHARS_REGEX = re.compile(r"[?&/:\\#]+") 
    158159EXTRA_DASHES_REGEX = re.compile(r"(^\-+)|(\-+$)") 
    159  
    160160 
    161161 
     
    10251025                    msg=True 
    10261026        if msg: 
    1027             self.addPortalMessage("Added tags and/or renamed pieces. Thank you for helping LeMill!") 
     1027            self.addPortalMessage(_("Added tags and/or renamed pieces. Thank you for helping LeMill!")) 
    10281028        return self.REQUEST.RESPONSE.redirect(REQUEST.get('HTTP_REFERER')) 
    10291029 
     
    12381238        return split_results 
    12391239     
    1240     def getMaterialTypes(self):  
    1241         """ returns a list of material types """  
    1242         return MATERIAL_TYPES  
     1240    def getMaterialTypes(self, no_references=False): 
     1241        """ returns a list of material types """ 
     1242        if no_references: 
     1243            return [x for x in MATERIAL_TYPES if x!='LeMillReference'] 
     1244        else: 
     1245            return MATERIAL_TYPES 
    12431246 
    12441247    def getSearchableTypes(self): 
     
    15551558-- 
    15561559Do not reply to this message. You can find this person's contact information from LeMill.""",domain="lemill",target_language=language) % {'msg':msg, 'preferences_url':preferences_url} 
    1557         try: 
    1558             mhost.secureSend(mbody.encode('utf-8'),  
    1559                 mto=recipient,  
    1560                 mfrom="LeMill <no-reply@lemill.net>",  
    1561                 subject="Announcement from LeMill (do not reply)",  
    1562                 charset='utf-8') 
    1563         except: 
    1564             print "Something is wrong, no message sent" 
     1560        #try: 
     1561        mhost.secureSend(mbody.encode('utf-8'),  
     1562            mto=recipient,  
     1563            mfrom="LeMill <no-reply@lemill.net>",  
     1564            subject="Announcement from LeMill (do not reply)",  
     1565            charset='utf-8') 
     1566        #except: 
     1567        #    print "Something is wrong, no message sent" 
    15651568 
    15661569    def shortenTitle(self, title, max_length): 
  • trunk/LearningResource.py

    r2998 r3014  
    2020from Products.CMFCore.utils import getToolByName 
    2121from AccessControl import ClassSecurityInfo, Unauthorized 
    22 from Products.LeMill import LeMillMessageFactory as _ 
    23 from Products.CMFPlone import PloneMessageFactory as PMF 
     22from messagefactory_ import i18nme as _ 
    2423from permissions import ModerateContent, MODIFY_CONTENT, DELETE_CONTENT, MANAGE_PORTAL, ACCESS_CONTENT, VIEW, ADD_CONTENT_PERMISSION 
    2524from Products.CMFPlone.utils import transaction_note 
     
    291290                    old_mother.removeFromTranslations(self.UID()) 
    292291            else: 
    293                 lt.addPortalMessage("text_message_type_mismatch_cant_translate", default="Type mismatch, cannot be translation of that kind of object.") 
     292                lt.addPortalMessage("Type mismatch, cannot be translation of that kind of object.") 
    294293        else: 
    295294            lt.addPortalMessage("Object not found.")         
  • trunk/MemberFolder.py

    r2998 r3014  
    3838    del languages 
    3939 
    40 from Products.LeMill import LeMillMessageFactory as _ 
     40from messagefactory_ import i18nme as _ 
    4141from FieldsWidgets import TagsField, TagsWidget, MessengerWidget, MobileWidget, LeTextAreaWidget, TwoColumnMultiSelectionWidget 
    4242from CommonMixIn import CommonMixIn, CoverImageMixIn 
     
    695695            self.setSlideshare_username(new_username) 
    696696        lt=getToolByName(self, 'lemill_tool') 
    697         lt.addPortalMessage('saved_slideshare_username', default='Saved SlideShare username.') 
     697        lt.addPortalMessage(_('Saved SlideShare username.')) 
    698698        return REQUEST.RESPONSE.redirect(self.content.absolute_url()+'/add_presentation') 
    699699 
  • trunk/Resource.py

    r3002 r3014  
    2424from config import MATERIAL_TYPES, TARGET_GROUP_TO_LRE_MAPPING, SUBJECT_AREA_TO_LRE_MAPPING, PORTAL_TYPE_TO_LRE_MAPPING, to_unicode 
    2525from persistent.list import PersistentList 
    26 from Products.LeMill import LeMillMessageFactory as _ 
    27 from Products.CMFPlone import PloneMessageFactory as PMF 
     26from messagefactory_ import i18nme as _ 
    2827from permissions import ModerateContent, MODIFY_CONTENT, DELETE_CONTENT, MANAGE_PORTAL, ACCESS_CONTENT, VIEW, ADD_CONTENT_PERMISSION 
    2928from DateTime import DateTime 
     
    4241# empty marker definition, used by _processForm 
    4342_marker = [] 
    44  
    4543 
    4644##################### Resource ##################################################### 
     
    816814        moved.unindexObject() 
    817815        lt=getToolByName(self, 'lemill_tool') 
    818         lt.addPortalMessage('Moved item to trash.') 
     816        lt.addPortalMessage(_('Moved item to trash.')) 
    819817        return REQUEST.RESPONSE.redirect(context.absolute_url()) 
    820818 
  • trunk/__init__.py

    r2948 r3014  
    5757else: 
    5858    LeMillMessageFactory = MessageFactory('lemill') 
     59 
     60from messagefactory_ import i18nme 
    5961 
    6062# Provide backward compatibility for products relying on this import location 
  • trunk/config.py

    r3001 r3014  
    4545# Load zope instance specific LeMill configuration from zope.conf: 
    4646from App import config as zconfig 
    47 lemill_config = zconfig.getConfiguration().product_config.get('lemill', {}) 
     47product_config=getattr(zconfig.getConfiguration(),'product_config', {}) 
     48lemill_config = product_config.get('lemill', {}) 
    4849 
    4950# Load recaptcha keys from zope.conf: 
  • trunk/deprecated/deprecated.py

    r2862 r3014  
    22# This file is for deprecated management methods that shouldn't be useful anymore but can be modified to serve some future purpose. 
    33# These methods can't be run, this is not valid python 
     4 
     5# from ConfigurationMethods 
     6 
     7def setupConfigureKupu(self, portal): 
     8    """ configure kupu """ 
     9    k = getToolByName(portal, 'kupu_library_tool') 
     10    k.configure_kupu(1, '',  #linkbyuid, table_classnames 
     11            [   # html exclusion. list tags you don't want to be in HTML code 
     12                {'tags':(), 
     13                 'attributes':'', 
     14                 'keep':1, 
     15                }, # list attributes you don't want in HTML code 
     16                {'tags':'', 
     17                 'attributes':'', 
     18                 'keep':1, 
     19                }, 
     20            ], 
     21            ['text-align', 'list-style-type'],   # style whitelist 
     22            [],  # class_blacklist 
     23            1,  # install before unload 
     24            ['Heading|h2', 'Code|pre'])   # Kupu can't handle 'code' 
     25    filters={} 
     26    visible=['bg-basicmarkup','bold-button','italic-button','bg-subsuper','subscript-button','superscript-button','bg-list','list-ol-addbutton','list-ul-addbutton','bg-drawers','linkdrawer-button','tabledrawer-button','source','styles'] 
     27 
     28    hidden=['bg-colorchooser','save-button','forecolor-button','hilitecolor-button','bg-justify','justifyleft-button','justifycenter-button','justifyright-button','definitionlist','bg-indent','outdent-button','indent-button','imagelibdrawer-button','linklibdrawer-button','embed-tab','anchors-button','manage-anchors-tab','toc-tab','bg-remove','removeimage-button','removelink-button','bg-undo','undo-button','redo-button','spellchecker','ulstyles','olstyles','zoom'] 
     29    visible=[{'id':button,'visible':True,'override':None} for button in visible] 
     30    hidden=[{'id':button,'visible':False,'override':None} for button in hidden] 
     31    k._setToolbarFilters(visible+hidden, None) 
     32 
     33 
     34# from ... 
    435 
    536    security.declareProtected(MANAGE_PORTAL, 'manage_cleanAfterSchemaUpdate') 
  • trunk/i18n/utils/updateTranslation.sh

    r2500 r3014  
    1515 
    1616# Extract data from live site 
    17 cd ../tests 
    18 ./runtests.sh extractTranslations.py 
    19 if [ -r lemill-generated.pot ]; then 
    20   echo "Site processed ok: " $(cat lemill-generated.pot|grep 'msgid'|wc -l) 
    21   mv lemill-generated.pot ../i18n 
    22   cd ../i18n 
    23 else 
    24   echo "Error processing site!" 
    25   exit 2 
    26 fi 
     17#cd ../tests 
     18#./runtests.sh extractTranslations.py 
     19#if [ -r lemill-generated.pot ]; then 
     20#  echo "Site processed ok: " $(cat lemill-generated.pot|grep 'msgid'|wc -l) 
     21#  mv lemill-generated.pot ../i18n 
     22#  cd ../i18n 
     23#else 
     24#  echo "Error processing site!" 
     25#  exit 2 
     26#fi 
    2727 
    2828cd .. 
     
    3232 
    3333# Filter Plone stuff out 
    34 PRODUCTS_FOLDER=$(pwd) 
    35 PRODUCTS_FOLDER=${PRODUCTS_FOLDER/\/LeMill\/i18n//} 
    36 i18ndude filter lemill-generated.pot ${PRODUCTS_FOLDER}PloneTranslations/i18n/plone.pot >lemill-generated2.pot || { echo "Problem filtering generated catalog!"; exit 3; } 
    37 echo "Skin catalog filtered with Plone: " $(cat lemill-generated2.pot|grep 'msgid'|wc -l) 
    38 rm lemill-generated.pot 
     34#PRODUCTS_FOLDER=$(pwd) 
     35#PRODUCTS_FOLDER=${PRODUCTS_FOLDER/\/LeMill\/i18n//} 
     36#i18ndude filter lemill-generated.pot ${PRODUCTS_FOLDER}PloneTranslations/i18n/plone.pot >lemill-generated2.pot || { echo "Problem filtering generated catalog!"; exit 3; } 
     37#echo "Skin catalog filtered with Plone: " $(cat lemill-generated2.pot|grep 'msgid'|wc -l) 
     38#rm lemill-generated.pot 
    3939 
    4040# Merge 
  • trunk/messagefactory_.py

    r1672 r3014  
    1414    return message 
    1515 
     16def i18nme(text): 
     17    """ This does nothing, but allow using pygettext to collect strings for i18n """ 
     18    return text 
     19 
     20_=i18nme 
  • trunk/skins/lemill/LRE-LOM.pt

    r2779 r3014  
    3333                BEGIN:VCARD 
    3434                VERSION:3.0 
    35                 N:<span tal:define="name python:person_md.getFull_name.split(' '); null python:name.reverse()" tal:replace="python:';'.join(name)" />; 
    36                 FN:<span tal:replace="person_md/getFull_name" /> 
     35                N:<span tal:define="name python:person_md.getNicename.split(' '); null python:name.reverse()" tal:replace="python:';'.join(name)" />; 
     36                FN:<span tal:replace="person_md/getNicename" /> 
    3737                END:VCARD 
    3838            </entity> 
  • trunk/skins/lemill/OAI-script.py

    r2881 r3014  
    245245        if userMD: 
    246246            userMD=userMD[0] 
    247             result.append(''.join(('<contribute><role><source>LOMv1.0</source><value>author</value></role><entity>BEGIN:VCARD\nVERSION:3.0\nN:',html_quote(userMD.getLastname),';',html_quote(userMD.getFull_name.split(' ')[0]),';;;\nFN:',html_quote(userMD.getNicename),'\nEND:VCARD</entity></contribute>'))) 
     247            names=userMD.getNicename.split(' ') 
     248            names.reverse() 
     249            names=';'.join(names) 
     250            result.append(''.join(('<contribute><role><source>LOMv1.0</source><value>author</value></role><entity>BEGIN:VCARD\nVERSION:3.0\nN:',html_quote(names),';;;\nFN:',html_quote(userMD.getNicename),'\nEND:VCARD</entity></contribute>'))) 
    248251    result.append(''.join(('</lifeCycle><metaMetadata><identifier><catalog>oai</catalog><entry>',obj.getId,'</entry></identifier><language>',language,'</language><metadataSchema>LREv3.0</metadataSchema></metaMetadata><technical><location>',obj.getURL(),'</location></technical><educational>'))) 
    249252    result.append('<learningResourceType><source>LREv3.0</source>') 
     
    291294        result.pop() 
    292295        raise ERROR_cannotDisseminateFormat 
    293     material = context.getSearchObject(portal_type = context.getMaterialTypes(), getState = ['public', 'draft'], getId = GenerateIdentifierFromOAIIdentifier(args['identifier'])) 
     296    material = context.getSearchObject(portal_type = context.getMaterialTypes(no_references=True), getState = ['public', 'draft'], getId = GenerateIdentifierFromOAIIdentifier(args['identifier'])) 
    294297    if not material: 
    295298        result.pop() 
     
    315318            raise ERROR_idDoesNotExist 
    316319        collection=collection[0].getObject() 
    317         return [x.UID() for x in collection.getContent() if x.portal_type in context.getMaterialTypes()] 
    318  
    319     query = {'portal_type':context.getMaterialTypes(), 'getState':['public','draft']}     
     320        return [x.UID() for x in collection.getContent() if x.portal_type in context.getMaterialTypes(no_references=True)] 
     321 
     322    query = {'portal_type':context.getMaterialTypes(no_references=True), 'getState':['public','draft']}     
    320323 
    321324    if args.has_key('resumptionToken'): 
     
    430433def ListMetadataFormats(): 
    431434    if args.has_key('identifier'): 
    432         materials = context.getSearchObject(portal_type = context.getMaterialTypes(), getState = ['public', 'draft'], getId = GenerateIdentifierFromOAIIdentifier(args['identifier'])) 
     435        materials = context.getSearchObject(portal_type = context.getMaterialTypes(no_references=True), getState = ['public', 'draft'], getId = GenerateIdentifierFromOAIIdentifier(args['identifier'])) 
    433436        if len(materials) == 0: 
    434437            result.pop() 
  • trunk/skins/lemill/collection_view.cpt

    r2890 r3014  
    7878 
    7979        <div> 
    80             <a href="RSS" tal:attributes="href string:${here_url}/RSS"><img i18n:domain="plone" i18n:attributes="title title_rss_feed; alt label_rss_feed;" 
     80            <a href="RSS" tal:attributes="href string:${here_url}/RSS"><img i18n:domain="plone" i18n:attributes="title title_rss_feed_for_collection; alt label_rss_feed;" 
    8181             tal:attributes="src string:$portal_url/rss.gif" 
    8282             src="rss.gif" 
  • trunk/skins/lemill/createObject.cpy

    r2883 r3014  
    1212from DateTime import DateTime 
    1313from Products.CMFPlone.utils import transaction_note 
    14 from Products.CMFPlone import PloneMessageFactory as _ 
     14from Products.LeMill import i18nme as gettext 
    1515from Products.CMFCore.utils import getToolByName 
    1616REQUEST=context.REQUEST 
     
    5151    o=getattr(real_context, new_id, None) 
    5252    if o: 
    53         lt.addPortalMessage('${tname} has been created.', mapping={'tname' : o.getTypeInfo().Title()}) 
     53        lt.addPortalMessage(gettext('${tname} has been created.'), mapping={'tname' : o.getTypeInfo().Title()}) 
    5454        transaction_note('Created %s with id %s in %s' % (o.getTypeInfo().getId(), new_id, real_context.absolute_url())) 
    5555         
  • trunk/skins/lemill/edit_scenes.cpt

    r2590 r3014  
    3737                <config id="image-size">large</config> 
    3838                </configset> 
     39 
    3940                </xml> 
    4041                </div> 
  • trunk/skins/lemill/front-page.pt

    r3001 r3014  
    1212            <div> 
    1313                <h1><img src="images/logo_content.png" alt="LeMill" width="112%"/></h1> 
    14                                 <p  i18n:translate="text_introduction_front-page_with_community"> 
     14                                <p  i18n:translate=""> 
    1515                                Web <span i18n:name="link_to_community_section"><a href="#" tal:attributes="href string:${portal_url}/community" i18n:translate="">community</a></span> for <strong>finding</strong>, <strong>authoring</strong> and <strong>sharing</strong> open educational resources 
    1616                </p> 
  • trunk/skins/lemill/getSectionColors.py

    r2885 r3014  
    1515     
    1616if path=='content': 
    17     colors= ('#77bb22', '#ccdd77') 
     17    dark= '#77bb22' 
     18    light= '#ccdd77' 
    1819elif path=='methods': 
    19     colors= ('#ff7700', '#ffff88') 
     20    dark= '#ff7700' 
     21    light= '#ffff88' 
    2022elif path=='tools': 
    21     colors= ('#666699', '#bbbbee') 
     23    dark= '#666699' 
     24    light= '#bbbbee' 
    2225elif path=='community': 
    23     colors= ('#77aabb', '#cceedd') 
     26    dark= '#77aabb' 
     27    light='#cceedd' 
    2428else: 
    25     colors= ('#77bb22', '#ccdd77') 
     29    dark= '#77bb22' 
     30    light= '#ccdd77' 
    2631 
    2732return """#tb-portal-header, #tb-portal-footer, #tb-portal-globalnav .selected, .tb-portlet, .portalMessage, h1, h2, h3, h4, h5, h6 { 
    28     border-color: %s;} 
    29 .portlet-title, .logo { background-color: %s; } 
    30 .portalMessage { background-color: %s; } 
    31 .kupu-tb { background-color: %s; border: 1px solid %s; } 
    32 .kupu-tb-buttons button { border: 1px solid %s; }         
    33 """ % (colors[0],colors[0],colors[1],colors[1],colors[0],colors[0]) 
     33    border-color: %(d)s;} 
     34.portlet-title, .logo { background-color: %(d)s; } 
     35.portalMessage { background-color: %(l)s; } 
     36.defaultSkin table.mceLayout {background:%(l)s; border:1px solid %(d)s;} 
     37.defaultSkin a.mceButtonEnabled:hover {border:1px solid %(d)s; background-color:%(d)s} 
     38.defaultSkin .mceButton {display:block; border:1px solid %(d)s; width:20px; height:20px} 
     39""" % {'d':dark,'l':light} 
  • trunk/skins/lemill/global_searchbox.pt

    r2967 r3014  
    88    <form name="searchform" 
    99          action="search" 
    10           onsubmit="return liveSearchSubmit();" 
    1110          tal:attributes="action string:${portal_url}/lemill_search_results" 
    1211          style="white-space:nowrap"> 
     
    2625                                   tabindex tabindex/next;" 
    2726                   class="searchbox" /> 
    28                        <button class="searchbutton" onclick="search_redirect();"><img src="images/search.png" class="smallicon" alt="Search" i18n:attributes="alt label_search" tal:attributes="src string:${portal_url}/images/search.png" /></button> 
     27                       <button class="searchbutton" type="submit" value="Search"><img src="images/search.png" class="smallicon" alt="Search" i18n:attributes="alt label_search" tal:attributes="src string:${portal_url}/images/search.png" /></button> 
    2928        <div class="LSResult" id="LSResult" style=""><div class="LSShadow" id="LSShadow"></div></div> 
    3029        </div> 
  • trunk/skins/lemill/go_back.cpy

    r2874 r3014  
    99##title=Go Back 
    1010## 
     11 
     12from Products.LeMill import i18nme as gettext 
    1113 
    1214obj_id=context.getId() 
     
    2123    ##context.remove_creation_mark() 
    2224    redirect_to = context.getFolderWhenPortalFactory().absolute_url() 
    23     context.lemill_tool.addPortalMessage('Resource cancelled.') 
     25    context.lemill_tool.addPortalMessage(gettext('Resource cancelled.')) 
    2426elif context.canDeleteOnCancel(): 
    2527    if translation_of: 
     
    2830        redirect_to = context.aq_parent.absolute_url() 
    2931    context.aq_parent.manage_delObjects([obj_id]) 
    30     context.lemill_tool.addPortalMessage('Resource cancelled.') 
     32    context.lemill_tool.addPortalMessage(gettext('Resource cancelled.')) 
    3133else: 
    3234    redirect_to = last_referer 
    33     context.lemill_tool.addPortalMessage('Edit cancelled') 
     35    context.lemill_tool.addPortalMessage(gettext('Edit cancelled')) 
    3436 
    3537kwargs = { 
  • trunk/skins/lemill/group_create_edit_script.cpy

    r2873 r3014  
    88##title=Edit user 
    99## 
     10from Products.LeMill import i18nme as gettext 
    1011from Products.LeMill import LeMillMessageFactory as _ 
    1112lt=context.lemill_tool 
     
    2223    if not addname: 
    2324        state.setError('title', _(u'This field is required, please provide some information.'), 'input_required') 
    24         lt.addPortalMessage('Please correct the indicated errors.') 
     25        lt.addPortalMessage(gettext('Please correct the indicated errors.')) 
    2526        return context.group_create() 
    2627    # else check does group with this id already exists 
    2728    elif context.getGroupById(addname): 
    2829        state.setError('title', _(u'Group with this name already exists, please choose a different name.'), 'input_required') 
    29         lt.addPortalMessage('Please correct the indicated errors.') 
     30        lt.addPortalMessage(gettext('Please correct the indicated errors.')) 
    3031        return context.group_create() 
    3132    addname=context.community.groups.invokeFactory('GroupBlog',addname) 
     
    3738    # Need to manually set _at_creation_flag to False, as processForm does not get called 
    3839    group.unmarkCreationFlag() 
    39     lt.addPortalMessage("Group has been created.") 
     40    lt.addPortalMessage(gettext("Group has been created.")) 
    4041elif groupname: 
    4142    group=context.getGroupById(groupname) 
     
    4647    # Need to manually set _at_creation_flag to False, as processForm does not get called 
    4748    group.unmarkCreationFlag() 
    48     lt.addPortalMessage('Changes saved.') 
     49    lt.addPortalMessage(gettext('Changes saved.')) 
    4950else: 
    50     lt.addPortalMessage('No change has been done.') 
     51    lt.addPortalMessage(gettext('No change has been done.')) 
    5152 
    5253 
  • trunk/skins/lemill/groupblog_view.pt

    r2982 r3014  
    114114 
    115115        <div> 
    116             <a href="RSS"><img i18n:domain="plone" i18n:attributes="title title_rss_feed; alt label_rss_feed;" 
     116            <a href="RSS"><img i18n:domain="plone" i18n:attributes="title title_rss_feed_for_group; alt label_rss_feed;" 
    117117             tal:attributes="src string:$portal_url/rss.gif" 
    118118             src="rss.gif" 
  • trunk/skins/lemill/join_form_validate.vpy

    r2874 r3014  
    99##title=validates the Registration of a User 
    1010 
    11 from Products.CMFPlone import PloneMessageFactory as _ 
     11from Products.LeMill import i18nme as gettext 
     12from Products.LeMill import LeMillMessageFactory as _ 
    1213 
    1314reg_tool=context.portal_registration 
     
    6465 
    6566if state.getErrors(): 
    66     context.lemill_tool.addPortalMessage('Please correct the indicated errors.') 
     67    context.lemill_tool.addPortalMessage(gettext('Please correct the indicated errors.')) 
    6768    return state.set(status='failure') 
    6869else: 
    69     context.lemill_tool.addPortalMessage('You have been registered.') 
     70    context.lemill_tool.addPortalMessage(gettext('You have been registered.')) 
    7071    return state 
  • trunk/skins/lemill/lemill_browse_macros.pt

    r3002 r3014  
    77       <tal:syndicate condition="syntool/isSiteSyndicationAllowed"> 
    88        <a href="" tal:attributes="href string:${request/URL1}/RSS?${request/QUERY_STRING}"> 
    9            <img i18n:domain="plone" i18n:attributes="title title_rss_feed; alt label_rss_feed;" 
     9           <img i18n:domain="plone" i18n:attributes="title title_rss_feed_for_search_results; alt label_rss_feed;" 
    1010             tal:attributes="src string:$portal_url/rss.gif" 
    1111             src="rss.gif" 
  • trunk/skins/lemill/lemill_recent_media.pt

    r2956 r3014  
    5555      <td tal:condition="nocall:real_obj"> 
    5656        <a href="" tal:attributes="href obj_url" class="browse_title_d" tal:content="name" /><br/> 
    57      <span i18n:translate="label_authors">Author</span>: 
     57     <span i18n:translate="label_author">Author</span>: 
    5858        <tal:loop tal:repeat="author authors"> 
    5959            <tal:def tal:define="homefolder python:context.lemill_usertool.getMemberFolderMetadata(author); homeurl homefolder/getURL|string:"> 
  • trunk/skins/lemill/logged_in.cpy

    r2874 r3014  
    1010## 
    1111 
    12 from Products.CMFPlone import PloneMessageFactory as _ 
     12from Products.LeMill import i18nme as gettext 
    1313REQUEST=context.REQUEST 
    1414 
     
    2020if lemill_usertool.isAnonymousUser(): 
    2121    REQUEST.RESPONSE.expireCookie('__ac', path='/') 
    22     context.lemill_tool.addPortalMessage('Login failed') 
     22    context.lemill_tool.addPortalMessage(gettext('Login failed')) 
    2323    return state.set(status='failure') 
    2424 
  • trunk/skins/lemill/mail_password.py

    r2874 r3014  
    88##parameters= 
    99 
    10 from Products.CMFPlone import PloneMessageFactory as _ 
     10from Products.LeMill import i18nme as gettext 
    1111REQUEST=context.REQUEST 
    1212userid = REQUEST.get('userid', '') 
  • trunk/skins/lemill/master.css

    r2885 r3014  
    3232 
    3333 
    34 h1, h2, h3, h4, h5, h6 { 
     34h1, h2, h3, h4, h5, h6, .preview_heading { 
    3535    color: black; 
    3636    background-color: transparent; 
     
    5656} 
    5757 
    58 h2 { 
     58h2{ 
    5959    font-size: 120%; 
    6060    border-bottom: none; 
     
    901901} 
    902902 
    903 iframe.kupu-editor-iframe { 
    904     height: 225px; 
    905     width: 99%; 
    906     padding: 0px 3px 0px 3px; 
    907 } 
    908 textarea.kupu-editor-textarea { 
    909     height: 225px; 
    910     width: 99%; 
    911     display: none; 
    912     padding: 3px; 
    913 } 
    914  
    915 iframe.kupu-linkdrawer-preview { 
    916     height: 0px !important; 
    917 } 
    918903 
    919904#archetypes-fieldname-description textarea { 
     
    12401225    text-decoration: none; 
    12411226} 
     1227 
     1228/* tinyMCE editor style */ 
     1229 
     1230/* Reset */ 
     1231.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} 
     1232 
     1233/* Containers */ 
     1234.defaultSkin {position:relative} 
     1235/*.defaultSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;} */ 
     1236.defaultSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;} 
     1237.defaultSkin .mceToolbar {height:24px;} 
     1238 
     1239/* Layout */ 
     1240.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} 
     1241.defaultSkin .mceIcon {background:url(images/icons.gif) no-repeat 20px 20px} 
     1242 
     1243/* Button */ 
     1244/*.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px} */ 
     1245/*.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} */ 
     1246.defaultSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0} 
     1247.defaultSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:alpha(opacity=30); filter:alpha(opacity=30)} 
     1248 
     1249/* Separator */ 
     1250.defaultSkin .mceSeparator {display:block; background:url(images/icons.gif) -280px 0; width:2px; height:20px; margin:0 2px 0 4px} 
     1251 
     1252/* Theme */ 
     1253.defaultSkin span.mce_bold {background-position:0 0} 
     1254.defaultSkin span.mce_italic {background-position:-60px 0} 
     1255.defaultSkin span.mce_underline {background-position:-120px 0} 
     1256.defaultSkin span.mce_strikethrough {background-position:-120px 0} 
     1257.defaultSkin span.mce_undo {background-position:-140px 0} 
     1258.defaultSkin span.mce_redo {background-position:-100px 0} 
     1259.defaultSkin span.mce_cleanup {background-position:-40px 0} 
     1260.defaultSkin span.mce_insertunorderedlist {background-position:-20px 0} 
     1261.defaultSkin span.mce_insertorderedlist {background-position:-80px 0} 
     1262.defaultSkin span.mce_subscript {background-position:-160px 0} 
     1263.defaultSkin span.mce_superscript {background-position:-180px 0} 
     1264.defaultSkin span.mce_link {background-position:-200px 0} 
     1265.defaultSkin span.mce_unlink {background-position:-220px 0} 
     1266.defaultSkin span.mce_table {background-position:-240px 0} 
     1267.defaultSkin span.mce_html {background-position:-260px 0} 
     1268 
     1269/* ListBox */ 
     1270.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} 
     1271.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} 
     1272.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} 
     1273.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} 
     1274.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} 
     1275.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} 
     1276.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} 
     1277.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} 
     1278.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} 
     1279.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} 
     1280 
     1281/* Menu */ 
     1282.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} 
     1283.defaultSkin .mceNoIcons span.mceIcon {width:0;} 
     1284.defaultSkin .mceNoIcons a .mceText {padding-left:10px} 
     1285.defaultSkin .mceMenu table {background:#FFF} 
     1286.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} 
     1287.defaultSkin .mceMenu td {height:20px} 
     1288.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} 
     1289.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} 
     1290.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} 
     1291.defaultSkin .mceMenu pre.mceText {font-family:Monospace} 
     1292.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} 
     1293.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} 
     1294.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} 
     1295.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} 
     1296.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} 
     1297.defaultSkin .mceMenuItemDisabled .mceText {color:#888} 
     1298.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} 
     1299.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} 
     1300.defaultSkin .mceMenu span.mceMenuLine {display:none} 
     1301.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} 
     1302 
     1303 
     1304.defaultSkin span.mceText {color: black; text-decoration: none; font-size: 13px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;} 
     1305.defaultSkin .preview_heading span.mceText {font-size: 120%;font-weight: bold;} 
     1306.defaultSkin .preview_code span.mceText {font-family: Monaco, "Courier New", Courier, monospace;font-size: 100%; color: black; background-color: #dee7ec;} 
     1307 
     1308 
  • trunk/skins/lemill/master.js

    r2999 r3014  
    4141/* Livesearch */  
    4242 
    43 function search_redirect () { 
    44     if (document.searchform.SearchableText.value == "") { 
    45         document.searchform.action = "lemill_search_form"; 
    46         document.searchform.submit(); 
    47     } else 
    48         document.searchform.submit(); 
    49 } 
    50 /* 
    51 // +----------------------------------------------------------------------+ 
    52 // | Copyright (c) 2004 Bitflux GmbH                                      | 
    53 // +----------------------------------------------------------------------+ 
    54 // | Licensed under the Apache License, Version 2.0 (the "License");      | 
    55 // | you may not use this file except in compliance with the License.     | 
    56 // | You may obtain a copy of the License at                              | 
    57 // | http://www.apache.org/licenses/LICENSE-2.0                           | 
    58 // | Unless required by applicable law or agreed to in writing, software  | 
    59 // | distributed under the License is distributed on an "AS IS" BASIS,    | 
    60 // | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or      | 
    61 // | implied. See the License for the specific language governing         | 
    62 // | permissions and limitations under the License.                       | 
    63 // +----------------------------------------------------------------------+ 
    64 // | Author: Bitflux GmbH <devel@bitflux.ch>                              | 
    65 // +----------------------------------------------------------------------+ 
    66 */ 
    67  
    68 var liveSearchReq = false; 
    69 var t = null; 
    70 var liveSearchLast = ""; 
    71 var queryTarget = "livesearch_reply?q="; 
    72  
    73 var searchForm = null; 
    74 var searchInput = null; 
    75  
    76 var isIE = false; 
    77  
    78 var _cache = new Object(); 
    79  
    80 var widthOffset = 1; 
    81  
    82 function calculateWidth() { 
    83 } 
    84  
    85 function getElementDimensions(elemID) { 
    86     var base = document.getElementById(elemID); 
    87     var offsetTrail = base; 
    88     var offsetLeft = 0; 
    89     var offsetTop = 0; 
    90     var width = 0; 
    91  
    92     while (offsetTrail) { 
    93         offsetLeft += offsetTrail.offsetLeft; 
    94         offsetTop += offsetTrail.offsetTop; 
    95         offsetTrail = offsetTrail.offsetParent; 
    96     } 
    97     if (navigator.userAgent.indexOf("Mac") != -1 && 
    98         typeof document.body.leftMargin != "undefined") { 
    99         offsetLeft += document.body.leftMargin; 
    100         offsetTop += document.body.topMargin; 
    101     } 
    102     if (!isIE) 
    103         width = searchInput.offsetWidth-widthOffset*2; 
    104     else 
    105         width = searchInput.offsetWidth; 
    106     return { left: offsetLeft, 
    107              top: offsetTop, 
    108              width: width, 
    109              height: base.offsetHeight, 
    110              bottom: offsetTop + base.offsetHeight, 
    111              right: offsetLeft + width}; 
    112 } 
    113  
    114 function liveSearchInit() { 
    115     searchInput = document.getElementById('searchGadget'); 
    116     if (searchInput == null || searchInput == undefined) 
    117         return 
    118     // Only keypress catches repeats in moz/FF but keydown is needed for 
    119     // khtml based browsers. 
    120     if (navigator.userAgent.indexOf("KHTML") > 0) { 
    121         searchInput.addEventListener("keydown",liveSearchKeyPress,false); 
    122         searchInput.addEventListener("focus",liveSearchDoSearch,false); 
    123         searchInput.addEventListener("keydown",liveSearchStart, false); 
    124         searchInput.addEventListener("blur",liveSearchHideDelayed,false); 
    125     } else if (searchInput.addEventListener) { 
    126         searchInput.addEventListener("keypress",liveSearchKeyPress,false); 
    127         searchInput.addEventListener("blur",liveSearchHideDelayed,false); 
    128         searchInput.addEventListener("keypress",liveSearchStart, false); 
    129     } else { 
    130         searchInput.attachEvent("onkeydown",liveSearchKeyPress); 
    131         searchInput.attachEvent("onkeydown",liveSearchStart); 
    132         searchInput.attachEvent("onblur",liveSearchHideDelayed); 
    133         isIE = true; 
    134     } 
    135  
    136     // Why doesn't this work in konq, setting it inline does. 
    137     searchInput.setAttribute("autocomplete", "off"); 
    138     var pos = getElementDimensions('searchGadget'); 
    139     result = document.getElementById('LSResult'); 
    140     if ((typeof result.offsetParent != 'undefined') && (result.offsetParent != null)) { 
    141         pos.left = pos.left - result.offsetParent.offsetLeft + pos.width; 
    142     } else { 
    143         pos.left = pos.left + pos.width; 
    144     } 
    145     result.style.display = 'none'; 
    146 } 
    147  
    148  
    149 function liveSearchHideDelayed() { 
    150     window.setTimeout("liveSearchHide()", 400); 
    151 } 
    152  
    153 function liveSearchHide() { 
    154     document.getElementById("LSResult").style.display = "none"; 
    155     var highlight = document.getElementById("LSHighlight"); 
    156     if (highlight) 
    157         highlight.removeAttribute("id"); 
    158 } 
    159  
    160 function getFirstHighlight() { 
    161     var set = getHits(); 
    162     return set[0]; 
    163 } 
    164  
    165 function getLastHighlight() { 
    166     var set = getHits(); 
    167     return set[set.length-1]; 
    168 } 
    169  
    170 function getHits() { 
    171     var res = document.getElementById("LSShadow"); 
    172     var set = res.getElementsByTagName('li'); 
    173     return set; 
    174 } 
    175  
    176 function findChild(object, specifier) { 
    177     var cur = object.firstChild; 
    178     try { 
    179         while (cur != undefined) { 
    180             cur = cur.nextSibling; 
    181             if (specifier(cur) == true) 
    182                 return cur; 
     43var jq = jQuery; // XXX, rewrite so we don't need this 
     44var livesearch = function (){ 
     45 
     46    // Delay in milliseconds until the search starts after the last key was 
     47    // pressed. This keeps the number of requests to the server low. 
     48    var _search_delay = 400; 
     49    // Delay in milliseconds until the results window closes after the 
     50    // searchbox looses focus. 
     51    var _hide_delay = 400; 
     52 
     53    // stores information for each searchbox on the page 
     54    var _search_handlers = {}; 
     55 
     56    // constants for better compression 
     57    var _LSHighlight = "LSHighlight"; 
     58 
     59    function _searchfactory($form, $inputnode) { 
     60        // returns the search functions in a dictionary. 
     61        // we need a factory to get a local scope for the event, this is 
     62        // necessary, because IE doesn't have a way to get the target of 
     63        // an event in a way we need it. 
     64        var $lastsearch = null; 
     65        var $request = null; 
     66        var $cache = {}; 
     67        var $querytarget = "livesearch_reply"; 
     68        var $querytarget = $form.attr('action').replace(/lemill_search_results$/g,"") + $querytarget; 
     69        var $$result = $form.find('div.LSResult'); 
     70        var $shadow = $form.find('div.LSShadow'); 
     71        var $path = $form.find('input[name=path]'); 
     72 
     73        function _hide() { 
     74            // hides the result window 
     75            $$result.hide(); 
     76            $lastsearch = null; 
     77        }; 
     78 
     79        function _hide_delayed() { 
     80            // hides the result window after a short delay 
     81            window.setTimeout( 
     82                'livesearch.hide("' + $form.attr('id') + '")', 
     83                _hide_delay); 
     84        }; 
     85 
     86        function _show($data) { 
     87            // shows the result 
     88            $$result.show(); 
     89            $shadow.html($data); 
     90        }; 
     91 
     92        function _search() { 
     93            // does the actual search 
     94            if ($lastsearch == $inputnode.value) { 
     95                // do nothing if the input didn't change 
     96                return; 
     97            } 
     98            $lastsearch = $inputnode.value; 
     99             
     100            if ($request && $request.readyState < 4) 
     101                // abort any pending request 
     102                $request.abort(); 
     103                 
     104            // Do nothing as long as we have less then two characters -  
     105            // the search results makes no sense, and it's harder on the server. 
     106            if ($inputnode.value.length < 2) { 
     107                _hide(); 
     108                return; 
     109            } 
     110             
     111            var $$query = { q: $inputnode.value }; 
     112            if ($path.length && $path[0].checked) 
     113                $$query['path'] = $path.val(); 
     114            // turn into a string for use as a cache key 
     115            $$query = jq.param($$query); 
     116 
     117            // check cache 
     118            if ($cache[$$query]) { 
     119                _show($cache[$$query]); 
     120                return; 
     121            } 
     122 
     123            // the search request (retrieve as text, not a document) 
     124            $request = jq.get($querytarget, $$query, function($data) { 
     125                // show results if there are any and cache them 
     126                _show($data); 
     127                $cache[$$query] = $data; 
     128            }, 'text'); 
     129        }; 
     130 
     131        function _search_delayed() { 
     132            // search after a small delay, used by onfocus 
     133            window.setTimeout( 
     134                'livesearch.search("' + $form.attr('id') + '")',  
     135                _search_delay); 
     136        }; 
     137 
     138        return { 
     139            hide: _hide, 
     140            hide_delayed: _hide_delayed, 
     141            search: _search, 
     142            search_delayed: _search_delayed 
     143        }; 
     144    }; 
     145 
     146    function _keyhandlerfactory($form) { 
     147        // returns the key event handler functions in a dictionary. 
     148        // we need a factory to get a local scope for the event, this is 
     149        // necessary, because IE doesn't have a way to get the target of 
     150        // an event in a way we need it. 
     151        var $timeout = null; 
     152        var $$result = $form.find('div.LSResult'); 
     153        var $shadow = $form.find('div.LSShadow'); 
     154 
     155        function _keyUp() { 
     156            // select the previous element 
     157            $cur = $shadow.find('li.LSHighlight').removeClass(_LSHighlight); 
     158            $prev = $cur.prev('li'); 
     159            if (!$prev.length) $prev = $shadow.find('li:last'); 
     160            $prev.addClass(_LSHighlight); 
     161            return false; 
     162        }; 
     163 
     164        function _keyDown() { 
     165            // select the next element 
     166            $cur = $shadow.find('li.LSHighlight').removeClass(_LSHighlight); 
     167            $next = $cur.next('li'); 
     168            if (!$next.length) $next = $shadow.find('li:first'); 
     169            $next.addClass(_LSHighlight); 
     170            return false; 
     171        }; 
     172 
     173        function _keyEscape() { 
     174            // hide results window 
     175            $shadow.find('li.LSHighlight').removeClass(_LSHighlight); 
     176            $$result.hide(); 
     177        }; 
     178 
     179        function _handler($event) { 
     180            // dispatch to specific functions and handle the search timer 
     181            window.clearTimeout($timeout); 
     182            switch ($event.keyCode) { 
     183                case 38: return _keyUp(); 
     184                case 40: return _keyDown(); 
     185                case 27: return _keyEscape(); 
     186                case 37: break; // keyLeft 
     187                case 39: break; // keyRight 
     188                default: { 
     189                    $timeout = window.setTimeout( 
     190                        'livesearch.search("' + $form.attr('id') + '")', 
     191                        _search_delay); 
     192                } 
     193            } 
     194        }; 
     195 
     196        function _submit() { 
     197            // check whether a search result was selected with the keyboard 
     198            // and open it 
     199            var $target = $shadow.find('li.LSHighlight a').attr('href'); 
     200            if (!$target) return; 
     201            window.location = $target; 
     202            return false; 
     203        }; 
     204 
     205        return { 
     206            handler: _handler, 
     207            submit: _submit 
     208        }; 
     209    }; 
     210 
     211    function _setup(i) { 
     212        // add an id which is used by other functions to find the correct node 
     213        var $id = 'livesearch' + i; 
     214        var $form = jq(this).closest('form'); 
     215        var $key_handler = _keyhandlerfactory($form); 
     216        _search_handlers[$id] = _searchfactory($form, this); 
     217 
     218        $form.attr('id', $id).css('white-space', 'nowrap').submit($key_handler.submit); 
     219        jq(this).attr('autocomplete','off') 
     220               .keydown($key_handler.handler) 
     221               .focus(_search_handlers[$id].search_delayed) 
     222               .blur(_search_handlers[$id].hide_delayed); 
     223    }; 
     224 
     225    jq(function() { 
     226        // find all search fields and set them up 
     227        jq("#searchGadget,input.portlet-search-gadget").each(_setup); 
     228    }); 
     229 
     230    return { 
     231        search: function(id) { 
     232            _search_handlers[id].search(); 
     233        }, 
     234        hide: function(id) { 
     235            _search_handlers[id].hide(); 
    183236        } 
    184     } catch(e) {}; 
    185     return null; 
    186 } 
    187  
    188 function findNext(object, specifier) { 
    189     var cur = object; 
    190     try { 
    191         while (cur != undefined) { 
    192             cur = cur.nextSibling; 
    193             if (cur.nodeType==3) 
    194                 cur=cur.nextSibling; 
    195             if (cur != undefined) { 
    196                 if (specifier(cur) == true) 
    197                     return cur; 
    198             } else { break; } 
    199         } 
    200     } catch(e) {}; 
    201     return null; 
    202 } 
    203  
    204 function findPrev(object, specifier) { 
    205     var cur = object; 
    206     try { 
    207         cur = cur.previousSibling; 
    208         if (cur.nodeType == 3) 
    209             cur = cur.previousSibling; 
    210         if (cur != undefined) { 
    211             if (specifier(cur) == true) 
    212                 return cur; 
    213         } 
    214     } catch(e) {}; 
    215     return null; 
    216 } 
    217  
    218 function liveSearchKeyPress(event) { 
    219     var highlight = document.getElementById("LSHighlight"); 
    220     if (event.keyCode == 40 ) 
    221     //KEY DOWN 
    222     { 
    223         if (!highlight) { 
    224             highlight = getFirstHighlight(); 
    225         } else { 
    226             highlight.removeAttribute("id"); 
    227             highlight = findNext(highlight, function (o) {return o.className =="LSRow";}); 
    228         } 
    229         if (highlight) 
    230             highlight.setAttribute("id","LSHighlight"); 
    231         if (!isIE) 
    232             event.preventDefault(); 
    233     } 
    234     //KEY UP 
    235     else if (event.keyCode == 38 ) { 
    236         if (!highlight) { 
    237             highlight = getLastHighlight(); 
    238         } 
    239         else { 
    240             highlight.removeAttribute("id"); 
    241             highlight = findPrev(highlight, function (o) {return o.className=='LSRow';}); 
    242         } 
    243         if (highlight) 
    244             highlight.setAttribute("id","LSHighlight"); 
    245         if (!isIE) 
    246             event.preventDefault(); 
    247     } 
    248     //ESC 
    249     else if (event.keyCode == 27) { 
    250         if (highlight) 
    251             highlight.removeAttribute("id"); 
    252         document.getElementById("LSResult").style.display = "none"; 
    253     } 
    254 } 
    255  
    256 function liveSearchStart(event) { 
    257     if (t) { 
    258         window.clearTimeout(t); 
    259     } 
    260     var code = event.keyCode; 
    261     if (code!=40 && code!=38 && code!=27 && code!=37 && code!=39) { 
    262         t = window.setTimeout("liveSearchDoSearch()", 200); 
    263     } 
    264 } 
    265  
    266 function liveSearchDoSearch() { 
    267     if (typeof liveSearchRoot == "undefined") { 
    268         if (typeof portal_url == "undefined") { 
    269             liveSearchRoot = ""; 
    270         } else { 
    271             if (portal_url[portal_url.length-1] == '/') { 
    272                 liveSearchRoot = portal_url; 
    273             } else { 
    274                 liveSearchRoot = portal_url + '/'; 
    275             } 
    276         } 
    277     } 
    278     if (typeof liveSearchRootSubDir == "undefined") { 
    279         liveSearchRootSubDir = ""; 
    280     } 
    281     if (liveSearchLast != searchInput.value) { 
    282         if (liveSearchReq && liveSearchReq.readyState < 4) { 
    283             liveSearchReq.abort(); 
    284         } 
    285         if ( searchInput.value == "") { 
    286             liveSearchHide(); 
    287             return false; 
    288         } 
    289         // Do nothing as long as we have less then two characters - 
    290         // the search results makes no sense, and it's harder on the server. 
    291         if ( searchInput.value.length < 2) { 
    292             liveSearchHide(); 
    293             return false; 
    294         } 
    295         // Do we have cached results 
    296         var result = _cache[searchInput.value]; 
    297         if (result) { 
    298             showResult(result); 
    299             return; 
    300         } 
    301         liveSearchReq = new XMLHttpRequest(); 
    302         liveSearchReq.onreadystatechange = liveSearchProcessReqChange; 
    303         // Need to use encodeURIComponent instead of encodeURI, to escape + 
    304         liveSearchReq.open("GET", liveSearchRoot + queryTarget + encodeURIComponent(searchInput.value)); 
    305         liveSearchLast = searchInput.value; 
    306         liveSearchReq.send(null); 
    307     } 
    308 } 
    309  
    310 function showResult(result) { 
    311     var res = document.getElementById("LSResult"); 
    312     res.style.display = "block"; 
    313     var sh = document.getElementById("LSShadow"); 
    314     sh.innerHTML = result; 
    315 } 
    316  
    317 function liveSearchProcessReqChange() { 
    318     if (liveSearchReq.readyState == 4) { 
    319         try { 
    320             if (liveSearchReq.status > 299 || liveSearchReq.status < 200  || 
    321                 liveSearchReq.responseText.length < 10) 
    322                 return; 
    323         } catch(e) { 
    324             return; 
    325         } 
    326         showResult(liveSearchReq.responseText); 
    327         _cache[liveSearchLast] = liveSearchReq.responseText; 
    328     } 
    329 } 
    330  
    331 function liveSearchSubmit() { 
    332     var highlight = document.getElementById("LSHighlight"); 
    333     if (highlight) { 
    334         var targets = highlight.getElementsByTagName('a'); 
    335         if (targets.length == 0) 
    336             return true; 
    337         var target = targets[0].href; 
    338         if (!target) 
    339             return true; 
    340         if ((liveSearchRoot.length > 0) && (target.substring(0, liveSearchRoot.length) != liveSearchRoot)) { 
    341             window.location = liveSearchRoot + liveSearchRootSubDir + target; 
    342         } else { 
    343             window.location = target; 
    344         } 
    345         return false; 
    346     } else { 
    347         return true; 
    348     } 
    349 } 
    350  
    351 if (window.addEventListener) 
    352     window.addEventListener("load", liveSearchInit, false); 
    353 else if (window.attachEvent) 
    354     window.attachEvent("onload", liveSearchInit); 
     237    }; 
     238}(); 
     239 
    355240 
    356241 
     
    440325} 
    441326 
    442 var list_expanded=false; 
    443 function listtoggle(){ 
    444         var rlist="resource_list"; 
    445         var views_menu="views_menu"; 
    446     if(!list_expanded){ 
    447         document.getElementById(rlist).className="expanded"; 
    448         document.getElementById(views_menu).selectedIndex=1; 
    449         list_expanded=true; 
    450     }else{ 
    451         document.getElementById(rlist).className="cover"; 
    452         document.getElementById(views_menu).selectedIndex=0; 
    453         list_expanded=false; 
    454     } 
    455 } 
    456  
    457 function show_div(divid) 
    458 { 
    459     document.getElementById(divid).style.display = 'block'; 
    460 } 
    461  
    462 function hide_div(divid) 
    463 { 
    464     document.getElementById(divid).style.display = 'none'; 
    465 } 
    466  
    467 function next(id) 
    468 { 
    469     steps=['selection']; 
    470     for (i=0; i<steps.length; i=i+1){ 
    471         setIdProperty(steps[i], "display", "none"); 
    472     } 
    473     setIdProperty(id, "display", "block"); 
    474 } 
    475  
    476 /* 
    477  * Functions that get or set some properties 
    478  */ 
    479  
    480 function setIdProperty( id, property, value ){ 
    481     if (isNav6){ 
    482         var styleObject = document.getElementById( id ); 
    483         if (styleObject != null){ 
    484             styleObject = styleObject.style; 
    485             styleObject[ property ] = value; 
    486         } 
    487     } 
    488     else if (isNav4){ 
    489         document[id][property] = value; 
    490     } 
    491     else if (isIE4){ 
    492         document.all[id].style[property] = value; 
    493     } 
    494 } 
    495  
    496 function getIdProperty( id, property ) 
    497 { 
    498     if (isNav6) 
    499     { 
    500         var styleObject = document.getElementById( id ); 
    501         if (styleObject != null) 
    502         { 
    503             styleObject = styleObject.style; 
    504             if (styleObject[property]) 
    505             { 
    506                 return styleObject[ property ]; 
    507             } 
    508         } 
    509         styleObject = getStyleBySelector( "#" + id ); 
    510         return (styleObject != null) ? 
    511             styleObject[property] : 
    512             null; 
    513     } 
    514     else if (isNav4) 
    515     { 
    516         return document[id][property]; 
    517     } 
    518     else 
    519     { 
    520         return document.all[id].style[property]; 
    521     } 
    522 } 
    523  
    524 function getStyleBySelector( selector ) 
    525 { 
    526     if (!isNav6) 
    527     { 
    528         return null; 
    529     } 
    530     var sheetList = document.styleSheets; 
    531     var ruleList; 
    532     var i, j; 
    533  
    534     /* look through stylesheets in reverse order that 
    535        they appear in the document */ 
    536     for (i=sheetList.length-1; i >= 0; i--) 
    537     { 
    538         ruleList = sheetList[i].cssRules; 
    539         for (j=0; j<ruleList.length; j++) 
    540         { 
    541             if (ruleList[j].type == CSSRule.STYLE_RULE || 
    542                     ruleList[j].selectorText == selector) 
    543             { 
    544                 return ruleList[j].style; 
    545             } 
    546         } 
    547     } 
    548     return null; 
    549 } 
    550  
    551 /* 
    552  * Functino that hides educational fields on base_metadata page 
    553  */ 
    554 function hide_educational() 
    555 { 
    556     change_educational('none', 'block') 
    557 } 
    558  
    559 function show_educational() 
    560 { 
    561     change_educational('block', 'none') 
    562 } 
    563  
    564 function change_educational(act1, act2) 
    565 { 
    566     document.getElementById('archetypes-fieldname-learningResourceType').style.display = act1; 
    567     document.getElementById('archetypes-fieldname-endUserRole').style.display = act1; 
    568     document.getElementById('archetypes-fieldname-learningContext').style.display = act1; 
    569     document.getElementById('archetypes-fieldname-educationalInfo').style.display = act2; 
    570 } 
    571  
    572 function setValue(elem_id, value) 
    573 { 
    574     document.getElementById(elem_id).value = value; 
    575 } 
     327/* Misc. functions */ 
    576328 
    577329var config_values = new Object; 
    578 function parseConfig() { 
    579     dataelem = document.getElementById('dataisland'); 
    580  
    581     eles = dataelem.getElementsByTagName('configset')[0]; 
    582     dataelem = eles; 
    583     for (var c=0; c<dataelem.childNodes.length; c++) 
    584     { 
    585         wele = dataelem.childNodes[c]; 
    586         if ( wele.nodeName.toLowerCase() == 'config' ) 
    587         { 
    588             config_values[wele.getAttribute('id')] = wele.childNodes[0].nodeValue; 
    589         } 
    590     } 
    591 } 
    592330 
    593331function getConfig(key) { 
    594332     
    595333    if ( !config_values[key] ) 
    596         parseConfig(); 
     334        $('#dataisland').find('config').each(function(){ 
     335            config_values[this.id]=this.text(); 
     336        }); 
    597337    return config_values[key]; 
    598338} 
     
    1060800} 
    1061801 
    1062  
    1063  
     802// Loader for tinyMCE 
     803 
     804(function(b){var e,d,a=[],c=window;b.fn.tinymce=function(j){var p=this,g,k,h,m,i,l="",n="";if(!p.length){return}if(!j){return tinyMCE.get(p[0].id)}function o(){var r=[],q=0;if(f){f();f=null}p.each(function(t,u){var s,w=u.id,v=j.oninit;if(!w){u.id=w=tinymce.DOM.uniqueId()}s=new tinymce.Editor(w,j);r.push(s);if(v){s.onInit.add(function(){var x,y=v;if(++q==r.length){if(tinymce.is(y,"string")){x=(y.indexOf(".")===-1)?null:tinymce.resolve(y.replace(/\.\w+$/,""));y=tinymce.resolve(y)}y.apply(x||tinymce,r)}})}});b.each(r,function(t,s){s.render()})}if(!c.tinymce&&!d&&(g=j.script_url)){d=1;h=g.substring(0,g.lastIndexOf("/"));if(/_(src|dev)\.js/g.test(g)){n="_src"}m=g.lastIndexOf("?");if(m!=-1){l=g.substring(m+1)}c.tinyMCEPreInit={base:h,suffix:n,query:l};if(g.indexOf("gzip")!=-1){i=j.language||"en";g=g+(/\?/.test(g)?"&":"?")+"js=true&core=true&suffix="+escape(n)+"&themes="+escape(j.theme)+"&plugins="+escape(j.plugins)+"&languages="+i;if(!c.tinyMCE_GZ){tinyMCE_GZ={start:function(){tinymce.suffix=n;function q(r){tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(r))}q("langs/"+i+".js");q("themes/"+j.theme+"/editor_template"+n+".js");q("themes/"+j.theme+"/langs/"+i+".js");b.each(j.plugins.split(","),function(s,r){if(r){q("plugins/"+r+"/editor_plugin"+n+".js");q("plugins/"+r+"/langs/"+i+".js")}})},end:function(){}}}}b.ajax({type:"GET",url:g,dataType:"script",cache:true,success:function(){tinymce.dom.Event.domLoaded=1;d=2;o();b.each(a,function(q,r){r()})}})}else{if(d===1){a.push(o)}else{o()}}};b.extend(b.expr[":"],{tinymce:function(g){return g.id&&!!tinyMCE.get(g.id)}});function f(){function i(l){if(l==="remove"){this.each(function(n,o){var m=h(o);if(m){m.remove()}})}this.find("span.mceEditor,div.mceEditor").each(function(n,o){var m=tinyMCE.get(o.id.replace(/_parent$/,""));if(m){m.remove()}})}function k(n){var m=this,l;if(n!==e){i.call(m);m.each(function(p,q){var o;if(o=tinyMCE.get(q.id)){o.setContent(n)}})}else{if(m.length>0){if(l=tinyMCE.get(m[0].id)){return l.getContent()}}}}function h(m){var l=null;(m)&&(m.id)&&(c.tinymce)&&(l=tinyMCE.get(m.id));return l}function g(l){return !!((l)&&(l.length)&&(c.tinymce)&&(l.is(":tinymce")))}var j={};b.each(["text","html","val"],function(n,l){var o=j[l]=b.fn[l],m=(l==="text");b.fn[l]=function(r){var p=this;if(!g(p)){return o.call(p,r)}if(r!==e){k.call(p.filter(":tinymce"),r);o.call(p.not(":tinymce"),r);return p}else{var q="";(m?p:p.eq(0)).each(function(t,u){var s=h(u);q+=s?(m?s.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):s.getContent()):o.call(b(u),r)});return q}}});b.each(["append","prepend"],function(n,m){var o=j[m]=b.fn[m],l=(m==="prepend");b.fn[m]=function(q){var p=this;if(!g(p)){return o.call(p,q)}if(q!==e){p.filter(":tinymce").each(function(s,t){var r=h(t);r&&r.setContent(l?q+r.getContent():r.getContent()+q)});o.call(p.not(":tinymce"),q);return p}}});b.each(["remove","replaceWith","replaceAll","empty"],function(m,l){var n=j[l]=b.fn[l];b.fn[l]=function(){i.call(this,l);return n.apply(this,arguments)}});j.attr=b.fn.attr;b.fn.attr=function(n,q,o){var m=this;if((!n)||(n!=="value")||(!g(m))){return j.attr.call(m,n,q,o)}if(q!==e){k.call(m.filter(":tinymce"),q);j.attr.call(m.not(":tinymce"),n,q,o);return m}else{var p=m[0],l=h(p);return l?l.getContent():j.attr.call(b(p),n,q,o)}}}})(jQuery); 
     805 
     806// Loading tinyMCE and setting it to class mceEditor 
     807 
     808$(function() { 
     809    $('textarea.mceEditor').tinymce({    
     810       script_url : 'tiny_mce/tiny_mce.js', 
     811       theme : "lemill", 
     812       content_css : "master.css", 
     813       plugins : "table"//inlinepopups", 
     814    }); 
     815}); 
     816 
     817 
  • trunk/skins/lemill/piece_edit.cpt

    r2929 r3014  
    6363        </tal:fields> 
    6464 
    65             <p i18n:translate="text_original_author_of_piece">If you are not the author of this piece you must add <span i18n:name="copyright_info"><a href="javascript:setIdProperty('copyright','display','block');" i18n:translate="text_snippet_copyright_information">copyright information</a></span></p> 
     65            <p i18n:translate="text_original_author_of_piece">If you are not the author of this piece you must add <span i18n:name="copyright_info"><a href="javascript:$('#copyright').toggle('slow');" i18n:translate="text_snippet_copyright_information">copyright information</a></span></p> 
    6666        <div id="copyright" style="display:none"> 
    6767            <metal:fieldMacro use-macro="python: here.widget('originalAuthor', mode='edit')"/> 
  • trunk/skins/lemill/piece_view.pt

    r2873 r3014  
    2121    </tal:block> 
    2222    <tal:noimageblock tal:condition="not:image"> 
    23     <script type="text/javascript" language="javascript" src="AC_RunActiveContent.js"></script> 
    2423    <tal:mp3block condition="mp3"> 
    2524        <img tal:condition="context/isAudio" 
  • trunk/skins/lemill/pilot_preview.pt

    r1897 r3014  
    1111                <a tal:attributes="href python:'%s/edit_scenes?edit=%s' % (here.absolute_url(), edit)" href="" i18n:translate="label_back_to_edit_scenes">Go back to edit scenes</a> 
    1212                </p> 
    13                 <script type="text/javascript" language="javascript" src="AC_RunActiveContent.js"></script>  
    1413                <tal:block tal:define="field python:here.getField('bodyText');"> 
    1514                            <metal:fieldMacro use-macro="python:here.widget(field.getName(), mode='view')" /> 
  • trunk/skins/lemill/plone_change_password.py

    r2874 r3014  
    1212from Products.CMFPlone import PloneMessageFactory as PMF 
    1313from Products.CMFPlone.utils import getToolByName 
     14from Products.LeMill import i18nme as gettext 
    1415 
    1516lutool=getToolByName(context, 'lemill_usertool') 
     
    2122 
    2223if REQUEST.form.has_key('cancel'): 
    23     lt.addPortalMessage('Password change was canceled.') 
     24    lt.addPortalMessage(gettext('Password change was canceled.')) 
    2425    return context.REQUEST.RESPONSE.redirect(home_url) 
    2526 
    2627 
    2728if not mt.testCurrentPassword(current): 
    28     lt.addPortalMessage('Does not match current password.') 
     29    lt.addPortalMessage(gettext('Does not match current password.')) 
    2930    return context.password_form(context, 
    3031                                 REQUEST, 
     
    4142    mt.setPassword(password, domains) 
    4243except AttributeError: 
    43     lt.addPortalMessage('While changing your password an AttributeError occurred.  This is usually caused by your user being defined outside the portal.') 
     44    lt.addPortalMessage(gettext('While changing your password an AttributeError occurred.  This is usually caused by your user being defined outside the portal.')) 
    4445    return context.password_form(context, 
    4546                                 REQUEST, 
     
    5152transaction_note('Changed password for %s' % (member.getUserName())) 
    5253 
    53 lt.addPortalMessage('Password changed.') 
     54lt.addPortalMessage(gettext('Password changed.')) 
    5455 
    5556return context.REQUEST.RESPONSE.redirect(home_url) 
  • trunk/skins/lemill/register.cpy

    r2909 r3014  
    1010## 
    1111 
    12 from Products.CMFPlone import PloneMessageFactory as _ 
     12from Products.LeMill import i18nme as gettext 
     13from Products.LeMill import LeMillMessageFactory as _ 
    1314from ZODB.POSException import ConflictError 
    1415 
     
    3334except AttributeError: 
    3435    state.setError('username', _(u'The login name you selected is already in use or is not valid. Please choose another.')) 
    35     lt.addPortalMessage('Please correct the indicated errors.') 
     36    lt.addPortalMessage(gettext('Please correct the indicated errors.')) 
    3637    return state.set(status='failure') 
    3738 
     
    6364        state.set(came_from='login_success') 
    6465        context.acl_users.userFolderDelUsers([username,],REQUEST=context.REQUEST) 
    65         lt.addPortalMessage('Please enter a valid email address.') 
     66        lt.addPortalMessage(gettext('Please enter a valid email address.')) 
    6667        return state.set(status='failure') 
    6768 
     
    6970 
    7071if came_from_prefs: 
    71     lt.addPortalMessage('User added.') 
     72    lt.addPortalMessage(gettext('User added.')) 
    7273    state.set(status='prefs') 
    7374 
  • trunk/skins/lemill/script_changeCoverImage.cpy

    r2962 r3014  
    1111 
    1212from Products.CMFCore.utils import getToolByName 
    13 from Products.LeMill import LeMillMessageFactory as _ 
     13from Products.LeMill import i18nme as gettext 
    1414file = REQUEST.get('file_file', None) 
    1515uid = REQUEST.get('bodyText_0', None) 
     
    1919# Does not let to publish the resource without providing a picture in lemill_ask_publish 
    2020if not file.filename and not uid and 'lemill_ask_publish' in theUrl and not context.getHasCoverImage(): 
    21     lt.addPortalMessage("You didn't choose an image.") 
     21    lt.addPortalMessage(gettext("You didn't choose an image.")) 
    2222    return state 
    2323 
    2424if not file and not uid and not context.getHasCoverImage(): 
    25     lt.addPortalMessage("You didn't choose an image.") 
     25    lt.addPortalMessage(gettext("You didn't choose an image.")) 
    2626    return state 
    2727 
     
    6464    # XXX Surely needed for: Tool, Method and Group 
    6565    context.reindexObject() 
    66     lt.addPortalMessage("Cover image changed.") 
     66    lt.addPortalMessage(gettext("Cover image changed.")) 
    6767else: 
    68     lt.addPortalMessage("Old cover image kept.") 
     68    lt.addPortalMessage(gettext("Old cover image kept.")) 
    6969return state 
  • trunk/skins/lemill/script_chapterController.cpy

    r2948 r3014  
    99## 
    1010 
    11 from Products.LeMill import LeMillMessageFactory as _ 
     11from Products.LeMill import i18nme as gettext 
    1212from Products.CMFCore.utils import getToolByName 
    1313lt=getToolByName(context, 'lemill_tool') 
     
    7474    mmedia=True 
    7575    granul=1 
    76     up_message='Moved chapter/piece up' 
    77     down_message='Moved chapter/piece down' 
    78     save_message='Chapter saved' 
     76    up_message=gettext('Moved chapter/piece up') 
     77    down_message=gettext('Moved chapter/piece down') 
     78    save_message=gettext('Chapter saved') 
    7979elif context.portal_type=='PILOTMaterial': 
    8080    pilot=True 
    8181    granul=3 
    8282    edit_page='edit_scenes'     
    83     up_message='Moved scene up' 
    84     down_message='Moved scene down' 
    85     save_message='Scene saved' 
     83    up_message=gettext('Moved scene up') 
     84    down_message=gettext('Moved scene down') 
     85    save_message=gettext('Scene saved') 
    8686elif context.portal_type=='ExerciseMaterial': 
    8787    exercise=True 
    8888    granul=1 
    89     up_message='Moved exercise portion up' 
    90     down_message='Moved exercise portion down' 
     89    up_message=gettext('Moved exercise portion up') 
     90    down_message=gettext('Moved exercise portion down') 
    9191    save_message='Exercise saved' 
    9292 
     
    9797if deleted_nr>-1 and 'del' in button: 
    9898    if 'delChapter' in button and pilot:     
    99         del_message='Scene removed' 
     99        del_message=gettext('Scene removed') 
    100100    elif 'delChapter' in button and (mmedia or exercise): 
    101         del_message='Chapter removed' 
     101        del_message=gettext('Chapter removed') 
    102102    else: 
    103103        delsize = 0 
     
    115115    if 'add_textareas' in button: 
    116116        edit_nr=context.getField('bodyText').add_new_chapter(context)      
    117         add_message='Added a new chapter' 
     117        add_message=gettext('Added a new chapter') 
    118118    elif 'add_mediapieces' in button: 
    119119        edit_nr=context.getField('bodyText').add_new_mediapiece(context)      
    120         add_message='Added a new media piece' 
     120        add_message=gettext('Added a new media piece') 
    121121    elif 'add_embedblocks' in button: 
    122122        edit_nr=context.getField('bodyText').add_new_chapter(context, [('','embed_block')]) 
    123         add_message='Added a new embed block' 
     123        add_message=gettext('Added a new embed block') 
    124124    elif 'add_scene' in button: 
    125125        edit_nr=context.getField('bodyText').add_new_scene(context) 
    126126        repairPilotOrder()      
    127         add_message='Added a new scene' 
     127        add_message=gettext('Added a new scene') 
    128128    elif 'add_exercise_textarea' in button: 
    129129        edit_nr=context.getField('bodyText').add_new_question(context,'text_block') 
    130         add_message='Added a new chapter' 
     130        add_message=gettext('Added a new chapter') 
    131131    elif 'add_exercise_mediapiece' in button: 
    132132        edit_nr=context.getField('bodyText').add_new_question(context,'media_piece') 
    133         add_message='Added a new media piece' 
     133        add_message=gettext('Added a new media piece') 
    134134    elif 'add_exercise_embedblock' in button: 
    135135        edit_nr=context.getField('bodyText').add_new_question(context,'embed_block') 
    136         add_message='Added a new embed block' 
     136        add_message=gettext('Added a new embed block') 
    137137    elif 'add_question' in button: 
    138138        questype = REQUEST.get('questiontype') 
    139139        if (questype == 'Multiple choice question'): 
    140140            edit_nr=context.getField('bodyText').add_new_question(context,'choice') 
    141             add_message='Added a new multiple choice question' 
     141            add_message=gettext('Added a new multiple choice question') 
    142142        elif (questype == 'Multiple response question'): 
    143143            edit_nr=context.getField('bodyText').add_new_question(context,'multiple_choices') 
    144             add_message='Added a new multiple response question' 
     144            add_message=gettext('Added a new multiple response question') 
    145145        elif (questype == 'Fill-in-the-blanks exercise'): 
    146146            edit_nr=context.getField('bodyText').add_new_question(context,'fill_in_the_blanks') 
    147             add_message='Added a new fill-in-the-blanks exercise' 
     147            add_message=gettext('Added a new fill-in-the-blanks exercise') 
    148148        if (questype == 'Open-ended question'): 
    149149            edit_nr=context.getField('bodyText').add_new_question(context,'open_ended') 
    150             add_message='Added a new open ended question' 
     150            add_message=gettext('Added a new open ended question') 
    151151    elif 'add_hotpotatoes_questions' in button: 
    152152        edit_nr = -1 
     
    169169                            lt.addPortalMessage('Invalid file.', type="warn") 
    170170            if (success == 0): 
    171                 lt.addPortalMessage('You can import only questions made with JQuiz or JCloze.', type="warn") 
     171                lt.addPortalMessage(gettext('You can import only questions made with JQuiz or JCloze.'), type="warn") 
    172172 
    173173    if del_message: 
  • trunk/skins/lemill/script_collection_actions.cpy

    r2874 r3014  
    99## 
    1010REQUEST=context.REQUEST 
     11from Products.LeMill import i18nme as gettext 
    1112 
    1213if REQUEST.get("action")=="Delete": 
    1314    context.delResources(REQUEST) 
    14     context.lemill_tool.addPortalMessage("Selected resources are deleted from collection") 
     15    context.lemill_tool.addPortalMessage(gettext("Selected resources are deleted from collection")) 
    1516 
    1617if REQUEST.get("action")=="MoveUp": 
    1718    context.moveUpResources(REQUEST) 
    18     context.lemill_tool.addPortalMessage("Selected resources moved") 
     19    context.lemill_tool.addPortalMessage(gettext("Selected resources moved")) 
    1920 
    2021if REQUEST.get("action")=="MoveDown": 
    2122    context.moveDownResources(REQUEST) 
    22     context.lemill_tool.addPortalMessage("Selected resources moved") 
     23    context.lemill_tool.addPortalMessage(gettext("Selected resources moved")) 
    2324 
    2425return state.set(next_action=' redirect_to:string:collection_view' ) 
  • trunk/skins/lemill/script_collection_add.py

    r2874 r3014  
    99 
    1010from Products.CMFCore.utils import getToolByName 
    11 from Products.LeMill import LeMillMessageFactory as _ 
     11from Products.LeMill import i18nme as gettext 
    1212 
    1313REQUEST = context.REQUEST 
     
    4343    return new_id 
    4444else: 
    45     context.lemill_tool.addPortalMessage("Added to collection") 
     45    context.lemill_tool.addPortalMessage(gettext("Added to collection")) 
    4646    return REQUEST.RESPONSE.redirect('%s/view' % context.absolute_url()) 
  • trunk/skins/lemill/script_contact_add.py

    r2874 r3014  
    99 
    1010from Products.CMFCore.utils import getToolByName 
     11from Products.LeMill import i18nme as gettext 
    1112 
    1213REQUEST = context.REQUEST 
     
    1920 
    2021home.addToContacts(this_uid) 
    21 lt.addPortalMessage('Member added to contacts.') 
     22lt.addPortalMessage(gettext('Member added to contacts.')) 
    2223 
    2324 
  • trunk/skins/lemill/script_contact_remove.py

    r2874 r3014  
    99 
    1010from Products.CMFCore.utils import getToolByName 
     11from Products.LeMill import i18nme as gettext 
    1112 
    1213REQUEST = context.REQUEST 
     
    1920 
    2021home.removeFromContacts(this_uid) 
    21 lt.addPortalMessage('Member removed from contacts.') 
     22lt.addPortalMessage(gettext('Member removed from contacts.')) 
    2223 
    2324 
  • trunk/skins/lemill/script_deleteCollection.cpy

    r2874 r3014  
    1111"""Deletes the resource and adds a note about deletion""" 
    1212REQUEST=context.REQUEST 
     13from Products.LeMill import i18nme as gettext 
    1314 
    1415(collections,msg)= context.delCollection(context.getId()) 
  • trunk/skins/lemill/script_editPiece.cpy

    r2874 r3014  
    1010## 
    1111REQUEST = context.REQUEST 
     12from Products.LeMill import i18nme as gettext 
    1213 
    1314# Let's try to keep it simple 
  • trunk/skins/lemill/script_group_invite.cpy

    r2874 r3014  
    1010from Products.LeMill import LeMillMessageFactory as _ 
    1111from Products.CMFPlone.utils import getToolByName 
     12from Products.LeMill import i18nme as gettext 
    1213 
    1314REQUEST=context.REQUEST 
     
    3334if ok_to_send: 
    3435    context.sendInvitationMail(mail,invited,inviter.getNicename()) 
    35     lt.addPortalMessage("Invitation mail sent") 
     36    lt.addPortalMessage(gettext("Invitation mail sent")) 
    3637else: 
    37     lt.addPortalMessage("No group selected") 
     38    lt.addPortalMessage(gettext("No group selected")) 
    3839 
    3940return state.set(next_action='redirect_to:python:object.absolute_url()') 
  • trunk/skins/lemill/validate_base.vpy

    r2874 r3014  
    88##parameters= 
    99## 
    10 from Products.CMFPlone import PloneMessageFactory as PMF 
     10from Products.LeMill import i18nme as gettext 
    1111 
    1212errors = {} 
     
    1414 
    1515if errors: 
    16     context.lemill_tool.addPortalMessage('Please correct the indicated errors.') 
     16    context.lemill_tool.addPortalMessage(gettext('Please correct the indicated errors.')) 
    1717    return state.set(status='failure', errors=errors) 
    1818else: 
    1919    if state.button != 'add_piece': 
    20         context.lemill_tool.addPortalMessage('Changes saved.') 
     20        context.lemill_tool.addPortalMessage(gettext('Changes saved.')) 
    2121    return state 
  • trunk/skins/lemill/validate_base_silently.vpy

    r2874 r3014  
    88##parameters= 
    99## 
    10 from Products.CMFPlone import PloneMessageFactory as PMF 
     10from Products.LeMill import i18nme as gettext 
    1111 
    1212errors = {} 
     
    1515 
    1616if errors: 
    17     context.lemill_tool.addPortalMessage('Please correct the indicated errors.') 
     17    context.lemill_tool.addPortalMessage(gettext('Please correct the indicated errors.')) 
    1818    return state.set(status='failure', errors=errors) 
    1919else: 
  • trunk/skins/lemill/validate_groupname.vpy

    r2874 r3014  
    1111 
    1212from Products.LeMill import LeMillMessageFactory as _ 
     13from Products.LeMill import i18nme as gettext 
    1314 
    1415addname = context.REQUEST.get('new_group_name', '') 
     
    1617if addname and context.lemill_tool.checkGroupTitle(addname): 
    1718    state.setError('groupEditing', _(u'Group with this name already exists, please choose a different name.'), 'input_required') 
    18     context.lemill_tool.addPortalMessage('Please correct the indicated errors.') 
     19    context.lemill_tool.addPortalMessage(gettext('Please correct the indicated errors.')) 
    1920else: 
    20     context.lemill_tool.addPortalMessage('Changes saved.') 
     21    context.lemill_tool.addPortalMessage(gettext('Changes saved.')) 
    2122 
    2223if state.getErrors(): 
  • trunk/skins/lemill/validate_title.vpy

    r2873 r3014  
    1010## 
    1111 
     12from Products.LeMill import i18nme as gettext 
    1213from Products.LeMill import LeMillMessageFactory as _ 
    1314lt = context.lemill_tool 
     
    2425    if context.getGroupById(addname) and (addname != context.id): 
    2526        state.setError('title', _(u'This title is already in use, please provide another one.'), 'input_required') 
    26         lt.addPortalMessage('Please correct the indicated errors.') 
     27        lt.addPortalMessage(gettext('Please correct the indicated errors.')) 
    2728    else: 
    28         lt.addPortalMessage('Changes saved.') 
     29        lt.addPortalMessage(gettext('Changes saved.')) 
    2930 
    3031if state.getErrors(): 
  • trunk/skins/lemill/validate_user.vpy

    r2874 r3014  
    1010## 
    1111 
    12 from Products.CMFPlone import PloneMessageFactory as _ 
     12from Products.LeMill import i18nme as gettext 
     13from Products.LeMill import LeMillMessageFactory as _ 
    1314from Products.CMFCore.utils import getToolByName 
    1415 
     
    2728         
    2829if state.getErrors(): 
    29     context.lemill_tool.addPortalMessage('Please correct the indicated errors.') 
     30    context.lemill_tool.addPortalMessage(gettext('Please correct the indicated errors.')) 
    3031    return state.set(status='failure') 
    3132else: 
  • trunk/skins/lemill/widget_exercise.pt

    r2780 r3014  
    4646    </tal:chapters> 
    4747    <fieldset class="visualNoPrint"> 
    48         <p i18n:translate="text_do_send_answers_to_e_mail">If you want the system to check your answers and send feedback as e-mail to you or your teacher, you need to fill <span i18n:name="show_form"><a href="javascript:setIdProperty('sending_email','display','block');" i18n:translate="text_snippet_show_form">the e-mail form</a></span>.</p> 
     48        <p i18n:translate="text_do_send_answers_to_e_mail">If you want the system to check your answers and send feedback as e-mail to you or your teacher, you need to fill <span i18n:name="show_form"><a href="javascript:$('#sending_email').toggle('slow');" i18n:translate="text_snippet_show_form">the e-mail form</a></span>.</p> 
    4949        <div id="sending_email" style="display:none"> 
    5050        <div class="visualClear" style="height:10px">&nbsp;</div> 
  • trunk/skins/lemill/widget_pilot.pt

    r3009 r3014  
    8585                \'width\', \'500\',\n 
    8686                \'height\', \'400\',\n 
    87                 \'src\', \'player.swf\',\n 
     87                \'src\', \'%s/player.swf\',\n 
    8888                \'quality\', \'high\',\n 
    8989                \'pluginspage\', \'http://www.macromedia.com/go/getflashplayer\',\n 
     
    103103                \'salign\', \'\',\n 
    104104                \'flashvars\', \'xml=%s/buildXML\'\n 
    105             );' % here_url"> 
     105            );' % (portal_url, here_url)"> 
    106106        </script> 
    107107        <noscript> 
     
    109109            <param name="allowScriptAccess" value="sameDomain" /> 
    110110            <param name="allowFullScreen" value="true" /> 
    111             <param name="movie" value="player.swf" /> 
     111            <param name="movie" tal:attributes="value string:{portal_url}/player.swf" value="player.swf" /> 
    112112            <param name="loop" value="false" /> 
    113113            <param name="quality" value="high" /> 
    114114            <param name="bgcolor" value="#000000" /> 
    115115            <param name="flashvars" tal:attributes="value python:'xml=%s/buildXML' % here_url" value="xml=something" /> 
    116             <embed src="player.swf" loop="false" quality="high" bgcolor="#000000" width="500" height="400" name="player" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="xml=something" tal:attributes="flashvars python:'xml=%s/buildXML' % here_url" /> 
     116            <embed src="player.swf" loop="false" quality="high" bgcolor="#000000" width="500" height="400" name="player" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="xml=something" tal:attributes="flashvars python:'xml=%s/buildXML' % here_url; src python:portal_url+'/player.swf';" /> 
    117117            </object> 
    118118        </noscript> 
  • trunk/skins/lemill/wysiwyg_support.pt

    r2943 r3014  
    1 <html xmlns:metal="http://xml.zope.org/namespaces/metal" xmlns:tal="http://xml.zope.org/namespaces/tal" xmlns="http://www.w3.org/1999/xhtml" xmlns:i18n="http://xml.zope.org/namespaces/i18n" i18n:domain="kupu"> 
     1<html xmlns:metal="http://xml.zope.org/namespaces/metal" xmlns:tal="http://xml.zope.org/namespaces/tal" xmlns="http://www.w3.org/1999/xhtml" xmlns:i18n="http://xml.zope.org/namespaces/i18n" i18n:domain="lemill"> 
    22 
    3    <div xmlns:metal="http://xml.zope.org/namespaces/metal" xmlns:tal="http://xml.zope.org/namespaces/tal" metal:define-macro="wysiwygEditorBox" id="kupu-editor" tal:define="name fieldName|inputname; editorid string:kupu-editor-${name}" tal:attributes="id editorid"> 
    4      <tal:usekupu define="fname fieldName|inputname|nothing; usekupu python:here.contentUsesKupu(fname);"> 
    5       <div tal:condition="usekupu"> 
     3   <div xmlns:metal="http://xml.zope.org/namespaces/metal" xmlns:tal="http://xml.zope.org/namespaces/tal" metal:define-macro="wysiwygEditorBox" tal:define="area_id string:tinymce-${fieldName}"> 
    64 
    7     <div id="kupu-editor-config-escaped" style="display: none;" tal:attributes="id string:kupu-editor-${fname}-config-escaped" tal:define="field field|nothing;      kupu_base_override kupu_base_override|nothing;      config python:context.kupu_xmlconfig(field=field, kupu_base_override=kupu_base_override);      pss modules/Products/PythonScripts/standard" tal:content="python:pss.url_quote(config)"/> 
    8     <div id="kupu-editor-config" tal:attributes="id string:kupu-editor-${fname}-config" style="display: none;"> </div>   
    9     <div class="kupu-fulleditor">       
    10     <link href="kupucombined.css" rel="stylesheet" type="text/css" tal:attributes="href string:${portal_url}/kupucombined.css"/> 
    11    <tal:test metal:define-macro="kupu_js_include"> 
    12       <tal:var define="global kupu_js_loaded string:yes"/> 
    13     <script type="text/javascript" tal:attributes="src string:${portal_url}/kupunoi18n.js"> </script> 
    14     <script type="text/javascript" tal:attributes="src string:${portal_url}/sarissa.js"> </script> 
    15     <script type="text/javascript" tal:attributes="src string:${portal_url}/sarissa_ieemu_xpath.js"> </script> 
    16     <script type="text/javascript" tal:attributes="src string:${portal_url}/kupuhelpers.js"> </script> 
    17     <script type="text/javascript" tal:attributes="src string:${portal_url}/kupueditor.js"> </script> 
    18     <script type="text/javascript" tal:attributes="src string:${portal_url}/kupubasetools.js"> </script> 
    19     <script type="text/javascript" tal:attributes="src string:${portal_url}/kupuloggers.js"> </script> 
    20     <script type="text/javascript" tal:attributes="src string:${portal_url}/kupucontentfilters.js"> </script> 
    21     <script type="text/javascript" tal:attributes="src string:${portal_url}/kupuploneeditor.js"> </script> 
    22     <script type="text/javascript" tal:attributes="src string:${portal_url}/kupuploneui.js"> </script> 
    23     <script type="text/javascript" src="kupusourceedit.js" tal:attributes="src string:${portal_url}/kupusourceedit.js"> </script> 
    24     <script type="text/javascript" src="kupudrawers.js" tal:attributes="src string:${portal_url}/kupudrawers.js"> </script> 
    25    </tal:test>   
    26     <script type="text/javascript" src="kupubeforeunload.js" tal:attributes="src string:${portal_url}/kupubeforeunload.js" tal:define="global haveBeforeUnload python:True;"> </script> 
    27     <script type="text/javascript" src="kupuploneinit.js" tal:attributes="src string:${portal_url}/kupuploneinit.js"> </script> 
    28     <div class="kupu-tb" id="toolbar" tal:define="tool context/kupu_library_tool;field field|nothing;filter python:tool.filterToolbar(context,field);"> 
    29     <span id="kupu-tb-buttons" class="kupu-tb-buttons">       
    30    
    31     <span class="kupu-tb-buttongroup" style="float: right" id="kupu-zoom" tal:condition="filter/zoom"> 
    32       <button type="button" class="kupu-zoom" id="kupu-zoom-button" i18n:attributes="title title_zoom;" title="Zoom: Access key (Alt or Ctrl) + X" accesskey="x">&#160;</button> 
    33     </span> 
    34    
    35     <span class="kupu-tb-buttongroup" tal:condition="not:context/checkCreationFlag|python:True"> 
    36       <button type="button" class="kupu-save" id="kupu-save-button" title="Save" i18n:attributes="title title_save;" tal:condition="filter/save-button">&#160;</button> 
    37     </span> 
    38    
    39     <select class="kupu-tb-styles" tal:condition="filter/styles" tal:define="field field|nothing;styles python:tool.getStyleList(field);"> 
    40       <option value="p" i18n:translate="Normal">Normal paragraph</option> 
    41       <tal:block condition="styles" repeat="style styles"> 
    42         <option i18n:translate="" tal:attributes="value style/value" tal:content="style/content"/> 
    43       </tal:block> 
    44     </select> 
    45  
    46    
    47     <span class="kupu-tb-buttongroup" id="kupu-bg-basicmarkup" tal:condition="filter/bg-basicmarkup"> 
    48       <button type="button" class="kupu-bold" id="kupu-bold-button" title="Bold: Access key (Alt or Ctrl) + B" tal:condition="filter/bold-button" i18n:attributes="title title_bold;" accesskey="b">&#160;</button> 
    49       <button type="button" class="kupu-italic" id="kupu-italic-button" title="Italic: Access key (Alt or Ctrl) + I" tal:condition="filter/italic-button" i18n:attributes="title title_italic;" accesskey="i">&#160;</button> 
    50     </span> 
    51    
    52     <span class="kupu-tb-buttongroup" id="kupu-bg-subsuper" tal:condition="filter/bg-subsuper"> 
    53       <button type="button" class="kupu-subscript" id="kupu-subscript-button" title="Subscript: Access key (Alt or Ctrl) + -" tal:condition="filter/subscript-button" i18n:attributes="title title_subscript;" accesskey="-">&#160;</button> 
    54       <button type="button" class="kupu-superscript" id="kupu-superscript-button" title="Superscript: Access key (Alt or Ctrl) + +" tal:condition="filter/superscript-button" i18n:attributes="title title_superscript;" accesskey="+">&#160;</button> 
    55     </span> 
    56    
    57     <span class="kupu-tb-buttongroup" tal:condition="filter/bg-colorchooser"> 
    58       <button type="button" class="kupu-forecolor" id="kupu-forecolor-button" tal:condition="filter/forecolor-button" title="text color: alt-f" i18n:attributes="title title_text_color;" accesskey="f">&#160;</button> 
    59       <button type="button" class="kupu-hilitecolor" id="kupu-hilitecolor-button" tal:condition="filter/hilitecolor-button" title="background color: alt-h" i18n:attributes="title title_back_color;" accesskey="h">&#160;</button> 
    60     </span> 
    61    
    62     <span class="kupu-tb-buttongroup" id="kupu-bg-justify" tal:condition="filter/bg-justify"> 
    63       <button type="button" class="kupu-justifyleft" id="kupu-justifyleft-button" tal:condition="filter/justifyleft-button" title="Left justify: Access key (Alt or Ctrl) + L" i18n:attributes="title title_ljust;" accesskey="l">&#160;</button> 
    64       <button type="button" class="kupu-justifycenter" tal:condition="filter/justifycenter-button" id="kupu-justifycenter-button" title="Center justify: Access key (Alt or Ctrl) + C" i18n:attributes="title title_center;" accesskey="c">&#160;</button> 
    65       <button type="button" class="kupu-justifyright" tal:condition="filter/justifyright-button" id="kupu-justifyright-button" title="Right justify: Access key (Alt or Ctrl) + R" i18n:attributes="title title_rjust;" accesskey="r">&#160;</button> 
    66     </span> 
    67    
    68     <span class="kupu-tb-buttongroup" id="kupu-bg-list" tal:condition="filter/bg-list"> 
    69        
    70       <button type="button" class="kupu-insertorderedlist" tal:condition="filter/list-ol-addbutton" title="Numbered list: Access key (Alt or Ctrl) + #" id="kupu-list-ol-addbutton" i18n:attributes="title title_numlist;" accesskey="#">&#160;</button> 
    71       <button type="button" class="kupu-insertunorderedlist" tal:condition="filter/list-ul-addbutton" title="Unordered list: Access key (Alt or Ctrl) + *" id="kupu-list-ul-addbutton" i18n:attributes="title title_unorderedlist;" accesskey="*">&#160;</button> 
    72               </span> 
    73    
    74     <span class="kupu-tb-buttongroup" id="kupu-bg-definitionlist" tal:condition="filter/definitionlist"> 
    75        
    76       <button type="button" class="kupu-insertdefinitionlist" title="Definition list: Access key (Alt or Ctrl) + =" id="kupu-list-dl-addbutton" i18n:attributes="title title_deflist;" accesskey="=">&#160;</button> 
    77     </span> 
    78    
    79     <span class="kupu-tb-buttongroup" id="kupu-bg-indent" tal:condition="filter/bg-indent"> 
    80       <button type="button" class="kupu-outdent" tal:condition="filter/outdent-button" id="kupu-outdent-button" title="Decrease quote level: Access key (Alt or Ctrl) + &lt;" i18n:attributes="title title_decrease_quote;" accesskey="&lt;">&#160;</button> 
    81       <button type="button" class="kupu-indent" tal:condition="filter/indent-button" id="kupu-indent-button" title="Increase quote level: Access key (Alt or Ctrl) + &gt;" i18n:attributes="title title_increase_quote;" accesskey="&gt;">&#160;</button> 
    82     </span> 
    83    
    84     <span class="kupu-tb-buttongroup" tal:condition="filter/bg-drawers"> 
    85       <button type="button" class="kupu-image" tal:condition="filter/imagelibdrawer-button" id="kupu-imagelibdrawer-button" title="Insert image" i18n:attributes="title title_insert_image;">&#160;</button> 
    86       <button type="button" class="kupu-inthyperlink" tal:condition="filter/linklibdrawer-button" id="kupu-linklibdrawer-button" title="Insert internal link" i18n:attributes="title title_insert_internal_link;">&#160;</button> 
    87       <button type="button" class="kupu-exthyperlink" tal:condition="filter/linkdrawer-button" id="kupu-linkdrawer-button" title="Insert external link" i18n:attributes="title title_insert_external_link;">&#160;</button> 
    88       <button type="button" class="kupu-anchors" tal:condition="filter/anchors-button" id="kupu-anchors" title="Insert anchors" i18n:attributes="title title_insert_anchors;">&#160;</button> 
    89       <button type="button" class="kupu-table" tal:condition="filter/tabledrawer-button" id="kupu-tabledrawer-button" title="Insert table" i18n:attributes="title title_insert_table;">&#160;</button> 
    90     </span> 
    91    
    92     <span class="kupu-tb-buttongroup" id="kupu-bg-undo" tal:condition="filter/bg-undo"> 
    93       <button type="button" class="kupu-undo" tal:condition="filter/undo-button" id="kupu-undo-button" title="Undo: Access key (Alt or Ctrl) + Z" i18n:attributes="title title_undo;" accesskey="z">&#160;</button> 
    94       <button type="button" class="kupu-redo" tal:condition="filter/redo-button" id="kupu-redo-button" title="Redo: Access key (Alt or Ctrl) + Y" i18n:attributes="title title_redo;" accesskey="y">&#160;</button> 
    95     </span> 
    96    
    97     <span class="kupu-tb-buttongroup kupu-spellchecker-span" id="kupu-spellchecker" tal:condition="filter/spellchecker"> 
    98       <button type="button" class="kupu-spellchecker" id="kupu-spellchecker-button" title="Check spelling" i18n:attributes="title title_spelling;">&#160;</button> 
    99     </span> 
    100    
    101     <span class="kupu-tb-buttongroup kupu-source-span" id="kupu-source" tal:condition="filter/source"> 
    102       <button type="button" class="kupu-source" id="kupu-source-button" title="Switch between visual editor and HTML view" i18n:attributes="title toggle_source_view;" accesskey="h">&#160;</button> 
    103     </span> 
    104      
    105     <span class="kupu-tb-buttongroup" id="kupu-bg-remove" tal:condition="filter/bg-remove"> 
    106       <button type="button" class="kupu-removeimage invisible" tal:condition="filter/removeimage-button" id="kupu-removeimage-button" title="Remove image" i18n:attributes="title title_removeimage;">&#160;</button> 
    107       <button type="button" class="kupu-removelink invisible" tal:condition="filter/removelink-button" id="kupu-removelink-button" title="Remove link" i18n:attributes="title title_removelink;">&#160;</button> 
    108     </span> 
    109    
    110     </span> 
    111    
    112     <select id="kupu-ulstyles" class="kupu-ulstyles" tal:condition="filter/ulstyles"> 
    113       <option value="disc" i18n:translate="list-disc">&#9679;</option> 
    114       <option value="square" i18n:translate="list-square">&#9632;</option> 
    115       <option value="circle" i18n:translate="list-circle">&#9675;</option> 
    116       <option value="none" i18n:translate="list-nobullet">no bullet</option> 
    117     </select> 
    118     <select id="kupu-olstyles" class="kupu-olstyles" tal:condition="filter/olstyles"> 
    119       <option value="decimal" i18n:translate="list-decimal">1</option> 
    120       <option value="upper-roman" i18n:translate="list-upperroman">I</option> 
    121       <option value="lower-roman" i18n:translate="list-lowerroman">i</option> 
    122       <option value="upper-alpha" i18n:translate="list-upperalpha">A</option> 
    123       <option value="lower-alpha" i18n:translate="list-loweralpha">a</option> 
    124     </select> 
    125    
    126      
    127     <div style="display:block;" class="kupu-librarydrawer-parent"> 
    128       <iframe style="display:none" class="kupu-anchorframe" src="javascript:''"> 
    129       </iframe> 
    130     </div> 
    131    
    132     <div id="kupu-linkdrawer" class="kupu-drawer kupu-linkdrawer"> 
    133       <h1 class="kupu-drawer-title" i18n:translate="title_external_link">External Link</h1> 
    134  
    135       <div id="kupu-linkdrawer-addlink" class="kupu-panels kupu-linkdrawer-addlink"> 
    136          <ul class="kupu-tabs"> 
    137             <li class="kupu-linkdrawer-addlink selected"><a href="#" i18n:translate="tab_link">Link to url</a></li> 
    138             <li class="kupu-linkdrawer-embed" tal:condition="filter/embed-tab|nothing"><a href="#" i18n:translate="tab_embed">Embed external object</a></li> 
    139          </ul> 
    140          <table class="kupu-tabbed"> 
    141             <tbody class="kupu-addlink"> 
    142                <tr> 
    143                   <td> 
    144                      <div class="kupu-toolbox-label"> 
    145                          
    146                         <span i18n:translate="label_link_text"> 
    147                            Link the highlighted text to this URL: 
    148                         </span> 
    149                      </div> 
    150                      <input class="kupu-toolbox-st kupu-linkdrawer-input" type="text" onkeypress="return HandleDrawerEnter(event, 'linkdrawer-preview');"/> 
    151                   </td> 
    152                   <td class="kupu-preview-button"> 
    153                      <button class="kupu-dialog-button" type="button" id="linkdrawer-preview" onclick="drawertool.current_drawer.preview()" i18n:translate="button_preview">Preview</button> 
    154                   </td> 
    155                </tr> 
    156                <tr class="kupu-linkdrawer-anchors" style="display:none"> 
    157                   <td colspan="2"> 
    158                      <label i18n:translate="label_anchor" for="anchorselect">Anchor</label> 
    159                      <select id="anchorselect"><option i18n:translate="opt_top_of_page" value="">top of page (default)</option></select> 
    160                   </td> 
    161                </tr> 
    162                <tr><td colspan="2" align="center"> 
    163                   <div class="watermark"><span i18n:translate="watermark_preview">Preview</span></div> 
    164                   <iframe frameborder="1" scrolling="auto" width="440" height="198" class="kupu-linkdrawer-preview" src="javascript:''"> 
    165                   </iframe> 
    166                   </td> 
    167                </tr> 
    168             </tbody> 
    169             <tbody class="kupu-embed"> 
    170                <tr> 
    171                   <td> 
    172                      <div class="kupu-toolbox-label"> 
    173                          
    174                         <span i18n:translate="help_paste_here"> 
    175                            Paste &lt;object&gt; or &lt;embed&gt; tag here: 
    176                         </span> 
    177                      </div> 
    178                      <textarea class="kupu-toolbox-st kupu-embed-input" i18n:translate="placeholder_html_code">[insert arbitrary HTML code here]</textarea> 
    179                   </td> 
    180                </tr> 
    181                <tr> 
    182                   <td i18n:translate="custom_html_help"> 
    183                   You may use this box to insert custom snippets of 
    184                   HTML code. There is no guarantee that any code 
    185                   inserted in this way will be preserved when you save 
    186                   your edits. To select an existing object from IE click on 
    187                   the border, from Firefox double click it. 
    188                   </td> 
    189                </tr> 
    190             </tbody> 
    191         </table> 
    192  
    193         <div class="kupu-dialogbuttons"> 
    194           <button class="kupu-dialog-button" type="button" onclick="drawertool.current_drawer.save()" i18n:translate="button_ok">Ok</button> 
    195           <button class="kupu-dialog-button" type="button" onclick="drawertool.closeDrawer()" i18n:translate="button_cancel">Cancel</button> 
    196         </div> 
    197  
    198       </div> 
    199     </div> 
    200    
    201     <div id="kupu-tabledrawer" class="kupu-drawer kupu-tabledrawer"> 
    202     <h1 class="kupu-drawer-title" i18n:translate="tabledrawer_title">Table</h1> 
    203     <div class="kupu-panels"> 
    204       <table width="300"> 
    205         <tr class="kupu-panelsrow"> 
    206           <td class="kupu-panel"> 
    207              
    208             <div class="kupu-tabledrawer-addtable"> 
    209               <table> 
    210                 <tr> 
    211                   <th i18n:translate="tabledrawer_class_label" class="kupu-toolbox-label">Table Class</th> 
    212                   <td> 
    213                     <select class="kupu-tabledrawer-addclasschooser"> 
    214                       <option i18n:translate="Plain" value="plain">Plain</option> 
    215                       <option i18n:translate="Listing" value="listing">Listing</option> 
    216                       <option i18n:translate="Grid" value="grid">Grid</option> 
    217                       <option i18n:translate="Data" value="data">Data</option> 
    218                     </select> 
    219                   </td> 
    220                 </tr> 
    221                 <tr> 
    222                   <th i18n:translate="tabledrawer_rows_label" class="kupu-toolbox-label">Rows</th> 
    223                   <td><input type="text" class="kupu-tabledrawer-newrows" onkeypress="return HandleDrawerEnter(event);"/></td> 
    224                 </tr> 
    225                 <tr> 
    226                   <th i18n:translate="tabledrawer_columns_label" class="kupu-toolbox-label">Columns</th> 
    227                   <td><input type="text" class="kupu-tabledrawer-newcols" onkeypress="return HandleDrawerEnter(event);"/></td> 
    228                 </tr> 
    229                 <tr> 
    230                   <th class="kupu-toolbox-label"> </th> 
    231                   <td> 
    232                     <input class="kupu-tabledrawer-makeheader" type="checkbox" checked="checked" onkeypress="return HandleDrawerEnter(event);" id="tabledrawer_makeheader"/> 
    233                     <label i18n:translate="tabledrawer_headings_label" for="tabledrawer_makeheader"> 
    234                       Create Headings 
    235                     </label> 
    236                   </td> 
    237                 </tr> 
    238                 <tr> 
    239                   <th class="kupu-toolbox-label"> </th> 
    240                   <td> 
    241                       <button class="kupu-dialog-button" type="button" i18n:translate="tabledrawer_add_table_button" onclick="drawertool.current_drawer.createTable()">Add Table</button> 
    242                       <button class="kupu-dialog-button" type="button" i18n:translate="tabledrawer_fix_tables_button" onclick="drawertool.current_drawer.fixAllTables()">Fix All Tables</button> 
    243                   </td> 
    244                 </tr> 
    245               </table> 
    246             </div> 
    247  
    248              
    249             <div class="kupu-tabledrawer-edittable"> 
    250               <table> 
    251                 <tr> 
    252                   <th class="kupu-toolbox-label" i18n:translate="tabledrawer_class_label">Table Class</th> 
    253                   <td> 
    254                     <select class="kupu-tabledrawer-editclasschooser" onchange="drawertool.current_drawer.setTableClass(this.options[this.selectedIndex].value)"> 
    255                       <option i18n:translate="Plain" value="plain">Plain</option> 
    256                       <option i18n:translate="Listing" value="listing">Listing</option> 
    257                       <option i18n:translate="Grid" value="grid">Grid</option> 
    258                       <option i18n:translate="Data" value="data">Data</option> 
    259                     </select> 
    260                   </td> 
    261                 </tr> 
    262                 <tr> 
    263                   <th class="kupu-toolbox-label" i18n:translate="tabledrawer_alignment_label">Current column alignment</th> 
    264                   <td> 
    265                     <select id="kupu-tabledrawer-alignchooser" class="kupu-tabledrawer-alignchooser" onchange="drawertool.current_drawer.tool.setColumnAlign(this.options[this.selectedIndex].value)"> 
    266                       <option i18n:translate="tabledrawer_left_option" value="left">Left</option> 
    267                       <option i18n:translate="tabledrawer_center_option" value="center">Center</option> 
    268                       <option i18n:translate="tabledrawer_right_option" value="right">Right</option> 
    269                       </select> 
    270                   </td> 
    271                 </tr> 
    272                 <tr> 
    273                   <th class="kupu-toolbox-label" i18n:translate="tabledrawer_column_label">Column</th> 
    274                   <td> 
    275                     <button class="kupu-dialog-button" type="button" i18n:translate="tabledrawer_add_button" onclick="drawertool.current_drawer.addTableColumn()">Add</button> 
    276                     <button class="kupu-dialog-button" type="button" i18n:translate="tabledrawer_remove_button" onclick="drawertool.current_drawer.delTableColumn()">Remove</button> 
    277                   </td> 
    278                 </tr> 
    279                 <tr> 
    280                   <th class="kupu-toolbox-label" i18n:translate="tabledrawer_row_label">Row</th> 
    281                   <td> 
    282                     <button class="kupu-dialog-button" type="button" i18n:translate="tabledrawer_add_button" onclick="drawertool.current_drawer.addTableRow()">Add</button>  
    283                     <button class="kupu-dialog-button" type="button" i18n:translate="tabledrawer_remove_button" onclick="drawertool.current_drawer.delTableRow()">Remove</button> 
    284                   </td> 
    285                 </tr> 
    286                 <tr> 
    287                   <th class="kupu-toolbox-label" i18n:translate="tabledrawer_table_label">Table</th> 
    288                   <td> 
    289                     <button class="kupu-dialog-button" type="button" i18n:translate="tabledrawer_fix_button" onclick="drawertool.current_drawer.fixTable()">Fix</button>  
    290                     <button class="kupu-dialog-button" type="button" i18n:translate="tabledrawer_remove_button" onclick="drawertool.current_drawer.delTable()">Remove</button>  
    291                   </td> 
    292                 </tr> 
    293               </table> 
    294             </div> 
    295           </td> 
    296         </tr> 
    297       </table> 
    298       <div class="kupu-dialogbuttons"> 
    299         <button class="kupu-dialog-button" type="button" i18n:translate="tabledrawer_close_button" onclick="drawertool.closeDrawer(this)">Close</button> 
    300       </div> 
    301     </div> 
    302     </div> 
    303  
    304    
    305     <div id="kupu-anchordrawer" class="kupu-drawer kupu-anchordrawer"> 
    306       <h1 class="kupu-drawer-title" i18n:translate="anchordrawer_title">Anchors</h1> 
    307       <div class="kupu-panels kupu-ins-bm"> 
    308          <ul class="kupu-tabs"> 
    309             <li class="kupu-ins-bm selected"><a href="#" i18n:translate="tab_link_anchor">Link to anchor</a></li> 
    310             <li class="kupu-anchor" tal:condition="filter/manage-anchors-tab"><a href="#" i18n:translate="tab_manage_anchors">Manage Anchors</a></li> 
    311             <li class="kupu-toc" tal:condition="filter/toc-tab|nothing"><a href="#" i18n:translate="tab_toc">Table of contents</a></li> 
    312          </ul> 
    313         <table class="kupu-tabbed" cellspacing="0"> 
    314           <tr> 
    315             <td class="kupu-bm-select"> 
    316               <select id="kupu-bm-sel1" size="10"> </select> 
    317             </td> 
    318             <td> 
    319               <div class="kupu-bm-heading"> 
    320                 <div class="kupu-bm-tablestyle invis-ins-bm invis-anchor"> 
    321                   <label i18n:translate="label_table_style" for="kupu-bm-outcls"> 
    322                     Table style 
    323                   </label> 
    324                   <select id="kupu-bm-outcls" size="1"> 
    325                     <option value="" i18n:translate="Normal">Normal paragraph</option> 
    326                   </select> 
    327                 </div> 
    328                 <div class="kupu-bm-numbering invis-ins-bm invis-anchor"> 
    329                   <label i18n:translate="label_numbering" for="kupu-bm-number"> 
    330                     Numbering 
    331                   </label> 
    332                   <input type="checkbox" class="hide-ins-bm hide-anchor" checked="checked" id="kupu-bm-number"/> 
    333                 </div> 
    334                 <div class="invis-ins-bm"> 
    335                    <label for="kupu-bm-checkall"> 
    336                       <em i18n:translate="label_toggle_all">toggle all</em> 
    337                    </label> 
    338                    <input type="checkbox" class="hide-ins-bm" checked="checked" id="kupu-bm-checkall"/> 
    339                 </div> 
    340               </div> 
    341               <div class="kupu-bm-paras">&#160;</div> 
    342             </td> 
    343           </tr> 
    344           <tr> 
    345             <td> 
    346               <select id="kupu-bm-sel2" size="1" class="hide-ins-bm hide-anchor"> 
    347                 <option value="" i18n:translate="opt_2nd_style">(optional 2nd style)</option> 
    348               </select> 
    349             </td> 
    350             <td> 
    351                <div class="kupu-bm-help"> 
    352                   <span class="hide-anchor hide-toc discreet" i18n:translate="create_anchor_link_help"> 
    353                      Select a paragraph style then choose a paragraph and Ok to insert a link to that location. 
    354                   </span> 
    355                   <span class="hide-ins-bm hide-anchor discreet" i18n:translate="create_toc_help"> 
    356                      Select one or two paragraph styles, then Ok to insert a table of contents. 
    357                   </span> 
    358                   <span class="hide-ins-bm hide-toc discreet" i18n:translate="create_anchor_help"> 
    359                      Anchors are created for checked paragraphs and 
    360                      removed for unchecked paragraphs when you press Ok. 
    361                      Anchors in use on this page may not be deleted. 
    362                   </span> 
    363               </div> 
    364             </td> 
    365           </tr> 
    366         </table> 
    367         <div class="kupu-dialogbuttons"> 
    368           <button class="kupu-dialog-button" type="button" onclick="drawertool.current_drawer.save()" i18n:translate="button_ok">Ok</button> 
    369           <button class="kupu-dialog-button" type="button" onclick="drawertool.closeDrawer()" i18n:translate="button_cancel">Cancel</button> 
    370         </div> 
    371       </div> 
    372     </div> 
    373    
    374    
    375     </div> 
    376    
    377     <table id="kupu-colorchooser" class="kupu-colorchooser" cellpadding="0" cellspacing="0" style="position: fixed; border-style: solid; border-color: black; border-width: 1px;"> 
    378     </table> 
    379   <script type="text/javascript">var focuscount = 0;</script> 
    380     <div> 
    381     <iframe class="kupu-editor-iframe" frameborder="0" src="emptypage" tabindex="" onfocus="this.contentWindow.focus();" tal:define="base python:here.kupu_library_tool.getBaseUrl(here, True);                     base kupu_base_override|base;" tal:attributes="src string:${base}/emptypage;                         id string:kupu-editor-iframe-${fname};                         name string:kupu-editor-iframe-${fname};tabindex tabindex/next|tabindex|nothing;"> 
    382     </iframe> 
    383      <input type="hidden" name="text_format:default" value="text/html" tal:define="fieldName fieldName|inputname|nothing;                 val python:fieldName and 'text/html' or 'html';                 fieldName python:test(fieldName, fieldName+'_', '') + 'text_format:default';" tal:attributes="name fieldName;value val;"/> 
    384 <tal:test condition="fieldName|nothing"> 
    385     <textarea cols="80" rows="25" class="kupu-editor-textarea" name="description" tal:condition="fieldName|nothing" tal:content="inputvalue" tal:attributes="name inputname;                         onfocus onfocus|nothing;                         onblur onblur|nothing;                         rows rows|default;                         cols cols|default;"> 
    386     </textarea> 
    387 </tal:test> 
    388     </div> 
    389    
    390     <tal:guard tal:define="ti context/getTypeInfo | nothing" tal:condition="python: ti and ti.listActionInfos('object/edit', check_condition=0)"> 
    391       <div class="kupuoverride" tal:condition="python:exists('kupu_content') and allowed and len(allowed)!=1" tal:define="floated widget/allow_file_upload | python:1;     klass python:test(exists('kupu_content') and len(kupu_content), ' kupusourceoverride', '');     gAC nocall:field/getAllowedContentTypes|nothing;     allowed python:gAC and gAC(context) or path('field/allowable_content_types|nothing');" tal:attributes="style python:test(floated, 'float:left;;', '');class string:kupuoverride$klass"><span class="discreet"><a class="forcekupu" href="#" i18n:translate="suppress-kupu" i18n:attributes="title title_suppress_kupu;" tal:define="fs fieldset|nothing;fs python:test(fs,'&amp;fieldset=%s'%fs,'');    editaction python:context.getActionInfo('object/edit')['url'];" tal:attributes="href string:${editaction}?kupu.suppress=${fieldName}${fs};" title="reload current page without kupu"> 
    392        Edit without visual editor 
    393     </a></span> 
    394       </div> 
    395     </tal:guard> 
    396    
    397     </div> 
    398    
    399     <script type="text/javascript" tal:content="string:       addEventHandler(window, 'load',  function() { initPloneKupu('${editorid}'); }, document);"/> 
    400    
    401       </div> 
    402  
    403       <div tal:condition="not:usekupu"> 
    404          
    405    <tal:test condition="not:exists:portal/portal_css"> 
    406     <link href="kupustyles.css" rel="stylesheet" type="text/css" tal:attributes="href string:${portal_url}/kupustyles.css"/> 
    407     <link href="kupuplone.css" rel="stylesheet" type="text/css" tal:attributes="href string:${portal_url}/kupuplone.css"/> 
    408     <link href="kupudrawerstyles.css" rel="stylesheet" type="text/css" tal:attributes="href string:${portal_url}/kupudrawerstyles.css"/> 
    409    </tal:test> 
    410    
    411     <textarea cols="80" rows="25" name="fieldName" tal:content="inputvalue" tal:attributes="name fieldName|inputname;                         id fieldName|inputname;                         onfocus onfocus|nothing;                         onblur onblur|nothing;                         rows rows|default;                         cols cols|default;"> 
    412     </textarea> 
    413      <input type="hidden" name="text_format:default" value="text/html" tal:define="fieldName fieldName|inputname|nothing;                 val python:fieldName and 'text/html' or 'html';                 fieldName python:test(fieldName, fieldName+'_', '') + 'text_format:default';" tal:attributes="name fieldName;value val;"/> 
    414    
    415     <tal:archetypes tal:condition="fieldName|nothing"> 
    416       <div class="kupuoverride" tal:condition="python:path('widget/allow_format_edit|python:True') and not path('kupu_convert_message_generated|nothing')" tal:define="floated widget/allow_file_upload | python:1;" tal:attributes="style python:test(floated, 'float:left;;', '');"> 
    417         <span class="discreet"><a class="forcekupu" href="#" i18n:translate="force-kupu" i18n:attributes="title title_force_kupu;" tal:condition="python:portal.kupu_library_tool.isKupuEnabled(REQUEST=context.REQUEST, context=context, fieldName=fieldName)" tal:define="fs fieldset|nothing;fs python:test(fs,'&amp;fieldset=%s'%fs,None);" tal:attributes="href string:${request/URL0}?kupu.convert=${fieldName}${fs};" title="reload current page using kupu to edit this field"> 
    418            Edit with visual editor 
    419         </a></span> 
    420       </div> 
    421     </tal:archetypes> 
    422    
    423       </div> 
    424      </tal:usekupu> 
    425     </div> 
    426    
    427  
    428 <div xmlns:metal="http://xml.zope.org/namespaces/metal" metal:define-macro="textFormatSelector" class="field"> 
    429  <tal:usekupu xmlns:tal="http://xml.zope.org/namespaces/tal" define="fname fieldName|inputname|nothing;               usekupu python:here.contentUsesKupu(fname);"> 
    430   <tal:editor tal:condition="usekupu"> 
    431      <input type="hidden" name="text_format" value="text/html" tal:define="fieldName fieldName|inputname|nothing;                 val python:fieldName and 'text/html' or 'html';                 fieldName python:fieldName and fieldName+'_text_format' or 'text_format';" tal:attributes="name fieldName;value val;"/> 
    432   </tal:editor>                  
    433   <tal:noeditor tal:condition="not:usekupu"> 
    434     <tal:archetypes tal:condition="fieldName|nothing"> 
    435          <div metal:use-macro="here/widgets/visual/macros/area_format"/> 
    436          <span tal:condition="python:portal.kupu_library_tool.isKupuEnabled(REQUEST=context.REQUEST, context=context, fieldName=fieldName)" tal:define="global kupu_convert_message_generated python:True"> 
    437            <a href="#" tal:attributes="href python:portal.kupu_library_tool.forcekupu_url(fieldName);" i18n:translate="convert-to-kupu">Convert to HTML and edit with the visual editor</a></span> 
    438     </tal:archetypes> 
    439     <tal:nonat condition="not:fieldName|nothing" define="text_format text_format | python: getattr(here,'text_format','html');"> 
    440      <label for="text_format" i18n:translate="label_format">Format</label> 
    441  
    442      <div class="formHelp" i18n:translate="help_format"> 
    443        If you are unsure of which format to use, just select Plain 
    444        Text and type the document as you usually do. 
    445      </div> 
    446  
    447      <input class="noborder" type="radio" name="text_format" value="structured-text" id="cb_structuredtext" tal:attributes="checked python:test(text_format=='structured-text', 1, None);"/> 
    448      <label for="cb_structuredtext" i18n:translate="structured_text">Structured Text</label> <br/> 
    449  
    450      <input class="noborder" type="radio" name="text_format" value="html" id="cb_html" tal:attributes="checked python:test(text_format=='html', 1, None);"/> 
    451      <label for="cb_html" i18n:translate="format_html">HTML</label> <br/> 
    452  
    453      <input class="noborder" type="radio" name="text_format" value="plain" id="cb_plain" tal:attributes="checked python:test(text_format=='plain', 1, None);"/> 
    454      <label for="cb_plain" i18n:translate="plain_text">Plain Text</label> 
    455     </tal:nonat> 
    456   </tal:noeditor> 
    457  </tal:usekupu> 
     5<textarea id="content1" tal:attributes="id area_id" tal:content="inputvalue" name="content1" class="mceEditor" cols="85" rows="20">This will be a editor, since it has a selector class.</textarea> 
     6    <a href="javascript:;" class="visual_toggle" onclick="$(this).hide();$('.mceEditor').tinymce().show();$('.html_toggle').show();" style="display:none">[Visual]</a> 
     7    <a href="javascript:;" class="html_toggle" onclick="$(this).hide();$('.mceEditor').tinymce().hide();$('.visual_toggle').show();">[HTML]</a>     
    4588</div> 
    4599 
Note: See TracChangeset for help on using the changeset viewer.