Browse Source

Removed coin tipper scripts. Added basic address and paypal link.

pull/24/head
Teknikode 4 years ago
parent
commit
d8a52a6c79

+ 4
- 20
about/main.php View File

@@ -75,27 +75,11 @@
While we provide these services for free, sadly that doesn't make the cost magically go away. If you think we are doing a great job and would like to say thanks, we would greatly appreciate a small donation so that we can pay the bills! (Or buy some beer)
</p>
<p>
<span id="donate-bitcoin"></span>
<span id="donate-dogecoin"></span>
Bitcoin can be sent to <input type="text" class="form-control" name="bitcoin_address" value="<?php echo $$CONF['']; ?>" readonly>
<br />
PayPal Address: <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MBG93VKQ343P4">admin@teknik.io</a>
</p>
</p>
<script>
$(function() {
$('#donate-bitcoin').coinTipper({
type: 'tip',
currency: 'bitcoin',
iso: 'BTC',
address: '<?php echo $CONF['bitcoin_address']; ?>',
label: 'Teknik Donations'
});
$('#donate-dogecoin').coinTipper({
type: 'tip',
currency: 'dogecoin',
iso: 'DOGE',
address: '<?php echo $CONF['dogecoin_address']; ?>',
label: 'Teknik Donations'
});
});
</script>
</div>
</div>
</div>

+ 0
- 96
templates/default/css/coin.css View File

@@ -1,96 +0,0 @@
/**

Donations welcome:
BTC: 122MeuyZpYz4GSHNrF98e6dnQCXZfHJeGS
LTC: LY1L6M6yG26b4sRkLv4BbkmHhPn8GR5fFm
~ Thank you!

------------

MIT License (MIT)

Copyright (c) 2013 http://coinwidget.com/
Copyright (c) 2013 http://scotty.cc/

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

*/

