fanforce-plugin-factory 2.0.0.rc3 → 2.0.0.rc5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +5 -13
  2. data/.ruby-version +1 -1
  3. data/Gemfile +2 -0
  4. data/README.md +1 -1
  5. data/fanforce-plugin-factory.gemspec +16 -16
  6. data/lib/fanforce/plugin_factory/Rakefile +2 -0
  7. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/_directives.scss +1 -0
  8. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/campaign-added/_campaign-added.coffee +21 -0
  9. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/campaign-added/_campaign-added.scss +15 -0
  10. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/initiative-added/_initiative-added.coffee +1 -1
  11. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/page/_page.scss +1 -1
  12. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/vendors/cross-dresser.js +698 -0
  13. data/lib/fanforce/plugin_factory/core_config.rb +31 -14
  14. data/lib/fanforce/plugin_factory/directive_views/campaign-added.haml +13 -0
  15. data/lib/fanforce/plugin_factory/directive_views/initiative-added.haml +3 -3
  16. data/lib/fanforce/plugin_factory/scaffolding/._Gemfile.registry +2 -0
  17. data/lib/fanforce/plugin_factory/scaffolding/Gemfile +1 -1
  18. data/lib/fanforce/plugin_factory/scaffolding/assets/css/._fembedded.scss.registry +3 -0
  19. data/lib/fanforce/plugin_factory/scaffolding/assets/css/._fembedded_native.scss.registry +2 -0
  20. data/lib/fanforce/plugin_factory/scaffolding/assets/css/fembedded.scss +3 -4
  21. data/lib/fanforce/plugin_factory/scaffolding/assets/css/fembedded_native.scss +3 -3
  22. data/lib/fanforce/plugin_factory/scaffolding/assets/js/._app-fembedded.coffee.registry +2 -0
  23. data/lib/fanforce/plugin_factory/scaffolding/assets/js/._fembedded.js.registry +2 -0
  24. data/lib/fanforce/plugin_factory/scaffolding/assets/js/app-fembedded.coffee +11 -0
  25. data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/._cookie.coffee.registry +1 -0
  26. data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/cookie.coffee +1 -1
  27. data/lib/fanforce/plugin_factory/scaffolding/layouts/._fembedded.haml.registry +7 -0
  28. data/lib/fanforce/plugin_factory/scaffolding/layouts/._fembedded_native.haml.registry +2 -0
  29. data/lib/fanforce/plugin_factory/scaffolding/layouts/._promotional.haml.registry +2 -0
  30. data/lib/fanforce/plugin_factory/scaffolding/layouts/._visitor.haml.registry +1 -0
  31. data/lib/fanforce/plugin_factory/scaffolding/layouts/fembedded.haml +12 -9
  32. data/lib/fanforce/plugin_factory/scaffolding/layouts/fembedded_native.haml +3 -1
  33. data/lib/fanforce/plugin_factory/scaffolding/layouts/promotional.haml +5 -6
  34. data/lib/fanforce/plugin_factory/scaffolding/layouts/visitor.haml +22 -20
  35. data/lib/fanforce/plugin_factory/scaffolding/views/._cross-dresser.html.registry +2 -0
  36. data/lib/fanforce/plugin_factory/scaffolding/views/._index.haml.registry +1 -0
  37. data/lib/fanforce/plugin_factory/scaffolding/views/cross-dresser.html +26 -0
  38. data/lib/fanforce/plugin_factory/scaffolding/views/index.haml +3 -2
  39. data/lib/fanforce/plugin_factory/sinatra/_load.rb +25 -7
  40. data/lib/fanforce/plugin_factory/sinatra/helpers/fanforce.rb +2 -1
  41. data/lib/fanforce/plugin_factory/sinatra/route_helpers/base.rb +13 -0
  42. data/lib/fanforce/plugin_factory/sinatra/route_helpers/com_campaign.rb +7 -0
  43. data/lib/fanforce/plugin_factory/sinatra/route_helpers/com_database.rb +11 -0
  44. data/lib/fanforce/plugin_factory/sinatra/{helper_routes → route_helpers}/com_identifier.rb +0 -0
  45. data/lib/fanforce/plugin_factory/sinatra/{helper_routes → route_helpers}/com_initiative.rb +6 -3
  46. data/lib/fanforce/plugin_factory/sinatra/{helper_routes → route_helpers}/com_js_widget.rb +0 -0
  47. data/lib/fanforce/plugin_factory/sinatra/{helper_routes → route_helpers}/plugin.rb +1 -1
  48. data/lib/fanforce/plugin_factory/version.rb +1 -1
  49. metadata +131 -110
  50. data/lib/fanforce/plugin_factory/sinatra/helper_routes/com_campaign.rb +0 -11
  51. data/lib/fanforce/plugin_factory/sinatra/helper_routes/com_database.rb +0 -11
