[gen] ckeditor now works with IE.
This commit is contained in:
		
							parent
							
								
									c2eaab4b44
								
							
						
					
					
						commit
						6801188496
					
				
					 3 changed files with 17 additions and 10 deletions
				
			
		|  | @ -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 | ||||
|             obj.log(Traceback.get(), type='error') | ||||
|             if raiseOnError: | ||||
|                 raise e | ||||
|             else: | ||||
|                 obj.log(Traceback.get(), type='error') | ||||
|                 return str(e) | ||||
| 
 | ||||
|     def process(self, obj): | ||||
|  | @ -1209,8 +1210,11 @@ class String(Type): | |||
|         self.isSelect = self.isSelection() | ||||
|         # Default width, height and maxChars vary according to String format | ||||
|         if width == None: | ||||
|             if format == String.TEXT: self.width  = 60 | ||||
|             else:                     self.width  = 30 | ||||
|             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 | ||||
|             elif self.isSelect:       self.height = 4 | ||||
|  |  | |||
|  | @ -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): | ||||
|  |  | |||
|  | @ -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> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Gaetan Delannay
						Gaetan Delannay