[Kimchi-devel] [PATCH] [Wok 1/6] Remove legacy code under ui/js/widgets
Aline Manera
alinefm at linux.vnet.ibm.com
Mon Feb 8 20:04:16 UTC 2016
All files under ui/js/widgets/ are not needed for the current UI
implementation. So remove them.
Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
---
ui/js/Makefile.am | 4 +-
ui/js/widgets/button-dropDown.js | 37 --
ui/js/widgets/button-flat.js | 421 ---------------------
ui/js/widgets/checkbox-flat.js | 88 -----
ui/js/widgets/circleGauge.js | 102 -----
ui/js/widgets/combobox.js | 129 -------
ui/js/widgets/dialog-flat.js | 122 ------
ui/js/widgets/filter-select.js | 138 -------
ui/js/widgets/gauge-flat.js | 128 -------
ui/js/widgets/line.js | 74 ----
ui/js/widgets/list-flat.js | 78 ----
ui/js/widgets/menu-flat.js | 116 ------
ui/js/widgets/message-flat.js | 99 -----
ui/js/widgets/messagebar-flat.js | 73 ----
ui/js/widgets/radio-flat.js | 88 -----
ui/js/widgets/samples/README.md | 1 -
ui/js/widgets/samples/dialog.html | 53 ---
ui/js/widgets/samples/gauge-flat.html | 55 ---
ui/js/widgets/samples/grid.html | 82 ----
ui/js/widgets/samples/line.html | 170 ---------
ui/js/widgets/samples/list.html | 48 ---
.../menu-button-radio-checkbox-text-select.html | 104 -----
ui/js/widgets/samples/message.html | 51 ---
ui/js/widgets/samples/messagebar-flat.html | 51 ---
ui/js/widgets/samples/tabs.html | 70 ----
ui/js/widgets/select-menu.js | 86 -----
ui/js/widgets/selectmenu-flat.js | 132 -------
ui/js/widgets/textbox-flat.js | 41 --
28 files changed, 2 insertions(+), 2639 deletions(-)
delete mode 100644 ui/js/widgets/button-dropDown.js
delete mode 100755 ui/js/widgets/button-flat.js
delete mode 100644 ui/js/widgets/checkbox-flat.js
delete mode 100644 ui/js/widgets/circleGauge.js
delete mode 100644 ui/js/widgets/combobox.js
delete mode 100644 ui/js/widgets/dialog-flat.js
delete mode 100644 ui/js/widgets/filter-select.js
delete mode 100755 ui/js/widgets/gauge-flat.js
delete mode 100644 ui/js/widgets/line.js
delete mode 100644 ui/js/widgets/list-flat.js
delete mode 100644 ui/js/widgets/menu-flat.js
delete mode 100644 ui/js/widgets/message-flat.js
delete mode 100644 ui/js/widgets/messagebar-flat.js
delete mode 100644 ui/js/widgets/radio-flat.js
delete mode 100644 ui/js/widgets/samples/README.md
delete mode 100644 ui/js/widgets/samples/dialog.html
delete mode 100644 ui/js/widgets/samples/gauge-flat.html
delete mode 100644 ui/js/widgets/samples/grid.html
delete mode 100644 ui/js/widgets/samples/line.html
delete mode 100644 ui/js/widgets/samples/list.html
delete mode 100644 ui/js/widgets/samples/menu-button-radio-checkbox-text-select.html
delete mode 100644 ui/js/widgets/samples/message.html
delete mode 100644 ui/js/widgets/samples/messagebar-flat.html
delete mode 100644 ui/js/widgets/samples/tabs.html
delete mode 100644 ui/js/widgets/select-menu.js
delete mode 100644 ui/js/widgets/selectmenu-flat.js
delete mode 100644 ui/js/widgets/textbox-flat.js
diff --git a/ui/js/Makefile.am b/ui/js/Makefile.am
index feaacb5..832365f 100644
--- a/ui/js/Makefile.am
+++ b/ui/js/Makefile.am
@@ -17,13 +17,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-EXTRA_DIST = src widgets
+EXTRA_DIST = src
jsdir = $(datadir)/wok/ui/js
dist_js_DATA = wok.min.js $(filter-out wok.min.js, $(wildcard *.js))
-wok.min.js: widgets/*.js src/*.js
+wok.min.js: src/*.js
cat $(sort $^) > $@
CLEANFILES = wok.min.js
diff --git a/ui/js/widgets/button-dropDown.js b/ui/js/widgets/button-dropDown.js
deleted file mode 100644
index a4f20e9..0000000
--- a/ui/js/widgets/button-dropDown.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2014-2015
- *
- * Code derived from Project Kimchi
- *
- * 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.
- */
-(function($) {
- $.widget('wok.dropdownButton', {
-
- _create : function() {
- this.actionDiv = this.element;
- this.actionDiv.addClass('btn dropdown popable');
- this.actionDiv.find('div').addClass('popover');
- this.actionDiv.find('button').addClass('button-big');
- },
-
- destroy : function() {
- this.actionDiv.removeClass('btn dropdown popable');
- this.actionDiv.find('div').removeClass('popover');
- this.actionDiv.find('button').removeClass('button-big');
- $.Widget.prototype.destroy.call(this);
- }
- });
-}(jQuery));
diff --git a/ui/js/widgets/button-flat.js b/ui/js/widgets/button-flat.js
deleted file mode 100755
index 12d1dc9..0000000
--- a/ui/js/widgets/button-flat.js
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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.
- */
-
-(function( factory ) {
- if ( typeof define === "function" && define.amd ) {
-
- // AMD. Register as an anonymous module.
- define([
- "jquery",
- "./core",
- "./widget"
- ], factory );
- } else {
-
- // Browser globals
- factory( jQuery );
- }
-}(function( $ ) {
-
-var lastActive,
- baseClasses = "ui-button ui-widget",
- typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
- formResetHandler = function() {
- var form = $( this );
- setTimeout(function() {
- form.find( ":ui-button" ).button( "refresh" );
- }, 1 );
- },
- radioGroup = function( radio ) {
- var name = radio.name,
- form = radio.form,
- radios = $( [] );
- if ( name ) {
- name = name.replace( /'/g, "\\'" );
- if ( form ) {
- radios = $( form ).find( "[name='" + name + "'][type=radio]" );
- } else {
- radios = $( "[name='" + name + "'][type=radio]", radio.ownerDocument )
- .filter(function() {
- return !this.form;
- });
- }
- }
- return radios;
- };
-
-$.widget( "wok.buttonFlat", {
- version: "@VERSION",
- defaultElement: "<button>",
- options: {
- disabled: null,
- text: true,
- label: null,
- icons: {
- primary: null,
- secondary: null
- }
- },
- _create: function() {
- this.element.closest( "form" )
- .unbind( "reset" + this.eventNamespace )
- .bind( "reset" + this.eventNamespace, formResetHandler );
-
- if ( typeof this.options.disabled !== "boolean" ) {
- this.options.disabled = !!this.element.prop( "disabled" );
- } else {
- this.element.prop( "disabled", this.options.disabled );
- }
-
- this._determineButtonType();
- this.hasTitle = !!this.buttonElement.attr( "title" );
-
- var that = this,
- options = this.options,
- toggleButton = this.type === "checkbox" || this.type === "radio",
- activeClass = !toggleButton ? "ui-state-active" : "";
-
- if ( options.label === null ) {
- options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());
- }
-
- this._hoverable( this.buttonElement );
-
- this.buttonElement
- .addClass( baseClasses )
- .attr( "role", "button" )
- .bind( "mouseenter" + this.eventNamespace, function() {
- if ( options.disabled ) {
- return;
- }
- if ( this === lastActive ) {
- $( this ).addClass( "ui-state-active" );
- }
- })
- .bind( "mouseleave" + this.eventNamespace, function() {
- if ( options.disabled ) {
- return;
- }
- $( this ).removeClass( activeClass );
- })
- .bind( "click" + this.eventNamespace, function( event ) {
- if ( options.disabled ) {
- event.preventDefault();
- event.stopImmediatePropagation();
- }
- });
-
- // Can't use _focusable() because the element that receives focus
- // and the element that gets the ui-state-focus class are different
- this._on({
- focus: function() {
- this.buttonElement.addClass( "ui-state-focus" );
- },
- blur: function() {
- this.buttonElement.removeClass( "ui-state-focus" );
- }
- });
-
- if ( toggleButton ) {
- this.element.bind( "change" + this.eventNamespace, function() {
- that.refresh();
- });
- }
-
- if ( this.type === "checkbox" ) {
- this.buttonElement.bind( "click" + this.eventNamespace, function() {
- if ( options.disabled ) {
- return false;
- }
- });
- } else if ( this.type === "radio" ) {
- this.buttonElement.bind( "click" + this.eventNamespace, function() {
- if ( options.disabled ) {
- return false;
- }
- $( this ).addClass( "ui-state-active" );
- that.buttonElement.attr( "aria-pressed", "true" );
-
- var radio = that.element[ 0 ];
- radioGroup( radio )
- .not( radio )
- .map(function() {
- return $( this ).button( "widget" )[ 0 ];
- })
- .removeClass( "ui-state-active" )
- .attr( "aria-pressed", "false" );
- });
- } else {
- this.buttonElement
- .bind( "mousedown" + this.eventNamespace, function() {
- if ( options.disabled ) {
- return false;
- }
- $( this ).addClass( "ui-state-active" );
- lastActive = this;
- that.document.one( "mouseup", function() {
- lastActive = null;
- });
- })
- .bind( "mouseup" + this.eventNamespace, function() {
- if ( options.disabled ) {
- return false;
- }
- $( this ).removeClass( "ui-state-active" );
- })
- .bind( "keydown" + this.eventNamespace, function(event) {
- if ( options.disabled ) {
- return false;
- }
- if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {
- $( this ).addClass( "ui-state-active" );
- }
- })
- // see #8559, we bind to blur here in case the button element loses
- // focus between keydown and keyup, it would be left in an "active" state
- .bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
- $( this ).removeClass( "ui-state-active" );
- });
-
- if ( this.buttonElement.is("a") ) {
- this.buttonElement.keyup(function(event) {
- if ( event.keyCode === $.ui.keyCode.SPACE ) {
- // TODO pass through original event correctly (just as 2nd argument doesn't work)
- $( this ).click();
- }
- });
- }
- }
-
- this._setOption( "disabled", options.disabled );
- this._resetButton();
- },
-
- _determineButtonType: function() {
- var ancestor, labelSelector, checked;
-
- if ( this.element.is("[type=checkbox]") ) {
- this.type = "checkbox";
- } else if ( this.element.is("[type=radio]") ) {
- this.type = "radio";
- } else if ( this.element.is("input") ) {
- this.type = "input";
- } else {
- this.type = "button";
- }
-
- if ( this.type === "checkbox" || this.type === "radio" ) {
- // we don't search against the document in case the element
- // is disconnected from the DOM
- ancestor = this.element.parents().last();
- labelSelector = "label[for='" + this.element.attr("id") + "']";
- this.buttonElement = ancestor.find( labelSelector );
- if ( !this.buttonElement.length ) {
- ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
- this.buttonElement = ancestor.filter( labelSelector );
- if ( !this.buttonElement.length ) {
- this.buttonElement = ancestor.find( labelSelector );
- }
- }
- this.element.addClass( "ui-helper-hidden-accessible" );
-
- checked = this.element.is( ":checked" );
- if ( checked ) {
- this.buttonElement.addClass( "ui-state-active" );
- }
- this.buttonElement.prop( "aria-pressed", checked );
- } else {
- this.buttonElement = this.element;
- }
- },
-
- widget: function() {
- return this.buttonElement;
- },
-
- _destroy: function() {
- this.element
- .removeClass( "ui-helper-hidden-accessible" );
- this.buttonElement
- .removeClass( baseClasses + " ui-state-active " + typeClasses )
- .removeAttr( "role" )
- .removeAttr( "aria-pressed" )
- .html( this.buttonElement.find(".ui-button-text").html() );
-
- if ( !this.hasTitle ) {
- this.buttonElement.removeAttr( "title" );
- }
- },
-
- _setOption: function( key, value ) {
- this._super( key, value );
- if ( key === "disabled" ) {
- this.widget().toggleClass( "ui-state-disabled", !!value );
- this.element.prop( "disabled", !!value );
- if ( value ) {
- if ( this.type === "checkbox" || this.type === "radio" ) {
- this.buttonElement.removeClass( "ui-state-focus" );
- } else {
- this.buttonElement.removeClass( "ui-state-focus ui-state-active" );
- }
- }
- return;
- }
- this._resetButton();
- },
-
- refresh: function() {
- //See #8237 & #8828
- var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
-
- if ( isDisabled !== this.options.disabled ) {
- this._setOption( "disabled", isDisabled );
- }
- if ( this.type === "radio" ) {
- radioGroup( this.element[0] ).each(function() {
- if ( $( this ).is( ":checked" ) ) {
- $( this ).button( "widget" )
- .addClass( "ui-state-active" )
- .attr( "aria-pressed", "true" );
- } else {
- $( this ).button( "widget" )
- .removeClass( "ui-state-active" )
- .attr( "aria-pressed", "false" );
- }
- });
- } else if ( this.type === "checkbox" ) {
- if ( this.element.is( ":checked" ) ) {
- this.buttonElement
- .addClass( "ui-state-active" )
- .attr( "aria-pressed", "true" );
- } else {
- this.buttonElement
- .removeClass( "ui-state-active" )
- .attr( "aria-pressed", "false" );
- }
- }
- },
-
- _resetButton: function() {
- if ( this.type === "input" ) {
- if ( this.options.label ) {
- this.element.val( this.options.label );
- }
- return;
- }
- var buttonElement = this.buttonElement.removeClass( typeClasses ),
- buttonText = $( "<span></span>", this.document[0] )
- .addClass( "ui-button-text" )
- .html( this.options.label )
- .appendTo( buttonElement.empty() )
- .text(),
- icons = this.options.icons,
- multipleIcons = icons.primary && icons.secondary,
- buttonClasses = [];
-
- if ( icons.primary || icons.secondary ) {
- if ( this.options.text ) {
- buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
- }
-
- if ( icons.primary ) {
- buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
- }
-
- if ( icons.secondary ) {
- buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
- }
-
- if ( !this.options.text ) {
- buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
-
- if ( !this.hasTitle ) {
- buttonElement.attr( "title", $.trim( buttonText ) );
- }
- }
- } else {
- buttonClasses.push( "ui-button-text-only" );
- }
- buttonElement.addClass( buttonClasses.join( " " ) );
- }
-});
-
-$.widget( "ui.buttonset", {
- version: "@VERSION",
- options: {
- items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
- },
-
- _create: function() {
- this.element.addClass( "ui-buttonset" );
- },
-
- _init: function() {
- this.refresh();
- },
-
- _setOption: function( key, value ) {
- if ( key === "disabled" ) {
- this.buttons.button( "option", key, value );
- }
-
- this._super( key, value );
- },
-
- refresh: function() {
- var rtl = this.element.css( "direction" ) === "rtl",
- allButtons = this.element.find( this.options.items ),
- existingButtons = allButtons.filter( ":ui-button" );
-
- // Initialize new buttons
- allButtons.not( ":ui-button" ).button();
-
- // Refresh existing buttons
- existingButtons.button( "refresh" );
-
- this.buttons = allButtons
- .map(function() {
- return $( this ).button( "widget" )[ 0 ];
- })
- .removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
- .filter( ":first" )
- .addClass( rtl ? "ui-corner-right" : "ui-corner-left" )
- .end()
- .filter( ":last" )
- .addClass( rtl ? "ui-corner-left" : "ui-corner-right" )
- .end()
- .end();
- },
-
- _destroy: function() {
- this.element.removeClass( "ui-buttonset" );
- this.buttons
- .map(function() {
- return $( this ).button( "widget" )[ 0 ];
- })
- .removeClass( "ui-corner-left ui-corner-right" )
- .end()
- .button( "destroy" );
- }
-});
-
-return $.ui.button;
-
-}));
diff --git a/ui/js/widgets/checkbox-flat.js b/ui/js/widgets/checkbox-flat.js
deleted file mode 100644
index cd22205..0000000
--- a/ui/js/widgets/checkbox-flat.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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").checkboxFlat({
-// id: "t", //Checkbox base id.
-// name: "test", //Checkbox name.
-// content: ["apple", "banana", "orange", "cherry"], //Contents of the checkbox set.
-// checked: [1,3] //Set the checked item, which starts with number 1.
-// });
-// $(".selector").click(function() {
-// console.log($(".selector").checkboxFlat("value")); //Get value of the checked checkbox.
-// });
-
- (function($) {
- $.widget("wok.checkboxFlat", {
- options: {
- id: "",
- name: "",
- content: [],
- checked: []
- },
-
- _create: function() {
- var that = this;
- var idBase = that.options.id;
- var name = that.options.name;
- var checked = that.options.checked;
- var content = that.options.content;
- var html = "";
- for (var i=1;i<content.length+1;i++) {
- if($.inArray(i,checked) < 0) {
- html += "<div class='checkbox-item checkbox-inline icon-check-empty-1' id='" + idBase + i + "' name='" + name + "'></div>" +
- "<label class='checkbox-label checkbox-inline' for='" + idBase + i + "'>" + content[i-1] + "</label>";
- } else {
- html += "<div class='checkbox-item checkbox-inline icon-ok-squared' id='" + idBase + i + "' name='" + name + "'></div>" +
- "<label class='checkbox-label checkbox-inline' for='" + idBase + i + "'>" + content[i-1] + "</label>";
- }
- }
- $(html).appendTo(that.element);
- $(".checkbox-item").on("click", function() {
- var tickID = $(this).attr("id");
- var tick = tickID.substring(idBase.length,tickID.length);
- if($(this).hasClass("icon-check-empty-1")) {
- $(this).removeClass("icon-check-empty-1");
- $(this).addClass("icon-ok-squared");
- checked.push(Number(tick));
- } else {
- $(this).removeClass("icon-ok-squared");
- $(this).addClass("icon-check-empty-1");
- checked.splice($.inArray(Number(tick),checked),1);
- }
- });
- },
-
- value: function() {
- var value = new Array();
- var vContent = this.options.content;
- var vChencked = this.options.checked;
- for(var i=0;i<vChencked.length;i++) {
- value.push(vContent[vChencked[i]-1]);
- }
- return value;
- },
-
- _destroy: function() {
- this.element.remove();
- }
- });
- })(jQuery);
diff --git a/ui/js/widgets/circleGauge.js b/ui/js/widgets/circleGauge.js
deleted file mode 100644
index b093143..0000000
--- a/ui/js/widgets/circleGauge.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2014-2015
- *
- * Code derived from Project Kimchi
- *
- * 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.
- */
- (function($) {
- $.widget('wok.circleGauge', {
-
- options : {
- color : '#87C004',
- fillColor : '#87C004',
- lineWidth : 20,
- shadowSize : '2px',
- font : 'bold 13px Geneva, sans-serif',
- textAlign : 'center',
- radius : 35,
- peakRate : 100,
- display : 0,
- circle : 0,
- label : ''
- },
-
- _create : function() {
- //valuesAttr="{" + this.element.data('value')+ "}";
- //console.info(valuesAttr);
- //values=eval("(" + valuesAttr + ")");
- //$.extend(this.options, values);
- this.options.display=this.element.data('display');
- this.options.percentage=this.element.data('percentage');
- this._fixupPeakRate();
- this._draw();
- },
-
- setValues : function(values) {
- $.extend(this.options, values);
- this._fixupPeakRate();
- this._draw();
- },
-
- _fixupPeakRate : function() {
- if (this.options.circle>this.options.peakRate) {
- this.options.peakRate=this.options.circle;
- }
- },
-
- _draw : function() {
- this.element.empty();
- var canvas = document.createElement('canvas');
- //this.element.append($(canvas)); //I don't quite understand this line so trying the one below...
- this.element.append(canvas);
-
- var ctx = canvas.getContext('2d');
- var radius = this.options.radius;
-
- var shadowSize = 2;
- var width = height = radius * 2;
- $(canvas).attr('height', height);
- $(canvas).attr('width', width);
-
- $(canvas).css({
- 'boxShadow' : shadowSize + 'px ' + shadowSize + 'px ' + shadowSize + 'px #fff, -' + shadowSize + 'px -' + shadowSize + 'px ' + shadowSize + 'px #eaeaea',
- borderRadius : radius + 'px'
- });
-
- ctx.clearRect(0, 0, width, height);
- ctx.fillStyle = this.options.fillColor;
- ctx.font = this.options.font;
- ctx.textAlign = 'center';
- var originPos = radius;
- ctx.textBaseline = 'middle';
- ctx.fillText(this.options.display, originPos, originPos);
- ctx.strokeStyle = this.options.color;
- ctx.lineWidth = this.options.lineWidth;
- ctx.beginPath();
- ctx.arc(originPos, originPos, radius, -.5 * Math.PI, (this.options.percentage / 50 - .5) * Math.PI);
- ctx.stroke();
- },
-
- destroy : function() {
- this.element.empty();
- $.Widget.prototype.destroy.call(this);
- }
- });
-}(jQuery));
-
-wok.circleGauge = function(selector) {
- $(selector).circleGauge();
-};
diff --git a/ui/js/widgets/combobox.js b/ui/js/widgets/combobox.js
deleted file mode 100644
index c2bb75b..0000000
--- a/ui/js/widgets/combobox.js
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2014-2015
- *
- * Code derived from Project Kimchi
- *
- * 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.
- */
-(function($) {
- $.widget('wok.combobox', {
- _create : function() {
- this.selectDiv = this.element;
- this.listControl = this.selectDiv.find('ul').first();
- this.listControl.html('');
- this.target = this.selectDiv.find('input').first();
- this.selectDiv.addClass('btn-select dropdown popable');
- this.target.addClass('input');
- this.target.width(this.selectDiv.width()+10);
- this.listControl.addClass('select-list');
- this.listControl.parent().addClass('popover');
- },
-
- setData : function(options) {
- var that = this;
- var value = this.target.val();
- var selectedClass = 'active';
- var itemTag = 'li';
- if (options.length > 0) {
- that.target.after($('<span class="arrow"></span>'));
- that.listControl.on('click', itemTag, function(e) {
- that.listControl.children().removeClass(selectedClass);
- $(this).addClass(selectedClass);
- var oldValue = that.target.val();
- var newValue = $(this).data('value');
- that.target.val(newValue);
- if (oldValue !== newValue) {
- that.target.change();
- }
- });
-
- that.selectDiv.click(function(e) {
- that.listControl.html('');
- var items = that._dataList(options);
- $.each(items, function(index, item) {
- that.listControl.append(item);
- })
- });
-
- that.target.keyup(function(event) {
- that.listControl.html('');
- var items = that._dataList(options);
- var temp = 0;
- $.each(items, function(index, item) {
- if (item.text().indexOf(that.target.val()) == 0) {
- that.listControl.append(item);
- temp++;
- }
- });
- if (temp > 0 && that.listControl.html() !== '') {
- that._open();
- } else {
- that._close();
- }
- });
- }
- },
-
- value : function(value) {
- if (value === undefined) {
- return this.target.val();
- }
- this.target.val(value);
- },
-
- _dataList : function(options) {
- var item;
- var itemTag = 'li';
- var selectedClass = 'active';
- var items = [];
- var that = this;
- $.each(options, function(index, option) {
- item = $('<' + itemTag + '>' + option.label +'</' + itemTag + '>');
- item.data('value', option.value);
- if (option.value === that.target.val()) {
- item.addClass(selectedClass);
- }
- items.push(item);
- });
- return items;
- },
-
- clear : function() {
- this.target.val("");
- },
-
- _open : function() {
- var isOpen = this.selectDiv.hasClass('open');
- if (!isOpen) {
- this.selectDiv.addClass('open');
- }
- },
-
- _close : function() {
- var isOpen = this.selectDiv.hasClass('open');
- if (isOpen) {
- this.selectDiv.removeClass('open');
- }
- },
-
- destroy : function() {
- this.selectDiv.removeClass('btn-select dropdown popable');
- this.target.removeClass('input');
- this.listControl.removeClass('select-list');
- this.listControl.parent().removeClass('popover');
- $.Widget.prototype.destroy.call(this);
- }
- });
-}(jQuery));
diff --git a/ui/js/widgets/dialog-flat.js b/ui/js/widgets/dialog-flat.js
deleted file mode 100644
index b70af22..0000000
--- a/ui/js/widgets/dialog-flat.js
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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").dialogFlat({
- * title: "Demo", //Title of the dialog.
- * confirmText: "Ok", //Text of the confirm button, "Ok" is the default value.
- * cancelText: "Cancel", //Text of the cancel button.
- * width: "300", //Width of the dialog, "px" is the default unit.
- * height: "500", //Height of the dialog, "px" is the default unit.
- * confirmFunc: function() {
- * //Function after confirm
- * }
- * });
- */
-
-(function( $ ) {
- $.widget("wok.dialogFlat", {
- options: {
- title: "",
- autoOpen: true,
- confirmText: "Ok",
- cancelText: "Cancel",
- confirmFunc: null,
- height: "150",
- width: "150"
- },
-
- _create: function() {
- var that = this;
- var w = that.options.width;
- var h = that.options.height;
- $(".body").addClass("style:'opacity:0.5'");
- that._open();
- that._setSize(w, h);
- $(".dialog-container .dialog-cancel").on("click", that._destroy);
- $(".dialog-container .dialog-okay").on("click", function() {
- that._trigger("confirmFunc");
- that._destroy();
- });
- },
-
- _open: function() {
- var cfmTxt = this.options.confirmText;
- var celTxt = this.options.cancelText;
- var titleTxt = this.options.title;
- var html =
- "<div id='dialog-overlay'></div>" +
- "<div class='dialog-border-grey'>" +
- "<div class='dialog-container'>" +
- "<div class='dialog-title h1 dark-gray'>" + titleTxt + "</div>" +
- "<div class='dialog-body'>dafafdafdas</div>" +
- "<div class='dialog-footer'>" +
- "<div class='dialog-button dialog-okay'>" + cfmTxt + "</div>" +
- "<div class='dialog-button dialog-cancel'>" + celTxt + "</div>" +
- "</div>" +
- "</div>" +
- "</div>";
- if (this.options.autoOpen) {
- $(html).appendTo($("body"));
- var pageWidth = window.screen.width;
- var pageHeight = window.screen.height;
- var pageLeft = document.screenLeft
- var pageTop = document.screenTop;
- var topOffset = "-" + pageHeight + "px";
- $("#dialog-overlay").css({
- "opacity": "0.5",
- "Left": pageLeft,
- "Top": pageTop,
- "background-color": "white",
- "width": pageWidth,
- "height": pageHeight,
- "margin-top": topOffset,
- "overflow": "hidden"
- });
- }
- },
-
- _setSize: function(width, height) {
- var wid = width + "px";
- var hei = height + "px";
- var cHeight = (height - 4) + "px";
- var bHeight = (height - 54) + "px";
- var tWidth = (width - 25) + "px";
- $(".dialog-border-grey").css({
- "width": wid,
- "height": hei
- });
- $(".dialog-container").css({
- "height": cHeight
- });
- $(".dialog-container .dialog-body").css({
- "height": bHeight
- });
- $(".dialog-container .dialog-title").css({
- "width": tWidth
- });
- },
-
- _destroy: function() {
- $(".dialog-border-grey").remove();
- $("#dialog-overlay").remove();
- }
- });
-})(jQuery);
diff --git a/ui/js/widgets/filter-select.js b/ui/js/widgets/filter-select.js
deleted file mode 100644
index d884962..0000000
--- a/ui/js/widgets/filter-select.js
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2014-2015
- *
- * Code derived from Project Kimchi
- *
- * 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.
- */
-(function($) {
- $.widget('wok.filterselect', {
- _create : function() {
- this.selectDiv = this.element;
- this.listControl = this.selectDiv.find('ul').first();
- this.listControl.html('');
- this.target = this.selectDiv.find('input').first();
- this.selectDiv.addClass('btn-select dropdown popable');
- this.target.addClass('input');
- this.target.width(this.selectDiv.width()+10);
- this.listControl.addClass('select-list');
- this.listControl.parent().addClass('popover');
- },
-
- setData : function(options) {
- var that = this;
- var value = this.target.val();
- var selectedClass = 'active';
- var itemTag = 'li';
- if (options.length > 0) {
- that.target.after($('<span class="arrow"></span>'));
- that.listControl.on('click', itemTag, function(e) {
- that.listControl.children().removeClass(selectedClass);
- $(this).addClass(selectedClass);
- var oldValue = that.target.val();
- var newValue = $(this).data('value');
- that.target.val(newValue);
- if (oldValue !== newValue) {
- that.target.change();
- that.target.removeClass("invalid-field");
- }
- });
-
- that.selectDiv.click(function(e) {
- that.listControl.html('');
- var items = that._dataList(options);
- if (items.length === 0) {
- that.listControl.html(i18n['WOKAPI6005E']);
- } else {
- $.each(items, function(index, item) {
- that.listControl.append(item);
- });
- }
- });
-
- that.target.keyup(function(event) {
- that.listControl.html('');
- var items = that._dataList(options);
- var temp = 0;
- $.each(items, function(index, item) {
- if (item.text().indexOf(that.target.val()) == 0) {
- that.listControl.append(item);
- temp++;
- }
- });
- if (that.listControl.html() === '') {
- that.target.addClass("invalid-field");
- that.listControl.html(i18n['WOKAPI6005E']);
- } else {
- that.target.removeClass("invalid-field");
- }
- if (temp > 0) {
- that._open();
- }
- });
- }
- },
-
- value : function(value) {
- if (value === undefined) {
- return this.target.val();
- }
- this.target.val(value);
- },
-
- _dataList : function(options) {
- var item;
- var itemTag = 'li';
- var selectedClass = 'active';
- var items = [];
- var that = this;
- $.each(options, function(index, option) {
- item = $('<' + itemTag + '>' + option.label +'</' + itemTag + '>');
- item.data('value', option.value);
- if (option.value === that.target.val()) {
- item.addClass(selectedClass);
- }
- items.push(item);
- });
- return items;
- },
-
- clear : function() {
- this.target.val("");
- },
-
- _open : function() {
- var isOpen = this.selectDiv.hasClass('open');
- if (!isOpen) {
- this.selectDiv.addClass('open');
- }
- },
-
- _close : function() {
- var isOpen = this.selectDiv.hasClass('open');
- if (isOpen) {
- this.selectDiv.removeClass('open');
- }
- },
-
- destroy : function() {
- this.selectDiv.removeClass('btn-select dropdown popable');
- this.target.removeClass('input');
- this.listControl.removeClass('select-list');
- this.listControl.parent().removeClass('popover')
- $.Widget.prototype.destroy.call(this);
- }
- });
-}(jQuery));
diff --git a/ui/js/widgets/gauge-flat.js b/ui/js/widgets/gauge-flat.js
deleted file mode 100755
index aeb0fd5..0000000
--- a/ui/js/widgets/gauge-flat.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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").gaugeFlat({
- * value: 25, // Value that you the gauge is going to show, varies from 0 to 100.
- * color: "red" // Color showed, currently only "red", "yellow", "blue" and "purple" are supported.
- * });
- *
- * Set value:
- * $(".selector").gaugeFlat("value", <value>); // Replace <value> with the value that is going to be showed.
- *
- * Get value:
- * $(".selector").gaugeFlat("value"); // This returns the value of gauge.
- *
- */
-
-(function( $ ) {
-
-return $.widget( "wok.gaugeFlat", {
- version: "@VERSION",
- options: {
- max: 100,
- value: 0,
- color: "red"
- },
-
- min: 0,
-
- _create: function() {
- this.oldValue = this.options.value = this._constrainedValue();
-
- this.element
- .addClass( "ui-gauge-flat ui-widget ui-widget-content ui-corner-all" )
- .attr({
- role: "gaugeflat",
- "aria-valuemin": this.min
- });
- var color = this.options.color;
- if(color != "red" && color != "yellow" && color != "blue" && color != "purple") {
- color = "red";
- }
-
- this.valueDiv = $( "<div class='ui-gauge-flat-value " + color + " ui-widget-header ui-corner-left'></div>" )
- .appendTo( this.element );
-
- this._refreshValue();
- },
-
- _destroy: function() {
- this.element
- .removeClass( "ui-gauge-flat ui-widget ui-widget-content ui-corner-all" )
- .removeAttr( "role" )
- .removeAttr( "aria-valuemin" )
- .removeAttr( "aria-valuemax" )
- .removeAttr( "aria-valuenow" );
-
- this.valueDiv.remove();
- },
-
- value: function( newValue ) {
- if ( newValue === undefined ) {
- return this.options.value;
- }
-
- this.options.value = this._constrainedValue( newValue );
- this._refreshValue();
- },
-
- _constrainedValue: function( newValue ) {
- if ( newValue === undefined ) {
- newValue = this.options.value;
- }
-
- this.indeterminate = newValue === false;
-
- if ( typeof newValue !== "number" ) {
- newValue = 0;
- }
-
- return this.indeterminate ? false :
- Math.min( this.options.max, Math.max( this.min, newValue ) );
- },
-
- _setOptions: function( options ) {
- var value = options.value;
- delete options.value;
-
- this._super( options );
-
- this.options.value = this._constrainedValue( value );
- this._refreshValue();
- },
-
- _percentage: function() {
- return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
- },
-
- _refreshValue: function() {
- var value = this.options.value,
- percentage = this._percentage();
-
- this.valueDiv
- .toggle( this.indeterminate || value > this.min )
- .toggleClass( "ui-corner-right", value === this.options.max )
- .width( percentage.toFixed(0) + "%" );
- }
-});
-
-})(jQuery);
diff --git a/ui/js/widgets/line.js b/ui/js/widgets/line.js
deleted file mode 100644
index 8dd10b2..0000000
--- a/ui/js/widgets/line.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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.
- */
-
-$(function(){
-$.widget("wok.line", {
- options: {
- xShift: true,
- minVal: 0,
- maxVal: 100,
- datasets: []
- },
- _create: function() {
- this._build();
- },
- _build: function() {
- this.element.empty();
- var maxX = this.element.width();
- var maxY = this.element.height();
- var svg = "<svg class='line' width='"+maxX+"' height='"+maxY+"'>";
- svg += "<line x1='0' y1='0' x2='"+maxX+"' y2='0' class='max'/>";
- svg += "<line x1='0' y1='"+maxY+"' x2='"+maxX+"' y2='"+maxY+"' class='min'/>";
- for(var i=0;i<this.options.datasets.length;i++){
- var data = this.options.datasets[i].data;
- var points = "";
- for(var j=0;j<data.length;j++){
- if(data[j]){
- var xVal = maxX/(data.length-1)*j;
- var yVal = (this.options.maxVal-data[j])*maxY/this.options.maxVal;
- points += xVal+","+yVal+" ";
- }
- }
- svg += "<polyline points='"+points+"' style='stroke:"+this.options.datasets[i].color+";'/>";
- }
- svg += "</svg>";
- this.element.append(svg);
- },
- addData: function(values){
- if(values.length<this.options.datasets.length) return;
- for(var i=0;i<this.options.datasets.length;i++){
- this.options.datasets[i].data.push(values[i]);
- if(this.options.xShift) this.options.datasets[i].data.splice(0,1);
- }
- this._build();
- },
- removeData: function(){
- for(var i=0;i<this.options.datasets.length;i++){
- var data = this.options.datasets[i].data;
- data.splice(0,1);
- if(this.options.xShift) data.push(null);
- }
- this._build();
- },
- _destroy: function() {
- this.element.empty();
- }
-});
-});
diff --git a/ui/js/widgets/list-flat.js b/ui/js/widgets/list-flat.js
deleted file mode 100644
index 12ea43d..0000000
--- a/ui/js/widgets/list-flat.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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:
- // $(".test-bar").listFlat({
- // title: "Hello World" //Set title.
- // });
- // $(".test-bar").listFlat("addItem", "Hello", "2015", "icon-user", "button1");
- // //Add one item of the list, parameters are: name, info, icon and button-id
-
-
- (function($) {
-
- $.widget("wok.listFlat", {
-
- options: {
- title: null
- },
-
- _create: function() {
- var that = this;
- var listTitle = that.options.title;
- var titleTrim = listTitle.replace(/\s*/g, "");
- var html = "";
- html += "<div class='list-titlef'>" + listTitle + "</div>" +
- "<div class='list-content' id='list" + titleTrim + "'></div>";
- $(html).appendTo(that.element);
- },
-
- _getTitle: function() {
- return this.options.title;
- },
-
- addItem: function(name, detail, icon, id) {
- var title = this._getTitle().replace(/\s/g, "");
- var usedIcon = icon || "";
- var html = "";
- html += "<div class='list-item'>" +
- "<span class='list-inline list-item-icon " + usedIcon + "'></span>" +
- "<span class='list-inline list-item-info'>"+
- "<div class='list-item-name'>" + name + "</div>" +
- "<div class='list-item-detail'>" + detail + "</div>" +
- "</span>" +
- "<span class='list-inline list-item-button' id='" + id + "'></span>" +
- "</div>";
- $(html).appendTo($("#list" + title));
- $.each($(".list-item"), function(index, data) {
- if(index%2 >0) {
- $(this).addClass("list-item-even");
- } else {
- $(this).addClass("list-item-odd");
- }
- })
- console.log("title");
- },
-
- _destory: function() {
- this.element.remove();
- }
- });
- })(jQuery);
diff --git a/ui/js/widgets/menu-flat.js b/ui/js/widgets/menu-flat.js
deleted file mode 100644
index 0da3593..0000000
--- a/ui/js/widgets/menu-flat.js
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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:
- // $("#test-bar").menuFlat({
- // content: [1,2,3,4,5,6], //Set content of the menu.
- // icon: "icon-edit-alt", //Set icon of the menu button.
- // listIconList: ["icon-edit-alt","icon-edit-alt","icon-edit-alt","icon-edit-alt","icon-edit-alt","icon-user"]
- // //Set icons of the menu list.
- // // name is optional which set the name of the menu list.
- // });
- // $("#test-bar0").on("click", function() {
- // alert("hello");
- // });
- // $("#test-bar1").on("click", function() {
- // console.log("hello");
- // });
-
-
- (function( $ ) {
- $.widget("wok.menuFlat", {
-
- options: {
- content: null,
- name: null,
- parentid: null,
- icon: null,
- listIconList: null
- },
-
- _create: function() {
- var that = this;
- var name = that.options.name || $(this.element).attr("id");
- var value = that.options.content;
- var icon = that.options.icon || "";
- var parentid = $(this.element).attr("id");
- $("#" + parentid).addClass("menu-content");
- that.options.parentid = parentid;
- var html = "<div class='menu-box' id='manu-" + name + "'>" +
- "<span class='menu-icon-front " + icon + "'></span>" +
- "<span class='menu-label'>"+ name + "</span>" +
- "<span class='menu-icon icon-down-open'></span>" +
- "</div>";
- $(html).appendTo(that.element);
- html = that._setValue(value);
- $(html).appendTo(that.element);
- $(".menu-box", "#" + parentid).on("click", that._toggleOpt);
- $(".menu-opt", "#" + parentid).on("click", that._toggleOpt);
- $(document).mouseup(function(e) {
- var container = $(".menu-opt");
- if(!container.is(e.target) && container.has(e.target).length === 0 && $(".menu-icon").hasClass("icon-up-open")) {
- $(".menu-list", "#" + parentid).prop("style", "display:none");
- $(".menu-icon", "#" + parentid).removeClass("icon-up-open");
- $(".menu-icon", "#" + parentid).addClass("icon-down-open").css({
- "background": "#4E4D4F"
- });
- }
- });
- },
-
- _setValue: function(value) {
- var that = this;
- var name = that.options.name;
- var html = "<ul class='menu-list' name='" + name + "' style='display:none'>";
- var name = this.options.name || $(this.element).attr("id");
- $.each(value, function(index, data) {
- that.options.content[index] = data.toString();
- var liIcon = that.options.listIconList[index] || "";
- html += "<li id='" + name + index + "' class='menu-opt'>" +
- "<span class='list-icon-front " + liIcon + "'></span>" +
- "<span>" + data + "</span>" +
- "</li>";
- });
- html += "</ul>"
- return html;
- },
-
- _toggleOpt: function() {
- var thisButton = $(this).parent().attr("id") || $(this).parent().parent().attr("id");
- if($(".menu-icon", "#" + thisButton).hasClass("icon-down-open")) {
- $(".menu-list", "#" + thisButton).prop("style", "display");
- $(".menu-icon", "#" + thisButton).removeClass("icon-down-open");
- $(".menu-icon", "#" + thisButton).addClass("icon-up-open").css({
- "background": "#3A393B"
- });
- } else {
- $(".menu-list", "#" + thisButton).prop("style", "display:none");
- $(".menu-icon", "#" + thisButton).removeClass("icon-up-open");
- $(".menu-icon", "#" + thisButton).addClass("icon-down-open").css({
- "background": "#4E4D4F"
- });
- }
- },
-
- _destroy: function() {
- this.element.remove();
- }
- });
- })(jQuery);
diff --git a/ui/js/widgets/message-flat.js b/ui/js/widgets/message-flat.js
deleted file mode 100644
index 4393332..0000000
--- a/ui/js/widgets/message-flat.js
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-* Project Wok
-*
-* Copyright IBM, Corp. 2015
-*
-* Code derived from Project Kimchi
-*
-* 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").messageFlat({
-* contentMain: "This is a test", //Content you are going to add
-* contentConfirm: "Sure?" //Content that inform user whether they want to continue.
-* //Default value is: "Are you sure you want to go on?"
-* confirm: function() {
-* //Function after confirm
-* }
-* });
-*/
-
-(function( $ ) {
- $.widget("wok.messageFlat", {
- options: {
- autoOpen: true,
- contentMain: null,
- contentConfirm: "Are you sure you want to go on?",
- confirm: null
- },
-
- _create: function() {
- var that = this;
- var msg = that.options.contentMain;
- var cfm = that.options.contentConfirm;
- $(".body").addClass("style:'opacity:0.5'");
- that._open();
- $(".message-type-icon").addClass("icon-help-circled-1");
- $(".message-dialog .message-content .message-main").text(msg);
- $(".message-dialog .message-confirm-info").text(cfm);
- $(".message-dialog .message-cancel").on("click", that.destroy);
- $(".message-dialog .message-okay").on("click", function() {
- that._trigger("confirm");
- that.destroy();
- });
- },
-
- _open: function() {
- var html =
- "<div id='overlay'></div>" +
- "<div class='border-grey'>" +
- "<div class='message-dialog'>" +
- "<div class='message-content'>" +
- "<div class='message-inline message-type-icon'></div>" +
- "<div class='message-inline message-main'></div>" +
- "</div>" +
- "<div class='message-confirm-info'></div>" +
- "<div class='message-footer'>" +
- "<div class='message-button message-okay'>Ok</div>" +
- "<div class='message-button message-cancel'>Cancel</div>" +
- "</div>" +
- "</div>" +
- "</div>";
- if (this.options.autoOpen) {
- $(html).appendTo($("body"));
- var pageWidth = window.screen.width;
- var pageHeight = window.screen.height;
- var pageLeft = document.screenLeft
- var pageTop = document.screenTop;
- var topOffset = "-" + pageHeight + "px";
- console.log(topOffset);
- $("#overlay").css({
- "opacity": "0.5",
- "Left": pageLeft,
- "Top": pageTop,
- "background-color": "white",
- "width": pageWidth,
- "height": pageHeight,
- "margin-top": topOffset,
- "overflow": "hidden"
- });
- }
- },
-
- destroy: function() {
- $(".border-grey").remove();
- $("#overlay").remove();
- }
- });
-})(jQuery);
diff --git a/ui/js/widgets/messagebar-flat.js b/ui/js/widgets/messagebar-flat.js
deleted file mode 100644
index a050ad6..0000000
--- a/ui/js/widgets/messagebar-flat.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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.
- */
-
-/*
-* Usage:
- $(selector).messagebarFlat({
- content: "Test", //message you want to show in the messagebar
- color: "red", //Three color supported: "red", "yellow" and "green",
- dismissTime: 3000 //when set to "never", the messagebar will never disappear.
- // Or setting it to numbers for the dismiss time you want to delay.
- });
-*/
-
-(function($) {
- $.widget("wok.messagebarFlat", {
- options : {
- content : null,
- color : "red",
- dismissTime: 3000
- },
-
- _create: function() {
- var now = this._getTime();
- var that = this;
- $("<div class='messagebar'><span class='messageHead'></span>" +
- "<span class='messagebar-text'> " + this.options.content +": " + now + "</span></div>")
- .addClass(this.options.color)
- .appendTo(that.element);
- $(".messageHead").addClass("dark-" + this.options.color);
- $("<span class='messagebar-close icon-cancel-circled'></span>").on("click", function() {
- that.destroy();
- }).appendTo($(".messagebar"));
- var dismissDelay = this.options.dismissTime;
- if (dismissDelay != "never") {
- setTimeout(function() {
- that.destroy()
- }, dismissDelay);
- }
- },
-
- _getTime: function() {
- var CT = new Date();
- var currentDate = CT.getDate() + "/" + CT.getMonth()+1 + "/" +CT.getFullYear();
- var currentTime = CT.getHours() + ":" + CT.getMinutes() + ":" + CT.getSeconds();
- var now = currentDate + " " + currentTime;
- return now;
- },
-
- destroy: function() {
- var that = this;
- that.element.fadeOut("normal", function() {
- that.element.remove();
- });
- }
- });
-})(jQuery);
diff --git a/ui/js/widgets/radio-flat.js b/ui/js/widgets/radio-flat.js
deleted file mode 100644
index 3cb8836..0000000
--- a/ui/js/widgets/radio-flat.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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").radioFlat({
- * id: "t", //Base id of the radio set.
- * name: "test", //name of the radio.
- * whichChecked: 2, //First selected position, starts from 1.
- * content: ["apple", "banana", "orange", "cherry"] //set the content array.
- * });
- *
- *
- * $(".test-bar").click(function() {
- * console.log($(".test-bar").radioFlat("value")); //this is how to get the value of selected radio value
- * });
- *
- *
- *
- */
-
- (function($) {
-
- $.widget("wok.radioFlat", {
- options: {
- id: "",
- name: "",
- whichChecked: "",
- content:[],
- },
-
- _create: function() {
- var that = this;
- var radioName = this.options.name;
- var labelID = this.options.id;
- var checked = this.options.whichChecked;
- var num = Number(this.options.content.length);
- var html ="";
- if(num >0) {
- for(var i=1;i < num+1;i++) {
- var tmpLabelID = labelID + i;
- html += "<div class='icon-circle-empty inline-radio radio-label' id='" + tmpLabelID + "'></div>" +
- "<label class='radio-content inline-radio' for='" + tmpLabelID + "'>" + that.options.content[i-1] + "</label>";
- }
- $(html).appendTo(that.element);
- $("#" + labelID + checked).attr("checked", "true");
- $("#" + labelID + checked).removeClass("icon-circle-empty");
- $("#" + labelID + checked).addClass("icon-dot-circled");
- }
- $(".radio-label").on("click", function() {
- $(".radio-label").removeClass("icon-dot-circled");
- $(".radio-label").addClass("icon-circle-empty");
- $(".radio-label").removeAttr("checked");
- $(this).removeClass("icon-circle-empty");
- $(this).addClass("icon-dot-circled");
- $(this).attr("checked", "true");
- var thisID = $(this).attr("id");
- that.options.whichChecked = thisID.substring(labelID.length,thisID.length);
- });
- },
-
- value: function() {
- var value = Number(this.options.whichChecked) -1;
- return this.options.content[value];
- },
-
- _destroy: function() {
- this.element.remove();
- }
- });
- })(jQuery);
diff --git a/ui/js/widgets/samples/README.md b/ui/js/widgets/samples/README.md
deleted file mode 100644
index 9c8e425..0000000
--- a/ui/js/widgets/samples/README.md
+++ /dev/null
@@ -1 +0,0 @@
-This folder contains the usage of Kimchi new UI design widgets.
\ No newline at end of file
diff --git a/ui/js/widgets/samples/dialog.html b/ui/js/widgets/samples/dialog.html
deleted file mode 100644
index ec67b97..0000000
--- a/ui/js/widgets/samples/dialog.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<!--
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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.
- */
--->
-
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="UTF-8">
- <title>Dialog Demo</title>
- <script src="../../../libs/jquery-1.10.0.min.js"></script>
- <script src="../../../libs/jquery-ui.min.js"></script>
- <script src="../dialog-flat.js"></script>
- <link rel="stylesheet" href="../../../libs/themes/base/jquery-ui.min.css">
- <link rel="stylesheet" href="../../../css/theme-default/dialog-flat.css">
- <link rel="stylesheet" href="../../../css/fontello/css/animation.css">
- <link rel="stylesheet" href="../../../css/fontello/css/fontello.css">
- </head>
- <body>
- <div class="dialog-demo"></div>
- <script>
- $(document).ready(function() {
- $(".dialog-demo").dialogFlat({
- title: "Demo", //Title of the dialog.
- confirmText: "Ok", //Text of the confirm button, "Ok" is the default value.
- cancelText: "Cancel", //Text of the cancel button.
- width: "600", //Width of the dialog, "px" is the default unit.
- height: "500", //Height of the dialog, "px" is the default unit.
- confirmFunc: function() {
- alert("success");//Function after confirm
- }
- });
- });
- </script>
- </body>
-</html>
diff --git a/ui/js/widgets/samples/gauge-flat.html b/ui/js/widgets/samples/gauge-flat.html
deleted file mode 100644
index efa6eec..0000000
--- a/ui/js/widgets/samples/gauge-flat.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!--Sample code of gauge-->
-<!--
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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.
- */
- -->
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="UTF-8">
- <title>Gauge Demo</title>
- <script src="../../../libs/jquery-1.10.0.min.js"></script>
- <script src="../../../libs/jquery-ui.min.js"></script>
- <script src="../gauge-flat.js"></script>
- <link rel="stylesheet" href="../../../libs/themes/base/jquery-ui.min.css">
- <link rel="stylesheet" href="../../../css/theme-default/gauge-flat.css">
- </head>
- <body>
- <div class="gauge-demo"></div>
- <script>
- $(document).ready(function() {
- console.log("test started1");
- var gauged = $(".gauge-demo");
- gauged.gaugeFlat({
- value: 25,
- color: "red"
- });
- var gaugeAdd = function() {
- var gaugeValue = gauged.gaugeFlat("value");
- gauged.gaugeFlat("value", gaugeValue + 1);
- if (gaugeValue < 99) {
- setTimeout(gaugeAdd, 300);
- }
- }
- gaugeAdd();
- });
- </script>
- </body>
-</html>
diff --git a/ui/js/widgets/samples/grid.html b/ui/js/widgets/samples/grid.html
deleted file mode 100644
index ac667ac..0000000
--- a/ui/js/widgets/samples/grid.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<!--
- *
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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.
- *
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="UTF-8">
-<title>Wok</title>
-<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
-<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
-
-<link rel="stylesheet" href="../../../libs/themes/base/jquery-ui.min.css">
-<link rel="stylesheet" href="../../../fontello/css/fontello.css">
-<link rel="stylesheet" href="../../../fontello/css/animation.css">
-<link rel="stylesheet" href="../../../css/theme-default.min.css">
-
-<script src="../../../libs/jquery-1.10.0.min.js"></script>
-<script src="../../../libs/jquery-ui.min.js"></script>
-<script src="../../../libs/jquery-ui-i18n.min.js"></script>
-<script src="../../../js/wok.min.js"></script>
-
-<style type="text/css">
-body {
- background: none;
-}
-input {
- float: right;
-}
-.name {
- width: 30%;
-}
-.project {
- width: 30%;
-}
-.role {
- width: 39%;
-}
-</style>
-<script>
-function init(){
- $('#ibmers').dataGrid({enableSorting: true});
- $('input').on('keyup', function(){
- $('#ibmers').dataGrid('filter', ($(this).val()));
- });
-}
-</script>
-</head>
-<body onload="init()">
-<div style="height: 50px; padding-top: 10px; padding-right: 50px;"><input type='text' placeholder='Filter' style='padding-left: 5px; height: 20px;'></div>
-<div id="ibmers">
-<div><span class="name">Name</span><span class="project">Project</span><span class="role">Role</span></div>
-<div>
-<div><span class="name" val="tify">tify</span><span class="project" val="kimchi">kimchi</span><span class="role" val="designer">designer</span></div>
-<div><span class="name" val="rick">rick</span><span class="project" val="finance">finance</span><span class="role" val="sponsor">sponsor</span></div>
-<div><span class="name" val="icy">icy</span><span class="project" val="human resource">human resource</span><span class="role" val="administrator*">administrator</span></div>
-<div><span class="name" val="paul">paul</span><span class="project" val="tomcat">tomcat</span><span class="role" val="dev lead">dev lead</span></div>
-<div><span class="name" val="kapil">kapil</span><span class="project" val="apache">apache</span><span class="role" val="developer">developer</span></div>
-<div><span class="name" val="adam">adam</span><span class="name" val="mongodb">mongodb</span><span class="role" val="dev lead">dev lead</span></div>
-<div><span class="name" val="shikha">shikha</span><span class="project" val="mysql">mysql</span><span class="role" val="dev lead">dev lead</span></div>
-</div>
-</div>
-</body>
-</html>
diff --git a/ui/js/widgets/samples/line.html b/ui/js/widgets/samples/line.html
deleted file mode 100644
index 4ded4db..0000000
--- a/ui/js/widgets/samples/line.html
+++ /dev/null
@@ -1,170 +0,0 @@
-<!--
- *
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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.
- *
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="UTF-8">
-<title>Wok</title>
-<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
-<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
-
-<link rel="stylesheet" href="../../../libs/themes/base/jquery-ui.min.css">
-<link rel="stylesheet" href="../../../fontello/css/fontello.css">
-<link rel="stylesheet" href="../../../fontello/css/animation.css">
-<link rel="stylesheet" href="../../../css/theme-default.min.css">
-
-<script src="../../../libs/jquery-1.10.0.min.js"></script>
-<script src="../../../libs/jquery-ui.min.js"></script>
-<script src="../../../libs/jquery-ui-i18n.min.js"></script>
-<script src="../../../js/wok.min.js"></script>
-
-<style type="text/css">
-body {
- background: none;
-}
-.cell {
- display: inline-block;
- width: 49%;
-}
-.monitor {
- width: 391px;
- margin: 15px auto;
-}
-.chart {
- width: 390px;
- height: 200px;
- margin-top: 20px;
-}
-.legend {
- height: 25px;
- line-height: 25px;
- padding-left: 8px;
- margin: 5px 30px 5px 0;
- border-left: 3px solid;
- display: inline-block;
-}
-</style>
-<script>
-function init(){
-$('#chart1').line({
- minVal: 0,
- maxVal: 500,
- datasets: [{
- data: new Array(50),
- color: "#d9182d"
- }]
-});
-$('#chart2').line({
- minVal: 0,
- maxVal: 500,
- datasets: [{
- data: new Array(50),
- color: "#008abf"
- }]
-});
-$('#chart3').line({
- minVal: 0,
- maxVal: 500,
- datasets: [{
- data: new Array(50),
- color: "#fdb813"
- }, {
- data: new Array(50),
- color: "#00a6a0"
- }]
-});
-$('#chart4').line({
- minVal: 0,
- maxVal: 500,
- datasets: [{
- data: new Array(50),
- color: "#561289"
- }, {
- data: new Array(50),
- color: "#238901"
- }]
-});
-setInterval(function(){
- $('#chart1').line('addData', [Math.round(Math.random()*500)]);
-}, 1000);
-setInterval(function(){
- $('#chart2').line('addData', [Math.round(Math.random()*500)]);
-}, 1000);
-setInterval(function(){
- $('#chart3').line('addData', [Math.round(Math.random()*500),Math.round(Math.random()*500)]);
-}, 1000);
-setInterval(function(){
- $('#chart4').line('addData', [Math.round(Math.random()*500),Math.round(Math.random()*500)]);
-}, 1000);
-}
-</script>
-</head>
-<body onload="init()">
-<div>
-<span class='cell'>
- <div class="monitor">
- <div class="h1 grey">Processor</div>
- <div class="c1 dark-grey bold">
- <span class="legend" style="border-color: #d9182d;">Used: 41%</span>
- </div>
- <div class="c1 light-grey">Maximum: 100%</div>
- <div id="chart1" class='chart'></div>
- </div>
-</span>
-<span class='cell'>
- <div class="monitor">
- <div class="h1 grey">Memory</div>
- <div class="c1 dark-grey bold">
- <span class="legend" style="border-color: #008abf;">Available: 49%</span>
- </div>
- <div class="c1 light-grey">Maximum: 280GB</div>
- <div id="chart2" class='chart'></div>
- </div>
-</span>
-</div>
-<div>
-<span class='cell'>
- <div class="monitor">
- <div class="h1 grey">Storage IO</div>
- <div class="c1 dark-grey bold">
- <span class="legend" style="border-color: #fdb813">Write: 6KB/S</span>
- <span class="legend" style="border-color: #00a6a0">Read: 123KB/S</span>
- </div>
- <div class="c1 light-grey">Maximum: 79.04KB/S</div>
- <div id="chart3" class='chart'></div>
- </div>
-</span>
-<span class='cell'>
- <div class="monitor">
- <div class="h1 grey">Network IO</div>
- <div class="c1 dark-grey bold">
- <span class="legend" style="border-color: #561289">Received: 2KB/S</span>
- <span class="legend" style="border-color: #238901">Sent: 1KB/S</span>
- </div>
- <div class="c1 light-grey">Maximum: 33.35KB/S</div>
- <div id="chart4" class='chart'></div>
- </div>
-</span>
-</div>
-</body>
-</html>
diff --git a/ui/js/widgets/samples/list.html b/ui/js/widgets/samples/list.html
deleted file mode 100644
index 39388b3..0000000
--- a/ui/js/widgets/samples/list.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!--
- *
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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.
- *
--->
-
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="UTF-8">
- <title>List Demo</title>
- <script src="../../../libs/jquery-1.10.0.min.js"></script>
- <script src="../../../libs/jquery-ui.min.js"></script>
- <script src="../list-flat.js"></script>
- <link rel="stylesheet" href="../../../libs/themes/base/jquery-ui.min.css">
- <link rel="stylesheet" href="../../../css/theme-default/list-flat.css">
- <link rel="stylesheet" href="../../../fontello/css/animation.css">
- <link rel="stylesheet" href="../../../fontello/css/fontello.css">
- </head>
- <body>
- <div class="list-demo"></div>
- <script>
- $(document).ready(function() {
- $(".list-demo").listFlat({
- title: "Hello World" //Set title.
- });
- $(".list-demo").listFlat("addItem", "Hello", "2015", "icon-user", "button1");
- //Add one item of the list, parameters are: name, info, icon and button-id
- });
- </script>
- </body>
-</html>
diff --git a/ui/js/widgets/samples/menu-button-radio-checkbox-text-select.html b/ui/js/widgets/samples/menu-button-radio-checkbox-text-select.html
deleted file mode 100644
index 48ac2b1..0000000
--- a/ui/js/widgets/samples/menu-button-radio-checkbox-text-select.html
+++ /dev/null
@@ -1,104 +0,0 @@
-<!--
- *
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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.
- *
--->
-
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="UTF-8">
- <title>Demo</title>
- <script src="../../../libs/jquery-1.10.0.min.js"></script>
- <script src="../../../libs/jquery-ui.min.js"></script>
- <script src="../menu-flat.js"></script>
- <script src="../button-flat.js"></script>
- <script src="../radio-flat.js"></script>
- <script src="../checkbox-flat.js"></script>
- <script src="../textbox-flat.js"></script>
- <script src="../selectmenu-flat.js"></script>
- <link rel="stylesheet" href="../../../libs/themes/base/jquery-ui.min.css">
- <link rel="stylesheet" href="../../../css/theme-default/menu-flat.css">
- <link rel="stylesheet" href="../../../css/theme-default/button-flat.css">
- <link rel="stylesheet" href="../../../css/theme-default/radio-flat.css">
- <link rel="stylesheet" href="../../../css/theme-default/checkbox-flat.css">
- <link rel="stylesheet" href="../../../css/theme-default/textbox-flat.css">
- <link rel="stylesheet" href="../../../css/theme-default/selectmenu-flat.css">
- <link rel="stylesheet" href="../../../fontello/css/animation.css">
- <link rel="stylesheet" href="../../../fontello/css/fontello.css">
- </head>
- <body>
- <div id="menu"></div>
- <div style="height:50px"><div id="select"></div></div>
- <div class="radio-demo"></div>
- <div class="checkbox-demo"></div>
- <input class="text-demo">
- <button class="button-demo">submit</button>
- <script>
- $(document).ready(function() {
- $("#menu").menuFlat({
- content: [1,2,3,4,5,6], //Set content of the menu.
- icon: "icon-edit-alt", //Set icon of the menu button.
- listIconList: ["icon-edit-alt","icon-edit-alt","icon-edit-alt","icon-edit-alt","icon-edit-alt","icon-user"]
- //Set icons of the menu list.
- // name is optional which set the name of the menu list.
- });
- $("#menu0").on("click", function() {
- alert("hello");
- });
- $("#menu1").on("click", function() {
- console.log("hello");
- });
- $("#select").selectmenuFlat({
- content: [1,2,3,4,5,6], //Set content of the select menu
- selected: 2 // set the selected option, starts from "1"
- });
- $("#select").selectmenuFlat("value", "4"); //Set value.
- var t = $("#select").selectmenuFlat("value"); //Get value
- console.log(t);
- $(".radio-demo").radioFlat({
- id: "t", //Base id of the radio set.
- name: "test", //name of the radio.
- whichChecked: 2, //First selected position, starts from 1.
- content: ["apple", "banana", "orange", "cherry"] //set the content array.
- });
- $(".radio-demo").click(function() {
- console.log($(".radio-demo").radioFlat("value")); //this is how to get the value of selected radio value
- });
- $(".checkbox-demo").checkboxFlat({
- id: "t", //Checkbox base id.
- name: "test", //Checkbox name.
- content: ["apple", "banana", "orange", "cherry"], //Contents of the checkbox set.
- checked: [1,3] //Set the checked item, which starts with number 1.
- });
- $(".checkbox-demo").click(function() {
- console.log($(".selector").checkboxFlat("value")); //Get value of the checked checkbox.
- });
- $(".text-demo").textboxFlat({
- hint: "hint"
- });
- $(".text-demo").css({
- "height": "30px",
- "width": "200px"
- });
- $(".button-demo").buttonFlat();
- });
- </script>
- </body>
-</html>
diff --git a/ui/js/widgets/samples/message.html b/ui/js/widgets/samples/message.html
deleted file mode 100644
index 0fd5c45..0000000
--- a/ui/js/widgets/samples/message.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<!--
- *
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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.
- *
--->
-
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="UTF-8">
- <title>Message Demo</title>
- <script src="../../../libs/jquery-1.10.0.min.js"></script>
- <script src="../../../libs/jquery-ui.min.js"></script>
- <script src="../message-flat.js"></script>
- <link rel="stylesheet" href="../../../libs/themes/base/jquery-ui.min.css">
- <link rel="stylesheet" href="../../../css/theme-default/message-flat.css">
- <link rel="stylesheet" href="../../../fontello/css/animation.css">
- <link rel="stylesheet" href="../../../fontello/css/fontello.css">
- </head>
- <body>
- <div class="message-demo"></div>
- <script>
- $(document).ready(function() {
- $(".message-demo").messageFlat({
- contentMain: "This is a test", //Content you are going to add
- contentConfirm: "Sure?", //Content that inform user whether they want to continue.
- //Default value is: "Are you sure you want to go on?"
- confirm: function() {
- alert("comfirmed")
- }
- });
- });
- </script>
- </body>
-</html>
diff --git a/ui/js/widgets/samples/messagebar-flat.html b/ui/js/widgets/samples/messagebar-flat.html
deleted file mode 100644
index 4014283..0000000
--- a/ui/js/widgets/samples/messagebar-flat.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<!--
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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.
- */
--->
-
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="UTF-8">
- <title>Sample of messagebar</title>
- <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
- <link rel="stylesheet" href="../../../fontello/css/fontello.css">
- <link rel="stylesheet" href="../../../fontello/css/animation.css">
- <link rel="stylesheet" href="../../../libs/themes/base/jquery-ui.min.css">
- <link rel="stylesheet" href="../../../css/theme-default/messagebar-flat.css">
- <script src="../../../libs/jquery-1.10.0.min.js"></script>
- <script src="../../../libs/jquery-ui.min.js"></script>
- <script src="../messagebar-flat.js"></script>
- </head>
- <body>
- <div class="message"></div>
- <script>
- $(document).ready(function() {
- $(".message").messagebarFlat({
- content: "This is a test",
- color: "red",
- dismissTime: 1000
- });
- });
- </script>
- </body>
-
-</html>
diff --git a/ui/js/widgets/samples/tabs.html b/ui/js/widgets/samples/tabs.html
deleted file mode 100644
index 0a5c401..0000000
--- a/ui/js/widgets/samples/tabs.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<!--
- *
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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.
- *
--->
-
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="UTF-8">
-<title>Wok</title>
-<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
-<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
-
-<link rel="stylesheet" href="../../../libs/themes/base/jquery-ui.min.css">
-<link rel="stylesheet" href="../../../fontello/css/fontello.css">
-<link rel="stylesheet" href="../../../fontello/css/animation.css">
-<link rel="stylesheet" href="../../../css/theme-default.min.css">
-
-<script src="../../../libs/jquery-1.10.0.min.js"></script>
-<script src="../../../libs/jquery-ui.min.js"></script>
-<script src="../../../libs/jquery-ui-i18n.min.js"></script>
-<script src="../../../js/wok.min.js"></script>
-
-<style type="text/css">
-body {
- background: none;
-}
-</style>
-<script>
-function init(){
- $( "#tabs" ).tabs();
-}
-</script>
-</head>
-<body onload="init()">
-<div id="tabs">
- <ul>
- <li><a href="#tabs-1">Nunc tincidunt</a></li>
- <li><a href="#tabs-2">Proin dolor</a></li>
- <li><a href="#tabs-3">Aenean lacinia</a></li>
- </ul>
- <div id="tabs-1">
- <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p>
- </div>
- <div id="tabs-2">
- <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p>
- </div>
- <div id="tabs-3">
- <p>Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.</p>
- <p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p>
- </div>
-</body>
-</html>
diff --git a/ui/js/widgets/select-menu.js b/ui/js/widgets/select-menu.js
deleted file mode 100644
index d176d00..0000000
--- a/ui/js/widgets/select-menu.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2014-2015
- *
- * Code derived from Project Kimchi
- *
- * 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.
- */
-(function($) {
- $.widget('wok.selectMenu', {
-
- _create : function() {
- this.selectDiv = this.element;
- this.listControl = this.selectDiv.find('ul').first();
- this.listControl.html('');
- this.target = this.selectDiv.find('input').first();
- this.label = this.selectDiv.find('span').first();
- this.selectDiv.addClass('btn dropdown popable');
- this.target.addClass('input');
- this.listControl.addClass('select-list');
- this.listControl.parent().addClass('popover');
- },
-
- setData : function (options) {
- var that = this;
- var value = this.target.val();
- var selectedClass = 'active';
- var itemTag = 'li';
- var item;
- that.listControl.find('li').remove();
- that.label.text("");
- that.target.val("");
- if (options.length > 0) {
- $.each(options, function(index, option) {
- item = $('<' + itemTag + '>' + option.label +'</' + itemTag + '>');
- item.data('value', option.value);
- if(option.value === value) {
- item.addClass(selectedClass);
- that.label.text(option.label);
- that.target.val(option.value);
- }
- that.listControl.append(item);
- });
- that.listControl.on('click', itemTag, function() {
- that.listControl.children().removeClass(selectedClass);
- $(this).addClass(selectedClass);
- that.label.text($(this).text());
- var oldValue = that.target.val();
- var newValue = $(this).data('value');
- that.target.val(newValue);
- if(oldValue !== newValue) {
- that.target.change();
- }
- });
- }
- },
-
- value : function(data) {
- if (data === undefined) {
- return this.target.val();
- }
- this.target.val(data.value);
- this.label.val(data.label);
- },
-
- destroy : function() {
- this.selectDiv.removeClass('btn dropdown popable');
- this.target.removeClass('input');
- this.label.removeClass('input');
- this.listControl.removeClass('select-list');
- this.listControl.parent().removeClass('popover');
- $.Widget.prototype.destroy.call(this);
- }
- });
-}(jQuery));
diff --git a/ui/js/widgets/selectmenu-flat.js b/ui/js/widgets/selectmenu-flat.js
deleted file mode 100644
index 3cd34ef..0000000
--- a/ui/js/widgets/selectmenu-flat.js
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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").selectmenuFlat({
-// content: [1,2,3,4,5,6], //Set content of the select menu
-// selected: 2 // set the selected option, starts from "1"
-// });
-// $(".selector").selectmenuFlat("value", "4"); //Set value.
-// var t = $(".selector").selectmenuFlat("value"); //Get value
-// console.log(t);
-
-
- (function( $ ) {
- $.widget("wok.selectmenuFlat", {
-
- options: {
- content: null,
- name: null,
- selected: null,
- parentid: null
- },
-
- _create: function() {
- var that = this;
- var name = that.options.name || $(this.element).attr("id");
- var value = that.options.content;
- var parentid = $(this.element).attr("id");
- that.options.parentid = parentid;
- var html = "<div class='selected-box'>" +
- "<input class='select-val'>" +
- "<span class='select-label'></span>" +
- "<span class='select-icon icon-down-open'></span>" +
- "</div>";
- $(html).appendTo(that.element);
- html = that._setValue(value);
- $(html).appendTo(that.element);
- $("#" + parentid).addClass("select-content");
- var sel = that.options.selected || 1;
- sel = that.options.content[Number(sel) -1];
- that.options.selected = $.inArray(sel, that.options.content) + 1;
- $(".select-val", "#" + parentid).text(sel);
- $(".select-label", "#" + parentid).text(sel);
- $(".selected-box", "#" + parentid).on("click", this._toggleOpt);
- $(".selectmenu-opt", "#" + parentid).on("click", function() {
- var selectedText = $(this).text();
- that.options.selected = $.inArray(selectedText, that.options.content) +1;
- $(".selected-box .select-label", "#" + parentid).text(selectedText);
- $(".select-val", "#" + parentid).text(selectedText);
- $(".selectmenu-list", "#" + parentid).prop("style", "display:none");
- $(".select-icon", "#" + parentid).removeClass("icon-up-open");
- $(".select-icon", "#" + parentid).addClass("icon-down-open").css({
- "border-left": "none"
- });
- });
- $(document).mouseup(function(e) {
- var container = $(".selectmenu-opt");
- if(!container.is(e.target) && container.has(e.target).length === 0 && $(".select-icon").hasClass("icon-up-open")) {
- $(".selectmenu-list", "#" + parentid).prop("style", "display:none");
- $(".select-icon", "#" + parentid).removeClass("icon-up-open");
- $(".select-icon", "#" + parentid).addClass("icon-down-open").css({
- "border-left": "none"
- });
- }
- });
- },
-
- _setValue: function(value) {
- var that = this;
- var html = "<ul class='selectmenu-list' style='display:none'>";
- var name = this.options.name || $(this.element).attr("id");
- $.each(value, function(index, data) {
- that.options.content[index] = data.toString();
- html += "<li id='" + name + index + "' class='selectmenu-opt'>" + data + "</li>";
- });
- html += "</ul>";
- return html;
- },
-
- _toggleOpt: function() {
- var thisButton = $(this).parent().attr("id");
- if($(".select-icon", "#" + thisButton).hasClass("icon-down-open")) {
- $(".selectmenu-list", "#" + thisButton).prop("style", "display");
- $(".select-icon", "#" + thisButton).removeClass("icon-down-open");
- $(".select-icon", "#" + thisButton).addClass("icon-up-open").css({
- "border-left": "1px solid #d8d8d8"
- });
- } else {
- $(".selectmenu-list", "#" + thisButton).prop("style", "display:none");
- $(".select-icon", "#" + thisButton).removeClass("icon-up-open");
- $(".select-icon", "#" + thisButton).addClass("icon-down-open").css({
- "border-left": "none"
- });
- }
- },
-
- value: function(value) {
- var parentid = this.options.parentid;
- if(!value) {
- return $(".selected-box .select-val", "#" + parentid).text();
- }
- if (value <= this.options.content.length) {
- this.options.selected = value;
- var selectedText = this.options.content[value-1];
- $(".selected-box .select-label", "#" + parentid).text(selectedText);
- $(".selected-box .select-val", "#" + parentid).text(selectedText);
- }
- },
-
- _destroy: function() {
- this.element.remove();
- }
- });
- })(jQuery);
diff --git a/ui/js/widgets/textbox-flat.js b/ui/js/widgets/textbox-flat.js
deleted file mode 100644
index 40f6233..0000000
--- a/ui/js/widgets/textbox-flat.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Project Wok
- *
- * Copyright IBM, Corp. 2015
- *
- * Code derived from Project Kimchi
- *
- * 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("wok.textboxFlat", {
- optons: {
- hint: ""
- },
-
- _create: function() {
- this.element.addClass("textbox-container");
- this.element.attr("placeholder", this.options.hint);
- },
-
- destroy:function() {
- this.element.remove();
- }
- });
- })(jQuery);
--
2.5.0
More information about the Kimchi-devel
mailing list