Просмотр исходного кода

#1088: support of HTMLEditor in the PortalWebPage, for example if the description of a ticket is in HTML.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3538 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 10 лет назад
Родитель
Сommit
0db3c90344
1 измененных файлов с 16 добавлено и 0 удалено
  1. 16 0
      application/portalwebpage.class.inc.php

+ 16 - 0
application/portalwebpage.class.inc.php

@@ -90,6 +90,8 @@ class PortalWebPage extends NiceWebPage
 		$this->add_linked_script("../js/jquery.qtip-1.0.min.js");
 		$this->add_linked_script('../js/jquery.multiselect.min.js');
 		$this->add_linked_script("../js/ajaxfileupload.js");
+		$this->add_linked_script("../js/ckeditor/ckeditor.js");
+		$this->add_linked_script("../js/ckeditor/adapters/jquery.js");
 		$this->add_ready_script(
 <<<EOF
 try
@@ -231,6 +233,20 @@ EOF
 		var next_step = $('input[id=next_step]');
 		next_step.val(sStep);
 	}
+		
+	// For disabling the CKEditor at init time when the corresponding textarea is disabled !
+	CKEDITOR.plugins.add( 'disabler',
+	{
+		init : function( editor )
+		{
+			editor.on( 'instanceReady', function(e)
+			{
+				e.removeListener();
+				$('#'+ editor.name).trigger('update');
+			});
+		}
+		
+	});
 EOF
 );