[gen] ckeditor now works with IE.

This commit is contained in:
Gaetan Delannay 2012-09-10 11:44:22 +02:00
parent c2eaab4b44
commit 6801188496
3 changed files with 17 additions and 10 deletions

View file

@ -968,16 +968,17 @@ class Type:
try:
return method(obj, self)
except Exception, e:
obj.log(tb, type='error')
if raiseOnError:
# Raise the initial error.
raise te
else:
obj.log(tb, type='error')
return str(te)
except Exception, e:
if raiseOnError: raise e
else:
obj.log(Traceback.get(), type='error')
if raiseOnError:
raise e
else:
return str(e)
def process(self, obj):
@ -1210,6 +1211,9 @@ class String(Type):
# Default width, height and maxChars vary according to String format
if width == None:
if format == String.TEXT: self.width = 60
# This width corresponds to the standard width of an Appy page,
# minus the portlet.
if format == String.XHTML: self.width = 750
else: self.width = 30
if height == None:
if format == String.TEXT: self.height = 5

View file

@ -1576,13 +1576,16 @@ class BaseMixin:
# this field.
field = self.getAppyType(name)
ckAttrs = {'toolbar': field.richText and 'AppyRich' or 'Appy',
'format_tags': '%s' % ';'.join(field.styles)}
'format_tags': '%s' % ';'.join(field.styles),
'width': field.width}
if field.allowImageUpload:
ckAttrs['filebrowserUploadUrl'] = '%s/upload' % self.absolute_url()
ck = ''
ck = []
for k, v in ckAttrs.iteritems():
ck += "%s: '%s'," % (k, v)
res = "CKEDITOR.replace('%s', {%s})" % (name, ck)
if isinstance(v, int): sv = str(v)
else: sv = '"%s"' % v
ck.append('%s: %s' % (k, sv))
res = 'CKEDITOR.replace("%s", {%s})' % (name, ', '.join(ck))
return res
def getCalendarInit(self, name, years):

View file

@ -64,7 +64,7 @@
class python: (fmt==2) and ('rich_%s' % name) or ''"
tal:content="python: test(inRequest, requestValue, value)">
</textarea>
<script tal:condition="python: fmt == 2"
<script type="text/javascript" tal:condition="python: fmt == 2"
tal:content="python: contextObj.getEditorInit(name)">
</script>
</tal:textarea>