@@ -10,7 +10,7 @@ class Fanforce::Plugin::CoreConfig
10
10
  end
11
11
 
12
12
  def _id
13
- raw_config[:_id] || (raise 'base_dir is missing')
13
+ config_json[:_id] || (raise 'base_dir is missing')
14
14
  end
15
15
 
16
16
  def base_dir
@@ -29,16 +29,28 @@ class Fanforce::Plugin::CoreConfig
29
29
  @redis_url || ENV['REDIS_URL'] || 'redis://localhost:6379'
30
30
  end
31
31
 
32
+ def worker_should_bypass_enqueue
33
+ ENV['FANFORCE_WORKER_SHOULD_BYPASS_ENQUEUE'] == 'true'
34
+ end
35
+
36
+ def worker_should_bypass_enqueue=(bool)
37
+ if bool == true
38
+ ENV['FANFORCE_WORKER_SHOULD_BYPASS_ENQUEUE'] = 'true'
39
+ else
40
+ ENV.delete('FANFORCE_WORKER_SHOULD_BYPASS_ENQUEUE')
41
+ end
42
+ end
43
+
32
44
  ######################################################################################################################
33
45
 
34
- def raw_config
35
- @raw_config ||= validate_config_file(MultiJson.load(File.open("#{@base_dir}/config.json").read, symbolize_keys: true))
46
+ def config_json
47
+ @config_json ||= validate_config_json(MultiJson.load(File.open("#{@base_dir}/config.json").read, symbolize_keys: true))
36
48
  end
37
49
 
38
- def validate_config_file(raw_config)
39
- raw_config.is_a?(Hash) || (raise "#{@base_dir}/config.json must contain a json object (not a #{raw_config.class})")
40
- raw_config[:_id].present? || (raise '#{@base_dir}/config.json must include an _id field')
41
- return raw_config
50
+ def validate_config_json(config_json)
51
+ config_json.is_a?(Hash) || (raise "#{@base_dir}/config.json must contain a json object (not a #{config_json.class})")
52
+ config_json[:_id].present? || (raise '#{@base_dir}/config.json must include an _id field')
53
+ return config_json
42
54
  end
43
55
 
44
56
  ######################################################################################################################
@@ -56,15 +68,20 @@ class Fanforce::Plugin::CoreConfig
56
68
  @is_bugsnag_enabled = true
57
69
  end
58
70
 
59
- def load_routes
60
- $: << File.join(@base_dir,'lib') if File.directory?("#{@base_dir}/lib")
71
+ def load_global_paths
61
72
  $: << @base_dir if File.directory?("#{@base_dir}")
73
+ $: << File.join(@base_dir,'lib') if File.directory?("#{@base_dir}/lib")
74
+ end
62
75
 
63
- require "#{factory_dir}/sinatra/helper_routes/com_database"
64
- require "#{factory_dir}/sinatra/helper_routes/com_campaign"
65
- require "#{factory_dir}/sinatra/helper_routes/com_identifier"
66
- require "#{factory_dir}/sinatra/helper_routes/com_js_widget"
67
- require "#{factory_dir}/sinatra/helper_routes/plugin"
76
+ def load_routes
77
+ load_global_paths
78
+
79
+ require "#{factory_dir}/sinatra/route_helpers/base"
80
+ require "#{factory_dir}/sinatra/route_helpers/com_database"
81
+ require "#{factory_dir}/sinatra/route_helpers/com_campaign"
82
+ require "#{factory_dir}/sinatra/route_helpers/com_identifier"
83
+ require "#{factory_dir}/sinatra/route_helpers/com_js_widget"
84
+ require "#{factory_dir}/sinatra/route_helpers/plugin"
68
85
 
69
86
  Dir["#{@base_dir}/initializers/*.rb"].each {|f| require f } if File.directory?("#{@base_dir}/initializers")
