Permalink
Browse files

Merge remote branch 'ethan/new_forms' into develop

  • Loading branch information...
2 parents 29c85a6 + 96b9178 commit a73648a38ab2f33a60e899c0fce44a91e46114c7 Gerry Gleason committed Dec 20, 2012
View
3 Gemfile
@@ -17,6 +17,7 @@ gem 'xmlscan', '~> 0.3'
gem "rubyzip", "~> 0.9" # only required in module. should be separated out.
gem "airbrake", "~> 3.1"
+
# DATABASE
# need at least one of the following
@@ -43,6 +44,8 @@ group :assets do
gem 'uglifier' # makes pretty code ugly again. compresses js/css for fast loading
gem 'jquery-rails', '~> 2.1.4' # main js framework, along with rails-specific unobtrusive lib
+ gem "jquerymobile-rails", "~> 0.2"
+
gem 'tinymce-rails', '~> 3.4' # wysiwyg editor
gem 'therubyracer' # execjs is necessary for developing coffeescript. mac users have execjs built-in; don't need this one
View
2 Gemfile.lock
@@ -86,6 +86,7 @@ GEM
jquery-rails (2.1.4)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
+ jquerymobile-rails (0.2.3)
json (1.7.5)
launchy (2.1.2)
addressable (~> 2.3)
@@ -226,6 +227,7 @@ DEPENDENCIES
email_spec
htmlentities (~> 4.3)
jquery-rails (~> 2.1.4)
+ jquerymobile-rails (~> 0.2)
launchy
minitest
mysql2 (~> 0.3)
View
1 app/assets/javascripts/application.js
@@ -13,6 +13,7 @@
//= require tinymce
//= require wagn_pack
//= require wagn
+//= require jquerymobile
/*
View
50 app/assets/javascripts/wagn_pack.js.coffee
@@ -58,6 +58,18 @@ wagn.chooseFile = (e, data) ->
editor.append '<input type="hidden" value="CHOSEN" class="upload-card-content" name="' + contentFieldName + '">'
# we add and remove the contentField to insure that nothing is added / updated when nothing is chosen.
+wagn.openMenu = (link) ->
+ # if card menu already exists
+ # show it
+ # else
+ # get the template menu
+ # make a copy right after menu link (or associate if necessary)
+ # do simple substitutions?
+ cm = $(link).find '.card-menu'
+ cm.menu position: { my:'right top', at:'left top' },
+ icons:{ submenu:'ui-icon-carat-1-w' }
+ cm.show()
+
$(window).ready ->
@@ -78,24 +90,34 @@ $(window).ready ->
# sadly, it also causes odd navbox behavior, resetting the search term
}
-
$('.card-menu-link').live 'mouseenter', ->
- # if card menu already exists
- # show it
- # else
- # get the template menu
- # make a copy right after menu link (or associate if necessary)
- # do simple substitutions?
- cm = $(this).find '.card-menu'
- cm.menu position: { my:'right top', at:'left top' },
- icons:{ submenu:'ui-icon-carat-1-w' }
- cm.show()
- # do a request to flesh out remaining menu parts
+ wagn.openMenu this
$('.card-menu').live 'mouseleave', ->
$(this).hide()
+
+ $('.card-menu').live 'swipe', ->
+ $(this).hide()
+
+ $('.card-menu-link').live 'tap', (event) ->
+ initiated_menu = $(this).find('.ui-menu')[0]
+ if initiated_menu
+ if $(initiated_menu).is ':hidden'
+ $(initiated_menu).show()
+ event.preventDefault()
+ else
+ wagn.openMenu this
+ event.preventDefault()
+
+ $('.ui-menu-icon').live 'tap', (event)->
+ $(this).closest('li').trigger('mouseenter')
+ event.preventDefault()
+
+# alert('prevented?')
+ #wagn.openMenu this
+
#pointer pack
$('.pointer-item-add').live 'click', (event)->
@@ -156,6 +178,10 @@ $(window).ready ->
$(wagn.padform)[0].submit()
false
+$(document).bind 'mobileinit', ->
+ $.mobile.autoInitializePage = false
+ $.mobile.ajaxEnabled = false
+
permissionsContent = (ed) ->
return '_left' if ed.find('#inherit').attr('checked')
View
1 app/assets/stylesheets/application-all.css
@@ -2,6 +2,7 @@
* application-all.css
*
*= require jquery-ui-smoothness
+ *= unrequire jquerymobile
*= require page
*= require defaults
*= require card
View
17 app/assets/stylesheets/card.css
@@ -1,15 +1,15 @@
.card-frame {
- margin: 1px 0px;
- padding: 0px !important;
+ margin: 1px 0;
+ padding: 0 !important;
-moz-border-radius: 8px;
border-radius: 8px;
border: 1px solid #aaa;
border-bottom: 2px solid #ccc;
border-right: 2px solid #ccc;
width: 100%; /*needed for ie6, or..?*/
- margin: 0px;
+ margin: 0;
background: #fff;
- padding: 0px;
+ padding: 0;
}
html>body .open-view {
@@ -31,8 +31,9 @@ html>body .open-view {
.card-header {
background: #8AB;
padding: 5px 12px;
- margin: 0px;
+ margin: 0;
text-align: left;
+ overflow: hidden;
}
.card-header,
.card-header a,
@@ -162,8 +163,7 @@ a.email-link {
display: none
}
fieldset {
- padding: 1 0px;
- margin: 10px 1px;
+ margin: 5px 1px;
clear: both;
float: none !important;
display:block;
@@ -591,4 +591,7 @@ table.perm-editor .pointer-item-text {
.ui-icon {
background-image: url('images/ui-icons_454545_256x240.png')
}
+.ui-loader {
+ display: none;
+}
View
5 app/assets/stylesheets/page.css
@@ -20,6 +20,7 @@
background: #8AB;
margin-bottom: 20px;
padding: 2px;
+ overflow: hidden;
}
#menu a {
color: #000;
@@ -29,7 +30,7 @@
display: inline;
}
#menu #logging { /* signing in and out */
- position: absolute;
+ float:right;
right: 0.5%;
top: 2px;
}
@@ -154,4 +155,4 @@
margin-bottom: 15px;
padding: 5px;
text-align: center;
-}
+}
View
2 app/views/mailer/account_info.text.erb
@@ -1,4 +1,4 @@
-<%= @message %><%#ENGLISH%>
+<%= raw @message %><%#ENGLISH%>
~~~~~~~~~~~~~~~
Account Details
View
2 lib/wagn/renderer.rb
@@ -179,7 +179,7 @@ def ok_view view, args={}
when @depth >= @@max_depth ; :too_deep
# prevent recursion. @depth tracks subrenderers (view within views)
when @@perms[view] == :none ; view
- # This may currently be overloaded. always allowed = skip moodes = never modified. not sure that's right.
+ # This may currently be overloaded. always allowed = skip modes = never modified. not sure that's right.
when !card ; :no_card
# This should disappear when we get rid of admin and account controllers and all renderers always have cards
View
2 lib/wagn/renderer/html.rb
@@ -137,7 +137,7 @@ def edit_slot args={}
end.join
# raw _render_core(args)
elsif card.new_card?
- fieldset 'content', content_field( form )
+ fieldset '', content_field( form )
else
content_field form
end
View
15 lib/wagn/set/all/rich_html.rb
@@ -62,9 +62,9 @@ module Set::All::RichHtml
define_view :header do |args|
%{
<div class="card-header">
- #{ _optional_render :menu_link, args }
#{ _optional_render :closer, args, default_hidden=true }
#{ _render_title }
+ #{ _optional_render :menu_link, args }
</div>
}
end
@@ -100,13 +100,9 @@ module Set::All::RichHtml
}
</ul>
</li>
- #{ if card && card.update_account_ok?
- "<li>#{ link_to_action 'account', :account, :class=>'slotter' }</li>"
- end
- }
<li>#{ link_to_action 'advanced', :options, :class=>'slotter' }
<ul>
- <li>#{ link_to_action 'rules', :options, :class=>'slotter' }
+ <li>#{ link_to_action 'rules', :options, :class=>'slotter' }</li>
<li>#{ link_to_page raw("#{card.type_name} &crarr;"), card.type_name }</li>
#{
card.cardname.piece_names.map do |piece|
@@ -121,6 +117,11 @@ module Set::All::RichHtml
"<li>#{ render_watch }</li>"
end
}
+ #{
+ if card && card.update_account_ok?
+ "<li>#{ link_to_action 'account', :account, :class=>'slotter' }</li>"
+ end
+ }
</ul>
}
#fixme - many of these (including watch) need permission checks for activation
@@ -186,7 +187,7 @@ module Set::All::RichHtml
#{ hidden_field_tag :success, card.rule(:thanks) || '_self' }
#{
case
- when name_ready ; _render_header + hidden_field_tag( 'card[name]', card.name )
+ when name_ready ; _render_title + hidden_field_tag( 'card[name]', card.name )
when card.rule_card( :autoname ) ; ''
else ; _render_name_editor
end
View
1 lib/wagn/set/self/head_and_foot.rb
@@ -29,6 +29,7 @@ module Set::Self::HeadAndFoot
end
end
+ bits << %{<meta name="viewport" content="width=device-width, initial-scale=0.8">}
# CSS
# bits << stylesheet_link_tag('http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css')
bits << stylesheet_link_tag('application-all')
View
2 spec/lib/wagn/renderer/xml_spec.rb
@@ -378,7 +378,7 @@
context "*version" do
it "should have an X.X.X version" do
render_card(:raw, :name=>'*version').
- match(/\d\.\d\.\w+/ ).should_not be_nil
+ match(/\d\.\d+\.\w+/ ).should_not be_nil
end
end
View
2 spec/lib/wagn/renderer_spec.rb
@@ -466,7 +466,7 @@
context "*version" do
it "should have an X.X.X version" do
- (render_card(:raw, :name=>'*version') =~ (/\d\.\d\.\w+/ )).should be_true
+ (render_card(:raw, :name=>'*version') =~ (/\d\.\d+\.\w+/ )).should be_true
end
end

0 comments on commit a73648a

Please sign in to comment.