toolbox_esten 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +0 -0
  3. data/CONTRIBUTING.md +0 -0
  4. data/Gemfile +10 -0
  5. data/Gemfile.lock +165 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +0 -0
  8. data/Rakefile +8 -0
  9. data/assets/javascripts/simpleLoader/simpleLoader.js +122 -0
  10. data/assets/javascripts/simpleLoader/simpleLoader.min.js +1 -0
  11. data/assets/javascripts/simpleMenu/simpleMenu.js +53 -0
  12. data/assets/javascripts/simpleMenu/simpleMenu.min.js +1 -0
  13. data/assets/javascripts/simpleSelection/simpleSelect.js +60 -0
  14. data/assets/javascripts/simpleTextfield/simpleTextfield.js +94 -0
  15. data/assets/javascripts/simpleTooltip/simpleTooltip.js +166 -0
  16. data/assets/javascripts/simpleTooltip/simpleTooltip.min.js +1 -0
  17. data/assets/stylesheets/_jquery_ui.scss +1 -0
  18. data/assets/stylesheets/_simpleloader.scss +2 -0
  19. data/assets/stylesheets/_simpleselection.scss +1 -0
  20. data/assets/stylesheets/_simpletextfield.scss +1 -0
  21. data/assets/stylesheets/_simpletooltip.scss +1 -0
  22. data/assets/stylesheets/_toolbox_esten.scss +18 -0
  23. data/assets/stylesheets/jquery_ui/uidialog.scss +39 -0
  24. data/assets/stylesheets/simpleLoader/keyframes.scss +325 -0
  25. data/assets/stylesheets/simpleLoader/simpleLoader.scss +367 -0
  26. data/assets/stylesheets/simpleSelection/simpleSelection.scss +15 -0
  27. data/assets/stylesheets/simpleTextfield/simpleTextfield.scss +54 -0
  28. data/assets/stylesheets/simpleTooltip/simpleTooltip.scss +21 -0
  29. data/assets/stylesheets/toolbox_esten/base.scss +27 -0
  30. data/assets/stylesheets/toolbox_esten/buttons.scss +162 -0
  31. data/assets/stylesheets/toolbox_esten/datatables.scss +113 -0
  32. data/assets/stylesheets/toolbox_esten/detail.scss +22 -0
  33. data/assets/stylesheets/toolbox_esten/flex.scss +32 -0
  34. data/assets/stylesheets/toolbox_esten/form.scss +35 -0
  35. data/assets/stylesheets/toolbox_esten/grid.scss +34 -0
  36. data/assets/stylesheets/toolbox_esten/helper.scss +42 -0
  37. data/assets/stylesheets/toolbox_esten/mixins.scss +179 -0
  38. data/assets/stylesheets/toolbox_esten/notification.scss +109 -0
  39. data/assets/stylesheets/toolbox_esten/reset.scss +38 -0
  40. data/assets/stylesheets/toolbox_esten/section.scss +53 -0
  41. data/assets/stylesheets/toolbox_esten/tables.scss +72 -0
  42. data/assets/stylesheets/toolbox_esten/tabs.scss +42 -0
  43. data/assets/stylesheets/toolbox_esten/textfield.scss +43 -0
  44. data/assets/stylesheets/toolbox_esten/top_bar.scss +80 -0
  45. data/assets/stylesheets/toolbox_esten/variables.scss +260 -0
  46. data/bower.json +26 -0
  47. data/composer.json +20 -0
  48. data/lib/toolbox_esten.rb +84 -0
  49. data/lib/toolbox_esten/engine.rb +11 -0
  50. data/lib/toolbox_esten/version.rb +3 -0
  51. data/sache.json +5 -0
  52. data/tasks/bower.rake +29 -0
  53. data/tasks/converter.rb +62 -0
  54. data/tasks/converter/char_string_scanner.rb +38 -0
  55. data/tasks/converter/logger.rb +57 -0
  56. data/tasks/converter/network.rb +100 -0
  57. data/tasks/install.rake +20 -0
  58. data/templates/.travis.yml +19 -0
  59. data/templates/project/styles.sass +2 -0
  60. data/toolbox_esten.gemspec +43 -0
  61. metadata +317 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ff650e1f545000b2f79ccfab9ebff20dda06289bc596b0584ab13825de9531a9
