fanforce-plugin-factory 2.0.0.rc8 → 2.0.0.rc9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fanforce/plugin_factory/Routes.rb +2 -1
- data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/vendors/cross-dresser.js +13 -13
- data/lib/fanforce/plugin_factory/cli/lib/bitbucket.rb +2 -1
- data/lib/fanforce/plugin_factory/cli/lib/iron.rb +1 -0
- data/lib/fanforce/plugin_factory/cli/scripts/restart.rb +2 -0
- data/lib/fanforce/plugin_factory/core_config.rb +2 -2
- data/lib/fanforce/plugin_factory/directive_views/initiative-added.haml +2 -2
- data/lib/fanforce/plugin_factory/plugin.rb +5 -2
- data/lib/fanforce/plugin_factory/scaffolding/layouts/._visitor.haml.registry +3 -0
- data/lib/fanforce/plugin_factory/scaffolding/layouts/visitor.haml +5 -4
- data/lib/fanforce/plugin_factory/scaffolding/views/._cross-dresser.html.registry +3 -0
- data/lib/fanforce/plugin_factory/scaffolding/views/cross-dresser.html +6 -5
- data/lib/fanforce/plugin_factory/sinatra/helpers/assets.rb +8 -8
- data/lib/fanforce/plugin_factory/sinatra/route_helpers/{com_js_widget.rb → com_widget.rb} +0 -0
- data/lib/fanforce/plugin_factory/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e212a1da66f382e5fb89e0feb285414bd858bff
|
4
|
+
data.tar.gz: 4485a106e8fe69b1f4f5556ef53f780ceea3e2e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4246057f32d34e3a6a386a312967a2454a96a3be98b9104466456abc86c3fbe906cb4b9c9db4a166f4116475eadc168f57af8f552be3e9a971fdd3ed72f27b95
|
7
|
+
data.tar.gz: 9ff0cd6d538b30dc7df4cc5c53d0e07726a26813056880df469ad832ca09499f22a2632696b780f7e747fea33f32d764118837bbe990705b50c8f2832826a8be
|
@@ -22,7 +22,8 @@ class Fanforce::Plugin::Sinatra
|
|
22
22
|
new_config = MultiJson.load(params[:config], symbolize_keys: true)
|
23
23
|
raise 'IUIDs do not match' if old_config[:_iuid] and old_config[:_iuid] != new_config[:_iuid]
|
24
24
|
|
25
|
-
|
25
|
+
raw_json = JSON.pretty_generate(Hash[new_config.sort]) + $/
|
26
|
+
File.open(filename, 'w') {|f| f.write(raw_json) }
|
26
27
|
json status: 'finished'
|
27
28
|
end
|
28
29
|
|
@@ -219,9 +219,9 @@ var CrossDresser;
|
|
219
219
|
return this.element = this.element || $('iframe#' + this._id);
|
220
220
|
};
|
221
221
|
ChildFrame.prototype.loadContent = function () {
|
222
|
-
if (this.instance.
|
222
|
+
if (this.instance.content_request) {
|
223
223
|
var frame = this;
|
224
|
-
this.instance.
|
224
|
+
this.instance.content_request.then(function (html) {
|
225
225
|
frame.getElement()[0].contentWindow.CrossDresser.injectIntoPage(html);
|
226
226
|
});
|
227
227
|
}
|
@@ -243,7 +243,7 @@ var CrossDresser;
|
|
243
243
|
var is_native = false;
|
244
244
|
if (settings.use_native_base) {
|
245
245
|
var goto_url = ((url.indexOf('?') > -1) ? url + '&' : url + '?') + $.param(attrs);
|
246
|
-
var
|
246
|
+
var content_request = $.ajax({
|
247
247
|
url: goto_url,
|
248
248
|
dataType: 'jsonp',
|
249
249
|
jsonp: 'callback'
|
@@ -254,7 +254,7 @@ var CrossDresser;
|
|
254
254
|
}
|
255
255
|
attrs.crss_drssr = _id + '::' + encodeURIComponent(CrossDresser.current.getConduitUrl());
|
256
256
|
if (goto_url) {
|
257
|
-
attrs.crss_drssr += '::' + encodeURIComponent(goto_url);
|
257
|
+
attrs.crss_drssr += '::' + encodeURIComponent(btoa(goto_url));
|
258
258
|
}
|
259
259
|
url = (url.indexOf('?') > -1) ? url + '&' : url + '?';
|
260
260
|
url += $.param(attrs);
|
@@ -264,7 +264,7 @@ var CrossDresser;
|
|
264
264
|
height: height,
|
265
265
|
url: url,
|
266
266
|
is_native: is_native,
|
267
|
-
|
267
|
+
content_request: content_request
|
268
268
|
};
|
269
269
|
return new ChildFrame(_id);
|
270
270
|
};
|
@@ -559,17 +559,17 @@ var CrossDresser;
|
|
559
559
|
this.raw_uri = CrossDresser.Utils.parseUrl(this.raw_url);
|
560
560
|
this.raw_params = CrossDresser.Utils.parseQueryString(this.raw_uri.query_string);
|
561
561
|
try {
|
562
|
-
if (window.
|
563
|
-
this.environment = 'popup';
|
564
|
-
this.parent = window.opener || window.top.opener;
|
565
|
-
this.is_popup = true;
|
566
|
-
}
|
567
|
-
else if (window.top && window.top != window.self && document.referrer != this.raw_url.replace(document.location.hash, '')) {
|
562
|
+
if (window.top && window.top != window.self && document.referrer != this.raw_url.replace(document.location.hash, '')) {
|
568
563
|
this.environment = 'frame';
|
569
564
|
this.parent = window.top;
|
570
565
|
this.is_frame = true;
|
571
566
|
this.is_native = this.isNativeFrame();
|
572
567
|
}
|
568
|
+
else if (window.opener || (window.top && window.top.opener)) {
|
569
|
+
this.environment = 'popup';
|
570
|
+
this.parent = window.opener || window.top.opener;
|
571
|
+
this.is_popup = true;
|
572
|
+
}
|
573
573
|
else {
|
574
574
|
this.environment = 'toplevel';
|
575
575
|
this.parent = null;
|
@@ -587,8 +587,8 @@ var CrossDresser;
|
|
587
587
|
}
|
588
588
|
Current.prototype.isNativeFrame = function () {
|
589
589
|
try {
|
590
|
-
var parent_host = CrossDresser.Utils.parseUrl(window.top.location.href).host;
|
591
590
|
var current_host = this.raw_uri.host;
|
591
|
+
var parent_host = CrossDresser.Utils.parseUrl(window.top.location.href).host;
|
592
592
|
return (parent_host == current_host) ? true : false;
|
593
593
|
}
|
594
594
|
catch (err) {
|
@@ -607,7 +607,7 @@ var CrossDresser;
|
|
607
607
|
this._id = array[0];
|
608
608
|
this.parent_conduit_url = decodeURIComponent(array[1]);
|
609
609
|
if (array[2]) {
|
610
|
-
this.url_to_load = decodeURIComponent(array[2]);
|
610
|
+
this.url_to_load = atob(decodeURIComponent(array[2]));
|
611
611
|
}
|
612
612
|
if (this.url_to_load && !this.is_native) {
|
613
613
|
var url = this.url_to_load;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'bitbucket_rest_api'
|
2
1
|
require 'rest_client'
|
3
2
|
require 'open3'
|
4
3
|
|
@@ -7,6 +6,8 @@ class Fanforce::PluginFactory::CLI::Bitbucket
|
|
7
6
|
|
8
7
|
attr_reader :plugin
|
9
8
|
|
9
|
+
require_gem 'bitbucket_rest_api', 'bitbucket_rest_api'
|
10
|
+
|
10
11
|
def initialize(plugin)
|
11
12
|
@plugin = plugin
|
12
13
|
end
|
@@ -34,6 +34,7 @@ class Fanforce::PluginFactory::CLI::Iron
|
|
34
34
|
code_name = filename.gsub('.worker', '')
|
35
35
|
|
36
36
|
puts "#{'Uploading'.format(:green,:bold)} #{filename.gsub('.worker', '')} to #{environment.to_s.titleize}..."
|
37
|
+
|
37
38
|
code = IronWorkerNG::Code::Base.new(:workerfile => "#{plugin.dir}/workers/#{filename}")
|
38
39
|
code.gem('fanforce-plugin-factory', factory_version)
|
39
40
|
code.remote
|
@@ -49,7 +49,7 @@ class Fanforce::Plugin::CoreConfig
|
|
49
49
|
|
50
50
|
def validate_config_json(config_json)
|
51
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
|
52
|
+
config_json[:_id].present? || (raise "#{@base_dir}/config.json must include an _id field")
|
53
53
|
return config_json
|
54
54
|
end
|
55
55
|
|
@@ -80,7 +80,7 @@ class Fanforce::Plugin::CoreConfig
|
|
80
80
|
require "#{factory_dir}/sinatra/route_helpers/com_database"
|
81
81
|
require "#{factory_dir}/sinatra/route_helpers/com_campaign"
|
82
82
|
require "#{factory_dir}/sinatra/route_helpers/com_identifier"
|
83
|
-
require "#{factory_dir}/sinatra/route_helpers/
|
83
|
+
require "#{factory_dir}/sinatra/route_helpers/com_widget"
|
84
84
|
require "#{factory_dir}/sinatra/route_helpers/plugin"
|
85
85
|
|
86
86
|
Dir["#{@base_dir}/initializers/*.rb"].each {|f| require f } if File.directory?("#{@base_dir}/initializers")
|
@@ -1,8 +1,8 @@
|
|
1
1
|
%h2 SUCCESS!
|
2
|
-
%h3
|
2
|
+
%h3(ng-if='initiative')
|
3
3
|
Your fanforce is now tracking
|
4
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="//#{Fanforce.client_domain}/#/initiatives/{{initiative._id}}" target='_top') Open Initiative
|
6
|
+
%a.btn.btn-default(ng-if='initiative' 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
8
|
%a.btn.btn-default(ng-click='close()') Close Overlay
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'redis'
|
2
|
-
require 'sass'
|
3
2
|
require 'fileutils'
|
4
3
|
require 'rack/jsonr'
|
5
4
|
require 'rack/jquery-params'
|
@@ -43,7 +42,11 @@ class Fanforce::Plugin
|
|
43
42
|
end
|
44
43
|
|
45
44
|
def self.redis
|
46
|
-
|
45
|
+
if ENV['RACK_ENV'] == 'development'
|
46
|
+
Thread.current[:plugin_factory_redis] ||= Redis.new(url: @@config.redis_url)
|
47
|
+
else
|
48
|
+
@@redis ||= Redis.new(url: @@config.redis_url)
|
49
|
+
end
|
47
50
|
end
|
48
51
|
|
49
52
|
######################################################################################################################
|
@@ -6,3 +6,6 @@ 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
8
|
fanforce-plugin-factory-2.0.0.rc4:31826496dbfa9106191e449909ec535bd01318af
|
9
|
+
fanforce-plugin-factory-2.0.0.rc8:91ab029d981cb646b3ad8922cdbd6016e6ae04c6
|
10
|
+
fanforce-plugin-factory-2.0.0.rc8:ee0c9ebae4c527c27060b9fcb6ca034272fd35f6
|
11
|
+
fanforce-plugin-factory-2.0.0.rc8:8b4aaef7947b95ac823e0905c2bb25414bf06bba
|
@@ -3,14 +3,15 @@
|
|
3
3
|
!!! 5
|
4
4
|
%html.visitor-layout
|
5
5
|
%head
|
6
|
-
%title
|
6
|
+
%title Engagement Page
|
7
7
|
%meta(http-equiv='Content-Type' content='text/html; charset=iso-8859-1')
|
8
8
|
%meta(http-equiv='Content-Language' content='en-us')
|
9
9
|
= stylesheet '/visitor.css'
|
10
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'}"
|
12
|
-
|
13
|
-
FF.option('
|
11
|
+
= javascript "//#{Fanforce.eye_domain}/#{params[:organization_slug]}-fanforce.js#{'?DEBUG=true&DYNAMIC=true' if ENV['RACK_ENV']=='development'}"
|
12
|
+
:javascript
|
13
|
+
FF.option('core:disable_browse_webpage', true)
|
14
|
+
FF.option('dynamic_url', FF.browser.uri.scheme + '://' + '#{Plugin._id}.{{SHORT_DOMAIN}}/{{INITIATIVE_ID}}')
|
14
15
|
%body
|
15
16
|
.lyt-root
|
16
17
|
.lyt-header
|
@@ -1,2 +1,5 @@
|
|
1
1
|
fanforce-plugin-factory-2.0.0.rc3:39092030cfc19fa4d63e6f1b6bdf4c9b5bc5cc40
|
2
2
|
fanforce-plugin-factory-2.0.0.rc3:1b592a137f1da55422e78637439ac775047eadea
|
3
|
+
fanforce-plugin-factory-2.0.0.rc8:29cff279c95cc5bea8aa45fda35ed5bc803efe83
|
4
|
+
fanforce-plugin-factory-2.0.0.rc8:cd6a0fe4200c18ff77297e89dce6fb8af858a7b3
|
5
|
+
fanforce-plugin-factory-2.0.0.rc8:8c7e3867788bad4517347c0c9f3b6bb9b75398c7
|
@@ -5,18 +5,19 @@
|
|
5
5
|
<script type='text/javascript'>
|
6
6
|
window.onload = function() {
|
7
7
|
try {
|
8
|
-
if (window.
|
9
|
-
environment = 'popup'
|
10
|
-
parent = window.opener || window.top.opener
|
11
|
-
} else if (window.top) {
|
8
|
+
if (window.parent && window.parent.parent && window.parent != window.parent.parent) {
|
12
9
|
environment = 'frame'
|
13
10
|
parent = window.top
|
11
|
+
}else if (window.opener || (window.top && window.top.opener)) {
|
12
|
+
environment = 'popup'
|
13
|
+
parent = window.opener || window.top.opener
|
14
14
|
} else {
|
15
|
-
throw('
|
15
|
+
throw('environment type is unknown')
|
16
16
|
}
|
17
17
|
parent.CrossDresser.conduit.fromIframe(environment, document.location.href)
|
18
18
|
} catch(err) {
|
19
19
|
console.error('CrossDresser can only be used inside an iframe or popup window: ' + err)
|
20
|
+
console.log(err)
|
20
21
|
}
|
21
22
|
}
|
22
23
|
</script>
|
@@ -1,15 +1,15 @@
|
|
1
1
|
module Fanforce::Plugin::Sinatra::AssetHelpers
|
2
2
|
|
3
|
-
def stylesheet(
|
4
|
-
|
5
|
-
|
6
|
-
"<link rel='stylesheet' href='#{
|
3
|
+
def stylesheet(src)
|
4
|
+
src += '.css' unless src.include?('.css')
|
5
|
+
src = asset_path(src) unless src =~ /^https?:\// or src =~ /^\/\/.+/
|
6
|
+
"<link rel='stylesheet' href='#{src}' />"
|
7
7
|
end
|
8
8
|
|
9
|
-
def javascript(
|
10
|
-
|
11
|
-
|
12
|
-
"<script type='text/javascript' src='#{
|
9
|
+
def javascript(src, &block)
|
10
|
+
src += '.js' unless src.include?('.js')
|
11
|
+
src = asset_path(src) unless src =~ /^https?:\// or src =~ /^\/\/.+/
|
12
|
+
"<script type='text/javascript' src='#{src}'></script>"
|
13
13
|
end
|
14
14
|
|
15
15
|
def asset_path(source, options={})
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fanforce-plugin-factory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.rc9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Caleb Clark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -522,7 +522,7 @@ files:
|
|
522
522
|
- lib/fanforce/plugin_factory/sinatra/route_helpers/com_database.rb
|
523
523
|
- lib/fanforce/plugin_factory/sinatra/route_helpers/com_identifier.rb
|
524
524
|
- lib/fanforce/plugin_factory/sinatra/route_helpers/com_initiative.rb
|
525
|
-
- lib/fanforce/plugin_factory/sinatra/route_helpers/
|
525
|
+
- lib/fanforce/plugin_factory/sinatra/route_helpers/com_widget.rb
|
526
526
|
- lib/fanforce/plugin_factory/sinatra/route_helpers/plugin.rb
|
527
527
|
- lib/fanforce/plugin_factory/sprockets/compiler.rb
|
528
528
|
- lib/fanforce/plugin_factory/sprockets/hacks.rb
|