70
87
  require "#{factory_dir}/Routes"
@@ -0,0 +1,13 @@
1
+ %h2 SUCCESS!
2
+ %h3(ng-if='campaign')
3
+ Your new campaign has been added
4
+ %a.campaign-name(ng-href="//#{Fanforce.client_domain}/#/campaigns/{{campaign._id}}" target='_top') {{campaign.name}}
5
+ %h3(ng-if='campaigns')
6
+ {{campaigns.length}} campaigns have been added
7
+ %ul
8
+ %li(ng-repeat='campaign in campaigns')
9
+ %a.campaign-name(ng-href="//#{Fanforce.client_domain}/#/campaigns/{{campaign._id}}" target='_top') {{campaign.name}}
10
+ .buttons
11
+ %a.btn.btn-default(ng-if='campaign' ng-href="//#{Fanforce.client_domain}/#/campaigns/{{campaign._id}}" target='_top') Open Campaign
12
+ %a.btn.btn-default(ng-click='reset()' ng-show='has_reset_feature') Add Another Campaign
13
+ %a.btn.btn-default(ng-click='close()') Close Overlay
@@ -1,8 +1,8 @@
1
1
  %h2 SUCCESS!
2
2
  %h3
3
3
  Your fanforce is now tracking
4
- %a.initiative-name(ng-href='//0.0.0.0:4567/#/initiatives/{{initiative._id}}' target='_top') {{prefix}} {{initiative.name}}
4
+ %a.initiative-name(ng-href="//#{Fanforce.client_domain}/#/initiatives/{{initiative._id}}" target='_top') {{prefix}} {{initiative.name}}
5
5
  .buttons
6
- %a.btn.btn-default(ng-href='//0.0.0.0:4567/#/initiatives/{{initiative._id}}' target='_top') Open Initiative
6
+ %a.btn.btn-default(ng-href="//#{Fanforce.client_domain}/#/initiatives/{{initiative._id}}" target='_top') Open Initiative
7
7
  %a.btn.btn-default(ng-click='reset()' ng-show='has_reset_feature') Add Another Initiative
8
- %a.btn.btn-default(ng-click='close()') Close Overlay
8
+ %a.btn.btn-default(ng-click='close()') Close Overlay
@@ -2,3 +2,5 @@ fanforce-plugin-factory-1.6.0:ae064a186c4105989dbb1fc1d89d297c4bb50645
2
2
  fanforce-plugin-factory-1.6.0:b4efb7323d5dd68f09d7a16c16d02880a0504284
3
3
  fanforce-plugin-factory-1.6.0:8b96f77d8bb7e7cea7a96b2bd9e580bd8b12dee8
4
4
  fanforce-plugin-factory-2.0.0.rc1:804c185c4212d74d0be61e4f5f035d9eecbfa8be
5
+ fanforce-plugin-factory-2.0.0.rc4:d148b77d6f0c2f48ae1d6ab3a52ec1850e051724
6
+ fanforce-plugin-factory-2.0.0.rc5:4087247960e532a1d6b1b05b1c4b9d11d1b9a8f2
@@ -1,7 +1,7 @@
1
1
  # PluginFactoryScaffolding : PARTIAL
2
2
  ########################################################################################################################
3
3
  source 'https://rubygems.org'
4
- ruby '1.9.3'
4
+ ruby '2.1.6'
5
5
 
6
6
  gem FANFORCE-PLUGIN-FACTORY
7
7
 
@@ -4,3 +4,6 @@ fanforce-plugin-factory-1.6.0:4bbddc05c99b42b72cc9b71036b1540db02b7842
4
4
  fanforce-plugin-factory-1.6.0:3100df670df8f5fb23b7e9fce2653228db080841
5
5
  fanforce-plugin-factory-2.0.0.rc1:37b5ba82eda9b6058e6ee625916caa998dc0d64b
6
6
  fanforce-plugin-factory-2.0.0.rc3:d45041fa836d5116a97dbb03cae9dd2888186758
7
+ fanforce-plugin-factory-2.0.0.rc3:db562b36043cf48c1bf0594b1aded41befa5b6c9
8
+ fanforce-plugin-factory-2.0.0.rc4:9bb7912bed2d260ab4224f21859cff9534519b94
9
+ fanforce-plugin-factory-2.0.0.rc4:bc85412edbbb93d6922d295d5950f281d1b23722
@@ -4,3 +4,5 @@ fanforce-app-factory-3.0.0.rc1:509bc7bca24f5e3baf4f0e23b2e151ccf25439cb
4
4
  fanforce-app-factory-3.0.0.rc1:2a5b9a55d2e729cc71d8b0ae9d9547206ae604e7
