Update modal on download inviting user to share
parent
e5c107f64d
commit
c192b2d764
@ -1,127 +0,0 @@
|
|||||||
|
|
||||||
.avgrund-popin {
|
|
||||||
position: absolute;
|
|
||||||
background: #fff;
|
|
||||||
padding: 0px;
|
|
||||||
overflow: hidden;
|
|
||||||
visibility: hidden;
|
|
||||||
opacity: 0;
|
|
||||||
filter: alpha(opacity=0);
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
border-radius: 10px;
|
|
||||||
z-index: 1000;
|
|
||||||
box-shadow: 0 1px 10px 0 rgba(0, 0, 0, .5);
|
|
||||||
|
|
||||||
-webkit-transform: scale(0.8);
|
|
||||||
-moz-transform: scale(0.8);
|
|
||||||
-ms-transform: scale(0.8);
|
|
||||||
-o-transform: scale(0.8);
|
|
||||||
transform: scale(0.8);
|
|
||||||
}
|
|
||||||
|
|
||||||
.avgrund-overlay {
|
|
||||||
background: #000;
|
|
||||||
width: 100%;
|
|
||||||
position: relative;
|
|
||||||
top: -1500px;
|
|
||||||
left: 0;
|
|
||||||
z-index: 101;
|
|
||||||
visibility: hidden;
|
|
||||||
opacity: 0;
|
|
||||||
filter: alpha(opacity=0);
|
|
||||||
}
|
|
||||||
|
|
||||||
body.avgrund-ready,
|
|
||||||
.avgrund-ready .avgrund-popin,
|
|
||||||
.avgrund-ready .avgrund-overlay {
|
|
||||||
-webkit-transform-origin: 50% 50%;
|
|
||||||
-moz-transform-origin: 50% 50%;
|
|
||||||
-ms-transform-origin: 50% 50%;
|
|
||||||
-o-transform-origin: 50% 50%;
|
|
||||||
transform-origin: 50% 50%;
|
|
||||||
|
|
||||||
-webkit-transition: 0.3s all ease-out;
|
|
||||||
-moz-transition: 0.3s all ease-out;
|
|
||||||
-ms-transition: 0.3s all ease-out;
|
|
||||||
-o-transition: 0.3s all ease-out;
|
|
||||||
transition: 0.3s all ease-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.avgrund-active {
|
|
||||||
-webkit-transform: scale(0.9);
|
|
||||||
-moz-transform: scale(0.9);
|
|
||||||
-ms-transform: scale(0.9);
|
|
||||||
-o-transform: scale(0.9);
|
|
||||||
transform: scale(0.9);
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.avgrund-active .avgrund-popin {
|
|
||||||
visibility: visible;
|
|
||||||
opacity: 1;
|
|
||||||
filter: alpha(opacity=100);
|
|
||||||
|
|
||||||
-webkit-transform: scale(1.1);
|
|
||||||
-moz-transform: scale(1.1);
|
|
||||||
-ms-transform: scale(1.1);
|
|
||||||
-o-transform: scale(1.1);
|
|
||||||
transform: scale(1.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.avgrund-active .avgrund-overlay {
|
|
||||||
visibility: visible;
|
|
||||||
opacity: .5;
|
|
||||||
filter: alpha(opacity=50);
|
|
||||||
height: 20000px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.avgrund-popin.stack {
|
|
||||||
-webkit-transform: scale(1.5);
|
|
||||||
-moz-transform: scale(1.5);
|
|
||||||
-ms-transform: scale(1.5);
|
|
||||||
-o-transform: scale(1.5);
|
|
||||||
transform: scale(1.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
.avgrund-active .avgrund-popin.stack {
|
|
||||||
-webkit-transform: scale(1.1);
|
|
||||||
-moz-transform: scale(1.1);
|
|
||||||
-ms-transform: scale(1.1);
|
|
||||||
-o-transform: scale(1.1);
|
|
||||||
transform: scale(1.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.avgrund-active .avgrund-blur {
|
|
||||||
-webkit-filter: blur(1px);
|
|
||||||
-moz-filter: blur(1px);
|
|
||||||
-ms-filter: blur(1px);
|
|
||||||
-o-filter: blur(1px);
|
|
||||||
filter: blur(1px);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Optional close button styles */
|
|
||||||
.avgrund-close {
|
|
||||||
position: absolute;
|
|
||||||
top: 26px;
|
|
||||||
right: 10px;
|
|
||||||
width:25px;
|
|
||||||
height:25px;
|
|
||||||
display:block;
|
|
||||||
text-transform:uppercase;
|
|
||||||
text-decoration:none;
|
|
||||||
color: #A2A2A2;
|
|
||||||
background: #FFF;
|
|
||||||
font-family:"Tahoma", Helvetica, sans-serif;
|
|
||||||
text-align:center;
|
|
||||||
font-size:18px;
|
|
||||||
line-height:1.4em;
|
|
||||||
border-radius:50%;
|
|
||||||
-moz-border-radius:50%;
|
|
||||||
-webkit-border-radius:50%;
|
|
||||||
box-shadow:0px 0px 2px 0px #666;
|
|
||||||
-moz-box-shadow:0px 0px 2px 0px #666;
|
|
||||||
-webkit-box-shadow:0px 0px 2px 0px #666;
|
|
||||||
text-indent:1px;
|
|
||||||
font-weight:bold;
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
<?php
|
|
||||||
class shareCount {
|
|
||||||
private $url,$timeout;
|
|
||||||
function __construct($url,$timeout=10) {
|
|
||||||
$this->url=rawurlencode($url);
|
|
||||||
$this->timeout=$timeout;
|
|
||||||
}
|
|
||||||
function get_tweets() {
|
|
||||||
$json_string = $this->file_get_contents_curl('http://urls.api.twitter.com/1/urls/count.json?url=' . $this->url);
|
|
||||||
$json = json_decode($json_string, true);
|
|
||||||
return isset($json['count'])?intval($json['count']):0;
|
|
||||||
}
|
|
||||||
function get_fb() {
|
|
||||||
$json_string = $this->file_get_contents_curl('http://api.facebook.com/restserver.php?method=links.getStats&format=json&urls='.$this->url);
|
|
||||||
$json = json_decode($json_string, true);
|
|
||||||
return isset($json[0]['total_count'])?intval($json[0]['total_count']):0;
|
|
||||||
}
|
|
||||||
function get_plusones() {
|
|
||||||
$curl = curl_init();
|
|
||||||
curl_setopt($curl, CURLOPT_URL, "https://clients6.google.com/rpc");
|
|
||||||
curl_setopt($curl, CURLOPT_POST, true);
|
|
||||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
|
||||||
curl_setopt($curl, CURLOPT_POSTFIELDS, '[{"method":"pos.plusones.get","id":"p","params":{"nolog":true,"id":"'.rawurldecode($this->url).'","source":"widget","userId":"@viewer","groupId":"@self"},"jsonrpc":"2.0","key":"p","apiVersion":"v1"}]');
|
|
||||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
|
|
||||||
$curl_results = curl_exec ($curl);
|
|
||||||
curl_close ($curl);
|
|
||||||
$json = json_decode($curl_results, true);
|
|
||||||
return isset($json[0]['result']['metadata']['globalCounts']['count'])?intval( $json[0]['result']['metadata']['globalCounts']['count'] ):0;
|
|
||||||
}
|
|
||||||
private function file_get_contents_curl($url){
|
|
||||||
$ch=curl_init();
|
|
||||||
curl_setopt($ch, CURLOPT_URL, $url);
|
|
||||||
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
|
|
||||||
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
|
|
||||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
|
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
|
|
||||||
$cont = curl_exec($ch);
|
|
||||||
if(curl_error($ch)){
|
|
||||||
die(curl_error($ch));
|
|
||||||
}
|
|
||||||
return $cont;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
@ -1,142 +0,0 @@
|
|||||||
/**
|
|
||||||
* jQuery Avgrund Popin Plugin
|
|
||||||
* http://github.com/voronianski/jquery.avgrund.js/
|
|
||||||
*
|
|
||||||
* (c) 2012-2013 http://pixelhunter.me/
|
|
||||||
* MIT licensed
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function (factory) {
|
|
||||||
if (typeof define === 'function' && define.amd) {
|
|
||||||
// AMD
|
|
||||||
define(['jquery'], factory);
|
|
||||||
} else if (typeof exports === 'object') {
|
|
||||||
// CommonJS
|
|
||||||
module.exports = factory;
|
|
||||||
} else {
|
|
||||||
// Browser globals
|
|
||||||
factory(jQuery);
|
|
||||||
}
|
|
||||||
}(function ($) {
|
|
||||||
$.fn.avgrund = function (options) {
|
|
||||||
var defaults = {
|
|
||||||
width: 600, // max = 640
|
|
||||||
height: 350, // max = 350
|
|
||||||
showClose: false,
|
|
||||||
showCloseText: '',
|
|
||||||
closeByEscape: true,
|
|
||||||
closeByDocument: true,
|
|
||||||
holderClass: '',
|
|
||||||
overlayClass: '',
|
|
||||||
enableStackAnimation: false,
|
|
||||||
onBlurContainer: '',
|
|
||||||
openOnEvent: true,
|
|
||||||
setEvent: 'click',
|
|
||||||
onLoad: false,
|
|
||||||
onUnload: false,
|
|
||||||
template: '<p>This is test popin content!</p>'
|
|
||||||
};
|
|
||||||
|
|
||||||
options = $.extend(defaults, options);
|
|
||||||
|
|
||||||
return this.each(function() {
|
|
||||||
var self = $(this),
|
|
||||||
body = $('body'),
|
|
||||||
maxWidth = options.width > 640 ? 640 : options.width,
|
|
||||||
maxHeight = options.height > 350 ? 350 : options.height,
|
|
||||||
template = typeof options.template === 'function' ? options.template(self) : options.template;
|
|
||||||
|
|
||||||
body.addClass('avgrund-ready');
|
|
||||||
|
|
||||||
if ($('.avgrund-overlay').length === 0) {
|
|
||||||
body.append('<div class="avgrund-overlay ' + options.overlayClass + '"></div>');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.onBlurContainer !== '') {
|
|
||||||
$(options.onBlurContainer).addClass('avgrund-blur');
|
|
||||||
}
|
|
||||||
|
|
||||||
function onDocumentKeyup (e) {
|
|
||||||
if (options.closeByEscape) {
|
|
||||||
if (e.keyCode === 27) {
|
|
||||||
deactivate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onDocumentClick (e) {
|
|
||||||
if (options.closeByDocument) {
|
|
||||||
if ($(e.target).is('.avgrund-overlay, .avgrund-close')) {
|
|
||||||
e.preventDefault();
|
|
||||||
deactivate();
|
|
||||||
}
|
|
||||||
} else if ($(e.target).is('.avgrund-close')) {
|
|
||||||
e.preventDefault();
|
|
||||||
deactivate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function activate () {
|
|
||||||
if (typeof options.onLoad === 'function') {
|
|
||||||
options.onLoad(self);
|
|
||||||
}
|
|
||||||
|
|
||||||
setTimeout(function() {
|
|
||||||
body.addClass('avgrund-active');
|
|
||||||
}, 100);
|
|
||||||
|
|
||||||
var $popin = $('<div class="avgrund-popin ' + options.holderClass + '"></div>');
|
|
||||||
$popin.append(template);
|
|
||||||
body.append($popin);
|
|
||||||
|
|
||||||
$('.avgrund-popin').css({
|
|
||||||
'width': maxWidth + 'px',
|
|
||||||
'height': maxHeight + 'px',
|
|
||||||
'margin-left': '-' + (maxWidth / 2 + 10) + 'px',
|
|
||||||
'margin-top': '-' + (maxHeight / 2 + 10) + 'px'
|
|
||||||
});
|
|
||||||
$("#modal_popup").css('display', 'block');
|
|
||||||
if (options.showClose) {
|
|
||||||
$('.avgrund-popin').append('<a href="#" class="avgrund-close">' + options.showCloseText + '</a>');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.enableStackAnimation) {
|
|
||||||
$('.avgrund-popin').addClass('stack');
|
|
||||||
}
|
|
||||||
|
|
||||||
body.bind('keyup', onDocumentKeyup)
|
|
||||||
.bind('click', onDocumentClick);
|
|
||||||
}
|
|
||||||
|
|
||||||
function deactivate () {
|
|
||||||
body.unbind('keyup', onDocumentKeyup)
|
|
||||||
.unbind('click', onDocumentClick)
|
|
||||||
.removeClass('avgrund-active');
|
|
||||||
|
|
||||||
setTimeout(function() {
|
|
||||||
|
|
||||||
$("#modal_popup").css('display', 'noce');
|
|
||||||
$('.avgrund-popin').remove();
|
|
||||||
}, 500);
|
|
||||||
|
|
||||||
if (typeof options.onUnload === 'function') {
|
|
||||||
options.onUnload(self);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.openOnEvent) {
|
|
||||||
self.bind(options.setEvent, function (e) {
|
|
||||||
e.stopPropagation();
|
|
||||||
|
|
||||||
if ($(e.target).is('a')) {
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
activate();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
activate();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}));
|
|
Loading…
Reference in New Issue