/* button */
.COINWIDGETCOM_CONTAINER {height:22px;display:inline-block;font-family:arial;line-height:12px;margin-right:5px;}
.COINWIDGETCOM_CONTAINER > span {padding:1px;background:#fff;box-shadow:1px 1px 2px rgba(0,0,0,0.05);border:1px solid #ddd;position:relative;min-height:14px;max-height:14px;min-width:14px;text-align:center;font-size:11px;color:#666;margin-left:7px;border-radius:3px 3px 3px 3px;}
.COINWIDGETCOM_CONTAINER > span:after, .COINWIDGETCOM_CONTAINER > span:before {right: 100%;border: solid transparent;content: " ";height: 0;width: 0;position: absolute;pointer-events: none;}
.COINWIDGETCOM_CONTAINER > span:after {border-color: rgba(255, 255, 255, 0);border-right-color: #fff;border-width: 5px;top: 50%;margin-top: -5px;}
.COINWIDGETCOM_CONTAINER > span:before {border-color: rgba(221, 221, 221, 0);border-right-color: #ddd;border-width: 6px;top: 50%;margin-top: -6px;}
.COINWIDGETCOM_CONTAINER > span,
.COINWIDGETCOM_CONTAINER > a {display:inline-block;vertical-align:middle;height:22px;}
.COINWIDGETCOM_CONTAINER > a {background: #eeeeee;background: -moz-linear-gradient(top, #eeeeee 0%, #fafafa 100%);background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(100%,#fafafa));background: -webkit-linear-gradient(top, #eeeeee 0%,#fafafa 100%);background: -o-linear-gradient(top, #eeeeee 0%,#fafafa 100%);background: -ms-linear-gradient(top, #eeeeee 0%,#fafafa 100%);background: linear-gradient(to bottom, #eeeeee 0%,#fafafa 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#fafafa',GradientType=0 );padding:2px 4px;border:1px solid #ccc;font-size:11px;box-shadow:1px 1px 4px rgba(0,0,0,0.075),inset 1px 1px 0px rgba(255,255,255,0.8);border-radius:2px 2px 2px 2px;}
.COINWIDGETCOM_CONTAINER > a:hover {background: #fafafa;background: -moz-linear-gradient(top, #fafafa 0%, #eeeeee 100%);background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fafafa), color-stop(100%,#eeeeee));background: -webkit-linear-gradient(top, #fafafa 0%,#eeeeee 100%);background: -o-linear-gradient(top, #fafafa 0%,#eeeeee 100%);background: -ms-linear-gradient(top, #fafafa 0%,#eeeeee 100%);background: linear-gradient(to bottom, #fafafa 0%,#eeeeee 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fafafa', endColorstr='#eeeeee',GradientType=0 );}
.COINWIDGETCOM_CONTAINER > a > img,
.COINWIDGETCOM_CONTAINER > a > span {display:inline-block;vertical-align:middle;}
.COINWIDGETCOM_CONTAINER > a > span {margin:0px 3px;color:#444;text-shadow:0px -1px 0px #fff;font-weight:bold;}
.COINWIDGETCOM_CONTAINER > span > img,
.COINWIDGETCOM_CONTAINER > a > img {padding:0px;margin:0px!important;border:0px;}

/* window */
.COINWIDGETCOM_WINDOW {font-family:arial;position:absolute;z-index:99999999998;background:#fff;border:1px solid #ccc;padding:5px 5px 25px 5px;background: #fafafa;background: -moz-linear-gradient(top, #fafafa 0%, #eeeeee 100%);background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fafafa), color-stop(100%,#eeeeee));background: -webkit-linear-gradient(top, #fafafa 0%,#eeeeee 100%);background: -o-linear-gradient(top, #fafafa 0%,#eeeeee 100%);background: -ms-linear-gradient(top, #fafafa 0%,#eeeeee 100%);background: linear-gradient(to bottom, #fafafa 0%,#eeeeee 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fafafa', endColorstr='#eeeeee',GradientType=0 );border-radius:2px 2px 2px 2px;top:90%;left:45%;}

/* window alignments */
.COINWIDGETCOM_WINDOW_BC {box-shadow:0px 3px 4px rgba(0,0,0,0.1),inset 1px 1px 0px #fff;}
.COINWIDGETCOM_WINDOW_BL {box-shadow:3px 3px 4px rgba(0,0,0,0.1),inset 1px 1px 0px #fff;}
.COINWIDGETCOM_WINDOW_BR {box-shadow:3px 3px 4px rgba(0,0,0,0.1),inset 1px 1px 0px #fff;}
.COINWIDGETCOM_WINDOW_AC {box-shadow:0px 3px 4px rgba(0,0,0,0.1),inset 1px 1px 0px #fff;}
.COINWIDGETCOM_WINDOW_AL {box-shadow:3px 3px 4px rgba(0,0,0,0.1),inset 1px 1px 0px #fff;}
.COINWIDGETCOM_WINDOW_AR {box-shadow:3px 3px 4px rgba(0,0,0,0.1),inset 1px 1px 0px #fff;}

.COINWIDGETCOM_WINDOW_BC:after, .COINWIDGETCOM_WINDOW_BC:before {bottom: 100%;border: solid transparent;content: " ";height: 0;width: 0;position: absolute;pointer-events: none;}
.COINWIDGETCOM_WINDOW_BC:after {border-color: rgba(250, 250, 250, 0);border-bottom-color: #fafafa;border-width: 5px;left: 50%;margin-left: -5px;}
.COINWIDGETCOM_WINDOW_BC:before {border-color: rgba(204, 204, 204, 0);border-bottom-color: #ccc;border-width: 6px;left: 50%;margin-left: -6px;}
.COINWIDGETCOM_WINDOW_BL:after, .COINWIDGETCOM_WINDOW_BL:before {bottom: 100%;border: solid transparent;content: " ";height: 0;width: 0;position: absolute;pointer-events: none;}
.COINWIDGETCOM_WINDOW_BL:after {border-color: rgba(250, 250, 250, 0);border-bottom-color: #fafafa;border-width: 5px;left: 10%;margin-left: -5px;}
.COINWIDGETCOM_WINDOW_BL:before {border-color: rgba(204, 204, 204, 0);border-bottom-color: #ccc;border-width: 6px;left: 10%;margin-left: -6px;}
.COINWIDGETCOM_WINDOW_BR:after, .COINWIDGETCOM_WINDOW_BR:before {bottom: 100%;border: solid transparent;content: " ";height: 0;width: 0;position: absolute;pointer-events: none;}
.COINWIDGETCOM_WINDOW_BR:after {border-color: rgba(250, 250, 250, 0);border-bottom-color: #fafafa;border-width: 5px;left: 90%;margin-left: -5px;}
.COINWIDGETCOM_WINDOW_BR:before {border-color: rgba(204, 204, 204, 0);border-bottom-color: #ccc;border-width: 6px;left: 90%;margin-left: -6px;}
.COINWIDGETCOM_WINDOW_AC:after, .COINWIDGETCOM_WINDOW_AC:before {top: 100%;border: solid transparent;content: " ";height: 0;width: 0;position: absolute;pointer-events: none;}
.COINWIDGETCOM_WINDOW_AC:after {border-color: rgba(238, 238, 238, 0);border-top-color: #eeeeee;border-width: 5px;left: 50%;margin-left: -5px;}
.COINWIDGETCOM_WINDOW_AC:before {border-color: rgba(204, 204, 204, 0);border-top-color: #ccc;border-width: 6px;left: 50%;margin-left: -6px;}
.COINWIDGETCOM_WINDOW_AL:after, .COINWIDGETCOM_WINDOW_AL:before {top: 100%;border: solid transparent;content: " ";height: 0;width: 0;position: absolute;pointer-events: none;}
.COINWIDGETCOM_WINDOW_AL:after {border-color: rgba(238, 238, 238, 0);border-top-color: #eeeeee;border-width: 5px;left: 10%;margin-left: -5px;}
.COINWIDGETCOM_WINDOW_AL:before {border-color: rgba(204, 204, 204, 0);border-top-color: #ccc;border-width: 6px;left: 10%;margin-left: -6px;}
.COINWIDGETCOM_WINDOW_AR:after, .COINWIDGETCOM_WINDOW_AR:before {top: 100%;border: solid transparent;content: " ";height: 0;width: 0;position: absolute;pointer-events: none;}
.COINWIDGETCOM_WINDOW_AR:after {border-color: rgba(238, 238, 238, 0);border-top-color: #eeeeee;border-width: 5px;left: 90%;margin-left: -5px;}
.COINWIDGETCOM_WINDOW_AR:before {border-color: rgba(204, 204, 204, 0);border-top-color: #ccc;border-width: 6px;left: 90%;margin-left: -6px;}

/* window elements */
.COINWIDGETCOM_WINDOW > label {font-size:12px;font-weight:bold;color:#444;display:block;width:250px;padding:3px;text-shadow:0px -1px 0px #fff;}
.COINWIDGETCOM_WINDOW > input {padding:4px 3px 4px 20px;border-radius:2px 2px 2px 2px;border:1px solid #ccc;display:block;width:210px;font-size:10px;margin-bottom:5px;}
.COINWIDGETCOM_WINDOW > a.COINWIDGETCOM_CLOSER {position:absolute;top:3px;right:7px;color:#666;font-weight:bold;text-decoration:none;}
.COINWIDGETCOM_WINDOW > a.COINWIDGETCOM_CLOSER:hover {color:#aaa;}
.COINWIDGETCOM_WINDOW > img {position:absolute;border:none;margin:0px;padding:0px;}
.COINWIDGETCOM_WINDOW > a img {border:none;margin:0px;padding:0px;}
.COINWIDGETCOM_WINDOW > a.COINWIDGETCOM_WALLETURI {position:absolute;}
.COINWIDGETCOM_WINDOW > span {float: left;font-size:12px;font-weight:bold;display: block;width: 115px;text-align: left;border: 1px solid #ffeeb3;background: #fff8ef;text-shadow:0px -1px 0px #fffefa;padding: 5px;margin-right: 4px;box-shadow: inset 1px 1px 0px #fff;color:#444!important;}
.COINWIDGETCOM_WINDOW > span.end {margin-right:0px;}
.COINWIDGETCOM_WINDOW > span > small {display:block;font-size:11px;font-weight:normal;}
.COINWIDGETCOM_WINDOW > a.COINWIDGETCOM_CREDITS {position:absolute;bottom:5px;right:5px;font-size:11px;color:#555;text-decoration:none;text-shadow:0px -1px 0px #fff;}
.COINWIDGETCOM_WINDOW > a.COINWIDGETCOM_CREDITS:hover {color:#111;}
.COINWIDGETCOM_WINDOW > img.COINWIDGETCOM_QRCODE {position:absolute;bottom:5px;left:6px;}
.COINWIDGETCOM_WINDOW > img.COINWIDGETCOM_QRCODE_LARGE {position:absolute;bottom:5px;left:30px;display:none;border:1px solid #333;border-radius:4px;z-index:99999999;box-shadow:0px 0px 8px rgba(0,0,0,0.5);}


+ 0
- 1
templates/default/css/jquery.cointipper.min.css
File diff suppressed because it is too large
View File


+ 1
- 3
templates/default/header.php View File

@@ -35,9 +35,7 @@
case "admin":
array_push($jsFiles, 'admin.js');
break;
case "about":
array_push($cssFiles, 'jquery.cointipper.min.css');
array_push($jsFiles, 'jquery/jquery.cointipper.js');
case "about":
break;
case "blog":
array_push($cssFiles, 'bootstrap-markdown.min.css');

+ 0
- 324
templates/default/js/coin/coin.js View File

@@ -1,324 +0,0 @@
/**

Donations welcome:
BTC: 122MeuyZpYz4GSHNrF98e6dnQCXZfHJeGS
LTC: LY1L6M6yG26b4sRkLv4BbkmHhPn8GR5fFm
~ Thank you!

------------

MIT License (MIT)

Copyright (c) 2013 http://coinwidget.com/
Copyright (c) 2013 http://scotty.cc/

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

*/

if (typeof CoinWidgetComCounter != 'number')
var CoinWidgetComCounter = 0;

if (typeof CoinWidgetCom != 'object')
var CoinWidgetCom = {
source: 'http://api.teknik.io/'
, config: []
, go :function(config) {
config = CoinWidgetCom.validate(config);
CoinWidgetCom.config[CoinWidgetComCounter] = config;
CoinWidgetCom.init();
document.write('<span data-coinwidget-instance="'+CoinWidgetComCounter+'" class="COINWIDGETCOM_CONTAINER"></span>');
CoinWidgetComCounter++;
}
, validate: function(config) {
var $accepted = [];
$accepted['currencies'] = ['bitcoin','litecoin','dogecoin'];
$accepted['counters'] = ['count','amount','hide'];
$accepted['alignment'] = ['al','ac','ar','bl','bc','br'];
if (!config.currency || !CoinWidgetCom.in_array(config.currency,$accepted['currencies']))
config.currency = 'bitcoin';
if (!config.counter || !CoinWidgetCom.in_array(config.counter,$accepted['counters']))
config.counter = 'count';
if (!config.alignment || !CoinWidgetCom.in_array(config.alignment,$accepted['alignment']))
config.alignment = 'bl';
if (typeof config.qrcode != 'boolean')
config.qrcode = true;
if (typeof config.auto_show != 'boolean')
config.auto_show = false;
if (!config.wallet_address)
config.wallet_address = 'My '+ config.currency +' wallet_address is missing!';
if (!config.lbl_button)
config.lbl_button = 'Donate';
if (!config.lbl_address)
config.lbl_address = 'My Bitcoin Address:';
if (!config.lbl_count)
config.lbl_count = 'Donation';
if (!config.lbl_amount)
config.lbl_amount = 'BTC';
if (typeof config.decimals != 'number' || config.decimals < 0 || config.decimals > 10)
config.decimals = 4;
if (!config.imgSource)
config.imgSource = 'img';
if (!config.jsSource)
config.jsSource = 'js';
if (!config.cssSource)
config.cssSource = 'css';
if (!config.phpSource)
config.phpSource = 'php';

return config;
}
, init: function(){
$(window).resize(function(){
CoinWidgetCom.window_resize();
});
setTimeout(function(){
/* this delayed start gives the page enough time to
render multiple widgets before pinging for counts.
*/
CoinWidgetCom.build();
},800);
}
, build: function(){
$containers = $("span[data-coinwidget-instance]");
$containers.each(function(i,v){
$config = CoinWidgetCom.config[$(this).attr('data-coinwidget-instance')];
$counter = $config.counter == 'hide'?'':('<span><img src="'+$config.imgSource+'icon_loading.gif" width="13" height="13" /></span>');
$button = '<a class="COINWIDGETCOM_BUTTON_'+$config.currency.toUpperCase()+'" href="#"><img src="'+$config.imgSource+'icon_'+$config.currency+'.png" /><span>'+$config.lbl_button+'</span></a>'+$counter;
$(this).html($button);
$(this).find('> a').unbind('click').click(function(e){
e.preventDefault();
CoinWidgetCom.show(this);
});
});
CoinWidgetCom.counters();
}
, window_resize: function(){
$.each(CoinWidgetCom.config,function(i,v){
CoinWidgetCom.window_position(i);
});
}
, window_position: function($instance){
$config = CoinWidgetCom.config[$instance];
coin_window = "#COINWIDGETCOM_WINDOW_"+$instance;

obj = "span[data-coinwidget-instance='"+$instance+"'] > a";
/* to make alignment relative to the full width of the container instead
of just the button change this occurence of $(obj) to $(obj).parent(),
do the same for the occurences within the switch statement. */
$pos = $(obj).offset();
switch ($config.alignment) {
default:
case 'al': /* above left */
$top = $pos.top - $(coin_window).outerHeight() - 10;
$left = $pos.left;
break;
case 'ac': /* above center */
$top = $pos.top - $(coin_window).outerHeight() - 10;
$left = $pos.left + ($(obj).outerWidth()/2) - ($(coin_window).outerWidth()/2);
break;
case 'ar': /* above right */
$top = $pos.top - $(coin_window).outerHeight() - 10;
$left = $pos.left + $(obj).outerWidth() - $(coin_window).outerWidth();
break;
case 'bl': /* bottom left */
$top = $pos.top + $(obj).outerHeight() + 10;
$left = $pos.left;
break;
case 'bc': /* bottom center */
$top = $pos.top + $(obj).outerHeight() + 10;
$left = $pos.left + ($(obj).outerWidth()/2) - ($(coin_window).outerWidth()/2);
break;
case 'br': /* bottom right */
$top = $pos.top + $(obj).outerHeight() + 10;
$left = $pos.left + $(obj).outerWidth() - $(coin_window).outerWidth();
break;
}
if ($(coin_window).is(':visible')) {
$(coin_window).stop().animate({'z-index':99999999999,'top':$top,'left':$left},150);
} else {
$(coin_window).stop().css({'z-index':99999999998,'top':$top,'left':$left});
}
}
, counter: []
, counters: function(){
$addresses = [];
$.each(CoinWidgetCom.config,function(i,v){
$instance = i;
$config = v;
if ($config.counter != 'hide')
$addresses.push($instance+'_'+$config.currency+'_'+$config.wallet_address);
else {
if ($config.auto_show)
$("span[data-coinwidget-instance='"+i+"']").find('> a').click();
}
});
if ($addresses.length) {
CoinWidgetCom.loader.script({
id: 'COINWIDGETCOM_INFO'+Math.random()
, source: ($config.phpSource+'lookup.php?data='+$addresses.join('|'))
, callback: function(){
if (typeof COINWIDGETCOM_DATA == 'object') {
CoinWidgetCom.counter = COINWIDGETCOM_DATA;
$.each(CoinWidgetCom.counter,function(i,v){
$config = CoinWidgetCom.config[i];
if (!v.count || v == null) v = {count:0,amount:0};
$("span[data-coinwidget-instance='"+i+"']").find('> span').html($config.counter=='count'?v.count:(v.amount.toFixed($config.decimals)+' '+$config.lbl_amount));
if ($config.auto_show) {
$("span[data-coinwidget-instance='"+i+"']").find('> a').click();
}
});
}
if ($("span[data-coinwidget-instance] > span img").length > 0) {
setTimeout(function(){CoinWidgetCom.counters();},2500);
}
}
});
}
}
, show: function(obj) {
$instance = $(obj).parent().attr('data-coinwidget-instance');
$config = CoinWidgetCom.config[$instance];
coin_window = "#COINWIDGETCOM_WINDOW_"+$instance;
$(".COINWIDGETCOM_WINDOW").css({'z-index':99999999998});
if (!$(coin_window).length) {

$sel = !navigator.userAgent.match(/iPhone/i)?'onclick="this.select();"':'onclick="prompt(\'Select all and copy:\',\''+$config.wallet_address+'\');"';

$html = ''
+ '<label>'+$config.lbl_address+'</label>'
+ '<input type="text" readonly '+$sel+' value="'+$config.wallet_address+'" />'
+ '<a class="COINWIDGETCOM_WALLETURI" href="'+$config.currency.toLowerCase()+':'+$config.wallet_address+'" target="_blank" title="Click here to send this address to your wallet (if your wallet is not compatible you will get an empty page, close the white screen and copy the address by hand)" ><img src="'+$config.imgSource+'icon_wallet.png" /></a>'
+ '<a class="COINWIDGETCOM_CLOSER" href="javascript:;" onclick="CoinWidgetCom.hide('+$instance+');" title="Close this window">x</a>'
+ '<img class="COINWIDGET_INPUT_ICON" src="'+$config.imgSource+'icon_'+$config.currency+'.png" width="16" height="16" title="This is a '+$config.currency+' wallet address." />'
;
if ($config.counter != 'hide') {
$html += '<span class="COINWIDGETCOM_COUNT">0<small>'+$config.lbl_count+'</small></span>'
+ '<span class="COINWIDGETCOM_AMOUNT end">0.00<small>'+$config.lbl_amount+'</small></span>'
;
}
if ($config.qrcode) {
$html += '<img class="COINWIDGETCOM_QRCODE" data-coinwidget-instance="'+$instance+'" src="'+$config.imgSource+'icon_qrcode.png" width="16" height="16" />'
+ '<img class="COINWIDGETCOM_QRCODE_LARGE" src="'+$config.imgSource+'icon_qrcode.png" width="111" height="111" />'
;
}
var $div = $('<div></div>');
$('body').append($div);
$div.attr({
'id': 'COINWIDGETCOM_WINDOW_'+$instance
}).addClass('COINWIDGETCOM_WINDOW COINWIDGETCOM_WINDOW_'+$config.currency.toUpperCase()+' COINWIDGETCOM_WINDOW_'+$config.alignment.toUpperCase()).html($html).unbind('click').bind('click',function(){
$(".COINWIDGETCOM_WINDOW").css({'z-index':99999999998});
$(this).css({'z-index':99999999999});
});
if ($config.qrcode) {
$(coin_window).find('.COINWIDGETCOM_QRCODE').bind('mouseenter click',function(){
$config = CoinWidgetCom.config[$(this).attr('data-coinwidget-instance')];
$lrg = $(this).parent().find('.COINWIDGETCOM_QRCODE_LARGE');
if ($lrg.is(':visible')) {
$lrg.hide();
return;
}
$lrg.attr({
src: $config.phpSource +'qr/?address='+$config.wallet_address
}).show();
}).bind('mouseleave',function(){
$lrg = $(this).parent().find('.COINWIDGETCOM_QRCODE_LARGE');
$lrg.hide();
});
}
} else {
if ($(coin_window).is(':visible')) {
CoinWidgetCom.hide($instance);
return;
}
}
CoinWidgetCom.window_position($instance);
$(coin_window).show();
$pos = $(coin_window).find('input').position();
$(coin_window).find('img.COINWIDGET_INPUT_ICON').css({'top':$pos.top+3,'left':$pos.left+3});
$(coin_window).find('.COINWIDGETCOM_WALLETURI').css({'top':$pos.top+3,'left':$pos.left+$(coin_window).find('input').outerWidth()+3});
if ($config.counter != 'hide') {
$counters = CoinWidgetCom.counter[$instance];
if ($counters == null) {
$counters = {
count: 0,
amount: 0
};
}
if ($counters.count == null) $counters.count = 0;
if ($counters.amount == null) $counters.amount = 0;
$(coin_window).find('.COINWIDGETCOM_COUNT').html($counters.count+ '<small>'+$config.lbl_count+'</small>');
$(coin_window).find('.COINWIDGETCOM_AMOUNT').html($counters.amount.toFixed($config.decimals)+ '<small>'+$config.lbl_amount+'</small>');
}
if (typeof $config.onShow == 'function')
$config.onShow();
}
, hide: function($instance) {
$config = CoinWidgetCom.config[$instance];
coin_window = "#COINWIDGETCOM_WINDOW_"+$instance;
$(coin_window).fadeOut();
if (typeof $config.onHide == 'function') {
$config.onHide();
}
}
, in_array: function(needle,haystack) {
for (i=0;i<haystack.length;i++) {
if (haystack[i] == needle) {
return true;
}
}
return false;
}
, loader: {
loading_jquery: false,
script: function(obj){
if (!document.getElementById(obj.id)) {
var x = document.createElement('script');
x.onreadystatechange = function(){
switch (this.readyState) {
case 'complete':
case 'loaded':
obj.callback();
break;
}
};
x.onload = function(){
obj.callback();
};
x.src = obj.source;
x.id = obj.id;
document.lastChild.firstChild.appendChild(x);
}
}
, jquery: function(){
if (!window.jQuery && !CoinWidgetCom.loader.loading_jquery) {
$prefix = window.location.protocol=='file:'?'http:':'';
CoinWidgetCom.loader.script({
id : 'COINWIDGETCOM_JQUERY'
, source : $prefix + '//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'
, callback : function(){
CoinWidgetCom.init();
}
});
return;
}
CoinWidgetCom.init();
}
}
};

+ 0
- 1771
templates/default/js/jquery/jquery.cointipper-pack.js
File diff suppressed because it is too large
View File


+ 0
- 118
templates/default/js/jquery/jquery.cointipper.js View File

@@ -1,118 +0,0 @@
// ======================
// jQuery.CoinTipper
// ======================

(function ( $ ) {
// Hello .coinTipper();
$.fn.coinTipper = function(options) {
var settings = $.extend({
type: null,
currency: null,
iso: null,
address: null,
label: null
}, options );

button = generateDonationButton(options, this);
return button;
};
}( jQuery ));

function generateDonationButton(options,btn) {
// Get the options passed to .coinTipper()
var type = options.type,
currency = options.currency,
iso = options.iso,
address = options.address,
name = options.label,
label = name.replace(/\s+/g, '+');

// Assign and build HTML

var modal = buildDonateModalHtml(type, currency, iso, address, label, name);
var btnHtml = buildDonateButtonHtml(type, currency);

$(btn).replaceWith(btnHtml);
$('body').append(modal);

// Watch radio buttons and input field for changes.
// Update values on change, and regenerate QR code.

// Watch radio buttons
$('.'+currency+'.modal input[name="donation-option"]').bind('change', function() {
var amount = $(this).attr('value');
generateDonationPayment(currency, address, amount, label, iso);
});

// Watch donation input field
$('.'+currency+'.modal input[name="donation-amount"]').keyup( function() {
var amount = $(this).val();
$('.'+currency+'.modal input[name="donation-option"]').prop('checked', false);
generateDonationPayment(currency, address, amount, label, iso);
});
}

function generateDonationPayment(currency, address, amount, label, iso) {
// Update DOM values, donation URI, and generate QR code.

var uri;

// Label specified?
if (label === undefined) {
uri = currency+":"+address+"?amount="+amount;

} else {
uri = currency+":"+address+"?amount="+amount+"&label="+label;
}

// Replace DOM with new values
$('.'+currency+'.modal input#donation-amount').val(amount);
$('.'+currency+'.modal .span-amount').html(amount + ' ' + iso).css('font-weight','bold');
$('.'+currency+'.modal .span-uri').attr('href',uri);
$('.'+currency+'.modal #qrcode').html('').wrap('<a href="'+uri+'"></a>');
$('.'+currency+'.modal #qrcode').qrcode({
width: 170,
height: 170,
text: uri
});
}

function buildDonateButtonHtml(type, currency) {
// Build out the donation button
var html = '<a href="" data-toggle="modal" data-target="#'+currency+'-donation-overlay" class="donate-btn '+currency+'">'+type+' '+currency+'</a>';
return html;
}

function buildDonateModalHtml(type, currency, iso, address, label, name) {
// Set the donation amounts for each currency and generate the modal.

var html,
show_options = true,
type = type.charAt(0).toUpperCase() + type.slice(1),
amounts;

// Set donation amounts
if (currency === "bitcoin") {
amounts = Array(0.0005, 0.001, 0.002, 0.003, 0.005);
} else if (currency === "dogecoin") {
amounts = Array(20, 50, 100, 500, 1000);
} else if (currency === "kittehcoin") {
amounts = Array(200, 500, 1000, 5000, 10000);
iso = '<small>'+iso+'</small>';
} else {
// Empty array and hide amount option for new coins
amounts = Array(0,0,0,0,0);
show_options = false;
}

// Generate modal html, using Bootstrap.
// Assign default donation values to supported coins.
// Hide prefilled options for unsupported coins.
if (show_options === true) {
html = '<div id="'+currency+'-donation-overlay" class="modal fade '+currency+'"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title">'+type+' to '+name+'</h4></div><div class="modal-body"><div class="well">'+type+' <input type="text" name="donation-amount" id="donation-amount" size="4" value="" placeholder="'+amounts[0]+'"> '+iso+' to <strong>'+name+'</strong>.</div><table class="donation-options"><td>Amount:</td><td><label class="radio inline"><input id="donation-option-1" name="donation-option" type="radio" value="'+amounts[0]+'">'+amounts[0]+' '+iso+'</label></td><td><label class="radio inline"><input id="donation-option-2" name="donation-option" type="radio" value="'+amounts[1]+'">'+amounts[1]+' '+iso+'</label></td><td><label class="radio inline"><input id="donation-option-3" name="donation-option" type="radio" value="'+amounts[2]+'">'+amounts[2]+' '+iso+'</label></td><td><label class="radio inline"><input id="donation-option-4" name="donation-option" type="radio" value="'+amounts[3]+'">'+amounts[3]+' '+iso+'</label></td><td><label class="radio inline"><input id="donation-option-5" name="donation-option" type="radio" value="'+amounts[4]+'">'+amounts[4]+' '+iso+'</label></td></table><table class="donation-payment"><td><div id="qrcode"><img src="http://placehold.it/170/ffffff/999999&text=Select amount" alt=""></div></td><td><p>Send <span class="span-amount">selected amount</span> to:</p><input type="text" value="'+address+'" class="span-uri form-control" readonly><br><p>Thank you for your support!</p></td></table></div><div class="modal-footer"><p class="powered-by">Powered by <a href="https://github.com/jeremymouton/cointipper" target="_blank">CoinTipper</a></p><a href="'+currency+':'+address+'?label='+label+'" class="span-uri btn btn-primary">Send with Wallet</a><a class="btn" data-dismiss="modal">Done</a></div></div></div></div>';
} else {
html = '<div id="'+currency+'-donation-overlay" class="modal fade '+currency+'"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title">'+type+' to '+name+'</h4></div><div class="modal-body"><div class="well">'+type+' <input type="text" name="donation-amount" id="donation-amount" size="4" value=""> '+iso+' to <strong>'+name+'</strong>.</div><table class="donation-payment"><td><div id="qrcode"><img src="http://placehold.it/170/ffffff/999999&text=Select amount" alt=""></div></td><td><p>Send <span class="span-amount">selected amount</span> to:</p><input type="text" value="'+address+'" class="span-uri form-control" readonly><br><p>Thank you for your support!</p></td></table></div><div class="modal-footer"><p class="powered-by">Powered by <a href="https://github.com/jeremymouton/cointipper" target="_blank">CoinTipper</a></p><a href="'+currency+':'+address+'?label='+label+'" class="span-uri btn btn-primary">Send with Wallet</a><a class="btn" data-dismiss="modal">Done</a></div></div></div></div>';
}

return html;
}

Loading…
Cancel
Save