5
5
  fanforce-plugin-factory-2.0.0.rc3:3074d3afdd42742c82b4049fecd8be7af2535100
6
6
  fanforce-plugin-factory-2.0.0.rc3:a55e3190bce532b2f7b75c423dec3b6e9f3b6879
7
+ fanforce-plugin-factory-2.0.0.rc3:c3e63e3366297d36815af078c30ef8d667280bb4
8
+ fanforce-plugin-factory-2.0.0.rc4:71856ea0a579ba082683126ae4b6d2af92fdfa27
@@ -6,8 +6,7 @@
6
6
 
7
7
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
8
8
 
9
- @import 'plugin_factory/bootstrap';
10
- @import 'plugin_factory/font-awesome';
9
+ @import 'plugin_factory/bootstrap_override';
11
10
  @import 'plugin_factory/common';
12
11
  @import 'plugin_factory/ui-select';
13
12
  @import 'plugin_factory/directives';
@@ -15,8 +14,8 @@
15
14
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
16
15
 
17
16
  html.fembedded-layout {
18
- body { overflow: hidden; background: white;
19
- &.success { background: #eefcd8; }
17
+ body { background: white;
18
+ &.finished { background: #eefcd8; }
20
19
  }
21
20
  }
22
21
 
@@ -14,10 +14,10 @@
14
14
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
15
15
 
16
16
  html.fembedded-layout {
17
- body { overflow: hidden; background: white;
18
- &.success { background: #eefcd8; }
17
+ body { background: white;
18
+ &.finished { background: #eefcd8; }
19
19
  }
20
- page { height: auto; visibility: visible; }
20
+ page { height: auto; overflow: visible; visibility: visible; }
21
21
  }
22
22
 
23
23
  // END PARTIAL /////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1 +1,3 @@
1
1
  fanforce-plugin-factory-2.0.0.rc3:0f4456eaafd17b96293f4c3dc935c93067d9dc5b
2
+ fanforce-plugin-factory-2.0.0.rc3:d13885ac4ffa8036573c00ca00c5e9cb4441b0ab
3
+ fanforce-plugin-factory-2.0.0.rc3:cb0be34c600ef218f5e7fbb89ee8239225237daf
@@ -2,3 +2,5 @@ fanforce-plugin-factory-1.6.0:130fe4541ada9247bd4224b54f744f17476d7e55
2
2
  fanforce-plugin-factory-1.6.0:89a46b16eb62e6dd5b68767cc9e2d39733eb94c0
3
3
  fanforce-plugin-factory-1.6.0:bd29cc97b29b1819d13004bbecd02ef8d161e2ac
4
4
  fanforce-plugin-factory-2.0.0.rc1:d381adc3c98eb0d96afb32c12444487b6c1b16b3
5
+ fanforce-plugin-factory-2.0.0.rc3:615dde2adfdaf70249a3daf4e3557e0003a8917e
6
+ fanforce-plugin-factory-2.0.0.rc3:c6b73eaebe3fbb5a320d88cbc1c752e79ce9bc9f
@@ -10,5 +10,16 @@
10
10
  $rootScope.app_is_loaded = true;
11
11
  ])
12
12
 
13
+ FF(->
14
+ CrossDresser.on('finished', ->
15
+ $('body').addClass('finished')
16
+ $('page').addClass('finished')
17
+ )
18
+ CrossDresser.on('restart', ->
19
+ $('body').removeClass('finished')
20
+ $('page').removeClass('finished')
21
+ )
22
+ )
23
+
13
24
  # END PARTIAL ##########################################################################################################
14
25
 
@@ -1,3 +1,4 @@
1
1
  fanforce-plugin-factory-1.6.0:4a06d7375c7bc27405e8dfa3e169cba1a9aa314a
2
2
  fanforce-plugin-factory-1.6.0:71aedacc6a103c40403df6adca83dd4a891f204a
3
3
  fanforce-plugin-factory-1.6.0:8eb981facec4de7be79809c9b3593fd57875afe4
4
+ fanforce-plugin-factory-2.0.0.rc3:8d0d215b856f823fa61a0507df64fa2784e8aab9
@@ -8,7 +8,7 @@ Cookie.set = ((name, value, exdays=null)->
8
8
  exdate.setDate(exdate.getDate() + exdays)
9
9
  value = "#{escape(value)}; path=/"
10
10
  value += "; expires=#{exdate.toUTCString()}" if exdays
11
- value += "; domain=.#{BASE_DOMAIN}" if BASE_DOMAIN and URL.parse(window.location.href).root_domain != '0.0'
11
+ value += "; domain=.#{FANFORCE_BASE_DOMAIN}" if FANFORCE_BASE_DOMAIN and URL.parse(window.location.href).root_domain != '0.0'
12
12
  document.cookie = "#{name}=#{value}"
13
13
  )
14
14
 
@@ -5,3 +5,10 @@ fanforce-plugin-factory-1.6.0:fbda63d2f1b25138acc371c7be5d2e70f05886bf
5
5
  fanforce-plugin-factory-2.0.0.rc1:0a8a72543f701e54c2f05f649a3a92ce2dc482e7
6
6
  fanforce-plugin-factory-2.0.0.rc3:076369cf88b03cf8f38453b927ac00653540e8fa
7
7
  fanforce-plugin-factory-2.0.0.rc3:15d429776dafd31e304531de0f10628d6eb9a45c
8
+ fanforce-plugin-factory-2.0.0.rc3:c596cb7a720d42e7ee0ba780d1f7482aa5e5f2d7
9
+ fanforce-plugin-factory-2.0.0.rc3:1f5eb1b782dd1db04513df7ec3a6f66e27f7773f
10
+ fanforce-plugin-factory-2.0.0.rc3:582b0518b2e142638aad774c4eac3cd4320d74f5
11
+ fanforce-plugin-factory-2.0.0.rc3:7715e6ae2f0df0837b30305b34795e7ec6f567ca
12
+ fanforce-plugin-factory-2.0.0.rc4:026173352b2da4cea91aa4226719cf2dbbfa3d55
13
+ fanforce-plugin-factory-2.0.0.rc4:ac609118ff63594709813b95b045de4287fa2892
14
+ fanforce-plugin-factory-2.0.0.rc4:a32c15c51b2c610e277b59fb5cdb168d2be93b7a
@@ -2,3 +2,5 @@ fanforce-app-factory-3.0.0.rc1:f93a960435a3776e00415deb6ce72517e72a1ccd
2
2
  fanforce-app-factory-3.0.0.rc1:05d604b0736ee73c6e6f017d8b2191275d9de318
3
3
  fanforce-app-factory-3.0.0.rc1:bbc7a316e0edb12545a1b9d123b2ab5826ad307e
4
4
  fanforce-plugin-factory-2.0.0.rc3:d27cf17e7fc08396477568f9b6112e6d185c14a1
5
+ fanforce-plugin-factory-2.0.0.rc3:d784eb2d04f2fdb68836359687f40f29a47a6f4f
6
+ fanforce-plugin-factory-2.0.0.rc3:e26e2bc0c0f804aa062b8add9722495411a32d79
@@ -1,2 +1,4 @@
1
1
  fanforce-plugin-factory-1.6.0:ad07029e9f29896e1661791055508f17339a6d35
2
2
  fanforce-plugin-factory-1.6.0:51584a3ea897dce3224e0ed97d8e1e9e07e16b46
3
+ fanforce-plugin-factory-2.0.0.rc3:ff5fb7ad27f5ee2e406a5c3b19aa8ed78af564f2
4
+ fanforce-plugin-factory-2.0.0.rc4:dfd58c507bf38dbed0f59657d87eba654115056d
@@ -5,3 +5,4 @@ fanforce-plugin-factory-1.6.0:e26e07d033f76de23a645ec185b856c332caa9b6
5
5
  fanforce-plugin-factory-1.6.0:704a6dfc8e71d43ffec0fcbe859c7c2860595a2c
6
6
  fanforce-plugin-factory-1.6.0:53e9e89632a66d4ad9ec8967ab7c0e68b5dfc2f4
7
7
  fanforce-plugin-factory-1.6.0.rc4:cfe06885954ae0e14caba0ef27af32071f6f48fe
8
+ fanforce-plugin-factory-2.0.0.rc4:31826496dbfa9106191e449909ec535bd01318af
@@ -6,16 +6,19 @@
6
6
  %title Fanforce Plugin
7
7
  :javascript
8
8
  PLUGIN_ID = #{Plugin._id.to_json}
9
- BASE_DOMAIN = #{Fanforce.base_domain.to_json}
10
- API_DOMAIN = #{Fanforce.api_domain.to_json}
9
+ FANFORCE_BASE_DOMAIN = #{Fanforce.base_domain.to_json}
10
+ FANFORCE_API_DOMAIN = #{Fanforce.api_domain.to_json}
11
11
  PLUGINS_BASE_DOMAIN = #{Fanforce.plugins_base_domain.to_json}
12
- = javascript 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.js'
13
- = javascript 'http://ajax.googleapis.com/ajax/libs/angularjs/1.3.9/angular.min.js'
14
- = javascript 'http://i.fanforce.dev/devforce.js'
15
- = javascript "#{request.base_url}/assets/fembedded.js"
16
- = stylesheet "#{request.base_url}/assets/fembedded.css"
17
- %body(ng-class='{success: is_success}')
12
+ = stylesheet '//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css'
13
+ = stylesheet '//netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.css'
14
+ = stylesheet '/assets/fembedded.css'
15
+ = javascript '//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.js'
16
+ = javascript '//ajax.googleapis.com/ajax/libs/angularjs/1.3.9/angular.min.js'
17
+ = javascript "//#{Fanforce.eye_domain}/devforce.js"
18
+ = javascript '/assets/plugin_factory/vendors/cross-dresser.js'
19
+ = javascript '/assets/fembedded.js'
20
+ %body
18
21
  %loading(ng-hide='app_is_loaded') Page loading...
19
- %page(class=page_classes ng-show='app_is_loaded' ng-class='{success: is_success}' ng-cloak)
22
+ %page(class=page_classes ng-show='app_is_loaded' ng-cloak)
20
23
  %ng-view
21
24
  = yield
@@ -1,8 +1,10 @@
1
1
  -# PluginFactoryScaffolding : FILE
2
2
  -#######################################################################################################################
3
+ :javascript
4
+ PLUGIN_ID = #{Plugin._id.to_json}
3
5
  = stylesheet "#{request.base_url}/assets/fembedded_native.css"
4
6
  = javascript "#{request.base_url}/assets/fembedded_native.js"
5
7
  %loading(ng-hide='app_is_loaded') Page loading...
6
- %page.ng-hide(class=page_classes ng-show='app_is_loaded' ng-class='{success: is_success}' ng-cloak)
8
+ %page.ng-hide(class=page_classes ng-show='app_is_loaded' ng-cloak)
7
9
  %ng-view
8
10
  = yield
@@ -8,12 +8,11 @@
8
8
  %meta{'http-equiv'=>'Content-Language', content: 'en-us'}/
9
9
  = stylesheet '/promotional.css'
10
10
  :javascript
11
- BASE_DOMAIN = #{Fanforce.base_domain.to_json}
12
- API_DOMAIN = #{Fanforce.api_domain.to_json}
13
-
14
- %body
15
- = yield
11
+ FANFORCE_BASE_DOMAIN = #{Fanforce.base_domain.to_json}
12
+ FANFORCE_API_DOMAIN = #{Fanforce.api_domain.to_json}
16
13
  = javascript '//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'
17
14
  = javascript "//#{Fanforce.eye_domain}/devforce.js#{'?DEBUG=1&DYNAMIC=1' if ENV['RACK_ENV']=='development'}"
18
15
  = javascript '/promotional.js'
19
- = yield_content :after_core_js
16
+
17
+ %body
18
+ = yield
@@ -4,10 +4,13 @@
4
4
  %html.visitor-layout
5
5
  %head
6
6
  %title Fanforce
7
- %meta{'http-equiv'=>'Content-Type', content:'text/html; charset=iso-8859-1'}/
8
- %meta{'http-equiv'=>'Content-Language', content: 'en-us'}/
7
+ %meta(http-equiv='Content-Type' content='text/html; charset=iso-8859-1')
8
+ %meta(http-equiv='Content-Language' content='en-us')
9
9
  = stylesheet '/visitor.css'
10
- %script(src='//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.js')
10
+ = javascript '//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.js'
11
+ = javascript "//#{Fanforce.eye_domain}/#{params[:organization_slug]}-fanforce.js#{'?DEBUG=true&DYNAMIC=true' if ENV['RACK_ENV']=='development'}" do
12
+ FF.option('track_browse_webpage', false)
13
+ FF.option('dynamic_url', FF.browser.uri.scheme + '://' + '#{FanforcePlugin._id}.{{SHORT_DOMAIN}}/{{INITIATIVE_ID}}')
11
14
  %body
12
15
  .lyt-root
13
16
  .lyt-header
@@ -19,23 +22,22 @@
19
22
  %span#distributed-by
20
23
  %a{href: "http://#{Fanforce.base_domain}"} Powered by Fanforce.
21
24
 
22
- = javascript "//#{Fanforce.eye_domain}/#{params[:organization_slug]}-fanforce.js#{'?DEBUG=true&DYNAMIC=true' if ENV['RACK_ENV']=='development'}" do
23
- FF.option('track_browse_webpage', false)
24
- FF.option('dynamic_url', FF.browser.uri.scheme + '://' + '#{FanforcePlugin._id}.{{SHORT_DOMAIN}}/{{INITIATIVE_ID}}')
25
-
26
- = yield_content :after_fanforce_js
27
25
  :coffeescript
28
26
  FF.css_framework = 'bootstrap3'
29
- FF.on('visitor.logout', ->
30
- $('#hello').html('')
27
+ FF(->
28
+ FF.on('visitor.logout', ->
29
+ $('#hello').html('')
30
+ )
31
+ FF.organization((organization)->
32
+ if organization.website_url
33
+ $('#distributed-by').html('Distributed by <a href="' + organization.website_url + '">' + organization.name + '</a>.&nbsp;')
34
+ $('#logo').html('<div class="logo"><a href="' + organization.website_url + '"><img src="' + organization.logo_url + '"></a></div>') if organization.logo_url
35
+ else
36
+ $('#distributed-by').html('Distributed by ' + organization.name + '.&nbsp;')
37
+ $('#logo').html('<div class="logo"><img src="' + organization.logo_url + '"></div>') if organization.logo_url
38
+ )
39
+ FF.visitor((visitor)->
40
+ return if !visitor.access_level
41
+ $('#hello').html('<div class="hello"><div class="hello-wrapper"><span class="greeting">Hello, ' + visitor.first_name + '!</span><a href="javascript: FF.visitor.logout(); void(0)">Logout</a></div></div>')
42
+ )
31
43
  )
32
- FF.organization (organization)->
33
- if organization.website_url
34
- $('#distributed-by').html('Distributed by <a href="' + organization.website_url + '">' + organization.name + '</a>.&nbsp;')
35
- $('#logo').html('<div class="logo"><a href="' + organization.website_url + '"><img src="' + organization.logo_url + '"></a></div>') if organization.logo_url
36
- else
37
- $('#distributed-by').html('Distributed by ' + organization.name + '.&nbsp;')
38
- $('#logo').html('<div class="logo"><img src="' + organization.logo_url + '"></div>') if organization.logo_url
39
- FF.visitor (visitor)->
40
- return if !visitor.access_level
41
- $('#hello').html('<div class="hello"><div class="hello-wrapper"><span class="greeting">Hello, ' + visitor.first_name + '!</span><a href="javascript: FF.visitor.logout(); void(0)">Logout</a></div></div>')
@@ -0,0 +1,2 @@
1
+ fanforce-plugin-factory-2.0.0.rc3:39092030cfc19fa4d63e6f1b6bdf4c9b5bc5cc40
2
+ fanforce-plugin-factory-2.0.0.rc3:1b592a137f1da55422e78637439ac775047eadea
@@ -1,3 +1,4 @@
1
1
  fanforce-plugin-factory-1.6.0:48bf030f14a9dbd660503d182ecb91690a43066e
2
2
  fanforce-plugin-factory-1.6.0:2c454a47b0f525bcff75cb76e7273ae9d22282e0
3
3
  fanforce-plugin-factory-1.6.0:4cb444083045792c9c8f696db2d79df8ba0ce135
4
+ fanforce-plugin-factory-2.0.0.rc4:982d98f3f169b800cdeace6d45838584274369b2
@@ -0,0 +1,26 @@
1
+ <!-- PluginFactoryScaffolding : FILE -->
2
+ <html>
3
+ <head>
4
+ <title>CrossDresser Frame</title>
5
+ <script type='text/javascript'>
6
+ window.onload = function() {
7
+ try {
8
+ if (window.opener || (window.top && window.top.opener)) {
9
+ environment = 'popup'
10
+ parent = window.opener || window.top.opener
11
+ } else if (window.top) {
12
+ environment = 'frame'
13
+ parent = window.top
14
+ } else {
15
+ throw('not found')
16
+ }
17
+ parent.CrossDresser.conduit.fromIframe(environment, document.location.href)
18
+ } catch(err) {
19
+ console.error('CrossDresser can only be used inside an iframe or popup window: ' + err)
20
+ }
21
+ }
22
+ </script>
23
+ </head>
24
+ <body></body>
25
+ </html>
26
+
@@ -32,8 +32,8 @@
32
32
  %span.plugin_company_description
33
33
  %a{href: "http://#{Fanforce.base_domain}"} Learn more.
34
34
 
35
- - content_for :after_core_js do
36
- :coffeescript
35
+ :coffeescript
36
+ FF(->
37
37
  FF.get('/available_plugins/#{Plugin._id}').done((plugin)->
38
38
  $('.plugin_company_name').text(plugin.company_name || 'Engineers Who Love Coffee')
39
39
  $('.plugin_company_description').text(plugin.company_description)
@@ -42,3 +42,4 @@
42
42
  $('.loaded').show()
43
43
  $('.about-box').hide() if !plugin.company_description
44
44
  )
45
+ )
@@ -4,7 +4,6 @@ PluginWorker = Fanforce::PluginWorker
4
4
  ########################################################################################################################
5
5
 
6
6
  class Fanforce::Plugin::Sinatra < Sinatra::Base
7
- require 'sinatra/content_for'
8
7
  require 'bugsnag'
9
8
 
10
9
  require_relative 'error_handling'
@@ -39,8 +38,8 @@ class Fanforce::Plugin::Sinatra < Sinatra::Base
39
38
 
40
39
  def self.setup_catchall_routes_from_folder(path)
41
40
  path = ('views/' + path.to_s.gsub(/^views\/?/, '')).gsub(/\/$/, '')
42
- Dir["#{Fanforce::Plugin.config.base_dir}/#{path}/*/*.haml"].each do |file|
43
- create_basic_route($1) if file =~ /\/views\/(.+).haml/
41
+ Dir["#{Fanforce::Plugin.config.base_dir}/#{path}/**/*.{html,haml}"].each do |file|
42
+ create_basic_route($1) if (file =~ /\/views\/(.+)\.haml/) || (file =~ /\/views\/(.+\.html)/)
44
43
  end
45
44
  end
46
45
 
@@ -65,11 +64,30 @@ class Fanforce::Plugin::Sinatra < Sinatra::Base
65
64
 
66
65
  def page(page, options={})
67
66
  plugin_views_dir = Pathname.new(settings.views)
68
- page = :"#{options[:com_dir]}/#{page}" if File.exists?("#{plugin_views_dir}/#{options[:com_dir]}/#{page}.haml")
69
67
 
70
- options[:layout] = options[:layout] ? :"../layouts/#{options[:layout]}" : false
71
- locals = {page_classes: page.to_s.split('/')}
72
- haml page.to_sym, options, locals
68
+ if File.exists?("#{plugin_views_dir}/#{options[:com_dir]}/#{page}.haml")
69
+ page = :"#{options[:com_dir]}/#{page}"
70
+ file_type = :haml
71
+ elsif File.exists?("#{plugin_views_dir}/#{options[:com_dir]}/#{page}")
72
+ page = :"#{options[:com_dir]}/#{page}"
73
+ file_type = :html
74
+ elsif File.exists?("#{plugin_views_dir}/#{page}.haml")
75
+ file_type = :haml
76
+ else
77
+ file_type = :html
78
+ end
79
+
80
+ if file_type == :haml
81
+ options[:layout] = options[:layout] ? :"../layouts/#{options[:layout]}" : false
82
+ locals = {page_classes: page.to_s.split('/')}
83
+ haml(page.to_sym, options, locals)
84
+ else
85
+ html("#{plugin_views_dir}/#{page}")
86
+ end
87
+ end
88
+
89
+ def html(filepath)
90
+ File.read(filepath)
73
91
  end
74
92
 
75
93
  configure do