web/data/cubicweb.ajax.js
branchstable
changeset 3060 ea967a4f6ccb
parent 3011 657dfe374b08
child 3073 09c6fe0db381
child 3075 e9b7cd2e9012
equal deleted inserted replaced
3055:06814d57514f 3060:ea967a4f6ccb
    49     if (typeof(Sortable) != 'undefined') {
    49     if (typeof(Sortable) != 'undefined') {
    50 	Sortable.sortTables(node);
    50 	Sortable.sortTables(node);
    51     }
    51     }
    52     // find textareas and wrap them if there are some
    52     // find textareas and wrap them if there are some
    53     if (typeof(FCKeditor) != 'undefined') {
    53     if (typeof(FCKeditor) != 'undefined') {
    54 	buildWysiwygEditors(node);
    54 	buildWysiwygEditors();
    55     }
    55     }
    56     if (typeof initFacetBoxEvents != 'undefined') {
    56     if (typeof initFacetBoxEvents != 'undefined') {
    57 	initFacetBoxEvents(node);
    57 	initFacetBoxEvents(node);
    58     }
    58     }
    59     if (typeof buildWidgets != 'undefined') {
    59     if (typeof buildWidgets != 'undefined') {
   349  *
   349  *
   350  * replace all textareas with fckeditors.
   350  * replace all textareas with fckeditors.
   351  */
   351  */
   352 function buildWysiwygEditors(parent) {
   352 function buildWysiwygEditors(parent) {
   353     jQuery('textarea').each(function () {
   353     jQuery('textarea').each(function () {
   354 	if (this.getAttribute('cubicweb:type', 'wysiwyg')) {
   354 	if (this.getAttribute('cubicweb:type') == 'wysiwyg') {
       
   355             // mark editor as instanciated, we may be called a number of times
       
   356             // (see postAjaxLoad)
       
   357             this.setAttribute('cubicweb:type', 'fckeditor');
   355 	    if (typeof FCKeditor != "undefined") {
   358 	    if (typeof FCKeditor != "undefined") {
   356 		var fck = new FCKeditor(this.id);
   359 		var fck = new FCKeditor(this.id);
   357 		fck.Config['CustomConfigurationsPath'] = fckconfigpath;
   360 		fck.Config['CustomConfigurationsPath'] = fckconfigpath;
   358 		fck.Config['DefaultLanguage'] = fcklang;
   361 		fck.Config['DefaultLanguage'] = fcklang;
   359 		fck.BasePath = "fckeditor/";
   362 		fck.BasePath = "fckeditor/";