Skip to content

Commit d7fba8a

Browse files
committed
restructuring and html templating
1 parent 9fc24a6 commit d7fba8a

File tree

105 files changed

+1276
-613
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+1276
-613
lines changed

api/index.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
header("Content-Type: application/json");
33
header("Access-Control-Allow-Headers: Cache-Control, Pragma");
4+
//header("Access-Control-Allow-Origin: *"); // uncomment for nginx
45

56
include ("keys.php");
67
include ("api.php");
File renamed without changes.

assets/js/bitrequest_bip39.js assets_js_bitrequest_bip39.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1620,19 +1620,19 @@ function phrase_info_pu(coin) {
16201620
var platform = getplatform(getdevicetype()),
16211621
store_icon = (platform == "playstore") ? "button-playstore-v2.svg" :
16221622
(platform == "appstore") ? "button-appstore.svg" : "button-desktop_app.svg",
1623-
store_tag = (store_icon) ? "<img src='img/" + store_icon + "'/>" : "<span class='icon-download'></span> ",
1623+
store_tag = (store_icon) ? "<img src='img_" + store_icon + "'/>" : "<span class='icon-download'></span> ",
16241624
wallets = walletdat.wallets;
16251625
$.each(wallets, function(key, value) {
16261626
var device_url = value[platform];
16271627
if (device_url && value.seed === true) {
16281628
var walletname = value.name,
16291629
website = value.website,
1630-
wallet_icon = "<img src='img/icons/wallet-icons/" + walletname + ".png' class='wallet_icon'/>";
1630+
wallet_icon = "<img src='img_icons_wallet-icons_" + walletname + ".png' class='wallet_icon'/>";
16311631
walletlist += "<li><a href='" + website + "' target='_blank' class='exit app_dll'>" + wallet_icon + walletname + "</a><a href='" + device_url + "' target='_blank' class='exit store_tag'>" + store_tag + "</a></li>";
16321632
}
16331633
});
16341634
}
1635-
var icon_node = $("<img src='img/logos/" + ccsymbol + "-" + currency + ".png' data-class='pd_" + currency + "'/>"),
1635+
var icon_node = $("<img src='img_logos_" + ccsymbol + "-" + currency + ".png' data-class='pd_" + currency + "'/>"),
16361636
dp_node_dat = {
16371637
"bip32": bip32dat,
16381638
"currency": currency
@@ -1656,7 +1656,7 @@ function phrase_info_pu(coin) {
16561656
<div class='show_xpub'><strong>Xpub: </strong><span class='xpref ref'>show</span></div>\
16571657
<div class='xp_span drawer'>\
16581658
<div class='qrwrap flex'>\
1659-
<div class='qrcode'></div><img src='img/logos/" + ccsymbol + "-" + currency + ".png' class='cmc_icon'>\
1659+
<div class='qrcode'></div><img src='img_logos_" + ccsymbol + "-" + currency + ".png' class='cmc_icon'>\
16601660
</div>\
16611661
<p class='adbox adboxl select' data-type='Xpub'>" + x_pub + "</p>\
16621662
</div>\
@@ -1700,19 +1700,19 @@ function compatible_wallets(coin) {
17001700
var platform = getplatform(getdevicetype()),
17011701
store_icon = (platform == "playstore") ? "button-playstore-v2.svg" :
17021702
(platform == "appstore") ? "button-appstore.svg" : "button-desktop_app.svg",
1703-
store_tag = (store_icon) ? "<img src='img/" + store_icon + "'/>" : "<span class='icon-download'></span> ",
1703+
store_tag = (store_icon) ? "<img src='img_" + store_icon + "'/>" : "<span class='icon-download'></span> ",
17041704
wallets = walletdat.wallets;
17051705
$.each(wallets, function(key, value) {
17061706
var device_url = value[platform];
17071707
if (device_url && value.seed === true) {
17081708
var walletname = value.name,
17091709
website = value.website,
1710-
wallet_icon = "<img src='img/icons/wallet-icons/" + walletname + ".png' class='wallet_icon'/>";
1710+
wallet_icon = "<img src='img_icons_wallet-icons_" + walletname + ".png' class='wallet_icon'/>";
17111711
walletlist += "<li><a href='" + website + "' target='_blank' class='exit app_dll'>" + wallet_icon + walletname + "</a><a href='" + device_url + "' target='_blank' class='exit store_tag'>" + store_tag + "</a></li>";
17121712
}
17131713
});
17141714
}
1715-
var icon_node = $("<img src='img/logos/" + ccsymbol + "-" + currency + ".png' data-class='pd_" + currency + "'/>"),
1715+
var icon_node = $("<img src='img_logos_" + ccsymbol + "-" + currency + ".png' data-class='pd_" + currency + "'/>"),
17161716
sw_node = $("<ul id='formbox_ul' class='clearfix pd_hide pd_" + currency + "'>" + walletlist + "</ul>");
17171717
$("#pi_icons").append(icon_node);
17181718
$("#supported_wallets").append(sw_node);

assets/js/bitrequest_coin_settings.js assets_js_bitrequest_coin_settings.js

+111-74
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ $(document).ready(function() {
5252
trigger_apikey();
5353
//add_apikey;
5454
submit_apikey();
55+
56+
reset_coinsettings();
57+
//reset_coinsettings_function
5558
});
5659

5760
// ** Currency Settings **
@@ -63,65 +66,46 @@ function edit_confirmations() {
6366
thiscurrency = thistrigger.attr("data-currency"),
6467
thisli = thistrigger.closest("li"),
6568
confsrc = thisli.data("selected"),
66-
content = "<div class='formbox' id='conf_formbox'>\
67-
<h2 class='icon-clock'>Confirmations</h2>\
68-
<div class='popnotify'></div>\
69-
<ul class='conf_options noselect'>\
70-
<li>\
71-
<div class='pick_conf'>\
72-
<div class='radio icon-radio-unchecked'></div>\
73-
<span>0</span>\
74-
<div class='conf_emoji'>☕</div>\
75-
</div>\
76-
</li>\
77-
<li>\
78-
<div class='pick_conf'>\
79-
<div class='radio icon-radio-unchecked'></div>\
80-
<span>1</span>\
81-
<div class='conf_emoji'>🍷 🍽</div>\
82-
</div>\
83-
</li>\
84-
<li>\
85-
<div class='pick_conf'>\
86-
<div class='radio icon-radio-unchecked'></div>\
87-
<span>2</span>\
88-
<div class='conf_emoji'>📱</div>\
89-
</div>\
90-
</li>\
91-
<li>\
92-
<div class='pick_conf'>\
93-
<div class='radio icon-radio-unchecked'></div>\
94-
<span>3</span>\
95-
<div class='conf_emoji'>🖥</div>\
96-
</div>\
97-
</li>\
98-
<li>\
99-
<div class='pick_conf'>\
100-
<div class='radio icon-radio-unchecked'></div>\
101-
<span>4</span>\
102-
<div class='conf_emoji'>🚗</div>\
103-
</div>\
104-
</li>\
105-
<li>\
106-
<div class='pick_conf'>\
107-
<div class='radio icon-radio-unchecked'></div>\
108-
<span>5</span>\
109-
<div class='conf_emoji'>🏠</div>\
110-
</div>\
111-
</li>\
112-
<li>\
113-
<div class='pick_conf'>\
114-
<div class='radio icon-radio-unchecked'></div>\
115-
<span>6</span>\
116-
<div class='conf_emoji'>🛥 💎</div>\
117-
</div>\
118-
</li>\
119-
</ul>\
120-
<div class='popform'>\
121-
<input type='hidden' value='" + confsrc + "'/>\
122-
<input type='submit' class='submit' value='OK' data-currency='" + thiscurrency + "'/>\
123-
</div>\
124-
</div>";
69+
ddat = [{
70+
"ul": {
71+
"class": "conf_options noselect",
72+
"content": "<li><div class='pick_conf'><div class='radio icon-radio-unchecked'></div><span>0</span><div class='conf_emoji'>☕</div></div></li>\
73+
<li><div class='pick_conf'><div class='radio icon-radio-unchecked'></div><span>1</span><div class='conf_emoji'>🍷 🍽</div></div></li>\
74+
<li><div class='pick_conf'><div class='radio icon-radio-unchecked'></div><span>2</span><div class='conf_emoji'>📱</div></div></li>\
75+
<li><div class='pick_conf'><div class='radio icon-radio-unchecked'></div><span>3</span><div class='conf_emoji'>🖥</div></div></li>\
76+
<li><div class='pick_conf'><div class='radio icon-radio-unchecked'></div><span>4</span><div class='conf_emoji'>🚗</div></div></li>\
77+
<li><div class='pick_conf'><div class='radio icon-radio-unchecked'></div><span>5</span><div class='conf_emoji'>🏠</div></div></li>\
78+
<li><div class='pick_conf'><div class='radio icon-radio-unchecked'></div><span>6</span><div class='conf_emoji'>🛥 💎</div></div></li>"
79+
},
80+
"div": {
81+
"class": "popform",
82+
"content": [{
83+
"input": {
84+
"attr": {
85+
"type": "hidden",
86+
"value": confsrc
87+
}
88+
}
89+
},
90+
{
91+
"input": {
92+
"class": "submit",
93+
"attr": {
94+
"type": "submit",
95+
"value": "OK",
96+
"data-currency": thiscurrency
97+
}
98+
}
99+
}
100+
]
101+
}
102+
}],
103+
content = template_dialog({
104+
"id": "conf_formbox",
105+
"icon": "icon-clock",
106+
"title": "Confirmations",
107+
"elements": ddat
108+
});
125109
popdialog(content, "alert", "triggersubmit");
126110
var currentli = $("#conf_formbox ul.conf_options li").filter(function() {
127111
return $(this).find("span").text() == confsrc;
@@ -195,20 +179,53 @@ function edit_blockexplorer() {
195179
} else {
196180
var thiscurrency = current_li.children(".liwrap").attr("data-currency"),
197181
selected = this_data.selected,
198-
content = "\
199-
<div class='formbox' id='be_formbox'>\
200-
<h2 class='icon-key'>Choose Blockexplorer</h2>\
201-
<div class='popnotify'></div>\
202-
<div class='popform'>\
203-
<div class='selectbox'>\
204-
<input type='text' value='" + selected + "' placeholder='Choose Blockexplorer' readonly='readonly'/>\
205-
<div class='selectarrows icon-menu2' data-pe='none'></div>\
206-
<div class='options'>\
207-
</div>\
208-
</div>\
209-
<input type='submit' class='submit' value='OK' data-currency='" + thiscurrency + "'/>\
210-
</div>\
211-
</div>";
182+
ddat = [{
183+
"div": {
184+
"class": "popform",
185+
"content": [{
186+
"div": {
187+
"class": "selectbox",
188+
"content": [{
189+
"input": {
190+
"attr": {
191+
"type": "text",
192+
"value": selected,
193+
"placeholder": "Choose Blockexplorer",
194+
"readonly": "readonly"
195+
},
196+
"close": true
197+
},
198+
"div": {
199+
"class": "selectarrows icon-menu2",
200+
"attr": {
201+
"data-pe": "none"
202+
}
203+
}
204+
},
205+
{
206+
"div": {
207+
"class": "options"
208+
}
209+
}
210+
]
211+
},
212+
"input": {
213+
"class": "submit",
214+
"attr": {
215+
"type": "submit",
216+
"value": "OK",
217+
"data-currency": thiscurrency
218+
}
219+
}
220+
}]
221+
}
222+
}],
223+
content = template_dialog({
224+
"id": "be_formbox",
225+
"icon": "icon-key",
226+
"title": "Choose Blockexplorer",
227+
"elements": ddat
228+
});
212229
popdialog(content, "alert", "triggersubmit");
213230
var optionlist = $("#be_formbox").find(".options");
214231
$.each(options, function(key, value) {
@@ -1067,7 +1084,7 @@ function xpub_info_pu(currency, xpub) {
10671084
<div class='show_xpub'><strong>Xpub: </strong><span class='xpref ref'>show</span></div>\
10681085
<div class='xp_span drawer'>\
10691086
<div class='qrwrap flex'>\
1070-
<div class='qrcode'></div><img src='img/logos/" + ccsymbol + "-" + currency + ".png' class='cmc_icon'>\
1087+
<div class='qrcode'></div><img src='img_logos_" + ccsymbol + "-" + currency + ".png' class='cmc_icon'>\
10711088
</div>\
10721089
<p class='adbox adboxl select' data-type='Xpub'>" + xpub + "</p>\
10731090
</div>\
@@ -1184,4 +1201,24 @@ function submit_apikey() {
11841201
popnotify("error", "Enter a valid API key");
11851202
}
11861203
})
1204+
}
1205+
1206+
function reset_coinsettings() {
1207+
$(document).on("click", ".reset_cc_settings", function() {
1208+
var thistrigger = $(this),
1209+
currency = thistrigger.attr("data-currency");
1210+
popdialog("<h2 class='icon-bin'>Reset " + currency + " settings?</h2>", "alert", "reset_coinsettings_function", thistrigger);
1211+
})
1212+
}
1213+
1214+
function reset_coinsettings_function(trigger) {
1215+
var currency = trigger.attr("data-currency"),
1216+
result = confirm("Are you sure you want to reset " + currency + " settings?");
1217+
if (result === true) {
1218+
var coinsettings = getcoinsettings(currency);
1219+
localStorage.setItem("bitrequest_" + currency + "_settings", JSON.stringify(coinsettings));
1220+
append_coinsetting(currency, coinsettings, false);
1221+
canceldialog();
1222+
notify(currency + " settings reset to default");
1223+
}
11871224
}

assets/js/bitrequest_config.js assets_js_bitrequest_config.js

-6
Original file line numberDiff line numberDiff line change
@@ -1233,12 +1233,6 @@ var app_settings = [{
12331233
"custom_proxies": [],
12341234
"icon": "icon-sphere"
12351235
},
1236-
/*{
1237-
"id": "cachecontrol",
1238-
"heading": "Cache control / updates",
1239-
"selected": "",
1240-
"icon": "icon-database"
1241-
},*/
12421236
{
12431237
"id": "apikeys",
12441238
"heading": "API Keys",

0 commit comments

Comments
 (0)