X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=plugins%2Fforms%2Fdialogs%2Fhiddenfield.js;fp=plugins%2Fforms%2Fdialogs%2Fhiddenfield.js;h=5d84a10f45ff4cac7e62c1638914e996cba2ede3;hp=f4699b7d03c2c6604f075cbc35f4d34ba0076058;hb=a0df3d0ab0c5252b5e2e0fd274705ede834c2276;hpb=dc5b273b4cbd7e7d0167499e7649867ba2a5b408 diff --git a/plugins/forms/dialogs/hiddenfield.js b/plugins/forms/dialogs/hiddenfield.js index f4699b7..5d84a10 100644 --- a/plugins/forms/dialogs/hiddenfield.js +++ b/plugins/forms/dialogs/hiddenfield.js @@ -1,8 +1,7 @@ /* - Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. + Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ -CKEDITOR.dialog.add("hiddenfield",function(d){return{title:d.lang.forms.hidden.title,hiddenField:null,minWidth:350,minHeight:110,onShow:function(){delete this.hiddenField;var a=this.getParentEditor(),b=a.getSelection(),c=b.getSelectedElement();c&&(c.data("cke-real-element-type")&&"hiddenfield"==c.data("cke-real-element-type"))&&(this.hiddenField=c,c=a.restoreRealElement(this.hiddenField),this.setupContent(c),b.selectElement(this.hiddenField))},onOk:function(){var a=this.getValueOf("info","_cke_saved_name"); -this.getValueOf("info","value");var b=this.getParentEditor(),a=CKEDITOR.env.ie&&!(8<=CKEDITOR.document.$.documentMode)?b.document.createElement(''):b.document.createElement("input");a.setAttribute("type","hidden");this.commitContent(a);a=b.createFakeElement(a,"cke_hidden","hiddenfield");this.hiddenField?(a.replace(this.hiddenField),b.getSelection().selectElement(a)):b.insertElement(a);return!0},contents:[{id:"info",label:d.lang.forms.hidden.title,title:d.lang.forms.hidden.title, -elements:[{id:"_cke_saved_name",type:"text",label:d.lang.forms.hidden.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){this.getValue()?a.setAttribute("name",this.getValue()):a.removeAttribute("name")}},{id:"value",type:"text",label:d.lang.forms.hidden.value,"default":"",accessKey:"V",setup:function(a){this.setValue(a.getAttribute("value")||"")},commit:function(a){this.getValue()?a.setAttribute("value",this.getValue()): -a.removeAttribute("value")}}]}]}}); \ No newline at end of file +CKEDITOR.dialog.add("hiddenfield",function(d){return{title:d.lang.forms.hidden.title,hiddenField:null,minWidth:350,minHeight:110,onShow:function(){delete this.hiddenField;var a=this.getParentEditor(),b=a.getSelection(),c=b.getSelectedElement();c&&(c.data("cke-real-element-type")&&"hiddenfield"==c.data("cke-real-element-type"))&&(this.hiddenField=c,c=a.restoreRealElement(this.hiddenField),this.setupContent(c),b.selectElement(this.hiddenField))},onOk:function(){var a=this.getValueOf("info","_cke_saved_name"), +b=this.getParentEditor(),a=8>CKEDITOR.document.$.documentMode?'':"input",a=CKEDITOR.env.ie&&b.document.createElement(a);a.setAttribute("type","hidden");this.commitContent(a);a=b.createFakeElement(a,"cke_hidden","hiddenfield");this.hiddenField?(a.replace(this.hiddenField),b.getSelection().selectElement(a)):b.insertElement(a);return!0},contents:[{id:"info",label:d.lang.forms.hidden.title,title:d.lang.forms.hidden.title,elements:[{id:"_cke_saved_name",type:"text", +label:d.lang.forms.hidden.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){this.getValue()?a.setAttribute("name",this.getValue()):a.removeAttribute("name")}},{id:"value",type:"text",label:d.lang.forms.hidden.value,"default":"",accessKey:"V",setup:function(a){this.setValue(a.getAttribute("value")||"")},commit:function(a){this.getValue()?a.setAttribute("value",this.getValue()):a.removeAttribute("value")}}]}]}}); \ No newline at end of file