[Kimchi-devel] [PATCH] UI: Adding new textbox widget to new kimchi UI

Wen Wang wenwang at linux.vnet.ibm.com
Fri Jan 23 09:41:44 UTC 2015


Signed-off-by: Wen Wang <wenwang at linux.vnet.ibm.com>
---
 ui/css/theme-default/textbox-flat.css | 22 ++++++++++++++++++++
 ui/js/widgets/textbox-flat.js         | 39 +++++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+)
 create mode 100644 ui/css/theme-default/textbox-flat.css
 create mode 100644 ui/js/widgets/textbox-flat.js

diff --git a/ui/css/theme-default/textbox-flat.css b/ui/css/theme-default/textbox-flat.css
new file mode 100644
index 0000000..39d5ffb
--- /dev/null
+++ b/ui/css/theme-default/textbox-flat.css
@@ -0,0 +1,22 @@
+/*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2015
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ .textbox-container {
+    border: 1px solid #CCC;
+    border-radius: 3px;
+ }
\ No newline at end of file
diff --git a/ui/js/widgets/textbox-flat.js b/ui/js/widgets/textbox-flat.js
new file mode 100644
index 0000000..80192ef
--- /dev/null
+++ b/ui/js/widgets/textbox-flat.js
@@ -0,0 +1,39 @@
+/*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2015
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// How to use:
+//     $(".selector").textboxFlat({
+//         hint: "hint"
+//     });
+
+ (function($) {
+    $.widget("kimchi.textboxFlat", {
+        optons: {
+            hint: ""
+        },
+
+        _create: function() {
+            this.element.addClass("textbox-container");
+            this.element.attr("placeholder", this.options.hint);
+        },
+
+        destroy:function() {
+            this.element.remove();
+        }
+    });
+ })(jQuery);
\ No newline at end of file
-- 
2.1.0




More information about the Kimchi-devel mailing list