Browse Source

Addcoin GUI elements added

master
Satinder Grewal 8 years ago
parent
commit
ac804020eb
  1. 6
      assets/global/js/components/jquery-labelauty.min.js
  2. BIN
      assets/global/vendor/jquery-labelauty/images/input-checked.png
  3. BIN
      assets/global/vendor/jquery-labelauty/images/input-unchecked.png
  4. 240
      assets/global/vendor/jquery-labelauty/jquery-labelauty.js
  5. 1
      assets/global/vendor/jquery-labelauty/jquery-labelauty.min.css
  6. 1
      assets/scripts/dashboard.js
  7. 7
      assets/scripts/iguana_api.js
  8. 67
      index.html

6
assets/global/js/components/jquery-labelauty.min.js

@ -0,0 +1,6 @@
/*!
* remark (http://getbootstrapadmin.com/remark)
* Copyright 2016 amazingsurge
* Licensed under the Themeforest Standard Licenses
*/
$.components.register("labelauty",{mode:"default",defaults:{same_width:!0}});

BIN
assets/global/vendor/jquery-labelauty/images/input-checked.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

BIN
assets/global/vendor/jquery-labelauty/images/input-unchecked.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

240
assets/global/vendor/jquery-labelauty/jquery-labelauty.js

@ -0,0 +1,240 @@
/*!
* LABELAUTY jQuery Plugin
*
* @file: jquery-labelauty.js
* @author: Francisco Neves (@fntneves)
* @site: www.francisconeves.com
* @license: MIT License
*/
(function( $ ){
$.fn.labelauty = function( options )
{
/*
* Our default settings
* Hope you don't need to change anything, with these settings
*/
var settings = $.extend(
{
// Development Mode
// This will activate console debug messages
development: false,
// Trigger Class
// This class will be used to apply styles
class: "labelauty",
// Use text label ?
// If false, then only an icon represents the input
label: true,
// Separator between labels' messages
// If you use this separator for anything, choose a new one
separator: "|",
// Default Checked Message
// This message will be visible when input is checked
checked_label: "Checked",
// Default UnChecked Message
// This message will be visible when input is unchecked
unchecked_label: "Unchecked",
// Force random ID's
// Replace original ID's with random ID's,
force_random_id: false,
// Minimum Label Width
// This value will be used to apply a minimum width to the text labels
minimum_width: false,
// Use the greatest width between two text labels ?
// If this has a true value, then label width will be the greatest between labels
same_width: true
}, options);
/*
* Let's create the core function
* It will try to cover all settings and mistakes of using
*/
return this.each(function()
{
var $object = $( this );
var use_labels = true;
var labels;
var labels_object;
var input_id;
// Test if object is a check input
// Don't mess me up, come on
if( $object.is( ":checkbox" ) === false && $object.is( ":radio" ) === false )
return this;
// Add "labelauty" class to all checkboxes
// So you can apply some custom styles
$object.addClass( settings.class );
// Get the value of "data-labelauty" attribute
// Then, we have the labels for each case (or not, as we will see)
labels = $object.attr( "data-labelauty" );
use_labels = settings.label;
// It's time to check if it's going to the right way
// Null values, more labels than expected or no labels will be handled here
if( use_labels === true )
{
if( labels == null || labels.length === 0 )
{
// If attribute has no label and we want to use, then use the default labels
labels_object = new Array();
labels_object[0] = settings.unchecked_label;
labels_object[1] = settings.checked_label;
}
else
{
// Ok, ok, it's time to split Checked and Unchecked labels
// We split, by the "settings.separator" option
labels_object = labels.split( settings.separator );
// Now, let's check if exist _only_ two labels
// If there's more than two, then we do not use labels :(
// Else, do some additional tests
if( labels_object.length > 2 )
{
use_labels = false;
debug( settings.development, "There's more than two labels. LABELAUTY will not use labels." );
}
else
{
// If there's just one label (no split by "settings.separator"), it will be used for both cases
// Here, we have the possibility of use the same label for both cases
if( labels_object.length === 1 )
debug( settings.development, "There's just one label. LABELAUTY will use this one for both cases." );
}
}
}
/*
* Let's begin the beauty
*/
// Start hiding ugly checkboxes
// Obviously, we don't need native checkboxes :O
$object.css({ display : "none" });
// We don't need more data-labelauty attributes!
// Ok, ok, it's just for beauty improvement
$object.removeAttr( "data-labelauty" );
// Now, grab checkbox ID Attribute for "label" tag use
// If there's no ID Attribute, then generate a new one
input_id = $object.attr( "id" );
if( settings.force_random_id || input_id == null || input_id.trim() === "")
{
var input_id_number = 1 + Math.floor( Math.random() * 1024000 );
input_id = "labelauty-" + input_id_number;
// Is there any element with this random ID ?
// If exists, then increment until get an unused ID
while( $( input_id ).length !== 0 )
{
input_id_number++;
input_id = "labelauty-" + input_id_number;
debug( settings.development, "Holy crap, between 1024 thousand numbers, one raised a conflict. Trying again." );
}
$object.attr( "id", input_id );
}
// Now, add necessary tags to make this work
// Here, we're going to test some control variables and act properly
$object.after( create( input_id, labels_object, use_labels ) );
// Now, add "min-width" to label
// Let's say the truth, a fixed width is more beautiful than a variable width
if( settings.minimum_width !== false )
$object.next( "label[for=" + input_id + "]" ).css({ "min-width": settings.minimum_width });
// Now, add "min-width" to label
// Let's say the truth, a fixed width is more beautiful than a variable width
if( settings.same_width != false && settings.label == true )
{
var label_object = $object.next( "label[for=" + input_id + "]" );
var unchecked_width = getRealWidth(label_object.find( "span.labelauty-unchecked" ));
var checked_width = getRealWidth(label_object.find( "span.labelauty-checked" ));
if( unchecked_width > checked_width )
label_object.find( "span.labelauty-checked" ).width( unchecked_width );
else
label_object.find( "span.labelauty-unchecked" ).width( checked_width );
}
});
};
/*
* Tricky code to work with hidden elements, like tabs.
* Note: This code is based on jquery.actual plugin.
* https://github.com/dreamerslab/jquery.actual
*/
function getRealWidth( element )
{
var width = 0;
var $target = element;
var style = 'position: absolute !important; top: -1000 !important; ';
$target = $target.clone().attr('style', style).appendTo('body');
width = $target.width(true);
$target.remove();
return width;
}
function debug( debug, message )
{
if( debug && window.console && window.console.log )
window.console.log( "jQuery-LABELAUTY: " + message );
};
function create( input_id, messages_object, label )
{
var block;
var unchecked_message;
var checked_message;
if( messages_object == null )
unchecked_message = checked_message = "";
else
{
unchecked_message = messages_object[0];
// If checked message is null, then put the same text of unchecked message
if( messages_object[1] == null )
checked_message = unchecked_message;
else
checked_message = messages_object[1];
}
if( label == true )
{
block = '<label for="' + input_id + '">' +
'<span class="labelauty-unchecked-image"></span>' +
'<span class="labelauty-unchecked">' + unchecked_message + '</span>' +
'<span class="labelauty-checked-image"></span>' +
'<span class="labelauty-checked">' + checked_message + '</span>' +
'</label>';
}
else
{
block = '<label for="' + input_id + '">' +
'<span class="labelauty-unchecked-image"></span>' +
'<span class="labelauty-checked-image"></span>' +
'</label>';
}
return block;
};
}( jQuery ));

