mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
#1174: support HTML fields in the bulk modify forms (capability to enable/disable the field live)
SVN:trunk[3883]
This commit is contained in:
@@ -99,7 +99,7 @@ class UIHTMLEditorWidget
|
|||||||
|
|
||||||
// Could also be bound to 'instanceReady.ckeditor'
|
// Could also be bound to 'instanceReady.ckeditor'
|
||||||
$oPage->add_ready_script("$('#$iId').bind('validate', function(evt, sFormId) { return ValidateCKEditField('$iId', '', {$this->m_sMandatory}, sFormId, '') } );\n");
|
$oPage->add_ready_script("$('#$iId').bind('validate', function(evt, sFormId) { return ValidateCKEditField('$iId', '', {$this->m_sMandatory}, sFormId, '') } );\n");
|
||||||
$oPage->add_ready_script("$('#$iId').bind('update', function() { BlockField('cke_$iId', $('#$iId').attr('disabled')); } );\n");
|
$oPage->add_ready_script("$('#$iId').bind('update', function() { BlockField('cke_$iId', $('#$iId').attr('disabled')); $(this).data('ckeditorInstance').setReadOnly($(this).prop('disabled')); } );\n");
|
||||||
|
|
||||||
return $sHtmlValue;
|
return $sHtmlValue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -280,6 +280,11 @@ legend.transparent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.ui-widget-content td a.cke_toolbox_collapser {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
p a:hover, td a:hover {
|
p a:hover, td a:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
color: #e87c1e;
|
color: #e87c1e;
|
||||||
|
|||||||
@@ -224,6 +224,9 @@ legend.transparent {
|
|||||||
padding-left:14px;
|
padding-left:14px;
|
||||||
background: url(../images/mini-arrow-orange.gif) no-repeat left;
|
background: url(../images/mini-arrow-orange.gif) no-repeat left;
|
||||||
}
|
}
|
||||||
|
.ui-widget-content td a.cke_toolbox_collapser {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
p a:hover, td a:hover {
|
p a:hover, td a:hover {
|
||||||
text-decoration:underline;
|
text-decoration:underline;
|
||||||
color:$highlight-color;
|
color:$highlight-color;
|
||||||
|
|||||||
@@ -233,25 +233,32 @@ function ValidateCKEditField(sFieldId, sPattern, bMandatory, sFormId, nullValue)
|
|||||||
var bValid;
|
var bValid;
|
||||||
var sTextContent;
|
var sTextContent;
|
||||||
|
|
||||||
// Get the contents without the tags
|
if ($('#'+sFieldId).attr('disabled'))
|
||||||
var oFormattedContents = $("#cke_"+sFieldId+" iframe");
|
|
||||||
if (oFormattedContents.length == 0)
|
|
||||||
{
|
{
|
||||||
var oSourceContents = $("#cke_"+sFieldId+" textarea.cke_source");
|
bValid = true; // disabled fields are not checked
|
||||||
sTextContent = oSourceContents.val();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sTextContent = oFormattedContents.contents().find("body").text();
|
// Get the contents without the tags
|
||||||
}
|
var oFormattedContents = $("#cke_"+sFieldId+" iframe");
|
||||||
|
if (oFormattedContents.length == 0)
|
||||||
if (bMandatory && (sTextContent == ''))
|
{
|
||||||
{
|
var oSourceContents = $("#cke_"+sFieldId+" textarea.cke_source");
|
||||||
bValid = false;
|
sTextContent = oSourceContents.val();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bValid = true;
|
sTextContent = oFormattedContents.contents().find("body").text();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bMandatory && (sTextContent == ''))
|
||||||
|
{
|
||||||
|
bValid = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bValid = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReportFieldValidationStatus(sFieldId, sFormId, bValid, '');
|
ReportFieldValidationStatus(sFieldId, sFormId, bValid, '');
|
||||||
|
|||||||
Reference in New Issue
Block a user