4
+ data.tar.gz: 99925a6ced6912d31f7eae5c43b68cc6e95e468e27079ddd3b23511c5e159072
5
+ SHA512:
6
+ metadata.gz: 2914538ae2be8377210ea474da585b7e21a36d7a0f5b7869f5f8202d50f856b145929b038d18199365a83ab6c017fac0d8d7c9269cb633a8d71a5e0beef7e741
7
+ data.tar.gz: 263d07fc06dc8d5e5e8a9ae4a053ee49e0b1550e7c9720af1b60632a99a2be75676991bfa100f21d0aea5b4ff9ba69606b071ff03d942c4a0378aec8f0c6a284
data/CHANGELOG.md ADDED
File without changes
data/CONTRIBUTING.md ADDED
File without changes
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ # Compass for the dummy app
6
+ gem 'compass', '~> 1.0', '>= 1.0.3', require: false
7
+
8
+ group :development do
9
+ gem 'byebug', '~> 10.0', '>= 10.0.2', platforms: [:mri_21, :mri_22], require: false
10
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,165 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ toolbox_esten (1.0.0)
5
+ sass
6
+ thor
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (5.2.0)
12
+ actionview (= 5.2.0)
13
+ activesupport (= 5.2.0)
14
+ rack (~> 2.0)
15
+ rack-test (>= 0.6.3)
16
+ rails-dom-testing (~> 2.0)
17
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
18
+ actionview (5.2.0)
19
+ activesupport (= 5.2.0)
20
+ builder (~> 3.1)
21
+ erubi (~> 1.4)
22
+ rails-dom-testing (~> 2.0)
23
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
24
+ activesupport (5.2.0)
25
+ concurrent-ruby (~> 1.0, >= 1.0.2)
26
+ i18n (>= 0.7, < 2)
27
+ minitest (~> 5.1)
28
+ tzinfo (~> 1.1)
29
+ aruba (0.14.6)
30
+ childprocess (>= 0.6.3, < 0.10.0)
31
+ contracts (~> 0.9)
32
+ cucumber (>= 1.3.19)
33
+ ffi (~> 1.9.10)
34
+ rspec-expectations (>= 2.99)
35
+ thor (~> 0.19)
36
+ backports (3.11.3)
37
+ builder (3.2.3)
38
+ byebug (10.0.2)
39
+ childprocess (0.9.0)
40
+ ffi (~> 1.0, >= 1.0.11)
41
+ chunky_png (1.3.10)
42
+ compass (1.0.3)
43
+ chunky_png (~> 1.2)
44
+ compass-core (~> 1.0.2)
45
+ compass-import-once (~> 1.0.5)
46
+ rb-fsevent (>= 0.9.3)
47
+ rb-inotify (>= 0.9)
48
+ sass (>= 3.3.13, < 3.5)
49
+ compass-core (1.0.3)
50
+ multi_json (~> 1.0)
51
+ sass (>= 3.3.0, < 3.5)
52
+ compass-import-once (1.0.5)
53
+ sass (>= 3.2, < 3.5)
54
+ concurrent-ruby (1.0.5)
55
+ contracts (0.16.0)
56
+ crass (1.0.4)
57
+ cucumber (3.1.1)
58
+ builder (>= 2.1.2)
59
+ cucumber-core (~> 3.1.0)
60
+ cucumber-expressions (~> 6.0.0)
61
+ cucumber-wire (~> 0.0.1)
62
+ diff-lcs (~> 1.3)
63
+ gherkin (~> 5.1.0)
64
+ multi_json (>= 1.7.5, < 2.0)
65
+ multi_test (>= 0.1.2)
66
+ cucumber-core (3.1.0)
67
+ backports (>= 3.8.0)
68
+ cucumber-tag_expressions (~> 1.1.0)
69
+ gherkin (>= 5.0.0)
70
+ cucumber-expressions (6.0.1)
71
+ cucumber-tag_expressions (1.1.1)
72
+ cucumber-wire (0.0.1)
73
+ diff-lcs (1.3)
74
+ erubi (1.7.1)
75
+ execjs (2.7.0)
76
+ ffi (1.9.25)
77
+ gherkin (5.1.0)
78
+ i18n (1.0.1)
79
+ concurrent-ruby (~> 1.0)
80
+ jquery-rails (4.3.3)
81
+ rails-dom-testing (>= 1, < 3)
82
+ railties (>= 4.2.0)
83
+ thor (>= 0.14, < 2.0)
84
+ json (2.1.0)
85
+ loofah (2.2.2)
86
+ crass (~> 1.0.2)
87
+ nokogiri (>= 1.5.9)
88
+ method_source (0.9.0)
89
+ mini_portile2 (2.3.0)
90
+ minitest (5.11.3)
91
+ multi_json (1.13.1)
92
+ multi_test (0.1.2)
93
+ nokogiri (1.8.3)
94
+ mini_portile2 (~> 2.3.0)
95
+ rack (2.0.5)
96
+ rack-test (1.0.0)
97
+ rack (>= 1.0, < 3)
98
+ rails-dom-testing (2.0.3)
99
+ activesupport (>= 4.2.0)
100
+ nokogiri (>= 1.6)
101
+ rails-html-sanitizer (1.0.4)
102
+ loofah (~> 2.2, >= 2.2.2)
103
+ railties (5.2.0)
104
+ actionpack (= 5.2.0)
105
+ activesupport (= 5.2.0)
106
+ method_source
107
+ rake (>= 0.8.7)
108
+ thor (>= 0.18.1, < 2.0)
109
+ rake (10.5.0)
110
+ rb-fsevent (0.10.3)
111
+ rb-inotify (0.9.10)
112
+ ffi (>= 0.5.0, < 2)
113
+ rspec-expectations (3.7.0)
114
+ diff-lcs (>= 1.2.0, < 2.0)
115
+ rspec-support (~> 3.7.0)
116
+ rspec-support (3.7.1)
117
+ sass (3.4.25)
118
+ slim (3.0.9)
119
+ temple (>= 0.7.6, < 0.9)
120
+ tilt (>= 1.3.3, < 2.1)
121
+ slim-rails (3.1.3)
122
+ actionpack (>= 3.1)
123
+ railties (>= 3.1)
124
+ slim (~> 3.0)
125
+ sprockets (3.7.2)
126
+ concurrent-ruby (~> 1.0)
127
+ rack (> 1, < 3)
128
+ sprockets-rails (3.2.1)
129
+ actionpack (>= 4.0)
130
+ activesupport (>= 4.0)
131
+ sprockets (>= 3.0.0)
132
+ temple (0.8.0)
133
+ term-ansicolor (1.6.0)
134
+ tins (~> 1.0)
135
+ thor (0.20.0)
136
+ thread_safe (0.3.6)
137
+ tilt (2.0.8)
138
+ tins (1.16.3)
139
+ tzinfo (1.2.5)
140
+ thread_safe (~> 0.1)
141
+ uglifier (4.1.13)
142
+ execjs (>= 0.3.0, < 3)
143
+
144
+ PLATFORMS
145
+ ruby
146
+
147
+ DEPENDENCIES
148
+ actionpack (~> 5.2)
149
+ activesupport (>= 4.1.5)
150
+ aruba (~> 0.4)
151
+ bundler (~> 1.7)
152
+ byebug (~> 10.0, >= 10.0.2)
153
+ compass (~> 1.0, >= 1.0.3)
154
+ jquery-rails (>= 3.1.0)
155
+ json (>= 1.8.1)
156
+ railties (~> 5.2)
157
+ rake (~> 10.0)
158
+ slim-rails (~> 3.1, >= 3.1.3)
159
+ sprockets-rails (~> 3.2, >= 3.2.1)
160
+ term-ansicolor (~> 1.6)
161
+ toolbox_esten!
162
+ uglifier (~> 4.1, >= 4.1.12)
163
+
164
+ BUNDLED WITH
165
+ 1.16.2
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Shang Chuan Chuan
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
File without changes
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ require 'cucumber/rake/task'
4
+
5
+ Bundler::GemHelper.install_tasks
6
+ Cucumber::Rake::Task.new
7
+
8
+ task :default => :cucumber
@@ -0,0 +1,122 @@
1
+ /*
2
+ loader types:
3
+ 1. horizon-ball
4
+ 2. grid-ball
5
+ 3. rotate-circle
6
+ 4. rotate-clip-ball
7
+ 5. square-spin
8
+ 6. rotate-clip-circle
9
+ 7. rise-ball
10
+ 8. rotate-ball
11
+ 9. transition-cube
12
+ 10. transition-ball
13
+ 11. transition-ball-reflect
14
+ 12. transition-ball-triangle
15
+ 13. scale-ball
16
+ 14. scale-ball-multiple
17
+ 15. spin-ball
18
+ 16. spin-line
19
+ 17. time-loader
20
+ */
21
+ +function($) {
22
+ 'use strict';
23
+
24
+ var Simpleloader = function(element, options) {
25
+ this.init(element, options);
26
+ }
27
+
28
+ Simpleloader.DEFAULTS = {
29
+ type: 1,
30
+ background: "#FFFFFF",
31
+ thrink: 1,
32
+ template: "",
33
+ mask: false
34
+ }
35
+
36
+ var divs = [
37
+ {type: 1, css_class: "horizon-ball ball", num: 3},
38
+ {type: 2, css_class: "grid-ball ball", num: 9},
39
+ {type: 3, css_class: "rotate-circle circle", num: 1},
40
+ {type: 4, css_class: "rotate-clip-ball circle", num: 2},
41
+ {type: 5, css_class: "square-spin cube", num: 1},
42
+ {type: 6, css_class: "rotate-clip-circle circle", num: 2},
43
+ {type: 7, css_class: "rise-ball ball", num: 5},
44
+ {type: 8, css_class: "rotate-ball ball", num: 3},
45
+ {type: 9, css_class: "transition-cube cube", num: 2},
46
+ {type: 10, css_class: "transition-ball ball", num: 2},
47
+ {type: 11, css_class: "transition-ball-reflect ball", num: 2},
48
+ {type: 12, css_class: "transition-ball-triangle circle", num: 3},
49
+ {type: 13, css_class: "scale-ball ball", num: 1},
50
+ {type: 14, css_class: "scale-ball-multiple ball", num: 3},
51
+ {type: 15, css_class: "spin-ball ball", num: 8},
52
+ {type: 16, css_class: "spin-line line", num: 8},
53
+ {type: 17, css_class: "time-loader circle", num: 1}
54
+ ]
55
+
56
+ Simpleloader.prototype.init = function(element, options) {
57
+ var $element = $(element);
58
+ var that = this;
59
+
60
+ $.each(divs, function(key, value) {
61
+ if(options.type == this.type) {
62
+ options.template = '<div class="'+this.css_class+'">';
63
+ options.template += that.buildStructure(this, options) + '</div>';
64
+ $element.append(options.template);
65
+ }
66
+ });
67
+ that.addEffect(element, options);
68
+ if(options.mask) { that.addMask(element); }
69
+ }
70
+
71
+ Simpleloader.prototype.buildStructure = function(obj, options) {
72
+ var template = "";
73
+ for(var i=0; i<obj.num; i++) {
74
+ template += '<div></div>';
75
+ }
76
+ return template;
77
+ }
78
+
79
+ Simpleloader.prototype.addEffect = function(element, options) {
80
+ var $element = $(element);
81
+ var targets = $element.find("div:not([class])");
82
+
83
+ $element.css({
84
+ "-webkit-transform": "scale("+options.thrink+")",
85
+ "transform": "scale("+options.thrink+")",
86
+ });
87
+
88
+ if(options.type == 3 || options.type == 6 || options.type == 12) {
89
+ targets.css({
90
+ "border-color": options.background
91
+ });
92
+ } else if(options.type == 4) {
93
+ $element.find("div:not([class]):nth-child(1)").css({
94
+ "border-color": options.background
95
+ });
96
+ $element.find("div:not([class]):nth-child(2)").css({
97
+ "background": options.background
98
+ })
99
+ } else {
100
+ targets.css({
101
+ "background": options.background
102
+ });
103
+ }
104
+ }
105
+
106
+ Simpleloader.prototype.addMask = function(element) {
107
+ var template = '<div class="layermask"></div>';
108
+ var $element = $(element);
109
+
110
+ $element.before(template);
111
+ }
112
+
113
+ function Plugin(option) {
114
+ return this.each(function () {
115
+ var options = $.extend({}, Simpleloader.DEFAULTS, option);
116
+ new Simpleloader(this, options);
117
+ });
118
+ }
119
+
120
+ $.fn.simpleloader = Plugin;
121
+ $.fn.simpleloader.Constructor = Simpleloader;
122
+ }(jQuery);
@@ -0,0 +1 @@
1
+ +function(s){"use strict";function t(t){return this.each(function(){var l=s.extend({},c.DEFAULTS,t);new c(this,l)})}var c=function(s,t){this.init(s,t)};c.DEFAULTS={type:1,background:"#FFFFFF",thrink:1,template:"",mask:!1};var l=[{type:1,css_class:"horizon-ball ball",num:3},{type:2,css_class:"grid-ball ball",num:9},{type:3,css_class:"rotate-circle circle",num:1},{type:4,css_class:"rotate-clip-ball circle",num:2},{type:5,css_class:"square-spin cube",num:1},{type:6,css_class:"rotate-clip-circle circle",num:2},{type:7,css_class:"rise-ball ball",num:5},{type:8,css_class:"rotate-ball ball",num:3},{type:9,css_class:"transition-cube cube",num:2},{type:10,css_class:"transition-ball ball",num:2},{type:11,css_class:"transition-ball-reflect ball",num:2},{type:12,css_class:"transition-ball-triangle circle",num:3},{type:13,css_class:"scale-ball ball",num:1},{type:14,css_class:"scale-ball-multiple ball",num:3},{type:15,css_class:"spin-ball ball",num:8},{type:16,css_class:"spin-line line",num:8},{type:17,css_class:"time-loader circle",num:1}];c.prototype.init=function(t,c){var a=s(t),e=this;s.each(l,function(s,t){c.type==this.type&&(c.template='<div class="'+this.css_class+'">',c.template+=e.buildStructure(this,c)+"</div>",a.append(c.template))}),e.addEffect(t,c),c.mask&&e.addMask(t)},c.prototype.buildStructure=function(s,t){for(var c="",l=0;l<s.num;l++)c+="<div></div>";return c},c.prototype.addEffect=function(t,c){var l=s(t),a=l.find("div:not([class])");l.css({"-webkit-transform":"scale("+c.thrink+")",transform:"scale("+c.thrink+")"}),3==c.type||6==c.type||12==c.type?a.css({"border-color":c.background}):4==c.type?(l.find("div:not([class]):nth-child(1)").css({"border-color":c.background}),l.find("div:not([class]):nth-child(2)").css({background:c.background})):a.css({background:c.background})},c.prototype.addMask=function(t){var c='<div class="layermask"></div>',l=s(t);l.before(c)},s.fn.simpleloader=t,s.fn.simpleloader.Constructor=c}(jQuery);
@@ -0,0 +1,53 @@
1
+ +function($) {
2
+ 'use strict';
3
+
4
+ var Simplemenu = function(element, options) {
5
+ this.init(element, options);
6
+ }
7
+
8
+ Simplemenu.DEFAULTS = {
9
+ "trigger": "hover"
10
+ }
11
+
12
+ Simplemenu.prototype.init = function(element, options) {
13
+ var $element = $(element);
14
+ var trigger = options.trigger = $element.find("a[data-toggle]").data("trigger");
15
+
16
+ $element.find("a[data-toggle]").addClass("dropdown-enabled");
17
+
18
+ if(trigger == "hover") {
19
+ $element.bind("mouseover", function() {
20
+ $(this).find(".dropdown").show();
21
+ });
22
+ $element.bind("mouseout", function() {
23
+ $(this).find(".dropdown").hide();
24
+ });
25
+ } else {
26
+ $element.bind("click", function() {
27
+ $(this).find(".dropdown").toggle();
28
+ });
29
+ }
30
+ }
31
+
32
+ function Plugin(option) {
33
+ return this.each(function() {
34
+ var $this = $(this);
35
+ var options = $.extend({}, Simplemenu.DEFAULTS, option);
36
+ var target = $this.find("[data-toggle='dropdown']");
37
+
38
+ if(!target.hasClass("dropdown-enabled")) {
39
+ new Simplemenu(this, options);
40
+ }
41
+ });
42
+ }
43
+
44
+ var old = $.fn.simplemenu;
45
+
46
+ $.fn.simplemenu = Plugin;
47
+ $.fn.simplemenu.Constructor = Simplemenu;
48
+
49
+ $.fn.simplemenu.noConflict = function() {
50
+ $.fn.simplemenu = old;
51
+ return this;
52
+ }
53
+ }(jQuery);
@@ -0,0 +1 @@
1
+ +function(n){"use strict";function i(i){return this.each(function(){var o=n(this),e=n.extend({},t.DEFAULTS,i),d=o.find("[data-toggle='dropdown']");d.hasClass("dropdown-enabled")||new t(this,e)})}var t=function(n,i){this.init(n,i)};t.DEFAULTS={trigger:"hover"},t.prototype.init=function(i,t){var o=n(i),e=t.trigger=o.find("a[data-toggle]").data("trigger");o.find("a[data-toggle]").addClass("dropdown-enabled"),"hover"==e?(o.bind("mouseover",function(){n(this).find(".dropdown").show()}),o.bind("mouseout",function(){n(this).find(".dropdown").hide()})):o.bind("click",function(){n(this).find(".dropdown").toggle()})};var o=n.fn.simplemenu;n.fn.simplemenu=i,n.fn.simplemenu.Constructor=t,n.fn.simplemenu.noConflict=function(){return n.fn.simplemenu=o,this}}(jQuery);
@@ -0,0 +1,60 @@
1
+ +function($) {
2
+ 'use strict';
3
+
4
+ var Simpleselect = function(element, options) {
5
+ this.init(element, options);
6
+ }
7
+
8
+ Simpleselect.DEFAULTS = {
9
+ "state" : ""
10
+ }
11
+
12
+ Simpleselect.prototype.init = function(element, options) {
13
+ var $ele = $(element);
14
+ options.state = checkState(element);
15
+ var template = generateTemplate(options);
16
+ var html = $ele.wrap(template);
17
+
18
+ $ele.on("change", function() {
19
+ changeState(this, options);
20
+ });
21
+ }
22
+
23
+ function generateTemplate(options) {
24
+ var template = '<span class="icon-'+options.state+' inline-top" data-icon="'+options.state+'"></span>';
25
+
26
+ return template;
27
+ }
28
+
29
+ function checkState(element) {
30
+ var state = $(element).is(':checked') ? 'select' : 'unselect';
31
+
32
+ return state;
33
+ }
34
+
35
+ function changeState(element, options) {
36
+ var new_state = checkState(element);
37
+
38
+ $(element).parent().toggleClass("icon-"+options.state+" icon-"+new_state).attr("data-icon", new_state);
39
+
40
+ options.state = new_state;
41
+ }
42
+
43
+ function Plugin(option) {
44
+ return this.each(function() {
45
+ var $this = $(this);
46
+ var options = $.extend({}, Simpleselect.DEFAULTS, option);
47
+ new Simpleselect(this, options);
48
+ });
49
+ }
50
+
51
+ var old = $.fn.simpleselect;
52
+
53
+ $.fn.simpleselect = Plugin;
54
+ $.fn.simpleselect.Constructor = Simpleselect;
55
+
56
+ $.fn.simpleselect.noConflict = function() {
57
+ $.fn.simpleselect = old;
58
+ return this;
59
+ }
60
+ }(jQuery);