1
assets/global/vendor/jquery-labelauty/jquery-labelauty.min.css

@ -0,0 +1 @@
input.labelauty+label ::-moz-selection{background-color:rgba(255,255,255,0)}input.labelauty+label ::selection{background-color:rgba(255,255,255,0)}input.labelauty+label ::-moz-selection{background-color:rgba(255,255,255,0)}input.labelauty{display:none!important}input.labelauty+label{display:table;padding:10px 12px;margin-bottom:0;font-size:14px;line-height:1;color:#757575;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#eee;border-radius:3px;-webkit-transition:background-color .25s;-moz-transition:background-color .25s;-o-transition:background-color .25s;transition:background-color .25s}input.labelauty+label>span.labelauty-checked,input.labelauty+label>span.labelauty-unchecked{display:inline-block;line-height:16px;vertical-align:bottom}input.labelauty+label>span.labelauty-checked-image,input.labelauty+label>span.labelauty-unchecked-image{display:inline-block;width:16px;height:16px;vertical-align:bottom;background-repeat:no-repeat;background-position:left center;-webkit-transition:background-image .5s linear;-moz-transition:background-image .5s linear;-o-transition:background-image .5s linear;transition:background-image .5s linear}input.labelauty+label>span.labelauty-checked-image+span.labelauty-checked,input.labelauty+label>span.labelauty-unchecked-image+span.labelauty-unchecked{margin-left:7px}input.labelauty:not(:checked):not([disabled])+label:hover{color:#757575;background-color:#e0e0e0}input.labelauty:not(:checked)+label>span.labelauty-checked-image{display:none}input.labelauty:not(:checked)+label>span.labelauty-checked{display:none}input.labelauty:checked+label{color:#fff;background-color:#3949ab}input.labelauty:checked:not([disabled])+label:hover{background-color:#3f51b5}input.labelauty:checked+label>span.labelauty-unchecked-image{display:none}input.labelauty:checked+label>span.labelauty-unchecked{display:none}input.labelauty:checked+label>span.labelauty-checked{display:inline-block}input.labelauty.no-label:checked+label>span.labelauty-checked{display:block}input.labelauty[disabled]+label{opacity:.7}input.labelauty+label>span.labelauty-unchecked-image{background-image:url(images/input-unchecked.png)}input.labelauty+label>span.labelauty-checked-image{background-image:url(images/input-checked.png)}input.to-labelauty+label{min-width:160px}input.to-labelauty-icon+label{display:inline-block;padding:8px 8px}input.to-labelauty-icon+label+span{margin-left:7px}

1
assets/scripts/dashboard.js

@ -329,6 +329,7 @@ function ShowCoinHistory(getData) {
//var show_coin_history = testhistory; //Enable to get history from just test variable.
//console.log(show_coin_history_unspents);
//console.log(show_coin_history_spends);
//console.log(show_coin_history_unspents.length+show_coin_history_spends.length+show_coin_history_spends.length)
//if ( sessionStorage.getItem('PrevHistoryLength_'+getData.vals['coin']) != CoinHistoryData.history.length ) {

7
assets/scripts/iguana_api.js

@ -314,6 +314,13 @@ function Iguana_addcoin(addcoin_data) {
});
}
function ExecuteAddCoinFn() {
var addcoin_selected_mode_val = $("input[name='addcoin_select_mode_mdl']:checked").val();
var addcoin_selected_coinname_code_val = $("option:selected","#addcoin_select_coin_mdl_options").val();
var ExecAddCoinData = {"coin": addcoin_selected_coinname_code_val, "mode": addcoin_selected_mode_val}
Iguana_addcoin(ExecAddCoinData);
}
function Iguana_ServiceUnavailable() {
console.log('Network Error with history api');
toastr.error("Unable to connect with iguana service. 127.0.0.1:7778", "Service Notification")

67
index.html

@ -27,6 +27,7 @@
<link rel="stylesheet" href="assets/global/vendor/intro-js/introjs.min.css">
<link rel="stylesheet" href="assets/global/vendor/slidepanel/slidePanel.min.css">
<!--<link rel="stylesheet" href="assets/global/vendor/flag-icon-css/flag-icon.min.css">-->
<link rel="stylesheet" href="assets/global/vendor/jquery-labelauty/jquery-labelauty.min.css">
<link rel="stylesheet" href="assets/global/vendor/bootstrap-toastr/toastr.min.css">
<link rel="stylesheet" href="assets/global/vendor/bootstrap-select/bootstrap-select.min.css">
<link rel="stylesheet" href="assets/global/vendor/sweetalert2/sweetalert2.min.css">
@ -463,47 +464,57 @@
</div>
</div>
<!-- End Modal -->
<!-- Modal -->
<div class="modal fade modal-3d-sign" id="AddCoinModel" aria-hidden="true"
aria-labelledby="AddCoinModelTitle" role="dialog" tabindex="-1">
</div>
<!-- START ADD COIN DIV -->
<div>
<!-- Modal -->
<div class="modal fade modal-3d-sign" id="exampleGrid" aria-hidden="true" aria-labelledby="exampleGrid" role="dialog" tabindex="-1">
<div class="modal-dialog modal-center modal-lg">
<form class="modal-content" id="send_currency_form">
<!--<div class="modal-header bg-orange-a400 wallet-send-header">
<div class="modal-content">
<div class="modal-header bg-orange-a400 wallet-send-header">
<button type="button" class="close white" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title white" id="SendCoinModelLabel">SEND <span id="mdl_currency_coin">[COIN]</span> <span id="mdl_currency_balance">(Balance)</span> <small class="white" style="font-size: 10px;">STEP 1 of 2</small></h4>
</div>-->
<h4 class="modal-title white">Select Coin to add to EasyDEX</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-lg-12 form-group form-material">
<label class="control-label" for="mdl_currency_sendto">Send To</label>
<input type="text" class="form-control" id="mdl_currency_sendto" name="mdl_currency_sendto" placeholder="Enter [coin] address" autocomplete="off" required/>
</div>
<div class="col-lg-6 form-group form-material">
<label class="control-label" for="mdl_currency_amount" id="mdl_currency_amount_label">[Coin]</label>
<input type="text" class="form-control" id="mdl_currency_amount" name="mdl_currency_amount" placeholder="0.000" autocomplete="off"/>
<div class="col-sm-6" style="text-align: center;">
<div class="form-group col-lg-6 col-md-6 col-sm-6 col-xs-6">
<input type="radio" class="to-labelauty labelauty" name="addcoin_select_mode_mdl" data-plugin="labelauty" id="addcoin_mdl_full_mode" data-labelauty="Full Mode|Full Mode" value="1" checked>
</div>
<div class="col-lg-6 form-group form-material">
<label class="control-label" for="mdl_currency_fee">Fee</label>
<input type="text" class="form-control" id="mdl_currency_fee" name="mdl_currency_fee" placeholder="0.000" autocomplete="off"/>
<div class="form-group col-lg-6 col-md-6 col-sm-6 col-xs-6">
<input type="radio" class="to-labelauty labelauty" name="addcoin_select_mode_mdl" data-plugin="labelauty" id="addcoin_mdl_basilisk_mode" value="0" data-labelauty="Basilisk Mode|Basilisk Mode">
</div>
<div class="col-lg-12">
<span><b>Total:</b>
<span id="mdl_currency_total_value">0.000</span> <span id="mdl_currency_total_coinname">[Coin]</span> <span class="icon glyphicon glyphicon-resize-horizontal"></span> <span id="mdl_currency_total_fiat_value">0.00</span></span>
</div>
<div class="col-sm-4">
<div class="form-group">
<select class="form-control form-material" id="addcoin_select_coin_mdl_options">
<option>-Select-</option>
<option value="BTC">Bitcoin</option>
<option value="BTCD">BitcoinDark</option>
<option value="LTC">Litcoin</option>
<option value="DOGE">Dogecoin</option>
<option value="DGB">Digibyte</option>
<option value="SYS">SysCoin</option>
<option value="MZC">MazaCoin</option>
<option value="UNO">Unobtanium</option>
<option value="ZET">Zetacoin</option>
</select>
</div>
</div>
<div class="col-sm-2" style="text-align: center;">
<button type="button" class="btn btn-primary" data-toggle="modal" data-dismiss="modal" id="mdl_addcoin_done_btn" onclick="ExecuteAddCoinFn()">Add Coin</button>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" onclick="CurrencyMdlBtnClean()">Close</button>
<button type="button" class="btn btn-primary disabled" data-toggle="modal" id="mdl_currency_send_btn">Send</button>
</div>
</form>
</div>
</div>
</div>
<!-- End Modal -->
<button type="button" class="btn btn-info btn-lg btn-block waves-effect waves-light" data-target="#exampleGrid" data-toggle="modal">Add Coin</button>
</div>
<button type="button" class="btn btn-info btn-lg btn-block waves-effect waves-light">Add Coin</button>
<!-- START ADD COIN DIV -->
<!-- END DASHBOARD CONTENT BODY -->
<!-- BEGIN EASYDEX CONTENT BODY -->
@ -554,6 +565,7 @@
<script src="assets/global/vendor/jquery-qrcode/jquery.qrcode.min.js" type="text/javascript"></script>
<script src="assets/global/vendor/clipboard/clipboard.min.js"></script>
<script src="assets/global/vendor/asprogress/jquery-asProgress.min.js"></script>
<script src="assets/global/vendor/jquery-labelauty/jquery-labelauty.js"></script>
<!-- Crypto Dependencies -->
<script src="assets/scripts/wordlist.js" type="text/javascript"></script>
<script src="assets/scripts/passphrasegenerator.js" type="text/javascript"></script>
@ -573,6 +585,7 @@
<script src="assets/global/js/components/switchery.js"></script>
<script src="assets/global/js/components/tabs.js"></script>
<script src="assets/global/js/components/asprogress.min.js"></script>
<script src="assets/global/js/components/jquery-labelauty.min.js"></script>
<script src="assets/scripts/iguana_api.js"></script>
<script src="assets/scripts/login.js"></script>
<script src="assets/scripts/dashboard.js"></script>

Loading…
Cancel
Save