web/data/cubicweb.edition.js
branchstable
changeset 2330 8c70ca715fe9
parent 2246 e89c15221a8a
child 2334 464c896bee65
equal deleted inserted replaced
2329:8b5a1af6dc35 2330:8c70ca715fe9
   452  * @param formid : the dom id of the form used
   452  * @param formid : the dom id of the form used
   453  * @param rtype : the attribute being edited
   453  * @param rtype : the attribute being edited
   454  * @param eid : the eid of the entity being edited
   454  * @param eid : the eid of the entity being edited
   455  * @param reload: boolean to reload page if true (when changing URL dependant data)
   455  * @param reload: boolean to reload page if true (when changing URL dependant data)
   456  */
   456  */
   457 function inlineValidateAttributeForm(formid, rtype, eid, divid, reload, default_value) {
   457 function inlineValidateAttributeForm(formid, rtype, eid, divid, reload,
       
   458                                      default_value, lzone) {
   458     try {
   459     try {
   459 	var form = getNode(formid);
   460 	var form = getNode(formid);
   460 	if (typeof FCKeditorAPI != "undefined") {
   461 	if (typeof FCKeditorAPI != "undefined") {
   461 	    for ( var name in FCKeditorAPI.__Instances ) {
   462 	    for ( var name in FCKeditorAPI.__Instances ) {
   462 		var oEditor = FCKeditorAPI.__Instances[name] ;
   463 		var oEditor = FCKeditorAPI.__Instances[name] ;
   465 		}
   466 		}
   466 	    }
   467 	    }
   467 	}
   468 	}
   468 	var zipped = formContents(form);
   469 	var zipped = formContents(form);
   469 	var d = asyncRemoteExec('edit_field', 'apply', zipped[0], zipped[1],
   470 	var d = asyncRemoteExec('edit_field', 'apply', zipped[0], zipped[1],
   470                                 rtype, eid, default_value);
   471                                 rtype, eid, default_value, lzone);
   471     } catch (ex) {
   472     } catch (ex) {
   472 	log('got exception', ex);
   473 	log('got exception', ex);
   473 	return false;
   474 	return false;
   474     }
   475     }
   475     d.addCallback(function (result, req) {
   476     d.addCallback(function (result, req) {
   492 	return false;
   493 	return false;
   493     });
   494     });
   494     return false;
   495     return false;
   495 }
   496 }
   496 
   497 
   497 function inlineValidateRelationForm(formid, rtype, role, eid, divid, vid, default_value) {
   498 function inlineValidateRelationForm(formid, rtype, role, eid, divid, vid,
       
   499                                     default_value, escape, lzone) {
   498     try {
   500     try {
   499 	var form = getNode(formid);
   501 	var form = getNode(formid);
   500         var relname = rtype + ':' + eid;
   502         var relname = rtype + ':' + eid;
   501         var newtarget = jQuery('[name=' + relname + ']').val();
   503         var newtarget = jQuery('[name=' + relname + ']').val();
   502 	var zipped = formContents(form);
   504 	var zipped = formContents(form);
   503 	var d = asyncRemoteExec('edit_relation', 'apply', zipped[0], zipped[1], rtype, role,
   505 	var d = asyncRemoteExec('edit_relation', 'apply', zipped[0], zipped[1], rtype, role,
   504                                 eid, vid, default_value);
   506                                 eid, vid, default_value, escape, lzone);
   505     } catch (ex) {
   507     } catch (ex) {
   506 	log('got exception', ex);
   508 	log('got exception', ex);
   507 	return false;
   509 	return false;
   508     }
   510     }
   509     d.addCallback(function (result, req) {
   511     d.addCallback(function (result, req) {