spree_multi_share 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +20 -0
- data/.rspec +1 -0
- data/Gemfile +7 -0
- data/LICENSE +26 -0
- data/README.md +4 -0
- data/Rakefile +15 -0
- data/Versionfile +11 -0
- data/app/assets/images/spree/aol_logo.jpg +0 -0
- data/app/assets/images/spree/cs_logo.gif +0 -0
- data/app/assets/images/spree/cs_signup.png +0 -0
- data/app/assets/images/spree/gmail_logo.jpg +0 -0
- data/app/assets/images/spree/msn_logo.jpg +0 -0
- data/app/assets/images/spree/osx_logo.jpg +0 -0
- data/app/assets/images/spree/outlook_logo.png +0 -0
- data/app/assets/images/spree/windows_logo.png +0 -0
- data/app/assets/javascripts/admin/spree_multi_share.js +1 -0
- data/app/assets/javascripts/spree/cloud_sender.js +2 -0
- data/app/assets/javascripts/store/spree_multi_share.js +1 -0
- data/app/assets/stylesheets/admin/spree_multi_share.css +3 -0
- data/app/assets/stylesheets/spree/cloud_sender.css +4 -0
- data/app/assets/stylesheets/store/spree_multi_share.css +3 -0
- data/app/controllers/spree/admin/cloudsponge_settings_controller.rb +15 -0
- data/app/controllers/spree/cloud_sender_controller.rb +175 -0
- data/app/helpers/spree/cloud_sender_helper.rb +2 -0
- data/app/mailers/spree/cloud_mailer.rb +21 -0
- data/app/models/spree/cloudsponge_configuration.rb +5 -0
- data/app/models/spree/mail_to_cloud.rb +42 -0
- data/app/overrides/add_cloudsponge_settings_to_admin_configurations_menu.rb +5 -0
- data/app/overrides/add_email_to_cloud_link_to_products.rb +7 -0
- data/app/views/spree/admin/cloudsponge_settings/edit.html.erb +39 -0
- data/app/views/spree/cloud_mailer/mail_to_cloud.text.erb +3 -0
- data/app/views/spree/cloud_sender/importAOL.html.erb +56 -0
- data/app/views/spree/cloud_sender/importCheck.html.erb +1 -0
- data/app/views/spree/cloud_sender/importContacts.html.erb +104 -0
- data/app/views/spree/cloud_sender/importGmail.html.erb +62 -0
- data/app/views/spree/cloud_sender/importOSX.html.erb +95 -0
- data/app/views/spree/cloud_sender/importOutlook.html.erb +95 -0
- data/app/views/spree/cloud_sender/send_mail.html.erb +150 -0
- data/app/views/spree/products/_mail_to_cloud.text.erb +14 -0
- data/config/locales/en.yml +18 -0
- data/config/routes.rb +18 -0
- data/db/migrate/20130125181027_create_spree_mail_to_clouds.rb +8 -0
- data/lib/generators/spree_multi_share/install/install_generator.rb +29 -0
- data/lib/spree_multi_share/engine.rb +29 -0
- data/lib/spree_multi_share.rb +2 -0
- data/script/rails +7 -0
- data/spec/controllers/spree/cloud_sender_controller_spec.rb +5 -0
- data/spec/helpers/spree/cloud_sender_helper_spec.rb +15 -0
- data/spec/mailers/spree/cloud_mailer_spec.rb +5 -0
- data/spec/models/spree/mail_to_cloud_spec.rb +5 -0
- data/spec/spec_helper.rb +46 -0
- data/spree_multi_share.gemspec +30 -0
- metadata +61 -4
@@ -0,0 +1,62 @@
|
|
1
|
+
<div id="waitingDiv"><b>Loading Your Address Book...</b><br/><i>(Larger contact lists may take longer to load)</i></div>
|
2
|
+
<div id="contentDiv">
|
3
|
+
<br/>
|
4
|
+
If you have popups disabled you will need to enable them for the authorization window to appear..<br/>
|
5
|
+
If you do not see the authorization popup, click <a target='_blank' href='<%= @authURL %>'><b>here</b></a> to open it.<br/>
|
6
|
+
<br/>
|
7
|
+
<input type="button" value="Cancel" onclick="closeWindow()">
|
8
|
+
</div>
|
9
|
+
|
10
|
+
|
11
|
+
<script>
|
12
|
+
function authPopup(){
|
13
|
+
window.open('<%= @authURL %>', '', 'width=500,height=400');
|
14
|
+
}
|
15
|
+
authPopup();
|
16
|
+
|
17
|
+
jQuery("#importText").html("<b>Waiting for Authorization...</b><br><small><i>powered by</i> <a target='new' href='http://www.cloudsponge.com'>Cloudsponge</a></small>");
|
18
|
+
</script>
|
19
|
+
|
20
|
+
<script>
|
21
|
+
var i = 0;
|
22
|
+
var authReceived = false;
|
23
|
+
var intervalID = setInterval(checkAuth, 1000);
|
24
|
+
|
25
|
+
function checkAuth(){
|
26
|
+
i = i + 1;
|
27
|
+
tempString = "Loading Your Address Book"
|
28
|
+
for (j=0; j<(i%6); j++)
|
29
|
+
tempString = tempString + ".";
|
30
|
+
jQuery("#waitingDiv").html("<b>" + tempString + "</b><br/><i>(Larger contact lists may take longer to load)</i>");
|
31
|
+
|
32
|
+
jQuery.ajax("/importCheck/<%= @importID %>", {
|
33
|
+
complete:function(jqXHR, textStatus) {
|
34
|
+
if (jqXHR.responseText == "true")
|
35
|
+
authReceived = true;
|
36
|
+
}
|
37
|
+
})
|
38
|
+
|
39
|
+
if (authReceived){
|
40
|
+
clearInterval(intervalID);
|
41
|
+
jQuery("#waitingDiv").html("<b>Authorization Received!</b>");
|
42
|
+
jQuery("#importText").html("<b>Loading Contacts. Please wait...</b>");
|
43
|
+
jQuery.ajax("/importContacts/<%= @importID %>?service=<%= params[:service] %><% if !(params[:new_client_waiting_list_id].nil?) %>&new_client_waiting_list_id=<%= params[:new_client_waiting_list_id] %><% end %>", {
|
44
|
+
complete:function(jqXHR, textStatus) {
|
45
|
+
document.getElementById("waitingDiv").style.display = 'none';
|
46
|
+
jQuery("#contentDiv").html(jqXHR.responseText);
|
47
|
+
}
|
48
|
+
})
|
49
|
+
}
|
50
|
+
}
|
51
|
+
</script>
|
52
|
+
|
53
|
+
<script>
|
54
|
+
function closeWindow(){
|
55
|
+
document.getElementById("importGMAILLogo").style.display = 'none';
|
56
|
+
document.getElementById("importWINDOWSLIVELogo").style.display = 'none';
|
57
|
+
document.getElementById("importText").style.display = 'none';
|
58
|
+
document.getElementById("importDiv").style.display = 'none';
|
59
|
+
document.getElementById("addressSelectionDiv").style.display = 'block';
|
60
|
+
clearInterval(intervalID);
|
61
|
+
}
|
62
|
+
</script>
|
@@ -0,0 +1,95 @@
|
|
1
|
+
<div id="waitingDiv"><b>Loading Your Address Book...</b><br/><i>(Larger contact lists may take longer to load)</i></div>
|
2
|
+
<div id="contentDiv">
|
3
|
+
<br/>
|
4
|
+
<!--[if !IE]> Firefox and others will use outer object -->
|
5
|
+
<object classid="java:ContactsApplet"
|
6
|
+
type="application/x-java-applet"
|
7
|
+
archive="<%= @authURL %>"
|
8
|
+
height="1"
|
9
|
+
width="1">
|
10
|
+
<!-- Konqueror browser needs the following param -->
|
11
|
+
<param name="archive" value="<%= @authURL %>" />
|
12
|
+
<param name="cookieValue" value="document.cookie"/>
|
13
|
+
<param name="importId" value="<%= @importID %>"/>
|
14
|
+
<param name="MAYSCRIPT" value="true">
|
15
|
+
<!--<![endif]-->
|
16
|
+
|
17
|
+
<!-- MSIE (Microsoft Internet Explorer) will use inner object -->
|
18
|
+
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
|
19
|
+
codebase="http://java.sun.com/update/1.6.0/jinstall-6u30-windows-i586.cab"
|
20
|
+
height="0"
|
21
|
+
width="0" >
|
22
|
+
<param name="code" value="ContactsApplet" />
|
23
|
+
<param name="archive" value="<%= @authURL %>" />
|
24
|
+
<param name="cookieValue" value="document.cookie"/>
|
25
|
+
<param name="importId" value="<%= @importID %>"/>
|
26
|
+
<param name="MAYSCRIPT" value="true">
|
27
|
+
|
28
|
+
<!-- Chrome falls through to this innermost applet -->
|
29
|
+
<applet archive="url" code="ContactsApplet" height="1" width="1" MAYSCRIPT>
|
30
|
+
<param name="cookieValue" value="document.cookie" />
|
31
|
+
<param name="importId" value="<%= @importID %>"/>
|
32
|
+
<param name="MAYSCRIPT" value="true">
|
33
|
+
<strong>
|
34
|
+
This browser does not have a Java Plug-in.<br />
|
35
|
+
<a href="http://java.sun.com/products/plugin/downloads/index.html">
|
36
|
+
Get the latest Java Plug-in here.
|
37
|
+
</a>
|
38
|
+
</strong>
|
39
|
+
</applet>
|
40
|
+
</object>
|
41
|
+
|
42
|
+
<!--[if !IE]> close outer object -->
|
43
|
+
</object>
|
44
|
+
<!--<![endif]-->
|
45
|
+
<br/>
|
46
|
+
<input type="button" value="Cancel" onclick="closeWindow()">
|
47
|
+
</div>
|
48
|
+
|
49
|
+
|
50
|
+
<script>
|
51
|
+
jQuery("#importText").html("<b>Waiting for Authorization...</b>");
|
52
|
+
</script>
|
53
|
+
|
54
|
+
<script>
|
55
|
+
var i = 0;
|
56
|
+
var authReceived = false;
|
57
|
+
var intervalID = setInterval(checkAuth, 1000);
|
58
|
+
|
59
|
+
function checkAuth(){
|
60
|
+
i = i + 1;
|
61
|
+
tempString = "Loading Your Address Book"
|
62
|
+
for (j=0; j<(i%6); j++)
|
63
|
+
tempString = tempString + ".";
|
64
|
+
jQuery("#waitingDiv").html("<b>" + tempString + "</b><br/><i>(Larger contact lists may take longer to load)</i>");
|
65
|
+
|
66
|
+
jQuery.ajax("/importCheck/<%= @importID %>", {
|
67
|
+
complete:function(jqXHR, textStatus) {
|
68
|
+
if (jqXHR.responseText == "true")
|
69
|
+
authReceived = true;
|
70
|
+
}
|
71
|
+
})
|
72
|
+
|
73
|
+
if (authReceived){
|
74
|
+
clearInterval(intervalID);
|
75
|
+
jQuery("#waitingDiv").html("<b>Authorization Received!</b>");
|
76
|
+
jQuery("#importText").html("<b>Loading Contacts. Please wait...</b>");
|
77
|
+
jQuery.ajax("/importContacts/<%= @importID %>?service=OSX<% if !(params[:new_client_waiting_list_id].nil?) %>&new_client_waiting_list_id=<%= params[:new_client_waiting_list_id] %><% end %>", {
|
78
|
+
complete:function(jqXHR, textStatus) {
|
79
|
+
document.getElementById("waitingDiv").style.display = 'none';
|
80
|
+
jQuery("#contentDiv").html(jqXHR.responseText);
|
81
|
+
}
|
82
|
+
})
|
83
|
+
}
|
84
|
+
}
|
85
|
+
</script>
|
86
|
+
|
87
|
+
<script>
|
88
|
+
function closeWindow(){
|
89
|
+
document.getElementById("importOSXLogo").style.display = 'none';
|
90
|
+
document.getElementById("importText").style.display = 'none';
|
91
|
+
document.getElementById("importDiv").style.display = 'none';
|
92
|
+
document.getElementById("addressSelectionDiv").style.display = 'block';
|
93
|
+
clearInterval(intervalID);
|
94
|
+
}
|
95
|
+
</script>
|
@@ -0,0 +1,95 @@
|
|
1
|
+
<div id="waitingDiv"><b>Loading Your Address Book...</b><br/><i>(Larger contact lists may take longer to load)</i></div>
|
2
|
+
<div id="contentDiv">
|
3
|
+
<br/>
|
4
|
+
<!--[if !IE]> Firefox and others will use outer object -->
|
5
|
+
<object classid="java:ContactsApplet"
|
6
|
+
type="application/x-java-applet"
|
7
|
+
archive="<%= @authURL %>"
|
8
|
+
height="1"
|
9
|
+
width="1">
|
10
|
+
<!-- Konqueror browser needs the following param -->
|
11
|
+
<param name="archive" value="<%= @authURL %>" />
|
12
|
+
<param name="cookieValue" value="document.cookie"/>
|
13
|
+
<param name="importId" value="<%= @importID %>"/>
|
14
|
+
<param name="MAYSCRIPT" value="true">
|
15
|
+
<!--<![endif]-->
|
16
|
+
|
17
|
+
<!-- MSIE (Microsoft Internet Explorer) will use inner object -->
|
18
|
+
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
|
19
|
+
codebase="http://java.sun.com/update/1.6.0/jinstall-6u30-windows-i586.cab"
|
20
|
+
height="0"
|
21
|
+
width="0" >
|
22
|
+
<param name="code" value="ContactsApplet" />
|
23
|
+
<param name="archive" value="<%= @authURL %>" />
|
24
|
+
<param name="cookieValue" value="document.cookie"/>
|
25
|
+
<param name="importId" value="<%= @importID %>"/>
|
26
|
+
<param name="MAYSCRIPT" value="true">
|
27
|
+
|
28
|
+
<!-- Chrome falls through to this innermost applet -->
|
29
|
+
<applet archive="url" code="ContactsApplet" height="1" width="1" MAYSCRIPT>
|
30
|
+
<param name="cookieValue" value="document.cookie" />
|
31
|
+
<param name="importId" value="<%= @importID %>"/>
|
32
|
+
<param name="MAYSCRIPT" value="true">
|
33
|
+
<strong>
|
34
|
+
This browser does not have a Java Plug-in.<br />
|
35
|
+
<a href="http://java.sun.com/products/plugin/downloads/index.html">
|
36
|
+
Get the latest Java Plug-in here.
|
37
|
+
</a>
|
38
|
+
</strong>
|
39
|
+
</applet>
|
40
|
+
</object>
|
41
|
+
|
42
|
+
<!--[if !IE]> close outer object -->
|
43
|
+
</object>
|
44
|
+
<!--<![endif]-->
|
45
|
+
<br/>
|
46
|
+
<input type="button" value="Cancel" onclick="closeWindow()">
|
47
|
+
</div>
|
48
|
+
|
49
|
+
|
50
|
+
<script>
|
51
|
+
jQuery("#importText").html("<b>Waiting for Authorization...</b>");
|
52
|
+
</script>
|
53
|
+
|
54
|
+
<script>
|
55
|
+
var i = 0;
|
56
|
+
var authReceived = false;
|
57
|
+
var intervalID = setInterval(checkAuth, 1000);
|
58
|
+
|
59
|
+
function checkAuth(){
|
60
|
+
i = i + 1;
|
61
|
+
tempString = "Loading Your Address Book"
|
62
|
+
for (j=0; j<(i%6); j++)
|
63
|
+
tempString = tempString + ".";
|
64
|
+
jQuery("#waitingDiv").html("<b>" + tempString + "</b><br/><i>(Larger contact lists may take longer to load)</i>");
|
65
|
+
|
66
|
+
jQuery.ajax("/importCheck/<%= @importID %>", {
|
67
|
+
complete:function(jqXHR, textStatus) {
|
68
|
+
if (jqXHR.responseText == "true")
|
69
|
+
authReceived = true;
|
70
|
+
}
|
71
|
+
})
|
72
|
+
|
73
|
+
if (authReceived){
|
74
|
+
clearInterval(intervalID);
|
75
|
+
jQuery("#waitingDiv").html("<b>Authorization Received!</b>");
|
76
|
+
jQuery("#importText").html("<b>Loading Contacts. Please wait...</b>");
|
77
|
+
jQuery.ajax("/importContacts/<%= @importID %>?service=OUTLOOK<% if !(params[:new_client_waiting_list_id].nil?) %>&new_client_waiting_list_id=<%= params[:new_client_waiting_list_id] %><% end %>", {
|
78
|
+
complete:function(jqXHR, textStatus) {
|
79
|
+
document.getElementById("waitingDiv").style.display = 'none';
|
80
|
+
jQuery("#contentDiv").html(jqXHR.responseText);
|
81
|
+
}
|
82
|
+
})
|
83
|
+
}
|
84
|
+
}
|
85
|
+
</script>
|
86
|
+
|
87
|
+
<script>
|
88
|
+
function closeWindow(){
|
89
|
+
document.getElementById("importOutlookLogo").style.display = 'none';
|
90
|
+
document.getElementById("importText").style.display = 'none';
|
91
|
+
document.getElementById("importDiv").style.display = 'none';
|
92
|
+
document.getElementById("addressSelectionDiv").style.display = 'block';
|
93
|
+
clearInterval(intervalID);
|
94
|
+
}
|
95
|
+
</script>
|
@@ -0,0 +1,150 @@
|
|
1
|
+
<h1><%= t('cloudsponge.tell_about', :product => @object.name) %></h1>
|
2
|
+
<br/>
|
3
|
+
<%= form_for(@mail_to_cloud, :url => email_to_cloud_path(params[:type], @object)) do |f| -%>
|
4
|
+
<%= render 'spree/shared/error_messages', :target => @mail_to_cloud %>
|
5
|
+
|
6
|
+
<b><%= f.label(:sender_name, t('cloudsponge.sender_name')) %></b><br/><%= f.text_field(:sender_name) %><br/>
|
7
|
+
<br/>
|
8
|
+
<b><%= f.label(:sender_email, t('cloudsponge.sender_email')) %></b><br/><%= f.text_field(:sender_email) %><br/>
|
9
|
+
<br/>
|
10
|
+
<b><%= f.label(:message, t('cloudsponge.message')) %></b><br/>
|
11
|
+
<%= f.text_area(:message, :cols => 50, :rows => 4) %><br/>
|
12
|
+
<br/>
|
13
|
+
<div id="addressSelectionDiv">
|
14
|
+
<b>Look up contacts in your address book by clicking the appropriate logo:</b><br/>
|
15
|
+
<small><i>powered by</i> <a target='new' href='http://www.cloudsponge.com'>Cloudsponge</a></small><br/>
|
16
|
+
<br/>
|
17
|
+
|
18
|
+
<%= image_tag "spree/gmail_logo.jpg", :height => 30, :class => "holderWhite", :onclick => "importGmail('GMAIL')", :style => "cursor:pointer" %>
|
19
|
+
|
20
|
+
<%= image_tag "spree/windows_logo.png", :height => 30, :class => "holderWhite", :onclick => "importGmail('WINDOWSLIVE')", :style => "cursor:pointer" %>
|
21
|
+
|
22
|
+
<%= image_tag "spree/aol_logo.jpg", :height => 30, :class => "holderWhite", :onclick => "showAOLLogin()", :style => "cursor:pointer" %>
|
23
|
+
|
24
|
+
<%= image_tag "spree/outlook_logo.png", :height => 30, :class => "holderWhite", :onclick => "importOutlook()", :style => "cursor:pointer" %>
|
25
|
+
|
26
|
+
<%= image_tag "spree/osx_logo.jpg", :height => 30, :class => "holderWhite", :onclick => "importOSX()", :style => "cursor:pointer" %><br/>
|
27
|
+
<br/>
|
28
|
+
<b>OR</b> you can just type one or more emails below:<br/>
|
29
|
+
<b>Your Friend's Email:</b> <i>(separate multiple emails with a comma)</i><br/><%= f.text_field(:recipient_email) %><br/>
|
30
|
+
<br/>
|
31
|
+
<%= f.submit t('cloudsponge.send_message') %>
|
32
|
+
</div>
|
33
|
+
<div id="importGMAILLogo" style="display:none;float:left"><%= image_tag "spree/gmail_logo.jpg", :height => 50 %></div>
|
34
|
+
<div id="importWINDOWSLIVELogo" style="display:none;float:left"><%= image_tag "spree/windows_logo.png", :height => 50 %></div>
|
35
|
+
<div id="importOutlookLogo" style="display:none;float:left"><%= image_tag "spree/outlook_logo.png", :height => 50 %></div>
|
36
|
+
<div id="importOSXLogo" style="display:none;float:left"><%= image_tag "spree/osx_logo.jpg", :height => 50 %></div>
|
37
|
+
<div id="importAOLLogo" style="display:none;float:left"><%= image_tag "spree/aol_logo.jpg", :height => 50 %></div>
|
38
|
+
<div style="float:left;width:25px"> </div>
|
39
|
+
<div id="importText" style="display:none;float:left;"> </div>
|
40
|
+
<div style="clear:both"> </div>
|
41
|
+
<div id="importDiv" style="display:none;padding:10px;width:690px;min-height:200px"></div>
|
42
|
+
<% end -%>
|
43
|
+
|
44
|
+
<script>
|
45
|
+
function importGmail(service)
|
46
|
+
{
|
47
|
+
document.getElementById("addressSelectionDiv").style.display = 'none';
|
48
|
+
document.getElementById("import" + service + "Logo").style.display = 'block';
|
49
|
+
jQuery("#importText").html("<b>Please Wait...</b>");
|
50
|
+
jQuery("#importDiv").html("");
|
51
|
+
document.getElementById("importText").style.display = 'block';
|
52
|
+
document.getElementById("importDiv").style.display = 'block';
|
53
|
+
jQuery.ajax("/importGmail/?service=" + service, {
|
54
|
+
complete:function(jqXHR, textStatus) {
|
55
|
+
jQuery("#importDiv").html(jqXHR.responseText);
|
56
|
+
}
|
57
|
+
})
|
58
|
+
}
|
59
|
+
function showAOLLogin(){
|
60
|
+
document.getElementById("addressSelectionDiv").style.display = 'none';
|
61
|
+
document.getElementById("importAOLLogo").style.display = 'block';
|
62
|
+
jQuery("#importText").html("<b>Please Enter Your Username and Password:</b><br/><small><i>powered by</i></small> <a target='new' href='http://www.cloudsponge.com'>Cloudsponge</a>");
|
63
|
+
jQuery("#importDiv").html("<b>Username</b>: <input type='text' size='20' id='username'><br/><b>Password</b>: <input type='password' size='25' id='password'><br/><br/><input type='button' value='Get Contacts' onclick='importAOL()'> <input type='button' value='Cancel' onclick='hideAOLLogin()'>");
|
64
|
+
document.getElementById("importText").style.display = 'block';
|
65
|
+
document.getElementById("importDiv").style.display = 'block';
|
66
|
+
}
|
67
|
+
function hideAOLLogin(){
|
68
|
+
document.getElementById("addressSelectionDiv").style.display = 'block';
|
69
|
+
document.getElementById("importAOLLogo").style.display = 'none';
|
70
|
+
document.getElementById("importText").style.display = 'none';
|
71
|
+
document.getElementById("importDiv").style.display = 'none';
|
72
|
+
}
|
73
|
+
function importAOL()
|
74
|
+
{
|
75
|
+
username = document.getElementById('username').value;
|
76
|
+
password = document.getElementById('password').value;
|
77
|
+
if ((username == '') || (password == ''))
|
78
|
+
{
|
79
|
+
alert('You must enter a username and password to proceed!');
|
80
|
+
}
|
81
|
+
else
|
82
|
+
{
|
83
|
+
document.getElementById("importAOLLogo").style.display = 'block';
|
84
|
+
jQuery("#importText").html("<b>Please Wait...</b>");
|
85
|
+
jQuery("#importDiv").html("");
|
86
|
+
document.getElementById("importText").style.display = 'block';
|
87
|
+
document.getElementById("importDiv").style.display = 'block';
|
88
|
+
jQuery.ajax("/importAOL/?service=AOL&username=" + username + "&password=" + password, {
|
89
|
+
complete:function(jqXHR, textStatus) {
|
90
|
+
jQuery("#importDiv").html(jqXHR.responseText);
|
91
|
+
}
|
92
|
+
});
|
93
|
+
}
|
94
|
+
|
95
|
+
}
|
96
|
+
function importOutlook()
|
97
|
+
{
|
98
|
+
document.getElementById("addressSelectionDiv").style.display = 'none';
|
99
|
+
document.getElementById("importOutlookLogo").style.display = 'block';
|
100
|
+
jQuery("#importText").html("<b>Please Wait...</b>");
|
101
|
+
jQuery("#importDiv").html("");
|
102
|
+
document.getElementById("importText").style.display = 'block';
|
103
|
+
document.getElementById("importDiv").style.display = 'block';
|
104
|
+
jQuery.ajax("/importOutlook/", {
|
105
|
+
complete:function(jqXHR, textStatus) {
|
106
|
+
jQuery("#importDiv").html(jqXHR.responseText);
|
107
|
+
}
|
108
|
+
});
|
109
|
+
}
|
110
|
+
function importOSX()
|
111
|
+
{
|
112
|
+
document.getElementById("addressSelectionDiv").style.display = 'none';
|
113
|
+
document.getElementById("importOSXLogo").style.display = 'block';
|
114
|
+
jQuery("#importText").html("<b>Please Wait...</b>");
|
115
|
+
jQuery("#importDiv").html("");
|
116
|
+
document.getElementById("importText").style.display = 'block';
|
117
|
+
document.getElementById("importDiv").style.display = 'block';
|
118
|
+
jQuery.ajax("/importOSX/", {
|
119
|
+
complete:function(jqXHR, textStatus) {
|
120
|
+
jQuery("#importDiv").html(jqXHR.responseText);
|
121
|
+
}
|
122
|
+
});
|
123
|
+
}
|
124
|
+
</script>
|
125
|
+
|
126
|
+
<!--
|
127
|
+
<%= form_for(@mail_to_cloud, :url => email_to_cloud_path(params[:type], @object)) do |f| -%>
|
128
|
+
<%= render 'spree/shared/error_messages', :target => @mail_to_cloud %>
|
129
|
+
|
130
|
+
<p>
|
131
|
+
<%= f.label(:sender_name, t('cloudsponge.sender_name')) %><br/>
|
132
|
+
<%= f.text_field(:sender_name) %>
|
133
|
+
</p>
|
134
|
+
<p>
|
135
|
+
<%= f.label(:sender_email, t('cloudsponge.sender_email')) %><br/>
|
136
|
+
<%= f.text_field(:sender_email) %>
|
137
|
+
</p>
|
138
|
+
<p>
|
139
|
+
<%= f.label(:recipient_email, t('cloudsponge.recipient_email')) %><br/>
|
140
|
+
<%= f.text_field(:recipient_email) %>
|
141
|
+
</p>
|
142
|
+
<p>
|
143
|
+
<%= f.label(:message, t('cloudsponge.message')) %><br/>
|
144
|
+
<%= f.text_area(:message) %>
|
145
|
+
</p>
|
146
|
+
<p>
|
147
|
+
<%= f.submit t('cloudsponge.send_message') %>
|
148
|
+
</p>
|
149
|
+
<% end -%>
|
150
|
+
-->
|
@@ -0,0 +1,14 @@
|
|
1
|
+
I think you would like this item:
|
2
|
+
|
3
|
+
* <%= product.name %>
|
4
|
+
|
5
|
+
<% unless mail.message.blank? -%>
|
6
|
+
<%= mail.message %>
|
7
|
+
<% end -%>
|
8
|
+
|
9
|
+
<%= mail.sender_name %>
|
10
|
+
|
11
|
+
Click the link below to view the <%= product.name %> page.
|
12
|
+
<%= spree.product_url(product) %>
|
13
|
+
|
14
|
+
For more online shopping, visit <%= spree.products_url %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
en:
|
3
|
+
cloudsponge:
|
4
|
+
send_to_cloud: "Tell your friends!"
|
5
|
+
tell_about: "Tell your friends about: %{product}"
|
6
|
+
sender_name: "Your name"
|
7
|
+
sender_email: "Your email address"
|
8
|
+
recipient_email: "Your friend's email address"
|
9
|
+
recipient_emails: "Email addresses (comma separated)"
|
10
|
+
message: "Type a personal message to your friend(s), if you wish"
|
11
|
+
send_message: "Tell your friends!"
|
12
|
+
mail_sent_to: "Mail sent to %{email} "
|
13
|
+
send_to_other: "Send to more friends"
|
14
|
+
you_would_like_this: "%{sender_name} wants you to see this item at %{site}"
|
15
|
+
|
16
|
+
cloudsponge_settings: "CloudSponge Settings"
|
17
|
+
domain_key: "Domain Key"
|
18
|
+
domain_password: "Domain Password"
|
data/config/routes.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Spree::Core::Engine.routes.prepend do
|
2
|
+
|
3
|
+
match "/email_to_cloud/:type/:id" => 'cloud_sender#send_mail', :as => :email_to_cloud
|
4
|
+
|
5
|
+
match '/importGmail', :to => 'cloud_sender#importGmail'
|
6
|
+
match '/importOutlook', :to => 'cloud_sender#importOutlook'
|
7
|
+
match '/importOSX', :to => 'cloud_sender#importOSX'
|
8
|
+
match '/importAOL', :to => 'cloud_sender#importAOL'
|
9
|
+
match '/importCheck/:id', :to => 'cloud_sender#importCheck'
|
10
|
+
match '/importContacts/:id', :to => 'cloud_sender#importContacts'
|
11
|
+
|
12
|
+
match '/cloudsponge_proxy', :to => 'cloud_sender#cloudsponge_proxy'
|
13
|
+
|
14
|
+
namespace :admin do
|
15
|
+
resource :cloudsponge_settings
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module SpreeMultiShare
|
2
|
+
module Generators
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
4
|
+
|
5
|
+
def add_javascripts
|
6
|
+
append_file 'app/assets/javascripts/store/all.js', "//= require store/spree_multi_share\n"
|
7
|
+
append_file 'app/assets/javascripts/admin/all.js', "//= require admin/spree_multi_share\n"
|
8
|
+
end
|
9
|
+
|
10
|
+
def add_stylesheets
|
11
|
+
inject_into_file 'app/assets/stylesheets/store/all.css', " *= require store/spree_multi_share\n", :before => /\*\//, :verbose => true
|
12
|
+
inject_into_file 'app/assets/stylesheets/admin/all.css', " *= require admin/spree_multi_share\n", :before => /\*\//, :verbose => true
|
13
|
+
end
|
14
|
+
|
15
|
+
def add_migrations
|
16
|
+
run 'bundle exec rake railties:install:migrations FROM=spree_multi_share'
|
17
|
+
end
|
18
|
+
|
19
|
+
def run_migrations
|
20
|
+
res = ask 'Would you like to run the migrations now? [Y/n]'
|
21
|
+
if res == '' || res.downcase == 'y'
|
22
|
+
run 'bundle exec rake db:migrate'
|
23
|
+
else
|
24
|
+
puts 'Skipping rake db:migrate, don\'t forget to run it!'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Spree::Cloudsponge
|
2
|
+
end
|
3
|
+
|
4
|
+
module SpreeCloudsponge
|
5
|
+
class Engine < Rails::Engine
|
6
|
+
require 'spree/core'
|
7
|
+
isolate_namespace Spree
|
8
|
+
engine_name 'spree_multi_share'
|
9
|
+
|
10
|
+
config.autoload_paths += %W(#{config.root}/lib)
|
11
|
+
|
12
|
+
initializer "spree.email_to_cloud.preferences", :after => "spree.environment" do |app|
|
13
|
+
Spree::Cloudsponge::Config = Spree::CloudspongeConfiguration.new
|
14
|
+
end
|
15
|
+
|
16
|
+
# use rspec for tests
|
17
|
+
config.generators do |g|
|
18
|
+
g.test_framework :rspec
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.activate
|
22
|
+
Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
|
23
|
+
Rails.configuration.cache_classes ? require(c) : load(c)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
config.to_prepare &method(:activate).to_proc
|
28
|
+
end
|
29
|
+
end
|
data/script/rails
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
2
|
+
|
3
|
+
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
4
|
+
ENGINE_PATH = File.expand_path('../../lib/spree_multi_share/engine', __FILE__)
|
5
|
+
|
6
|
+
require 'rails/all'
|
7
|
+
require 'rails/engine/commands'
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
# Specs in this file have access to a helper object that includes
|
4
|
+
# the Spree::CloudSenderHelper. For example:
|
5
|
+
#
|
6
|
+
# describe Spree::CloudSenderHelper do
|
7
|
+
# describe "string concat" do
|
8
|
+
# it "concats two strings with spaces" do
|
9
|
+
# helper.concat_strings("this","that").should == "this that"
|
10
|
+
# end
|
11
|
+
# end
|
12
|
+
# end
|
13
|
+
describe Spree::CloudSenderHelper do
|
14
|
+
pending "add some examples to (or delete) #{__FILE__}"
|
15
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV['RAILS_ENV'] = 'test'
|
3
|
+
|
4
|
+
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
5
|
+
|
6
|
+
require 'rspec/rails'
|
7
|
+
require 'ffaker'
|
8
|
+
|
9
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
10
|
+
# in spec/support/ and its subdirectories.
|
11
|
+
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
|
12
|
+
|
13
|
+
# Requires factories defined in spree_core
|
14
|
+
require 'spree/core/testing_support/factories'
|
15
|
+
require 'spree/core/testing_support/controller_requests'
|
16
|
+
require 'spree/core/testing_support/authorization_helpers'
|
17
|
+
require 'spree/core/url_helpers'
|
18
|
+
|
19
|
+
RSpec.configure do |config|
|
20
|
+
config.include FactoryGirl::Syntax::Methods
|
21
|
+
|
22
|
+
# == URL Helpers
|
23
|
+
#
|
24
|
+
# Allows access to Spree's routes in specs:
|
25
|
+
#
|
26
|
+
# visit spree.admin_path
|
27
|
+
# current_path.should eql(spree.products_path)
|
28
|
+
config.include Spree::Core::UrlHelpers
|
29
|
+
|
30
|
+
# == Mock Framework
|
31
|
+
#
|
32
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
33
|
+
#
|
34
|
+
# config.mock_with :mocha
|
35
|
+
# config.mock_with :flexmock
|
36
|
+
# config.mock_with :rr
|
37
|
+
config.mock_with :rspec
|
38
|
+
|
39
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
40
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
41
|
+
|
42
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
43
|
+
# examples within a transaction, remove the following line or assign false
|
44
|
+
# instead of true.
|
45
|
+
config.use_transactional_fixtures = true
|
46
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
Gem::Specification.new do |s|
|
3
|
+
s.platform = Gem::Platform::RUBY
|
4
|
+
s.name = 'spree_multi_share'
|
5
|
+
s.version = '1.3.2'
|
6
|
+
s.summary = 'Extension for Spree that allows customers to share products for store credit.'
|
7
|
+
s.description = 'Extension for Spree that allows customers to share products with their cloud friends for store credit. Powered by CloudSponge.'
|
8
|
+
s.required_ruby_version = '>= 1.8.7'
|
9
|
+
|
10
|
+
s.author = 'Derek Sweet'
|
11
|
+
s.email = 'derek@arizonabay.com'
|
12
|
+
# s.homepage = 'http://www.spreecommerce.com'
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.require_path = 'lib'
|
17
|
+
s.requirements << 'none'
|
18
|
+
|
19
|
+
s.add_dependency 'spree_core', '~> 1.3.1'
|
20
|
+
s.add_dependency 'httpclient'
|
21
|
+
s.add_dependency 'cloudsponge'
|
22
|
+
|
23
|
+
s.add_development_dependency 'capybara', '~> 1.1.2'
|
24
|
+
s.add_development_dependency 'coffee-rails'
|
25
|
+
s.add_development_dependency 'factory_girl', '~> 2.6.4'
|
26
|
+
s.add_development_dependency 'ffaker'
|
27
|
+
s.add_development_dependency 'rspec-rails', '~> 2.9'
|
28
|
+
s.add_development_dependency 'sass-rails'
|
29
|
+
s.add_development_dependency 'sqlite3'
|
30
|
+
end
|