forked from bradvin/social-share-urls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerator.htm
51 lines (46 loc) · 2.06 KB
/
generator.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
<!DOCTYPE html>
<html>
<head>
<title>Social Network Link Generator</title>
<script src="http://cdn.jsdelivr.net/zepto/1.0rc1/zepto.min.js" type="text/javascript"></script>
<script src="generator.js" type="text/javascript"></script>
<link rel="stylesheet" href="font.css">
</head>
<body>
<h1>Social Link Generator</h1>
URL : <input type="input" id="input_url" value="http://fooplugins.com" /><br />
Image : <input type="input" id="input_img" value="http://fooplugins.com/wp-content/uploads/2013/04/FooBot-YouTube-800.png" /><br />
Title : <input type="input" id="input_title" value="FooPlugins - a jQuery and WordPress Plugin MarketPlace" /><br />
Description : <input type="input" id="input_desc" value="We sell free and premium plugins written in jQuery and WordPress" /><br />
FaceBook App Id : <input type="input" id="input_app_id" value="215402498629351" /><br />
FaceBook Redirect Url : <input type="input" id="input_redirect_url" value="http://fooplugins.com/" /><br />
Twitter Via : <input type="input" id="input_via" value="fooplugins" /><br />
Twitter Hastags : <input type="input" id="input_hashtags" value="jQuery,WordPress" /><br />
<input id="btn_generate" type="button" value="Generate" />
<div id="share_target" class="social_links"></div>
<script>
$(function() {
$('#btn_generate').on('click', function(e) {
var params = {
url: $('#input_url').val(),
img: $('#input_img').val(),
title: $('#input_title').val(),
desc: $('#input_desc').val(),
redirect_url: $('#input_redirect_url').val(),
app_id: $('#input_app_id').val(),
via: $('#input_via').val(),
hashtags: $('#input_hashtags').val()
},
links = SocialShare.generateSocialUrls(params),
$target = $('#share_target');
$target.html(''); //clear!
for (var i = 0; i < links.length; i++) {
var link = links[i];
$target.append('<a class="soc ' + link.class + '" target="_blank" href="' + link.url + '" title="' + link.name + '"></a>');
}
$target.find('a').on('click', SocialShare.doPopup);
});
});
</script>
</body>
</html>