rapid-router 7.5.13__py2.py3-none-any.whl → 7.5.15__py2.py3-none-any.whl
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.
- game/__init__.py +1 -1
- game/templates/game/scoreboard.html +0 -4
- {rapid_router-7.5.13.dist-info → rapid_router-7.5.15.dist-info}/METADATA +32 -9
- {rapid_router-7.5.13.dist-info → rapid_router-7.5.15.dist-info}/RECORD +7 -9
- game/static/game/js/pqselect.min.js +0 -9
- game/static/game/js/widget-scroller.js +0 -906
- {rapid_router-7.5.13.dist-info → rapid_router-7.5.15.dist-info}/WHEEL +0 -0
- {rapid_router-7.5.13.dist-info → rapid_router-7.5.15.dist-info}/licenses/LICENSE.md +0 -0
- {rapid_router-7.5.13.dist-info → rapid_router-7.5.15.dist-info}/top_level.txt +0 -0
game/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "7.5.
|
|
1
|
+
__version__ = "7.5.15"
|
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
{{block.super}}
|
|
17
17
|
<script src="{% static 'game/js/jquery.dataTables.min.js' %}"></script>
|
|
18
18
|
<script src="{% static 'game/js/dataTables.fixedColumns.js' %}"></script>
|
|
19
|
-
<script src="{% static 'game/js/widget-scroller.js' %}"></script>
|
|
20
|
-
<script src="{% static 'game/js/pqselect.min.js' %}"></script>
|
|
21
19
|
<script src="{% static 'game/js/jquery.outerhtml.js' %}"></script>
|
|
22
20
|
<script src="{% static 'game/js/scoreboard.js' %}"></script>
|
|
23
21
|
{% if language == "blockly" %}
|
|
@@ -29,8 +27,6 @@
|
|
|
29
27
|
{{block.super}}
|
|
30
28
|
<link href="https://code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css">
|
|
31
29
|
<link href="{% static 'game/css/scoreboard.css' %}" rel="stylesheet" type="text/css">
|
|
32
|
-
<link href="{% static 'game/css/pqselect.min.css' %}" rel="stylesheet" type="text/css">
|
|
33
|
-
<link href="{% static 'game/css/pqselect.multiselect.css' %}" rel="stylesheet" type="text/css">
|
|
34
30
|
<link href="{% static 'game/css/jquery.dataTables.css' %}" rel="stylesheet" type="text/css">
|
|
35
31
|
<link href="{% static 'game/css/dataTables.fixedColumns.css' %}" rel="stylesheet" type="text/css">
|
|
36
32
|
<link href="{% static 'game/css/dataTables.jqueryui.css' %}" rel="stylesheet" type="text/css">
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rapid-router
|
|
3
|
-
Version: 7.5.
|
|
3
|
+
Version: 7.5.15
|
|
4
4
|
Classifier: Programming Language :: Python
|
|
5
5
|
Classifier: Programming Language :: Python :: 3.12
|
|
6
6
|
Classifier: Framework :: Django
|
|
7
7
|
License-File: LICENSE.md
|
|
8
8
|
Requires-Dist: asgiref==3.8.1; python_version >= "3.8"
|
|
9
9
|
Requires-Dist: asttokens==3.0.0; python_version >= "3.8"
|
|
10
|
-
Requires-Dist: certifi==2025.
|
|
11
|
-
Requires-Dist: cfl-common==8.7.
|
|
10
|
+
Requires-Dist: certifi==2025.6.15; python_version >= "3.7"
|
|
11
|
+
Requires-Dist: cfl-common==8.7.7
|
|
12
12
|
Requires-Dist: charset-normalizer==3.4.2; python_version >= "3.7"
|
|
13
13
|
Requires-Dist: decorator==5.2.1; python_version >= "3.8"
|
|
14
14
|
Requires-Dist: diff-match-patch==20241021; python_version >= "3.7"
|
|
@@ -55,19 +55,27 @@ Requires-Dist: tablib==3.7.0; python_version >= "3.9"
|
|
|
55
55
|
Requires-Dist: traitlets==5.14.3; python_version >= "3.8"
|
|
56
56
|
Requires-Dist: typing-extensions==4.14.0; python_version >= "3.9"
|
|
57
57
|
Requires-Dist: tzdata==2025.2; python_version >= "2"
|
|
58
|
-
Requires-Dist: urllib3==2.
|
|
58
|
+
Requires-Dist: urllib3==2.5.0; python_version >= "3.9"
|
|
59
59
|
Requires-Dist: wcwidth==0.2.13
|
|
60
60
|
Requires-Dist: wheel==0.45.1; python_version >= "3.8"
|
|
61
61
|
Provides-Extra: dev
|
|
62
|
+
Requires-Dist: amqp==5.3.1; python_version >= "3.6" and extra == "dev"
|
|
62
63
|
Requires-Dist: asgiref==3.8.1; python_version >= "3.8" and extra == "dev"
|
|
63
64
|
Requires-Dist: attrs==25.3.0; python_version >= "3.8" and extra == "dev"
|
|
65
|
+
Requires-Dist: billiard==4.2.1; python_version >= "3.7" and extra == "dev"
|
|
64
66
|
Requires-Dist: black==25.1.0; python_version >= "3.9" and extra == "dev"
|
|
65
|
-
Requires-Dist:
|
|
66
|
-
Requires-Dist:
|
|
67
|
+
Requires-Dist: boto3==1.36.14; python_version >= "3.8" and extra == "dev"
|
|
68
|
+
Requires-Dist: botocore==1.36.26; python_version >= "3.8" and extra == "dev"
|
|
69
|
+
Requires-Dist: celery[sqs]==5.4.0; python_version >= "3.8" and extra == "dev"
|
|
70
|
+
Requires-Dist: certifi==2025.6.15; python_version >= "3.7" and extra == "dev"
|
|
71
|
+
Requires-Dist: cfl-common==8.7.7; extra == "dev"
|
|
67
72
|
Requires-Dist: chardet==5.2.0; python_version >= "3.7" and extra == "dev"
|
|
68
73
|
Requires-Dist: charset-normalizer==3.4.2; python_version >= "3.7" and extra == "dev"
|
|
69
74
|
Requires-Dist: click==8.2.1; python_version >= "3.10" and extra == "dev"
|
|
70
|
-
Requires-Dist:
|
|
75
|
+
Requires-Dist: click-didyoumean==0.3.1; python_full_version >= "3.6.2" and extra == "dev"
|
|
76
|
+
Requires-Dist: click-plugins==1.1.1; extra == "dev"
|
|
77
|
+
Requires-Dist: click-repl==0.3.0; python_version >= "3.6" and extra == "dev"
|
|
78
|
+
Requires-Dist: codeforlife-portal==8.7.7; extra == "dev"
|
|
71
79
|
Requires-Dist: diff-match-patch==20241021; python_version >= "3.7" and extra == "dev"
|
|
72
80
|
Requires-Dist: django==5.1.10; python_version >= "3.10" and extra == "dev"
|
|
73
81
|
Requires-Dist: django-classy-tags==4.1.0; python_version >= "3.8" and extra == "dev"
|
|
@@ -88,13 +96,17 @@ Requires-Dist: django-treebeard==4.7.1; python_version >= "3.8" and extra == "de
|
|
|
88
96
|
Requires-Dist: django-two-factor-auth==1.17.0; python_version >= "3.8" and extra == "dev"
|
|
89
97
|
Requires-Dist: djangorestframework==3.16.0; python_version >= "3.9" and extra == "dev"
|
|
90
98
|
Requires-Dist: execnet==2.1.1; python_version >= "3.8" and extra == "dev"
|
|
99
|
+
Requires-Dist: gunicorn==23.0.0; python_version >= "3.7" and extra == "dev"
|
|
91
100
|
Requires-Dist: h11==0.16.0; python_version >= "3.8" and extra == "dev"
|
|
92
101
|
Requires-Dist: idna==3.10; python_version >= "3.6" and extra == "dev"
|
|
93
102
|
Requires-Dist: importlib-metadata==4.13.0; python_version >= "3.7" and extra == "dev"
|
|
94
103
|
Requires-Dist: iniconfig==2.1.0; python_version >= "3.8" and extra == "dev"
|
|
95
104
|
Requires-Dist: isort==6.0.1; python_full_version >= "3.9.0" and extra == "dev"
|
|
105
|
+
Requires-Dist: jmespath==1.0.1; python_version >= "3.7" and extra == "dev"
|
|
106
|
+
Requires-Dist: kombu[sqs]==5.5.4; python_version >= "3.8" and extra == "dev"
|
|
96
107
|
Requires-Dist: libsass==0.23.0; python_version >= "3.8" and extra == "dev"
|
|
97
108
|
Requires-Dist: more-itertools==8.7.0; python_version >= "3.5" and extra == "dev"
|
|
109
|
+
Requires-Dist: mypy-boto3-s3==1.36.9; python_version >= "3.8" and extra == "dev"
|
|
98
110
|
Requires-Dist: mypy-extensions==1.1.0; python_version >= "3.8" and extra == "dev"
|
|
99
111
|
Requires-Dist: numpy==2.3.0; python_version >= "3.11" and extra == "dev"
|
|
100
112
|
Requires-Dist: outcome==1.3.0.post0; python_version >= "3.7" and extra == "dev"
|
|
@@ -106,20 +118,26 @@ Requires-Dist: phonenumbers==8.12.12; extra == "dev"
|
|
|
106
118
|
Requires-Dist: pillow==11.2.1; python_version >= "3.9" and extra == "dev"
|
|
107
119
|
Requires-Dist: platformdirs==4.3.8; python_version >= "3.9" and extra == "dev"
|
|
108
120
|
Requires-Dist: pluggy==1.6.0; python_version >= "3.9" and extra == "dev"
|
|
121
|
+
Requires-Dist: prompt-toolkit==3.0.51; python_version >= "3.8" and extra == "dev"
|
|
122
|
+
Requires-Dist: psycopg2-binary==2.9.9; python_version >= "3.7" and extra == "dev"
|
|
123
|
+
Requires-Dist: pycurl==7.45.6; python_version >= "3.5" and extra == "dev"
|
|
109
124
|
Requires-Dist: pygments==2.19.1; python_version >= "3.8" and extra == "dev"
|
|
110
125
|
Requires-Dist: pyjwt==2.6.0; python_version >= "3.7" and extra == "dev"
|
|
111
126
|
Requires-Dist: pypng==0.20220715.0; extra == "dev"
|
|
112
127
|
Requires-Dist: pysocks==1.7.1; extra == "dev"
|
|
113
|
-
Requires-Dist: pytest==8.4.
|
|
128
|
+
Requires-Dist: pytest==8.4.1; python_version >= "3.9" and extra == "dev"
|
|
114
129
|
Requires-Dist: pytest-django==4.8.0; python_version >= "3.8" and extra == "dev"
|
|
115
130
|
Requires-Dist: pytest-order==1.3.0; python_version >= "3.7" and extra == "dev"
|
|
116
131
|
Requires-Dist: pytest-xdist==3.7.0; python_version >= "3.9" and extra == "dev"
|
|
117
132
|
Requires-Dist: python-dateutil==2.9.0.post0; (python_version >= "2.7" and python_version not in "3.0, 3.1, 3.2, 3.3") and extra == "dev"
|
|
133
|
+
Requires-Dist: python-dotenv==1.0.1; python_version >= "3.8" and extra == "dev"
|
|
118
134
|
Requires-Dist: pytz==2025.2; extra == "dev"
|
|
119
135
|
Requires-Dist: pyyaml==6.0.2; python_version >= "3.8" and extra == "dev"
|
|
120
136
|
Requires-Dist: qrcode==7.4.2; python_version >= "3.7" and extra == "dev"
|
|
121
137
|
Requires-Dist: reportlab==4.2.5; (python_version >= "3.7" and python_version < "4") and extra == "dev"
|
|
122
138
|
Requires-Dist: requests==2.32.4; python_version >= "3.8" and extra == "dev"
|
|
139
|
+
Requires-Dist: requests-toolbelt==1.0.0; (python_version >= "2.7" and python_version not in "3.0, 3.1, 3.2, 3.3") and extra == "dev"
|
|
140
|
+
Requires-Dist: s3transfer==0.11.3; python_version >= "3.8" and extra == "dev"
|
|
123
141
|
Requires-Dist: selenium==4.29.0; python_version >= "3.9" and extra == "dev"
|
|
124
142
|
Requires-Dist: setuptools==80.9.0; python_version >= "3.9" and extra == "dev"
|
|
125
143
|
Requires-Dist: six==1.17.0; (python_version >= "2.7" and python_version not in "3.0, 3.1, 3.2, 3.3") and extra == "dev"
|
|
@@ -131,9 +149,14 @@ Requires-Dist: trio==0.30.0; python_version >= "3.9" and extra == "dev"
|
|
|
131
149
|
Requires-Dist: trio-websocket==0.12.2; python_version >= "3.8" and extra == "dev"
|
|
132
150
|
Requires-Dist: typing-extensions==4.14.0; python_version >= "3.9" and extra == "dev"
|
|
133
151
|
Requires-Dist: tzdata==2025.2; python_version >= "2" and extra == "dev"
|
|
134
|
-
Requires-Dist: urllib3==2.
|
|
152
|
+
Requires-Dist: urllib3==2.5.0; python_version >= "3.9" and extra == "dev"
|
|
153
|
+
Requires-Dist: uvicorn==0.34.3; python_version >= "3.9" and extra == "dev"
|
|
154
|
+
Requires-Dist: uvicorn-worker==0.2.0; python_version >= "3.8" and extra == "dev"
|
|
155
|
+
Requires-Dist: vine==5.1.0; python_version >= "3.6" and extra == "dev"
|
|
156
|
+
Requires-Dist: wcwidth==0.2.13; extra == "dev"
|
|
135
157
|
Requires-Dist: websocket-client==1.8.0; python_version >= "3.8" and extra == "dev"
|
|
136
158
|
Requires-Dist: wheel==0.45.1; python_version >= "3.8" and extra == "dev"
|
|
159
|
+
Requires-Dist: whitenoise==6.9.0; python_version >= "3.9" and extra == "dev"
|
|
137
160
|
Requires-Dist: wsproto==1.2.0; python_full_version >= "3.7.0" and extra == "dev"
|
|
138
161
|
Requires-Dist: zipp==3.23.0; python_version >= "3.9" and extra == "dev"
|
|
139
162
|
Dynamic: classifier
|
|
@@ -3,7 +3,7 @@ example_project/rapid_router_test_settings.py,sha256=3PPkhCEztAn-WGLQ-Bf2hA5n1q_
|
|
|
3
3
|
example_project/settings.py,sha256=-Lsw_DJow_LaKaTE4DNfY69o3cclXUHNoWNybPBHIqY,4333
|
|
4
4
|
example_project/urls.py,sha256=XHug_cpNy21yOef3E1-wWT5VkTuxpl6ZXIlCj6jDjWA,422
|
|
5
5
|
example_project/wsgi.py,sha256=U1W6WzZxZaIdYZ5tks7w9fqp5WS5qvn2iThsVcskrWw,829
|
|
6
|
-
game/__init__.py,sha256=
|
|
6
|
+
game/__init__.py,sha256=nK1f_fnFMe4aU1sNEE48q0SO4flv_e6SIKqjUmB3PzU,23
|
|
7
7
|
game/admin.py,sha256=BLwwaqQYuqmMdwqnvhdan19iGxdcoBX4CXFk_ROG5-M,1431
|
|
8
8
|
game/app_settings.py,sha256=mlg-1AiP7AR5JNOHAXXLuCrYWaZMmSihvSYk9c2c8YY,857
|
|
9
9
|
game/cache.py,sha256=dtOiFl6Z4I2Q9-8Hz24ZI-5C0asXYSQhF2Be5q74N8g,2227
|
|
@@ -361,7 +361,6 @@ game/static/game/js/mobile-detect.min.js,sha256=ZEzLi37qSJcT0EcvwXLxxT7TkgU4XIsb
|
|
|
361
361
|
game/static/game/js/model.js,sha256=y88pf2JsTtYz6CMOj3CM8T_mJGpO0a-9gwwRvIThsfg,22839
|
|
362
362
|
game/static/game/js/node.js,sha256=k5Bm3GzK0qrEp4ixZasEqsrmxP6l6l719USglsxF3ek,3537
|
|
363
363
|
game/static/game/js/pathFinder.js,sha256=XV5XV-mhSWytIuRDKEId6AwhVVxKpH_YlR9idAy0JUo,11039
|
|
364
|
-
game/static/game/js/pqselect.min.js,sha256=LHgmQouzISIADz-qPkME3_WrbUctePBc6VFtPJqiQJY,12541
|
|
365
364
|
game/static/game/js/program.js,sha256=jZFzctW_vX8z0IJBTUQhNFXmrUvKZ_Ecp0Glxgli3WE,7022
|
|
366
365
|
game/static/game/js/pythonControl.js,sha256=QOmtfLCGejAd2sGTsn2Wd3_FNKT9e7ZX_pRx45DATLg,4901
|
|
367
366
|
game/static/game/js/raphael.js,sha256=eDv2E-X3gaJcvDQLojLney44xj04InPmPpWDkSo92qU,299673
|
|
@@ -376,7 +375,6 @@ game/static/game/js/templates.js,sha256=9rZkuOUM0D11jHavlx00H2BMW5EreJ4XwrHToxxu
|
|
|
376
375
|
game/static/game/js/trafficLight.js,sha256=jXiLbc8f46RRgh37dLaWEq3X8HkErAUkJbAt2NX35kQ,1787
|
|
377
376
|
game/static/game/js/utils.js,sha256=X0F-9-NYYWmUg5Bn3IAORop1VI5732WehX-kchM-agQ,1501
|
|
378
377
|
game/static/game/js/van.js,sha256=E8kLONgFRcSyD9qGXURZMD8rBQ0Q2WJWXIFLTDT6yng,1579
|
|
379
|
-
game/static/game/js/widget-scroller.js,sha256=nHO9hlICY_Nhrlg6J8_wyhRBnQQe4U5liH0wzGgwloM,40526
|
|
380
378
|
game/static/game/js/blockly/blockly_compressed.js,sha256=RKnLJ0N9tcvFly-ZU-xlTzVtMQMEdN4hp4bcneThefc,812383
|
|
381
379
|
game/static/game/js/blockly/blockly_uncompressed.js,sha256=wdzlKGN8c10i0rkB7goH2T5E4D3i_kEXMgqW5EYw8fc,504051
|
|
382
380
|
game/static/game/js/blockly/blocks_compressed.js,sha256=HJepQvypNgp-f2aLmEqAa0kXCxJ7b3EkYe1xpcW1Pu0,74936
|
|
@@ -768,7 +766,7 @@ game/templates/game/level_moderation.html,sha256=6JOutcJd9ZkkBppF4pKXdH5Q8dZpC2n
|
|
|
768
766
|
game/templates/game/level_selection.html,sha256=zDh59c8nE_T_tE3bvTwlxn96psYu0rROWdihMtcdNJI,11156
|
|
769
767
|
game/templates/game/logged_students.html,sha256=WBTwdNb5YGopLdog7-vNDc9WO5_u8pqi3ehG12g8VOM,1471
|
|
770
768
|
game/templates/game/python_den_level_selection.html,sha256=Tzqxk6qfxjS5NnwUEeVvQ36TAKS818tQPhFT8J5DhHs,21549
|
|
771
|
-
game/templates/game/scoreboard.html,sha256=
|
|
769
|
+
game/templates/game/scoreboard.html,sha256=zv0spcadzAm_AOgkxkl-LvprO1DX29ruplokLdFMqYE,15784
|
|
772
770
|
game/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
773
771
|
game/templatetags/game/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
774
772
|
game/templatetags/game/utils.py,sha256=quMDcxpoi998hHiOH6CtoxITgpVPo4iWeINFk5AHFPU,406
|
|
@@ -800,8 +798,8 @@ game/views/level_selection.py,sha256=UI345nDv5iTRQ7VttiLKLzezJlaSlaKOnhlALZgMU9Q
|
|
|
800
798
|
game/views/level_solutions.py,sha256=lfwLFvw4gFuptTkL2J_ibhnuiysl3Yao15sn2qoQlcE,97194
|
|
801
799
|
game/views/scoreboard.py,sha256=Lxy7XtoG7VwWpTb-c22BGC6eN8uCmmOnQ2qjY-oXA3k,16914
|
|
802
800
|
game/views/scoreboard_csv.py,sha256=yx4tOwx5QsHyU1S1BUPUqRBWIh5idq8QVtBID-NqZto,1768
|
|
803
|
-
rapid_router-7.5.
|
|
804
|
-
rapid_router-7.5.
|
|
805
|
-
rapid_router-7.5.
|
|
806
|
-
rapid_router-7.5.
|
|
807
|
-
rapid_router-7.5.
|
|
801
|
+
rapid_router-7.5.15.dist-info/licenses/LICENSE.md,sha256=9AbRlCDqD2D1tPibimysFv3zg3AIc49-eyv9aEsyq9w,115
|
|
802
|
+
rapid_router-7.5.15.dist-info/METADATA,sha256=Z1Zgr27Copw9He4Ys0Gxjrq_AguaBxYRzp1siCWotHw,10992
|
|
803
|
+
rapid_router-7.5.15.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
|
|
804
|
+
rapid_router-7.5.15.dist-info/top_level.txt,sha256=rKP4ryr1t8Wcnx8grJHDViM3T5cMYH_0vygDjC04ArA,21
|
|
805
|
+
rapid_router-7.5.15.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* ParamQuery Select v1.3.0
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2015 Paramvir Dhindsa (http://paramquery.com)
|
|
5
|
-
* Released under GNU General Public License v3
|
|
6
|
-
* http://paramquery.com/license
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
!function(a){"function"==typeof define&&define.amd?define(["jquery","jui/core","jui/widget","jui/position"],a):a(jQuery)}(function(a){"use strict";a.support.touch="ontouchend"in document;var b={};b.options=function(){var b=a.ui.keyCode;return{radio:!1,singlePlaceholder:"Select an option",checkbox:!1,displayText:"{0} of {1} selected",maxDisplay:4,maxSelect:0,multiplePlaceholder:"Select options",selectallText:"Select All",closeOnWindowScroll:!0,closeOnWindowResize:!0,itemCls:"pq-select-item ui-corner-all ui-state-default",bootstrap:{on:!1,btn:"btn btn-default",popupCont:"panel panel-default",selectCls:"label label-info",itemCls:"label label-default",closeIcon:"glyphicon glyphicon-remove",searchIcon:"glyphicon glyphicon-search",hoverCls:""},position:{my:"left top",at:"left bottom",collision:"flipfit"},kcOpen:[b.DOWN,b.ENTER,b.UP],deselect:!0,hoverCls:"pq-state-hover",search:!0,searchRule:"contain",_selectCls:"pq-state-select",selectCls:"ui-state-highlight",width:null,maxSelectReach:null,maxSelectExceed:null}}(),b._setButtonWidth=function(){var a=this.element;a.show();var b=this.options,c=b.width?b.width:a[0].offsetWidth;a.hide(),this.$button.width(c)},b._create=function(){var b=this,c=this.options,d=c.bootstrap,e=d.on,f=this.element,g=f.attr("name"),h=f.attr("multiple"),i=a(["<div class='pq-select-button pq-no-capture ui-widget ui-state-default ui-corner-all ",e?d.btn:"","' "," data-name='",g,"' tabindex='0'>",h?"":"<span class='ui-icon ui-icon-triangle-1-s"+(e?" caret":"")+"'></span>","<div class='pq-select-text'></div>","</div>"].join(""));e&&(c.selectCls+=" "+d.selectCls,c.itemCls+=" "+d.itemCls),this.$button=i,this.multiple=h?!0:!1,this.selector="label.pq-select-option-label.ui-state-enable:visible",this._setButtonWidth(),f.after(i),i.attr("name",g),i.addClass(f.attr("class")),f.addClass("pq-select"),this._extractData(),this._createPopup(),this._createMenu(),i.on({click:function(){if(!c.disabled){var d=a(this).parent(".pq-select-item"),e=parseInt(d.attr("data-id"));return b.select(e,!1),b.setText(),b.focus(),b.triggerChange(),!1}}},".ui-icon-close"),i.on({click:function(){return c.disabled?void 0:(b.toggle(),!1)},focus:function(){c.disabled||a(this).addClass("ui-state-hover")},blur:function(){a(this).removeClass("ui-state-hover")},mousedown:function(){c.disabled||a(this).addClass("ui-state-active")},mouseup:function(){c.disabled||a(this).removeClass("ui-state-active")},keydown:function(d){if(!c.disabled){var e=d.keyCode,f=c.kcOpen,g=a.ui.keyCode;-1!==a.inArray(e,f)?b.open():e===g.ESCAPE?b.close():e===g.SPACE&&b.toggle()}}}),this.setText();var j=this.eventNamespace;a(window).on("resize"+j,function(a){b.onWindowResize(a)}),a(window).on("scroll"+j,function(a){b.onWindowScroll(a)})},b.onWindowResize=function(){this.options.closeOnWindowResize&&this.close()},b.onWindowScroll=function(){this.options.closeOnWindowScroll&&this.close()},b.focus=function(){var b=this;a.support.touch||b.$search.focus()},a.paramquery=a.paramquery||{},a.paramquery.scrollView=function(b){var c=b[0],d=c.offsetTop,e=c.offsetHeight,f=c.offsetParent,g=f.scrollTop,h=f.clientHeight;e+d>h+g?a(f).scrollTop(e+d-h):g>d&&a(f).scrollTop(d)},a.paramquery.pageMove=function(b,c,d){var e,f=b[0].offsetHeight,g=b[0].offsetParent,h=g.clientHeight;do{if(e=b[d?"nextAll":"prevAll"](c),!e.length)break;e=a(e[0]),f+=e[0].offsetHeight,b=e}while(h>f);return a.paramquery.scrollView(b),b},b._move=function(b){var c=this.$lastlabelHighlight;if(c&&c.length){var d=c[b?"nextAll":"prevAll"](this.selector);d.length&&(d=a(d[0]),this._highlight(d))}else this._hightlight()},b._onkeydown=function(b){var c=b.keyCode,d=a.ui.keyCode;if(c===d.DOWN||c===d.UP)return this._move(c===d.DOWN),!1;if(c===d.PAGE_DOWN||c===d.PAGE_UP){var e=a.paramquery.pageMove(this.$lastlabelHighlight,this.selector,c===d.PAGE_DOWN);return this._highlight(e),!1}if(c===d.TAB)return this.close(),!1;if(c===d.ESCAPE)this.close();else if(c===d.ENTER&&this.$lastlabelHighlight)return this.$lastlabelHighlight.trigger("label_changed"),!1},b.search=function(a){for(var b=this.data,c=this.options.searchRule,d="contain"===c,e=0,f=b.length;f>e;e++){var g=b[e],h=g.text.toUpperCase(),i=h.indexOf(a);g.searchIndx=null,-1===i?g.hidden=!0:d===!1&&i>0?g.hidden=!0:(g.hidden=!1,g.searchIndx=i)}},b._onkeyupsearch=function(b){var c=a(b.target),d=a.trim(c.val()).toUpperCase(),e=(this.data,b.keyCode),f=a.ui.keyCode,g=[f.DOWN,f.UP,f.ENTER,f.PAGE_DOWN,f.PAGE_UP];-1===a.inArray(e,g)&&(this.search(d),this._createMenu(),this.positionPopup())},b._onChange=function(a,b){var c=this,d=c.options,e=this.multiple,f=d.maxSelect,g=c.selectIndx;if(e){if(b&&f&&g.length>=f)return c._trigger("maxSelectExceed",null,{option:c.$options[a]}),c.focus(),!1}else if(g.length){var h=g[0];if(a===h)return!1;b&&this.select(h,!1)}this.select(a,b),c.setText(),c.setSelectAllState(),e?f&&g.length>=f?c._trigger("maxSelectReach",null,{option:c.$options[a]})!==!1&&c.close():c.focus():c.close(),this.triggerChange()},b.setSelectAllState=function(){var a=this.$popup.find(".pq-select-all input");if(a.length){for(var b=this.data,c=0,d=0,e=0,f=b.length;f>e;e++){var g=b[e],h=g.selected,i=g.disabled;i||(c++,h&&d++)}c===d?a.prop("checked",!0):a.prop("checked",!1)}},b.getInstance=function(){return{select:this}},b.select=function(b,c){var d=this,e=d.selectIndx,f=this.options,g=this.data[b],h=a(d.$options[b]),i=d.$popup.find("#pq-option-"+this.uuid+"-"+b),j=i.find("input");if(i[c?"addClass":"removeClass"](f._selectCls+" "+f.selectCls),j.prop("checked",c),g.selected=c,d.multiple){if(c)e.push(b);else{var k=a.inArray(b,e);e.splice(k,1)}h.prop("selected",c)}else c?(e.length&&(this.data[e[0]].selected=!1),e[0]=b,h.prop("selected",c)):(d.selectIndx=[0],this.data[0].selected=!0,a(d.$options[0]).prop("selected",!0))},b.triggerChange=function(){this.element.trigger("change")},b._extractData=function(){var b,c=this.data=[],d=this.element,e=d.find("option,optgroup"),f=!1,g=!1;this.$options=d.find("option");for(var h=0,i=e.length;i>h;h++){var j=e[h],k=a(j);if("optgroup"!=j.nodeName.toLowerCase()){var l=k.prop("selected"),m=k.prop("disabled");!m&&f&&(m=g);var n=k.html();c.push({selected:l,disabled:m,text:n,optgroup:b})}else b=k.attr("label"),f=!0,g=k.prop("disabled")}this.grouping=f},b.refresh=function(){this.search(""),this._setButtonWidth(),this._createPopup(),this._createMenu(),this.setText()},b.refreshData=function(){this._extractData(),this.refresh()},b._createPopup=function(){var b=this,c=(this.data,this.options),d=c.bootstrap,e=d.on,f=b.multiple,g="",h="";f&&c.selectallText&&!c.maxSelect&&(h=["<label class='pq-select-all ui-widget-header ui-corner-all'>","<span class='ui-icon ui-icon-close ",e?d.closeIcon:"","'></span>","<input type='checkbox' >",c.selectallText,"</label>"].join("")),c.search&&(g=["<div class='pq-select-search-div ui-corner-all'>","<span class='ui-icon ui-icon-search ",e?d.searchIcon:"","' />","<div class='pq-select-search-div1'>","<input type='text' class='pq-select-search-input' autocomplete='off' />","</div>","</div>"].join(""));var i=a(["<div class='pq-select-popup-cont ",e?d.popupCont:"","'>","<div class='pq-select-popup ui-widget-content ui-corner-all'>",h,g,"</div><div class='pq-select-shadow-fix'></div></div>"].join(""));i.css({"font-family":this.$button.css("font-family"),"font-size":this.$button.css("font-size")});var j=i.children("div.pq-select-popup");j.on({keydown:function(a){return b._onkeydown(a)}}),j.find(".ui-icon-close").on({click:function(){return b.close(),!1}}),j.on({change:function(){for(var c=(b.element,a(this)),d=c.prop("checked")?!0:!1,e=b.data,f=b.$options,g=0;g<e.length;g++){var h=e[g];h.disabled||h.selected===d||(h.selected=d,a(f[g]).prop("selected",d))}b._createMenu(),b.setText(),b.focus(),b.triggerChange()}},"label.pq-select-all input"),j.on({mouseenter:function(){b._highlight(a(this))},label_changed:function(){var d=a(this),e=d.attr("id");if(e){var f=!d.hasClass(c._selectCls),g=parseInt(e.split("-")[3]);return b._onChange(g,f)}}},"label.pq-select-option-label.ui-state-enable"),f&&c.checkbox||!f&&c.radio?j.on({click:function(){var b=a(this).closest("label");b.trigger("label_changed")}},"label.pq-select-option-label.ui-state-enable input"):j.on({click:function(){a(this).trigger("label_changed")}},"label.pq-select-option-label.ui-state-enable"),this.$popupCont&&this.$popupCont.remove(),this.$popupCont=i,this.$popup=j,this.$search=j.find(".pq-select-search-input").on({keyup:function(a){return b._onkeyupsearch(a)}}),a(document.body).append(i),this.setSelectAllState()},b._createMenu=function(){for(var b,c,d,e,f=this,g=this.data,h=this.uuid,i=this.options,j=i.search?a.trim(this.$search.val()).length:0,k=" "+i._selectCls+" "+i.selectCls+" ",l=f.multiple,m=l?i.checkbox?'type="checkbox"':"":i.radio?'type="radio"':"",n=m?"pq-left-input":this.grouping?"pq-left-group":"",o=f.selectIndx=[],p=[],q=0;q<g.length;q++){var r=g[q],c=r.disabled,s=r.selected,t=r.text,u=r.optgroup;if(s&&o.push(q),!r.hidden){e!==u&&(p.push("<div class='pq-select-optgroup'>",u,"</div>"),e=u);var v=s?' checked="checked" ':"",w=s?k:"",x=c?' disabled="disabled" ':"",d=c?"ui-state-disabled":"ui-state-enable",y="";(0!==q||""!==t)&&(j&&(b=r.searchIndx,t=t.substr(0,b)+"<span class='pq-select-search-highlight'>"+t.substr(b,j)+"</span>"+t.substr(b+j,t.length)),p.push("<label class='pq-select-option-label ",w,d,"'",y," id='pq-option-",h,"-",q,"'>",m?"<input "+m+" "+v+x+" >":"","<span class='",n,"'>",t,"</span>","</label>"))}}var z=a(["<div class='pq-select-menu' >",p.join(""),"</div>"].join(""));this.$menu&&this.$menu.remove(),this.$popup.append(z),delete this.$lastlabelHighlight,this.$menu=z,this._highlight()},b._highlight=function(b){var c=this.options.hoverCls;b&&b.length||(b=this.$menu.find("label.pq-select-option-label.ui-state-enable:visible:first")),b.length&&(this.$lastlabelHighlight&&this.$lastlabelHighlight.removeClass(c),b.addClass(c),this.$lastlabelHighlight=b,a.paramquery.scrollView(b))},b._setPopupWidth=function(){var a=this.$button[0].offsetWidth;this.$popupCont.width(a)},b.positionPopup=function(){var b=this.options,c=this.$button,d=a.extend({of:c},b.position),e=this.$popupCont;this._setPopupWidth(),e.position(d)},b.isOpen=function(){return this.$popupCont&&"block"==this.$popupCont.css("display")?!0:!1},b.open=function(){{var b=this,c=this.$popupCont;this.$menu,this.selectIndx}return this.isOpen()?!1:(c.show(),this.positionPopup(),this._highlight(),a(document).on("mousedown"+b.eventNamespace,function(c){var d=a(c.target);d.closest(b.$popup).length||d.closest(b.$button).length||b.close()}),void(this.options.search?b.focus():c.attr("tabindex","-1").focus()))},b.setText=function(){var a,b=this.$button,c=b.find(".pq-select-text"),d=this.element,e=this.options,f=e.deselect,g=this.data,h=e.itemCls,i=e.bootstrap,j=i.on?i.closeIcon:"",k=function(a){return f?["<span class='",h,"' data-id = '",a,"'>","<span class='ui-icon ui-icon-close ",j,"'></span>","<span class='pq-select-item-text'>",g[a].text,"</span>","</span>"].join(""):g[a].text},l=this.selectIndx;if(this.multiple){b.addClass("pq-select-multiple");var m=l.length,n=e.maxDisplay,o=g.length;if(m>0)if(n>=m){for(var p=[],q=0;m>q;q++){var r=l[q];p.push(k(r))}a=p.join(f?"":", ")}else a=e.displayText,a=a.replace("{0}",l.length),a=a.replace("{1}",o);else a=d.attr("data-placeholder"),a||(a=e.multiplePlaceholder)}else{b.addClass("pq-select-single"),c.css("maxWidth",b.width()-16);var r=l[0],a=r>=0?g[r].text:"";null!=a&&""!==a?a=k(r):(a=d.attr("data-placeholder"),a||(a=e.singlePlaceholder))}c.html(a),this.multiple||c.find(".pq-select-item-text").css({maxWidth:b.width()-35}),this.positionPopup()},b.close=function(b){this.isOpen()&&(b=b||{},b.focus!==!1&&this.$button.focus(),this.$popupCont.hide()),a(document).off(this.eventNamespace)},b.toggle=function(){this.isOpen()?this.close():this.open()},b.disable=function(){this.option({disabled:!0})},b.enable=function(){this.option({disabled:!1})},b._destroy=function(){this.$popupCont.remove(),this.$button.remove(),this.element.removeClass("pq-select").show();var b=this.eventNamespace;a(document).off(b),a(window).off(b)},b.destroy=function(){this._super();for(var a in this)delete this[a]},b._setOption=function(a,b){"disabled"==a&&(b===!0?(this.close(),this.$button.addClass("ui-state-disabled")):b===!1&&this.$button.removeClass("ui-state-disabled")),this._super(a,b)},a.widget("paramquery.pqSelect",b)});
|
|
@@ -1,906 +0,0 @@
|
|
|
1
|
-
/*! Widget: scroller - updated 5/17/2015 (v2.22.0) *//*
|
|
2
|
-
Copyright (C) 2011 T. Connell & Associates, Inc.
|
|
3
|
-
|
|
4
|
-
Dual-licensed under the MIT and GPL licenses
|
|
5
|
-
|
|
6
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
7
|
-
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
8
|
-
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
9
|
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
10
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
11
|
-
|
|
12
|
-
Resizable scroller widget for the jQuery tablesorter plugin
|
|
13
|
-
|
|
14
|
-
Version 2.0 - modified by Rob Garrison 4/12/2013;
|
|
15
|
-
updated 3/5/2015 (v2.22.2) with lots of help from TheSin-
|
|
16
|
-
Requires jQuery v1.7+
|
|
17
|
-
Requires the tablesorter plugin, v2.8+, available at http://mottie.github.com/tablesorter/docs/
|
|
18
|
-
|
|
19
|
-
Usage:
|
|
20
|
-
$(function() {
|
|
21
|
-
$('table.tablesorter').tablesorter({
|
|
22
|
-
widgets: ['zebra', 'scroller'],
|
|
23
|
-
widgetOptions : {
|
|
24
|
-
scroller_height : 300, // height of scroll window
|
|
25
|
-
scroller_jumpToHeader : true, // header snap to browser top when scrolling the tbody
|
|
26
|
-
scroller_upAfterSort : true, // scroll tbody to top after sorting
|
|
27
|
-
scroller_fixedColumns : 0 // set number of fixed columns
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
Website: www.tconnell.com
|
|
33
|
-
*/
|
|
34
|
-
/*jshint browser:true, jquery:true, unused:false */
|
|
35
|
-
;( function( $, window ) {
|
|
36
|
-
'use strict';
|
|
37
|
-
|
|
38
|
-
var ts = $.tablesorter,
|
|
39
|
-
tscss = ts.css;
|
|
40
|
-
|
|
41
|
-
$.extend( ts.css, {
|
|
42
|
-
scrollerWrap : 'tablesorter-scroller',
|
|
43
|
-
scrollerHeader : 'tablesorter-scroller-header',
|
|
44
|
-
scrollerTable : 'tablesorter-scroller-table',
|
|
45
|
-
scrollerFooter : 'tablesorter-scroller-footer',
|
|
46
|
-
scrollerFixed : 'tablesorter-scroller-fixed',
|
|
47
|
-
scrollerFixedPanel : 'tablesorter-scroller-fixed-panel',
|
|
48
|
-
scrollerHasFix : 'tablesorter-scroller-has-fixed-columns',
|
|
49
|
-
scrollerHideColumn : 'tablesorter-scroller-hidden-column',
|
|
50
|
-
scrollerHideElement : 'tablesorter-scroller-hidden',
|
|
51
|
-
scrollerSpacerRow : 'tablesorter-scroller-spacer',
|
|
52
|
-
scrollerBarSpacer : 'tablesorter-scroller-bar-spacer',
|
|
53
|
-
scrollerAddedHeight : 'tablesorter-scroller-added-height',
|
|
54
|
-
scrollerHack : 'tablesorter-scroller-scrollbar-hack',
|
|
55
|
-
scrollerReset : 'tablesorter-scroller-reset',
|
|
56
|
-
// class name on table cannot start with 'tablesorter-' or the
|
|
57
|
-
// suffix "scroller-rtl" will match as a theme name
|
|
58
|
-
scrollerRtl : 'ts-scroller-rtl'
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
ts.addWidget({
|
|
62
|
-
id : 'scroller',
|
|
63
|
-
priority : 60, // run after the filter widget
|
|
64
|
-
options : {
|
|
65
|
-
scroller_height : 300,
|
|
66
|
-
// pop table header into view while scrolling up the page
|
|
67
|
-
scroller_jumpToHeader : true,
|
|
68
|
-
// scroll tbody to top after sorting
|
|
69
|
-
scroller_upAfterSort : true,
|
|
70
|
-
// set number of fixed columns
|
|
71
|
-
scroller_fixedColumns : 0,
|
|
72
|
-
// add hover highlighting to the fixed column (disable if it causes slowing)
|
|
73
|
-
scroller_rowHighlight : 'hover',
|
|
74
|
-
// add a fixed column overlay for styling
|
|
75
|
-
scroller_addFixedOverlay : false,
|
|
76
|
-
// In tablesorter v2.19.0 the scroll bar width is auto-detected
|
|
77
|
-
// add a value here to override the auto-detected setting
|
|
78
|
-
scroller_barWidth : null
|
|
79
|
-
},
|
|
80
|
-
format : function( table, c, wo ) {
|
|
81
|
-
if ( !c.isScrolling ) {
|
|
82
|
-
// initialize here instead of in widget init to give the
|
|
83
|
-
// filter widget time to finish building the filter row
|
|
84
|
-
ts.scroller.setup( c, wo );
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
remove : function( table, c, wo ) {
|
|
88
|
-
ts.scroller.remove( c, wo );
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
/* Add window resizeEnd event */
|
|
93
|
-
ts.window_resize = function() {
|
|
94
|
-
if ( ts.timer_resize ) {
|
|
95
|
-
clearTimeout( ts.timer_resize );
|
|
96
|
-
}
|
|
97
|
-
ts.timer_resize = setTimeout( function() {
|
|
98
|
-
$( window ).trigger( 'resizeEnd' );
|
|
99
|
-
}, 250 );
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
// Add extra scroller css
|
|
103
|
-
$( function() {
|
|
104
|
-
var style = '<style>' +
|
|
105
|
-
/* reset width to get accurate measurements after window resize */
|
|
106
|
-
'.' + tscss.scrollerReset + ' { width: auto !important; min-width: auto !important; max-width: auto !important; }' +
|
|
107
|
-
/* overall wrapper & table section wrappers */
|
|
108
|
-
'.' + tscss.scrollerWrap + ' { position: relative; overflow: hidden; }' +
|
|
109
|
-
/* add border-box sizing to all scroller widget tables; see #135 */
|
|
110
|
-
'.' + tscss.scrollerWrap + ' * { box-sizing: border-box; }' +
|
|
111
|
-
'.' + tscss.scrollerHeader + ', .' + tscss.scrollerFooter + ' { position: relative; overflow: hidden; }' +
|
|
112
|
-
'.' + tscss.scrollerHeader + ' table.' + tscss.table + ' { margin-bottom: 0; }' +
|
|
113
|
-
/* always leave the scroll bar visible for tbody, or table overflows into the scrollbar
|
|
114
|
-
when height < max height (filtering) */
|
|
115
|
-
'.' + tscss.scrollerTable + ' { position: relative; overflow: auto; }' +
|
|
116
|
-
'.' + tscss.scrollerTable + ' table.' + tscss.table +
|
|
117
|
-
' { border-top: 0; margin-top: 0; margin-bottom: 0; overflow: hidden; }' +
|
|
118
|
-
/* hide footer in original table */
|
|
119
|
-
'.' + tscss.scrollerTable + ' tfoot, .' + tscss.scrollerHideElement + ', .' + tscss.scrollerHideColumn +
|
|
120
|
-
' { display: none; }' +
|
|
121
|
-
|
|
122
|
-
/*** fixed column ***/
|
|
123
|
-
/* disable pointer-events on fixed column wrapper or the user can't interact with the horizontal scrollbar */
|
|
124
|
-
'.' + tscss.scrollerFixed + ', .' + tscss.scrollerFixed + ' .' + tscss.scrollerFixedPanel +
|
|
125
|
-
' { pointer-events: none; }' +
|
|
126
|
-
/* enable pointer-events for fixed column children; see #135 & #878 */
|
|
127
|
-
'.' + tscss.scrollerFixed + ' > div { pointer-events: all; }' +
|
|
128
|
-
'.' + tscss.scrollerWrap + ' .' + tscss.scrollerFixed + ' { position: absolute; top: 0; z-index: 1; left: 0 } ' +
|
|
129
|
-
'.' + tscss.scrollerWrap + ' .' + tscss.scrollerFixed + '.' + tscss.scrollerRtl + ' { left: auto; right: 0 } ' +
|
|
130
|
-
/* add horizontal scroll bar; set to "auto", see #135 */
|
|
131
|
-
'.' + tscss.scrollerWrap + '.' + tscss.scrollerHasFix + ' > .' + tscss.scrollerTable + ' { overflow: auto; }' +
|
|
132
|
-
/* need to position the tbody & tfoot absolutely to hide the scrollbar & move the footer
|
|
133
|
-
below the horizontal scrollbar */
|
|
134
|
-
'.' + tscss.scrollerFixed + ' .' + tscss.scrollerFooter + ' { position: absolute; bottom: 0; }' +
|
|
135
|
-
/* hide fixed tbody scrollbar - see http://goo.gl/VsLe6n */
|
|
136
|
-
'.' + tscss.scrollerFixed + ' .' + tscss.scrollerTable +
|
|
137
|
-
' { position: relative; left: 0; overflow: hidden; -ms-overflow-style: none; }' +
|
|
138
|
-
'.' + tscss.scrollerFixed + ' .' + tscss.scrollerTable + '::-webkit-scrollbar { display: none; }' +
|
|
139
|
-
/*** fixed column panel ***/
|
|
140
|
-
'.' + tscss.scrollerWrap + ' .' + tscss.scrollerFixedPanel +
|
|
141
|
-
' { position: absolute; top: 0; bottom: 0; z-index: 2; left: 0; right: 0; } ' +
|
|
142
|
-
'</style>';
|
|
143
|
-
$( style ).appendTo( 'body' );
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
ts.scroller = {
|
|
147
|
-
|
|
148
|
-
// Ugh.. Firefox misbehaves, so it needs to be detected
|
|
149
|
-
isFirefox : navigator.userAgent.toLowerCase().indexOf( 'firefox' ) > -1,
|
|
150
|
-
// old IE needs a wrap to hide the fixed column scrollbar; http://stackoverflow.com/a/24408672/145346
|
|
151
|
-
isOldIE : document.all && !window.atob,
|
|
152
|
-
// http://stackoverflow.com/questions/7944460/detect-safari-browser - needed to position scrolling body
|
|
153
|
-
// when the table is set up in RTL direction
|
|
154
|
-
isSafari : navigator.userAgent.toLowerCase().indexOf( 'safari' ) > -1 &&
|
|
155
|
-
navigator.userAgent.toLowerCase().indexOf( 'chrome' ) === -1,
|
|
156
|
-
|
|
157
|
-
hasScrollBar : function( $target, checkWidth ) {
|
|
158
|
-
if ( checkWidth ) {
|
|
159
|
-
return $target.get(0).scrollWidth > $target.width();
|
|
160
|
-
} else {
|
|
161
|
-
return $target.get(0).scrollHeight > $target.height();
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
setWidth : function( $el, width ) {
|
|
166
|
-
$el.css({
|
|
167
|
-
'width' : width,
|
|
168
|
-
'min-width' : width,
|
|
169
|
-
'max-width' : width
|
|
170
|
-
});
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
// modified from http://davidwalsh.name/detect-scrollbar-width
|
|
174
|
-
getBarWidth : function() {
|
|
175
|
-
var $div = $( '<div>' ).css({
|
|
176
|
-
'position' : 'absolute',
|
|
177
|
-
'top' : '-9999px',
|
|
178
|
-
'left' : 0,
|
|
179
|
-
'width' : '100px',
|
|
180
|
-
'height' : '100px',
|
|
181
|
-
'overflow' : 'scroll',
|
|
182
|
-
'visibility' : 'hidden'
|
|
183
|
-
}).appendTo( 'body' ),
|
|
184
|
-
div = $div[0],
|
|
185
|
-
barWidth = div.offsetWidth - div.clientWidth;
|
|
186
|
-
$div.remove();
|
|
187
|
-
return barWidth;
|
|
188
|
-
},
|
|
189
|
-
|
|
190
|
-
setup : function( c, wo ) {
|
|
191
|
-
var maxHt, tbHt, $hdr, $t, $hCells, $fCells, $tableWrap, tmp,
|
|
192
|
-
$win = $( window ),
|
|
193
|
-
namespace = c.namespace + 'tsscroller',
|
|
194
|
-
$foot = $(),
|
|
195
|
-
// c.namespace contains a unique tablesorter ID, per table
|
|
196
|
-
id = c.namespace.slice( 1 ) + 'tsscroller',
|
|
197
|
-
$table = c.$table;
|
|
198
|
-
|
|
199
|
-
// set scrollbar width & allow setting width to zero
|
|
200
|
-
wo.scroller_barSetWidth = wo.scroller_barWidth !== null ?
|
|
201
|
-
wo.scroller_barWidth :
|
|
202
|
-
( ts.scroller.getBarWidth() || 15 );
|
|
203
|
-
|
|
204
|
-
maxHt = wo.scroller_height || 300;
|
|
205
|
-
// sum all tbody heights
|
|
206
|
-
tbHt = 0;
|
|
207
|
-
$table.children( 'tbody' ).map( function() {
|
|
208
|
-
tbHt += $( this ).outerHeight();
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
$hdr = $( '<table class="' + $table.attr( 'class' ) + '" cellpadding=0 cellspacing=0>' +
|
|
212
|
-
$table.children( 'thead' )[ 0 ].outerHTML + '</table>' );
|
|
213
|
-
wo.scroller_$header = $hdr.addClass( c.namespace.slice( 1 ) + '_extra_table' );
|
|
214
|
-
|
|
215
|
-
$t = $table.children( 'tfoot' );
|
|
216
|
-
if ( $t.length ) {
|
|
217
|
-
$foot = $( '<table class="' + $table.attr( 'class' ) +
|
|
218
|
-
'" cellpadding=0 cellspacing=0 style="margin-top:0"></table>' )
|
|
219
|
-
.addClass( c.namespace.slice( 1 ) + '_extra_table' )
|
|
220
|
-
// maintain any bindings on the tfoot cells
|
|
221
|
-
.append( $t.clone( true ) )
|
|
222
|
-
.wrap( '<div class="' + tscss.scrollerFooter + '"/>' );
|
|
223
|
-
$fCells = $foot.children( 'tfoot' ).eq( 0 ).children( 'tr' ).children();
|
|
224
|
-
}
|
|
225
|
-
wo.scroller_$footer = $foot;
|
|
226
|
-
|
|
227
|
-
$table
|
|
228
|
-
.wrap( '<div id="' + id + '" class="' + tscss.scrollerWrap + '" />' )
|
|
229
|
-
.before( $hdr )
|
|
230
|
-
// shrink filter row but don't completely hide it because the inputs/selectors may distort the columns
|
|
231
|
-
.find( '.' + tscss.filterRow )
|
|
232
|
-
.addClass( tscss.filterRowHide );
|
|
233
|
-
|
|
234
|
-
wo.scroller_$container = $table.parent();
|
|
235
|
-
|
|
236
|
-
if ( $foot.length ) {
|
|
237
|
-
// $foot.parent() to include <div> wrapper
|
|
238
|
-
$table.after( $foot.parent() );
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
$hCells = $hdr
|
|
242
|
-
.wrap( '<div class="' + tscss.scrollerHeader + '" />' )
|
|
243
|
-
.find( '.' + tscss.header );
|
|
244
|
-
|
|
245
|
-
// use max-height, so the height resizes dynamically while filtering
|
|
246
|
-
$table.wrap( '<div class="' + tscss.scrollerTable + '" style="max-height:' + maxHt + 'px;" />' );
|
|
247
|
-
$tableWrap = $table.parent();
|
|
248
|
-
|
|
249
|
-
// make scroller header sortable
|
|
250
|
-
ts.bindEvents( c.table, $hCells );
|
|
251
|
-
|
|
252
|
-
// look for filter widget
|
|
253
|
-
if ( $table.hasClass( 'hasFilters' ) ) {
|
|
254
|
-
ts.filter.bindSearch( $table, $hdr.find( '.' + tscss.filter ) );
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
$table
|
|
258
|
-
.find( 'thead' )
|
|
259
|
-
.addClass( tscss.scrollerHideElement );
|
|
260
|
-
|
|
261
|
-
tbHt = $tableWrap.parent().height();
|
|
262
|
-
|
|
263
|
-
// The header will always jump into view if scrolling the table body
|
|
264
|
-
$tableWrap
|
|
265
|
-
.off( 'scroll' + namespace )
|
|
266
|
-
.on( 'scroll' + namespace, function() {
|
|
267
|
-
if ( wo.scroller_jumpToHeader ) {
|
|
268
|
-
var pos = $win.scrollTop() - $hdr.offset().top;
|
|
269
|
-
if ( $( this ).scrollTop() !== 0 && pos < tbHt && pos > 0 ) {
|
|
270
|
-
$win.scrollTop( $hdr.offset().top );
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
$hdr
|
|
274
|
-
.parent()
|
|
275
|
-
.add( $foot.parent() )
|
|
276
|
-
.scrollLeft( $( this ).scrollLeft() );
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
// Sorting, so scroll to top
|
|
280
|
-
tmp = 'sortEnd setFixedColumnSize updateComplete pagerComplete pagerInitialized columnUpdate '
|
|
281
|
-
.split( ' ' )
|
|
282
|
-
.join( namespace + ' ' );
|
|
283
|
-
$table
|
|
284
|
-
.off( tmp )
|
|
285
|
-
.on( 'sortEnd' + namespace, function() {
|
|
286
|
-
if ( wo.scroller_upAfterSort ) {
|
|
287
|
-
$table.parent().animate({
|
|
288
|
-
scrollTop : 0
|
|
289
|
-
}, 'fast' );
|
|
290
|
-
}
|
|
291
|
-
})
|
|
292
|
-
.on( 'setFixedColumnSize' + namespace, function( event, size ) {
|
|
293
|
-
var $wrap = wo.scroller_$container;
|
|
294
|
-
if ( typeof size !== 'undefined' && !isNaN( size ) ) {
|
|
295
|
-
wo.scroller_fixedColumns = parseInt( size, 10 );
|
|
296
|
-
}
|
|
297
|
-
// remove fixed columns
|
|
298
|
-
ts.scroller.removeFixed( c, wo );
|
|
299
|
-
size = wo.scroller_fixedColumns;
|
|
300
|
-
if ( size > 0 && size < c.columns - 1 ) {
|
|
301
|
-
ts.scroller.updateFixed( c, wo );
|
|
302
|
-
} else if ( $wrap.hasClass( tscss.scrollerHasFix ) ) {
|
|
303
|
-
$wrap.removeClass( tscss.scrollerHasFix );
|
|
304
|
-
// resize needed to make tables full width
|
|
305
|
-
ts.scroller.resize( c, wo );
|
|
306
|
-
}
|
|
307
|
-
})
|
|
308
|
-
.on( 'updateComplete pagerComplete pagerInitialized columnUpdate '
|
|
309
|
-
.split( ' ' ).join( namespace + ' ' ), function() {
|
|
310
|
-
// adjust column sizes after an update
|
|
311
|
-
ts.scroller.resize( c, wo );
|
|
312
|
-
});
|
|
313
|
-
|
|
314
|
-
// Setup window.resizeEnd event
|
|
315
|
-
$win
|
|
316
|
-
.off( 'resize resizeEnd '.split( ' ' ).join( namespace + ' ' ) )
|
|
317
|
-
.on( 'resize' + namespace, ts.window_resize )
|
|
318
|
-
.on( 'resizeEnd' + namespace, function() {
|
|
319
|
-
// IE calls resize when you modify content, so we have to unbind the resize event
|
|
320
|
-
// so we don't end up with an infinite loop. we can rebind after we're done.
|
|
321
|
-
$win.off( 'resize' + namespace, ts.window_resize );
|
|
322
|
-
ts.scroller.resize( c, wo );
|
|
323
|
-
$win.on( 'resize' + namespace, ts.window_resize );
|
|
324
|
-
$tableWrap.trigger( 'scroll' + namespace );
|
|
325
|
-
});
|
|
326
|
-
|
|
327
|
-
// initialization flag
|
|
328
|
-
c.isScrolling = true;
|
|
329
|
-
|
|
330
|
-
ts.scroller.updateFixed( c, wo );
|
|
331
|
-
|
|
332
|
-
},
|
|
333
|
-
|
|
334
|
-
resize : function( c, wo ) {
|
|
335
|
-
var index, borderWidth, setWidth, $hCells, $bCells, $fCells, $headers, $this, temp,
|
|
336
|
-
$table = c.$table,
|
|
337
|
-
$tableWrap = $table.parent(),
|
|
338
|
-
$hdr = wo.scroller_$header,
|
|
339
|
-
$foot = wo.scroller_$footer,
|
|
340
|
-
id = c.namespace.slice( 1 ) + 'tsscroller',
|
|
341
|
-
// Hide other scrollers so we can resize
|
|
342
|
-
$div = $( 'div.' + tscss.scrollerWrap + '[id!="' + id + '"]' )
|
|
343
|
-
.addClass( tscss.scrollerHideElement );
|
|
344
|
-
|
|
345
|
-
// Remove fixed so we get proper widths and heights
|
|
346
|
-
ts.scroller.removeFixed( c, wo );
|
|
347
|
-
|
|
348
|
-
// show original table thead to get proper alignments
|
|
349
|
-
$table.children( 'thead' ).removeClass( tscss.scrollerHideElement );
|
|
350
|
-
|
|
351
|
-
// Reset sizes so parent can resize.
|
|
352
|
-
$table
|
|
353
|
-
.addClass( tscss.scrollerReset )
|
|
354
|
-
.children( 'thead' )
|
|
355
|
-
.find( '.' + tscss.headerIn )
|
|
356
|
-
.addClass( tscss.scrollerReset )
|
|
357
|
-
.end()
|
|
358
|
-
.find( '.' + tscss.filterRow )
|
|
359
|
-
.removeClass( tscss.scrollerHideElement );
|
|
360
|
-
$tableWrap.addClass( tscss.scrollerReset );
|
|
361
|
-
|
|
362
|
-
// include left & right border widths
|
|
363
|
-
borderWidth = parseInt( $table.css( 'border-left-width' ), 10 );
|
|
364
|
-
|
|
365
|
-
$hCells = $hdr
|
|
366
|
-
.children( 'thead' )
|
|
367
|
-
.children( 'tr' )
|
|
368
|
-
.not( '.' + c.cssIgnoreRow )
|
|
369
|
-
.children( 'th, td' )
|
|
370
|
-
.filter( ':visible' );
|
|
371
|
-
$bCells = c.$tbodies
|
|
372
|
-
.eq( 0 )
|
|
373
|
-
.children( 'tr' )
|
|
374
|
-
.not( '.' + c.cssChildRow )
|
|
375
|
-
.eq( 0 )
|
|
376
|
-
.children( 'th, td' )
|
|
377
|
-
.filter( ':visible' );
|
|
378
|
-
$fCells = $foot
|
|
379
|
-
.children( 'tfoot' )
|
|
380
|
-
.children( 'tr' )
|
|
381
|
-
.children( 'th, td' )
|
|
382
|
-
.filter( ':visible' );
|
|
383
|
-
|
|
384
|
-
ts.scroller.setWidth( $hCells.add( $bCells ).add( $fCells ), '' );
|
|
385
|
-
$headers = $table
|
|
386
|
-
.children( 'thead' )
|
|
387
|
-
.children()
|
|
388
|
-
.eq( 0 )
|
|
389
|
-
.children( 'th, td' );
|
|
390
|
-
for ( index = 0; index < $headers.length; index++ ) {
|
|
391
|
-
$this = $headers.eq( index );
|
|
392
|
-
// code from https://github.com/jmosbech/StickyTableHeaders
|
|
393
|
-
if ( $this.css( 'box-sizing' ) === 'border-box' ) {
|
|
394
|
-
setWidth = $this.outerWidth();
|
|
395
|
-
} else {
|
|
396
|
-
if ( $hCells.eq( index ).css( 'border-collapse' ) === 'collapse' ) {
|
|
397
|
-
if ( $this.length && window.getComputedStyle ) {
|
|
398
|
-
setWidth = parseFloat( window.getComputedStyle( $this[ 0 ], null ).width );
|
|
399
|
-
} else {
|
|
400
|
-
// ie8 only
|
|
401
|
-
setWidth = $this.outerWidth() - parseFloat( $this.css( 'padding-left' ) ) -
|
|
402
|
-
parseFloat( $this.css( 'padding-right' ) ) -
|
|
403
|
-
( parseFloat( $this.css( 'border-width' ) ) || 0 );
|
|
404
|
-
}
|
|
405
|
-
} else {
|
|
406
|
-
setWidth = $this.width();
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
temp = $hCells.eq( index )
|
|
410
|
-
.add( $bCells.eq( index ) )
|
|
411
|
-
.add( $fCells.eq( index ) );
|
|
412
|
-
ts.scroller.setWidth( temp, setWidth );
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
temp = $tableWrap.parent().innerWidth() -
|
|
416
|
-
( ts.scroller.hasScrollBar( $tableWrap ) ? wo.scroller_barSetWidth : 0 );
|
|
417
|
-
$tableWrap.width( temp );
|
|
418
|
-
setWidth = $tableWrap.innerWidth() -
|
|
419
|
-
( ts.scroller.hasScrollBar( $tableWrap ) ? wo.scroller_barSetWidth : 0 ) + borderWidth;
|
|
420
|
-
|
|
421
|
-
$hdr
|
|
422
|
-
.parent()
|
|
423
|
-
.add( $foot.parent() )
|
|
424
|
-
.width( setWidth );
|
|
425
|
-
|
|
426
|
-
wo.scroller_$container
|
|
427
|
-
.find( '.' + tscss.scrollerReset )
|
|
428
|
-
.removeClass( tscss.scrollerReset );
|
|
429
|
-
|
|
430
|
-
// update fixed column sizes
|
|
431
|
-
ts.scroller.updateFixed( c, wo );
|
|
432
|
-
|
|
433
|
-
// hide original table thead
|
|
434
|
-
$table.children( 'thead' ).addClass( tscss.scrollerHideElement );
|
|
435
|
-
|
|
436
|
-
$div.removeClass( tscss.scrollerHideElement );
|
|
437
|
-
|
|
438
|
-
},
|
|
439
|
-
|
|
440
|
-
// Add fixed (frozen) columns (Do not call directly, use updateFixed)
|
|
441
|
-
setupFixed : function( c, wo ) {
|
|
442
|
-
var index, index2, $el, len, temp, $fixedColumn, $fixedTbody, $fixedContainer,
|
|
443
|
-
$table = c.$table,
|
|
444
|
-
$wrapper = wo.scroller_$container,
|
|
445
|
-
fixedColumns = wo.scroller_fixedColumns;
|
|
446
|
-
|
|
447
|
-
$fixedColumn = $wrapper
|
|
448
|
-
.addClass( tscss.scrollerHasFix )
|
|
449
|
-
.clone()
|
|
450
|
-
.addClass( tscss.scrollerFixed )
|
|
451
|
-
.removeClass( tscss.scrollerWrap )
|
|
452
|
-
.attr( 'id', '' );
|
|
453
|
-
|
|
454
|
-
if ( wo.scroller_addFixedOverlay ) {
|
|
455
|
-
$fixedColumn.append( '<div class="' + tscss.scrollerFixedPanel + '">' );
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
$fixedTbody = $fixedColumn.find( '.' + tscss.scrollerTable );
|
|
459
|
-
$fixedContainer = $fixedTbody.children( 'table' ).children( 'tbody' );
|
|
460
|
-
$fixedTbody
|
|
461
|
-
.children( 'table' )
|
|
462
|
-
.addClass( c.namespace.slice( 1 ) + '_extra_table' )
|
|
463
|
-
.attr( 'id', '' )
|
|
464
|
-
.children( 'thead, tfoot' )
|
|
465
|
-
.remove();
|
|
466
|
-
|
|
467
|
-
wo.scroller_$fixedColumns = $fixedColumn;
|
|
468
|
-
|
|
469
|
-
// RTL support (fixes column on right)
|
|
470
|
-
if ( $table.hasClass( tscss.scrollerRtl ) ) {
|
|
471
|
-
$fixedColumn.addClass( tscss.scrollerRtl );
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
$el = $fixedColumn.find( 'tr' );
|
|
475
|
-
len = $el.length;
|
|
476
|
-
for ( index = 0; index < len; index++ ) {
|
|
477
|
-
$el.eq( index ).children( ':gt(' + ( fixedColumns - 1 ) + ')' ).remove();
|
|
478
|
-
}
|
|
479
|
-
$fixedColumn
|
|
480
|
-
.addClass( tscss.scrollerHideElement )
|
|
481
|
-
.prependTo( $wrapper );
|
|
482
|
-
|
|
483
|
-
// look for filter widget
|
|
484
|
-
if ( c.$table.hasClass( 'hasFilters' ) ) {
|
|
485
|
-
// make sure fixed column filters aren't disabled
|
|
486
|
-
$el = $fixedColumn
|
|
487
|
-
.find( '.' + tscss.filter )
|
|
488
|
-
.not( '.' + tscss.filterDisabled )
|
|
489
|
-
.prop( 'disabled', false );
|
|
490
|
-
ts.filter.bindSearch( $table, $fixedColumn.find( '.' + tscss.filter ) );
|
|
491
|
-
// disable/enable filters behind fixed column
|
|
492
|
-
$el = $wrapper
|
|
493
|
-
.children( '.' + tscss.scrollerHeader )
|
|
494
|
-
.find( '.' + tscss.filter );
|
|
495
|
-
len = $el.length;
|
|
496
|
-
for ( index = 0; index < len; index++ ) {
|
|
497
|
-
// previously disabled filter; don't mess with it! filterDisabled class added by filter widget
|
|
498
|
-
if ( !$el.eq( index ).hasClass( tscss.filterDisabled || 'disabled' ) ) {
|
|
499
|
-
// disable filters behind fixed column; don't disable visible filters
|
|
500
|
-
$el.eq( index ).prop( 'disabled', index < fixedColumns );
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
// disable/enable tab indexes behind fixed column
|
|
506
|
-
c.$table
|
|
507
|
-
.add( '.' + tscss.scrollerFooter + ' table' )
|
|
508
|
-
.children( 'thead' )
|
|
509
|
-
.children( 'tr.' + tscss.headerRow )
|
|
510
|
-
.children()
|
|
511
|
-
.attr( 'tabindex', -1 );
|
|
512
|
-
|
|
513
|
-
$el = wo.scroller_$header
|
|
514
|
-
.add( $fixedColumn.find( '.' + tscss.scrollerTable + ' table' ) )
|
|
515
|
-
.children( 'thead' )
|
|
516
|
-
.children( 'tr.' + tscss.headerRow );
|
|
517
|
-
len = $el.length;
|
|
518
|
-
for ( index = 0; index < len; index++ ) {
|
|
519
|
-
temp = $el.eq( index ).children();
|
|
520
|
-
for ( index2 = 0; index2 < temp.length; index2++ ) {
|
|
521
|
-
temp.eq( index2 ).attr( 'tabindex', index2 < fixedColumns ? -1 : 0 );
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
ts.bindEvents( c.table, $fixedColumn.find( '.' + tscss.header ) );
|
|
526
|
-
ts.scroller.bindFixedColumnEvents( c, wo );
|
|
527
|
-
|
|
528
|
-
/*** Scrollbar hack! Since we can't hide the scrollbar with css ***/
|
|
529
|
-
if ( ts.scroller.isFirefox || ts.scroller.isOldIE ) {
|
|
530
|
-
$fixedTbody.wrap( '<div class="' + tscss.scrollerHack + '" style="overflow:hidden;">' );
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
},
|
|
534
|
-
|
|
535
|
-
bindFixedColumnEvents : function( c, wo ) {
|
|
536
|
-
// update thead & tbody in fixed column
|
|
537
|
-
var namespace = c.namespace + 'tsscrollerFixed',
|
|
538
|
-
events = ( 'tablesorter-initialized sortEnd filterEnd ' ).split( ' ' ).join( namespace + ' ' ),
|
|
539
|
-
events2 = 'scroll' + namespace,
|
|
540
|
-
$fixedTbody = wo.scroller_$fixedColumns.find( '.' + tscss.scrollerTable ),
|
|
541
|
-
fixedScroll = true,
|
|
542
|
-
tableScroll = true;
|
|
543
|
-
|
|
544
|
-
c.$table
|
|
545
|
-
.off( events )
|
|
546
|
-
.on( events, function() {
|
|
547
|
-
ts.scroller.updateFixed( c, wo, false );
|
|
548
|
-
ts.scroller.resize( c, wo );
|
|
549
|
-
})
|
|
550
|
-
.parent()
|
|
551
|
-
// *** SCROLL *** scroll fixed column along with main
|
|
552
|
-
.off( events2 )
|
|
553
|
-
.on( events2, function() {
|
|
554
|
-
// using flags to prevent firing the scroll event excessively leading to slow scrolling in Firefox
|
|
555
|
-
if ( fixedScroll || !ts.scroller.isFirefox ) {
|
|
556
|
-
tableScroll = false;
|
|
557
|
-
$fixedTbody[0].scrollTop = $( this ).scrollTop();
|
|
558
|
-
setTimeout( function() {
|
|
559
|
-
tableScroll = true;
|
|
560
|
-
}, 20 );
|
|
561
|
-
}
|
|
562
|
-
});
|
|
563
|
-
// scroll main along with fixed column
|
|
564
|
-
$fixedTbody
|
|
565
|
-
.off( events2 )
|
|
566
|
-
.on( events2, function() {
|
|
567
|
-
// using flags to prevent firing the scroll event excessively leading to slow scrolling in Firefox
|
|
568
|
-
if ( tableScroll || !ts.scroller.isFirefox ) {
|
|
569
|
-
fixedScroll = false;
|
|
570
|
-
c.$table.parent()[0].scrollTop = $( this ).scrollTop();
|
|
571
|
-
setTimeout( function() {
|
|
572
|
-
fixedScroll = true;
|
|
573
|
-
}, 20 );
|
|
574
|
-
}
|
|
575
|
-
})
|
|
576
|
-
.scroll();
|
|
577
|
-
|
|
578
|
-
// *** ROW HIGHLIGHT ***
|
|
579
|
-
if ( wo.scroller_rowHighlight !== '' ) {
|
|
580
|
-
events = 'mouseover mouseleave '.split( ' ' ).join( namespace + ' ' );
|
|
581
|
-
// can't use c.$tbodies because it doesn't include info-only tbodies
|
|
582
|
-
c.$table
|
|
583
|
-
.off( events, 'tbody > tr' )
|
|
584
|
-
.on( events, 'tbody > tr', function( event ) {
|
|
585
|
-
var indx = c.$table.children( 'tbody' ).children( 'tr' ).index( this );
|
|
586
|
-
$fixedTbody
|
|
587
|
-
.children( 'table' )
|
|
588
|
-
.children( 'tbody' )
|
|
589
|
-
.children( 'tr' )
|
|
590
|
-
.eq( indx )
|
|
591
|
-
.add( this )
|
|
592
|
-
.toggleClass( wo.scroller_rowHighlight, event.type === 'mouseover' );
|
|
593
|
-
});
|
|
594
|
-
$fixedTbody
|
|
595
|
-
.find( 'table' )
|
|
596
|
-
.off( events, 'tbody > tr' )
|
|
597
|
-
.on( events, 'tbody > tr', function( event ) {
|
|
598
|
-
var $fixed = $fixedTbody.children( 'table' ).children( 'tbody' ).children( 'tr' ),
|
|
599
|
-
indx = $fixed.index( this );
|
|
600
|
-
c.$table
|
|
601
|
-
.children( 'tbody' )
|
|
602
|
-
.children( 'tr' )
|
|
603
|
-
.eq( indx )
|
|
604
|
-
.add( this )
|
|
605
|
-
.toggleClass( wo.scroller_rowHighlight, event.type === 'mouseover' );
|
|
606
|
-
});
|
|
607
|
-
}
|
|
608
|
-
},
|
|
609
|
-
|
|
610
|
-
updateFixed : function( c, wo ) {
|
|
611
|
-
var $wrapper = wo.scroller_$container;
|
|
612
|
-
|
|
613
|
-
if ( wo.scroller_fixedColumns === 0 ) {
|
|
614
|
-
ts.scroller.removeFixed( c, wo );
|
|
615
|
-
return;
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
if ( !c.isScrolling ) {
|
|
619
|
-
return;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
// Make sure the wo.scroller_$fixedColumns container exists if not build it
|
|
623
|
-
if ( !$wrapper.find( '.' + tscss.scrollerFixed ).length ) {
|
|
624
|
-
ts.scroller.setupFixed( c, wo );
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
// scroller_fixedColumns
|
|
628
|
-
var index, tbodyIndex, rowIndex, $tbody, $adjCol, $fb, $fixHead, $fixBody, $fixFoot,
|
|
629
|
-
totalRows, widths, temp, adj, row,
|
|
630
|
-
$table = c.$table,
|
|
631
|
-
$tableWrap = $table.parent(),
|
|
632
|
-
$hdr = wo.scroller_$header,
|
|
633
|
-
$foot = wo.scroller_$footer,
|
|
634
|
-
|
|
635
|
-
// source cells for measurement
|
|
636
|
-
$mainTbodies = wo.scroller_$container
|
|
637
|
-
.children( '.' + tscss.scrollerTable )
|
|
638
|
-
.children( 'table' )
|
|
639
|
-
.children( 'tbody' ),
|
|
640
|
-
// variable gets redefined
|
|
641
|
-
$rows = wo.scroller_$header
|
|
642
|
-
.children( 'thead' )
|
|
643
|
-
.children( '.' + tscss.headerRow ),
|
|
644
|
-
|
|
645
|
-
// hide fixed column during resize, or we get a FOUC
|
|
646
|
-
$fixedColumn = wo.scroller_$fixedColumns
|
|
647
|
-
.addClass( tscss.scrollerHideElement ),
|
|
648
|
-
|
|
649
|
-
// target cells
|
|
650
|
-
$fixedTbodiesTable = $fixedColumn
|
|
651
|
-
.find( '.' + tscss.scrollerTable )
|
|
652
|
-
.children( 'table' ),
|
|
653
|
-
$fixedTbodies = $fixedTbodiesTable
|
|
654
|
-
.children( 'tbody' ),
|
|
655
|
-
// variables
|
|
656
|
-
tsScroller = ts.scroller,
|
|
657
|
-
scrollBarWidth = wo.scroller_barSetWidth,
|
|
658
|
-
fixedColumns = wo.scroller_fixedColumns,
|
|
659
|
-
dir = $table.hasClass( tscss.scrollerRtl ),
|
|
660
|
-
// get dimensions
|
|
661
|
-
$temp = $table.find( 'tbody td' ),
|
|
662
|
-
borderRightWidth = parseInt( $temp.css( 'border-right-width' ), 10 ) || 1,
|
|
663
|
-
borderSpacing = parseInt( ( $temp.css( 'border-spacing' ) || '' ).split( /\s/ )[ 0 ], 10 ) / 2 || 0,
|
|
664
|
-
totalWidth = parseInt( $table.css( 'padding-left' ), 10 ) +
|
|
665
|
-
parseInt( $table.css( 'padding-right' ), 10 ) -
|
|
666
|
-
borderRightWidth;
|
|
667
|
-
|
|
668
|
-
ts.scroller.removeFixed( c, wo, false );
|
|
669
|
-
|
|
670
|
-
// recalculate widths
|
|
671
|
-
$table.children( 'thead' ).removeClass( tscss.scrollerHideElement );
|
|
672
|
-
widths = [];
|
|
673
|
-
for ( index = 0; index < c.columns; index++ ) {
|
|
674
|
-
temp = c.$headerIndexed[ index ].outerWidth();
|
|
675
|
-
totalWidth += index < fixedColumns ? temp + borderSpacing : 0;
|
|
676
|
-
widths.push( temp );
|
|
677
|
-
}
|
|
678
|
-
$table.children( 'thead' ).addClass( tscss.scrollerHideElement );
|
|
679
|
-
|
|
680
|
-
// set fixed column width
|
|
681
|
-
totalWidth = totalWidth + borderRightWidth * 2 - borderSpacing;
|
|
682
|
-
tsScroller.setWidth( $fixedColumn.add( $fixedColumn.children() ), totalWidth );
|
|
683
|
-
tsScroller.setWidth( $fixedColumn.children().children( 'table' ), totalWidth );
|
|
684
|
-
|
|
685
|
-
$table.find( '.' + tscss.scrollerSpacerRow ).remove();
|
|
686
|
-
row = '<tr class="' + tscss.scrollerSpacerRow + ' ' + c.selectorRemove.slice(1) + '">';
|
|
687
|
-
for ( index = 0; index < c.columns; index++ ) {
|
|
688
|
-
row += '<td style="padding:0; margin:0;height:0;max-height:0;min-height:0;width:' +
|
|
689
|
-
widths[ index ] + 'px;min-width:' + widths[ index ] + 'px;max-width:' +
|
|
690
|
-
widths[ index ] + 'px"></td>';
|
|
691
|
-
}
|
|
692
|
-
c.$tbodies.eq(0).prepend( row += '</tr>' );
|
|
693
|
-
|
|
694
|
-
// update fixed column tbody content, set row height & set cell widths for first row
|
|
695
|
-
for ( tbodyIndex = 0; tbodyIndex < c.$tbodies.length; tbodyIndex++ ) {
|
|
696
|
-
$tbody = $mainTbodies.eq( tbodyIndex );
|
|
697
|
-
if ( $tbody.length ) {
|
|
698
|
-
// get tbody
|
|
699
|
-
$rows = $tbody.children();
|
|
700
|
-
totalRows = $rows.length;
|
|
701
|
-
$fb = ts.processTbody( $fixedTbodiesTable, $fixedTbodies.eq( tbodyIndex ), true );
|
|
702
|
-
$fb.empty();
|
|
703
|
-
// update tbody cells after sort/filtering
|
|
704
|
-
for ( rowIndex = 0; rowIndex < totalRows; rowIndex++ ) {
|
|
705
|
-
$adjCol = $( $rows[ rowIndex ].outerHTML );
|
|
706
|
-
$adjCol
|
|
707
|
-
.children( 'td, th' )
|
|
708
|
-
.slice( fixedColumns )
|
|
709
|
-
.remove();
|
|
710
|
-
$fb.append( $adjCol );
|
|
711
|
-
}
|
|
712
|
-
// adjust fixed thead/tbody/tfoot cell widths
|
|
713
|
-
$fixHead = $fixedColumn
|
|
714
|
-
.find( 'thead' )
|
|
715
|
-
.children( 'tr.' + tscss.headerRow )
|
|
716
|
-
.children();
|
|
717
|
-
$fixBody = $fixedColumn
|
|
718
|
-
.find( tscss.scrollerSpacerRow )
|
|
719
|
-
.children();
|
|
720
|
-
$fixFoot = $fixedColumn
|
|
721
|
-
.find( 'tfoot' )
|
|
722
|
-
.children( 'tr' )
|
|
723
|
-
.eq( 0 )
|
|
724
|
-
.children();
|
|
725
|
-
// reusing variables, so ignore the names :P
|
|
726
|
-
$adjCol = $hdr.children( 'thead' ).children( 'tr' ).children( 'td, th' );
|
|
727
|
-
$rows = $foot.children( 'tfoot' ).children( 'tr' ).children( 'td, th' );
|
|
728
|
-
for ( index = 0; index < c.columns; index++ ) {
|
|
729
|
-
if ( index < fixedColumns ) {
|
|
730
|
-
$temp = $fixHead.eq( index )
|
|
731
|
-
.add( $fixBody.eq( index ) )
|
|
732
|
-
.add( $fixFoot.eq( index ) );
|
|
733
|
-
tsScroller.setWidth( $temp, widths[ index ] );
|
|
734
|
-
}
|
|
735
|
-
$temp = $adjCol.eq( index )
|
|
736
|
-
.add( $rows.eq( index ) );
|
|
737
|
-
tsScroller.setWidth( $temp, widths[ index ] );
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
// restore tbody
|
|
741
|
-
ts.processTbody( $fixedTbodiesTable, $fb, false );
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
/*** scrollbar HACK! Since we can't hide the scrollbar with css ***/
|
|
746
|
-
if ( tsScroller.isFirefox || tsScroller.isOldIE ) {
|
|
747
|
-
$fixedTbodiesTable
|
|
748
|
-
.parent()
|
|
749
|
-
.css({
|
|
750
|
-
'width' : totalWidth
|
|
751
|
-
});
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
$fixedColumn.removeClass( tscss.scrollerHideElement );
|
|
755
|
-
for ( index = 0; index < fixedColumns; index++ ) {
|
|
756
|
-
$wrapper
|
|
757
|
-
.children( 'div' )
|
|
758
|
-
.children( 'table' )
|
|
759
|
-
.find( 'th:nth-child(' + ( index + 1 ) + '), td:nth-child(' + ( index + 1 ) + ')' )
|
|
760
|
-
.addClass( tscss.scrollerHideColumn );
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
adj = ts.scroller.hasScrollBar( $tableWrap ) ? scrollBarWidth : 0;
|
|
764
|
-
totalWidth = totalWidth - borderRightWidth;
|
|
765
|
-
temp = $tableWrap.parent().innerWidth() - totalWidth;
|
|
766
|
-
$tableWrap.width( temp );
|
|
767
|
-
// RTL support (fixes column on right)
|
|
768
|
-
$wrapper
|
|
769
|
-
.children( '.' + tscss.scrollerTable )
|
|
770
|
-
.css( dir ? 'right' : 'left', totalWidth );
|
|
771
|
-
$wrapper
|
|
772
|
-
.children( '.' + tscss.scrollerHeader + ', .' + tscss.scrollerFooter )
|
|
773
|
-
// Safari needs a scrollbar width of extra adjusment to align the fixed & scrolling columns
|
|
774
|
-
.css( dir ? 'right' : 'left', totalWidth + ( dir && ts.scroller.isSafari ? adj : 0 ) );
|
|
775
|
-
|
|
776
|
-
$hdr
|
|
777
|
-
.parent()
|
|
778
|
-
.add( $foot.parent() )
|
|
779
|
-
.width( temp - adj );
|
|
780
|
-
|
|
781
|
-
// fix gap under the tbody for the horizontal scrollbar
|
|
782
|
-
temp = ts.scroller.hasScrollBar( $tableWrap, true );
|
|
783
|
-
adj = temp ? scrollBarWidth : 0;
|
|
784
|
-
if ( !$fixedColumn.find( '.' + tscss.scrollerBarSpacer ).length && temp ) {
|
|
785
|
-
$temp = $( '<div class="' + tscss.scrollerBarSpacer + '">' )
|
|
786
|
-
.css( 'height', adj + 'px' );
|
|
787
|
-
$fixedColumn.find( '.' + tscss.scrollerTable ).append( $temp );
|
|
788
|
-
} else if ( !temp ) {
|
|
789
|
-
$fixedColumn.find( '.' + tscss.scrollerBarSpacer ).remove();
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
ts.scroller.updateRowHeight( c, wo );
|
|
793
|
-
// set fixed column height (changes with filtering)
|
|
794
|
-
$fixedColumn.height( $wrapper.height() );
|
|
795
|
-
|
|
796
|
-
$fixedColumn.removeClass( tscss.scrollerHideElement );
|
|
797
|
-
|
|
798
|
-
},
|
|
799
|
-
|
|
800
|
-
fixHeight : function( $rows, $fixedRows ) {
|
|
801
|
-
var index, heightRow, heightFixed, $r, $f,
|
|
802
|
-
len = $rows.length;
|
|
803
|
-
for ( index = 0; index < len; index++ ) {
|
|
804
|
-
$r = $rows.eq( index );
|
|
805
|
-
$f = $fixedRows.eq( index );
|
|
806
|
-
heightRow = $r.height();
|
|
807
|
-
heightFixed = $f.height();
|
|
808
|
-
if ( heightRow > heightFixed ) {
|
|
809
|
-
$f.addClass( tscss.scrollerAddedHeight ).height( heightRow );
|
|
810
|
-
} else if ( heightRow < heightFixed ) {
|
|
811
|
-
$r.addClass( tscss.scrollerAddedHeight ).height( heightFixed );
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
},
|
|
815
|
-
|
|
816
|
-
updateRowHeight : function( c, wo ) {
|
|
817
|
-
var $rows, $fixed,
|
|
818
|
-
$fixedColumns = wo.scroller_$fixedColumns;
|
|
819
|
-
|
|
820
|
-
wo.scroller_$container
|
|
821
|
-
.find( '.' + tscss.scrollerAddedHeight )
|
|
822
|
-
.removeClass( tscss.scrollerAddedHeight )
|
|
823
|
-
.height( '' );
|
|
824
|
-
|
|
825
|
-
$rows = wo.scroller_$header
|
|
826
|
-
.children( 'thead' )
|
|
827
|
-
.children( 'tr' );
|
|
828
|
-
$fixed = $fixedColumns
|
|
829
|
-
.children( '.' + tscss.scrollerHeader )
|
|
830
|
-
.children( 'table' )
|
|
831
|
-
.children( 'thead' )
|
|
832
|
-
.children( 'tr' );
|
|
833
|
-
ts.scroller.fixHeight( $rows, $fixed );
|
|
834
|
-
|
|
835
|
-
$rows = wo.scroller_$footer
|
|
836
|
-
.children( 'tfoot' )
|
|
837
|
-
.children( 'tr' );
|
|
838
|
-
$fixed = $fixedColumns
|
|
839
|
-
.children( '.' + tscss.scrollerFooter )
|
|
840
|
-
.children( 'table' )
|
|
841
|
-
.children( 'tfoot' )
|
|
842
|
-
.children( 'tr' );
|
|
843
|
-
ts.scroller.fixHeight( $rows, $fixed );
|
|
844
|
-
|
|
845
|
-
if ( ts.scroller.isFirefox ) {
|
|
846
|
-
// Firefox/Old IE scrollbar hack (wraps table to hide the scrollbar)
|
|
847
|
-
$fixedColumns = $fixedColumns.find( '.' + tscss.scrollerHack );
|
|
848
|
-
}
|
|
849
|
-
$rows = c.$table
|
|
850
|
-
.children( 'tbody' )
|
|
851
|
-
.children( 'tr' );
|
|
852
|
-
$fixed = $fixedColumns
|
|
853
|
-
.children( '.' + tscss.scrollerTable )
|
|
854
|
-
.children( 'table' )
|
|
855
|
-
.children( 'tbody' )
|
|
856
|
-
.children( 'tr' );
|
|
857
|
-
ts.scroller.fixHeight( $rows, $fixed );
|
|
858
|
-
|
|
859
|
-
},
|
|
860
|
-
|
|
861
|
-
removeFixed : function( c, wo, removeIt ) {
|
|
862
|
-
var $table = c.$table,
|
|
863
|
-
$wrapper = wo.scroller_$container,
|
|
864
|
-
dir = $table.hasClass( tscss.scrollerRtl );
|
|
865
|
-
|
|
866
|
-
// remove fixed columns
|
|
867
|
-
if ( removeIt || typeof removeIt === 'undefined' ) {
|
|
868
|
-
$wrapper.find( '.' + tscss.scrollerFixed ).remove();
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
$wrapper
|
|
872
|
-
.find( '.' + tscss.scrollerHideColumn )
|
|
873
|
-
.removeClass( tscss.scrollerHideColumn );
|
|
874
|
-
|
|
875
|
-
// RTL support ( fixes column on right )
|
|
876
|
-
$wrapper
|
|
877
|
-
.children( ':not(.' + tscss.scrollerFixed + ')' )
|
|
878
|
-
.css( dir ? 'right' : 'left', 0 );
|
|
879
|
-
},
|
|
880
|
-
|
|
881
|
-
remove : function( c, wo ) {
|
|
882
|
-
var $wrap = wo.scroller_$container,
|
|
883
|
-
namespace = c.namespace + 'tsscroller';
|
|
884
|
-
c.$table
|
|
885
|
-
.off( namespace )
|
|
886
|
-
.insertBefore( $wrap )
|
|
887
|
-
.find( 'thead' )
|
|
888
|
-
.removeClass( tscss.scrollerHideElement )
|
|
889
|
-
.children( 'tr.' + tscss.headerRow )
|
|
890
|
-
.children()
|
|
891
|
-
.attr( 'tabindex', 0 )
|
|
892
|
-
.end()
|
|
893
|
-
.find( '.' + tscss.filterRow )
|
|
894
|
-
.removeClass( tscss.scrollerHideElement + ' ' + tscss.filterRowHide );
|
|
895
|
-
c.$table
|
|
896
|
-
.find( '.' + tscss.filter )
|
|
897
|
-
.not( '.' + tscss.filterDisabled )
|
|
898
|
-
.prop( 'disabled', false );
|
|
899
|
-
$wrap.remove();
|
|
900
|
-
$( window ).off( namespace );
|
|
901
|
-
c.isScrolling = false;
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
};
|
|
905
|
-
|
|
906
|
-
})( jQuery, window );
|
|
File without changes
|
|
File without changes
|
|
File without changes
|