@fintatech/fintachart 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/LICENSE.md +63 -0
- package/README.md +151 -0
- package/THIRD_PARTY_NOTICES.md +38 -0
- package/basic-objects.html +165 -0
- package/css/FintaChart.min.css +1 -0
- package/css/external/jqNumericField.min.css +1 -0
- package/css/external/spectrum.min.css +7 -0
- package/css/external/toastr.min.css +1 -0
- package/custom-indicator.html +209 -0
- package/d.ts/FintaChart.d.ts +24313 -0
- package/d.ts/frameworks/Intl.d.ts +115 -0
- package/d.ts/frameworks/bootstrap.d.ts +128 -0
- package/d.ts/frameworks/bootstrap.v3.datetimepicker.d.ts +10 -0
- package/d.ts/frameworks/detectizr.d.ts +27 -0
- package/d.ts/frameworks/dom-to-image-more.d.ts +17 -0
- package/d.ts/frameworks/html2canvas.d.ts +101 -0
- package/d.ts/frameworks/i18nextXHRBackend.d.ts +42 -0
- package/d.ts/frameworks/jquery-i18next.d.ts +14 -0
- package/d.ts/frameworks/jquery-ui.d.ts +1914 -0
- package/d.ts/frameworks/jquery.d.ts +3779 -0
- package/d.ts/frameworks/jquery.ui.touch-punch.d.ts +12 -0
- package/d.ts/frameworks/moment-node.d.ts +485 -0
- package/d.ts/frameworks/moment.d.ts +10 -0
- package/d.ts/frameworks/tinycolor.d.ts +377 -0
- package/d.ts/frameworks-modified/bootstrap-select.d.ts +18 -0
- package/d.ts/frameworks-modified/i18next.d.ts +148 -0
- package/d.ts/frameworks-modified/jquery.autocolumnlist.d.ts +17 -0
- package/d.ts/frameworks-modified/jquery.resizable.d.ts +20 -0
- package/d.ts/frameworks-modified/spectrum.d.ts +294 -0
- package/d.ts/frameworks-modified/switchery.d.ts +69 -0
- package/d.ts/frameworks-modified/toastr.d.ts +224 -0
- package/data/offline-market-history/EUR_CAD/Day/1.csv +2001 -0
- package/data/offline-market-history/EUR_CAD/Hour/1.csv +1702 -0
- package/data/offline-market-history/EUR_CAD/Hour/4.csv +442 -0
- package/data/offline-market-history/EUR_CAD/Minute/1.csv +2001 -0
- package/data/offline-market-history/EUR_CAD/Minute/15.csv +2001 -0
- package/data/offline-market-history/EUR_CAD/Minute/5.csv +2001 -0
- package/data/offline-market-history/EUR_CAD/Monthly/1.csv +175 -0
- package/data/offline-market-history/EUR_CAD/Weekly/1.csv +752 -0
- package/data/offline-market-history/EUR_CAD/Yearly/1.csv +16 -0
- package/data/offline-market-history/EUR_GBP/Day/1.csv +2001 -0
- package/data/offline-market-history/EUR_GBP/Hour/1.csv +1702 -0
- package/data/offline-market-history/EUR_GBP/Hour/4.csv +442 -0
- package/data/offline-market-history/EUR_GBP/Minute/1.csv +2001 -0
- package/data/offline-market-history/EUR_GBP/Minute/15.csv +2001 -0
- package/data/offline-market-history/EUR_GBP/Minute/5.csv +2001 -0
- package/data/offline-market-history/EUR_GBP/Monthly/1.csv +199 -0
- package/data/offline-market-history/EUR_GBP/Weekly/1.csv +860 -0
- package/data/offline-market-history/EUR_GBP/Yearly/1.csv +18 -0
- package/data/predefined-templates/EMAAndMACDTemplate.json +100 -0
- package/data/predefined-templates/bigTreeTemplate.json +137 -0
- package/data/predefined-templates/multiIndicator.json +136 -0
- package/data/predefined-templates/renkoTemplate.json +50 -0
- package/data/predefined-templates/standartCandleTemplate.json +73 -0
- package/fonts/calibri/calibri.svg +3707 -0
- package/fonts/calibri/calibri.ttf +0 -0
- package/fonts/calibri/calibri.woff +0 -0
- package/fonts/courier-new/courier-new.svg +633 -0
- package/fonts/courier-new/courier-new.ttf +0 -0
- package/fonts/courier-new/courier-new.woff +0 -0
- package/fonts/open-sans-cyrillic/open-sans-cyrillic.svg +475 -0
- package/fonts/open-sans-cyrillic/open-sans-cyrillic.ttf +0 -0
- package/fonts/open-sans-cyrillic/open-sans-cyrillic.woff +0 -0
- package/fonts/open-sans-cyrillic-ext/open-sans-cyrillic-ext.svg +567 -0
- package/fonts/open-sans-cyrillic-ext/open-sans-cyrillic-ext.ttf +0 -0
- package/fonts/open-sans-cyrillic-ext/open-sans-cyrillic-ext.woff +0 -0
- package/fonts/open-sans-greek/open-sans-greek.svg +603 -0
- package/fonts/open-sans-greek/open-sans-greek.ttf +0 -0
- package/fonts/open-sans-greek/open-sans-greek.woff +0 -0
- package/fonts/open-sans-greek-ext/open-sans-greek-ext.svg +42 -0
- package/fonts/open-sans-greek-ext/open-sans-greek-ext.ttf +0 -0
- package/fonts/open-sans-greek-ext/open-sans-greek-ext.woff +0 -0
- package/fonts/open-sans-latin/open-sans-latin.svg +1863 -0
- package/fonts/open-sans-latin/open-sans-latin.ttf +0 -0
- package/fonts/open-sans-latin/open-sans-latin.woff +0 -0
- package/fonts/open-sans-latin-ext/open-sans-latin-ext.svg +1686 -0
- package/fonts/open-sans-latin-ext/open-sans-latin-ext.ttf +0 -0
- package/fonts/open-sans-latin-ext/open-sans-latin-ext.woff +0 -0
- package/fonts/open-sans-vietnamese/open-sans-vietnamese.svg +375 -0
- package/fonts/open-sans-vietnamese/open-sans-vietnamese.ttf +0 -0
- package/fonts/open-sans-vietnamese/open-sans-vietnamese.woff +0 -0
- package/fonts/rubik-medium/Rubik-Medium.svg +8831 -0
- package/fonts/rubik-medium/Rubik-Medium.ttf +0 -0
- package/fonts/rubik-medium/Rubik-Medium.woff +0 -0
- package/fonts/rubik-regular/Rubik-Regular.svg +8885 -0
- package/fonts/rubik-regular/Rubik-Regular.ttf +0 -0
- package/fonts/rubik-regular/Rubik-Regular.woff +0 -0
- package/fonts/source-sans-pro-latin/source-sans-pro-latin.svg +2642 -0
- package/fonts/source-sans-pro-latin/source-sans-pro-latin.ttf +0 -0
- package/fonts/source-sans-pro-latin/source-sans-pro-latin.woff +0 -0
- package/fonts/source-sans-pro-latin-ext/source-sans-pro-latin-ext.svg +1572 -0
- package/fonts/source-sans-pro-latin-ext/source-sans-pro-latin-ext.ttf +0 -0
- package/fonts/source-sans-pro-latin-ext/source-sans-pro-latin-ext.woff +0 -0
- package/fonts/source-sans-pro-vietnamese/source-sans-pro-vietnamese.svg +428 -0
- package/fonts/source-sans-pro-vietnamese/source-sans-pro-vietnamese.ttf +0 -0
- package/fonts/source-sans-pro-vietnamese/source-sans-pro-vietnamese.woff +0 -0
- package/htmldialogs/ChartContextMenu.html +3 -0
- package/htmldialogs/ChartTypeSettingsDialog.html +231 -0
- package/htmldialogs/CheckboxIndicatorParameterControl.html +9 -0
- package/htmldialogs/CompareInstrumentSettings.html +61 -0
- package/htmldialogs/ComparingContextMenu.html +8 -0
- package/htmldialogs/ConfirmDialog.html +28 -0
- package/htmldialogs/DemoModePopup.html +24 -0
- package/htmldialogs/FillPlotStyleControl.html +28 -0
- package/htmldialogs/HotkeysSettings.html +28 -0
- package/htmldialogs/IndicatorContextMenu.html +18 -0
- package/htmldialogs/IndicatorSettingsDialog.html +38 -0
- package/htmldialogs/IndicatorsDialog.html +39 -0
- package/htmldialogs/IndicatorsOverview_en.html +1694 -0
- package/htmldialogs/IndicatorsOverview_ua.html +9 -0
- package/htmldialogs/InstrumentSearchDialog.html +22 -0
- package/htmldialogs/LinePlotStyleControl.html +33 -0
- package/htmldialogs/MainSettings.html +292 -0
- package/htmldialogs/MarketEventPopup.html +27 -0
- package/htmldialogs/MarketEventsSettingsDialog.html +22 -0
- package/htmldialogs/NumericIndicatorParameter.html +8 -0
- package/htmldialogs/OpenChart.html +6 -0
- package/htmldialogs/PatternSettingsControl.html +26 -0
- package/htmldialogs/PatternsIndicatorSettingsDialog.html +30 -0
- package/htmldialogs/PatternsSettingsParameterControl.html +12 -0
- package/htmldialogs/PositionShapeContextMenu.html +9 -0
- package/htmldialogs/QuantityPopup.html +7 -0
- package/htmldialogs/Scrollbar.html +6 -0
- package/htmldialogs/SelectableIndicatorParameter.html +9 -0
- package/htmldialogs/ShapeContextMenu.html +7 -0
- package/htmldialogs/ShapeFibonacciSettingsDialog.html +261 -0
- package/htmldialogs/ShapePositionSettingsDialog.html +351 -0
- package/htmldialogs/ShapeSettingsDialog.html +521 -0
- package/htmldialogs/TimeFrameChangePopup.html +11 -0
- package/htmldialogs/TimeIndicatorParameterControl.html +89 -0
- package/htmldialogs/Toolbar.html +1710 -0
- package/htmldialogs/TooltipView.html +151 -0
- package/htmldialogs/TradingContextMenu.html +2 -0
- package/img/ContextMenuCheckbox.png +0 -0
- package/img/cross-hairs.cur +0 -0
- package/img/eu.png +0 -0
- package/img/favicon/favicon.ico +0 -0
- package/img/fist.cur +0 -0
- package/img/point.cur +0 -0
- package/img/svg-icons/Illustration-License-b.svg +1 -0
- package/img/svg-icons/Illustration-License-w.svg +1 -0
- package/img/svg-icons/abcd-label-pattern.svg +1 -0
- package/img/svg-icons/abcd-pattern.svg +1 -0
- package/img/svg-icons/add.svg +1 -0
- package/img/svg-icons/adjust-OHLC.svg +1 -0
- package/img/svg-icons/adjust-all.svg +1 -0
- package/img/svg-icons/andrews-pitchfork.svg +1 -0
- package/img/svg-icons/arrow-down.svg +1 -0
- package/img/svg-icons/arrow-left.svg +3 -0
- package/img/svg-icons/arrow-right.svg +3 -0
- package/img/svg-icons/arrow-type-type.svg +3 -0
- package/img/svg-icons/arrow-up.svg +1 -0
- package/img/svg-icons/arrow.svg +1 -0
- package/img/svg-icons/balloon.svg +1 -0
- package/img/svg-icons/brand-x.svg +1 -0
- package/img/svg-icons/calculator.svg +15 -0
- package/img/svg-icons/chartType-area.svg +1 -0
- package/img/svg-icons/chartType-bars.svg +1 -0
- package/img/svg-icons/chartType-candles-volume.svg +1 -0
- package/img/svg-icons/chartType-candles.svg +1 -0
- package/img/svg-icons/chartType-colored-bars.svg +1 -0
- package/img/svg-icons/chartType-equi-volume-shadow.svg +1 -0
- package/img/svg-icons/chartType-equi-volume.svg +1 -0
- package/img/svg-icons/chartType-heikin-ashi.svg +1 -0
- package/img/svg-icons/chartType-hollow-candles.svg +1 -0
- package/img/svg-icons/chartType-kagi.svg +1 -0
- package/img/svg-icons/chartType-line-break.svg +1 -0
- package/img/svg-icons/chartType-line.svg +1 -0
- package/img/svg-icons/chartType-point-figure.svg +1 -0
- package/img/svg-icons/chartType-range-bars.svg +1 -0
- package/img/svg-icons/chartType-renko.svg +1 -0
- package/img/svg-icons/chevron-right-double.svg +3 -0
- package/img/svg-icons/chevron.svg +3 -0
- package/img/svg-icons/circle.svg +1 -0
- package/img/svg-icons/close-floating-toolbar.svg +1 -0
- package/img/svg-icons/close-pane.svg +1 -0
- package/img/svg-icons/close-rect.svg +4 -0
- package/img/svg-icons/close-windows.svg +1 -0
- package/img/svg-icons/close.svg +4 -0
- package/img/svg-icons/compare.svg +1 -0
- package/img/svg-icons/copy.svg +1 -0
- package/img/svg-icons/cursorType-arrow-with-labels.svg +1 -0
- package/img/svg-icons/cursorType-arrow.svg +3 -0
- package/img/svg-icons/cursorType-crosshairs.svg +1 -0
- package/img/svg-icons/cursorType-point.svg +1 -0
- package/img/svg-icons/cyclic-lines.svg +1 -0
- package/img/svg-icons/default-screen.svg +11 -0
- package/img/svg-icons/demo-popup-bg.svg +1 -0
- package/img/svg-icons/diamond.svg +1 -0
- package/img/svg-icons/dot.svg +1 -0
- package/img/svg-icons/drag.svg +1 -0
- package/img/svg-icons/elliott-wave-pattern.svg +1 -0
- package/img/svg-icons/ellipse.svg +1 -0
- package/img/svg-icons/error-channel.svg +1 -0
- package/img/svg-icons/export.svg +1 -0
- package/img/svg-icons/extended-line.svg +3 -0
- package/img/svg-icons/fibonacci-arcs.svg +1 -0
- package/img/svg-icons/fibonacci-ellipses.svg +1 -0
- package/img/svg-icons/fibonacci-extensions.svg +1 -0
- package/img/svg-icons/fibonacci-fan.svg +1 -0
- package/img/svg-icons/fibonacci-retracements.svg +1 -0
- package/img/svg-icons/fibonacci-time-zones.svg +1 -0
- package/img/svg-icons/fintatech.svg +1 -0
- package/img/svg-icons/free-hand.svg +1 -0
- package/img/svg-icons/full-screen.svg +11 -0
- package/img/svg-icons/full-windows.svg +12 -0
- package/img/svg-icons/gann-fan.svg +1 -0
- package/img/svg-icons/general-delete.svg +3 -0
- package/img/svg-icons/head-shoulders-pattern.svg +1 -0
- package/img/svg-icons/horizontal-line.svg +1 -0
- package/img/svg-icons/horizontal-ray.svg +3 -0
- package/img/svg-icons/html-code.svg +1 -0
- package/img/svg-icons/image.svg +5 -0
- package/img/svg-icons/images.svg +1 -0
- package/img/svg-icons/in-shape-mode.svg +1 -0
- package/img/svg-icons/insert-indicator.svg +1 -0
- package/img/svg-icons/kings-crown-pattern.svg +1 -0
- package/img/svg-icons/latest-position.svg +1 -0
- package/img/svg-icons/line-segment.svg +1 -0
- package/img/svg-icons/link.svg +5 -0
- package/img/svg-icons/lock.svg +3 -0
- package/img/svg-icons/magnet-mode.svg +1 -0
- package/img/svg-icons/measure.svg +1 -0
- package/img/svg-icons/multiply-link.svg +5 -0
- package/img/svg-icons/note.svg +1 -0
- package/img/svg-icons/number-label-pattern.svg +1 -0
- package/img/svg-icons/open-OHLC-pane.svg +1 -0
- package/img/svg-icons/options.svg +1 -0
- package/img/svg-icons/period.svg +1 -0
- package/img/svg-icons/polygon.svg +1 -0
- package/img/svg-icons/polyline.svg +1 -0
- package/img/svg-icons/position-long.svg +90 -0
- package/img/svg-icons/position-long_og.svg +81 -0
- package/img/svg-icons/position-short.svg +90 -0
- package/img/svg-icons/position-short_og.svg +89 -0
- package/img/svg-icons/quadrant-lines.svg +1 -0
- package/img/svg-icons/raff-regression.svg +1 -0
- package/img/svg-icons/ray.svg +3 -0
- package/img/svg-icons/rectangle.svg +1 -0
- package/img/svg-icons/redo-new.svg +3 -0
- package/img/svg-icons/redo.svg +1 -0
- package/img/svg-icons/remove-all-indicators.svg +1 -0
- package/img/svg-icons/remove-all-shapes.svg +1 -0
- package/img/svg-icons/replay-jump.svg +1 -0
- package/img/svg-icons/replay-pause.svg +1 -0
- package/img/svg-icons/replay-play.svg +1 -0
- package/img/svg-icons/replay-skip-end.svg +1 -0
- package/img/svg-icons/replay-skip-one.svg +1 -0
- package/img/svg-icons/save-as-image.svg +1 -0
- package/img/svg-icons/screenshot.svg +5 -0
- package/img/svg-icons/scroll-bottom.svg +1 -0
- package/img/svg-icons/scroll-left.svg +1 -0
- package/img/svg-icons/scroll-right.svg +1 -0
- package/img/svg-icons/scroll-top.svg +1 -0
- package/img/svg-icons/search.svg +1 -0
- package/img/svg-icons/speed-lines.svg +1 -0
- package/img/svg-icons/square.svg +1 -0
- package/img/svg-icons/star.svg +4 -0
- package/img/svg-icons/stash.svg +4 -0
- package/img/svg-icons/stick-to-bar.svg +1 -0
- package/img/svg-icons/stick-to-close.svg +1 -0
- package/img/svg-icons/stick-to-high.svg +1 -0
- package/img/svg-icons/stick-to-low.svg +1 -0
- package/img/svg-icons/stick-to-open.svg +1 -0
- package/img/svg-icons/sticky-mode-off.svg +1 -0
- package/img/svg-icons/tcdPane-alert-indicator.svg +1 -0
- package/img/svg-icons/tcdPane-close.svg +1 -0
- package/img/svg-icons/tcdPane-down.svg +1 -0
- package/img/svg-icons/tcdPane-expand-closed.svg +1 -0
- package/img/svg-icons/tcdPane-expand.svg +1 -0
- package/img/svg-icons/tcdPane-maximize.svg +1 -0
- package/img/svg-icons/tcdPane-options.svg +1 -0
- package/img/svg-icons/tcdPane-remove-indicator.svg +1 -0
- package/img/svg-icons/tcdPane-restore.svg +1 -0
- package/img/svg-icons/tcdPane-toggle.svg +1 -0
- package/img/svg-icons/tcdPane-up.svg +1 -0
- package/img/svg-icons/template-delete.svg +1 -0
- package/img/svg-icons/template-edit.svg +1 -0
- package/img/svg-icons/template-ok.svg +1 -0
- package/img/svg-icons/template.svg +1 -0
- package/img/svg-icons/text-editor-b.svg +1 -0
- package/img/svg-icons/text-editor-i.svg +1 -0
- package/img/svg-icons/text-editor-u.svg +1 -0
- package/img/svg-icons/text.svg +1 -0
- package/img/svg-icons/tirone-levels.svg +1 -0
- package/img/svg-icons/toggle-shapes.svg +1 -0
- package/img/svg-icons/trade-manager.svg +1 -0
- package/img/svg-icons/trend-angle.svg +1 -0
- package/img/svg-icons/trend-channel.svg +1 -0
- package/img/svg-icons/triangle-pattern.svg +1 -0
- package/img/svg-icons/triangle.svg +1 -0
- package/img/svg-icons/undo-new.svg +3 -0
- package/img/svg-icons/undo.svg +1 -0
- package/img/svg-icons/unlock.svg +3 -0
- package/img/svg-icons/vertical-line.svg +1 -0
- package/img/svg-icons/visibleProfile.svg +1 -0
- package/img/svg-icons/web-link.svg +1 -0
- package/img/svg-icons/x.svg +3 -0
- package/img/svg-icons/xabcd-pattern.svg +1 -0
- package/img/svg-icons/zoom-by-area.svg +1 -0
- package/img/svg-icons/zoom.svg +1 -0
- package/img/usa.png +0 -0
- package/index-dark.html +132 -0
- package/index.html +229 -0
- package/localization/en.json +1646 -0
- package/localization/uk.json +1597 -0
- package/multiple-charts.html +162 -0
- package/package.json +62 -0
- package/scripts/FintaChart.min.js +70 -0
- package/scripts/frameworks/Intl.min.js +4 -0
- package/scripts/frameworks/bootstrap.v3.datetimepicker.min.js +2605 -0
- package/scripts/frameworks/detectizr.min.js +1 -0
- package/scripts/frameworks/dom-to-image-more.min.js +3 -0
- package/scripts/frameworks/i18nextXHRBackend.min.js +1 -0
- package/scripts/frameworks/jquery-i18next.min.js +1 -0
- package/scripts/frameworks/jquery-ui.min.js +8 -0
- package/scripts/frameworks/jquery.min.js +3 -0
- package/scripts/frameworks/jquery.ui.touch-punch.min.js +1 -0
- package/scripts/frameworks/moment.min.js +1216 -0
- package/scripts/frameworks-modified/bootstrap-select.js +1024 -0
- package/scripts/frameworks-modified/i18next.js +2075 -0
- package/scripts/frameworks-modified/jquery.autocolumnlist.js +48 -0
- package/scripts/frameworks-modified/jquery.resizable.js +229 -0
- package/scripts/frameworks-modified/spectrum.js +2279 -0
- package/scripts/frameworks-modified/switchery.js +1957 -0
- package/scripts/frameworks-modified/toastr.js +414 -0
- package/scripts/jsdataadapters/fileDataAdapter.js +129 -0
- package/scripts/jsdataadapters/restDataAdapter.js +149 -0
- package/scripts/jsdataadapters/webSocketDataAdapter.js +114 -0
- package/scripts/miscs/templateFileDataAdapter.js +17 -0
- package/scripts/themes/beetTheme.js +2999 -0
- package/scripts/themes/darkTheme.js +3004 -0
- package/scripts/themes/defaultTheme.js +3095 -0
- package/scripts/themes/fintatechDarkTheme.js +3005 -0
- package/scripts/themes/grayTheme.js +3004 -0
- package/scripts/themes/oliveTheme.js +3004 -0
- package/scripts/themes/orangeTheme.js +3004 -0
- package/scripts/themes/purpleTheme.js +3004 -0
- package/scripts/themes/skyTheme.js +3009 -0
- package/scripts/themes/tealTheme.js +3004 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var FintaChart;
|
|
4
|
+
(function (FintaChart) {
|
|
5
|
+
var External;
|
|
6
|
+
(function (External) {
|
|
7
|
+
(function($) {
|
|
8
|
+
var defaults = {
|
|
9
|
+
columns: 4,
|
|
10
|
+
classname: 'column',
|
|
11
|
+
min: 1
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
$.fn.autocolumnlist = function(params){
|
|
15
|
+
|
|
16
|
+
var options = $.extend({}, defaults, params);
|
|
17
|
+
|
|
18
|
+
return this.each(function() {
|
|
19
|
+
|
|
20
|
+
var els = $(this).find('li');
|
|
21
|
+
var dimension = els.length;
|
|
22
|
+
|
|
23
|
+
if (dimension > 0) {
|
|
24
|
+
var elCol = Math.ceil(dimension/options.columns);
|
|
25
|
+
if (elCol < options.min) {
|
|
26
|
+
elCol = options.min;
|
|
27
|
+
}
|
|
28
|
+
var start = 0;
|
|
29
|
+
var end = elCol;
|
|
30
|
+
|
|
31
|
+
for (var i=0; i<options.columns; i++) {
|
|
32
|
+
// Add "last" class for last column
|
|
33
|
+
if ((i + 1) == options.columns) {
|
|
34
|
+
els.slice(start, end).wrapAll('<div class="'+options.classname+' last" />');
|
|
35
|
+
} else {
|
|
36
|
+
els.slice(start, end).wrapAll('<div class="'+options.classname+'" />');
|
|
37
|
+
}
|
|
38
|
+
start = start+elCol;
|
|
39
|
+
end = end+elCol;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
})(jQuery);
|
|
45
|
+
})(External = FintaChart.External || (FintaChart.External = {}));
|
|
46
|
+
})(FintaChart || (FintaChart = {}));
|
|
47
|
+
|
|
48
|
+
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var FintaChart;
|
|
4
|
+
(function (FintaChart) {
|
|
5
|
+
var External;
|
|
6
|
+
(function (External) {
|
|
7
|
+
|
|
8
|
+
(function ($) {
|
|
9
|
+
$.fn.resizable = function(options) {
|
|
10
|
+
|
|
11
|
+
var settings = $.extend({
|
|
12
|
+
container: null,
|
|
13
|
+
direction: ['top', 'right', 'bottom', 'left'],
|
|
14
|
+
minWidth: 20,
|
|
15
|
+
minHeight: 20
|
|
16
|
+
}, options);
|
|
17
|
+
|
|
18
|
+
return this.each(function() {
|
|
19
|
+
|
|
20
|
+
var _this = this;
|
|
21
|
+
var element = $(this);
|
|
22
|
+
|
|
23
|
+
var isDragging = false;
|
|
24
|
+
var initial = {};
|
|
25
|
+
var prepareHandles = {
|
|
26
|
+
top: false,
|
|
27
|
+
right: false,
|
|
28
|
+
bottom: false,
|
|
29
|
+
left: false
|
|
30
|
+
};
|
|
31
|
+
var handles = {};
|
|
32
|
+
|
|
33
|
+
element.addClass('tcdResizable');
|
|
34
|
+
|
|
35
|
+
if(settings.direction instanceof Array)
|
|
36
|
+
{
|
|
37
|
+
for (var i = settings.direction.length - 1; i >= 0; i--) {
|
|
38
|
+
switch(settings.direction[i])
|
|
39
|
+
{
|
|
40
|
+
case 'top':
|
|
41
|
+
case 't':
|
|
42
|
+
prepareHandles.top = true;
|
|
43
|
+
break;
|
|
44
|
+
case 'right':
|
|
45
|
+
case 'r':
|
|
46
|
+
prepareHandles.right = true;
|
|
47
|
+
break;
|
|
48
|
+
case 'bottom':
|
|
49
|
+
case 'b':
|
|
50
|
+
prepareHandles.bottom = true;
|
|
51
|
+
break;
|
|
52
|
+
case 'left':
|
|
53
|
+
case 'l':
|
|
54
|
+
prepareHandles.left = true;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else if(typeof settings.direction == 'string')
|
|
60
|
+
{
|
|
61
|
+
switch(settings.direction)
|
|
62
|
+
{
|
|
63
|
+
case 'vertical':
|
|
64
|
+
case 'v':
|
|
65
|
+
prepareHandles.top = true;
|
|
66
|
+
prepareHandles.bottom = true;
|
|
67
|
+
break;
|
|
68
|
+
case 'horizontal':
|
|
69
|
+
case 'h':
|
|
70
|
+
prepareHandles.right = true;
|
|
71
|
+
prepareHandles.left = true;
|
|
72
|
+
break;
|
|
73
|
+
case 'top':
|
|
74
|
+
case 't':
|
|
75
|
+
prepareHandles.top = true;
|
|
76
|
+
break;
|
|
77
|
+
case 'right':
|
|
78
|
+
case 'r':
|
|
79
|
+
prepareHandles.right = true;
|
|
80
|
+
break;
|
|
81
|
+
case 'bottom':
|
|
82
|
+
case 'b':
|
|
83
|
+
prepareHandles.bottom = true;
|
|
84
|
+
break;
|
|
85
|
+
case 'left':
|
|
86
|
+
case 'l':
|
|
87
|
+
prepareHandles.left = true;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if(prepareHandles.top)
|
|
93
|
+
{
|
|
94
|
+
handles.top = $('<div />').addClass('tcdResizable-handle tcdResizable-t').appendTo(element);
|
|
95
|
+
}
|
|
96
|
+
if(prepareHandles.right)
|
|
97
|
+
{
|
|
98
|
+
handles.right = $('<div />').addClass('tcdResizable-handle tcdResizable-r').appendTo(element);
|
|
99
|
+
}
|
|
100
|
+
if(prepareHandles.bottom)
|
|
101
|
+
{
|
|
102
|
+
handles.bottom = $('<div />').addClass('tcdResizable-handle tcdResizable-b').appendTo(element);
|
|
103
|
+
}
|
|
104
|
+
if(prepareHandles.left)
|
|
105
|
+
{
|
|
106
|
+
handles.left = $('<div />').addClass('tcdResizable-handle tcdResizable-l').appendTo(element);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
$(this).children('.tcdResizable-l, .tcdResizable-r, .tcdResizable-t, .tcdResizable-b').mousedown(function(e) {
|
|
110
|
+
var dir;
|
|
111
|
+
|
|
112
|
+
switch(true)
|
|
113
|
+
{
|
|
114
|
+
case $(this).hasClass('tcdResizable-l'):
|
|
115
|
+
dir = 'l';
|
|
116
|
+
break;
|
|
117
|
+
case $(this).hasClass('tcdResizable-r'):
|
|
118
|
+
dir = 'r';
|
|
119
|
+
break;
|
|
120
|
+
case $(this).hasClass('tcdResizable-t'):
|
|
121
|
+
dir = 't';
|
|
122
|
+
break;
|
|
123
|
+
case $(this).hasClass('tcdResizable-b'):
|
|
124
|
+
dir = 'b';
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
isDragging = true;
|
|
128
|
+
initial = {
|
|
129
|
+
x: e.clientX,
|
|
130
|
+
y: e.clientY,
|
|
131
|
+
height: element.height(),
|
|
132
|
+
width: element.width(),
|
|
133
|
+
direction: dir,
|
|
134
|
+
left: element.position().left
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
$('html').addClass('tcdResizable-resizing tcdResizable-resizing-'+initial.direction);
|
|
138
|
+
|
|
139
|
+
if (typeof options.start === 'function') {
|
|
140
|
+
options.start.apply(_this);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
if (settings.container == null) {
|
|
145
|
+
settings.container = $(window);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
element.css({
|
|
149
|
+
minWidth: settings.minWidth,
|
|
150
|
+
minHeight: settings.minHeight,
|
|
151
|
+
maxHeight: settings.container.height(),
|
|
152
|
+
maxWidth: settings.container.width()
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
$(document)
|
|
156
|
+
.mousemove(function(e) {
|
|
157
|
+
resize(e);
|
|
158
|
+
})
|
|
159
|
+
.mouseup(function(e) {
|
|
160
|
+
stop();
|
|
161
|
+
})
|
|
162
|
+
.mouseleave(function(e) {
|
|
163
|
+
resize(e);
|
|
164
|
+
stop();
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
function resize(e) {
|
|
168
|
+
if(isDragging)
|
|
169
|
+
{
|
|
170
|
+
var moveX = e.clientX-initial.x;
|
|
171
|
+
var moveY = e.clientY-initial.y;
|
|
172
|
+
var container = {
|
|
173
|
+
width: settings.container.width(),
|
|
174
|
+
left: settings.container.position().left
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
switch(initial.direction)
|
|
178
|
+
{
|
|
179
|
+
case 'r':
|
|
180
|
+
// Prevent of go out of container
|
|
181
|
+
if (initial.left + initial.width + moveX > settings.container.width()) {
|
|
182
|
+
moveX = settings.container.width() - (initial.left + initial.width)
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
element.width(initial.width + moveX);
|
|
186
|
+
break;
|
|
187
|
+
case 'l':
|
|
188
|
+
// Prevent of go out of container
|
|
189
|
+
if (initial.left + moveX < 0) {
|
|
190
|
+
moveX = -initial.left;
|
|
191
|
+
} else if (initial.width - moveX >= settings.minWidth) {
|
|
192
|
+
element.width(initial.width - moveX);
|
|
193
|
+
element.css('left', initial.left + moveX);
|
|
194
|
+
}
|
|
195
|
+
break;
|
|
196
|
+
case 'b':
|
|
197
|
+
element.height(initial.height + moveY);
|
|
198
|
+
break;
|
|
199
|
+
case 't':
|
|
200
|
+
element.height(initial.height - moveY);
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (typeof options.resize === 'function') {
|
|
205
|
+
options.resize.apply(_this);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function stop() {
|
|
211
|
+
if(isDragging)
|
|
212
|
+
{
|
|
213
|
+
isDragging = false;
|
|
214
|
+
$('html').removeClass('tcdResizable-resizing tcdResizable-resizing-'+initial.direction);
|
|
215
|
+
|
|
216
|
+
if (typeof options.stop === 'function') {
|
|
217
|
+
options.stop.apply(_this);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}(jQuery));
|
|
224
|
+
|
|
225
|
+
})(External = FintaChart.External || (FintaChart.External = {}));
|
|
226
|
+
})(FintaChart || (FintaChart = {}));
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|