@oxiaom/adoremix-win32-x64 1.0.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/index.js +24 -0
- package/native/.adoremix-native.json +1 -0
- package/native/AdoreMixV8X.exe +0 -0
- package/native/Qt5Core.dll +0 -0
- package/native/Qt5Network.dll +0 -0
- package/native/Qt5Sql.dll +0 -0
- package/native/Qt5WebSockets.dll +0 -0
- package/native/audio/qtaudio_windows.dll +0 -0
- package/native/bearer/qgenericbearer.dll +0 -0
- package/native/bearer/qnativewifibearer.dll +0 -0
- package/native/etc/Demo1.ini +49 -0
- package/native/etc/docroot/bangzhu/.project +22 -0
- package/native/etc/docroot/bangzhu/css/app.css +21 -0
- package/native/etc/docroot/bangzhu/css/feedback.css +131 -0
- package/native/etc/docroot/bangzhu/css/icons-extra.css +63 -0
- package/native/etc/docroot/bangzhu/css/mui.dtpicker.css +136 -0
- package/native/etc/docroot/bangzhu/css/mui.imageviewer.css +123 -0
- package/native/etc/docroot/bangzhu/css/mui.indexedlist.css +112 -0
- package/native/etc/docroot/bangzhu/css/mui.listpicker.css +95 -0
- package/native/etc/docroot/bangzhu/css/mui.min.css +5 -0
- package/native/etc/docroot/bangzhu/css/mui.picker.all.css +285 -0
- package/native/etc/docroot/bangzhu/css/mui.picker.css +85 -0
- package/native/etc/docroot/bangzhu/css/mui.picker.min.css +7 -0
- package/native/etc/docroot/bangzhu/css/mui.poppicker.css +64 -0
- package/native/etc/docroot/bangzhu/examples/accordion.html +125 -0
- package/native/etc/docroot/bangzhu/examples/actionsheet-plus.html +128 -0
- package/native/etc/docroot/bangzhu/examples/actionsheet.html +153 -0
- package/native/etc/docroot/bangzhu/examples/ad.html +47 -0
- package/native/etc/docroot/bangzhu/examples/ajax.html +155 -0
- package/native/etc/docroot/bangzhu/examples/badges.html +54 -0
- package/native/etc/docroot/bangzhu/examples/beecloud.html +150 -0
- package/native/etc/docroot/bangzhu/examples/best-practices/list-to-detail/detail.html +104 -0
- package/native/etc/docroot/bangzhu/examples/best-practices/list-to-detail/list-to-detail.css +160 -0
- package/native/etc/docroot/bangzhu/examples/best-practices/list-to-detail/listview.html +326 -0
- package/native/etc/docroot/bangzhu/examples/best-practices/list-to-detail/vue.min.js +8 -0
- package/native/etc/docroot/bangzhu/examples/buttons-with-badges.html +48 -0
- package/native/etc/docroot/bangzhu/examples/buttons-with-block.html +50 -0
- package/native/etc/docroot/bangzhu/examples/buttons-with-icons.html +68 -0
- package/native/etc/docroot/bangzhu/examples/buttons-with-loading.html +86 -0
- package/native/etc/docroot/bangzhu/examples/buttons.html +89 -0
- package/native/etc/docroot/bangzhu/examples/card.html +97 -0
- package/native/etc/docroot/bangzhu/examples/checkbox.html +68 -0
- package/native/etc/docroot/bangzhu/examples/clouddb_wilddog.html +268 -0
- package/native/etc/docroot/bangzhu/examples/date.html +88 -0
- package/native/etc/docroot/bangzhu/examples/dialog.html +82 -0
- package/native/etc/docroot/bangzhu/examples/dtpicker.html +129 -0
- package/native/etc/docroot/bangzhu/examples/echarts.html +150 -0
- package/native/etc/docroot/bangzhu/examples/feedback.html +72 -0
- package/native/etc/docroot/bangzhu/examples/grid-default.html +61 -0
- package/native/etc/docroot/bangzhu/examples/grid-pagination.html +266 -0
- package/native/etc/docroot/bangzhu/examples/guide.html +269 -0
- package/native/etc/docroot/bangzhu/examples/icons-extra.html +161 -0
- package/native/etc/docroot/bangzhu/examples/icons.html +182 -0
- package/native/etc/docroot/bangzhu/examples/im-chat.html +711 -0
- package/native/etc/docroot/bangzhu/examples/imageviewer-native.html +90 -0
- package/native/etc/docroot/bangzhu/examples/imageviewer.html +197 -0
- package/native/etc/docroot/bangzhu/examples/indexed-list-select.html +459 -0
- package/native/etc/docroot/bangzhu/examples/indexed-list.html +265 -0
- package/native/etc/docroot/bangzhu/examples/info.html +119 -0
- package/native/etc/docroot/bangzhu/examples/input.html +108 -0
- package/native/etc/docroot/bangzhu/examples/lazyload-image.html +73 -0
- package/native/etc/docroot/bangzhu/examples/list-triplex-row.html +115 -0
- package/native/etc/docroot/bangzhu/examples/list-with-input.html +91 -0
- package/native/etc/docroot/bangzhu/examples/locker-dom.html +85 -0
- package/native/etc/docroot/bangzhu/examples/login.html +83 -0
- package/native/etc/docroot/bangzhu/examples/media-list.html +220 -0
- package/native/etc/docroot/bangzhu/examples/message-bottom.html +87 -0
- package/native/etc/docroot/bangzhu/examples/modals.html +45 -0
- package/native/etc/docroot/bangzhu/examples/nav-nativeObj.html +45 -0
- package/native/etc/docroot/bangzhu/examples/nav.html +135 -0
- package/native/etc/docroot/bangzhu/examples/nav_transparent.html +127 -0
- package/native/etc/docroot/bangzhu/examples/nav_transparent_native.html +121 -0
- package/native/etc/docroot/bangzhu/examples/numbox.html +114 -0
- package/native/etc/docroot/bangzhu/examples/offcanvas-drag-down.html +384 -0
- package/native/etc/docroot/bangzhu/examples/offcanvas-drag-left-plus-main.html +293 -0
- package/native/etc/docroot/bangzhu/examples/offcanvas-drag-left-plus-menu.html +102 -0
- package/native/etc/docroot/bangzhu/examples/offcanvas-drag-left.html +228 -0
- package/native/etc/docroot/bangzhu/examples/offcanvas-drag-right-plus-main.html +292 -0
- package/native/etc/docroot/bangzhu/examples/offcanvas-drag-right-plus-menu.html +111 -0
- package/native/etc/docroot/bangzhu/examples/offcanvas-drag-right.html +220 -0
- package/native/etc/docroot/bangzhu/examples/pagination.html +236 -0
- package/native/etc/docroot/bangzhu/examples/picker.html +159 -0
- package/native/etc/docroot/bangzhu/examples/popovers.html +200 -0
- package/native/etc/docroot/bangzhu/examples/progressbar.html +171 -0
- package/native/etc/docroot/bangzhu/examples/pullrefresh.html +86 -0
- package/native/etc/docroot/bangzhu/examples/pullrefresh_main.html +46 -0
- package/native/etc/docroot/bangzhu/examples/pullrefresh_sub.html +101 -0
- package/native/etc/docroot/bangzhu/examples/pullrefresh_with_tab.html +586 -0
- package/native/etc/docroot/bangzhu/examples/radio.html +93 -0
- package/native/etc/docroot/bangzhu/examples/range.html +89 -0
- package/native/etc/docroot/bangzhu/examples/setting.html +910 -0
- package/native/etc/docroot/bangzhu/examples/slider-default.html +98 -0
- package/native/etc/docroot/bangzhu/examples/slider-native.html +43 -0
- package/native/etc/docroot/bangzhu/examples/slider-table-default.html +62 -0
- package/native/etc/docroot/bangzhu/examples/slider-table-pagination.html +74 -0
- package/native/etc/docroot/bangzhu/examples/slider-with-title.html +99 -0
- package/native/etc/docroot/bangzhu/examples/switches.html +92 -0
- package/native/etc/docroot/bangzhu/examples/tab-top-subpage-1.html +131 -0
- package/native/etc/docroot/bangzhu/examples/tab-top-subpage-2.html +131 -0
- package/native/etc/docroot/bangzhu/examples/tab-top-subpage-3.html +56 -0
- package/native/etc/docroot/bangzhu/examples/tab-top-subpage-4.html +110 -0
- package/native/etc/docroot/bangzhu/examples/tab-top-subpage-5.html +131 -0
- package/native/etc/docroot/bangzhu/examples/tab-top-webview-main.html +183 -0
- package/native/etc/docroot/bangzhu/examples/tab-vertical-scroll.html +170 -0
- package/native/etc/docroot/bangzhu/examples/tab-webview-main.html +112 -0
- package/native/etc/docroot/bangzhu/examples/tab-webview-subpage-about.html +38 -0
- package/native/etc/docroot/bangzhu/examples/tab-webview-subpage-chat.html +127 -0
- package/native/etc/docroot/bangzhu/examples/tab-webview-subpage-contact.html +155 -0
- package/native/etc/docroot/bangzhu/examples/tab-webview-subpage-setting.html +79 -0
- package/native/etc/docroot/bangzhu/examples/tab-with-segmented-control-vertical.html +85 -0
- package/native/etc/docroot/bangzhu/examples/tab-with-segmented-control.html +195 -0
- package/native/etc/docroot/bangzhu/examples/tab-with-viewpagerindicator.html +203 -0
- package/native/etc/docroot/bangzhu/examples/tabbar-labels-only.html +44 -0
- package/native/etc/docroot/bangzhu/examples/tabbar-with-submenus.html +75 -0
- package/native/etc/docroot/bangzhu/examples/tabbar.html +247 -0
- package/native/etc/docroot/bangzhu/examples/tableviews-with-badges.html +78 -0
- package/native/etc/docroot/bangzhu/examples/tableviews-with-collapses.html +83 -0
- package/native/etc/docroot/bangzhu/examples/tableviews-with-swipe.html +184 -0
- package/native/etc/docroot/bangzhu/examples/tableviews.html +87 -0
- package/native/etc/docroot/bangzhu/examples/typography.html +41 -0
- package/native/etc/docroot/bangzhu/fonts/mui-icons-extra.ttf +0 -0
- package/native/etc/docroot/bangzhu/fonts/mui.ttf +0 -0
- package/native/etc/docroot/bangzhu/images/60x60.gif +0 -0
- package/native/etc/docroot/bangzhu/images/cbd.jpg +0 -0
- package/native/etc/docroot/bangzhu/images/login-1.png +0 -0
- package/native/etc/docroot/bangzhu/images/logo.png +0 -0
- package/native/etc/docroot/bangzhu/images/muwu.jpg +0 -0
- package/native/etc/docroot/bangzhu/images/qrcode.png +0 -0
- package/native/etc/docroot/bangzhu/images/shuijiao.jpg +0 -0
- package/native/etc/docroot/bangzhu/images/yuantiao.jpg +0 -0
- package/native/etc/docroot/bangzhu/index-menu.html +196 -0
- package/native/etc/docroot/bangzhu/index.html +414 -0
- package/native/etc/docroot/bangzhu/js/95516.js +32 -0
- package/native/etc/docroot/bangzhu/js/arttmpl.js +2 -0
- package/native/etc/docroot/bangzhu/js/beecloud.js +141 -0
- package/native/etc/docroot/bangzhu/js/city.data-3.js +11548 -0
- package/native/etc/docroot/bangzhu/js/city.data.js +1605 -0
- package/native/etc/docroot/bangzhu/js/feedback.js +234 -0
- package/native/etc/docroot/bangzhu/js/mui.dtpicker.js +471 -0
- package/native/etc/docroot/bangzhu/js/mui.imageViewer.js +268 -0
- package/native/etc/docroot/bangzhu/js/mui.indexedlist.js +187 -0
- package/native/etc/docroot/bangzhu/js/mui.js +8390 -0
- package/native/etc/docroot/bangzhu/js/mui.lazyload.img.js +116 -0
- package/native/etc/docroot/bangzhu/js/mui.lazyload.js +327 -0
- package/native/etc/docroot/bangzhu/js/mui.listpicker.js +399 -0
- package/native/etc/docroot/bangzhu/js/mui.locker.js +303 -0
- package/native/etc/docroot/bangzhu/js/mui.min.js +6 -0
- package/native/etc/docroot/bangzhu/js/mui.picker.all.js +1018 -0
- package/native/etc/docroot/bangzhu/js/mui.picker.js +389 -0
- package/native/etc/docroot/bangzhu/js/mui.picker.min.js +7 -0
- package/native/etc/docroot/bangzhu/js/mui.poppicker.js +160 -0
- package/native/etc/docroot/bangzhu/js/mui.previewimage.js +382 -0
- package/native/etc/docroot/bangzhu/js/mui.pullToRefresh.js +407 -0
- package/native/etc/docroot/bangzhu/js/mui.pullToRefresh.material.js +352 -0
- package/native/etc/docroot/bangzhu/js/mui.view.js +628 -0
- package/native/etc/docroot/bangzhu/js/mui.zoom.js +322 -0
- package/native/etc/docroot/bangzhu/js/update.js +45 -0
- package/native/etc/docroot/bangzhu/js/webviewGroup.js +286 -0
- package/native/etc/docroot/bangzhu/libs/echarts-all.js +35 -0
- package/native/etc/docroot/bangzhu/manifest.json +994 -0
- package/native/etc/docroot/index.html +1 -0
- package/native/etc/docroot/luyin2/index.html +145 -0
- package/native/etc/docroot/luyin2/js/jquery-1.10.1.min.js +6 -0
- package/native/etc/docroot/luyin2/js/jquery-1.5.min.js +16 -0
- package/native/etc/docroot/luyin2/js/jquery.js +18 -0
- package/native/etc/docroot/luyin2/js/jquery.multiselect.js +104 -0
- package/native/etc/docroot/luyin2/js/lame.min.js +308 -0
- package/native/etc/docroot/luyin2/js/recordmp3.js +239 -0
- package/native/etc/docroot/luyin2/js/worker-realtime.js +106 -0
- package/native/etc/docroot/luyin2//346/223/215/344/275/234/346/214/207/345/215/227.txt +3 -0
- package/native/etc/docroot/static/css/app.8421a6d597ba48619941ccd4e386fbb2.css +675 -0
- package/native/etc/docroot/static/css/app.8421a6d597ba48619941ccd4e386fbb2.css.map +1 -0
- package/native/etc/docroot/static/fonts/element-icons.535877f.woff +0 -0
- package/native/etc/docroot/static/fonts/element-icons.732389d.ttf +0 -0
- package/native/etc/docroot/static/img/login_bg.ad6b482.jpg +0 -0
- package/native/etc/docroot/static/js/app.eff1c2200a448936b027.js +2 -0
- package/native/etc/docroot/static/js/app.eff1c2200a448936b027.js.map +1 -0
- package/native/etc/docroot/static/js/manifest.400eada2d24447a4fc30.js +2 -0
- package/native/etc/docroot/static/js/manifest.400eada2d24447a4fc30.js.map +1 -0
- package/native/etc/docroot/static/js/vendor.ca4f735ec1dfe336a804.js +45 -0
- package/native/etc/docroot/static/js/vendor.ca4f735ec1dfe336a804.js.map +1 -0
- package/native/etc/docroot/tts.js +151 -0
- package/native/etc/docroot/xcx/Discover.html +156 -0
- package/native/etc/docroot/xcx/css/mui.css +5649 -0
- package/native/etc/docroot/xcx/css/mui.min.css +5 -0
- package/native/etc/docroot/xcx/devicelist.html +659 -0
- package/native/etc/docroot/xcx/fonts/mui.ttf +0 -0
- package/native/etc/docroot/xcx/index.html +75 -0
- package/native/etc/docroot/xcx/index.js +1 -0
- package/native/etc/docroot/xcx/js/axios.min.js +3 -0
- package/native/etc/docroot/xcx/js/axios.min.map +1 -0
- package/native/etc/docroot/xcx/js/js.cookie.js +8 -0
- package/native/etc/docroot/xcx/js/mui.js +8390 -0
- package/native/etc/docroot/xcx/js/mui.min.js +6 -0
- package/native/etc/docroot/xcx/main.html +85 -0
- package/native/etc/ssl/README.txt +5 -0
- package/native/etc/ssl/ca.crt +21 -0
- package/native/etc/ssl/ca.key +27 -0
- package/native/etc/ssl/client.crt +20 -0
- package/native/etc/ssl/client.key +28 -0
- package/native/etc/ssl/client.p12 +0 -0
- package/native/etc/ssl/server.crt +20 -0
- package/native/etc/ssl/server.key +28 -0
- package/native/etc/templates/demo-de.tpl +12 -0
- package/native/etc/templates/demo.tpl +12 -0
- package/native/etc/ttys/adore03.sql +426 -0
- package/native/etc/ttys/adore04.sql +426 -0
- package/native/etc/ttys/adore1.sql +859 -0
- package/native/etc/ttys/adore_mix22.sql +806 -0
- package/native/etc/ttys/sqlite.sql +1140 -0
- package/native/etc/ttys/sqlite3main.sql +434 -0
- package/native/etc/ttys/sqltest.sql +279 -0
- package/native/etc/ttys/tp3sql.sql +1412 -0
- package/native/find.js +529 -0
- package/native/findsc.js +701 -0
- package/native/iconengines/qsvgicon.dll +0 -0
- package/native/imageformats/qgif.dll +0 -0
- package/native/imageformats/qicns.dll +0 -0
- package/native/imageformats/qico.dll +0 -0
- package/native/imageformats/qjpeg.dll +0 -0
- package/native/imageformats/qsvg.dll +0 -0
- package/native/imageformats/qtga.dll +0 -0
- package/native/imageformats/qtiff.dll +0 -0
- package/native/imageformats/qwbmp.dll +0 -0
- package/native/imageformats/qwebp.dll +0 -0
- package/native/libgcc_s_sjlj-1.dll +0 -0
- package/native/libstdc++-6.dll +0 -0
- package/native/libwinpthread-1.dll +0 -0
- package/native/mediaservice/dsengine.dll +0 -0
- package/native/mediaservice/qtmedia_audioengine.dll +0 -0
- package/native/platforms/qdirect2d.dll +0 -0
- package/native/platforms/qminimal.dll +0 -0
- package/native/platforms/qoffscreen.dll +0 -0
- package/native/platforms/qwebgl.dll +0 -0
- package/native/platforms/qwindows.dll +0 -0
- package/native/qt.conf +2 -0
- package/native/sqldrivers/qsqlite.dll +0 -0
- package/native/sqldrivers/qsqlmysql.dll +0 -0
- package/native/sqldrivers/qsqlodbc.dll +0 -0
- package/native/sqldrivers/qsqlpsql.dll +0 -0
- package/native/sqldrivers/sqlitecipher.dll +0 -0
- package/native/tts.js +151 -0
- package/package.json +23 -0
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
(function($) {
|
|
2
|
+
var CLASS_PULL_TOP_TIPS = $.className('pull-top-tips');
|
|
3
|
+
|
|
4
|
+
$.PullToRefresh = $.PullToRefresh.extend({
|
|
5
|
+
init: function(element, options) {
|
|
6
|
+
this._super(element, options);
|
|
7
|
+
this.options = $.extend(true, {
|
|
8
|
+
down: {
|
|
9
|
+
tips: {
|
|
10
|
+
colors: ['008000', 'd8ad44', 'd00324', 'dc00b8', '017efc'],
|
|
11
|
+
size: 200, //width=height=size;x=y=size/2;radius=size/4
|
|
12
|
+
lineWidth: 15,
|
|
13
|
+
duration: 1000,
|
|
14
|
+
tail_duration: 1000 * 2.5
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}, this.options);
|
|
18
|
+
this.options.down.tips.color = this.options.down.tips.colors[0];
|
|
19
|
+
this.options.down.tips.colors = this.options.down.tips.colors.map(function(color) {
|
|
20
|
+
return {
|
|
21
|
+
r: parseInt(color.substring(0, 2), 16),
|
|
22
|
+
g: parseInt(color.substring(2, 4), 16),
|
|
23
|
+
b: parseInt(color.substring(4, 6), 16)
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
initPullDownTips: function() {
|
|
28
|
+
var self = this;
|
|
29
|
+
if ($.isFunction(self.options.down.callback)) {
|
|
30
|
+
self.pullDownTips = (function() {
|
|
31
|
+
var element = document.querySelector('.' + CLASS_PULL_TOP_TIPS);
|
|
32
|
+
if (element) {
|
|
33
|
+
element.parentNode.removeChild(element);
|
|
34
|
+
}
|
|
35
|
+
if (!element) {
|
|
36
|
+
element = document.createElement('div');
|
|
37
|
+
element.classList.add(CLASS_PULL_TOP_TIPS);
|
|
38
|
+
element.innerHTML = '<div class="mui-pull-top-wrapper"><div class="mui-pull-top-canvas"><canvas id="pullDownTips" width="' + self.options.down.tips.size + '" height="' + self.options.down.tips.size + '"></canvas></div></div>';
|
|
39
|
+
element.addEventListener('webkitTransitionEnd', self);
|
|
40
|
+
document.body.appendChild(element);
|
|
41
|
+
}
|
|
42
|
+
self.pullDownCanvas = document.getElementById("pullDownTips");
|
|
43
|
+
self.pullDownCanvasCtx = self.pullDownCanvas.getContext('2d');
|
|
44
|
+
self.canvasUtils.init(self.pullDownCanvas, self.options.down.tips);
|
|
45
|
+
return element;
|
|
46
|
+
}());
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
removePullDownTips: function() {
|
|
50
|
+
this._super();
|
|
51
|
+
this.canvasUtils.stopSpin();
|
|
52
|
+
},
|
|
53
|
+
pulling: function(deltaY) {
|
|
54
|
+
var ratio = Math.min(deltaY / (this.options.down.height * 1.5), 1);
|
|
55
|
+
var ratioPI = Math.min(1, ratio * 2);
|
|
56
|
+
this.pullDownTips.style.webkitTransform = 'translate3d(0,' + (deltaY < 0 ? 0 : deltaY) + 'px,0)';
|
|
57
|
+
this.pullDownCanvas.style.opacity = ratioPI;
|
|
58
|
+
this.pullDownCanvas.style.webkitTransform = 'rotate(' + 300 * ratio + 'deg)';
|
|
59
|
+
var canvas = this.pullDownCanvas;
|
|
60
|
+
var ctx = this.pullDownCanvasCtx;
|
|
61
|
+
var size = this.options.down.tips.size;
|
|
62
|
+
ctx.lineWidth = this.options.down.tips.lineWidth;
|
|
63
|
+
ctx.fillStyle = '#' + this.options.down.tips.color;
|
|
64
|
+
ctx.strokeStyle = '#' + this.options.down.tips.color;
|
|
65
|
+
ctx.stroke();
|
|
66
|
+
ctx.clearRect(0, 0, size, size);
|
|
67
|
+
//fixed android 4.1.x
|
|
68
|
+
canvas.style.display = 'none'; // Detach from DOM
|
|
69
|
+
canvas.offsetHeight; // Force the detach
|
|
70
|
+
canvas.style.display = 'inherit'; // Reattach to DOM
|
|
71
|
+
this.canvasUtils.drawArcedArrow(ctx, size / 2 + 0.5, size / 2, size / 4, 0 * Math.PI, 5 / 3 * Math.PI * ratioPI, false, 1, 2, 0.7853981633974483, 25, this.options.down.tips.lineWidth, this.options.down.tips.lineWidth);
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
beforeChangeOffset: function(deltaY) {},
|
|
75
|
+
afterChangeOffset: function(deltaY) {},
|
|
76
|
+
dragEndAfterChangeOffset: function(isNeedRefresh) {
|
|
77
|
+
if (isNeedRefresh) {
|
|
78
|
+
this.canvasUtils.startSpin();
|
|
79
|
+
this.pullDownLoading();
|
|
80
|
+
} else {
|
|
81
|
+
this.canvasUtils.stopSpin();
|
|
82
|
+
this.endPullDownToRefresh();
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
canvasUtils: (function() {
|
|
86
|
+
var canvasObj = null,
|
|
87
|
+
ctx = null,
|
|
88
|
+
size = 200,
|
|
89
|
+
lineWidth = 15,
|
|
90
|
+
tick = 0,
|
|
91
|
+
startTime = 0,
|
|
92
|
+
frameTime = 0,
|
|
93
|
+
timeLast = 0,
|
|
94
|
+
oldStep = 0,
|
|
95
|
+
acc = 0,
|
|
96
|
+
head = 0,
|
|
97
|
+
tail = 180,
|
|
98
|
+
rad = Math.PI / 180,
|
|
99
|
+
duration = 1000,
|
|
100
|
+
tail_duration = 1000 * 2.5,
|
|
101
|
+
colors = ['35ad0e', 'd8ad44', 'd00324', 'dc00b8', '017efc'],
|
|
102
|
+
rAF = null;
|
|
103
|
+
|
|
104
|
+
function easeLinear(currentIteration, startValue, changeInValue, totalIterations) {
|
|
105
|
+
return changeInValue * currentIteration / totalIterations + startValue;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function easeInOutQuad(currentIteration, startValue, changeInValue, totalIterations) {
|
|
109
|
+
if ((currentIteration /= totalIterations / 2) < 1) {
|
|
110
|
+
return changeInValue / 2 * currentIteration * currentIteration + startValue;
|
|
111
|
+
}
|
|
112
|
+
return -changeInValue / 2 * ((--currentIteration) * (currentIteration - 2) - 1) + startValue;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function minmax(value, v0, v1) {
|
|
116
|
+
var min = Math.min(v0, v1);
|
|
117
|
+
var max = Math.max(v0, v1);
|
|
118
|
+
if (value < min)
|
|
119
|
+
return min;
|
|
120
|
+
if (value > max)
|
|
121
|
+
return min;
|
|
122
|
+
return value;
|
|
123
|
+
}
|
|
124
|
+
var drawHead = function(ctx, x0, y0, x1, y1, x2, y2, style) {
|
|
125
|
+
'use strict';
|
|
126
|
+
if (typeof(x0) == 'string') x0 = parseInt(x0);
|
|
127
|
+
if (typeof(y0) == 'string') y0 = parseInt(y0);
|
|
128
|
+
if (typeof(x1) == 'string') x1 = parseInt(x1);
|
|
129
|
+
if (typeof(y1) == 'string') y1 = parseInt(y1);
|
|
130
|
+
if (typeof(x2) == 'string') x2 = parseInt(x2);
|
|
131
|
+
if (typeof(y2) == 'string') y2 = parseInt(y2);
|
|
132
|
+
var radius = 3;
|
|
133
|
+
var twoPI = 2 * Math.PI;
|
|
134
|
+
ctx.save();
|
|
135
|
+
ctx.beginPath();
|
|
136
|
+
ctx.moveTo(x0, y0);
|
|
137
|
+
ctx.lineTo(x1, y1);
|
|
138
|
+
ctx.lineTo(x2, y2);
|
|
139
|
+
switch (style) {
|
|
140
|
+
case 0:
|
|
141
|
+
var backdist = Math.sqrt(((x2 - x0) * (x2 - x0)) + ((y2 - y0) * (y2 - y0)));
|
|
142
|
+
ctx.arcTo(x1, y1, x0, y0, .55 * backdist);
|
|
143
|
+
ctx.fill();
|
|
144
|
+
break;
|
|
145
|
+
case 1:
|
|
146
|
+
ctx.beginPath();
|
|
147
|
+
ctx.moveTo(x0, y0);
|
|
148
|
+
ctx.lineTo(x1, y1);
|
|
149
|
+
ctx.lineTo(x2, y2);
|
|
150
|
+
ctx.lineTo(x0, y0);
|
|
151
|
+
ctx.fill();
|
|
152
|
+
break;
|
|
153
|
+
case 2:
|
|
154
|
+
ctx.stroke();
|
|
155
|
+
break;
|
|
156
|
+
case 3:
|
|
157
|
+
var cpx = (x0 + x1 + x2) / 3;
|
|
158
|
+
var cpy = (y0 + y1 + y2) / 3;
|
|
159
|
+
ctx.quadraticCurveTo(cpx, cpy, x0, y0);
|
|
160
|
+
ctx.fill();
|
|
161
|
+
break;
|
|
162
|
+
case 4:
|
|
163
|
+
var cp1x, cp1y, cp2x, cp2y, backdist;
|
|
164
|
+
var shiftamt = 5;
|
|
165
|
+
if (x2 == x0) {
|
|
166
|
+
backdist = y2 - y0;
|
|
167
|
+
cp1x = (x1 + x0) / 2;
|
|
168
|
+
cp2x = (x1 + x0) / 2;
|
|
169
|
+
cp1y = y1 + backdist / shiftamt;
|
|
170
|
+
cp2y = y1 - backdist / shiftamt;
|
|
171
|
+
} else {
|
|
172
|
+
backdist = Math.sqrt(((x2 - x0) * (x2 - x0)) + ((y2 - y0) * (y2 - y0)));
|
|
173
|
+
var xback = (x0 + x2) / 2;
|
|
174
|
+
var yback = (y0 + y2) / 2;
|
|
175
|
+
var xmid = (xback + x1) / 2;
|
|
176
|
+
var ymid = (yback + y1) / 2;
|
|
177
|
+
var m = (y2 - y0) / (x2 - x0);
|
|
178
|
+
var dx = (backdist / (2 * Math.sqrt(m * m + 1))) / shiftamt;
|
|
179
|
+
var dy = m * dx;
|
|
180
|
+
cp1x = xmid - dx;
|
|
181
|
+
cp1y = ymid - dy;
|
|
182
|
+
cp2x = xmid + dx;
|
|
183
|
+
cp2y = ymid + dy;
|
|
184
|
+
}
|
|
185
|
+
ctx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x0, y0);
|
|
186
|
+
ctx.fill();
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
ctx.restore();
|
|
190
|
+
};
|
|
191
|
+
var drawArcedArrow = function(ctx, x, y, r, startangle, endangle, anticlockwise, style, which, angle, d, lineWidth, lineRatio) {
|
|
192
|
+
'use strict';
|
|
193
|
+
style = typeof(style) != 'undefined' ? style : 3;
|
|
194
|
+
which = typeof(which) != 'undefined' ? which : 1;
|
|
195
|
+
angle = typeof(angle) != 'undefined' ? angle : Math.PI / 8;
|
|
196
|
+
lineWidth = lineWidth || 1;
|
|
197
|
+
lineRatio = lineRatio || 10;
|
|
198
|
+
d = typeof(d) != 'undefined' ? d : 10;
|
|
199
|
+
ctx.save();
|
|
200
|
+
ctx.lineWidth = lineWidth;
|
|
201
|
+
ctx.beginPath();
|
|
202
|
+
ctx.arc(x, y, r, startangle, endangle, anticlockwise);
|
|
203
|
+
ctx.stroke();
|
|
204
|
+
var sx, sy, lineangle, destx, desty;
|
|
205
|
+
if (which & 1) {
|
|
206
|
+
sx = Math.cos(startangle) * r + x;
|
|
207
|
+
sy = Math.sin(startangle) * r + y;
|
|
208
|
+
lineangle = Math.atan2(x - sx, sy - y);
|
|
209
|
+
if (anticlockwise) {
|
|
210
|
+
destx = sx + 10 * Math.cos(lineangle);
|
|
211
|
+
desty = sy + 10 * Math.sin(lineangle);
|
|
212
|
+
} else {
|
|
213
|
+
destx = sx - 10 * Math.cos(lineangle);
|
|
214
|
+
desty = sy - 10 * Math.sin(lineangle);
|
|
215
|
+
}
|
|
216
|
+
drawArrow(ctx, sx, sy, destx, desty, style, 2, angle, d);
|
|
217
|
+
}
|
|
218
|
+
if (which & 2) {
|
|
219
|
+
sx = Math.cos(endangle) * r + x;
|
|
220
|
+
sy = Math.sin(endangle) * r + y;
|
|
221
|
+
lineangle = Math.atan2(x - sx, sy - y);
|
|
222
|
+
if (anticlockwise) {
|
|
223
|
+
destx = sx - 10 * Math.cos(lineangle);
|
|
224
|
+
desty = sy - 10 * Math.sin(lineangle);
|
|
225
|
+
} else {
|
|
226
|
+
destx = sx + 10 * Math.cos(lineangle);
|
|
227
|
+
desty = sy + 10 * Math.sin(lineangle);
|
|
228
|
+
}
|
|
229
|
+
drawArrow(ctx, sx - lineRatio * Math.sin(endangle), sy + lineRatio * Math.cos(endangle), destx - lineRatio * Math.sin(endangle), desty + lineRatio * Math.cos(endangle), style, 2, angle, d)
|
|
230
|
+
}
|
|
231
|
+
ctx.restore();
|
|
232
|
+
}
|
|
233
|
+
var drawArrow = function(ctx, x1, y1, x2, y2, style, which, angle, d) {
|
|
234
|
+
'use strict';
|
|
235
|
+
if (typeof(x1) == 'string') x1 = parseInt(x1);
|
|
236
|
+
if (typeof(y1) == 'string') y1 = parseInt(y1);
|
|
237
|
+
if (typeof(x2) == 'string') x2 = parseInt(x2);
|
|
238
|
+
if (typeof(y2) == 'string') y2 = parseInt(y2);
|
|
239
|
+
style = typeof(style) != 'undefined' ? style : 3;
|
|
240
|
+
which = typeof(which) != 'undefined' ? which : 1;
|
|
241
|
+
angle = typeof(angle) != 'undefined' ? angle : Math.PI / 8;
|
|
242
|
+
d = typeof(d) != 'undefined' ? d : 10;
|
|
243
|
+
var toDrawHead = typeof(style) != 'function' ? drawHead : style;
|
|
244
|
+
var dist = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
|
|
245
|
+
var ratio = (dist - d / 3) / dist;
|
|
246
|
+
var tox, toy, fromx, fromy;
|
|
247
|
+
if (which & 1) {
|
|
248
|
+
tox = Math.round(x1 + (x2 - x1) * ratio);
|
|
249
|
+
toy = Math.round(y1 + (y2 - y1) * ratio);
|
|
250
|
+
} else {
|
|
251
|
+
tox = x2;
|
|
252
|
+
toy = y2;
|
|
253
|
+
}
|
|
254
|
+
if (which & 2) {
|
|
255
|
+
fromx = x1 + (x2 - x1) * (1 - ratio);
|
|
256
|
+
fromy = y1 + (y2 - y1) * (1 - ratio);
|
|
257
|
+
} else {
|
|
258
|
+
fromx = x1;
|
|
259
|
+
fromy = y1;
|
|
260
|
+
}
|
|
261
|
+
ctx.beginPath();
|
|
262
|
+
ctx.moveTo(fromx, fromy);
|
|
263
|
+
ctx.lineTo(tox, toy);
|
|
264
|
+
ctx.stroke();
|
|
265
|
+
var lineangle = Math.atan2(y2 - y1, x2 - x1);
|
|
266
|
+
var h = Math.abs(d / Math.cos(angle));
|
|
267
|
+
if (which & 1) {
|
|
268
|
+
var angle1 = lineangle + Math.PI + angle;
|
|
269
|
+
var topx = x2 + Math.cos(angle1) * h;
|
|
270
|
+
var topy = y2 + Math.sin(angle1) * h;
|
|
271
|
+
var angle2 = lineangle + Math.PI - angle;
|
|
272
|
+
var botx = x2 + Math.cos(angle2) * h;
|
|
273
|
+
var boty = y2 + Math.sin(angle2) * h;
|
|
274
|
+
toDrawHead(ctx, topx, topy, x2, y2, botx, boty, style);
|
|
275
|
+
}
|
|
276
|
+
if (which & 2) {
|
|
277
|
+
var angle1 = lineangle + angle;
|
|
278
|
+
var topx = x1 + Math.cos(angle1) * h;
|
|
279
|
+
var topy = y1 + Math.sin(angle1) * h;
|
|
280
|
+
var angle2 = lineangle - angle;
|
|
281
|
+
var botx = x1 + Math.cos(angle2) * h;
|
|
282
|
+
var boty = y1 + Math.sin(angle2) * h;
|
|
283
|
+
toDrawHead(ctx, topx, topy, x1, y1, botx, boty, style);
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
var spinColors = function(currentIteration, totalIterations) {
|
|
288
|
+
var step = currentIteration % totalIterations;
|
|
289
|
+
if (step < oldStep)
|
|
290
|
+
colors.push(colors.shift());
|
|
291
|
+
var c0 = colors[0],
|
|
292
|
+
c1 = colors[1],
|
|
293
|
+
r = minmax(easeLinear(step, c0.r, c1.r - c0.r, totalIterations), c0.r, c1.r),
|
|
294
|
+
g = minmax(easeLinear(step, c0.g, c1.g - c0.g, totalIterations), c0.g, c1.g),
|
|
295
|
+
b = minmax(easeLinear(step, c0.b, c1.b - c0.b, totalIterations), c0.b, c1.b);
|
|
296
|
+
|
|
297
|
+
oldStep = step;
|
|
298
|
+
return "rgb(" + parseInt(r) + "," + parseInt(g) + "," + parseInt(b) + ")";
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
var spin = function(t) {
|
|
302
|
+
var timeCurrent = t || (new Date).getTime();
|
|
303
|
+
if (!startTime) {
|
|
304
|
+
startTime = timeCurrent;
|
|
305
|
+
}
|
|
306
|
+
tick = timeCurrent - startTime;
|
|
307
|
+
acc = easeInOutQuad((tick + tail_duration / 2) % tail_duration, 0, duration, tail_duration);
|
|
308
|
+
head = easeLinear((tick + acc) % duration, 0, 360, duration);
|
|
309
|
+
tail = 20 + Math.abs(easeLinear((tick + tail_duration / 2) % tail_duration, -300, 600, tail_duration));
|
|
310
|
+
|
|
311
|
+
ctx.lineWidth = lineWidth;
|
|
312
|
+
ctx.lineCap = "round";
|
|
313
|
+
|
|
314
|
+
ctx.strokeStyle = spinColors(tick, duration);
|
|
315
|
+
ctx.clearRect(0, 0, size, size);
|
|
316
|
+
//fixed android 4.1.x
|
|
317
|
+
canvasObj.style.display = 'none'; // Detach from DOM
|
|
318
|
+
canvasObj.offsetHeight; // Force the detach
|
|
319
|
+
canvasObj.style.display = 'inherit'; // Reattach to DOM
|
|
320
|
+
ctx.beginPath();
|
|
321
|
+
ctx.arc(size / 2, size / 2, size / 4, parseInt(head - tail) % 360 * rad, parseInt(head) % 360 * rad, false);
|
|
322
|
+
ctx.stroke();
|
|
323
|
+
|
|
324
|
+
rAF = requestAnimationFrame(spin);
|
|
325
|
+
};
|
|
326
|
+
var startSpin = function() {
|
|
327
|
+
startTime = 0;
|
|
328
|
+
oldStep = 0;
|
|
329
|
+
rAF = requestAnimationFrame(spin);
|
|
330
|
+
};
|
|
331
|
+
var stopSpin = function() {
|
|
332
|
+
rAF && cancelAnimationFrame(rAF);
|
|
333
|
+
}
|
|
334
|
+
var init = function(canvas, options) {
|
|
335
|
+
canvasObj = canvas;
|
|
336
|
+
ctx = canvasObj.getContext('2d');
|
|
337
|
+
var options = $.extend(true, {}, options);
|
|
338
|
+
colors = options.colors;
|
|
339
|
+
duration = options.duration;
|
|
340
|
+
tail_duration = options.tail_duration;
|
|
341
|
+
size = options.size;
|
|
342
|
+
lineWidth = options.lineWidth;
|
|
343
|
+
};
|
|
344
|
+
return {
|
|
345
|
+
init: init,
|
|
346
|
+
drawArcedArrow: drawArcedArrow,
|
|
347
|
+
startSpin: startSpin,
|
|
348
|
+
stopSpin: stopSpin
|
|
349
|
+
};
|
|
350
|
+
})()
|
|
351
|
+
});
|
|
352
|
+
})(mui);
|