semantic-ui-rails 0.0.1 → 0.0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generators/semantic/install/templates/semantic-ui/collections.less +6 -6
  3. data/lib/generators/semantic/install/templates/semantic-ui/elements.less +11 -11
  4. data/lib/generators/semantic/install/templates/semantic-ui/modules.less +16 -18
  5. data/lib/generators/semantic/install/templates/semantic-ui/views.less +5 -6
  6. data/lib/generators/semantic/install/templates/semantic-ui.js +19 -21
  7. data/lib/semantic/ui/rails/version.rb +1 -1
  8. data/semantic-ui-rails.gemspec +5 -0
  9. data/semantic.thor +153 -0
  10. data/vendor/assets/fonts/{icons.eot → semantic-ui/icons.eot} +0 -0
  11. data/vendor/assets/fonts/{icons.svg → semantic-ui/icons.svg} +0 -0
  12. data/vendor/assets/fonts/{icons.ttf → semantic-ui/icons.ttf} +0 -0
  13. data/vendor/assets/fonts/{icons.woff → semantic-ui/icons.woff} +0 -0
  14. data/vendor/assets/javascripts/semantic-ui/{accordion.js → modules/accordion.js} +0 -0
  15. data/vendor/assets/javascripts/semantic-ui/{behavior → modules/behavior}/api.js +0 -0
  16. data/vendor/assets/javascripts/semantic-ui/{behavior → modules/behavior}/colorize.js +0 -0
  17. data/vendor/assets/javascripts/semantic-ui/{behavior → modules/behavior}/form.js +80 -34
  18. data/vendor/assets/javascripts/semantic-ui/{behavior → modules/behavior}/state.js +0 -0
  19. data/vendor/assets/javascripts/semantic-ui/{chatroom.js → modules/chatroom.js} +0 -0
  20. data/vendor/assets/javascripts/semantic-ui/{checkbox.js → modules/checkbox.js} +0 -0
  21. data/vendor/assets/javascripts/semantic-ui/{dimmer.js → modules/dimmer.js} +4 -5
  22. data/vendor/assets/javascripts/semantic-ui/{dropdown.js → modules/dropdown.js} +6 -6
  23. data/vendor/assets/javascripts/semantic-ui/{modal.js → modules/modal.js} +0 -0
  24. data/vendor/assets/javascripts/semantic-ui/{nag.js → modules/nag.js} +0 -0
  25. data/vendor/assets/javascripts/semantic-ui/{popup.js → modules/popup.js} +0 -0
  26. data/vendor/assets/javascripts/semantic-ui/{rating.js → modules/rating.js} +0 -0
  27. data/vendor/assets/javascripts/semantic-ui/{search.js → modules/search.js} +0 -0
  28. data/vendor/assets/javascripts/semantic-ui/{shape.js → modules/shape.js} +0 -0
  29. data/vendor/assets/javascripts/semantic-ui/{sidebar.js → modules/sidebar.js} +0 -0
  30. data/vendor/assets/javascripts/semantic-ui/{tab.js → modules/tab.js} +0 -0
  31. data/vendor/assets/javascripts/semantic-ui/{transition.js → modules/transition.js} +0 -0
  32. data/vendor/assets/javascripts/semantic-ui/{video.js → modules/video.js} +0 -0
  33. data/vendor/assets/stylesheets/semantic-ui/.less +38 -0
  34. data/vendor/assets/stylesheets/semantic-ui/collections/.less +12 -0
  35. data/vendor/assets/stylesheets/semantic-ui/collections/menu.less +8 -5
  36. data/vendor/assets/stylesheets/semantic-ui/elements/.less +11 -0
  37. data/vendor/assets/stylesheets/semantic-ui/elements/icon.less +39 -1
  38. data/vendor/assets/stylesheets/semantic-ui/elements/label.less +20 -1
  39. data/vendor/assets/stylesheets/semantic-ui/modules/.less +16 -0
  40. data/vendor/assets/stylesheets/semantic-ui/views/.less +5 -0
  41. data/vendor/assets/stylesheets/semantic-ui/views/list.less +17 -0
  42. data/vendor/assets/stylesheets/semantic-ui/views/{statistic.less → statistic.css} +27 -34
  43. metadata +88 -30
  44. data/vendor/assets/javascripts/semantic-ui/carousel.js +0 -327
  45. data/vendor/assets/stylesheets/semantic-ui/modules/carousel.less +0 -71
  46. data/vendor/assets/stylesheets/semantic-ui/modules/extra.transition.less +0 -1197
  47. data/vendor/assets/stylesheets/semantic-ui/views/sitemap.less +0 -47
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 337e10465f853c08a4df2cffe36bb4101f02dbf3
4
- data.tar.gz: 30f4cd2b84ee125ad855559b4a7b8a3ad80ad0d2
3
+ metadata.gz: aa67ea57643498ce9a6ccfddff28a683351c7009
4
+ data.tar.gz: a95d023c2370ea7083de98914a5473343e33877d
5
5
  SHA512:
