24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
# File 'lib/fanforce/factory/developer_config.rb', line 24
def self.plugin(addon)
plugin_type = addon.plugin_type
response = " \"type\": \"#{plugin_type}\",\n"
response += " \"#{plugin_type}_config\": {\n"
if plugin_type == :data_connector
response += " \"category_id\": \"bulk_messaging\"\n eos\n elsif plugin_type == :data_processor\n elsif plugin_type == :broadcaster\n response += <<-eos\n \"new_button_label\": \"\#{addon._id.humanize.titleize}\"\n eos\n elsif plugin_type == :identifier\n elsif plugin_type == :behavior\n response += <<-eos\n \"nouns\": {\n \"common\": \"action\"\n },\n \"verbs\": {\n \"simple\": \"do\",\n \"progressive\": \"doing\",\n \"perfect\": \"did\"\n },\n \"default_total_steps\": 1,\n \"valuerank_formula\": [],\n \"engagement_js_url\": \"http://${PRIMARY_DOMAIN}/assets/engage.js\"\n eos\n end\n response += \" },\\n\"\n\n response += <<-eos\n \"public_urls\": {\n \"icon_16\": \"http://${PRIMARY_DOMAIN}/assets/icon-16.png\",\n \"icon_32\": \"http://${PRIMARY_DOMAIN}/assets/icon-32.png\",\n \"icon_42\": \"http://${PRIMARY_DOMAIN}/assets/icon-42.png\"\n },\n eos\n\n response += \" \\\"staffer_ui_urls\\\": {\\n\"\n if plugin_type == :data_connector\n response += <<-eos\n \"add_source\": \"http://${PRIMARY_DOMAIN}/add_source.html\",\n \"source_details\": \"http://${PRIMARY_DOMAIN}/source_details.html\"\n eos\n elsif plugin_type == :data_processor\n elsif plugin_type == :broadcaster\n response += <<-eos\n \"new_message\": \"http://${PRIMARY_DOMAIN}/new_message.html\"\n eos\n elsif plugin_type == :identifier\n elsif plugin_type == :behavior\n response += <<-eos\n \"add_initiative\": \"http://${PRIMARY_DOMAIN}/add_initiative.html\",\n \"edit_initiative\": \"http://${PRIMARY_DOMAIN}/edit_initiative.html\",\n \"new_message\": \"http://${PRIMARY_DOMAIN}/new_message.html\"\n eos\n end\n response += \" },\\n\"\n\n response += \" \\\"staffer_js_urls\\\": {\\n\"\n if plugin_type == :data_connector\n response += <<-eos\n \"add_source\": \"http://${PRIMARY_DOMAIN}/assets/add_source_popup.js\"\n eos\n elsif plugin_type == :data_processor\n elsif plugin_type == :broadcaster\n elsif plugin_type == :identifier\n elsif plugin_type == :behavior\n end\n response += \" },\\n\"\n\n response += <<-eos\n \"callback_urls\": {\n \"install\": \"http://${PRIMARY_DOMAIN}/install\",\n \"uninstall\": \"http://${PRIMARY_DOMAIN}/uninstall\"\n },\n eos\n response += ' \"widget_dependencies\": []' if plugin_type == :behavior\n\n strip response.gsub!(/,\\s*\\z/, '')\nend\n"
|