* working on checkboxes

This commit is contained in:
Seth Call 2014-02-05 01:55:51 +00:00
parent 52f783f70e
commit ca7a69a465
3 changed files with 44 additions and 5 deletions

View File

@ -6,7 +6,22 @@
var logger = context.JK.logger;
var rest = context.JK.Rest();
function socialShare() {
var shareWithFacebook = $('.share-with-facebook').is(':checked');
var shareWithGoogle = $('.share-with-google').is(':checked');
var shareWithTwitter = $('.share-with-twitter').is(':checked');
if(!shareWithFacebook && !shareWithGoogle && !shareWithTwitter) {
$('.share-options').addClass('error')
}
}
function registerEvents(onOff) {
$('#dialog-share-button').unbind('click').click(function(e){
socialShare();
return false;
});
if (onOff) {
}
@ -146,6 +161,7 @@
}
function beforeShow() {
$('.share-with-selectors').removeClass('error');
registerEvents(true);
}

View File

@ -192,3 +192,25 @@ img.space {
-moz-border-radius:18px;
border-radius:18px;
}
.share-options {
.error-msg {
display:none;
margin-top:10px;
text-align:center;
color:#F00;
font-size:11px;
}
}
.share-options.error {
background-color: #330000;
border: 1px solid #990000;
padding:4px;
}
.error-msg {
display:block;
}
}

View File

@ -7,20 +7,21 @@
<tr>
<td valign="top" width="45%" class="border-right"><h3 class="mb5">Share to Social Media:</h3>
<textarea class="w95" rows="3">Add a Message...</textarea><br />
<div class="left">
<div class="left share-options">
<input type="checkbox" />
<%= image_tag "content/icon_facebook.png", :size => "24x24", :align => "absmiddle", :alt => "", :style => "vertical-align:middle" %>&nbsp;
<%= image_tag "content/icon_facebook.png", :size => "24x24", :align => "absmiddle", :alt => "", :style => "vertical-align:middle", :class => "share-with-facebook" %>&nbsp;
<input type="checkbox" />
<%= image_tag "content/icon_twitter.png", :size => "24x24", :align => "absmiddle", :alt => "", :style => "vertical-align:middle" %>&nbsp;
<%= image_tag "content/icon_twitter.png", :size => "24x24", :align => "absmiddle", :alt => "", :style => "vertical-align:middle", :class => "share-with-twitter" %>&nbsp;
<input type="checkbox" />
<%= image_tag "content/icon_google.png", :size => "24x24", :align => "absmiddle", :alt => "", :style => "vertical-align:middle" %>&nbsp;
<%= image_tag "content/icon_google.png", :size => "24x24", :align => "absmiddle", :alt => "", :style => "vertical-align:middle", :class => "share-with-google" %>&nbsp;
<div class="error-msg"
</div>
<div class=" right mr10 mt5"><a class="button-orange" id="dialog-share-button">SHARE</a></div>
</td>
<td valign="top" width="48%">
<div class="ml10">
<h3>Share a Link:</h3><br />
<% unless true # share_token.blank? %>
<% unless # share_token.blank? %>
<%= "#{root_url}#{share_token}" %>
<% end %>
<div class="right"><a class="button-orange">COPY LINK</a></div>