diff --git a/basicswap/http_server.py b/basicswap/http_server.py index 370a924..7a1f1ce 100644 --- a/basicswap/http_server.py +++ b/basicswap/http_server.py @@ -130,13 +130,13 @@ class HttpHandler(BaseHTTPRequestHandler): for msg in args_dict['messages']: messages_with_ids.append((self.server.msg_id_counter, msg)) self.server.msg_id_counter += 1 - args_dict['messages_withids'] = messages_with_ids + args_dict['messages'] = messages_with_ids if 'err_messages' in args_dict: err_messages_with_ids = [] for msg in args_dict['err_messages']: err_messages_with_ids.append((self.server.msg_id_counter, msg)) self.server.msg_id_counter += 1 - args_dict['err_messages_withids'] = err_messages_with_ids + args_dict['err_messages'] = err_messages_with_ids if self.server.msg_id_counter >= 0x7FFFFFFF: self.server.msg_id_counter = 0 diff --git a/basicswap/static/css/libs/dd.min.css b/basicswap/static/css/libs/dd.min.css new file mode 100644 index 0000000..b777d73 --- /dev/null +++ b/basicswap/static/css/libs/dd.min.css @@ -0,0 +1,179 @@ +/*! * +/** * * MSDropdown - dd.js * * @author: Marghoob Suleman * * @website: https://www.marghoobsuleman.com/ * * @version: 4.0.2 * * @date: Wed Oct 13 2021 15:19:38 GMT+0530 (India Standard Time) * * msDropdown is free web component: you can redistribute it and/or modify * * it under the terms of the either the MIT License or the Gnu General Public License (GPL) Version 2 * * / */ +/*! */ + .ms-pr { + position: relative; + border-width: 1px; + border-color: #fff +} + .blaat:active { + border-radius: 0.5rem; + border-width: 1px; + border-color: #3b82f6; + outline: none !important +} + .blaat:focus { + border-radius: 0.5rem; + border-width: 1px; + border-color: #3b82f6; + outline: none !important +} + .ms-dd { + border-radius: 0.5rem; + border-width: 1px; + border-color: #d1d5db; + background: none +} + .ms-list-option:active { + border-radius: 0.5rem; + border-width: 1px; + border-color: #3b82f6; + outline: none !important +} + .ms-dd .ms-value-input { + left: 20px; + position: absolute; + top: 10px; + width: 50% +} + .ms-dd .ms-dd-header { + c cursor: pointer; + min-height: 35px; + position: relative; + width: 100%; +} + .ms-dd .ms-dd-header .option-selected { + color: #333f51; + display: block; + overflow: hidden; + padding: 9px 19px 9px 9px; + pointer-events: none; + border-radius: 0.5rem; + border-width: 1px; + border-color: #f9fafb; + background: none +} + .ms-dd .ms-dd-header .ms-list-counter, .ms-dd .ms-dd-header input[type=checkbox] { + display: none +} + .ms-dd .ms-dd-header .ms-header-counter { + color: #0e76a8 +} + .ms-dd .ms-dd-header .ms-filter-box { + box-sizing: border-box; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + padding: 6px 10px; + min-height: 44px +} + .ms-dd .ms-dd-option-image, .ms-dd .ms-dd-selected-img { + margin-right: 5px; + max-width: 40px; + vertical-align: middle +} + .ms-dd .ms-dd-arrow { + height: 0; + margin-top: -3px; + position: absolute; + right: 10px; + top: 50%; + width: 0 +} + .ms-dd .ms-dd-arrow.ms-dd-pointer-down { + display: none +} + .ms-dd .ms-dd-arrow.ms-dd-pointer-up { + display: none +} + .ms-dd .ms-options { + background: #fff; + border: 1px solid #767676; + box-shadow: 0 1px 5px #ddd; + display: none; + list-style: none; + margin: 0; + overflow: auto; + padding: 0; + position: absolute; + width: 100%; + z-index: 9999 +} + .ms-dd .ms-list-option, .ms-dd .ms-optgroup ul .ms-list-option { + align-items: center; + color: #333; + cursor: pointer; + display: flex; + justify-content: flex-start; + overflow: hidden; + padding: 10px; + position: relative; + text-decoration: none +} + .ms-dd .ms-list-option input[type=checkbox], .ms-dd .ms-optgroup ul .ms-list-option input[type=checkbox] { + margin-right: 5px; + vertical-align: middle +} + .ms-dd .ms-list-option:last-child, .ms-dd .ms-optgroup ul .ms-list-option:last-child { + border-bottom: none +} + .ms-dd .ms-list-option:hover, .ms-dd .ms-optgroup ul .ms-list-option:hover { + background: #e0e0e6; + color: #000 +} + .ms-dd .ms-list-option.option-selected, .ms-dd .ms-optgroup ul .ms-list-option.option-selected { + background: #f9fafb +} + .ms-dd .ms-list-option.ico-align-right .ms-dd-option-image, .ms-dd .ms-list-option.ico-align-right .ms-dd-selected-img, .ms-dd .ms-optgroup ul .ms-list-option.ico-align-right .ms-dd-option-image, .ms-dd .ms-optgroup ul .ms-list-option.ico-align-right .ms-dd-selected-img { + order: 2 +} + .ms-dd .ms-list-option.disabled, .ms-dd .ms-list-option:disabled, .ms-dd .ms-optgroup ul .ms-list-option.disabled, .ms-dd .ms-optgroup ul .ms-list-option:disabled { + cursor: default; + opacity: .4 +} + .ms-dd .ms-list-option .ms-dd-desc, .ms-dd .ms-optgroup ul .ms-list-option .ms-dd-desc { + color: #aaa; + display: block; + line-height: 1.5em; + overflow: hidden; + text-shadow: 0 1px .5px #fff +} + .ms-dd .ms-header-middle-content, .ms-dd .ms-middle { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + font-size: 0.875rem; + min-width: 100px +} + .ms-dd.disabled, .ms-dd:disabled { + cursor: default; + opacity: .4; + pointer-events: none +} + .ms-dd .ms-optgroup-padding { + padding: 10px 10px 0 +} + .ms-dd .ms-optgroup { + display: block +} + .ms-dd .ms-optgroup:hover { + background: #fff; + color: #000 +} + .ms-dd .ms-optgroup ul { + margin: 0; + padding: 0 +} + .ms-dd .ms-optgroup ul .ms-list-option { + padding-left: 20px +} + .ms-dd .ms-optgroup ul:last-child { +} + .ms-dd .ms-dd-option-content { + width: 100% +} + .ms-value-input { + display:none; +} diff --git a/basicswap/static/images/coins/Bitcoin-20.png b/basicswap/static/images/coins/Bitcoin-20.png new file mode 100644 index 0000000..cda77ca Binary files /dev/null and b/basicswap/static/images/coins/Bitcoin-20.png differ diff --git a/basicswap/static/images/coins/Dash-20.png b/basicswap/static/images/coins/Dash-20.png new file mode 100644 index 0000000..2b1bbe6 Binary files /dev/null and b/basicswap/static/images/coins/Dash-20.png differ diff --git a/basicswap/static/images/coins/Dash.png b/basicswap/static/images/coins/Dash.png new file mode 100644 index 0000000..fc96155 Binary files /dev/null and b/basicswap/static/images/coins/Dash.png differ diff --git a/basicswap/static/images/coins/Litecoin-20.png b/basicswap/static/images/coins/Litecoin-20.png new file mode 100644 index 0000000..24c398b Binary files /dev/null and b/basicswap/static/images/coins/Litecoin-20.png differ diff --git a/basicswap/static/images/coins/Monero-20.png b/basicswap/static/images/coins/Monero-20.png new file mode 100644 index 0000000..00c2d71 Binary files /dev/null and b/basicswap/static/images/coins/Monero-20.png differ diff --git a/basicswap/static/images/coins/Particl-20.png b/basicswap/static/images/coins/Particl-20.png new file mode 100644 index 0000000..d412b84 Binary files /dev/null and b/basicswap/static/images/coins/Particl-20.png differ diff --git a/basicswap/static/images/coins/Particl-Anon-20.png b/basicswap/static/images/coins/Particl-Anon-20.png new file mode 100644 index 0000000..d412b84 Binary files /dev/null and b/basicswap/static/images/coins/Particl-Anon-20.png differ diff --git a/basicswap/static/images/coins/Particl-Anon.png b/basicswap/static/images/coins/Particl-Anon.png new file mode 100644 index 0000000..f2947fe Binary files /dev/null and b/basicswap/static/images/coins/Particl-Anon.png differ diff --git a/basicswap/static/images/coins/Particl-Blind-20.png b/basicswap/static/images/coins/Particl-Blind-20.png new file mode 100644 index 0000000..d412b84 Binary files /dev/null and b/basicswap/static/images/coins/Particl-Blind-20.png differ diff --git a/basicswap/static/images/coins/Particl-Blind.png b/basicswap/static/images/coins/Particl-Blind.png new file mode 100644 index 0000000..f2947fe Binary files /dev/null and b/basicswap/static/images/coins/Particl-Blind.png differ diff --git a/basicswap/static/images/coins/ParticlAnon-20.png b/basicswap/static/images/coins/ParticlAnon-20.png new file mode 100644 index 0000000..d412b84 Binary files /dev/null and b/basicswap/static/images/coins/ParticlAnon-20.png differ diff --git a/basicswap/static/images/coins/ParticlAnon.png b/basicswap/static/images/coins/ParticlAnon.png new file mode 100644 index 0000000..f2947fe Binary files /dev/null and b/basicswap/static/images/coins/ParticlAnon.png differ diff --git a/basicswap/static/images/coins/ParticlBlind-20.png b/basicswap/static/images/coins/ParticlBlind-20.png new file mode 100644 index 0000000..d412b84 Binary files /dev/null and b/basicswap/static/images/coins/ParticlBlind-20.png differ diff --git a/basicswap/static/images/coins/ParticlBlind.png b/basicswap/static/images/coins/ParticlBlind.png new file mode 100644 index 0000000..f2947fe Binary files /dev/null and b/basicswap/static/images/coins/ParticlBlind.png differ diff --git a/basicswap/static/images/coins/Pivx-20.png b/basicswap/static/images/coins/Pivx-20.png new file mode 100644 index 0000000..0b565ab Binary files /dev/null and b/basicswap/static/images/coins/Pivx-20.png differ diff --git a/basicswap/static/images/favicon-32.png b/basicswap/static/images/favicon/favicon-32.png similarity index 100% rename from basicswap/static/images/favicon-32.png rename to basicswap/static/images/favicon/favicon-32.png diff --git a/basicswap/static/images/logos/basicswap-logo-dark.svg b/basicswap/static/images/logos/basicswap-logo-dark.svg index 25022fd..80fc418 100644 --- a/basicswap/static/images/logos/basicswap-logo-dark.svg +++ b/basicswap/static/images/logos/basicswap-logo-dark.svg @@ -3,44 +3,66 @@ - - - + + + + + + + + + + + diff --git a/basicswap/static/images/logos/basicswap-logo.svg b/basicswap/static/images/logos/basicswap-logo.svg index e16e430..4a9f66d 100644 --- a/basicswap/static/images/logos/basicswap-logo.svg +++ b/basicswap/static/images/logos/basicswap-logo.svg @@ -1,47 +1,68 @@ - + - - - + + + + + + + + + + + + + diff --git a/basicswap/static/images/other/placeholder-line.png b/basicswap/static/images/other/placeholder-line.png new file mode 100644 index 0000000..182ea8b Binary files /dev/null and b/basicswap/static/images/other/placeholder-line.png differ diff --git a/basicswap/static/images/other/send-get.png b/basicswap/static/images/other/send-get.png new file mode 100644 index 0000000..231009e Binary files /dev/null and b/basicswap/static/images/other/send-get.png differ diff --git a/basicswap/static/js/libs/dd.min.js b/basicswap/static/js/libs/dd.min.js new file mode 100644 index 0000000..7a4892c --- /dev/null +++ b/basicswap/static/js/libs/dd.min.js @@ -0,0 +1,1015 @@ +/*! For license information please see dd.min.js.LICENSE.txt */ +(() => { + "use strict"; + let e = null; + class t { + constructor(e, t) { + this.ele = e, this._settings = { + byJson: { + data: null, + selectedIndex: 0, + name: null, + size: 0, + multiple: !1, + width: 250 + }, + mainCss: "ms-dd", + rowHeight: null, + visibleRows: null, + showIcon: !0, + zIndex: 9999, + event: "click", + style: "", + childWidth: null, + childHeight: null, + enableCheckbox: !1, + checkboxNameSuffix: "_mscheck", + showPlusItemCounter: !0, + enableAutoFilter: !1, + showFilterAlways: !1, + showListCounter: !1, + imagePosition: "left", + errorMessage: "Please select an item from this list", + on: { + create: null, + open: null, + close: null, + add: null, + remove: null, + change: null, + blur: null, + click: null, + dblclick: null, + mousemove: null, + mouseover: null, + mouseout: null, + focus: null, + mousedown: null, + mouseup: null + }, + ...t + }, this._css = {}, this._onDocumentClick = null, this._onDocumentKeyDown = null, this._onDocumentKeyUp = null, this._isOpen = !1, this._DOWN_ARROW = 40, this._UP_ARROW = 38, this._LEFT_ARROW = 37, this._RIGHT_ARROW = 39, this._ESCAPE = 27, this._ENTER = 13, this._ALPHABETS_START = 47, this._SHIFT = 16, this._CONTROL = 17, this._MAC_CONTROL = 91, this._BACKSPACE = 8, this._DELETE = 46, this._SPACE = 32, this._shiftHolded = !1, this._controlHolded = !1, this._isFirstTime = !0, this._cacheEle = {}, this._isMouseDown = !1, this._itemsArr = [], this._css = { + dd: this._settings.mainCss + " ms-pr blaat", + wrapperDisabled: "disabled", + headerA: "ms-list-option option-selected ", + header: "ms-dd-header ", + headerMiddleContent: "ms-header-middle-content ", + arrow: "ms-dd-arrow", + arrowDown: "ms-dd-pointer-down", + arrowUp: "ms-dd-pointer-up", + headerCounter: "ms-header-counter", + listOfItems: "ms-options ", + itemContent: "ms-dd-option-content", + item: "ms-list-option ", + itemSpan: "ms-middle", + itemSpanOpt: "ms-optgroup-padding", + itemLabel: "ms-dd-label", + itemImage: "ms-dd-option-image", + itemDesc: "ms-dd-desc", + itemSelected: "option-selected", + itemDisabled: "disabled", + itemEnabled: "enabled", + optgroup: "ms-optgroup", + listCounter: "ms-list-counter", + valueInput: "ms-value-input", + checkbox: "ms-checkbox", + imageRight: "ico-align-right" + }, this._wrapper = {}, this._createByJson(), this._checkDataSettings(), this._isList = this.ele.size > 1, this._isMultiple = this.ele.multiple, this._enableCheckbox = this._settings.enableCheckbox, (this._isList || "true" === this._enableCheckbox.toString()) && (this._isMultiple = this.ele.multiple = !0), this._isFilterApplied = !1, this._nexPrevCounter = 0, this._init() + } + _init() { + this._makeLayout(), this._updateUiAndValueByIndex(this.selectedIndex), this.ele.size > 1 && (this._makeUiAsList(!0, this.ele.size), this._scrollToItem()), null !== this._settings.childWidth && (this._wrapper.listOfItems.style.width = this._settings.childWidth), this._showHideOriginal(!1), "true" === this._settings.showFilterAlways.toString() && (this._settings.enableAutoFilter = !0, this._showHideFilterBox(!0)), this.ele.autofocus ? (this._wrapper.holder.focus(), this._wrapper.filterInput.focus()) : this._wrapper.filterInput.blur(), this.updateUiAndValue(), this._fireLocalEventIfExist("create"), this._fireEventIfExist("onCreate") + } + _showHideOriginal(e = !0) { + e ? this._show(this.ele) : this._hide(this.ele) + } + _checkDataSettings() { + let e = this._getDataSet(this.ele), + t = this._settings; + t.mainCss = e?.mainCss || t.mainCss, t.showIcon = e?.showIcon || t.showIcon, t.event = e?.event || t.event, t.childWidth = e?.childWidth || t.childWidth, t.childHeight = e?.childHeight || t.childHeight, t.enableCheckbox = e?.enableCheckbox || t.enableCheckbox, t.checkboxNameSuffix = e?.checkboxNameSuffix || t.checkboxNameSuffix, t.enableAutoFilter = e?.enableAutoFilter || t.enableAutoFilter, t.visibleRows = e?.visibleRows || t.visibleRows, t.showPlusItemCounter = e?.showPlusItemCounter || t.showPlusItemCounter, t.errorMessage = e?.errorMessage || t.errorMessage, t.showFilterAlways = e?.showFilterAlways || t.showFilterAlways, t.showListCounter = e?.showListCounter || t.showListCounter, t.imagePosition = e?.imagePosition || t.imagePosition, this._settings = { + ...this._settings, + ...t + } + } + setSettingAttribute(e, t) { + this._settings[e] = t + } + _createByJson() { + if (this._settings.byJson.data) try { + let e = this._settings.byJson, + t = {}; + t.name = e.name || this.ele.id || "", e.size > 0 && (t.size = e.size), e.multiple && (t.multiple = e.multiple); + let s = this._createEle("select", t), + i = e.data.length; + for (let t = 0; t < i; t++) { + let i = e.data[t], + l = new Option(i.text, i.value); + i.disabled && (l.disabled = !0); + for (let e in i) + if (i.hasOwnProperty(e) && "text" !== e.toLowerCase()) { + let t = `data-${e}`; + t = t.replace(/([A-Z])/g, "-$1").toLowerCase(), l.setAttribute(t, i[e]) + } s.options[t] = l + } + this.ele.appendChild(s), s.selectedIndex = e.selectedIndex, e.width && (this.ele.style.width = e.width + "px"), this.ele = s + } catch (e) { + throw "There is an error in json data." + } + } + _scrollToItem(e, t = "smooth") { + (e = e || this.uiData.ui) && (e = e.length > 1 ? e[0] : e, this._scrollToIfNeeded(e)) + } + _showHideFilterBox(e = !0) { + e ? (this._show(this._wrapper.filterHolder), this._wrapper.filterInput.focus(), "false" === this._settings.showFilterAlways.toString() && this._hide(this._wrapper.headerA)) : (this._wrapper.filterInput.value = "", this._hide(this._wrapper.filterHolder), this._show(this._wrapper.headerA)) + } + _applyFilters(e) { + let t = this._wrapper.filterInput.value; + if (0 === t.length) this._show(this._wrapper.headerA), this._makeChildren(), this._isFilterApplied = !1; + else { + "false" === this._settings.showFilterAlways.toString() && this._hide(this._wrapper.headerA), this._isOpen || this.open(null); + let e = [...this.options].filter((function(e) { + return "OPTGROUP" !== e.nodeName && !1 === e.disabled && e.text.toLowerCase().indexOf(t.toLowerCase()) >= 0 + })); + this._makeChildren(e), this._isFilterApplied = !0, this._nexPrevCounter = -1, this._scrollToIfNeeded(null, 0) + } + } + _makeFilterBox() { + let e = this._createEle("div", { + className: "ms-filter-box" + }), + t = this._createEle("input", { + type: "text" + }); + return e.appendChild(t), this._wrapper.filterInput = t, this._wrapper.filterHolder = e, this._bindEvents(t, "input", (e => { + this._applyFilters(e) + })), e + } + _makeHeader() { + let e = this._css, + t = this._createEle("div", { + className: e.header + }), + s = this._createEle("a", { + className: e.headerA + }), + i = this._createEle("span", { + className: e.headerMiddleContent + }), + l = this._createEle("span", { + className: e.arrow + " " + e.arrowDown + }); + return s.appendChild(l), s.appendChild(i), t.appendChild(s), this._wrapper.header = t, this._wrapper.headerA = s, this._wrapper.headerContent = i, this._wrapper.arrow = l, "left" !== this._settings.imagePosition && s.classList.add(e.imageRight), this._bindEvents(t, this._settings.event, (e => { + this.open(e) + })), t + } + _makeChildren(e = null) { + let t, s = this._css, + i = "true" === this._enableCheckbox.toString(), + l = this, + n = function(e, t) { + let n = {}; + return n = l._parseOption(e), { + opt: n, + itemObj: { + label: { + text: n.text, + css: s.itemLabel + }, + img: { + src: n.image, + css: s.itemImage + }, + desc: { + text: n.description, + css: s.itemDesc + }, + isDisabled: e.disabled || !1, + isSelected: e.selected || !1, + isCheckbox: i, + value: n.value, + title: n.title, + imageCss: `${n.imageCss} ${n.className}`, + counter: t + 1, + isOptGroup: "OPTGROUP" === e.nodeName, + innerSpanCss: s.itemContent + } + } + }, + r = function(e, t) { + t.isDisabled || (l._bindEvents(e, "mouseup", (e => { + l._isMouseDown = !1, i && "INPUT" === e.target.nodeName || l._isList || l.close(e) + })), l._bindEvents(e, "mousedown", (t => { + if (l._isMouseDown = !0, i && "INPUT" === t.target.nodeName) l._setSelectedByItemToggle(e._refCheckbox, e); + else if (l._shiftHolded && l._isMultiple) { + let t = l.selectedIndex, + s = e.index; + l._setSelectedByIndexFromTo(t, s) + } else l._controlHolded && l._isMultiple ? l._setSelectedByItem(e, !1, !1) : l._setSelectedByItem(e) + })), l._bindEvents(e, "mouseover", (t => { + l._isMouseDown && l._isMultiple && l._setSelectedByItem(e, !1, !1) + }))) + }; + this._wrapper.listOfItems ? t = this._wrapper.listOfItems : (t = this._createEle("ul", { + className: s.listOfItems, + zIndex: this._settings.zIndex + }), this._wrapper.listOfItems = t), t.innerHTML = ""; + let a = null === e ? this.ele.children : e, + h = a.length; + for (let e = 0; e < h; e++) { + let i = a[e], + l = n(i, e), + h = l.opt, + d = l.itemObj, + o = this._createRow(d); + if ("" !== h.className && (o.className = o.className + " " + h.className), "" !== h.internalStyle && (o.style = h.internalStyle), o.index = h.index, o.setAttribute("data-ms-index", h.index), d.isOptGroup) { + let e = i.children, + t = e.length, + l = this._createEle("ul"); + for (let i = 0; i < t; i++) { + let t = n(e[i], i), + a = t.opt, + h = t.itemObj, + d = this._createRow(h); + "" !== a.className && (d.className = d.className + " " + a.className), "" !== a.internalStyle && (d.style = a.internalStyle), d.index = a.index, d.setAttribute("data-ms-index", a.index), h.isSelected && this._setSelectedByItem(d, !0), r(d, h), "left" !== this._settings.imagePosition && d.classList.add(s.imageRight), l.appendChild(d) + } + o.appendChild(l) + } + d.isOptGroup || r(o, d), "left" !== this._settings.imagePosition && o.classList.add(s.imageRight), t.appendChild(o), d.isSelected && this._setSelectedByItem(o, !0) + } + return null !== this._settings.childHeight && (t.style.maxHeight = this._settings.childHeight + "px"), t + } + _makeLayout() { + this.ele.tabIndex = -1; + let t = this._css, + s = this._createEle("div", { + tabIndex: 0, + className: t.dd + }), + i = this.ele.name, + l = this.ele.required, + n = this._createEle("input", { + tabIndex: -1, + name: i, + type: "text", + className: this._css.valueInput, + required: l + }); + s.appendChild(n), this.ele.required = !1, this.ele.name = ""; + let r = this._createEle("div", { + className: "more", + style: "display:none" + }); + s.appendChild(r), this._wrapper.valueBox = n, this._wrapper.moreValueBox = r; + let a = this._makeHeader(), + h = this._makeFilterBox(); + a.appendChild(h), this._showHideFilterBox(!1); + let d = this._makeChildren(); + s.appendChild(a), s.appendChild(d), this._wrapper.holder = s, this._insertAfter(s, this.ele), this._hide(d), this.disabled && s.classList.add(t.wrapperDisabled); + let o = this._getInternalStyle(this.ele); + s.setAttribute("style", o), null !== this._settings.byJson.data && s.setAttribute("style", `width:${this._settings.byJson.width}px`); + let u = this._createEle("div", { + style: "clear:both" + }); + s.appendChild(u), this._bindEvents(this._wrapper.holder, "focus", (t => { + this._isList ? this._bindDocumentEvents(null, !1, !0) : (e && (e.close(null), e = null), this._bindDocumentEvents(null, !0, !0), e = this), this._fireLocalEventIfExist("focus"), this._fireEventIfExist("focus") + })), this._bindEvents(this._wrapper.holder, "blur", (e => { + this._isList && this._unbindDocumentEvents(), this._fireLocalEventIfExist("blur"), this._fireEventIfExist("blur") + })), this._bindEvents(this._wrapper.holder, "dblclick", (e => { + this._fireLocalEventIfExist("blur"), this._fireEventIfExist("blur") + })), this._bindEvents(n, "invalid", (e => { + e.target.setCustomValidity(""), e.target.validity.valid || e.target.setCustomValidity(this._settings.errorMessage) + })), this._bindEvents(n, "input", (e => { + e.target.setCustomValidity("") + })); + let _ = ["click", "dblclick", "mousemove", "mouseover", "mouseout", "mousedown", "mouseup"]; + for (let e = 0, t = _.length; e < t; e++) { + let t = _[e]; + this._bindEvents(this._wrapper.holder, t, (e => { + this._fireLocalEventIfExist(t), this._fireEventIfExist(t) + })) + } + return s + } + _createRow(e) { + let t = e.isOptGroup ? this._css.optgroup : this._css.item, + s = this._createEle("li", { + className: t + }); + if (e.isCheckbox && !e.isOptGroup) { + let t = this._createEle("input", { + tabIndex: -1, + className: this._css.checkbox, + type: "checkbox", + disabled: e.isDisabled, + checked: !1, + value: e.value, + name: this._wrapper.valueBox.name + this._settings.checkboxNameSuffix + "[]" + }); + s.appendChild(t), s._refCheckbox = t + } + let i = e.isOptGroup ? " " + this._css.itemSpanOpt : "", + l = this._createEle("span", { + className: this._css.itemSpan + i + }), + n = "true" === this._settings.showListCounter.toString() ? `${e.counter} ${e.label.text}` : e.label.text, + r = this._createEle("span", { + className: e.label.css + }, n), + a = this._createEle("span", { + className: e.innerSpanCss + }); + if (a.appendChild(r), null !== e.img.src) { + let t = this._createEle("img", { + className: e.img.css, + src: e.img.src + }); + l.appendChild(t) + } + if (null === e.img.src && "" !== e.imageCss.replace(/\s/g, "")) { + let t = this._createEle("span", { + className: e.img.css + " " + e.imageCss + }, " "); + l.appendChild(t) + } + if (null !== e.desc.text) { + let t = this._createEle("span", { + className: e.desc.css + }, e.desc.text); + a.appendChild(t) + } + return l.appendChild(a), s.appendChild(l), e.isDisabled ? s.classList.add(this._css.itemDisabled) : e.isOptGroup || s.classList.add(this._css.itemEnabled), "" !== e.title && (s.title = e.title), s + } + _parseOption(e) { + let t, s, i, l = null, + n = "", + r = "", + a = "", + h = "", + d = "", + o = "", + u = -1; + if (void 0 !== e) { + let _ = e.nodeName, + p = e.dataset; + "OPTGROUP" === _ ? h = e.label : (h = e.text, a = e.value || h), u = e.index, t = e.selected, s = e.disabled, d = e.className || "", n = p.title || "", r = p.description || "", l = p.image || l, o = p.imageCss || "", i = this._getInternalStyle(e) + } + return { + image: l, + title: n, + description: r, + value: a, + text: h, + className: d, + imageCss: o, + index: u, + selected: t, + disabled: s, + internalStyle: i + } + } + _removeOldSelected() { + let e = this._getAllEle("ul li." + this._css.itemSelected, this._wrapper.holder); + for (let t = 0; t < e.length; t++) e[t].classList.remove(this._css.itemSelected), this._isMultiple && "true" === this._enableCheckbox.toString() && (e[t]._refCheckbox.checked = !1) + } + _setSelectedByIndexFromTo(e, t) { + let s = Math.min(e, t), + i = Math.max(e, t), + l = this.optionsUI; + for (let e = s; e <= i; e++) this._setSelectedByItem(l[e], !1, !1) + } + _setSelectedByItemToggle(e, t) { + let s = !e.checked, + i = t.index; + s ? (t.classList.add(this._css.itemSelected), this.ele.options[i].selected = !0) : (t.classList.remove(this._css.itemSelected), this.ele.options[i].selected = !1), this.updateUiAndValue() + } + _setSelectedByItem(e, t = !1, s = !0) { + if (t && e) e.classList.add(this._css.itemSelected); + else { + let t = e.index; + !0 === s ? (this._removeOldSelected(), this.ele.selectedIndex = t) : this.ele.options[t].selected = !0, e?.classList?.add(this._css.itemSelected), this.updateUiAndValue() + } + "true" === this._enableCheckbox.toString() && e?._refCheckbox && (e._refCheckbox.checked = !0), !1 === this._isFirstTime && (this._fireLocalEventIfExist("change"), this._fireEventIfExist("change")), this._isFirstTime = !1 + } + _setSelectedByOptionItem(e, t = !1) { + let s = e.index, + i = this._getDataAndUI(s); + this._setSelectedByItem(i.ui, t) + } + _updateHeaderUI(e = null, t = null) { + let s = null === e ? this.uiData : e, + i = this._isArray(s.index) ? s.ui[0].innerHTML : null; + this._wrapper.headerContent.innerHTML = null !== t ? t : i || s?.ui?.innerHTML || " "; + let l = this._getEle("." + this._css.itemLabel, this._wrapper.headerContent); + if ("true" === this._settings.showPlusItemCounter.toString() && null !== s.ui && s.ui.length > 1 && (l.innerHTML = l.innerHTML + `  (+${s.ui.length-1})`), "false" === this._settings.showIcon.toString()) { + let e = this._getEle("img", this._wrapper.headerContent); + e && this._hide(e) + } + this._setTitleMinHeight(!1) + } + _findElementByIndexProp(e) { + let t = this._getAllEle(`ul li.${this._css.item}`, this._wrapper.holder), + s = t.length; + for (let i = 0; i < s; i++) + if (t[i].index === e) return t[i]; + return null + } + _getDataAndUI(e = null) { + let t, s, i, l = this.ele, + n = null, + r = -1, + a = this, + h = !1, + d = function(e) { + let t = l.options[e], + s = e; + return { + option: t, + data: a._parseOption(t), + index: s, + ui: a._findElementByIndexProp(s) + } + }; + if (null !== e) i = d(e), n = i.option, t = i.data, r = i.index, s = i.ui; + else if (s = this._getAllEle("ul li." + this._css.itemSelected, this._wrapper.holder), s.length > 1) { + let e = [], + l = [], + a = [], + o = []; + for (let t = 0; t < s.length; t++) i = d(s[t].index), e.push(i.data), l.push(i.option), a.push(i.index), o.push(i.ui); + t = e, n = l, r = a, s = o, h = !0 + } else i = d(s[0]?.index || this.selectedIndex), n = i.option || null, t = i.data || null, r = i.index || -1, s = i.ui || null; + return { + data: t, + ui: s, + index: r, + option: n, + isArray: h + } + } + _isArray = function(e) { + return "[object Array]" === Object.prototype.toString.call(e) + }; + updateUiAndValue(e = null) { + let t = null === e ? this.uiData : e; + this._updateHeaderUI(t); + let s = this._wrapper.valueBox; + if (s.value = this.ele.value, this._isMultiple && "[]" === s.name.substr(s.name.length - 2, s.name.length)) { + this._wrapper.moreValueBox.innerHTML = ""; + for (let e = 1; e < t.data.length; e++) { + let i = this._createEle("input", { + type: "hidden", + name: s.name, + value: t.data[e].value + }); + this._wrapper.moreValueBox.appendChild(i) + } + } + } + _updateUiAndValueByIndex(e) { + let t = this._getDataAndUI(e); + this.updateUiAndValue(t) + } + _createEle(e, t, s) { + let i = document.createElement(e); + if (t) + for (let e in t) "style" === e ? i.style.cssText = t[e] : i[e] = t[e]; + return s && (i.innerHTML = s), i + } + _getEle(e, t = null) { + return null === t ? document.querySelector(e) : t.querySelector(e) + } + _getAllEle(e, t = null) { + return null === t ? document.querySelectorAll(e) : t.querySelectorAll(e) + } + _getInternalStyle(e) { + return void 0 === e.style ? "" : e.style.cssText + } + _toggleShow(e) { + e.style.display = "none" === e.style.display || "" === e.style.display ? "inherit" : "none" + } + _show(e, t = "block") { + e.style.display = t + } + _hide(e) { + e.style.display = "none" + } + _insertAfter(e, t) { + return t.parentNode.insertBefore(e, t.nextSibling) + } + _insertBefore(e, t) { + return t.insertBefore(e, t) + } + _getIndex(e) { + return [...this._getAllEle("ul li", this._wrapper.holder)].indexOf(e) + } + _getProp(e, t) { + let s = {}; + for (let i = 0; i < e.attributes.length; i++) { + let l = e.attributes[i].nodeName, + n = e.attributes[i].nodeValue; + if (t === l) return n; + s[l] = n + } + return void 0 === t ? s : null + } + _getDataSet(e, t = null) { + return null === t ? e.dataset : e.dataset[t] || null + } + _bindEvents(e, t, s) { + e.addEventListener(t, s) + } + _unbindEvents(e, t, s) { + e.removeEventListener(t, s) + } + _adjustChildHeight(e = null) { + if (null !== (e = null === e ? parseInt(this._settings.visibleRows) : e)) { + let t = this._getEle("li[data-ms-index='0']", this._wrapper.listOfItems), + s = null !== this._settings.rowHeight ? this._settings.rowHeight : t.clientHeight; + this._wrapper.listOfItems.style.height = e * s + "px" + } + } + _setTitleMinHeight(e = !0) { + let t = 0; + if (!0 === e) { + let e = this._getAllEle("li", this._wrapper.listOfItems), + s = e.length; + for (let i = 0; i < s; i++) { + let s = e[i]; + t = s.clientHeight > t ? s.clientHeight : t + } + } else t = this._wrapper.headerA.clientHeight; + this._wrapper.header.style.minHeight = t + "px" + } + _makeUiAsList(e, t) { + !0 === e ? (this._hide(this._wrapper.header), this.open(null, !0), this._adjustChildHeight(t), this._wrapper.listOfItems.style.position = "relative", this._wrapper.listOfItems.style.display = "inline-block", this._wrapper.listOfItems.style.zIndex = 0, this._wrapper.holder.style.zIndex = 0, this._isList = !0) : (this._show(this._wrapper.header), this._wrapper.listOfItems.style.height = null, this._wrapper.listOfItems.style.position = "absolute", this._wrapper.listOfItems.style.zIndex = this._settings.zIndex, this._wrapper.holder.style.zIndex = 0, this._isList = !1, this.close(null)) + } + _bindDocumentEvents(e, t = !0, s = !0) { + this._unbindDocumentEvents(), this._onDocumentClick = e => { + let t = this._wrapper.listOfItems.getBoundingClientRect(), + s = this._wrapper.header.getBoundingClientRect(), + i = t.left + t.width, + l = s.top + t.height + s.height; + (e.clientX < t.left || e.clientX > i || e.clientY < s.y || e.clientY > l) && this.close(e) + }, this._onDocumentKeyDown = e => { + switch (e.keyCode) { + case this._DOWN_ARROW: + case this._RIGHT_ARROW: + e.preventDefault(), e.stopPropagation(), this._show(this._wrapper.listOfItems), this._isOpen = !0, this.next(); + break; + case this._UP_ARROW: + case this._LEFT_ARROW: + e.preventDefault(), e.stopPropagation(), this.previous(); + break; + case this._ESCAPE: + case this._ENTER: + e.preventDefault(), e.stopPropagation(), this.close(null); + break; + case this._SHIFT: + this._shiftHolded = !0; + break; + case this._CONTROL: + case this._MAC_CONTROL: + this._controlHolded = !0; + break; + case this._SPACE: + this._show(this._wrapper.listOfItems), this._isOpen = !0; + break; + default: + e.keyCode >= this._ALPHABETS_START && !1 === this._isList && "true" === this._settings.enableAutoFilter.toString() && this._showHideFilterBox(!0), this._shiftHolded = !1, this._controlHolded = !1 + } + }, this._onDocumentKeyUp = e => { + this._shiftHolded = !1, this._controlHolded = !1 + }, !0 === t && this._bindEvents(document, "mouseup", this._onDocumentClick), !0 === s && (this._bindEvents(document, "keydown", this._onDocumentKeyDown), this._bindEvents(document, "keyup", this._onDocumentKeyUp)) + } + _unbindDocumentEvents() { + null !== this._onDocumentClick && this._unbindEvents(document, "mouseup", this._onDocumentClick), null !== this._onDocumentKeyDown && this._unbindEvents(document, "keydown", this._onDocumentKeyDown), null !== this._onDocumentKeyUp && this._unbindEvents(document, "keyup", this._onDocumentKeyUp), this._onDocumentClick = null, this._onDocumentKeyDown = null, this._onDocumentKeyUp = null + } + _scrollToIfNeeded(e = null, t = null, s = "next") { + let i = this._wrapper.listOfItems; + if (i.getBoundingClientRect(), null === e && null !== t && (i.scrollTop = t), e = void 0 !== e ? e : this._getEle("li." + this._css.itemSelected)) { + let t = e.offsetTop, + l = i.clientHeight, + n = e.clientHeight; + t + n - i.scrollTop > l && "next" === s ? i.scrollTop = t + n - l : t - i.scrollTop < 0 && "previous" === s && (i.scrollTop = t) + } + } + _fireLocalEventIfExist(e, t = null) { + if ("function" == typeof this._settings.on[e]) { + let s = null === t ? this._getDataAndUI() : t, + i = this._settings.on[e]; + try { + i(s) + } catch (e) { + console.error(e.message) + } + } + } + _fireEventIfExist(e) { + if (this.ele.dataset[e]) { + let t = new Function(this.ele.dataset[e]); + try { + t() + } catch (e) { + console.error(e.message) + } + } + if (this._has_handler(e).hasEvent) { + if (this._has_handler(e).byElement) try { + this.ele[e]() + } catch (t) { + try { + this.ele["on" + e]() + } catch (e) {} + } else if (this._has_handler(e).byJQuery) switch (e) { + case "keydown": + case "keyup": + break; + default: + try { + "undefined" != typeof jQuery && jQuery(this.ele).triggerHandler(e) + } catch (e) {} + } + return !1 + } + } + _has_handler(e) { + let t = { + byElement: !1, + local: !1, + byJQuery: !1, + hasEvent: !1 + }; + null !== this._settings.on[e] && (t.hasEvent = !0, t.local = !0); + try { + null !== this._getProp(this.ele, "on" + e) && (t.hasEvent = !0, t.byElement = !0) + } catch (e) {} + if ("undefined" != typeof jQuery) { + let s, i = jQuery(this.ele); + s = "function" == typeof jQuery?._data ? jQuery?._data(this.ele, "events") : i.data("events"), s && s[e] && (t.hasEvent = !0, t.byJQuery = !0) + } + return t + } + add(e, t = null) { + let s, i, l, n, r, a, h; + e instanceof HTMLOptionElement ? h = e : "string" == typeof e ? (s = i = e, h = new Option(s, i)) : e instanceof Object && (s = e.text || "", i = e.value || s, l = e.title || "", n = e.image || "", a = e.imageCss || "", r = e.description || "", h = new Option(s, i), h.setAttribute("data-description", r), h.setAttribute("data-image", n), h.setAttribute("data-title", l), h.setAttribute("data-image-css", a)), this.ele.add(h, t), this._makeChildren(), this._fireLocalEventIfExist("add") + } + remove(e) { + let t = this._getDataAndUI(e); + return this.ele.remove(e), this._makeChildren(), this._fireLocalEventIfExist("remove", t), t + } + next() { + let e, t = this, + s = this.optionsUI, + i = s.length; + if (e = this._isFilterApplied ? this._nexPrevCounter : this.selectedIndex, i > 0) { + let l = function() { + let l = e; + for (; l < i; l++) { + let e = l + 1; + if (e = e >= i ? i - 1 : e, t._nexPrevCounter++, !s[e].classList.contains(t._css.itemDisabled)) return s[e] + } + return null + }(); + l && (this._setSelectedByItem(l, !1, !0), this._scrollToIfNeeded(l)) + } + } + previous() { + let e, t = this, + s = this.optionsUI; + if (s.length, e = this._isFilterApplied ? this._nexPrevCounter : this.selectedIndex, s.length > 0) { + let i = function(i) { + let l = e; + for (; l > 0; l--) { + let e = l - 1; + if (e = e >= 0 ? e : 0, t._nexPrevCounter--, !s[e].classList.contains(t._css.itemDisabled)) return s[e] + } + return null + }(); + i && (this._setSelectedByItem(i, !1, !0), this._scrollToIfNeeded(i, null, "previous")) + } + } + open(e, t = !1) { + this.disabled || (this._isOpen ? this.close(null) : (this._isOpen = !0, this._show(this._wrapper.listOfItems), !1 === t && this._bindDocumentEvents(e), this._wrapper.arrow.classList.remove(this._css.arrowDown), this._wrapper.arrow.classList.add(this._css.arrowUp), this._adjustChildHeight(), this._scrollToItem(), this._fireLocalEventIfExist("open"))) + } + close(e) { + let t = this._isList, + s = !1; + if (null !== e) { + e.stopImmediatePropagation(); + let t = e.target.closest("li"); + s = null !== t && t.classList.contains("disabled") + } + this.disabled || t || s || (this._scrollToIfNeeded(null, 0), this._hide(this._wrapper.listOfItems), this._wrapper.arrow.classList.add(this._css.arrowDown), this._wrapper.arrow.classList.remove(this._css.arrowUp), this._isOpen = !1, this._isMouseDown = !1, this._shiftHolded = !1, this._controlHolded = !1, this._isFilterApplied = !1, this._wrapper.filterInput.value = "", this._wrapper.filterInput.blur(), "false" === this._settings.showFilterAlways.toString() && this._showHideFilterBox(!1), this._applyFilters(), this._unbindDocumentEvents(), this._updateHeaderUI(), this.ele.length !== this._getAllEle(`li.${this._css.item}`, this._wrapper.listOfItems).length && (this._makeChildren(), this.updateUiAndValue()), this._fireLocalEventIfExist("close")) + } + namedItem(e, t = !1) { + let s = null, + i = this.ele.querySelector(`option[name='${e}']`); + if (i && t) { + s = {}; + let e = this._parseOption(i); + s.option = i, s.data = e + } else s = i; + return s + } + item(e, t = !1) { + let s = null, + i = this.ele.options[e]; + if (i && t) { + s = {}; + let e = this._parseOption(i); + s.option = i, s.data = e + } else s = i; + return s + } + visible(e = null) { + if (!0 === e ? this._show(this._wrapper.holder, "inline-block") : !1 === e && this._hide(this._wrapper.holder), null === e) return "none" !== this._wrapper.holder.style.display + } + showRows(e) { + this._settings.visibleRows = e > this.length ? this.length : e, this._adjustChildHeight() + } + visibleRows(e) { + this.showRows(e) + } + on(e, t) { + this._settings.on[e] = t + } + off(e, t) { + this._settings.on[e] = null + } + refresh() { + this._makeChildren(), this.updateUiAndValue() + } + destroy() { + this._show(this.ele), this.ele.required = this._wrapper.valueBox.required, this.ele.name = this._wrapper.valueBox.name, this._wrapper.holder.parentNode.removeChild(this._wrapper.holder) + } + get selectedIndex() { + return this.ele.selectedIndex + } + set selectedIndex(e) { + let t = this, + s = function(e) { + t.ele.selectedIndex = e, -1 === e ? (t._updateHeaderUI(null, ""), t._removeOldSelected()) : t._setSelectedByOptionItem(t.ele.options[e]) + }; + if (e < this.length && !this._isArray(e)) s(e); + else if (this._isMultiple && this._isArray(e)) { + for (let t = 0, s = e.length; t < s; t++) e[t] < this.length && -1 !== e[t] && this._setSelectedByOptionItem(this.ele.options[e[t]], t > 0); + this._updateHeaderUI(null) + } else s(e) + } + get options() { + return this.ele.options + } + set options(e) { + e instanceof HTMLOptionElement ? (this.ele.add(e), this._makeChildren(), this.updateUiAndValue()) : "number" == typeof e && (this.ele.length = e, this._makeChildren(), this.updateUiAndValue()) + } + get optionsUI() { + return this._cacheEle.allItems, this._cacheEle.allItems = this._getAllEle(`li.${this._css.item}`, this._wrapper.listOfItems) + } + get length() { + return this.ele.length + } + set length(e) { + this.ele.options.length = e, this._makeChildren(), this.updateUiAndValue() + } + get value() { + return this.ele.value + } + set value(e) { + this.ele.value = e, this.selectedIndex = this.ele.selectedIndex + } + get selectedText() { + return this.selectedIndex >= 0 ? this.ele.options[this.selectedIndex].text : "" + } + get disabled() { + return this.ele.hasAttribute("disabled") + } + set disabled(e) { + e ? (this.ele.setAttribute("disabled", ""), this._wrapper.holder.classList.add(this._css.wrapperDisabled)) : (this.ele.removeAttribute("disabled"), this._wrapper.holder.classList.remove(this._css.wrapperDisabled)) + } + get form() { + return this.ele.form + } + get multiple() { + return this.ele.multiple + } + set multiple(e) { + e ? (this.ele.setAttribute("multiple", ""), this._enableCheckbox = this._settings.enableCheckbox) : this.ele.removeAttribute("multiple"), this._isMultiple = e, e || (this.selectedIndex = this.ele.selectedIndex, this._enableCheckbox = !1), this._makeChildren() + } + get name() { + return this._wrapper?.valueBox ? this._wrapper.valueBox.name || "" : this.ele.name + } + set name(e) { + this._wrapper?.valueBox ? this._wrapper.valueBox.name = e : this.ele.name = e + } + get required() { + return this._wrapper.valueBox.required + } + set required(e) { + e ? this._wrapper.valueBox.setAttribute("required", !0) : this._wrapper.valueBox.removeAttribute("required") + } + get size() { + return this.ele.size + } + set size(e) { + this.ele.size = e, this._makeUiAsList(e > 1, e) + } + get selectedOptions() { + let e = null; + if (this.selectedIndex >= 0 && (e = this.ele.options[this.selectedIndex], this.multiple)) { + e = []; + let t = this.options, + s = t.length; + for (let i = 0; i < s; i++) t[i].selected && e.push(t[i]); + e = 1 === e.length ? e[0] : e + } + return e + } + get children() { + return this.ele.children + } + get uiData() { + return this._getDataAndUI() + } + get version() { + return "4.0.3" + } + } + class s { + constructor(e, i) { + "string" == typeof e ? document.querySelectorAll(e).forEach((e => { + new s(e, i) + })) : (e.msDropdown = this, this._ddMaker = new t(e, i)) + } + setSettingAttribute(e, t, s = !1) { + this._ddMaker.setSettingAttribute(e, t), s && this._ddMaker.refresh() + } + add(e, t) { + this._ddMaker.add(e, t) + } + remove(e) { + return this._ddMaker.remove(e) + } + next() { + this._ddMaker.next() + } + previous() { + this._ddMaker.previous() + } + open() { + this._ddMaker.open(null, !1) + } + close() { + this._ddMaker.close(null) + } + namedItem(e, t = !1) { + return this._ddMaker.namedItem(e, t) + } + item(e, t = !1) { + return this._ddMaker.item(e, t) + } + visible(e = null) { + return this._ddMaker.visible(e) + } + showRows(e) { + this._ddMaker.showRows(e) + } + visibleRows(e) { + this._ddMaker.showRows(e) + } + on(e, t) { + this._ddMaker.on(e, t) + } + off(e, t) { + this._ddMaker.off(e, t) + } + updateUiAndValue() { + this._ddMaker.updateUiAndValue() + } + refresh() { + this._ddMaker.refresh() + } + destroy() { + this._ddMaker.destroy() + } + get selectedIndex() { + return this._ddMaker.selectedIndex + } + set selectedIndex(e) { + this._ddMaker.selectedIndex = e + } + get options() { + return this._ddMaker.options + } + set options(e) { + this._ddMaker.options = e + } + get optionsUI() { + return this._ddMaker.optionsUI + } + get length() { + return this._ddMaker.length + } + set length(e) { + this._ddMaker.length = e + } + get value() { + return this._ddMaker.value + } + set value(e) { + this._ddMaker.value = e + } + get selectedText() { + return this._ddMaker.selectedText + } + get disabled() { + return this._ddMaker.disabled + } + set disabled(e) { + this._ddMaker.disabled = e + } + get form() { + return this._ddMaker.form + } + get multiple() { + return this._ddMaker.multiple + } + set multiple(e) { + this._ddMaker.multiple = e + } + get name() { + return this._ddMaker.name + } + set name(e) { + this._ddMaker.name = e + } + get required() { + return this._ddMaker.required + } + set required(e) { + this._ddMaker.required = e + } + get size() { + return this._ddMaker.size + } + set size(e) { + this._ddMaker.size = e + } + get selectedOptions() { + return this._ddMaker.selectedOptions + } + get children() { + return this._ddMaker.children + } + get uiData() { + return this._ddMaker.uiData + } + static make(e, t) { + if (!e.msDropdown) try { + let i = new s(e, t); + return e.addEventListener("change", (() => { + e.multiple ? e.msDropdown.refresh() : e.msDropdown.selectedIndex = current.selectedIndex + })), i + } catch (e) { + console.log(e.message) + } + } + static get version() { + return "4.0.3" + } + static get author() { + return "Marghoob Suleman" + } + } + class i extends HTMLSelectElement { + constructor(e, t) { + super() + } + connectedCallback() { + setTimeout((() => { + this.msDropdown || (this.msDropdown = new s(this)); + try { + this.addEventListener("change", (e => { + this.multiple ? this.msDropdown.refresh() : this.msDropdown.selectedIndex = this.selectedIndex + })) + } catch (e) { + console.log(e.message) + } + }), 1) + } + disconnectedCallback() {} + adoptedCallback() {} + attributeChangedCallback(e, t, s) { + if (this.msDropdown && -1 !== e.indexOf("data-")) { + let t = (e = e.replace("data-", "")).toLowerCase().split("-"); + for (let e = 1; e < t.length; e++) t[e] = t[e].charAt(0).toUpperCase() + t[e].substring(1); + this.msDropdown.setSettingAttribute(t.join(""), s, !0) + } + console.log("attributeChangedCallback") + } + static get observedAttributes() { + return ["data-main-css", "data-show-icon", "data-event", "data-child-width", "data-child-height", "data-enable-checkbox", "data-checkbox-name-suffix", "data-enable-auto-filter", "data-visible-rows", "data-show-plus-item-counter", "data-error-message", "data-show-filter-always", "data-show-list-counter", "data-image-position"] + } + } + customElements.define("ms-dropdown", i, { + extends: "select" + }), window.MsDropdown = s, navigator.vendor && navigator.vendor.indexOf("Apple") > -1 && navigator.userAgent && -1 == navigator.userAgent.indexOf("CriOS") && -1 == navigator.userAgent.indexOf("FxiOS") && s.make("select[is='ms-dropdown']") +})(); \ No newline at end of file diff --git a/basicswap/static/js/libs/tv-chart.js b/basicswap/static/js/libs/tv-chart.js deleted file mode 100644 index b7076a1..0000000 --- a/basicswap/static/js/libs/tv-chart.js +++ /dev/null @@ -1,1099 +0,0 @@ -"use strict"; -!(function () { - if (!window.TradingView || !window.TradingView.host || window.TradingView.reoloadTvjs) { - var e, - t, - o, - i, - n, - r, - s, - a = { "color-gull-gray": "#9db2bd", "color-brand": "#2962FF", "color-brand-hover": "#1E53E5", "color-brand-active": "#1848CC" }, - d = "-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif", - l = { - host: null == window.location.host.match(/tradingview\.com|pyrrosinvestment\.com/i) ? "https://s.tradingview.com" : "https://www.tradingview.com", - ideasHost: "https://www.tradingview.com", - chatHost: "https://www.tradingview.com", - widgetHost: "https://www.tradingview-widget.com", - getHost: function (e) { - return e.useWidgetHost ? l.widgetHost : l.host; - }, - embedStylesForCopyright: function () { - var e = document.createElement("style"); - return ( - (e.innerHTML = - ".tradingview-widget-copyright {font-size: 13px !important; line-height: 32px !important; text-align: center !important; vertical-align: middle !important; font-family: " + - d + - " !important; color: " + - a["color-gull-gray"] + - " !important;} .tradingview-widget-copyright .blue-text {color: " + - a["color-brand"] + - " !important;} .tradingview-widget-copyright a {text-decoration: none !important; color: " + - a["color-gull-gray"] + - " !important;} .tradingview-widget-copyright a:visited {color: " + - a["color-gull-gray"] + - " !important;} .tradingview-widget-copyright a:hover .blue-text {color: " + - a["color-brand-hover"] + - " !important;} .tradingview-widget-copyright a:active .blue-text {color: " + - a["color-brand-active"] + - " !important;} .tradingview-widget-copyright a:visited .blue-text {color: " + - a["color-brand"] + - " !important;}"), - e - ); - }, - embedStylesForFullHeight: function (e, t, o) { - var i = t ? "calc(" + e + " - 32px)" : e, - n = document.querySelector("#" + o); - (n.parentElement.style.height = i), (n.style.height = "100%"); - }, - gId: function () { - return "tradingview_" + ((1048576 * (1 + Math.random())) | 0).toString(16).substring(1); - }, - isPersentHeight: function (e) { - return "%" === e; - }, - getSuffix: function (e) { - var t = e.toString().match(/(%|px|em|ex)/); - return t ? t[0] : "px"; - }, - hasCopyright: function (e) { - var t = document.getElementById(e), - o = t && t.parentElement; - return !!o && !!o.querySelector(".tradingview-widget-copyright"); - }, - calculateWidgetHeight: function (e, t) { - var o = parseInt(e), - i = this.getSuffix(e), - n = this.isPersentHeight(i), - r = t && this.hasCopyright(t); - return n && t && (this.embedStylesForFullHeight(o + i, r, t), r) ? 100 + i : r ? "calc(" + o + i + " - 32px)" : o + i; - }, - onready: function (e) { - window.addEventListener ? window.addEventListener("DOMContentLoaded", e, !1) : window.attachEvent("onload", e); - }, - css: function (e) { - var t, - o = document.getElementsByTagName("head")[0], - i = document.createElement("style"); - (i.type = "text/css"), i.styleSheet ? (i.styleSheet.cssText = e) : ((t = document.createTextNode(e)), i.appendChild(t)), o.appendChild(i); - }, - bindEvent: function (e, t, o) { - e.addEventListener ? e.addEventListener(t, o, !1) : e.attachEvent && e.attachEvent("on" + t, o); - }, - unbindEvent: function (e, t, o) { - e.removeEventListener ? e.removeEventListener(t, o, !1) : e.detachEvent && e.detachEvent("on" + t, o); - }, - cloneSimpleObject: function (e) { - if (null == e || "object" != typeof e) return e; - var t = e.constructor(); - for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]); - return t; - }, - isArray: function (e) { - return "[object Array]" === Object.prototype.toString.call(e); - }, - isMobileDevice: - ((e = { Android: /Android/i.test(navigator.userAgent), BlackBerry: /BlackBerry/i.test(navigator.userAgent), iOS: /iPhone|iPad|iPod/i.test(navigator.userAgent), Opera: /Opera Mini/i.test(navigator.userAgent) }), - (e.any = e.Android || e.BlackBerry || e.iOS || e.Opera), - e), - generateUtmForUrlParams: function (e) { - return ( - "utm_source=" + - encodeURI(window.location.hostname) + - "&utm_medium=" + - (l.hasCopyright(e.container) ? "widget_new" : "widget") + - (e.type ? "&utm_campaign=" + e.type : "") + - (e.type && "chart" === e.type ? "&utm_term=" + encodeURIComponent(e.symbol) : "") - ); - }, - WidgetAbstract: function () {}, - MiniWidget: function (e) { - (this.id = l.gId()), - (this.options = { - whitelabel: e.whitelabel || "", - width: l.WidgetAbstract.prototype.fixSize(e.width) || 300, - height: l.WidgetAbstract.prototype.fixSize(e.height) || 400, - symbols: e.symbols, - tabs: e.tabs || "", - symbols_description: e.symbols_description || "", - customer: e.customer || "", - container: e.container_id || "", - greyText: e.greyText || "", - large_chart_url: e.large_chart_url || "", - large_chart_target: e.large_chart_target || "", - gridLineColor: e.gridLineColor || "", - fontColor: e.fontColor || "", - widgetFontColor: e.widgetFontColor || "", - underLineColor: e.underLineColor || "", - underLineBottomColor: e.underLineBottomColor || "", - trendLineColor: e.trendLineColor || "", - timeAxisBackgroundColor: e.timeAxisBackgroundColor || "", - activeTickerBackgroundColor: e.activeTickerBackgroundColor || "", - noGraph: e.noGraph || !1, - locale: e.locale, - styleTickerActiveBg: e.styleTickerActiveBg || "", - styleTabActiveBorderColor: e.styleTabActiveBorderColor || "", - styleTickerBodyFontSize: e.styleTickerBodyFontSize || "", - styleTickerBodyFontWeight: e.styleTickerBodyFontWeight || "", - styleTickerHeadFontSize: e.styleTickerHeadFontSize || "", - styleTickerHeadFontWeight: e.styleTickerHeadFontWeight || "", - styleTickerChangeDownColor: e.styleTickerChangeDownColor || "", - styleTickerChangeUpColor: e.styleTickerChangeUpColor || "", - styleTickerLastDownBg: e.styleTickerLastDownBg || "", - styleTickerLastUpBg: e.styleTickerLastUpBg || "", - styleTickerSymbolColor: e.styleTickerSymbolColor || "", - styleTickerSymbolHoverTextDecoration: e.styleTickerSymbolHoverTextDecoration || "", - styleTickerActiveSymbolTextDecoration: e.styleTickerActiveSymbolTextDecoration || "", - styleTabsActiveBorderColor: e.styleTabsActiveBorderColor || "", - styleTabsNoBorder: e.styleTabsNoBorder || "", - styleWidgetNoBorder: e.styleWidgetNoBorder || "", - useWidgetHost: Boolean(e.useWidgetHost), - }), - this.createWidget(); - }, - MediumWidget: function (e) { - this.id = l.gId(); - const t = l.calculateWidgetHeight(e.height || 400, e.container_id); - let o; - switch (e.chartType) { - case "candlesticks": { - const { chartType: t, upColor: i, downColor: n, borderUpColor: r, borderDownColor: s, wickUpColor: a, wickDownColor: d } = e; - o = { chartType: t, upColor: i, downColor: n, borderUpColor: r, borderDownColor: s, wickUpColor: a, wickDownColor: d }; - break; - } - case "bars": { - const { chartType: t, upColor: i, downColor: n } = e; - o = { chartType: t, upColor: i, downColor: n }; - break; - } - case "line": { - const { chartType: t, color: i, colorGrowing: n, colorFalling: r, lineWidth: s } = e; - o = { chartType: t, color: i, colorGrowing: n, colorFalling: r, lineWidth: s }; - break; - } - case "area": - default: { - const { - chartType: t = "area", - lineColor: i = e.trendLineColor || "", - lineColorGrowing: n, - lineColorFalling: r, - topColor: s = e.underLineColor || "", - bottomColor: a = e.underLineBottomColor || "", - lineWidth: d, - } = e; - o = { chartType: t, lineColor: i, lineColorGrowing: n, lineColorFalling: r, topColor: s, bottomColor: a, lineWidth: d }; - break; - } - } - (this.options = { - container: e.container_id || "", - width: l.WidgetAbstract.prototype.fixSize(e.width) || "", - height: l.WidgetAbstract.prototype.fixSize(t) || "", - symbols: e.symbols, - greyText: e.greyText || "", - symbols_description: e.symbols_description || "", - large_chart_url: e.large_chart_url || "", - customer: e.customer || "", - backgroundColor: e.backgroundColor || "", - gridLineColor: e.gridLineColor || "", - fontColor: e.fontColor || "", - widgetFontColor: e.widgetFontColor || "", - timeAxisBackgroundColor: e.timeAxisBackgroundColor || "", - chartOnly: !!e.chartOnly, - locale: e.locale, - whitelabel: !!e.whitelabel || "", - colorTheme: e.colorTheme, - isTransparent: e.isTransparent, - useWidgetHost: Boolean(e.useWidgetHost), - showFloatingTooltip: e.showFloatingTooltip, - valuesTracking: e.valuesTracking, - showVolume: e.showVolume, - volumeUpColor: e.volumeUpColor, - volumeDownColor: e.volumeDownColor, - hideDateRanges: e.hideDateRanges, - scalePosition: e.scalePosition, - scaleMode: e.scaleMode, - fontFamily: e.fontFamily, - noTimeScale: e.noTimeScale, - ...o, - }), - this.createWidget(); - }, - widget: function (e) { - this.id = e.id || l.gId(); - var t = l.getUrlParams(), - o = e.tvwidgetsymbol || t.tvwidgetsymbol || t.symbol || e.symbol || "NASDAQ:AAPL", - i = e.logo || ""; - i.src && (i = i.src), i && i.replace(".png", ""); - var n = l.calculateWidgetHeight(e.height || 500, e.container_id); - (this.options = { - whitelabel: e.whitelabel || "", - width: e.width || 800, - height: n, - symbol: o, - interval: e.interval || "1", - range: e.range || "", - timezone: e.timezone || "", - autosize: e.autosize, - hide_top_toolbar: e.hide_top_toolbar, - hide_side_toolbar: e.hide_side_toolbar, - hide_legend: e.hide_legend, - allow_symbol_change: e.allow_symbol_change, - save_image: void 0 === e.save_image || e.save_image, - container: e.container_id || "", - toolbar_bg: e.toolbar_bg || "f4f7f9", - watchlist: e.watchlist || [], - editablewatchlist: !!e.editablewatchlist, - studies: e.studies || [], - theme: e.theme || "", - style: e.style || "", - extended_hours: void 0 === e.extended_hours ? void 0 : +e.extended_hours, - details: !!e.details, - calendar: !!e.calendar, - hotlist: !!e.hotlist, - hideideas: !!e.hideideas, - hideideasbutton: !!e.hideideasbutton, - widgetbar_width: +e.widgetbar_width || void 0, - withdateranges: e.withdateranges || "", - customer: e.customer || i || "", - venue: e.venue, - symbology: e.symbology, - logo: i, - show_popup_button: !!e.show_popup_button, - popup_height: e.popup_height || "", - popup_width: e.popup_width || "", - studies_overrides: e.studies_overrides, - overrides: e.overrides, - enabled_features: e.enabled_features, - disabled_features: e.disabled_features, - publish_source: e.publish_source || "", - enable_publishing: e.enable_publishing, - whotrades: e.whotrades || void 0, - locale: e.locale, - referral_id: e.referral_id, - no_referral_id: e.no_referral_id, - fundamental: e.fundamental, - percentage: e.percentage, - hidevolume: e.hidevolume, - padding: e.padding, - greyText: e.greyText || "", - horztouchdrag: e.horztouchdrag, - verttouchdrag: e.verttouchdrag, - useWidgetHost: Boolean(e.useWidgetHost), - }), - e.cme && (this.options.customer = "cme"), - isFinite(e.widgetbar_width) && e.widgetbar_width > 0 && (this.options.widgetbar_width = e.widgetbar_width), - (this._ready_handlers = []), - this.create(); - }, - chart: function (e) { - (this.id = l.gId()), - (this.options = { - width: e.width || 640, - height: e.height || 500, - container: e.container_id || "", - realtime: e.realtime, - chart: e.chart, - locale: e.locale, - type: "chart", - autosize: e.autosize, - mobileStatic: e.mobileStatic, - }), - (this._ready_handlers = []), - this.create(); - }, - stream: function (e) { - (this.id = l.gId()), (this.options = { width: e.width || 640, height: e.height || 500, container: e.container_id || "", stream: e.stream, locale: e.locale, autosize: e.autosize }), this.create(); - }, - EventsWidget: function (e) { - (this.id = l.gId()), - (this.options = { container: e.container_id || "", width: e.width || 486, height: e.height || 670, currency: e.currencyFilter || "", importance: e.importanceFilter || "", type: "economic-calendar" }), - this.createWidget(e); - }, - IdeasStreamWidget: function (e) { - (this.id = l.gId()), - (this.options = { - container: e.container_id || "", - width: e.width || 486, - height: e.height || 670, - symbol: e.symbol || "", - username: e.username || "", - mode: e.mode || "", - publishSource: e.publishSource || "", - sort: e.sort || "trending", - stream: e.stream, - waitSymbol: e.waitSymbol, - hideDescription: e.hideDescription, - startingCount: e.startingCount, - bgColor: e.bgColor || "", - headerColor: e.headerColor || "", - borderColor: e.borderColor || "", - locale: e.locale, - type: "ideas-stream", - useWidgetHost: Boolean(e.useWidgetHost), - }), - (this._ready_handlers = []), - this.createWidget(); - }, - IdeaWidget: function (e) { - (this.id = l.gId()), - (this.options = { container: e.container_id || "", width: e.width || 486, height: e.height || 670, idea: e.idea || "", chartUrl: e.chartUrl || "", whotrades: e.whotrades || void 0, locale: e.locale, type: "idea" }), - this.createWidget(e); - }, - ChatWidgetEmbed: function (e) { - (this.id = l.gId()), - (this.options = { container: e.container_id || "", width: e.width || 400, height: e.height || 500, room: e.room || "", whotrades: e.whotrades || void 0, locale: e.locale, type: "chat-embed" }), - this.createWidget(e); - }, - }; - (l.WidgetAbstract.prototype = { - fixSize: function (e) { - return /^[0-9]+(\.|,[0-9])*$/.test(e) ? e + "px" : e; - }, - width: function () { - return this.options.autosize ? "100%" : l.WidgetAbstract.prototype.fixSize(this.options.width); - }, - height: function () { - return this.options.autosize ? "100%" : l.WidgetAbstract.prototype.fixSize(this.options.height); - }, - addWrapperFrame: function (e, t, o) { - var i = l.WidgetAbstract.prototype.height.call(this), - n = l.WidgetAbstract.prototype.width.call(this); - o = o || "transparent"; - return ( - '
' + - e + - "
" + - (t || "") + - "
" - ); - }, - addFooterLogo: function (e, t) { - var o = (t || {}).greyText || "powered by", - i = (t || {}).linkText || "tradingview.com", - n = (t || {}).href || "https://www.tradingview.com/"; - return l.WidgetAbstract.prototype.addWrapperFrame.call( - this, - e, - '
' + - o + - " " + - i + - "
", - "#fff" - ); - }, - }), - (l.ChatWidgetEmbed.prototype = { - createWidget: function () { - var e = this.widgetCode(); - (e = l.WidgetAbstract.prototype.addFooterLogo.call(this, e)), h(e, this.options.container); - }, - widgetCode: function () { - var e = this.options.room ? "#" + encodeURIComponent(this.options.room) : "", - t = "&" + l.createUrlParams({ whotrades: this.options.whotrades, locale: this.options.locale }), - o = l.generateUtmForUrlParams(this.options, { type: "UserInfoWidget" }); - return ( - '' - ); - }, - }), - (l.IdeaWidget.prototype = { - createWidget: function () { - var e = this.widgetCode(); - h(e, this.options.container); - var t = this, - o = document.getElementById(this.id); - (this.postMessage = l.postMessageWrapper(o.contentWindow, this.id)), - this.postMessage.on( - "resize", - function (e) { - e.id === t.id && (o.style.height = e.height + "px"); - }, - !0 - ); - }, - widgetCode: function () { - var e = l.createUrlParams({ - id: this.id, - width: this.options.width, - height: this.options.height, - idea: this.options.idea, - chart_url: this.options.chartUrl, - whotrades: this.options.whotrades, - locale: this.options.locale, - }); - this.options.type = "idea"; - var t = "&" + l.generateUtmForUrlParams(this.options), - o = l.ideasHost + "/idea-popup/?" + e + t; - return ( - '' - ); - }, - getSymbol: function (e) { - this.postMessage.on("symbolInfo", e); - }, - }), - (l.EventsWidget.prototype = { - createWidget: function () { - var e = this.widgetCode(); - h(e, this.options.container); - }, - widgetCode: function () { - var e = l.createUrlParams({ currency: this.options.currency, importance: this.options.importance }); - this.options.type = "events"; - var t = "&" + l.generateUtmForUrlParams(this.options); - return ( - '' - ); - }, - }), - (l.IdeasStreamWidget.prototype = { - createWidget: function () { - var e = this.widgetCode(); - h(e, this.options.container); - var t = this, - o = document.getElementById(this.id); - (this.postMessage = l.postMessageWrapper(o.contentWindow, this.id)), - l.bindEvent(o, "load", function () { - t._ready = !0; - for (var e = t._ready_handlers.length; e--; ) t._ready_handlers[e].call(t); - }), - t.postMessage.on( - "resize", - function (e) { - if (e.id === t.id) { - var i = Math.max(e.height, 450); - o.style.height = i + "px"; - } - }, - !0 - ); - }, - widgetCode: function () { - var e = this.options, - t = l.createUrlParams({ - id: this.id, - width: e.width, - height: e.height, - symbol: e.symbol, - username: e.username, - mode: e.mode, - publish_source: e.publishSource, - sort: e.sort, - stream: e.stream, - wait_symbol: e.waitSymbol, - hide_desc: e.hideDescription, - s_count: e.startingCount, - bg_color: e.bgColor, - h_color: e.headerColor, - borderColor: e.borderColor, - locale: e.locale, - useWidgetHost: Boolean(e.useWidgetHost), - }), - o = l.generateUtmForUrlParams(this.options) + "&", - i = l.getHost(e) + "/ideaswidgetembed/?" + o + t; - return ''; - }, - setSymbol: function (e) { - var t = document.getElementById(this.id); - this.postMessage.post(t.contentWindow, "setSymbol", e); - }, - ready: function (e) { - this._ready ? e.call(this) : this._ready_handlers.push(e); - }, - }), - (l.MiniWidget.prototype = { - createWidget: function () { - var e = this.widgetCode(), - t = this.options; - if (!t.noLogoOverlay && !t.whitelabel) { - var o = this.options.greyText || "Quotes by"; - e = l.WidgetAbstract.prototype.addFooterLogo.call(this, e, { greyText: o, linkText: "TradingView" }); - } - h(e, t.container); - }, - widgetCode: function () { - var e = "", - t = "", - o = "", - i = "/miniwidgetembed/", - n = this.options.width ? "&width=" + encodeURIComponent(this.options.width) : "", - r = this.options.height ? "&height=" + encodeURIComponent(this.options.height) : "", - s = this.options.noGraph ? "&noGraph=" + encodeURIComponent(this.options.noGraph) : "", - a = this.options.locale ? "&locale=" + encodeURIComponent(this.options.locale) : "", - d = this.options.whitelabel ? "&whitelabel=1" : ""; - this.options.type = "market-overview"; - for ( - var h = "&" + l.generateUtmForUrlParams(this.options), - c = [ - "large_chart_url", - "large_chart_target", - "backgroundColor", - "gridLineColor", - "fontColor", - "underLineColor", - "underLineBottomColor", - "trendLineColor", - "activeTickerBackgroundColor", - "timeAxisBackgroundColor", - "locale", - "styleTickerActiveBg", - "styleTabActiveBorderColor", - "styleTickerBodyFontSize", - "styleTickerBodyFontWeight", - "styleTickerHeadFontSize", - "styleTickerHeadFontWeight", - "styleTickerChangeDownColor", - "styleTickerChangeUpColor", - "styleTickerLastDownBg", - "styleTickerLastUpBg", - "styleTickerSymbolColor", - "styleTickerSymbolHoverTextDecoration", - "styleTickerActiveSymbolTextDecoration", - "styleTabsActiveBorderColor", - "styleTabsNoBorder", - "styleWidgetNoBorder", - ], - p = "", - g = c.length - 1; - g >= 0; - g-- - ) { - var m = c[g], - u = this.options[m]; - p += u ? "&" + m + "=" + encodeURIComponent(u) : ""; - } - var y = function (e) { - for (var t = [], i = 0; i < e.length; i++) { - var n = e[i]; - if (l.isArray(n)) { - var r = encodeURIComponent(n[0]), - s = encodeURIComponent(n[1]); - t.push(r), (o += "&" + r + "=" + s); - } else "string" == typeof n && t.push(encodeURIComponent(n)); - } - return t.join(","); - }; - if (this.options.tabs) { - g = 0; - for (var w = this.options.tabs.length; g < w; g++) { - var b = this.options.tabs[g]; - this.options.symbols[b] && (e += (e ? "&" : "") + encodeURIComponent(b) + "=" + y(this.options.symbols[b])); - } - t = "&tabs=" + encodeURIComponent(this.options.tabs.join(",")); - } else this.options.symbols && (e = "symbols=" + y(this.options.symbols)); - if (this.options.symbols_description) for (var f in this.options.symbols_description) o += "&" + encodeURIComponent(f) + "=" + encodeURIComponent(this.options.symbols_description[f]); - this.options.customer && (i = "/" + this.options.customer + i); - var v = l.getHost(this.options) + i + "?" + e + t + o + p + n + r + s + a + d + h; - return ( - '' - ); - }, - remove: function () { - var e = document.getElementById("tradingview_widget"); - e.parentNode.removeChild(e); - }, - }), - (l.MediumWidget.prototype = { - createWidget: function () { - var e = this.widgetCode(); - h(e, this.options.container); - }, - widgetCode: function () { - var e = "", - t = - "symbols=" + - (function (t) { - for (var o = [], i = 0; i < t.length; i++) { - var n = t[i]; - if (l.isArray(n)) { - var r = encodeURIComponent(n[0]), - s = encodeURIComponent(n[1]); - o.push(r), 2 === n.length && (e += "&" + r + "=" + s); - } else "string" == typeof n && o.push(encodeURIComponent(n)); - } - return o.join(","); - })(this.options.symbols), - o = "&width=" + encodeURIComponent(this.options.width), - i = "&height=" + encodeURIComponent(this.options.height), - n = "&colorTheme=" + encodeURIComponent(this.options.colorTheme); - this.options.type = "symbol-overview"; - var r = "&" + l.generateUtmForUrlParams(this.options); - for ( - var s = [ - "backgroundColor", - "gridLineColor", - "fontColor", - "widgetFontColor", - "underLineColor", - "underLineBottomColor", - "trendLineColor", - "activeTickerBackgroundColor", - "timeAxisBackgroundColor", - "locale", - "scalePosition", - "scaleMode", - "chartType", - "color", - "colorGrowing", - "colorFalling", - "lineColor", - "lineColorGrowing", - "lineColorFalling", - "topColor", - "bottomColor", - "upColor", - "downColor", - "borderUpColor", - "borderDownColor", - "wickUpColor", - "wickDownColor", - "fontFamily", - "noTimeScale", - "valuesTracking", - "lineWidth", - "volumeUpColor", - "volumeDownColor", - ], - a = "", - d = s.length - 1; - d >= 0; - d-- - ) { - var h = s[d], - c = this.options[h]; - a += c ? "&" + h + "=" + encodeURIComponent(c) : ""; - } - var p = this.options.chartOnly ? "&chartOnly=1" : "", - g = this.options.whitelabel ? "&whitelabel=1" : "", - m = this.options.isTransparent ? "&isTransparent=1" : "", - u = this.options.showFloatingTooltip ? "&showFloatingTooltip=1" : "", - y = this.options.showVolume ? "&showVolume=1" : "", - w = this.options.hideDateRanges ? "&hideDateRanges=1" : "", - b = "/mediumwidgetembed/"; - this.options.customer && (b = "/" + this.options.customer + b); - var f = l.getHost(this.options) + b + "?" + t + e + a + p + g + o + i + n + m + r + u + y + w; - return ( - '' - ); - }, - remove: function () { - var e = document.getElementById("tradingview_widget"); - e.parentNode.removeChild(e); - }, - }), - (l.widget.prototype = { - create: function () { - this.options.type = this.options.fundamental ? "fundamental" : "chart"; - var e = this.render(), - t = this; - this.options.noLogoOverlay || (e = l.WidgetAbstract.prototype.addWrapperFrame.call(this, e)), h(e, this.options.container); - var o = document.getElementById("tradingview-copyright"); - o && o.parentElement && o.parentElement.removeChild(o), - (this.iframe = document.getElementById(this.id)), - (this.postMessage = l.postMessageWrapper(this.iframe.contentWindow, this.id)), - l.bindEvent(this.iframe, "load", function () { - t.postMessage.get("widgetReady", {}, function () { - var e; - for (t._ready = !0, e = t._ready_handlers.length; e--; ) t._ready_handlers[e].call(t); - }); - }), - t.postMessage.on("logoCreated", function (e) { - if (e.left && e.bottom && e.width && e.height && e.href) { - t._logoOverlay && (t._logoOverlay.parentNode.removeChild(t._logoOverlay), delete t._logoOverlay); - var o = document.createElement("a"); - e.text && ((o.textContent = e.text), (o.style.color = "transparent")), - (o.style.position = "absolute"), - (o.style.display = "inline-block"), - (o.style.left = e.left), - (o.style.bottom = e.bottom), - (o.style.width = e.width), - (o.style.height = e.height), - (o.style.backgroundColor = "transparent"), - (o.style.pointerEvents = "none"), - (o.href = e.href), - o.setAttribute("target", "_blank"), - (t._logoOverlay = o), - document.getElementById(t.id + "-wrapper").appendChild(o); - } - }), - t.postMessage.on("setLogoOverlayVisibility", function (e) { - t._logoOverlay && e && "boolean" == typeof e.visible && (t._logoOverlay.style.display = e.visible ? "inline-block" : "none"); - }), - t.postMessage.on("openChartInPopup", function (e) { - for (var o = l.cloneSimpleObject(t.options), i = ["symbol", "interval"], n = i.length - 1; n >= 0; n--) { - var r = i[n], - s = e[r]; - s && (o[r] = s); - } - o.show_popup_button = !1; - var a = t.options.popup_width || 900, - d = t.options.popup_height || 600, - h = (screen.width - a) / 2, - c = (screen.height - d) / 2, - p = window.open(t.generateUrl(o), "_blank", "resizable=yes, top=" + c + ", left=" + h + ", width=" + a + ", height=" + d); - p && (p.opener = null); - }); - }, - ready: function (e) { - this._ready ? e.call(this) : this._ready_handlers.push(e); - }, - render: function () { - var e = this.generateUrl(); - return ''; - }, - generateUrl: function (e) { - var t; - function o(t, o) { - return (o = o || t), void 0 === e[t] ? "" : "&" + encodeURIComponent(o) + "=" + (e[t] ? "1" : "0"); - } - function i(t, o, i) { - return (i = i || t), e[t] ? "&" + i + "=" + o : ""; - } - function n(t, o, i) { - return (i = i || {}), "&" + t + "=" + (e[t] ? encodeURIComponent(JSON.stringify(o)) : encodeURIComponent(JSON.stringify(i))); - } - return ( - (t = "cme" === (e = e || this.options).customer ? "/cmewidgetembed/" : e.customer ? "/" + e.customer + "/widgetembed/" : "/widgetembed/"), - (e.enable_publishing ? l.ideasHost : l.getHost(e)) + - t + - "?frameElementId=" + - this.id + - "&symbol=" + - encodeURIComponent(e.symbol) + - "&interval=" + - encodeURIComponent(e.interval) + - (e.range ? "&range=" + encodeURIComponent(e.range) : "") + - (e.whitelabel ? "&whitelabel=1" : "") + - (e.hide_top_toolbar ? "&hidetoptoolbar=1" : "") + - (e.hide_legend ? "&hidelegend=1" : "") + - o("hide_side_toolbar", "hidesidetoolbar") + - o("allow_symbol_change", "symboledit") + - o("save_image", "saveimage") + - "&toolbarbg=" + - e.toolbar_bg.replace("#", "") + - (e.watchlist && e.watchlist.length && e.watchlist.join ? "&watchlist=" + encodeURIComponent(e.watchlist.join("")) : "") + - i("editablewatchlist", "1") + - i("details", "1") + - i("calendar", "1") + - i("hotlist", "1") + - (e.studies && l.isArray(e.studies) ? ("string" == typeof e.studies[0] ? i("studies", encodeURIComponent(e.studies.join(""))) : n("studies", e.studies)) : "") + - o("horztouchdrag") + - o("verttouchdrag") + - i("widgetbar_width", e.widgetbar_width, "widgetbarwidth") + - i("hideideas", "1") + - i("theme", encodeURIComponent(e.theme)) + - i("style", encodeURIComponent(e.style)) + - (void 0 === e.extended_hours ? "" : "&extended_hours=" + e.extended_hours) + - i("timezone", encodeURIComponent(e.timezone)) + - i("hideideasbutton", "1") + - i("withdateranges", "1") + - i("hidevolume", "1") + - (void 0 === e.padding ? "" : "&padding=" + e.padding) + - i("show_popup_button", "1", "showpopupbutton") + - n("studies_overrides", e.studies_overrides, {}) + - n("overrides", e.overrides, {}) + - n("enabled_features", e.enabled_features, []) + - n("disabled_features", e.disabled_features, []) + - (e.show_popup_button ? "&showpopupbutton=1" : "") + - (e.publish_source ? "&publishsource=" + encodeURIComponent(e.publish_source) : "") + - (e.enable_publishing ? "&enablepublishing=" + encodeURIComponent(e.enable_publishing) : "") + - (e.venue ? "&venue=" + encodeURIComponent(e.venue) : "") + - (e.symbology ? "&symbology=" + encodeURIComponent(e.symbology) : "") + - (e.whotrades ? "&whotrades=" + encodeURIComponent(e.whotrades) : "") + - (e.locale ? "&locale=" + e.locale : "") + - (e.referral_id ? "&referral_id=" + e.referral_id : "") + - (e.no_referral_id ? "&no_referral_id=1" : "") + - (e.fundamental ? "&fundamental=" + encodeURIComponent(e.fundamental) : "") + - (e.percentage ? "&percentage=" + encodeURIComponent(e.percentage) : "") + - "&utm_source=" + - encodeURI(window.location.hostname) + - "&utm_medium=" + - (l.hasCopyright(e.container) ? "widget_new" : "widget") + - (e.type ? "&utm_campaign=" + e.type : "") + - (e.type && "chart" === e.type ? "&utm_term=" + encodeURIComponent(e.symbol) : "") - ); - }, - image: function (e) { - this.postMessage.get("imageURL", {}, function (t) { - var o = l.host + "/x/" + t + "/"; - e(o); - }); - }, - subscribeToQuote: function (e) { - var t = document.getElementById(this.id); - this.postMessage.post(t.contentWindow, "quoteSubscribe"), this.postMessage.on("quoteUpdate", e); - }, - getSymbolInfo: function (e) { - this.postMessage.get("symbolInfo", {}, e); - }, - remove: function () { - var e = document.getElementById(this.id); - e.parentNode.removeChild(e); - }, - reload: function () { - var e = document.getElementById(this.id), - t = e.parentNode; - t.removeChild(e), (t.innerHTML = this.render()); - }, - }), - (l.chart.prototype = { - create: function () { - this.isMobile = l.isMobileDevice.any; - var e, - t = this.render(), - o = this; - l.chartCssAttached || (l.css(this.renderCss()), (l.chartCssAttached = !0)), - h(t, this.options.container), - (e = document.getElementById(this.id)), - l.bindEvent(e, "load", function () { - var e; - for (o._ready = !0, e = o._ready_handlers.length; e--; ) o._ready_handlers[e].call(o); - }), - l.onready(function () { - var t = !1; - if ((document.querySelector && document.querySelector('a[href$="/v/' + o.options.chart + '/"]') && (t = !0), !t)) - for (var i = document.getElementsByTagName("a"), n = new RegExp("/v/" + o.options.chart + "/$"), r = new RegExp("/chart/([0-9a-zA-Z:+*-/()]+)/" + o.options.chart), s = 0; s < i.length; s++) - if (n.test(i[s].href) || r.test(i[s].href)) { - t = !0; - break; - } - t && ((e.src += "#nolinks"), (e.name = "nolinks")); - }), - (this.postMessage = l.postMessageWrapper(e.contentWindow, this.id)), - this.postMessage.on( - "toggleFullscreen", - function (t) { - e.contentWindow === this.source && o.toggleFullscreen(t.value); - }, - !0 - ); - }, - ready: l.widget.prototype.ready, - renderCss: function () { - return ".tradingview-widget {position: relative;}"; - }, - render: function () { - var e = this.options.mobileStatic && this.isMobile ? l.host + "/embed-static/" : l.host + "/embed/", - t = "?method=script" + (this.options.locale ? "&locale=" + encodeURIComponent(this.options.locale) : ""); - return ( - (this.options.type = "chart"), - '
' - ); - }, - toggleFullscreen: function (e) { - var t = document.getElementById(this.id); - e - ? ((t.style.position = "fixed"), - (t.style.width = "100vw"), - (t.style.maxWidth = "100%"), - (t.style.height = "100vh"), - (t.style.maxHeight = "100%"), - (t.style.left = "0px"), - (t.style.top = "0px"), - (t.style.zIndex = "1000000"), - (t.style.backgroundColor = "#fff")) - : ((t.style.position = "static"), - this.options.autosize ? ((t.style.width = "100%"), (t.style.height = "100%")) : ((t.style.width = this.options.width + "px"), (t.style.height = this.options.height + "px")), - (t.style.maxWidth = "none"), - (t.style.maxHeight = "none"), - (t.style.zIndex = "auto"), - (t.style.backgroundColor = "transparent")); - }, - getSymbolInfo: function (e) { - this.postMessage.get("symbolInfo", {}, e); - }, - }), - (l.stream.prototype = { - create: function () { - this.isMobile = l.isMobileDevice.any; - var e = this.render(); - h(e, this.options.container); - }, - render: function () { - var e = "?" + (this.options.locale ? "&locale=" + encodeURIComponent(this.options.locale) : ""); - return ( - (this.options.type = "chart"), - '
' - ); - }, - }), - (l.postMessageWrapper = - ((o = {}), - (i = {}), - (n = {}), - (r = 0), - (s = 0), - window.addEventListener && - window.addEventListener("message", function (e) { - var n; - try { - n = JSON.parse(e.data); - } catch (e) { - return; - } - if (n && n.provider && "TradingView" === n.provider) - if (((n.source = e.source), "get" === n.type)) { - if (!i[n.name]) return; - i[n.name].forEach(function (e) { - "function" == typeof e && - e.call(n, n.data, function (e) { - var o = { id: n.id, type: "on", name: n.name, client_id: n.client_id, data: e, provider: "TradingView" }; - t.postMessage(JSON.stringify(o), "*"); - }); - }); - } else if ("on" === n.type) o[n.client_id] && o[n.client_id][n.id] && (o[n.client_id][n.id].call(n, n.data), delete o[n.client_id][n.id]); - else if ("post" === n.type) { - if (!i[n.name]) return; - i[n.name].forEach(function (e) { - "function" == typeof e && e.call(n, n.data, function () {}); - }); - } - }), - function (e, a) { - return ( - (o[a] = {}), - (n[a] = e), - (t = e), - { - on: function (e, t, o) { - (i[e] && o) || (i[e] = []), i[e].push(t); - }, - off: function (e, t) { - if (!i[e]) return !1; - var o = i[e].indexOf(t); - o > -1 && i[e].splice(o, 1); - }, - get: function (e, t, i) { - var s = { id: r++, type: "get", name: e, client_id: a, data: t, provider: "TradingView" }; - (o[a][s.id] = i), n[a].postMessage(JSON.stringify(s), "*"); - }, - post: function (e, t, o) { - var i = { id: s++, type: "post", name: t, data: o, provider: "TradingView" }; - e && "function" == typeof e.postMessage && e.postMessage(JSON.stringify(i), "*"); - }, - } - ); - })), - (l.getUrlParams = function () { - for ( - var e = /\+/g, - t = /([^&=]+)=?([^&]*)/g, - o = window.location.search.substring(1), - i = t.exec(o), - n = function (t) { - return decodeURIComponent(t.replace(e, " ")); - }, - r = {}; - i; - - ) - (r[n(i[1])] = n(i[2])), (i = t.exec(o)); - return r; - }), - (l.createUrlParams = function (e) { - var t = []; - for (var o in e) e.hasOwnProperty(o) && null != e[o] && t.push(encodeURIComponent(o) + "=" + encodeURIComponent(e[o])); - return t.join("&"); - }); - var h = function (e, t) { - var o = document.getElementById(t); - if (o) { - o.innerHTML = e; - var i = o.parentElement && o.parentElement.querySelector(".tradingview-widget-copyright"); - i && (i.style.width = o.querySelector("iframe").style.width); - } else document.write(e); - document.body.appendChild(l.embedStylesForCopyright()); - }, - c = function (e, t) { - for (var o in t) "object" == typeof t[o] && e.hasOwnProperty(o) ? c(e[o], t[o]) : (e[o] = t[o]); - return e; - }; - window.TradingView ? c(window.TradingView, l) : (window.TradingView = l); - } -})(); diff --git a/basicswap/templates/404.html b/basicswap/templates/404.html index 3c9736f..b1ecfaa 100644 --- a/basicswap/templates/404.html +++ b/basicswap/templates/404.html @@ -26,71 +26,70 @@ - {% for m in messages %} + {% for m in messages %} -
-
-
-
-
-
-
- - - -
-
-

{{ m }}

-
-
-
- -
-
-
-
+ - {% endfor %} + {% endfor %} - {% for m in err_messages %} + {% for m in err_messages %} -
-
-
-
-
-
-
- - - -
-
-

-

Error: {{ m }}

-

-
-
-
- -
-
-
-
+ - {% endfor %} + {% endfor %}
@@ -111,10 +110,6 @@
- - - -
diff --git a/basicswap/templates/automation_strategies.html b/basicswap/templates/automation_strategies.html index 1da3106..c93fc8a 100644 --- a/basicswap/templates/automation_strategies.html +++ b/basicswap/templates/automation_strategies.html @@ -44,71 +44,70 @@ - {% for m in messages %} + {% for m in messages %} -
-
-
-
-
-
-
- - - + + + {% endfor %} + + {% for m in err_messages %} + +
-
- -
-
-
-
+ - {% endfor %} - - {% for m in err_messages %} - -
-
-
-
-
-
-
- - - -
-
-

-

Error: {{ m }}

-

-
-
-
- -
-
-
-
- - {% endfor %} + {% endfor %}
@@ -212,7 +211,7 @@ {% for s in strategies %} - {{ s[1] }} + {{ s[1] }} {{ s[2] }} diff --git a/basicswap/templates/automation_strategy.html b/basicswap/templates/automation_strategy.html index 28f0875..b3ca255 100644 --- a/basicswap/templates/automation_strategy.html +++ b/basicswap/templates/automation_strategy.html @@ -41,71 +41,70 @@
- {% for m in messages %} + {% for m in messages %} -
-
-
-
-
-
-
- - - -
-
-

{{ m }}

-
-
-
- -
-
-
-
+ - {% endfor %} + {% endfor %} - {% for m in err_messages %} + {% for m in err_messages %} -
-
-
-
-
-
-
- - - -
-
-

-

Error: {{ m }}

-

-
-
-
- -
-
-
-
+ - {% endfor %} + {% endfor %}
@@ -142,13 +141,13 @@ Data - Notes - diff --git a/basicswap/templates/automation_strategy_new.html b/basicswap/templates/automation_strategy_new.html index 47caa1b..f7a6347 100644 --- a/basicswap/templates/automation_strategy_new.html +++ b/basicswap/templates/automation_strategy_new.html @@ -41,71 +41,70 @@
- {% for m in messages %} + {% for m in messages %} -
-
-
-
-
-
-
- - - + + + {% endfor %} + + {% for m in err_messages %} + +
-
- -
-
-
-
+ - {% endfor %} - - {% for m in err_messages %} - -
-
-
-
-
-
-
- - - -
-
-

-

Error: {{ m }}

-

-
-
-
- -
-
-
-
- - {% endfor %} + {% endfor %}
diff --git a/basicswap/templates/bid.html b/basicswap/templates/bid.html index a3dd521..e61f50e 100644 --- a/basicswap/templates/bid.html +++ b/basicswap/templates/bid.html @@ -54,74 +54,70 @@
- {% for m in messages %} + {% for m in messages %} -
-
-
-
-
-
-
- - - + + + {% endfor %} + + {% for m in err_messages %} + +
-
- -
-
-
-
- - {% endfor %} - - {% for m in err_messages %} - -
-
-
-
-
-
-
- - - -
-
-

-

Error: {{ m }}

-

-
-
-
- -
-
-
-
- - {% endfor %} - - + + {% endfor %}
@@ -371,10 +367,38 @@ {% else %} + {% if data.show_bidder_seq_diagram %} +
+ +
+ {% else %} +
+ +
+ {% endif %} + {% if data.show_offerer_seq_diagram %} +
+ +
+ {% else %} +
+ +
+ {% endif %} + + {% if data.can_abandon == true %}
-
@@ -412,33 +436,23 @@ {% endif %} + +
- {% if data.show_bidder_seq_diagram %} - - {% else %} - - {% endif %} - - {% if data.show_offerer_seq_diagram %} - - {% else %} - - - {% endif %} {% if data.show_bidder_seq_diagram %} - + {% endif %} {% if data.show_offerer_seq_diagram %} - + {% endif %} diff --git a/basicswap/templates/bid_xmr.html b/basicswap/templates/bid_xmr.html index 1297d20..609e361 100644 --- a/basicswap/templates/bid_xmr.html +++ b/basicswap/templates/bid_xmr.html @@ -54,71 +54,70 @@
- {% for m in messages %} + {% for m in messages %} -
-
-
-
-
-
-
- - - + + + {% endfor %} + + {% for m in err_messages %} + +
-
- -
-
-
-
+ - {% endfor %} - - {% for m in err_messages %} - -
-
-
-
-
-
-
- - - -
-
-

-

Error: {{ m }}

-

-
-
-
- -
-
-
-
- - {% endfor %} + {% endfor %}
@@ -565,18 +564,38 @@ {% else %} - {% if data.was_received == 'True' %} + {% if data.show_bidder_seq_diagram %} +
+ +
+ {% else %} +
+ +
+ {% endif %} + {% if data.show_offerer_seq_diagram %} +
+ +
+ {% else %} +
+ +
+ {% endif %} -
- -
- {% endif %} {% if data.can_abandon == true %}
-
@@ -604,15 +623,13 @@ {% endif %} - {% if data.show_bidder_seq_diagram %} - - {% else %} - - {% endif %} - {% if data.show_offerer_seq_diagram %} - - {% else %} - + {% if data.was_received == 'True' %} + +
+ +
+ {% endif %}
diff --git a/basicswap/templates/bids.html b/basicswap/templates/bids.html index 03495e8..ddab01f 100644 --- a/basicswap/templates/bids.html +++ b/basicswap/templates/bids.html @@ -148,7 +148,7 @@ - Clear Filters + Clear diff --git a/basicswap/templates/debug.html b/basicswap/templates/debug.html index 859f3e3..6328115 100644 --- a/basicswap/templates/debug.html +++ b/basicswap/templates/debug.html @@ -42,71 +42,71 @@
- {% for m in messages %} + {% for m in messages %} -
-
-
-
-
-
-
- - - -
-
-

{{ m }}

-
-
-
- -
-
-
-
+ - {% endfor %} + {% endfor %} - {% for m in err_messages %} + {% for m in err_messages %} -
-
-
-
-
-
-
- - - -
-
-

-

Error: {{ m }}

-

-
-
-
- -
-
-
-
+ - {% endfor %} + {% endfor %} +
diff --git a/basicswap/templates/explorers.html b/basicswap/templates/explorers.html index 67521de..143c67a 100644 --- a/basicswap/templates/explorers.html +++ b/basicswap/templates/explorers.html @@ -41,71 +41,70 @@
- {% for m in messages %} + {% for m in messages %} -
-
-
-
-
-
-
- - - + + + {% endfor %} + + {% for m in err_messages %} + +
-
- -
-
-
-
+ - {% endfor %} - - {% for m in err_messages %} - -
-
-
-
-
-
-
- - - -
-
-

-

Error: {{ m }}

-

-
-
-
- -
-
-
-
- - {% endfor %} + {% endfor %}
@@ -191,7 +190,7 @@ - diff --git a/basicswap/templates/footer.html b/basicswap/templates/footer.html index dc35cd0..4ed5a8d 100644 --- a/basicswap/templates/footer.html +++ b/basicswap/templates/footer.html @@ -24,10 +24,10 @@
-

© 2022~ BasicSwap

-

version {{ version }}

+

© 2022~

+

{{ title }}

-

GUI version 0.1

+

GUI 0.1.1

Made with

@@ -56,3 +56,4 @@
+ \ No newline at end of file diff --git a/basicswap/templates/header.html b/basicswap/templates/header.html index c7e33e3..10a4ae8 100644 --- a/basicswap/templates/header.html +++ b/basicswap/templates/header.html @@ -7,10 +7,11 @@ {% endif %} + - + {{ title }} @@ -18,11 +19,11 @@
- {% for m in messages %} + {% for m in messages %} -
-
-
-
-
-
-
- - - +
-
- -
-
-
-
+ - {% endfor %} + {% endfor %} + + {% for m in err_messages %} + + + + {% endfor %}
diff --git a/basicswap/templates/offer.html b/basicswap/templates/offer.html index 00e345a..5d3d447 100644 --- a/basicswap/templates/offer.html +++ b/basicswap/templates/offer.html @@ -50,71 +50,70 @@
- {% for m in messages %} + {% for m in messages %} -
-
-
-
-
-
-
- - - -
-
-

{{ m }}

-
-
-
- -
-
-
-
- - {% endfor %} - - {% for m in err_messages %} - -
-
-
-
-
-
-
- - - +
-
- -
-
-
-
+ - {% endfor %} + {% endfor %} + + {% for m in err_messages %} + + + + {% endfor %} {% if sent_bid_id %}
diff --git a/basicswap/templates/offer_confirm.html b/basicswap/templates/offer_confirm.html index 4d9f912..55b806c 100644 --- a/basicswap/templates/offer_confirm.html +++ b/basicswap/templates/offer_confirm.html @@ -39,7 +39,7 @@
-
+

Confirm your offer information

@@ -54,70 +54,70 @@
- {% for m in messages %} + {% for m in messages %} -
-
-
-
-
-
-
- - - -
-
-

{{ m }}

-
-
-
- -
-
-
-
+ - {% endfor %} - {% for m in err_messages %} + {% endfor %} -
-
-
-
-
-
-
- - - -
-
-

-

Error: {{ m }}

-

-
-
-
- -
-
-
-
+ {% for m in err_messages %} - {% endfor %} + + + {% endfor %}
@@ -146,7 +146,7 @@
- + @@ -171,7 +171,7 @@
- + @@ -206,7 +206,7 @@
contacts 2 - + @@ -230,43 +230,28 @@
-

Coins from

+

You Send

-

Coin From

-
- - - - - - - - - - - -
- + {% for c in coins_from %} - {{ c[1] }} + {{ c[1] }} {% endfor %}
-

Amount From (The amount you will send)

- + @@ -275,7 +260,7 @@
- +
@@ -286,7 +271,7 @@
- + @@ -304,7 +289,7 @@
- + @@ -315,7 +300,7 @@
- Fee Rate Source: {{ data.from_fee_src }} + Fee Rate Source: {{ data.from_fee_src }}
@@ -326,7 +311,7 @@
- + @@ -342,7 +327,7 @@
- Lock Tx Spend Fee: {{ data.amt_from_lock_spend_tx_fee }} {{ data.tla_from }} + Lock Tx Spend Fee: {{ data.amt_from_lock_spend_tx_fee }} {{ data.tla_from }}
{% endif %} @@ -357,44 +342,29 @@
-

Coins to

+

You Get

-

Coin To

-
- - - - - - - - - - - -
- + {% for c in coins %} - {{ c[1] }} + {{ c[1] }} {% endfor %}
-

Amount to (The amount you will receive)

- + @@ -403,7 +373,7 @@
- +
@@ -414,7 +384,7 @@
- + @@ -432,7 +402,7 @@
- + @@ -443,7 +413,7 @@
- Fee Rate Source: {{ data.to_fee_src }} + Fee Rate Source: {{ data.to_fee_src }}
@@ -454,7 +424,7 @@
- + @@ -481,7 +451,7 @@
- + @@ -502,7 +472,7 @@
- + @@ -541,7 +511,7 @@
- + @@ -559,7 +529,7 @@
- + @@ -590,7 +560,7 @@
- + @@ -610,7 +580,7 @@
- + @@ -633,7 +603,7 @@
- + @@ -676,7 +646,7 @@
- + diff --git a/basicswap/templates/offer_new_1.html b/basicswap/templates/offer_new_1.html index f3ae21d..cad64be 100644 --- a/basicswap/templates/offer_new_1.html +++ b/basicswap/templates/offer_new_1.html @@ -49,7 +49,7 @@ {% for m in messages %} -
@@ -61,16 +61,15 @@
-

{{ m }}

+

{{ m[1] }}

- - - - - +
@@ -81,7 +80,7 @@ {% for m in err_messages %} -
@@ -140,7 +139,7 @@
- + @@ -151,7 +150,7 @@
-
+
@@ -165,7 +164,7 @@
- + @@ -177,7 +176,7 @@
@@ -199,7 +198,7 @@
- + @@ -223,43 +222,28 @@
-

Coins from

+

You Send

-

Coin From

- + -
- - - - - - - - - - - -
- + {% for c in coins_from %} - {{ c[1] }} + {{ c[1] }} {% endfor %}
-

Amount From (The amount you will send)

- - + + @@ -268,7 +252,8 @@
- + +
@@ -282,44 +267,29 @@
-

Coins to

+

You Get

-

Coin To

- + -
- - - - - - - - - - - -
- + {% for c in coins %} - {{ c[1] }} + {{ c[1] }} {% endfor %}
-

Amount to (The amount you will receive)

- - + + @@ -328,7 +298,7 @@
- +
@@ -353,7 +323,7 @@
law - + @@ -371,7 +341,7 @@
- + @@ -427,7 +397,7 @@
-
+
-
-
- - + @@ -149,15 +127,16 @@
+
- + {% for c in coins_from %} + + {% endfor %}
@@ -176,11 +155,10 @@ - + {% for c in coins %} + + {% endfor %}
@@ -247,7 +225,7 @@ - Clear Filters + Clear
@@ -311,9 +289,9 @@ {{ o[7] }} {{ o[8] }}{% if o[9]==true %} {% endif %} - {{ o[2] }} + {{ o[2] }} {{ o[4] }} - {{ o[3] }} + {{ o[3] }} {{ o[5] }} {{ o[6] }} diff --git a/basicswap/templates/rpc.html b/basicswap/templates/rpc.html index a157cc8..d8605a3 100644 --- a/basicswap/templates/rpc.html +++ b/basicswap/templates/rpc.html @@ -42,71 +42,70 @@
- {% for m in messages %} + {% for m in messages %} -
-
-
-
-
-
-
- - - + + + {% endfor %} + + {% for m in err_messages %} + +
-
- -
-
-
-
+
- {% endfor %} - - {% for m in err_messages %} - -
-
-
-
-
-
-
- - - -
-
-

-

Error: {{ m }}

-

-
-
-
- -
-
-
-
- - {% endfor %} + {% endfor %}
@@ -172,7 +171,7 @@ - diff --git a/basicswap/templates/settings.html b/basicswap/templates/settings.html index 5d4bafb..fa5cf0e 100644 --- a/basicswap/templates/settings.html +++ b/basicswap/templates/settings.html @@ -15,7 +15,7 @@ -
  • Settings
  • +
  • Settings
  • @@ -33,94 +33,117 @@

    Settings

    -

    Manage your Basicswap and Coins settings

    +

    Manage your BasicSwap and Coins settings

    - {% for m in messages %} + {% for m in messages %} -
    -
    -
    -
    -
    -
    -
    - - - + + + {% endfor %} + + {% for m in err_messages %} + +
    -
    - -
    -
    -
    -
    + - {% endfor %} - - {% for m in err_messages %} - -
    -
    -
    -
    -
    -
    -
    - - - -
    -
    -

    -

    Error: {{ m }}

    -

    -
    -
    -
    - -
    -
    -
    -
    - - {% endfor %} + {% endfor %} - - +
    - {% for c in chains %} +
    + +
    + + + + +
    +
    +
    +
    @@ -278,4 +541,4 @@ {% include 'footer.html' %} - + \ No newline at end of file diff --git a/basicswap/templates/smsgaddresses.html b/basicswap/templates/smsgaddresses.html index 555635d..5ed9337 100644 --- a/basicswap/templates/smsgaddresses.html +++ b/basicswap/templates/smsgaddresses.html @@ -42,72 +42,71 @@
    - {% for m in messages %} + {% for m in messages %} -
    -
    -
    -
    -
    -
    -
    - - - + + + {% endfor %} + + {% for m in err_messages %} + +
    -
    - -
    -
    -
    -
    - - {% endfor %} - - {% for m in err_messages %} - -
    -
    -
    -
    -
    -
    -
    - - - -
    -
    -

    -

    Error: {{ m }}

    -

    -
    -
    -
    - -
    -
    -
    -
    - - {% endfor %} + + {% endfor %} +
    @@ -174,23 +173,13 @@
    - +
    + Cancel
    diff --git a/basicswap/templates/tor.html b/basicswap/templates/tor.html index a4e5e7d..0eb1ca4 100644 --- a/basicswap/templates/tor.html +++ b/basicswap/templates/tor.html @@ -45,71 +45,70 @@
    - {% for m in messages %} + {% for m in messages %} -
    -
    -
    -
    -
    -
    -
    - - - + + + {% endfor %} + + {% for m in err_messages %} + +
    -
    - -
    -
    -
    -
    + - {% endfor %} - - {% for m in err_messages %} - -
    -
    -
    -
    -
    -
    -
    - - - -
    -
    -

    -

    Error: {{ m }}

    -

    -
    -
    -
    - -
    -
    -
    -
    - - {% endfor %} + {% endfor %}
    diff --git a/basicswap/templates/wallet.html b/basicswap/templates/wallet.html index b8f72df..afb7ec2 100644 --- a/basicswap/templates/wallet.html +++ b/basicswap/templates/wallet.html @@ -50,41 +50,103 @@
    - {% for m in messages %} + {% for m in messages %} -
    -
    -
    -
    -
    -
    -
    - - - -
    -
    -

    {{ m }}

    -
    -
    -
    - -
    -
    -
    -
    + - {% endfor %} + {% endfor %} - {% for m in err_messages %} + {% for m in err_messages %} -
    + + + {% endfor %} + +{% if w.updating %} + + + +{% endif %} +{% if w.havedata %} {% if w.error %} + +
    @@ -97,7 +159,7 @@

    -

    Error: {{ m }}

    +

    Error: {{ w.error }}

    @@ -114,12 +176,9 @@
    - {% endfor %} +{% else %} - - -
    {% if w.updating %} -
    Updating
    {% endif %} {% if w.havedata %} {% if w.error %}

    Error: {{ w.error }}

    {% else %} +
    @@ -174,10 +233,22 @@ {% endif %} Expected Seed: - {{ w.expected_seed }}{% if w.expected_seed != true %} - - - {% else %} + {{ w.expected_seed }} + {% if w.expected_seed != true %} + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + {% else %} {% if w.cid == '1' %} Stealth Address @@ -189,7 +260,7 @@ - + {{ w.deposit_address }} {% else %} diff --git a/basicswap/templates/wallets.html b/basicswap/templates/wallets.html index 8dbc5ca..198ce4a 100644 --- a/basicswap/templates/wallets.html +++ b/basicswap/templates/wallets.html @@ -46,71 +46,70 @@
    - {% for m in messages %} + {% for m in messages %} -
    -
    -
    -
    -
    -
    -
    - - - -
    -
    -

    {{ m }}

    -
    -
    -
    - -
    -
    -
    -
    - - {% endfor %} - - {% for m in err_messages %} - -
    -
    -
    -
    -
    -
    -
    - - - +
    -
    - -
    -
    -
    -
    +
    - {% endfor %} + {% endfor %} + + {% for m in err_messages %} + + + + {% endfor %}