6
- metadata.gz: b8c222e806507d3c20bde5a97714f5500357703a4881b9c80639ec41203d3120218d4512159540a3ec4524062503d1facd7610ba028cece95a02011505052e1a
7
- data.tar.gz: 1a32e79abb036a2fd3bbd0230f75769353e5a71d8b9f31a4d4bc0258d7e0f51a56713536fe8a70b0bb9c44c0f289878c796b0bfcfb4df59f152710fb13a3ab0c
6
+ metadata.gz: a1bd442968196ffdaa1e578f64306ba0aec9ad55242103a3282faac24a65130026ac8829789eff307934cb5ee3c2fa53a397b84c9e54864a988fd66a29a47edb
7
+ data.tar.gz: a3603c79888fdff75fe96c3d2b770e899eb5926f16616ed256916bb19c2e69c481c80c0aa34cef49d4907c54805e7422ee9e9cdb18bbefef1198f4b510b96195
@@ -1,6 +1,6 @@
1
- @import "semantic-ui/collections/breadcrumb.less";
2
- @import "semantic-ui/collections/form.less";
3
- @import "semantic-ui/collections/grid.less";
4
- @import "semantic-ui/collections/menu.less";
5
- @import "semantic-ui/collections/message.less";
6
- @import "semantic-ui/collections/table.less";
1
+ @import 'semantic-ui/collections/table.less';
2
+ @import 'semantic-ui/collections/breadcrumb.less';
3
+ @import 'semantic-ui/collections/message.less';
4
+ @import 'semantic-ui/collections/grid.less';
5
+ @import 'semantic-ui/collections/menu.less';
6
+ @import 'semantic-ui/collections/form.less';
@@ -1,11 +1,11 @@
1
- @import "semantic-ui/elements/button.less";
2
- @import "semantic-ui/elements/divider.less";
3
- @import "semantic-ui/elements/header.less";
4
- @import "semantic-ui/elements/icon.less";
5
- @import "semantic-ui/elements/image.less";
6
- @import "semantic-ui/elements/input.less";
7
- @import "semantic-ui/elements/label.less";
8
- @import "semantic-ui/elements/loader.less";
9
- @import "semantic-ui/elements/progress.less";
10
- @import "semantic-ui/elements/segment.less";
11
- @import "semantic-ui/elements/step.less";
1
+ @import 'semantic-ui/elements/header.less';
2
+ @import 'semantic-ui/elements/progress.less';
3
+ @import 'semantic-ui/elements/segment.less';
4
+ @import 'semantic-ui/elements/loader.less';
5
+ @import 'semantic-ui/elements/step.less';
6
+ @import 'semantic-ui/elements/button.less';
7
+ @import 'semantic-ui/elements/input.less';
8
+ @import 'semantic-ui/elements/label.less';
9
+ @import 'semantic-ui/elements/divider.less';
10
+ @import 'semantic-ui/elements/image.less';
11
+ @import 'semantic-ui/elements/icon.less';
@@ -1,18 +1,16 @@
1
- @import "semantic-ui/modules/accordion.less";
2
- @import "semantic-ui/modules/carousel.less";
3
- @import "semantic-ui/modules/chatroom.less";
4
- @import "semantic-ui/modules/checkbox.less";
5
- @import "semantic-ui/modules/dimmer.less";
6
- @import "semantic-ui/modules/dropdown.less";
7
- @import "semantic-ui/modules/extra.transition.less";
8
- @import "semantic-ui/modules/modal.less";
9
- @import "semantic-ui/modules/nag.less";
10
- @import "semantic-ui/modules/popup.less";
11
- @import "semantic-ui/modules/rating.less";
12
- @import "semantic-ui/modules/reveal.less";
13
- @import "semantic-ui/modules/search.less";
14
- @import "semantic-ui/modules/shape.less";
15
- @import "semantic-ui/modules/sidebar.less";
16
- @import "semantic-ui/modules/tab.less";
17
- @import "semantic-ui/modules/transition.less";
18
- @import "semantic-ui/modules/video.less";
1
+ @import 'semantic-ui/modules/popup.less';
2
+ @import 'semantic-ui/modules/dimmer.less';
3
+ @import 'semantic-ui/modules/rating.less';
4
+ @import 'semantic-ui/modules/accordion.less';
5
+ @import 'semantic-ui/modules/transition.less';
6
+ @import 'semantic-ui/modules/checkbox.less';
7
+ @import 'semantic-ui/modules/search.less';
8
+ @import 'semantic-ui/modules/video.less';
9
+ @import 'semantic-ui/modules/nag.less';
10
+ @import 'semantic-ui/modules/shape.less';
11
+ @import 'semantic-ui/modules/modal.less';
12
+ @import 'semantic-ui/modules/sidebar.less';
13
+ @import 'semantic-ui/modules/reveal.less';
14
+ @import 'semantic-ui/modules/tab.less';
15
+ @import 'semantic-ui/modules/dropdown.less';
16
+ @import 'semantic-ui/modules/chatroom.less';
@@ -1,6 +1,5 @@
1
- @import "semantic-ui/views/comment.less";
2
- @import "semantic-ui/views/feed.less";
3
- @import "semantic-ui/views/item.less";
4
- @import "semantic-ui/views/list.less";
5
- @import "semantic-ui/views/sitemap.less";
6
- @import "semantic-ui/views/statistic.less";
1
+ @import 'semantic-ui/views/list.less';
2
+ @import 'semantic-ui/views/comment.less';
3
+ @import 'semantic-ui/views/statistic.css';
4
+ @import 'semantic-ui/views/item.less';
5
+ @import 'semantic-ui/views/feed.less';
@@ -1,21 +1,19 @@
1
- //= require semantic-ui/accordion
2
- //= require semantic-ui/carousel
3
- //= require semantic-ui/chatroom
4
- //= require semantic-ui/checkbox
5
- //= require semantic-ui/dimmer
6
- //= require semantic-ui/dropdown
7
- //= require semantic-ui/modal
8
- //= require semantic-ui/nag
9
- //= require semantic-ui/popup
10
- //= require semantic-ui/rating
11
- //= require semantic-ui/search
12
- //= require semantic-ui/shape
13
- //= require semantic-ui/sidebar
14
- //= require semantic-ui/tab
15
- //= require semantic-ui/transition
16
- //= require semantic-ui/video
17
-
18
- //= require semantic-ui/behavior/api
19
- //= require semantic-ui/behavior/colorize
20
- //= require semantic-ui/behavior/form
21
- //= require semantic-ui/behavior/state
1
+ //= require semantic-ui/modules/dimmer.js
2
+ //= require semantic-ui/modules/checkbox.js
3
+ //= require semantic-ui/modules/tab.js
4
+ //= require semantic-ui/modules/behavior/state.js
5
+ //= require semantic-ui/modules/behavior/colorize.js
6
+ //= require semantic-ui/modules/behavior/form.js
7
+ //= require semantic-ui/modules/behavior/api.js
8
+ //= require semantic-ui/modules/nag.js
9
+ //= require semantic-ui/modules/transition.js
10
+ //= require semantic-ui/modules/popup.js
11
+ //= require semantic-ui/modules/shape.js
12
+ //= require semantic-ui/modules/rating.js
13
+ //= require semantic-ui/modules/video.js
14
+ //= require semantic-ui/modules/modal.js
15
+ //= require semantic-ui/modules/accordion.js
16
+ //= require semantic-ui/modules/sidebar.js
17
+ //= require semantic-ui/modules/search.js
18
+ //= require semantic-ui/modules/dropdown.js
19
+ //= require semantic-ui/modules/chatroom.js
@@ -1,7 +1,7 @@
1
1
  module Semantic
