muck-engine 0.2.3 → 0.2.4

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
@@ -195,7 +195,7 @@ module MuckEngineHelper
195
195
 
196
196
  # Outputs include script for google ajax api
197
197
  def google_ajax_api_scripts
198
- return if defined?(@google_ajax_api_scripts_included)
198
+ return '' if defined?(@google_ajax_api_scripts_included)
199
199
  script = '<script type="text/javascript" src="http://www.google.com/jsapi'
200
200
  script << "?key=#{GlobalConfig.google_ajax_api_key}" if GlobalConfig.google_ajax_api_key
201
201
  script << '"></script>'
@@ -203,22 +203,45 @@ module MuckEngineHelper
203
203
  script
204
204
  end
205
205
 
206
+ # Output include script for google slideshows
206
207
  def google_ajax_slideshow_scripts
207
- return if defined?(@google_ajax_slideshow_scripts_included)
208
+ return '' if defined?(@google_ajax_slideshow_scripts_included)
208
209
  @google_ajax_slideshow_scripts_included = true
209
210
  '<script src="http://www.google.com/uds/solutions/slideshow/gfslideshow.js" type="text/javascript"></script>'
210
211
  end
211
212
 
213
+ # Output include script for google feeds
212
214
  def google_load_feeds
213
- return if defined?(@google_load_feeds_included)
215
+ return '' if defined?(@google_load_feeds_included)
214
216
  @google_load_feeds_included = true
215
- '<script type="text/javascript">google.load("feeds", "1");</script>'
217
+ google_ajax_api_scripts + '<script type="text/javascript">google.load("feeds", "1");</script>'
216
218
  end
217
219
 
220
+ # Output include script for google search
218
221
  def google_load_search
219
- return if defined?(@google_load_search_included)
222
+ return '' if defined?(@google_load_search_included)
220
223
  @google_load_search_included = true
221
- '<script type="text/javascript">google.load("search", "1");</script>'
224
+ google_ajax_api_scripts + '<script type="text/javascript">google.load("search", "1");</script>'
225
+ end
226
+
227
+ # Output include script to load jquery from google
228
+ def google_load_jquery
229
+ return '' if defined?(@google_load_jquery_included)
230
+ @google_load_jquery_included = true
231
+ google_ajax_api_scripts + '<script type="text/javascript">google.load("jquery", "1");</script>'
232
+ end
233
+
234
+ # Output include script to load jquery ui from google
235
+ def google_load_jquery_ui
236
+ return '' if defined?(@google_load_jquery_ui_included)
237
+ @google_load_jquery_ui_included = true
238
+ google_ajax_api_scripts + '<script type="text/javascript">google.load("jqueryui", "1");</script>'
239
+ end
240
+
241
+ # Outputs a snippet of javascript that can parse uris
242
+ # http://blog.stevenlevithan.com/archives/parseuri
243
+ def parse_uri_script
244
+ render :partial => 'scripts/parse_uri'
222
245
  end
223
246
 
224
247
  end
@@ -0,0 +1,30 @@
1
+ <script type="text/javascript">
2
+ // parseUri 1.2.2
3
+ // (c) Steven Levithan <stevenlevithan.com>
4
+ // MIT License
5
+ function parseUri (str) {
6
+ var o = parseUri.options,
7
+ m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
8
+ uri = {},
9
+ i = 14;
10
+ while (i--) uri[o.key[i]] = m[i] || "";
11
+ uri[o.q.name] = {};
12
+ uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
13
+ if ($1) uri[o.q.name][$1] = $2;
14
+ });
15
+ return uri;
16
+ };
17
+
18
+ parseUri.options = {
19
+ strictMode: false,
20
+ key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
21
+ q: {
22
+ name: "queryKey",
23
+ parser: /(?:^|&)([^&=]*)=?([^&]*)/g
24
+ },
25
+ parser: {
26
+ strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
27
+ loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
28
+ }
29
+ };
30
+ </script>
data/muck-engine.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{muck-engine}
8
- s.version = "0.2.3"
8
+ s.version = "0.2.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Justin Ball"]
12
- s.date = %q{2009-10-20}
12
+ s.date = %q{2009-10-22}
13
13
  s.description = %q{The base engine for the muck system. Contains common tables, custom for, css and javascript.}
14
14
  s.email = %q{justinball@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -65,6 +65,8 @@ Gem::Specification.new do |s|
65
65
  "app/views/layouts/global/_head.html.erb",
66
66
  "app/views/layouts/popup.html.erb",
67
67
  "app/views/layouts/popup.html.erb",
68
+ "app/views/scripts/_parse_uri.html.erb",
69
+ "app/views/scripts/_parse_uri.html.erb",
68
70
  "app/views/scripts/_time_scripts.html.erb",
69
71
  "app/views/scripts/_time_scripts.html.erb",
70
72
  "app/views/shared/_delete.html.erb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muck-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Ball
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-20 00:00:00 -06:00
12
+ date: 2009-10-22 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -68,6 +68,7 @@ files:
68
68
  - app/views/layouts/global/_google_analytics.html.erb
69
69
  - app/views/layouts/global/_head.html.erb
70
70
  - app/views/layouts/popup.html.erb
71
+ - app/views/scripts/_parse_uri.html.erb
71
72
  - app/views/scripts/_time_scripts.html.erb
72
73
  - app/views/shared/_delete.html.erb
73
74
  - app/views/shared/_error_box.html.erb