muck-engine 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +5 -0
- data/VERSION +1 -1
- data/app/helpers/muck_engine_helper.rb +25 -0
- data/lib/action_controller/muck_application.rb +25 -1
- data/lib/muck_engine.rb +6 -1
- data/lib/muck_engine/tasks.rb +5 -1
- data/locales/ar.yml +1 -0
- data/locales/bg.yml +1 -0
- data/locales/ca.yml +1 -0
- data/locales/cs.yml +1 -0
- data/locales/da.yml +1 -0
- data/locales/de.yml +1 -0
- data/locales/el.yml +1 -0
- data/locales/en.yml +1 -0
- data/locales/es.yml +1 -0
- data/locales/et.yml +2 -1
- data/locales/fa.yml +1 -0
- data/locales/fi.yml +1 -0
- data/locales/fr.yml +1 -0
- data/locales/gl.yml +1 -0
- data/locales/hi.yml +1 -0
- data/locales/hr.yml +1 -0
- data/locales/hu.yml +1 -0
- data/locales/id.yml +1 -0
- data/locales/it.yml +1 -0
- data/locales/iw.yml +1 -0
- data/locales/ja.yml +1 -0
- data/locales/ko.yml +1 -0
- data/locales/lt.yml +1 -0
- data/locales/lv.yml +1 -0
- data/locales/mt.yml +1 -0
- data/locales/nl.yml +1 -0
- data/locales/no.yml +1 -0
- data/locales/pl.yml +1 -0
- data/locales/pt-PT.yml +1 -0
- data/locales/ro.yml +1 -0
- data/locales/ru.yml +1 -0
- data/locales/sk.yml +1 -0
- data/locales/sl.yml +1 -0
- data/locales/sq.yml +1 -0
- data/locales/sr.yml +1 -0
- data/locales/sv.yml +1 -0
- data/locales/th.yml +1 -0
- data/locales/tl.yml +1 -0
- data/locales/tr.yml +1 -0
- data/locales/uk.yml +1 -0
- data/locales/vi.yml +1 -0
- data/locales/zh-CN.yml +1 -0
- data/locales/zh-TW.yml +1 -0
- data/locales/zh.yml +1 -0
- data/muck-engine.gemspec +6 -2
- data/public/images/icons/external.png +0 -0
- data/public/images/icons/feed.png +0 -0
- data/public/images/icons/pending.png +0 -0
- data/public/javascripts/jquery/jrails.js +1 -0
- metadata +6 -2
data/README.rdoc
CHANGED
@@ -60,6 +60,11 @@ If you build your own layout be sure to include the following script in your lay
|
|
60
60
|
You can customize your email template by overriding the existing layouts. Simply add email_default.text.html.erb and email_default.text.plain.erb
|
61
61
|
views/layouts. This will build templates for html and plain text emails. For an example of each look at the views/layouts directory in this project.
|
62
62
|
|
63
|
+
== iPhone
|
64
|
+
To add detection for the iPhone just add this to the top of your controller:
|
65
|
+
|
66
|
+
before_filter :adjust_format_for_iphone
|
67
|
+
|
63
68
|
== CSS
|
64
69
|
|
65
70
|
The css provided by the muck engine comes from blueprint:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
@@ -1,5 +1,19 @@
|
|
1
1
|
module MuckEngineHelper
|
2
2
|
|
3
|
+
# Outputs a small bit of javascript that will enable message
|
4
|
+
# output to jgrowl or to the given message dom id
|
5
|
+
#
|
6
|
+
# message_dom_id: The dom id of the element that will hold messages.
|
7
|
+
# This element can have display:none by default.
|
8
|
+
def jquery_message(message_dom_id)
|
9
|
+
if GlobalConfig.growl_enabled
|
10
|
+
"jQuery('##{message_dom_id}').html(json.message);"
|
11
|
+
"jQuery('##{message_dom_id}').show();"
|
12
|
+
else
|
13
|
+
"jQuery.jGrowl.info(json.message);"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
3
17
|
def custom_form_for(record_or_name_or_array, *args, &proc)
|
4
18
|
options = args.detect { |argument| argument.is_a?(Hash) }
|
5
19
|
if options.nil?
|
@@ -47,6 +61,17 @@ module MuckEngineHelper
|
|
47
61
|
end
|
48
62
|
end
|
49
63
|
|
64
|
+
# generates javascript that will hide a link or button
|
65
|
+
# when click and then show a different dom object
|
66
|
+
def show_hide_on_click(id_to_show, id_to_hide)
|
67
|
+
%Q{jQuery(document).ready(function() {
|
68
|
+
jQuery('##{id_to_hide}').click(function(){
|
69
|
+
jQuery(this).hide();
|
70
|
+
jQuery('##{id_to_show}').show();
|
71
|
+
});
|
72
|
+
});}
|
73
|
+
end
|
74
|
+
|
50
75
|
# Render a photo for the given object. Note that the object will need a 'photo' method
|
51
76
|
# provided by paperclip.
|
52
77
|
# size is commonly one of:
|
@@ -8,7 +8,18 @@ module ActionController
|
|
8
8
|
|
9
9
|
module InstanceMethods
|
10
10
|
protected
|
11
|
-
|
11
|
+
|
12
|
+
# Detect the iphone. Just call this method in a before filter:
|
13
|
+
# before_filter :adjust_format_for_iphone
|
14
|
+
def adjust_format_for_iphone
|
15
|
+
request.format = :iphone if iphone_user_agent?
|
16
|
+
end
|
17
|
+
|
18
|
+
# Request from an iPhone or iPod touch? (Mobile Safari user agent)
|
19
|
+
def iphone_user_agent?
|
20
|
+
request.env["HTTP_USER_AGENT"] && request.env["HTTP_USER_AGENT"][/(Mobile\/.+Safari)/]
|
21
|
+
end
|
22
|
+
|
12
23
|
# **********************************************
|
13
24
|
# Locale methods
|
14
25
|
# I18n methods from:
|
@@ -111,6 +122,19 @@ module ActionController
|
|
111
122
|
# **********************************************
|
112
123
|
# Parent methods
|
113
124
|
|
125
|
+
# Builds parameters that can be appended to a url to indicate the object's parent.
|
126
|
+
# Note that this method should only be used when absolutely needed. The preferred method is
|
127
|
+
# to use polymorhpic_url. For example:
|
128
|
+
# polymorphic_url([@parent, feeds])
|
129
|
+
# edit_polymorphic_url([@parent, @item])
|
130
|
+
def make_parent_params(parent)
|
131
|
+
if parent.blank?
|
132
|
+
{}
|
133
|
+
else
|
134
|
+
{ :parent_id => parent.id, :parent_type => parent.class.to_s }
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
114
138
|
# Attempts to create an @parent object using params
|
115
139
|
# or the url.
|
116
140
|
def setup_parent(*ignore)
|
data/lib/muck_engine.rb
CHANGED
@@ -4,4 +4,9 @@ ActiveRecord::Base.send :include, ActiveRecord::MuckModel
|
|
4
4
|
ActionController::Base.send :helper, MuckEngineHelper
|
5
5
|
|
6
6
|
I18n.load_path += Dir[ File.join(File.dirname(__FILE__), '..', 'locales', '*.{rb,yml}') ]
|
7
|
-
I18n.load_path += Dir[ File.join(File.dirname(__FILE__), '..', 'rails_i18n', '*.{rb,yml}') ]
|
7
|
+
I18n.load_path += Dir[ File.join(File.dirname(__FILE__), '..', 'rails_i18n', '*.{rb,yml}') ]
|
8
|
+
|
9
|
+
Mime::Type.register "application/rdf+xml", :rdf
|
10
|
+
Mime::Type.register "text/xml", :opml
|
11
|
+
Mime::Type.register "text/javascript", :pjs
|
12
|
+
Mime::Type.register_alias "text/html", :iphone
|
data/lib/muck_engine/tasks.rb
CHANGED
@@ -26,7 +26,11 @@ class MuckEngine
|
|
26
26
|
namespace :muck do
|
27
27
|
|
28
28
|
def muck_gem_paths
|
29
|
-
|
29
|
+
if defined?(muck_gems)
|
30
|
+
muck_gems.collect{|name| muck_gem_path(name)}
|
31
|
+
else
|
32
|
+
puts "Please create a method named 'muck_gems' in the namespace :muck in your rakefile."
|
33
|
+
end
|
30
34
|
end
|
31
35
|
|
32
36
|
def muck_gem_path(gem_name)
|
data/locales/ar.yml
CHANGED
data/locales/bg.yml
CHANGED
data/locales/ca.yml
CHANGED
data/locales/cs.yml
CHANGED
data/locales/da.yml
CHANGED
data/locales/de.yml
CHANGED
data/locales/el.yml
CHANGED
data/locales/en.yml
CHANGED
data/locales/es.yml
CHANGED
data/locales/et.yml
CHANGED
@@ -3,7 +3,7 @@ et:
|
|
3
3
|
muck:
|
4
4
|
engine:
|
5
5
|
choose_country: "Vali riik"
|
6
|
-
choose_language: "
|
6
|
+
choose_language: "Choose Language"
|
7
7
|
choose_state: "Vali riik"
|
8
8
|
missing_parent_error: "Palun täpsustage vanem objekti"
|
9
9
|
select_country_prompt: "Palun vali riik"
|
@@ -21,6 +21,7 @@ et:
|
|
21
21
|
enabled: Olemas?
|
22
22
|
general_info: "Üldine info"
|
23
23
|
help: Abi
|
24
|
+
loading: "Loading ..."
|
24
25
|
next: "Järgmine »"
|
25
26
|
no_text: Ei
|
26
27
|
previous: «Eelmine
|
data/locales/fa.yml
CHANGED
data/locales/fi.yml
CHANGED
data/locales/fr.yml
CHANGED
data/locales/gl.yml
CHANGED
data/locales/hi.yml
CHANGED
data/locales/hr.yml
CHANGED
data/locales/hu.yml
CHANGED
data/locales/id.yml
CHANGED
data/locales/it.yml
CHANGED
data/locales/iw.yml
CHANGED
data/locales/ja.yml
CHANGED
data/locales/ko.yml
CHANGED
data/locales/lt.yml
CHANGED
data/locales/lv.yml
CHANGED
data/locales/mt.yml
CHANGED
data/locales/nl.yml
CHANGED
data/locales/no.yml
CHANGED
data/locales/pl.yml
CHANGED
data/locales/pt-PT.yml
CHANGED
data/locales/ro.yml
CHANGED
data/locales/ru.yml
CHANGED
data/locales/sk.yml
CHANGED
data/locales/sl.yml
CHANGED
data/locales/sq.yml
CHANGED
data/locales/sr.yml
CHANGED
data/locales/sv.yml
CHANGED
data/locales/th.yml
CHANGED
data/locales/tl.yml
CHANGED
data/locales/tr.yml
CHANGED
data/locales/uk.yml
CHANGED
data/locales/vi.yml
CHANGED
data/locales/zh-CN.yml
CHANGED
data/locales/zh-TW.yml
CHANGED
data/locales/zh.yml
CHANGED
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.
|
8
|
+
s.version = "0.2.2"
|
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-
|
12
|
+
s.date = %q{2009-10-16}
|
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 = [
|
@@ -217,10 +217,13 @@ Gem::Specification.new do |s|
|
|
217
217
|
"public/images/icons/comment.png",
|
218
218
|
"public/images/icons/delete.png",
|
219
219
|
"public/images/icons/exclaim.png",
|
220
|
+
"public/images/icons/external.png",
|
221
|
+
"public/images/icons/feed.png",
|
220
222
|
"public/images/icons/grey_guy.png",
|
221
223
|
"public/images/icons/hide.png",
|
222
224
|
"public/images/icons/information.png",
|
223
225
|
"public/images/icons/minus.png",
|
226
|
+
"public/images/icons/pending.png",
|
224
227
|
"public/images/icons/question.png",
|
225
228
|
"public/images/icons/search_box.png",
|
226
229
|
"public/images/icons/star.png",
|
@@ -241,6 +244,7 @@ Gem::Specification.new do |s|
|
|
241
244
|
"public/javascripts/jquery/jquery.jgrowl.js",
|
242
245
|
"public/javascripts/jquery/jquery.js",
|
243
246
|
"public/javascripts/jquery/jquery.tips.js",
|
247
|
+
"public/javascripts/jquery/jrails.js",
|
244
248
|
"public/javascripts/muck.js",
|
245
249
|
"public/javascripts/muck.js",
|
246
250
|
"public/javascripts/muck_time/en.js",
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
(function($){$().ajaxSend(function(a,xhr,s){xhr.setRequestHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*")})})(jQuery);(function($){$.fn.reset=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};$.fn.enable=function(){return this.each(function(){this.disabled=false})};$.fn.disable=function(){return this.each(function(){this.disabled=true})}})(jQuery);(function($){$.extend({fieldEvent:function(el,obs){var field=el[0]||el,e="change";if(field.type=="radio"||field.type=="checkbox"){e="click"}else{if(obs&&field.type=="text"||field.type=="textarea"){e="keyup"}}return e}});$.fn.extend({delayedObserver:function(delay,callback){var el=$(this);if(typeof window.delayedObserverStack=="undefined"){window.delayedObserverStack=[]}if(typeof window.delayedObserverCallback=="undefined"){window.delayedObserverCallback=function(stackPos){observed=window.delayedObserverStack[stackPos];if(observed.timer){clearTimeout(observed.timer)}observed.timer=setTimeout(function(){observed.timer=null;observed.callback(observed.obj,observed.obj.formVal())},observed.delay*1000);observed.oldVal=observed.obj.formVal()}}window.delayedObserverStack.push({obj:el,timer:null,delay:delay,oldVal:el.formVal(),callback:callback});var stackPos=window.delayedObserverStack.length-1;if(el[0].tagName=="FORM"){$(":input",el).each(function(){var field=$(this);field.bind($.fieldEvent(field,delay),function(){observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.obj.oldVal){return}else{window.delayedObserverCallback(stackPos)}})})}else{el.bind($.fieldEvent(el,delay),function(){observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.obj.oldVal){return}else{window.delayedObserverCallback(stackPos)}})}},formVal:function(){var el=this[0];if(el.tagName=="FORM"){return this.serialize()}if(el.type=="checkbox"||self.type=="radio"){return this.filter("input:checked").val()||""}else{return this.val()}}})})(jQuery);(function($){$.fn.extend({visualEffect:function(o){e=o.replace(/\_(.)/g,function(m,l){return l.toUpperCase()});return eval("$(this)."+e+"()")},appear:function(speed,callback){return this.fadeIn(speed,callback)},blindDown:function(speed,callback){return this.show("blind",{direction:"vertical"},speed,callback)},blindUp:function(speed,callback){return this.hide("blind",{direction:"vertical"},speed,callback)},blindRight:function(speed,callback){return this.show("blind",{direction:"horizontal"},speed,callback)},blindLeft:function(speed,callback){this.hide("blind",{direction:"horizontal"},speed,callback);return this},dropOut:function(speed,callback){return this.hide("drop",{direction:"down"},speed,callback)},dropIn:function(speed,callback){return this.show("drop",{direction:"up"},speed,callback)},fade:function(speed,callback){return this.fadeOut(speed,callback)},fadeToggle:function(speed,callback){return this.animate({opacity:"toggle"},speed,callback)},fold:function(speed,callback){return this.hide("fold",{},speed,callback)},foldOut:function(speed,callback){return this.show("fold",{},speed,callback)},grow:function(speed,callback){return this.show("scale",{},speed,callback)},highlight:function(speed,callback){return this.show("highlight",{},speed,callback)},puff:function(speed,callback){return this.hide("puff",{},speed,callback)},pulsate:function(speed,callback){return this.show("pulsate",{},speed,callback)},shake:function(speed,callback){return this.show("shake",{},speed,callback)},shrink:function(speed,callback){return this.hide("scale",{},speed,callback)},squish:function(speed,callback){return this.hide("scale",{origin:["top","left"]},speed,callback)},slideUp:function(speed,callback){return this.hide("slide",{direction:"up"},speed,callback)},slideDown:function(speed,callback){return this.show("slide",{direction:"up"},speed,callback)},switchOff:function(speed,callback){return this.hide("clip",{},speed,callback)},switchOn:function(speed,callback){return this.show("clip",{},speed,callback)}})})(jQuery);
|
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.
|
4
|
+
version: 0.2.2
|
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-
|
12
|
+
date: 2009-10-16 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -159,10 +159,13 @@ files:
|
|
159
159
|
- public/images/icons/comment.png
|
160
160
|
- public/images/icons/delete.png
|
161
161
|
- public/images/icons/exclaim.png
|
162
|
+
- public/images/icons/external.png
|
163
|
+
- public/images/icons/feed.png
|
162
164
|
- public/images/icons/grey_guy.png
|
163
165
|
- public/images/icons/hide.png
|
164
166
|
- public/images/icons/information.png
|
165
167
|
- public/images/icons/minus.png
|
168
|
+
- public/images/icons/pending.png
|
166
169
|
- public/images/icons/question.png
|
167
170
|
- public/images/icons/search_box.png
|
168
171
|
- public/images/icons/star.png
|
@@ -182,6 +185,7 @@ files:
|
|
182
185
|
- public/javascripts/jquery/jquery.jgrowl.js
|
183
186
|
- public/javascripts/jquery/jquery.js
|
184
187
|
- public/javascripts/jquery/jquery.tips.js
|
188
|
+
- public/javascripts/jquery/jrails.js
|
185
189
|
- public/javascripts/muck.js
|
186
190
|
- public/javascripts/muck_time/en.js
|
187
191
|
- public/stylesheets/admin.css
|