wiskey 0.0.1

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 (73) hide show
  1. data/.gitignore +28 -0
  2. data/.rvmrc +1 -0
  3. data/Gemfile +10 -0
  4. data/Gemfile.lock +89 -0
  5. data/MIT-LICENSE +20 -0
  6. data/README.rdoc +3 -0
  7. data/Rakefile +29 -0
  8. data/app/assets/stylesheets/_wiskey.scss +25 -0
  9. data/app/assets/stylesheets/addons/_animation-keyframes.scss +28 -0
  10. data/app/assets/stylesheets/addons/_button.scss +169 -0
  11. data/app/assets/stylesheets/addons/_position.scss +30 -0
  12. data/app/assets/stylesheets/addons/_timing-functions.scss +29 -0
  13. data/app/assets/stylesheets/css3/_animation.scss +161 -0
  14. data/app/assets/stylesheets/css3/_background-clip.scss +25 -0
  15. data/app/assets/stylesheets/css3/_border-radius.scss +54 -0
  16. data/app/assets/stylesheets/css3/_box-shadow.scss +3 -0
  17. data/app/assets/stylesheets/css3/_box-sizing.scss +8 -0
  18. data/app/assets/stylesheets/css3/_flex-box.scss +67 -0
  19. data/app/assets/stylesheets/css3/_inline-block.scss +21 -0
  20. data/app/assets/stylesheets/css3/_linear-gradient.scss +32 -0
  21. data/app/assets/stylesheets/css3/_opacity.scss +6 -0
  22. data/app/assets/stylesheets/css3/_radial-gradient.scss +21 -0
  23. data/app/assets/stylesheets/css3/_text-overflow.scss +5 -0
  24. data/app/assets/stylesheets/css3/_text-shadow.scss +3 -0
  25. data/app/assets/stylesheets/css3/_transform.scss +19 -0
  26. data/app/assets/stylesheets/css3/_transition.scss +104 -0
  27. data/app/assets/stylesheets/functions/_experimental.scss +15 -0
  28. data/app/assets/stylesheets/functions/_linear-gradient.scss +21 -0
  29. data/lib/tasks/install.rake +10 -0
  30. data/lib/wiskey/engine.rb +5 -0
  31. data/lib/wiskey/sass_extensions/functions/compact.rb +13 -0
  32. data/lib/wiskey/sass_extensions/functions.rb +13 -0
  33. data/lib/wiskey/sass_extensions.rb +6 -0
  34. data/lib/wiskey/version.rb +3 -0
  35. data/lib/wiskey.rb +17 -0
  36. data/test/dummy/Rakefile +7 -0
  37. data/test/dummy/app/assets/stylesheets/application.css.scss +1 -0
  38. data/test/dummy/app/controllers/application_controller.rb +3 -0
  39. data/test/dummy/app/helpers/application_helper.rb +2 -0
  40. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  41. data/test/dummy/config/application.rb +48 -0
  42. data/test/dummy/config/boot.rb +10 -0
  43. data/test/dummy/config/database.yml +22 -0
  44. data/test/dummy/config/environment.rb +5 -0
  45. data/test/dummy/config/environments/development.rb +25 -0
  46. data/test/dummy/config/environments/production.rb +52 -0
  47. data/test/dummy/config/environments/test.rb +39 -0
  48. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  49. data/test/dummy/config/initializers/inflections.rb +10 -0
  50. data/test/dummy/config/initializers/mime_types.rb +5 -0
  51. data/test/dummy/config/initializers/secret_token.rb +7 -0
  52. data/test/dummy/config/initializers/session_store.rb +8 -0
  53. data/test/dummy/config/locales/en.yml +5 -0
  54. data/test/dummy/config/routes.rb +58 -0
  55. data/test/dummy/config.ru +4 -0
  56. data/test/dummy/public/404.html +26 -0
  57. data/test/dummy/public/422.html +26 -0
  58. data/test/dummy/public/500.html +26 -0
  59. data/test/dummy/public/favicon.ico +0 -0
  60. data/test/dummy/public/javascripts/application.js +2 -0
  61. data/test/dummy/public/javascripts/controls.js +965 -0
  62. data/test/dummy/public/javascripts/dragdrop.js +974 -0
  63. data/test/dummy/public/javascripts/effects.js +1123 -0
  64. data/test/dummy/public/javascripts/prototype.js +6001 -0
  65. data/test/dummy/public/javascripts/rails.js +191 -0
  66. data/test/dummy/public/stylesheets/.gitkeep +0 -0
  67. data/test/dummy/script/rails +6 -0
  68. data/test/integration/navigation_test.rb +7 -0
  69. data/test/support/integration_case.rb +5 -0
  70. data/test/test_helper.rb +22 -0
  71. data/test/wiskey_test.rb +7 -0
  72. data/wiskey.gemspec +16 -0
  73. metadata +129 -0