2
2
  module Ui
3
3
  module Rails
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2.1"
5
5
  end
6
6
  end
7
7
  end
@@ -18,6 +18,11 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.add_dependency "less-rails"
22
+
21
23
  spec.add_development_dependency "bundler", "~> 1.3"
22
24
  spec.add_development_dependency "rake"
25
+ spec.add_development_dependency "pry"
26
+ spec.add_development_dependency "binding_of_caller"
27
+ spec.add_development_dependency "git"
23
28
  end
data/semantic.thor ADDED
@@ -0,0 +1,153 @@
1
+ require 'pry'
2
+ require 'fileutils'
3
+ require 'git'
4
+ require 'logger'
5
+ require 'json'
6
+
7
+ class Semantic < Thor
8
+ include Thor::Actions
9
+
10
+ REPO_URI = "https://github.com/jlukic/Semantic-UI.git"
11
+
12
+ desc "update", "fetch Semantic UI code from git"
13
+ method_option :branch, default: "master"
14
+
15
+ def update
16
+ if File.directory? working_dir
17
+ say_status "MESSAGE", "WORKING DIR EXIST"
18
+ pull
19
+ else
20
+ say_status "MESSAGE", "THERE IS NO WORKING DIR"
21
+ prepare
22
+ clone
23
+ end
24
+
25
+ parse_version
26
+ copy_files
27
+ generate_templates
28
+ end
29
+
30
+ no_commands do
31
+
32
+ def clone
33
+ say_status "STEP", "CLONE REPO"
34
+ Dir.chdir working_dir
35
+
36
+ git = Git.clone(REPO_URI, 'semantic-ui')
37
+ end
38
+
39
+ def pull
40
+ say_status "STEP", "PULL REPO"
41
+ git = Git.open(git_root, :log => Logger.new(STDOUT))
42
+ git.pull
43
+ end
44
+
45
+ def parse_version
46
+ say_status "STEP", "PARSE VERSION"
47
+ Dir.chdir git_root
48
+
49
+ component = JSON.parse( IO.read('component.json'), :quirks_mode => true)
50
+ version = component["version"]
51
+
52
+ version_file = source_root + "lib/semantic/ui/rails/version.rb"
53
+
54
+ gsub_file version_file, /(?<=VERSION = \")(.+)(?=\")/, version
55
+ end
56
+
57
+ def copy_files
58
+ say_status "STEP", "COPY FILES"
59
+
60
+ # STYLESHEETS
61
+ stylesheets_path = "vendor/assets/stylesheets/semantic-ui/"
62
+ run "rsync -avm --include='*.less' --include='*.css' -f 'hide,! */' #{git_root + 'src/'} #{source_root + stylesheets_path}"
63
+
64
+ # JAVASCRIPTS
65
+ javascripts_path = "vendor/assets/javascripts/semantic-ui/"
66
+ run "rsync -avm --include='*.js' -f 'hide,! */' #{git_root + 'src/'} #{source_root + javascripts_path}"
67
+
68
+ # FONTS
69
+ fonts_path = "vendor/assets/fonts/semantic-ui"
70
+ run "rsync -avm --include='*.*' -f 'hide,! */' #{git_root + 'src/fonts/'} #{source_root + fonts_path}"
71
+
72
+ # IMAGES
73
+ images_path = "vendor/assets/images/semantic-ui/"
74
+ run "rsync -avm --include='*.*' -f 'hide,! */' #{git_root + 'src/images/'} #{source_root + images_path}"
75
+ end
76
+
77
+ def generate_templates
78
+ # JAVASCRIPTS
79
+ say_status "STEP", "GENERATE JAVASCRIPT TEMPLATE"
80
+ js_template_path = source_root + "lib/generators/semantic/install/templates/semantic-ui.js"
81
+
82
+ javascripts_path = Pathname.new(source_root + "vendor/assets/javascripts/semantic-ui")
83
+
84
+ FileUtils.rm js_template_path
85
+
86
+ File.open(js_template_path, 'a') do |template|
87
+ Dir.glob(source_root + javascripts_path + "**/*") do |file|
88
+ next if File.directory? file
89
+
90
+ filepath = Pathname.new(file)
91
+
92
+ relative_path = filepath.relative_path_from(javascripts_path)
93
+
94
+ template.write "//= require semantic-ui/#{relative_path} \n"
95
+ end
96
+ end
97
+
98
+ # STYLESHEETS
99
+ say_status "STEP", "GENERATE STYLESHEETS TEMPLATES"
100
+ css_template_path = source_root + "lib/generators/semantic/install/templates/semantic-ui/"
101
+
102
+ stylesheets_path = Pathname.new(source_root + "vendor/assets/stylesheets/semantic-ui")
103
+
104
+ FileUtils.rm_rf Dir.glob css_template_path + "*.*"
105
+
106
+ Dir.glob stylesheets_path + "**/*" do |file|
107
+ if File.directory? file
108
+ File.open(css_template_path + (Pathname.new(file).basename.to_s + ".less"), 'a') do |template|
109
+ Dir.glob(stylesheets_path + file + "**/*") do |file|
110
+ next if File.directory? file
111
+
112
+ filepath = Pathname.new(file)
113
+
114
+ relative_path = filepath.relative_path_from(stylesheets_path)
115
+
116
+ template.write "@import 'semantic-ui/#{relative_path}'; \n"
117
+ end
118
+ end
119
+ end
120
+ end
121
+ end
122
+
123
+ def clean
124
+ say_status "MESSAGE", "DELETE WORKING DIR"
125
+ FileUtils.rm_rf 'tmp/updater'
126
+ end
127
+
128
+ def prepare
129
+ say_status "MESSAGE", "CREATE WORKING DIR"
130
+ FileUtils.mkdir_p 'tmp/updater'
131
+ end
132
+
133
+
134
+ # dirs
135
+
136
+ def self.source_root
137
+ File.dirname(__FILE__)
138
+ end
139
+
140
+ def git_root
141
+ working_dir + 'semantic-ui'
142
+ end
143
+
144
+ def working_dir
145
+ source_root + 'tmp/updater'
146
+ end
147
+
148
+ def source_root
149
+ Pathname.new File.dirname(__FILE__)
150
+ end
151
+
152
+ end
153
+ end
@@ -68,11 +68,14 @@ $.fn.form = function(fields, parameters) {
68
68
  .on('submit' + eventNamespace, module.validate.form)
69
69
  ;
70
70
  $field
71
- .on('blur' + eventNamespace, module.event.field.change)
71
+ .on('blur' + eventNamespace, module.event.field.blur)
72
72
  ;
73
73
  $submit
74
74
  .on('click' + eventNamespace, module.submit)
75
75
  ;
76
+ $field
77
+ .on(module.get.changeEvent() + eventNamespace, module.event.field.change)
78
+ ;
76
79
  module.instantiate();
77
80
  },
78
81
 
@@ -121,7 +124,7 @@ $.fn.form = function(fields, parameters) {
121
124
  .blur()
122
125
  ;
123
126
  }
124
- if( key == keyCode.enter && $field.is(selector.input) ) {
127
+ if(!event.ctrlKey && key == keyCode.enter && $field.is(selector.input) ) {
125
128
  module.debug('Enter key pressed, submitting form');
126
129
  $submit
127
130
  .addClass(className.down)
@@ -138,6 +141,19 @@ $.fn.form = function(fields, parameters) {
138
141
  $submit.removeClass(className.down);
139
142
  module.submit();
140
143
  },
144
+ blur: function() {
145
+ var
146
+ $field = $(this),
147
+ $fieldGroup = $field.closest($group)
148
+ ;
149
+ if( $fieldGroup.hasClass(className.error) ) {
150
+ module.debug('Revalidating field', $field, module.get.validation($field));
151
+ module.validate.field( module.get.validation($field) );
152
+ }
153
+ else if(settings.on == 'blur' || settings.on == 'change') {
154
+ module.validate.field( module.get.validation($field) );
155
+ }
156
+ },
141
157
  change: function() {
142
158
  var
143
159
  $field = $(this),
@@ -156,6 +172,14 @@ $.fn.form = function(fields, parameters) {
156
172
  },
157
173
 
158
174
  get: {
175
+ changeEvent: function() {
176
+ return (document.createElement('input').oninput !== undefined)
177
+ ? 'input'
178
+ : (document.createElement('input').onpropertychange !== undefined)
179
+ ? 'propertychange'
180
+ : 'keyup'
181
+ ;
182
+ },
159
183
  field: function(identifier) {
160
184
  module.verbose('Finding field with identifier', identifier);
161
185
  if( $field.filter('#' + identifier).size() > 0 ) {
@@ -208,25 +232,31 @@ $.fn.form = function(fields, parameters) {
208
232
  $prompt = $fieldGroup.find(selector.prompt),
209
233
  promptExists = ($prompt.size() !== 0)
210
234
  ;
211
- module.verbose('Adding inline validation prompt');
235
+ module.verbose('Adding inline error', field);
212
236
  $fieldGroup
213
237
  .addClass(className.error)
214
238
  ;
215
- if(settings.inlineError) {
239
+ if(settings.inline) {
216
240
  if(!promptExists) {
217
241
  $prompt = settings.templates.prompt(errors);
218
242
  $prompt
219
243
  .appendTo($fieldGroup)
220
- .hide()
221
244
  ;
222
245
  }
223
246
  $prompt
224
247
  .html(errors[0])
225
248
  ;
226
- if($prompt.is(':not(:visible)')) {
227
- $prompt
228
- .fadeIn(settings.animateSpeed)
229
- ;
249
+ if(!promptExists) {
250
+ if(settings.transition && $.fn.transition !== undefined) {
251
+ module.verbose('Displaying error with css transition', settings.transition);
252
+ $prompt.transition(settings.transition + ' in', settings.duration);
253
+ }
254
+ else {
255
+ module.verbose('Displaying error with fallback javascript animation');
256
+ $prompt
257
+ .fadeIn(settings.duration)
258
+ ;
259
+ }
230
260
  }
231
261
  }
232
262
  },
@@ -248,8 +278,20 @@ $.fn.form = function(fields, parameters) {
248
278
  $fieldGroup
249
279
  .removeClass(className.error)
250
280
  ;
251
- if(settings.inlineError) {
252
- $prompt.hide();
281
+ if(settings.inline && $prompt.is(':visible')) {
282
+ module.verbose('Removing prompt for field', field);
283
+ if(settings.transition && $.fn.transition !== undefined) {
284
+ $prompt.transition(settings.transition + ' out', settings.duration, function() {
285
+ $prompt.remove();
286
+ });
287
+ }
288
+ else {
289
+ $prompt
290
+ .fadeOut(settings.duration, function(){
291
+ $prompt.remove();
292
+ })
293
+ ;
294
+ }
253
295
  }
254
296
  }
255
297
  },
@@ -278,7 +320,7 @@ $.fn.form = function(fields, parameters) {
278
320
  else {
279
321
  module.debug('Form has errors');
280
322
  $module.addClass(className.error);
281
- if(!settings.inlineError) {
323
+ if(!settings.inline) {
282
324
  module.add.errors(formErrors);
283
325
  }
284
326
  return $.proxy(settings.onFailure, this)(formErrors);
@@ -530,19 +572,20 @@ $.fn.form = function(fields, parameters) {
530
572
 
531
573
  $.fn.form.settings = {
532
574
 
533
- // module info
534
- name : 'Form',
575
+ name : 'Form',
576
+ namespace : 'form',
535
577
 
536
578
  debug : true,
537
579
  verbose : true,
538
580
  performance : true,
539
581
 
540
- namespace : 'form',
541
582
 
542
583
  keyboardShortcuts : true,
543
584
  on : 'submit',
544
- animateSpeed : 150,
545
- inlineError : false,
585
+ inline : false,
586
+
587
+ transition : 'scale',
588
+ duration : 150,
546
589
 
547
590
 
548
591
  onValid : function() {},
@@ -555,19 +598,19 @@ $.fn.form.settings = {
555
598
  },
556
599
 
557
600
  selector : {
558
- message : '.error.message',
559
- field : 'input, textarea, select',
560
- group : '.field',
561
- input : 'input',
562
- prompt : '.prompt',
563
- submit : '.submit'
601
+ message : '.error.message',
602
+ field : 'input, textarea, select',
603
+ group : '.field',
604
+ input : 'input',
605
+ prompt : '.prompt',
606
+ submit : '.submit'
564
607
  },
565
608
 
566
609
  className : {
567
- error : 'error',
568
- success: 'success',
569
- down : 'down',
570
- label : 'ui label prompt'
610
+ error : 'error',
611
+ success : 'success',
612
+ down : 'down',
613
+ label : 'ui label prompt'
571
614
  },
572
615
 
573
616
  // errors
@@ -615,6 +658,9 @@ $.fn.form.settings = {
615
658
  not: function(value, notValue) {
616
659
  return (value != notValue);
617
660
  },
661
+ contains: function(value, text) {
662
+ return (value.search(text) !== -1);
663
+ },
618
664
  is: function(value, text) {
619
665
  return (value == text);
620
666
  },
@@ -624,20 +670,20 @@ $.fn.form.settings = {
624
670
  : false
625
671
  ;
626
672
  },
627
- match: function(value, matchingField) {
673
+ match: function(value, fieldIdentifier) {
628
674
  // use either id or name of field
629
675
  var
630
676
  $form = $(this),
631
677
  matchingValue
632
678
  ;
633
- if($form.find('#' + matchingField).size() > 0) {
634
- matchingValue = $form.find('#' + matchingField).val();
679
+ if($form.find('#' + fieldIdentifier).size() > 0) {
680
+ matchingValue = $form.find('#' + fieldIdentifier).val();
635
681
  }
636
- else if($form.find('[name=' + matchingField +']').size() > 0) {
637
- matchingValue = $form.find('[name=' + matchingField + ']').val();
682
+ else if($form.find('[name=' + fieldIdentifier +']').size() > 0) {
683
+ matchingValue = $form.find('[name=' + fieldIdentifier + ']').val();
638
684
  }
639
- else if( $form.find('[data-validate="'+ matchingField +'"]').size() > 0 ) {
640
- matchingValue = $form.find('[data-validate="'+ matchingField +'"]').val();
685
+ else if( $form.find('[data-validate="'+ fieldIdentifier +'"]').size() > 0 ) {
686
+ matchingValue = $form.find('[data-validate="'+ fieldIdentifier +'"]').val();
641
687
  }
642
688
  return (matchingValue !== undefined)
643
689
  ? ( value.toString() == matchingValue.toString() )
@@ -191,7 +191,7 @@ $.fn.dimmer = function(parameters) {
191
191
  return $dimmer.hasClass(className.active);
192
192
  },
193
193
  animating: function() {
194
- return ( $dimmer.hasClass(className.show) || $dimmer.hasClass(className.hide) || $dimmer.is(':animated') );
194
+ return ( $dimmer.is(':animated') || $dimmer.hasClass(className.transition) );
195
195
  },
196
196
  dimmer: function() {
197
197
  return $module.is(selector.dimmer);
@@ -259,7 +259,7 @@ $.fn.dimmer = function(parameters) {
259
259
 
260
260
  show: function(callback) {
261
261
  module.debug('Showing dimmer', $dimmer);
262
- if( (!module.is.active() || module.is.animating() ) && module.is.enabled() ) {
262
+ if( !(module.is.active() || module.is.animating() ) && module.is.enabled() ) {
263
263
  module.animate.show(callback);
264
264
  $.proxy(settings.onShow, element)();
265
265
  $.proxy(settings.onChange, element)();
@@ -270,7 +270,7 @@ $.fn.dimmer = function(parameters) {
270
270
  },
271
271
 
272
272
  hide: function(callback) {
273
- if( module.is.active() || module.is.animating() ) {
273
+ if( module.is.active() && !module.is.animating() ) {
274
274
  module.debug('Hiding dimmer', $dimmer);
275
275
  module.animate.hide(callback);
276
276
  $.proxy(settings.onHide, element)();
@@ -510,14 +510,13 @@ $.fn.dimmer.settings = {
510
510
 
511
511
  className : {
512
512
  active : 'active',
513
- animating : 'animating',
514
513
  dimmable : 'ui dimmable',
515
514
  dimmed : 'dimmed',
516
515
  disabled : 'disabled',
517
516
  pageDimmer : 'page',
518
517
  hide : 'hide',
519
518
  show : 'show',
520
- transition : 'transition hidden visible'
519
+ transition : 'transition'
521
520
  }
522
521
 
523
522
  };
@@ -316,14 +316,14 @@ $.fn.dropdown = function(parameters) {
316
316
  is: {
317
317
  visible: function($subMenu) {
318
318
  return ($subMenu)
319
- ? $subMenu.is(':visible')
320
- : $menu.is(':visible')
319
+ ? $subMenu.is(':animated, :visible')
320
+ : $menu.is(':animated, :visible')
321
321
  ;
322
322
  },
323
323
  hidden: function($subMenu) {
324
324
  return ($subMenu)
325
- ? $subMenu.is(':not(:visible)')
326
- : $menu.is(':not(:visible)')
325
+ ? $subMenu.is(':not(:animated, :visible)')
326
+ : $menu.is(':not(:animated, :visible)')
327
327
  ;
328
328
  }
329
329
  },
@@ -434,7 +434,7 @@ $.fn.dropdown = function(parameters) {
434
434
 
435
435
  show: function() {
436
436
  dropdown.debug('Checking if dropdown can show');
437
- if( !dropdown.is.visible() ) {
437
+ if( dropdown.is.hidden() ) {
438
438
  dropdown.hideOthers();
439
439
  dropdown.set.active();
440
440
  dropdown.animate.show(dropdown.set.visible);
@@ -446,7 +446,7 @@ $.fn.dropdown = function(parameters) {
446
446
  },
447
447
 
448
448
  hide: function() {
449
- if( !dropdown.is.hidden() ) {
449
+ if( dropdown.is.visible() ) {
450
450
  dropdown.debug('Hiding dropdown');
451
451
  if( dropdown.can.click() ) {
452
452
  dropdown.unbind.intent();