JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-4.0_full
[ckeditor.git] / _source / plugins / forms / dialogs / button.js
diff --git a/_source/plugins/forms/dialogs/button.js b/_source/plugins/forms/dialogs/button.js
deleted file mode 100644 (file)
index b7ae7f7..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*\r
-Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
-For licensing, see LICENSE.html or http://ckeditor.com/license\r
-*/\r
-CKEDITOR.dialog.add( 'button', function( editor )\r
-{\r
-       function commitAttributes( element )\r
-       {\r
-               var val = this.getValue();\r
-               if ( val )\r
-               {\r
-                       element.attributes[ this.id ] = val;\r
-                       if ( this.id == 'name' )\r
-                               element.attributes[ 'data-cke-saved-name' ] = val;\r
-               }\r
-               else\r
-               {\r
-                       delete element.attributes[ this.id ];\r
-                       if ( this.id == 'name' )\r
-                               delete element.attributes[ 'data-cke-saved-name' ];\r
-               }\r
-       }\r
-\r
-       return {\r
-               title : editor.lang.button.title,\r
-               minWidth : 350,\r
-               minHeight : 150,\r
-               onShow : function()\r
-               {\r
-                       delete this.button;\r
-                       var element = this.getParentEditor().getSelection().getSelectedElement();\r
-                       if ( element && element.is( 'input' ) )\r
-                       {\r
-                               var type = element.getAttribute( 'type' );\r
-                               if ( type in { button:1, reset:1, submit:1 } )\r
-                               {\r
-                                       this.button = element;\r
-                                       this.setupContent( element );\r
-                               }\r
-                       }\r
-               },\r
-               onOk : function()\r
-               {\r
-                       var editor = this.getParentEditor(),\r
-                               element = this.button,\r
-                               isInsertMode = !element;\r
-\r
-                       var fake = element ? CKEDITOR.htmlParser.fragment.fromHtml( element.getOuterHtml() ).children[ 0 ]\r
-                                       : new CKEDITOR.htmlParser.element( 'input' );\r
-                       this.commitContent( fake );\r
-\r
-                       var writer = new CKEDITOR.htmlParser.basicWriter();\r
-                       fake.writeHtml( writer );\r
-                       var newElement = CKEDITOR.dom.element.createFromHtml( writer.getHtml(), editor.document );\r
-\r
-                       if ( isInsertMode )\r
-                               editor.insertElement( newElement );\r
-                       else\r
-                       {\r
-                               newElement.replace( element );\r
-                               editor.getSelection().selectElement( newElement );\r
-                       }\r
-               },\r
-               contents : [\r
-                       {\r
-                               id : 'info',\r
-                               label : editor.lang.button.title,\r
-                               title : editor.lang.button.title,\r
-                               elements : [\r
-                                       {\r
-                                               id : 'name',\r
-                                               type : 'text',\r
-                                               label : editor.lang.common.name,\r
-                                               'default' : '',\r
-                                               setup : function( element )\r
-                                               {\r
-                                                       this.setValue(\r
-                                                                       element.data( 'cke-saved-name' ) ||\r
-                                                                       element.getAttribute( 'name' ) ||\r
-                                                                       '' );\r
-                                               },\r
-                                               commit : commitAttributes\r
-                                       },\r
-                                       {\r
-                                               id : 'value',\r
-                                               type : 'text',\r
-                                               label : editor.lang.button.text,\r
-                                               accessKey : 'V',\r
-                                               'default' : '',\r
-                                               setup : function( element )\r
-                                               {\r
-                                                       this.setValue( element.getAttribute( 'value' ) || '' );\r
-                                               },\r
-                                               commit : commitAttributes\r
-                                       },\r
-                                       {\r
-                                               id : 'type',\r
-                                               type : 'select',\r
-                                               label : editor.lang.button.type,\r
-                                               'default' : 'button',\r
-                                               accessKey : 'T',\r
-                                               items :\r
-                                               [\r
-                                                       [ editor.lang.button.typeBtn, 'button' ],\r
-                                                       [ editor.lang.button.typeSbm, 'submit' ],\r
-                                                       [ editor.lang.button.typeRst, 'reset' ]\r
-                                               ],\r
-                                               setup : function( element )\r
-                                               {\r
-                                                       this.setValue( element.getAttribute( 'type' ) || '' );\r
-                                               },\r
-                                               commit : commitAttributes\r
-                                       }\r
-                               ]\r
-                       }\r
-               ]\r
-       };\r
-});\r