@@ -0,0 +1,191 @@
1
+ (function() {
2
+ // Technique from Juriy Zaytsev
3
+ // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
4
+ function isEventSupported(eventName) {
5
+ var el = document.createElement('div');
6
+ eventName = 'on' + eventName;
7
+ var isSupported = (eventName in el);
8
+ if (!isSupported) {
9
+ el.setAttribute(eventName, 'return;');
10
+ isSupported = typeof el[eventName] == 'function';
11
+ }
12
+ el = null;
13
+ return isSupported;
14
+ }
15
+
16
+ function isForm(element) {
17
+ return Object.isElement(element) && element.nodeName.toUpperCase() == 'FORM'
18
+ }
19
+
20
+ function isInput(element) {
21
+ if (Object.isElement(element)) {
22
+ var name = element.nodeName.toUpperCase()
23
+ return name == 'INPUT' || name == 'SELECT' || name == 'TEXTAREA'
24
+ }
25
+ else return false
26
+ }
27
+
28
+ var submitBubbles = isEventSupported('submit'),
29
+ changeBubbles = isEventSupported('change')
30
+
31
+ if (!submitBubbles || !changeBubbles) {
32
+ // augment the Event.Handler class to observe custom events when needed
33
+ Event.Handler.prototype.initialize = Event.Handler.prototype.initialize.wrap(
34
+ function(init, element, eventName, selector, callback) {
35
+ init(element, eventName, selector, callback)
36
+ // is the handler being attached to an element that doesn't support this event?
37
+ if ( (!submitBubbles && this.eventName == 'submit' && !isForm(this.element)) ||
38
+ (!changeBubbles && this.eventName == 'change' && !isInput(this.element)) ) {
39
+ // "submit" => "emulated:submit"
40
+ this.eventName = 'emulated:' + this.eventName
41
+ }
42
+ }
43
+ )
44
+ }
45
+
46
+ if (!submitBubbles) {
47
+ // discover forms on the page by observing focus events which always bubble
48
+ document.on('focusin', 'form', function(focusEvent, form) {
49
+ // special handler for the real "submit" event (one-time operation)
50
+ if (!form.retrieve('emulated:submit')) {
51
+ form.on('submit', function(submitEvent) {
52
+ var emulated = form.fire('emulated:submit', submitEvent, true)
53
+ // if custom event received preventDefault, cancel the real one too
54
+ if (emulated.returnValue === false) submitEvent.preventDefault()
55
+ })
56
+ form.store('emulated:submit', true)
57
+ }
58
+ })
59
+ }
60
+
61
+ if (!changeBubbles) {
62
+ // discover form inputs on the page
63
+ document.on('focusin', 'input, select, texarea', function(focusEvent, input) {
64
+ // special handler for real "change" events
65
+ if (!input.retrieve('emulated:change')) {
66
+ input.on('change', function(changeEvent) {
67
+ input.fire('emulated:change', changeEvent, true)
68
+ })
69
+ input.store('emulated:change', true)
70
+ }
71
+ })
72
+ }
73
+
74
+ function handleRemote(element) {
75
+ var method, url, params;
76
+
77
+ var event = element.fire("ajax:before");
78
+ if (event.stopped) return false;
79
+
80
+ if (element.tagName.toLowerCase() === 'form') {
81
+ method = element.readAttribute('method') || 'post';
82
+ url = element.readAttribute('action');
83
+ params = element.serialize();
84
+ } else {
85
+ method = element.readAttribute('data-method') || 'get';
86
+ url = element.readAttribute('href');
87
+ params = {};
88
+ }
89
+
90
+ new Ajax.Request(url, {
91
+ method: method,
92
+ parameters: params,
93
+ evalScripts: true,
94
+
95
+ onComplete: function(request) { element.fire("ajax:complete", request); },
96
+ onSuccess: function(request) { element.fire("ajax:success", request); },
97
+ onFailure: function(request) { element.fire("ajax:failure", request); }
98
+ });
99
+
100
+ element.fire("ajax:after");
101
+ }
102
+
103
+ function handleMethod(element) {
104
+ var method = element.readAttribute('data-method'),
105
+ url = element.readAttribute('href'),
106
+ csrf_param = $$('meta[name=csrf-param]')[0],
107
+ csrf_token = $$('meta[name=csrf-token]')[0];
108
+
109
+ var form = new Element('form', { method: "POST", action: url, style: "display: none;" });
110
+ element.parentNode.insert(form);
111
+
112
+ if (method !== 'post') {
113
+ var field = new Element('input', { type: 'hidden', name: '_method', value: method });
114
+ form.insert(field);
115
+ }
116
+
117
+ if (csrf_param) {
118
+ var param = csrf_param.readAttribute('content'),
119
+ token = csrf_token.readAttribute('content'),
120
+ field = new Element('input', { type: 'hidden', name: param, value: token });
121
+ form.insert(field);
122
+ }
123
+
124
+ form.submit();
125
+ }
126
+
127
+
128
+ document.on("click", "*[data-confirm]", function(event, element) {
129
+ var message = element.readAttribute('data-confirm');
130
+ if (!confirm(message)) event.stop();
131
+ });
132
+
133
+ document.on("click", "a[data-remote]", function(event, element) {
134
+ if (event.stopped) return;
135
+ handleRemote(element);
136
+ event.stop();
137
+ });
138
+
139
+ document.on("click", "a[data-method]", function(event, element) {
140
+ if (event.stopped) return;
141
+ handleMethod(element);
142
+ event.stop();
143
+ });
144
+
145
+ document.on("submit", function(event) {
146
+ var element = event.findElement(),
147
+ message = element.readAttribute('data-confirm');
148
+ if (message && !confirm(message)) {
149
+ event.stop();
150
+ return false;
151
+ }
152
+
153
+ var inputs = element.select("input[type=submit][data-disable-with]");
154
+ inputs.each(function(input) {
155
+ input.disabled = true;
156
+ input.writeAttribute('data-original-value', input.value);
157
+ input.value = input.readAttribute('data-disable-with');
158
+ });
159
+
160
+ var element = event.findElement("form[data-remote]");
161
+ if (element) {
162
+ handleRemote(element);
163
+ event.stop();
164
+ }
165
+ });
166
+
167
+ document.on("ajax:after", "form", function(event, element) {
168
+ var inputs = element.select("input[type=submit][disabled=true][data-disable-with]");
169
+ inputs.each(function(input) {
170
+ input.value = input.readAttribute('data-original-value');
171
+ input.removeAttribute('data-original-value');
172
+ input.disabled = false;
173
+ });
174
+ });
175
+
176
+ Ajax.Responders.register({
177
+ onCreate: function(request) {
178
+ var csrf_meta_tag = $$('meta[name=csrf-token]')[0];
179
+
180
+ if (csrf_meta_tag) {
181
+ var header = 'X-CSRF-Token',
182
+ token = csrf_meta_tag.readAttribute('content');
183
+
184
+ if (!request.options.requestHeaders) {
185
+ request.options.requestHeaders = {};
186
+ }
187
+ request.options.requestHeaders[header] = token;
188
+ }
189
+ }
190
+ });
191
+ })();
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class NavigationTest < ActiveSupport::IntegrationCase
4
+ test "truth" do
5
+ assert_kind_of Dummy::Application, Rails.application
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ # Define a bare test case to use with Capybara
2
+ class ActiveSupport::IntegrationCase < ActiveSupport::TestCase
3
+ include Capybara
4
+ include Rails.application.routes.url_helpers
5
+ end
@@ -0,0 +1,22 @@
1
+ # Configure Rails Envinronment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+
7
+ ActionMailer::Base.delivery_method = :test
8
+ ActionMailer::Base.perform_deliveries = true
9
+ ActionMailer::Base.default_url_options[:host] = "test.com"
10
+
11
+ Rails.backtrace_cleaner.remove_silencers!
12
+
13
+ # Configure capybara for integration testing
14
+ require "capybara/rails"
15
+ Capybara.default_driver = :rack_test
16
+ Capybara.default_selector = :css
17
+
18
+ # Run any available migration
19
+ ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
20
+
21
+ # Load support files
22
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class WiskeyTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, Wiskey
6
+ end
7
+ end
data/wiskey.gemspec ADDED
@@ -0,0 +1,16 @@
1
+ # Provide a simple gemspec so you can easily use your enginex
2
+ # project in your rails apps through git.
3
+ Gem::Specification.new do |s|
4
+ s.name = "wiskey"
5
+ s.summary = "The solutoiuns for the rails cutupping."
6
+
7
+ s.authors = [ "Alexey Osipenko" ]
8
+ s.email = [ "alexey@osipenko.in.ua" ]
9
+ s.homepage = "http://wiskey.github.com"
10
+ s.description = "The rails 3 gem, which include SCSS mixins and default rails templates for true-cutupping."
11
+ s.files = `git ls-files`.split("\n")
12
+ s.version = "0.0.1"
13
+
14
+ s.add_dependency "rails" , "~> 3.1.0"
15
+
16
+ end
metadata ADDED
@@ -0,0 +1,129 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: wiskey
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Alexey Osipenko
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-11-01 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: &70148866250780 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.1.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70148866250780
25
+ description: The rails 3 gem, which include SCSS mixins and default rails templates
26
+ for true-cutupping.
27
+ email:
28
+ - alexey@osipenko.in.ua
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - .gitignore
34
+ - .rvmrc
35
+ - Gemfile
36
+ - Gemfile.lock
37
+ - MIT-LICENSE
38
+ - README.rdoc
39
+ - Rakefile
40
+ - app/assets/stylesheets/_wiskey.scss
41
+ - app/assets/stylesheets/addons/_animation-keyframes.scss
42
+ - app/assets/stylesheets/addons/_button.scss
43
+ - app/assets/stylesheets/addons/_position.scss
44
+ - app/assets/stylesheets/addons/_timing-functions.scss
45
+ - app/assets/stylesheets/css3/_animation.scss
46
+ - app/assets/stylesheets/css3/_background-clip.scss
47
+ - app/assets/stylesheets/css3/_border-radius.scss
48
+ - app/assets/stylesheets/css3/_box-shadow.scss
49
+ - app/assets/stylesheets/css3/_box-sizing.scss
50
+ - app/assets/stylesheets/css3/_flex-box.scss
51
+ - app/assets/stylesheets/css3/_inline-block.scss
52
+ - app/assets/stylesheets/css3/_linear-gradient.scss
53
+ - app/assets/stylesheets/css3/_opacity.scss
54
+ - app/assets/stylesheets/css3/_radial-gradient.scss
55
+ - app/assets/stylesheets/css3/_text-overflow.scss
56
+ - app/assets/stylesheets/css3/_text-shadow.scss
57
+ - app/assets/stylesheets/css3/_transform.scss
58
+ - app/assets/stylesheets/css3/_transition.scss
59
+ - app/assets/stylesheets/functions/_experimental.scss
60
+ - app/assets/stylesheets/functions/_linear-gradient.scss
61
+ - lib/tasks/install.rake
62
+ - lib/wiskey.rb
63
+ - lib/wiskey/engine.rb
64
+ - lib/wiskey/sass_extensions.rb
65
+ - lib/wiskey/sass_extensions/functions.rb
66
+ - lib/wiskey/sass_extensions/functions/compact.rb
67
+ - lib/wiskey/version.rb
68
+ - test/dummy/Rakefile
69
+ - test/dummy/app/assets/stylesheets/application.css.scss
70
+ - test/dummy/app/controllers/application_controller.rb
71
+ - test/dummy/app/helpers/application_helper.rb
72
+ - test/dummy/app/views/layouts/application.html.erb
73
+ - test/dummy/config.ru
74
+ - test/dummy/config/application.rb
75
+ - test/dummy/config/boot.rb
76
+ - test/dummy/config/database.yml
77
+ - test/dummy/config/environment.rb
78
+ - test/dummy/config/environments/development.rb
79
+ - test/dummy/config/environments/production.rb
80
+ - test/dummy/config/environments/test.rb
81
+ - test/dummy/config/initializers/backtrace_silencers.rb
82
+ - test/dummy/config/initializers/inflections.rb
83
+ - test/dummy/config/initializers/mime_types.rb
84
+ - test/dummy/config/initializers/secret_token.rb
85
+ - test/dummy/config/initializers/session_store.rb
86
+ - test/dummy/config/locales/en.yml
87
+ - test/dummy/config/routes.rb
88
+ - test/dummy/public/404.html
89
+ - test/dummy/public/422.html
90
+ - test/dummy/public/500.html
91
+ - test/dummy/public/favicon.ico
92
+ - test/dummy/public/javascripts/application.js
93
+ - test/dummy/public/javascripts/controls.js
94
+ - test/dummy/public/javascripts/dragdrop.js
95
+ - test/dummy/public/javascripts/effects.js
96
+ - test/dummy/public/javascripts/prototype.js
97
+ - test/dummy/public/javascripts/rails.js
98
+ - test/dummy/public/stylesheets/.gitkeep
99
+ - test/dummy/script/rails
100
+ - test/integration/navigation_test.rb
101
+ - test/support/integration_case.rb
102
+ - test/test_helper.rb
103
+ - test/wiskey_test.rb
104
+ - wiskey.gemspec
105
+ homepage: http://wiskey.github.com
106
+ licenses: []
107
+ post_install_message:
108
+ rdoc_options: []
109
+ require_paths:
110
+ - lib
111
+ required_ruby_version: !ruby/object:Gem::Requirement
112
+ none: false
113
+ requirements:
114
+ - - ! '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
+ none: false
119
+ requirements:
120
+ - - ! '>='
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ requirements: []
124
+ rubyforge_project:
125
+ rubygems_version: 1.8.11
126
+ signing_key:
127
+ specification_version: 3
128
+ summary: The solutoiuns for the rails cutupping.
129
+ test_files: []