From 8d3badfcc3889991836d822874943bb3521b7ee8 Mon Sep 17 00:00:00 2001 From: weixiaoyi Date: Tue, 28 Aug 2018 16:11:41 +0800 Subject: [PATCH 001/224] k --- src/routes/Home/TradeChart.js | 13 +++++++------ src/services/trade.js | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/routes/Home/TradeChart.js b/src/routes/Home/TradeChart.js index de2986f..e8c92bd 100644 --- a/src/routes/Home/TradeChart.js +++ b/src/routes/Home/TradeChart.js @@ -18,7 +18,7 @@ export default class TradeChart extends Component { this.state = { loaded: false, map: 1, - time: '1day' + time: '1D' } } @@ -317,17 +317,18 @@ export default class TradeChart extends Component { "scalesProperties.textColor": "#778094", //-----------面积图,分时图的颜色 - "mainSeriesProperties.areaStyle.color1": "#606090", - "mainSeriesProperties.areaStyle.color2": "rgba(147,158,183,.08)", - "mainSeriesProperties.areaStyle.linecolor": "rgba(147,158,183,1)", + "mainSeriesProperties.areaStyle.color1":"rgba(62,108,174,.5)",// "#3278DD", + "mainSeriesProperties.areaStyle.color2":"rgba(62,108,174,.1)",// "#3278DD", + // "mainSeriesProperties.areaStyle.color3": "rgba(62,108,174,0)", + "mainSeriesProperties.areaStyle.linecolor": "#3E6CAE", //------------- "mainSeriesProperties.lineStyle.color": "white", "mainSeriesProperties.lineStyle.linestyle": 0, }, studies_overrides: { //--------------------volume的颜色设置 - "volume.volume.color.0": 'rgba(255,120,88,.85)', - "volume.volume.color.1": "rgba(0,192,135,.85)", + "volume.volume.color.0": 'rgba(255,120,88,.4)', + "volume.volume.color.1": "rgba(0,192,135,.4)", }, loading_screen: { backgroundColor: backColor }, diff --git a/src/services/trade.js b/src/services/trade.js index 6e39d88..6ddb33a 100644 --- a/src/services/trade.js +++ b/src/services/trade.js @@ -2,7 +2,7 @@ import { request } from '@utils' import { API } from "@constants" let { MOCKIP, UserIp0, USERIP, USERIP2, UserIp3, UserIp4 } = API -const MODE = 'mock' +const MODE = 'mock1' // mock数据 if (MODE === 'mock') { From 03a2a72aa311ab22395a84da5e323dbd55ae39c2 Mon Sep 17 00:00:00 2001 From: weixiaoyi Date: Tue, 28 Aug 2018 16:15:28 +0800 Subject: [PATCH 002/224] =?UTF-8?q?=E5=88=86=E6=97=B6=E5=9B=BE=E9=A2=9C?= =?UTF-8?q?=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/Home/TradeChart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/Home/TradeChart.js b/src/routes/Home/TradeChart.js index e8c92bd..65a3317 100644 --- a/src/routes/Home/TradeChart.js +++ b/src/routes/Home/TradeChart.js @@ -320,7 +320,7 @@ export default class TradeChart extends Component { "mainSeriesProperties.areaStyle.color1":"rgba(62,108,174,.5)",// "#3278DD", "mainSeriesProperties.areaStyle.color2":"rgba(62,108,174,.1)",// "#3278DD", // "mainSeriesProperties.areaStyle.color3": "rgba(62,108,174,0)", - "mainSeriesProperties.areaStyle.linecolor": "#3E6CAE", + "mainSeriesProperties.areaStyle.linecolor": "#4077C6", //------------- "mainSeriesProperties.lineStyle.color": "white", "mainSeriesProperties.lineStyle.linestyle": 0, From 7d19a22489cf535b9382ff85bc7ac70258c149b6 Mon Sep 17 00:00:00 2001 From: weixiaoyi Date: Tue, 28 Aug 2018 16:22:44 +0800 Subject: [PATCH 003/224] =?UTF-8?q?=E6=B7=B1=E5=BA=A6=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/Home/TradeChart.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/Home/TradeChart.js b/src/routes/Home/TradeChart.js index 65a3317..e84542a 100644 --- a/src/routes/Home/TradeChart.js +++ b/src/routes/Home/TradeChart.js @@ -176,7 +176,7 @@ export default class TradeChart extends Component { x2: 0, y2: 1, colorStops: [{ - offset: 0, color: 'rgba(86,188,157,0.41)' + offset: 0, color: 'rgba(0,192,135,0.41)' }, { offset: 1, color: 'rgba(86,188,157,0)' }] @@ -185,7 +185,7 @@ export default class TradeChart extends Component { }, lineStyle: { normal: { - color: 'rgba(86,188,157,1)' + color: 'rgba(0,192,135,1)' } }, itemStyle: { @@ -215,7 +215,7 @@ export default class TradeChart extends Component { x2: 0, y2: 1, colorStops: [{ - offset: 0, color: 'rgba(218,115,115,0.41)' + offset: 0, color: 'rgba(255,120,88,0.41)' }, { offset: 1, color: 'rgba(218,115,115,0)' }] @@ -224,7 +224,7 @@ export default class TradeChart extends Component { }, lineStyle: { normal: { - color: 'rgba(218,115,115,1)' + color: 'rgba(255,120,88,1)' } }, itemStyle: { From c9ba045f77393855bbca0b0a6d81f8a22956e329 Mon Sep 17 00:00:00 2001 From: weixiaoyi Date: Tue, 28 Aug 2018 19:18:16 +0800 Subject: [PATCH 004/224] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=9B=B0=E6=89=B0?= =?UTF-8?q?=E5=A5=BD=E4=B9=85=E7=9A=84=E8=BD=AE=E8=AE=AD=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Mixin/index.js | 28 +++++----------------------- src/constants/index.js | 2 +- src/routes/Home/CurrentContract.js | 3 ++- src/routes/Home/PersonEnsure.js | 6 +++--- src/routes/Home/Position.js | 4 +++- src/routes/Home/Purse.js | 10 +++++----- src/routes/Home/RecentRecord.js | 5 +++-- src/routes/Home/TradeChart.js | 16 ++++++++-------- src/routes/Home/index.js | 2 +- 9 files changed, 31 insertions(+), 45 deletions(-) diff --git a/src/components/Mixin/index.js b/src/components/Mixin/index.js index 974bff1..677d1c1 100644 --- a/src/components/Mixin/index.js +++ b/src/components/Mixin/index.js @@ -59,7 +59,6 @@ export class MixinChild extends React.Component { }) } } - // if (!that.props.that.childInitStacks) that.props.that.childInitStacks = [] } componentDidMount() { @@ -67,13 +66,15 @@ export class MixinChild extends React.Component { } componentWillUnmount() { - this.props.that._isMounted=false - // this.startUnMount() + this.props.that._isMounted = false } startInit = () => { const { that = {} } = this.props - const [startInit, childInitStacks] = [_.get(that, 'startInit'), _.get(that, 'props.that.childInitStacks')] + const [startInit, childInitStacks] = [ + _.get(that, 'startInit'), + _.get(that, 'props.that.childInitStacks') + ] if (_.isFunction(startInit) && _.isArray(childInitStacks)) { childInitStacks.push(() => { startInit() @@ -81,25 +82,6 @@ export class MixinChild extends React.Component { } } - startUnMount = () => { - const { that = {} } = this.props - that._isMounted = false - // return Promise.resolve() - // if (that.interval) { - // return new Promise((resolve) => { - // if (_.isArray(that.interval)) { - // that.interval.map(item => clearTimeout(item)) - // } else { - // clearTimeout(that.interval) - // } - // that.interval = null - // resolve() - // }) - // } else { - // return Promise.resolve() - // } - } - render() { const { children } = this.props return ( diff --git a/src/constants/index.js b/src/constants/index.js index 63936ca..20af2d8 100644 --- a/src/constants/index.js +++ b/src/constants/index.js @@ -21,7 +21,7 @@ export const API = { export const SPEED = { TOP: 0, MIDDLE: 10, - DOWM: 1500 + DOWM: 3000 } export const SOCKETURL = { diff --git a/src/routes/Home/CurrentContract.js b/src/routes/Home/CurrentContract.js index c84d4ff..0d9b8e5 100644 --- a/src/routes/Home/CurrentContract.js +++ b/src/routes/Home/CurrentContract.js @@ -20,8 +20,9 @@ export default class CurrentContract extends Component { dispatch({ type: `${modelName}/getLeverage` }).then(res => { - if (!this._isMounted) return + if (!this._isMounted || this.interval) return this.interval = dealInterval(() => { + this.interval = null this.getLeverage() }) }) diff --git a/src/routes/Home/PersonEnsure.js b/src/routes/Home/PersonEnsure.js index d379f67..84a6eac 100644 --- a/src/routes/Home/PersonEnsure.js +++ b/src/routes/Home/PersonEnsure.js @@ -20,10 +20,10 @@ export default class PersonEnsure extends Component { type: `${modelName}/getPersonalEnsure`, payload }).then((res) => { - if (!this._isMounted) return - if (callback) return callback() + if (!this._isMounted || this.interval) return this.interval = dealInterval(() => { - this.getPersonalEnsure(payload) + this.interval = null + this.getPersonalEnsure() }) } ) diff --git a/src/routes/Home/Position.js b/src/routes/Home/Position.js index bf73de4..9692c46 100644 --- a/src/routes/Home/Position.js +++ b/src/routes/Home/Position.js @@ -15,6 +15,7 @@ export default class Position extends Component { state = { active: 0 } + startInit = () => { this.getPosition() } @@ -24,8 +25,9 @@ export default class Position extends Component { dispatch({ type: `${modelName}/getPosition` }).then(() => { - if (!this._isMounted) return + if (!this._isMounted || this.interval) return this.interval = dealInterval(() => { + this.interval = null this.getPosition() }) }) diff --git a/src/routes/Home/Purse.js b/src/routes/Home/Purse.js index bae2d43..bc16948 100644 --- a/src/routes/Home/Purse.js +++ b/src/routes/Home/Purse.js @@ -20,11 +20,11 @@ export default class Pure extends Component { type: `${modelName}/getPurseAssetList` }).then((res) => { if (res) { - if (!this._isMounted) return + if (!this._isMounted || this.interval) return this.interval = dealInterval(() => { + this.interval = null this.getPurseAssetList() }) - } }) } @@ -57,7 +57,7 @@ export default class Pure extends Component {
钱包
-
    +
      { assetList.map((item, index) =>
    • { this.changeState({ @@ -81,10 +81,10 @@ export default class Pure extends Component {
      浮动盈亏
      - +
      - +
      diff --git a/src/routes/Home/RecentRecord.js b/src/routes/Home/RecentRecord.js index b02e063..06cac24 100644 --- a/src/routes/Home/RecentRecord.js +++ b/src/routes/Home/RecentRecord.js @@ -25,10 +25,11 @@ export default class RecentRecord extends Component { type: activeLi } }).then((res) => { - if (!this._isMounted) return + if (!this._isMounted || this.interval) return if (activeLi === '1') { this.interval = dealInterval(() => { - this.getHistory(activeLi) + this.interval = null + this.getHistory() }) } } diff --git a/src/routes/Home/TradeChart.js b/src/routes/Home/TradeChart.js index e84542a..4a95c99 100644 --- a/src/routes/Home/TradeChart.js +++ b/src/routes/Home/TradeChart.js @@ -317,8 +317,8 @@ export default class TradeChart extends Component { "scalesProperties.textColor": "#778094", //-----------面积图,分时图的颜色 - "mainSeriesProperties.areaStyle.color1":"rgba(62,108,174,.5)",// "#3278DD", - "mainSeriesProperties.areaStyle.color2":"rgba(62,108,174,.1)",// "#3278DD", + "mainSeriesProperties.areaStyle.color1": "rgba(62,108,174,.5)",// "#3278DD", + "mainSeriesProperties.areaStyle.color2": "rgba(62,108,174,.1)",// "#3278DD", // "mainSeriesProperties.areaStyle.color3": "rgba(62,108,174,0)", "mainSeriesProperties.areaStyle.linecolor": "#4077C6", //------------- @@ -434,19 +434,19 @@ export default class TradeChart extends Component { // }) // }) - // console.log('2') - // const a = _.debounce(() => { + // setInterval(() => { // onRealtimeCallback({ - // "time": 1530464461000, - // "close": 149.56, + // "time": 1535385600000, + // "close": _.random(100,300), // "open": _.random(100, 500), // "high": 150.9, // "low": 148.57, // "volume": 1000 // } // ) - // }, 1000) - // a() + // }, 2000) + + }, unsubscribeBars(subscriberUID) { } diff --git a/src/routes/Home/index.js b/src/routes/Home/index.js index b595cde..868fd86 100644 --- a/src/routes/Home/index.js +++ b/src/routes/Home/index.js @@ -249,7 +249,6 @@ export default class View extends Component { }
      - { isLogin ? (
      @@ -260,6 +259,7 @@ export default class View extends Component { ) : null } + { isLogin ? (
      From f46f904b1977a28115072199a05ec378683901c9 Mon Sep 17 00:00:00 2001 From: weixiaoyi Date: Wed, 29 Aug 2018 15:55:19 +0800 Subject: [PATCH 005/224] =?UTF-8?q?=E6=B7=B1=E8=89=B2=E6=B5=85=E8=89=B2?= =?UTF-8?q?=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mock/index.js | 4 +- public/charting_library.min.js | 311 +----------------- ...f54b85bc.js => 13.280894673316ad6ac6f2.js} | 6 +- ...ds-property-pages.1a3d233b8aa4552a7048.js} | 6 +- ...-date-dialog-impl.1e876e63af6d26496269.js} | 14 +- ...ie-fallback-logos.b27f679ee44b7d0992e1.js} | 2 +- ...d82.js => library.77596ca6783cb5996d22.js} | 142 ++++---- ... => lt-pane-views.96fd54d9b7bad567d490.js} | 2 +- ... objecttreedialog.3f22589e98a1cedf9028.js} | 6 +- ...-info-dialog-impl.f6bc55c14cd39967110a.js} | 2 +- ...image-dialog-impl.d8f49fce300496653730.js} | 10 +- ...22b.js => vendors.be39e0d831d7b65e9f31.js} | 99 +++--- public/static/other.css | 12 - .../static/tv-chart.7580da73a91e1354cb09.html | 1 + public/static/tv-chart.html | 101 ------ src/components/LayOut/BasicLayOut/Header.js | 33 +- src/components/LayOut/BasicLayOut/index.less | 24 +- src/constants/index.js | 5 +- src/models/global/theme.js | 2 +- src/routes/Home/TradeChart.js | 65 ++-- src/routes/Home/components/ScrollPanel.less | 15 +- src/routes/Home/index.js | 5 +- src/routes/Home/index.less | 70 +++- src/styles/common.less | 12 + src/styles/variable.less | 25 +- 25 files changed, 352 insertions(+), 622 deletions(-) rename public/static/bundles/{13.416855bb3e77f54b85bc.js => 13.280894673316ad6ac6f2.js} (97%) rename public/static/bundles/{ds-property-pages.1d6127a623f51513ea4f.js => ds-property-pages.1a3d233b8aa4552a7048.js} (99%) rename public/static/bundles/{go-to-date-dialog-impl.62cf944ccbbc265f35d6.js => go-to-date-dialog-impl.1e876e63af6d26496269.js} (96%) rename public/static/bundles/{ie-fallback-logos.1e0142e3b30300ec0153.js => ie-fallback-logos.b27f679ee44b7d0992e1.js} (92%) rename public/static/bundles/{library.a20ce7189cee174b6d82.js => library.77596ca6783cb5996d22.js} (98%) rename public/static/bundles/{lt-pane-views.58e294a05422f60f49f9.js => lt-pane-views.96fd54d9b7bad567d490.js} (99%) rename public/static/bundles/{objecttreedialog.e036091976a3fed3c8c9.js => objecttreedialog.3f22589e98a1cedf9028.js} (98%) rename public/static/bundles/{symbol-info-dialog-impl.a3697f845094a08295ab.js => symbol-info-dialog-impl.f6bc55c14cd39967110a.js} (99%) rename public/static/bundles/{take-chart-image-dialog-impl.53880c50752269d86d3a.js => take-chart-image-dialog-impl.d8f49fce300496653730.js} (95%) rename public/static/bundles/{vendors.60929e827fa9d685d22b.js => vendors.be39e0d831d7b65e9f31.js} (80%) delete mode 100644 public/static/other.css create mode 100644 public/static/tv-chart.7580da73a91e1354cb09.html delete mode 100644 public/static/tv-chart.html diff --git a/mock/index.js b/mock/index.js index 531cc86..32da619 100644 --- a/mock/index.js +++ b/mock/index.js @@ -484,8 +484,8 @@ export default delay({ "userAllowTrade": true, "marketAllowTrade": true, "marketCode": "BTCUSDT", - "minPriceMovement": 0.000000001, - "minPriceMovementDisplay": "0.000000001", + "minPriceMovement": 0.5, + "minPriceMovementDisplay": "0.5BTC", "maintenanceMarginRate": 0.005, "maintenanceMarginRateDisplay": "0.005%", "minTradeNum": 1, diff --git a/public/charting_library.min.js b/public/charting_library.min.js index 8a983b9..96994a0 100644 --- a/public/charting_library.min.js +++ b/public/charting_library.min.js @@ -1,310 +1 @@ - - -! - function (t, e) { - "object" == typeof exports && "undefined" != typeof module ? e(exports) : "function" == typeof define && define.amd ? define(["exports"], e) : e(t.TradingView = t.TradingView || {}) - }(this, - function (t) { - "use strict"; - function e(t, o) { - var i = n({}, - t); - for (var s in o) "object" != typeof t[s] || null === t[s] || Array.isArray(t[s]) ? void 0 !== o[s] && (i[s] = o[s]) : i[s] = e(t[s], o[s]); - return i - } - function o() { - return "1.12 (internal id 7f86d512 @ 2018-02-15 08:36:44.245398)" - } - function i(t) { - window.addEventListener("DOMContentLoaded", t, !1) - } - var n = Object.assign || - function (t) { - for (var e, o = arguments, - i = 1, - n = arguments.length; i < n; i++) { - e = o[i]; - for (var s in e) Object.prototype.hasOwnProperty.call(e, s) && (t[s] = e[s]) - } - return t - }, - s = { - mobile: { - disabled_features: ["left_toolbar", "header_widget", "timeframes_toolbar", "edit_buttons_in_legend", "context_menus", "control_bar", "border_around_the_chart"], - enabled_features: [] - } - }, - r = { - width: 800, - height: 500, - symbol: "AA", - interval: "D", - timezone: "UTC", - container_id: "", - library_path: "", - locale: "en", - widgetbar: { - details: !1, - watchlist: !1, - watchlist_settings: { - default_symbols: [] - } - }, - overrides: { - "mainSeriesProperties.showCountdown": !1 - }, - studies_overrides: {}, - brokerConfig: { - configFlags: {} - }, - fullscreen: !1, - autosize: !1, - disabled_features: [], - enabled_features: [], - debug: !1, - logo: {}, - time_frames: [{ - text: "5y", - resolution: "W" - }, - { - text: "1y", - resolution: "W" - }, - { - text: "6m", - resolution: "120" - }, - { - text: "3m", - resolution: "60" - }, - { - text: "1m", - resolution: "30" - }, - { - text: "5d", - resolution: "5" - }, - { - text: "1d", - resolution: "1" - }], - client_id: "0", - user_id: "0", - charts_storage_api_version: "1.0", - favorites: { - intervals: [], - chartTypes: [] - } - }, - a = function () { - function t(t) { - if (this._id = "tradingview_" + (1048576 * (1 + Math.random()) | 0).toString(16).substring(1), this._ready = !1, this._readyHandlers = [], this._onWindowResize = this._autoResizeChart.bind(this), !t.datafeed) throw new Error("Datafeed is not defined"); - if (this._options = e(r, t), t.preset) { - var o = s[t.preset]; - o ? (void 0 !== this._options.disabled_features ? this._options.disabled_features = this._options.disabled_features.concat(o.disabled_features) : this._options.disabled_features = o.disabled_features, void 0 !== this._options.enabled_features ? this._options.enabled_features = this._options.enabled_features.concat(o.enabled_features) : this._options.enabled_features = o.enabled_features) : console.warn("Unknown preset: `" + t.preset + "`") - } - this._create() - } - return t.prototype.onChartReady = function (t) { - this._ready ? t.call(this) : this._readyHandlers.push(t) - }, - t.prototype.onGrayedObjectClicked = function (t) { - this._innerAPI().onGrayedObjectClicked(t) - }, - t.prototype.onShortcut = function (t, e) { - this._innerWindow().createShortcutAction(t, e) - }, - t.prototype.subscribe = function (t, e) { - this._innerAPI().subscribe(t, e) - }, - t.prototype.unsubscribe = function (t, e) { - this._innerAPI().unsubscribe(t, e) - }, - t.prototype.chart = function (t) { - return this._innerAPI().chart(t) - }, - t.prototype.setLanguage = function (t) { - this.remove(), - this._options.locale = t, - this._create() - }, - t.prototype.setSymbol = function (t, e, o) { - this._innerAPI().changeSymbol(t, e + "", o) - }, - t.prototype.remove = function () { - window.removeEventListener("resize", this._onWindowResize), - this._readyHandlers.splice(0, this._readyHandlers.length), - delete window[this._id]; - var t = this._getIFrameElement(); - t.contentWindow.destroyChart(), - t.parentNode && t.parentNode.removeChild(t) - }, - t.prototype.closePopupsAndDialogs = function () { - this._innerAPI().closePopupsAndDialogs() - }, - t.prototype.selectLineTool = function (t) { - this._innerAPI().selectLineTool(t) - }, - t.prototype.selectedLineTool = function () { - return this._innerAPI().selectedLineTool() - }, - t.prototype.save = function (t) { - this._innerAPI().saveChart(t) - }, - t.prototype.load = function (t, e) { - console.log('load!!!!!!'); - this._innerAPI().loadChart({ - json: t, - extendedData: e - }) - }, - t.prototype.getSavedCharts = function (t) { - this._innerAPI().getSavedCharts(t) - }, - t.prototype.loadChartFromServer = function (t) { - this._innerAPI().loadChartFromServer(t) - }, - t.prototype.saveChartToServer = function (t, e, o, i) { - this._innerAPI().saveChartToServer(t, e, o, i) - }, - t.prototype.removeChartFromServer = function (t, e) { - this._innerAPI().removeChartFromServer(t, e) - }, - t.prototype.onContextMenu = function (t) { - this._innerAPI().onContextMenu(t) - }, - t.prototype.createButton = function (t) { - return this._innerWindow().createButton(t) - }, - t.prototype.showNoticeDialog = function (t) { - this._innerAPI().showNoticeDialog(t) - }, - t.prototype.showConfirmDialog = function (t) { - this._innerAPI().showConfirmDialog(t) - }, - t.prototype.showLoadChartDialog = function () { - this._innerAPI().showLoadChartDialog() - }, - t.prototype.showSaveAsChartDialog = function () { - this._innerAPI().showSaveAsChartDialog() - }, - t.prototype.symbolInterval = function () { - return this._innerAPI().getSymbolInterval() - }, - t.prototype.mainSeriesPriceFormatter = function () { - return this._innerAPI().mainSeriesPriceFormatter() - }, - t.prototype.getIntervals = function () { - return this._innerAPI().getIntervals() - }, - t.prototype.getStudiesList = function () { - return this._innerAPI().getStudiesList() - }, - t.prototype.addCustomCSSFile = function (t) { - this._innerWindow().addCustomCSSFile(t) - }, - t.prototype.applyOverrides = function (t) { - this._options = e(this._options, { - overrides: t - }), - this._innerWindow().applyOverrides(t) - }, - t.prototype.applyStudiesOverrides = function (t) { - this._innerWindow().applyStudiesOverrides(t) - }, - t.prototype.watchList = function () { - return this._innerAPI().watchlist() - }, - t.prototype.activeChart = function () { - return this._innerAPI().activeChart() - }, - t.prototype.chartsCount = function () { - return this._innerAPI().chartsCount() - }, - t.prototype.layout = function () { - return this._innerAPI().layout() - }, - t.prototype.setLayout = function (t) { - this._innerAPI().setLayout(t) - }, - t.prototype._getIFrameElement = function () { - var t = document.getElementById(this._id); - if (null === t) throw new Error("There is no such iframe"); - return t - }, - t.prototype._innerAPI = function () { - return this._getIFrameElement().contentWindow.tradingViewApi - }, - t.prototype._innerWindow = function () { - return this._getIFrameElement().contentWindow - }, - t.prototype._autoResizeChart = function () { - this._options.fullscreen && (this._getIFrameElement().style.height = window.innerHeight + "px") - }, - t.prototype._create = function () { - var t = this, - e = this._render(), - o = document.getElementById(this._options.container_id); - if (null === o) throw new Error("There is no such element - #" + this._options.container_id); - o.innerHTML = e; - var i = this._getIFrameElement(); (this._options.autosize || this._options.fullscreen) && (i.style.width = "100%", this._options.fullscreen || (i.style.height = "100%")), - window.addEventListener("resize", this._onWindowResize), - this._onWindowResize(); - var n = function () { - i.removeEventListener("load", n, !1), - console.log('i.contentWindow ->', i.contentWindow); - i.contentWindow.widgetReady(function () { - t._ready = !0; - for (var e = 0, - o = t._readyHandlers; e < o.length; e++) { - o[e].call(t) - } - i.contentWindow.initializationFinished() - }) - }; - i.addEventListener("load", n, !1) - }, - t.prototype._render = function () { - var t = window; - t[this._id] = { - datafeed: this._options.datafeed, - customFormatters: this._options.customFormatters, - brokerFactory: this._options.brokerFactory, - overrides: this._options.overrides, - studiesOverrides: this._options.studies_overrides, - disabledFeatures: this._options.disabled_features, - enabledFeatures: this._options.enabled_features, - brokerConfig: this._options.brokerConfig, - restConfig: this._options.restConfig, - favorites: this._options.favorites, - logo: this._options.logo, - numeric_formatting: this._options.numeric_formatting, - rss_news_feed: this._options.rss_news_feed, - newsProvider: this._options.news_provider, - loadLastChart: this._options.load_last_chart, - saveLoadAdapter: this._options.save_load_adapter, - loading_screen: this._options.loading_screen, - settingsAdapter: this._options.settings_adapter - }, - this._options.saved_data && (t[this._id].chartContent = { - json: this._options.saved_data - }); - var iframeSrc = "static/tv-chart.html"; - var e = (this._options.library_path || "") + iframeSrc + "#localserver=1&symbol=" + encodeURIComponent(this._options.symbol) + "&interval=" + encodeURIComponent(this._options.interval) + (this._options.timeframe ? "&timeframe=" + encodeURIComponent(this._options.timeframe) : "") + (this._options.toolbar_bg ? "&toolbarbg=" + this._options.toolbar_bg.replace("#", "") : "") + (this._options.studies_access ? "&studiesAccess=" + encodeURIComponent(JSON.stringify(this._options.studies_access)) : "") + "&widgetbar=" + encodeURIComponent(JSON.stringify(this._options.widgetbar)) + (this._options.drawings_access ? "&drawingsAccess=" + encodeURIComponent(JSON.stringify(this._options.drawings_access)) : "") + "&timeFrames=" + encodeURIComponent(JSON.stringify(this._options.time_frames)) + "&locale=" + encodeURIComponent(this._options.locale) + "&uid=" + encodeURIComponent(this._id) + "&clientId=" + encodeURIComponent(String(this._options.client_id)) + "&userId=" + encodeURIComponent(String(this._options.user_id)) + (this._options.charts_storage_url ? "&chartsStorageUrl=" + encodeURIComponent(this._options.charts_storage_url) : "") + (this._options.charts_storage_api_version ? "&chartsStorageVer=" + encodeURIComponent(this._options.charts_storage_api_version) : "") + (this._options.indicators_file_name ? "&indicatorsFile=" + encodeURIComponent(this._options.indicators_file_name) : "") + (this._options.custom_css_url ? "&customCSS=" + encodeURIComponent(this._options.custom_css_url) : "") + (this._options.auto_save_delay ? "&autoSaveDelay=" + encodeURIComponent(String(this._options.auto_save_delay)) : "") + "&debug=" + this._options.debug + (this._options.snapshot_url ? "&snapshotUrl=" + encodeURIComponent(this._options.snapshot_url) : "") + (this._options.timezone ? "&timezone=" + encodeURIComponent(this._options.timezone) : "") + (this._options.study_count_limit ? "&studyCountLimit=" + encodeURIComponent(String(this._options.study_count_limit)) : "") + (this._options.symbol_search_request_delay ? "&ssreqdelay=" + encodeURIComponent(String(this._options.symbol_search_request_delay)) : ""); - return '' - }, - t - }(), - d = a; - window.TradingView = window.TradingView || {}, - window.TradingView.version = o, - t.version = o, - t.onready = i, - t.widget = d, - Object.defineProperty(t, "__esModule", { - value: !0 - }) - }); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.TradingView=t.TradingView||{})}(this,function(t){"use strict";function e(t,o){var i=n({},t);for(var s in o)"object"!=typeof t[s]||null===t[s]||Array.isArray(t[s])?void 0!==o[s]&&(i[s]=o[s]):i[s]=e(t[s],o[s]);return i}function o(){return"1.12 (internal id 7580da73 @ 2018-05-14 05:13:04.428607)"}function i(t){window.addEventListener("DOMContentLoaded",t,!1)}var n=Object.assign||function(t){for(var e,o=arguments,i=1,n=arguments.length;i'},t}(),d=a;window.TradingView=window.TradingView||{},window.TradingView.version=o,t.version=o,t.onready=i,t.widget=d,Object.defineProperty(t,"__esModule",{value:!0})}); diff --git a/public/static/bundles/13.416855bb3e77f54b85bc.js b/public/static/bundles/13.280894673316ad6ac6f2.js similarity index 97% rename from public/static/bundles/13.416855bb3e77f54b85bc.js rename to public/static/bundles/13.280894673316ad6ac6f2.js index c8625e0..7fd3a6a 100644 --- a/public/static/bundles/13.416855bb3e77f54b85bc.js +++ b/public/static/bundles/13.280894673316ad6ac6f2.js @@ -1,4 +1,4 @@ -webpackJsonp([13],{334:function(t,e,n){var o,i,r;!function(a,c){i=[t,n(516),n(1091),n(687)],o=c,void 0!==(r="function"==typeof o?o.apply(e,i):o)&&(t.exports=r)}(0,function(t,e,n,o){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var l=i(e),s=i(n),f=i(o),h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d=function(){function t(t,e){var n,o;for(n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===h(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,f.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return u("action",t)}},{key:"defaultTarget",value:function(t){var e=u("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return u("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),e}(s.default);t.exports=p})},516:function(t,e,n){var o,i,r;!function(a,c){i=[t,n(1090)],o=c, +webpackJsonp([13],{334:function(t,e,n){var o,i,r;!function(a,c){i=[t,n(516),n(1092),n(687)],o=c,void 0!==(r="function"==typeof o?o.apply(e,i):o)&&(t.exports=r)}(0,function(t,e,n,o){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var l=i(e),s=i(n),f=i(o),h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d=function(){function t(t,e){var n,o;for(n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===h(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,f.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return u("action",t)}},{key:"defaultTarget",value:function(t){var e=u("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return u("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),e}(s.default);t.exports=p})},516:function(t,e,n){var o,i,r;!function(a,c){i=[t,n(1091)],o=c, void 0!==(r="function"==typeof o?o.apply(e,i):o)&&(t.exports=r)}(0,function(t,e){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=n(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(){function t(t,e){var n,o;for(n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t,e=this,n="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-9999px",t=window.pageYOffset||document.documentElement.scrollTop,this.fakeElem.style.top=t+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,i.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,i.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target", -set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=c})},613:function(t,e){function n(t,e){for(;t&&t.nodeType!==i;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}var o,i=9;"undefined"==typeof Element||Element.prototype.matches||(o=Element.prototype,o.matches=o.matchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector||o.webkitMatchesSelector),t.exports=n},614:function(t,e,n){function o(t,e,n,o,i){var a=r.apply(this,arguments);return t.addEventListener(n,a,i),{destroy:function(){t.removeEventListener(n,a,i)}}}function i(t,e,n,i,r){return"function"==typeof t.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return o(t,e,n,i,r)}))}function r(t,e,n,o){return function(n){n.delegateTarget=a(n.target,e),n.delegateTarget&&o.call(t,n)}}var a=n(613);t.exports=i},686:function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var n=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},687:function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return i(t,e,n);if(c.nodeList(t))return r(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function i(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function r(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return u(document.body,t,e,n)}var c=n(686),u=n(614);t.exports=o},1090:function(t,e){function n(t){var e,n,o,i;return"SELECT"===t.nodeName?(t.focus(),e=t.value):"INPUT"===t.nodeName||"TEXTAREA"===t.nodeName?(n=t.hasAttribute("readonly"),n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value):(t.hasAttribute("contenteditable")&&t.focus(),o=window.getSelection(), -i=document.createRange(),i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i),e=""+o),e}t.exports=n},1091:function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){i.off(t,o),e.apply(n,arguments)}var i=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,i=n.length;for(o;o");return this.bindControl(new l(p(e),this._linetool.properties().collectibleColors,!0,this.model(),"Change All Lines Color",0)),{label:$(""+$.t("Use one color")+""),editor:e}},n.prototype.addOneColorPropertyWidget=function(e){var t=this.createOneColorForAllLinesWidget(),o=$("");o.append($("")).append(t.label).append(t.editor),o.appendTo(e)},n=i(n),n.createTemplatesPropertyPage=i,e.exports=n},15:function(e,t,o){"use strict";function i(){return $('
      ').slider({max:4,min:1,step:1})}Object.defineProperty(t,"__esModule",{value:!0}),o(22),o(285),t.createLineWidthEditor=i},31:function(e,t,o){"use strict";function i(){return new n.Combobox([{html:'
      ',value:a.LINESTYLE_SOLID},{html:'
      ',value:a.LINESTYLE_DOTTED},{html:'
      ',value:a.LINESTYLE_DASHED}])}var n,a;Object.defineProperty(t,"__esModule",{value:!0}),n=o(738),a=o(115),t.createLineStyleEditor=i},65:function(e,t,o){"use strict";function i(e){var t=$('
      ').slider({max:100,min:0,step:1}),o=["-moz-linear-gradient(left, %COLOR 0%, transparent 100%)","-webkit-gradient(linear, left top, right top, color-stop(0%,%COLOR), color-stop(100%,transparent))","-webkit-linear-gradient(left, %COLOR 0%,transparent 100%)","-o-linear-gradient(left, %COLOR 0%,transparent 100%)","linear-gradient(to right, %COLOR 0%,transparent 100%)"];return t.updateColor=function(e){var i=t.find(".gradient");o.forEach(function(t){i.css("background-image",t.replace(/%COLOR/,e))})},e?(t.updateColor(e.val()||"black"),e.on("change",function(e){t.updateColor(e.target.value)})):t.updateColor("black"),t}Object.defineProperty(t,"__esModule",{value:!0}),o(22),o(285),t.createTransparencyEditor=i},81:function(e,t,o){"use strict";function i(e,t,o){a.call(this,e,t),this._linetool=o,this.prepareLayout()}var n=o(10),a=n.PropertyPage,r=n.GreateTransformer,l=n.LessTransformer,p=n.ToIntTransformer,s=n.SimpleStringBinder;o(142),inherit(i,a),i.BarIndexPastLimit=-5e4,i.BarIndexFutureLimit=15e3,i.prototype.bindBarIndex=function(e,t,o,n){var a=[p(e.value()),r(i.BarIndexPastLimit),l(i.BarIndexFutureLimit)];this.bindControl(new s(t,e,a,!1,o,n))}, -i.prototype.createPriceEditor=function(e){var t,o=this._linetool.ownerSource().formatter(),i=function(e){return o.format(e)},n=function(e){var t=o.parse(e);if(t.res)return t.price?t.price:t.value},a=$("");return a.TVTicker({step:o._minMove/o._priceScale||1,formatter:i,parser:n}),e&&(t=[function(t){var o=n(t);return void 0===o?e.value():o}],this.bindControl(new s(a,e,t,!1,this.model(),"Change "+this._linetool+" point price")).addFormatter(function(e){return o.format(e)})),a},i.prototype._createPointRow=function(e,t,o){var i,n,a,r,l,p=$(""),s=$("");return s.html($.t("Price")+o),s.appendTo(p),i=$(""),i.appendTo(p),n=this.createPriceEditor(t.price),n.appendTo(i),a=$(""),a.html($.t("Bar #")),a.appendTo(p),r=$(""),r.appendTo(p),l=$(""),l.appendTo(r),l.addClass("ticker"),this.bindBarIndex(t.bar,l,this.model(),"Change "+this._linetool+" point bar index"),p},i.prototype.prepareLayoutForTable=function(e){var t,o,i,n,a,r=this._linetool.points(),l=r.length;for(t=0;t1?" "+(t+1):"",a=this._createPointRow(o,i,n),a.appendTo(e))},i.prototype.prepareLayout=function(){this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),this.prepareLayoutForTable(this._table),this.loadData()},i.prototype.widget=function(){return this._table},e.exports=i},121:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Coordinates=100]="Coordinates",e[e.Display=100]="Display",e[e.Style=200]="Style",e[e.Inputs=300]="Inputs",e[e.Properties=250]="Properties"}(t.TabPriority||(t.TabPriority={})),function(e){e.background="Background",e.coordinates="Coordinates",e.drawings="Drawings",e.events="Events",e.eventsAndAlerts="Events & Alerts",e.inputs="Inputs",e.properties="Properties",e.scales="Scales",e.sourceCode="Source Code",e.style="Style",e.timezoneSessions="Timezone/Sessions",e.trading="Trading",e.visibility="Visibility"}(t.TabNames||(t.TabNames={})),function(e){e[e.Default=100]="Default",e[e.UserSave=200]="UserSave",e[e.Override=300]="Override"}(t.TabOpenFrom||(t.TabOpenFrom={}))},208:function(e,t,o){"use strict";function i(e,t,o){r.call(this,e,t),this._study=o,this.prepareLayout()}function n(e,t,o){r.call(this,e,t),this._study=o,this._property=e,this.prepareLayout()}var a=o(10),r=a.PropertyPage,l=a.GreateTransformer,p=a.LessTransformer,s=a.ToIntTransformer,d=a.ToFloatTransformer,h=a.SimpleComboBinder,c=a.BooleanBinder,b=a.DisabledBinder,u=a.ColorBinding,C=a.SliderBinder,y=a.SimpleStringBinder,g=o(47).addColorPicker,w=o(31).createLineStyleEditor,T=o(1121).createShapeLocationEditor,_=o(1122).createShapeStyleEditor,m=o(15).createLineWidthEditor,f=o(1123).createVisibilityEditor,L=o(1119).createHHistDirectionEditor,v=o(476).createPlotEditor,k=o(38).NumericFormatter,S=o(45),P=o(106).PlotType,x=o(13).getLogger("Chart.Study.PropertyPage");inherit(i,r),i.prototype.prepareLayout=function(){function e(e){ +i.prototype.createPriceEditor=function(e){var t,o=this._linetool.ownerSource().formatter(),i=function(e){return o.format(e)},n=function(e){var t=o.parse(e);if(t.res)return t.price?t.price:t.value},a=$("");return a.TVTicker({step:o._minMove/o._priceScale||1,formatter:i,parser:n}),e&&(t=[function(t){var o=n(t);return void 0===o?e.value():o}],this.bindControl(new s(a,e,t,!1,this.model(),"Change "+this._linetool+" point price")).addFormatter(function(e){return o.format(e)})),a},i.prototype._createPointRow=function(e,t,o){var i,n,a,r,l,p=$(""),s=$("");return s.html($.t("Price")+o),s.appendTo(p),i=$(""),i.appendTo(p),n=this.createPriceEditor(t.price),n.appendTo(i),a=$(""),a.html($.t("Bar #")),a.appendTo(p),r=$(""),r.appendTo(p),l=$(""),l.appendTo(r),l.addClass("ticker"),this.bindBarIndex(t.bar,l,this.model(),"Change "+this._linetool+" point bar index"),p},i.prototype.prepareLayoutForTable=function(e){var t,o,i,n,a,r=this._linetool.points(),l=r.length;for(t=0;t1?" "+(t+1):"",a=this._createPointRow(o,i,n),a.appendTo(e))},i.prototype.prepareLayout=function(){this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),this.prepareLayoutForTable(this._table),this.loadData()},i.prototype.widget=function(){return this._table},e.exports=i},121:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Coordinates=100]="Coordinates",e[e.Display=100]="Display",e[e.Style=200]="Style",e[e.Inputs=300]="Inputs",e[e.Properties=250]="Properties"}(t.TabPriority||(t.TabPriority={})),function(e){e.background="Background",e.coordinates="Coordinates",e.drawings="Drawings",e.events="Events",e.eventsAndAlerts="Events & Alerts",e.inputs="Inputs",e.properties="Properties",e.scales="Scales",e.sourceCode="Source Code",e.style="Style",e.timezoneSessions="Timezone/Sessions",e.trading="Trading",e.visibility="Visibility"}(t.TabNames||(t.TabNames={})),function(e){e[e.Default=100]="Default",e[e.UserSave=200]="UserSave",e[e.Override=300]="Override"}(t.TabOpenFrom||(t.TabOpenFrom={}))},208:function(e,t,o){"use strict";function i(e,t,o){r.call(this,e,t),this._study=o,this.prepareLayout()}function n(e,t,o){r.call(this,e,t),this._study=o,this._property=e,this.prepareLayout()}var a=o(10),r=a.PropertyPage,l=a.GreateTransformer,p=a.LessTransformer,s=a.ToIntTransformer,d=a.ToFloatTransformer,h=a.SimpleComboBinder,c=a.BooleanBinder,b=a.DisabledBinder,u=a.ColorBinding,C=a.SliderBinder,y=a.SimpleStringBinder,g=o(47).addColorPicker,w=o(31).createLineStyleEditor,T=o(1122).createShapeLocationEditor,_=o(1123).createShapeStyleEditor,m=o(15).createLineWidthEditor,f=o(1124).createVisibilityEditor,L=o(1120).createHHistDirectionEditor,v=o(476).createPlotEditor,k=o(38).NumericFormatter,S=o(45),P=o(106).PlotType,x=o(13).getLogger("Chart.Study.PropertyPage");inherit(i,r),i.prototype.prepareLayout=function(){function e(e){ return(new k).format(e)}var t,o,n,a,r,l,p,s,b,T,_,f,L,v,P,B,E,R,F,I,A,D,W,O,V,j,z,M,H,q,N,G,U,Y,K,Q;for(this._table=$(""),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),t=this._study.metaInfo(),o={},n=0;n0)for(n=0;n'),T.appendTo(this._table),_=$("
      "),_.appendTo(T),f=$(""),f.appendTo(_),L=$.t(b.name.value(),{context:"input"}),v=this.createLabeledCell(L,f).appendTo(T).addClass("propertypage-name-label"),P=$(""),P.appendTo(T),P.addClass("colorpicker-cell"),B=g(P),E=$(""),E.appendTo(T),R=m(),R.appendTo(E),F=$('').css({whiteSpace:"nowrap"}),F.appendTo(T),I=w(),I.render().appendTo(F),A=$(""),A.appendTo(F),D=[d(b.value.value())],W="Change band",O=new y(A,b.value,D,!1,this.model(),W),O.addFormatter(e),this.bindControl(O),this.bindControl(new c(f,b.visible,!0,this.model(),W)),this.bindControl(new u(B,b.color,!0,this.model(),W)),this.bindControl(new h(I,b.linestyle,parseInt,!0,this.model(),W)),this.bindControl(new C(R,b.linewidth,!0,this.model(),W)));if(this._study.properties().bandsBackground&&(b=this._study.properties().bandsBackground,V=$.t("Background"),W=$.t("Change band background"),T=this._prepareFilledAreaBackground(b.fillBackground,b.backgroundColor,b.transparency,V,W),T.appendTo(this._table)),this._study.properties().areaBackground&&(b=this._study.properties().areaBackground,V=$.t("Background"),W=$.t("Change area background"),T=this._prepareFilledAreaBackground(b.fillBackground,b.backgroundColor,b.transparency,V,W),T.appendTo(this._table)),void 0!==(j=t.filledAreas))for(n=0;n'),_=$(""),_.appendTo(T),f=$(""),f.appendTo(_), this.bindControl(new c(f,b.visible,!0,this.model(),W+" visibility")),this.createLabeledCell(V,f).appendTo(T).addClass("propertypage-name-label"),T.appendTo(this._table),M=this._findPlotPalette(n,z),H=M.palette,q=M.paletteProps,this._prepareLayoutForPalette(0,z,H,q,W)):(T=this._prepareFilledAreaBackground(b.visible,b.color,b.transparency,V,W),T.appendTo(this._table)));for(N in t.graphics){G=t.graphics[N];for(U in G)b=this._property.graphics[N][U],i["_createRow_"+N].call(this,this._table,b)}Y=this._table.find(".visibility-switch.plot-visibility-switch"),1===Y.length&&(_=Y.parent(),_.css("display","none"),v=this._table.find(".propertypage-plot-with-palette"),1===v.length?v.css("display","none"):(v=this._table.find(".propertypage-name-label"),v.css("padding-left",0),v.find("label").attr("for",""))),K=this._prepareStudyPropertiesLayout(),this._table=this._table.add(K),S.isScriptStrategy(t)&&(Q=this._prepareOrdersSwitches(),this._table=this._table.add(Q)),this.loadData()},i.prototype._prepareOrdersSwitches=function(){var e,t,o,i,n,a,r,l=$(''),p="chart-orders-switch_"+Date.now().toString(36),s=$("").appendTo(l),d=$('').appendTo($("").appendTo(l),o=$('').appendTo($("").appendTo(l),a=$('').appendTo($("'),o.appendTo(this._table),i=$("'),o.appendTo(this._table), i=$("');y.appendTo(this._table),o=$("'),a.appendTo(this._table),r=$("');L.appendTo(this._table),o=$("'), @@ -16,7 +16,7 @@ i=$("").appendTo(this._table),$('
      ").appendTo(s));return $('").appendTo($("").appendTo(s)),e="chart-orders-labels-switch_"+Date.now().toString(36),t=$("
      ").appendTo(t)),$('").appendTo($("").appendTo(t)),i="chart-orders-qty-switch_"+Date.now().toString(36),n=$("
      ").appendTo(n)),$('").appendTo($("").appendTo(n)),r=this._study.properties(),this.bindControl(new c(d,r.strategy.orders.visible,!0,this.model(),"Trades on chart visibility")),this.bindControl(new c(o,r.strategy.orders.showLabels,!0,this.model(),"Signal labels visibility")),this.bindControl(new b(o,r.strategy.orders.visible,!0,this.model(),"Signal labels visibility",!0)),this.bindControl(new c(a,r.strategy.orders.showQty,!0,this.model(),"Quantity visibility")),this.bindControl(new b(a,r.strategy.orders.visible,!0,this.model(),"Quantity visibility",!0)),l},i.prototype._prepareLayoutForPlot=function(e,t){var o,i,n,a,r,l,p,s,d,b,y,w,T=t.id,_=this._study.properties().styles[T],f=this._findPlotPalette(e,t),L=f.palette,k=f.paletteProps,S="Change "+T;L?(o=$('
      "),i.appendTo(o),i.addClass("visibility-cell"),n=$(""),n.appendTo(i),this.bindControl(new c(n,_.visible,!0,this.model(),S)),a=$.t(_.title.value(),{context:"input"}),this.createLabeledCell(a,n).appendTo(o).addClass("propertypage-name-label propertypage-plot-with-palette"),this._prepareLayoutForPalette(e,t,L,k,S)):(o=$('
      "),i.appendTo(o),i.addClass("visibility-cell"),n=$(""),n.appendTo(i),a=$.t(this._study.properties().styles[T].title.value(),{context:"input"}),this.createLabeledCell(a,n).appendTo(o).addClass("propertypage-name-label"),r=$(""),r.appendTo(o),r.addClass("colorpicker-cell"),l=g(r),p=$(""),p.appendTo(o),s=m(),s.appendTo(p),d=$(""),d.appendTo(o),b=v(),b.appendTo(d),y=$(""),y.appendTo(o),w=$(""),w.appendTo(y),this.createLabeledCell("Price Line",w).appendTo(o),this.bindControl(new c(n,_.visible,!0,this.model(),S)),this.bindControl(new u(l,_.color,!0,this.model(),S,_.transparency)),this.bindControl(new C(s,_.linewidth,!0,this.model(),S,this._study.metaInfo().isTVScript)),this.bindControl(new h(b,_.plottype,parseInt,!0,this.model(),S)),this.bindControl(new c(w,_.trackPrice,!0,this.model(),"Change Price Line")))},i.prototype._prepareLayoutForBarsPlot=function(e,t){var o,i,n,a,r,l,p=t.id,s=this._study.properties().ohlcPlots[p],d=this._findPlotPalette(e,t),h=d.palette,b=d.paletteProps,C="Change "+p,y=$('
      "),o.appendTo(y),o.addClass("visibility-cell"),i=$(""),i.appendTo(o),this.bindControl(new c(i,s.visible,!0,this.model(),C)),n=s.title.value(),this.createLabeledCell(n,i).appendTo(y).addClass("propertypage-name-label"),h?(a=!0,this._prepareLayoutForPalette(e,t,h,b,C,a)):(r=$(""),r.appendTo(y),r.addClass("colorpicker-cell"),l=g(r),this.bindControl(new u(l,s.color,!0,this.model(),C)))},i.prototype._prepareLayoutForCandlesPlot=function(e,t){var o,i,n,a,r,l,p,s,d;this._prepareLayoutForBarsPlot(e,t),o=t.id,i=this._study.properties().ohlcPlots[o],n="Change "+o,a=$('
      "),r.appendTo(a),r.addClass("visibility-cell"),l=$(""),l.appendTo(r),this.bindControl(new c(l,i.drawWick,!0,this.model(),n)),p="Wick",this.createLabeledCell(p,l).appendTo(a),s=$(""),s.appendTo(a),s.addClass("colorpicker-cell"),d=g(s),this.bindControl(new u(d,i.wickColor,!0,this.model(),n))},i.prototype._prepareLayoutForShapesPlot=function(e,t){var o,i,n,a,r,l,p,s,d,b=t.id,C=this._study.properties().styles[b],y=this._findPlotPalette(e,t),w=y.palette,m=y.paletteProps,f="Change "+b,L=$('
      "),o.appendTo(L),o.addClass("visibility-cell"),i=$(""),i.appendTo(o),this.bindControl(new c(i,C.visible,!0,this.model(),f)),n=$.t(this._study.properties().styles[b].title.value(),{context:"input"}),this.createLabeledCell(n,i).appendTo(L).addClass("propertypage-name-label"),a=$(""),a.appendTo(L),r=_(),r.appendTo(a),this.bindControl(new h(r,C.plottype,null,!0,this.model(),f)),l=$(""),l.appendTo(L),p=T(),p.appendTo(l),this.bindControl(new h(p,C.location,null,!0,this.model(),f)),w?this._prepareLayoutForPalette(e,t,w,m,f):(L=$('
      ').append($("