You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2019/05/04 02:24:17 UTC
[trafficcontrol] branch master updated: Removed deprecated UI
dependencies (#3517)
This is an automated email from the ASF dual-hosted git repository.
mitchell852 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new c6a6ca8 Removed deprecated UI dependencies (#3517)
c6a6ca8 is described below
commit c6a6ca8aed469d9cc6f399e3073d16d9ce5c9178
Author: ocket8888 <oc...@gmail.com>
AuthorDate: Fri May 3 20:24:13 2019 -0600
Removed deprecated UI dependencies (#3517)
* Removed deprecated UI dependencies
* Updated licensing information
* removed now-unecessary gitignore rules
---
.dependency_license | 17 -
.gitignore | 8 -
LICENSE | 33 -
licenses/BSD-prettyprint | 38 -
licenses/MIT-jmenu | 28 -
licenses/MIT-jquery_tree | 24 -
licenses/MIT-jqueryui | 55 -
licenses/WTFPL | 15 -
traffic_ops/app/public/close_fancybox.html | 31 -
traffic_ops/app/public/css/datatables.css | 147 -
traffic_ops/app/public/css/jMenu.jquery.css | 71 -
traffic_ops/app/public/css/jmenu.css | 4 -
traffic_ops/app/public/css/jquery-ui.structure.css | 833 -
traffic_ops/app/public/css/jquery.tree.min.css | 1 -
traffic_ops/app/public/css/select2.css | 704 -
traffic_ops/app/public/css/site.css | 321 -
traffic_ops/app/public/favicon.ico | Bin 16958 -> 0 bytes
traffic_ops/app/public/good.csv | 2 -
traffic_ops/app/public/images/anchor.gif | Bin 92 -> 0 bytes
traffic_ops/app/public/images/bad.png | Bin 472 -> 0 bytes
traffic_ops/app/public/images/blank.png | Bin 176 -> 0 bytes
traffic_ops/app/public/images/clock-black.png | Bin 427 -> 0 bytes
traffic_ops/app/public/images/clock.png | Bin 1514 -> 0 bytes
traffic_ops/app/public/images/good.png | Bin 617 -> 0 bytes
traffic_ops/app/public/images/graph.png | Bin 483 -> 0 bytes
traffic_ops/app/public/images/info.png | Bin 3379 -> 0 bytes
.../app/public/images/input_field_background.png | Bin 1239 -> 0 bytes
traffic_ops/app/public/images/na.png | Bin 1530 -> 0 bytes
traffic_ops/app/public/images/notrun.png | Bin 436 -> 0 bytes
traffic_ops/app/public/images/select2-spinner.gif | Bin 1849 -> 0 bytes
traffic_ops/app/public/images/select2.png | Bin 613 -> 0 bytes
traffic_ops/app/public/images/select2x2.png | Bin 845 -> 0 bytes
traffic_ops/app/public/images/spinner-small.gif | Bin 673 -> 0 bytes
traffic_ops/app/public/images/tc_logo.png | Bin 101717 -> 0 bytes
traffic_ops/app/public/images/tc_logo_c_only.png | Bin 106800 -> 0 bytes
.../app/public/images/traffic_operations_logo.png | Bin 10639 -> 0 bytes
traffic_ops/app/public/images/warning.png | Bin 595 -> 0 bytes
traffic_ops/app/public/js/application.js | 25 -
traffic_ops/app/public/js/jMenu.jquery.js | 185 -
traffic_ops/app/public/js/jMenu.jquery.min.js | 12 -
traffic_ops/app/public/js/jqtree/tree.jquery.js | 3341 ----
traffic_ops/app/public/js/jquery.dataTables.js | 15345 -------------------
traffic_ops/app/public/js/jquery.tree.min.js | 8 -
traffic_ops/app/public/js/prettyprint.js | 775 -
traffic_ops/app/public/js/select2.js | 3508 -----
traffic_ops/app/public/js/tm_utils.js | 176 -
traffic_ops/app/public/teak_favicon.ico | Bin 318 -> 0 bytes
traffic_ops/app/public/theme/default/style.css | 14 -
traffic_ops/install/bin/_postinstall | 42 +-
traffic_ops/install/bin/download_web_deps | 60 -
traffic_ops/install/bin/web_deps.txt | 48 -
traffic_ops/install/lib/WebDep.pm | 234 -
52 files changed, 19 insertions(+), 26086 deletions(-)
diff --git a/.dependency_license b/.dependency_license
index 12892c2..187a3e1 100644
--- a/.dependency_license
+++ b/.dependency_license
@@ -66,22 +66,6 @@ cron\.d/[^/]*$, Apache
^misc/logos/page_logos/traffic_router_logo\.png, Apache
^misc/logos/page_logos/traffic_stats_logo\.png, Apache
^misc/logos/page_logos/traffic_stats_logo_red\.png, Apache
-^traffic_ops/app/public/images/anchor\.gif, Apache
-^traffic_ops/app/public/images/bad\.png, Apache
-^traffic_ops/app/public/images/blank\.png, Apache
-^traffic_ops/app/public/images/clock-black., Apache
-^traffic_ops/app/public/images/clock\.png, Apache
-^traffic_ops/app/public/images/good\.png, Apache
-^traffic_ops/app/public/images/graph\.png, Apache
-^traffic_ops/app/public/images/info\.png, Apache
-^traffic_ops/app/public/images/input_field_background\.png, Apache
-^traffic_ops/app/public/images/na\.png, Apache
-^traffic_ops/app/public/images/notrun\.png, Apache
-^traffic_ops/app/public/images/tc_logo\.png, Apache
-^traffic_ops/app/public/images/tc_logo_c_only\.png, Apache
-^traffic_ops/app/public/images/traffic_operations_logo\.png, Apache
-^traffic_ops/app/public/images/warning\.png, Apache
-^traffic_ops/app/public/images/select2.*, Apache
# Demo certificates
ssl\.(crt|key)$, Apache
@@ -99,7 +83,6 @@ Lato-Bold\.ttf$, SIL OFL 1.1
Lato-Regular\.ttf$, SIL OFL 1.1
ssl-bundle\.crt$, MPL
^traffic_portal/app/src/assets/images/sort_, MIT
-^traffic_ops/app/public/images/spinner-small\.gif$, WTFPL
# Code dependencies
#
diff --git a/.gitignore b/.gitignore
index 68fbb4a..ab47069 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,14 +18,6 @@ docs/.todo_cache
docs/_build/
traffic_ops/app/conf/ldap.conf
traffic_ops/app/db/admin
-traffic_ops/app/public/css/images/
-traffic_ops/app/public/css/jquery-ui.css
-traffic_ops/app/public/js/bootstrap.min.js
-traffic_ops/app/public/js/fancybox/
-traffic_ops/app/public/js/flot/
-traffic_ops/app/public/js/jquery-1.11.2.min.js
-traffic_ops/app/public/js/jquery-ui.min.js
-traffic_ops/app/public/js/jquery.dataTables.min.js
traffic_ops/**/*.log
traffic_stats/traffic_stats
misc/traffic-control-cdn/downloads/*.rpm
diff --git a/LICENSE b/LICENSE
index e2b0fae..dafd021 100644
--- a/LICENSE
+++ b/LICENSE
@@ -236,17 +236,7 @@ For the sorttable component:
For the jQuery component:
./licenses/MIT-jquery
-For the jQuery UI component:
-@traffic_ops/app/public/css/jquery-ui.structure.css
-./licenses/MIT-jqueryui
-
-For the jMenu component:
-@traffic_ops/app/public/*/jMenu.*
-@traffic_ops/app/public/*/jmenu.*
-./licenses/MIT-jmenu
-
For the DataTables component:
-@traffic_ops/app/public/js/jquery.dataTables.js
@traffic_portal/app/src/assets/css/jquery.dataTables.min_1.10.9.css
@traffic_portal/app/src/assets/js/jquery.dataTables.min_1.10.16.js
@traffic_portal/app/src/assets/images/sort_*
@@ -273,10 +263,6 @@ For the angular-chart.js component:
@traffic_portal/app/src/assets/js/chartjs/angular-chart.min_1.1.1.js
./licenses/BSD-angular-chartjs
-For the jquery.tree component:
-@traffic_ops/app/public/*/jquery.tree.min.*
-./licenses/MIT-jquery_tree
-
For the downloadjs component:
@traffic_portal/app/src/assets/js/downloadjs-min_v4.21.js
./licenses/MIT-downloadjs
@@ -336,16 +322,6 @@ For the gofmt github hook:
@misc/git/pre-commit-hooks/01-gofmt
./licenses/BSD-go
-For the Select2 component:
-@traffic_ops/app/public/*/select2*
-This dual-licensed component is herein licensed under the Apache 2.0 license.
-
-Copyright (c) 2012-2015 Kevin Brown, Igor Vaynberg, and Select2 contributors
-
-For the prettyprint component:
-@traffic_ops/app/public/js/prettyprint.js
-./licenses/BSD-prettyprint
-
For the IPv6 Perl Module component:
@traffic_ops/app/bin/checks/NetPacket/IPv6.pm
./licenses/ISC-netpacket_ipv6
@@ -407,15 +383,6 @@ The ozzo-validation component is used under the MIT license:
@vendor/github.com/go-ozzo/ozzo-validation/*
./vendor/github.com/go-ozzo/ozzo-validation/LICENSE
-The spinner-small.gif is used under the WTFPL license:
-@traffic_ops/app/public/images/spinner-small.gif
-./licenses/WTFPL
-
-For the Pixabay icons:
-@traffic_ops/app/public/images/info.png
-@traffic_ops/app/public/images/graph.png
-./licenses/CC0
-
The bytefmt component is used under the Apache 2.0 license:
@grove/vendor/code.cloudfoundry.org/bytefmt/*
./grove/vendor/code.cloudfoundry.org/bytefmt/LICENSE
diff --git a/licenses/BSD-prettyprint b/licenses/BSD-prettyprint
deleted file mode 100644
index 28d9c0f..0000000
--- a/licenses/BSD-prettyprint
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-Copyright (c) 2009 James Padolsey. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY James Padolsey ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL James Padolsey OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
-The views and conclusions contained in the software and documentation are
-those of the authors and should not be interpreted as representing official
-policies, either expressed or implied, of James Padolsey.
-
- AUTHOR James Padolsey (http://james.padolsey.com)
- VERSION 1.03.0
- UPDATED 29-10-2011
- CONTRIBUTORS
- David Waller
- Benjamin Drucker
-
-*/
diff --git a/licenses/MIT-jmenu b/licenses/MIT-jmenu
deleted file mode 100644
index ae8dc70..0000000
--- a/licenses/MIT-jmenu
+++ /dev/null
@@ -1,28 +0,0 @@
-/************************************************************************
-*************************************************************************
-Name : jMenu - jQuery Plugin
-Revison : 2.0
-Date : 08/2013
-Author : ALPIXEL - (www.myjqueryplugins.com - www.alpixel.fr)
-Support : FF, IE7, IE8, MAC Firefox, MAC Safari
-License : Open Source - MIT License : http://www.opensource.org/licenses/mit-license.php
-
-**************************************************************************
-*************************************************************************/
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/licenses/MIT-jquery_tree b/licenses/MIT-jquery_tree
deleted file mode 100644
index 97a57a2..0000000
--- a/licenses/MIT-jquery_tree
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Tree - jQuery Tree Widget
- * @author Valerio Galano <v....@daredevel.com>
- * @license MIT
- * @see https://github.com/daredevel/jquery-tree
- * @version 0.1
- */
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/licenses/MIT-jqueryui b/licenses/MIT-jqueryui
deleted file mode 100644
index 25f6594..0000000
--- a/licenses/MIT-jqueryui
+++ /dev/null
@@ -1,55 +0,0 @@
-The note regarding "node_modules" and "external directories" is inapplicable in
-this project, as components from those folders were not included. The "demos
-directory" is not herein distributed, so this project contains no sample code
-licensed CC0 as indicated below.
-
-jQuery UI CSS Framework 1.11.2
-http://jqueryui.com
-
-Copyright 2014 jQuery Foundation and other contributors
-Released under the MIT license.
-http://jquery.org/license
-
-Copyright jQuery Foundation and other contributors, https://jquery.org/
-
-This software consists of voluntary contributions made by many
-individuals. For exact contribution history, see the revision history
-available at https://github.com/jquery/jquery-ui
-
-The following license applies to all parts of this software except as
-documented below:
-
-====
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-====
-
-Copyright and related rights for sample code are waived via CC0. Sample
-code is defined as all source code contained within the demos directory.
-
-CC0: http://creativecommons.org/publicdomain/zero/1.0/
-
-====
-
-All files located in the node_modules and external directories are
-externally maintained libraries used by this software which have their
-own licenses; we recommend you read them, as their terms may differ from
-the terms above.
diff --git a/licenses/WTFPL b/licenses/WTFPL
deleted file mode 100644
index 77dea88..0000000
--- a/licenses/WTFPL
+++ /dev/null
@@ -1,15 +0,0 @@
- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
- Version 2, December 2004
-
- Copyright (C) 2004 Sam Hocevar <sa...@hocevar.net>
-
- Everyone is permitted to copy and distribute verbatim or modified
- copies of this license document, and changing it is allowed as long
- as the name is changed.
-
- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. You just DO WHAT THE FUCK YOU WANT TO.
-
-
diff --git a/traffic_ops/app/public/close_fancybox.html b/traffic_ops/app/public/close_fancybox.html
deleted file mode 100644
index 26d8da3..0000000
--- a/traffic_ops/app/public/close_fancybox.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!--
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-
-<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>Quick page to close a fancy box</title>
- <script type="text/javascript" src="/js/jquery-1.11.2.min.js"></script>
- <script type="text/javascript">
- $(function(){
- parent.$.fancybox.close();
- });
- </script>
- </head>
- <body>
- Traffic Ops processing...
- </body>
-</html>
diff --git a/traffic_ops/app/public/css/datatables.css b/traffic_ops/app/public/css/datatables.css
deleted file mode 100644
index f6cb7b0..0000000
--- a/traffic_ops/app/public/css/datatables.css
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
-
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-
-*/
-
-.dataTables_wrapper .dataTables_paginate {
- float: right;
- text-align: right;
- padding-top: 0.25em;
- padding-bottom: 0.25em;
-}
-.dataTables_wrapper .dataTables_paginate .paginate_button {
- box-sizing: border-box;
- display: inline-block;
- min-width: 1.5em;
- padding: 0.5em 1em;
- margin-left: 2px;
- text-align: center;
- text-decoration: none !important;
- cursor: pointer;
- *cursor: hand;
- color: #333 !important;
- border: 1px solid transparent;
- border-radius: 2px
-}
-.dataTables_wrapper .dataTables_paginate .paginate_button.current,
-.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
- color: #333 !important;
- border: 1px solid #979797;
- background-color: white;
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #dcdcdc));
- background: -webkit-linear-gradient(top, #fff 0%, #dcdcdc 100%);
- background: -moz-linear-gradient(top, #fff 0%, #dcdcdc 100%);
- background: -ms-linear-gradient(top, #fff 0%, #dcdcdc 100%);
- background: -o-linear-gradient(top, #fff 0%, #dcdcdc 100%);
- background: linear-gradient(to bottom, #fff 0%, #dcdcdc 100%)
-}
-.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
-.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
-.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
- cursor: default;
- color: #666 !important;
- border: 1px solid transparent;
- background: transparent;
- box-shadow: none
-}
-.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
- color: white !important;
- border: 1px solid #111;
- background-color: #585858;
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));
- background: -webkit-linear-gradient(top, #585858 0%, #111 100%);
- background: -moz-linear-gradient(top, #585858 0%, #111 100%);
- background: -ms-linear-gradient(top, #585858 0%, #111 100%);
- background: -o-linear-gradient(top, #585858 0%, #111 100%);
- background: linear-gradient(to bottom, #585858 0%, #111 100%)
-}
-.dataTables_wrapper .dataTables_paginate .paginate_button:active {
- outline: none;
- background-color: #2b2b2b;
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));
- background: -webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
- background: -moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
- background: -ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
- background: -o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
- background: linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);
- box-shadow: inset 0 0 3px #111
-}
-.dataTables_wrapper .dataTables_paginate {
- color: white;
-}
-.dataTables_wrapper .dataTables_processing {
- position: absolute;
- top: 50%;
- left: 50%;
- width: 100%;
- height: 40px;
- margin-left: -50%;
- margin-top: -25px;
- padding-top: 20px;
- text-align: center;
- font-size: 1.2em;
- background-color: white;
- background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(25%, rgba(255, 255, 255, 0.9)), color-stop(75%, rgba(255, 255, 255, 0.9)), color-stop(100%, rgba(255, 255, 255, 0)));
- background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);
- background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);
- background: -ms-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);
- background: -o-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);
- background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%)
-}
-.dataTables_wrapper .dataTables_filter,
-.dataTables_wrapper .dataTables_processing{
- margin-top: 10px;
-}
-.dataTables_wrapper:after {
- visibility: hidden;
- display: block;
- content: "";
- clear: both;
- height: 0
-}
-@media screen and (max-width: 767px) {
- .dataTables_wrapper .dataTables_paginate {
- float: none;
- text-align: center
- }
- .dataTables_wrapper .dataTables_paginate {
- margin-top: 0.5em
- }
-}
-@media screen and (max-width: 640px) {
- .dataTables_wrapper .dataTables_filter {
- float: none;
- text-align: center
- }
- .dataTables_wrapper .dataTables_filter {
- margin-top: 0.5em
- }
-}
-
-.dataTables_paginate .fg-button {
- padding: 1em;
- margin: 2px;
- border-radius: 5px
-}
-
-.dataTables_info {
- margin-left: 10px;
- margin-top: 10px;
- float:left;
-}
diff --git a/traffic_ops/app/public/css/jMenu.jquery.css b/traffic_ops/app/public/css/jMenu.jquery.css
deleted file mode 100755
index 35ae3cb..0000000
--- a/traffic_ops/app/public/css/jMenu.jquery.css
+++ /dev/null
@@ -1,71 +0,0 @@
-.jMenu{
- display:table;
- margin:0;padding:0;
- list-style:none;
-}
-.jMenu li{
- display: inline-block;
- /*background-color: #322f32;*/
- background-color: #000000;
- margin: 0px;
- border-color: #322f32;
- border-style:solid;
- border-width:1px;
- border-top-left-radius: 1px;
- border-bottom-left-radius: 1px;
- border-top-right-radius: 1px;
- border-bottom-right-radius: 1px;
- width: 120px;
-}
-.jMenu li a{
- padding: 10px;
- display: block;
- background-color: transparent;
- color: white;
- cursor: pointer;
- text-decoration:none;
- border-top-left-radius: 1px;
- border-bottom-left-radius: 1px;
- border-top-right-radius: 1px;
- border-bottom-right-radius: 1px;
- width: 100px;
- text-align: center;
-}
-.jMenu li a:hover{
- background-color:#3a3a3a
-}
-.jMenu li:hover>a{
- background-color:#3a3a3a
-}
-.jMenu li ul{
- display:none;
- position:absolute;
- z-index:9999;
- padding:0;
- margin:0;
-}
-.jMenu li ul li{
- background-color:#322f32;
- display:block;
- border-bottom:1px solid #484548;
- padding:0;
- list-style:none;
- position:relative
-}
-.jMenu li ul li a{
- font-size:11px;
- text-transform:none;
- display:block;
- padding:7px;
- border-top:1px solid transparent;
- border-bottom:1px solid transparent
- }
-.jMenu li ul li a.isParent{
- background-color:#3a3a3a
-}
-.jMenu li ul li a:hover{
- background-color: #322f32;
- /*background-color: #514c52;*/
- border-top: 1px solid #322f32;
- border-bottom: 1px solid #322f32;
-}
diff --git a/traffic_ops/app/public/css/jmenu.css b/traffic_ops/app/public/css/jmenu.css
deleted file mode 100644
index 40002a7..0000000
--- a/traffic_ops/app/public/css/jmenu.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.jMenu{display:table;margin:0;padding:0;list-style:none;}.jMenu li{display:table-cell;background-color:#322f32;margin:0;list-style:none}.jMenu li a{padding:10px 15px;display:block;background-color:transparent;color:#fff;text-transform:uppercase;cursor:pointer;font-size:12px}.jMenu li a:hover{background-color:#3a3a3a}
-.jMenu li:hover>a{background-color:#3a3a3a}
-.jMenu li ul{display:none;position:absolute;z-index:9999;padding:0;margin:0;list-style:none}.jMenu li ul li{background-color:#322f32;display:block;border-bottom:1px solid #484548;padding:0;list-style:none;position:relative}.jMenu li ul li a{font-size:11px;text-transform:none;display:block;padding:7px;border-top:1px solid transparent;border-bottom:1px solid transparent}.jMenu li ul li a.isParent{background-color:#3a3a3a}
-.jMenu li ul li a:hover{background-color:#514c52;border-top:1px solid #322f32;border-bottom:1px solid #322f32}
diff --git a/traffic_ops/app/public/css/jquery-ui.structure.css b/traffic_ops/app/public/css/jquery-ui.structure.css
deleted file mode 100644
index d3d88d4..0000000
--- a/traffic_ops/app/public/css/jquery-ui.structure.css
+++ /dev/null
@@ -1,833 +0,0 @@
-/*!
- * jQuery UI CSS Framework 1.11.2
- * http://jqueryui.com
- *
- * Copyright 2014 jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/category/theming/
- */
-
-/* Layout helpers
-----------------------------------*/
-.ui-helper-hidden {
- display: none;
-}
-.ui-helper-hidden-accessible {
- border: 0;
- clip: rect(0 0 0 0);
- height: 1px;
- margin: -1px;
- overflow: hidden;
- padding: 0;
- position: absolute;
- width: 1px;
-}
-.ui-helper-reset {
- margin: 0;
- padding: 0;
- border: 0;
- outline: 0;
- line-height: 1.3;
- text-decoration: none;
- font-size: 100%;
- list-style: none;
-}
-.ui-helper-clearfix:before,
-.ui-helper-clearfix:after {
- content: "";
- display: table;
- border-collapse: collapse;
-}
-.ui-helper-clearfix:after {
- clear: both;
-}
-.ui-helper-clearfix {
- min-height: 0; /* support: IE7 */
-}
-.ui-helper-zfix {
- width: 100%;
- height: 100%;
- top: 0;
- left: 0;
- position: absolute;
- opacity: 0;
- filter:Alpha(Opacity=0); /* support: IE8 */
-}
-
-.ui-front {
- z-index: 100;
-}
-
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-disabled {
- cursor: default !important;
-}
-
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon {
- display: block;
- text-indent: -99999px;
- overflow: hidden;
- background-repeat: no-repeat;
-}
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Overlays */
-.ui-widget-overlay {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
-}
-.ui-draggable-handle {
- -ms-touch-action: none;
- touch-action: none;
-}
-.ui-resizable {
- position: relative;
-}
-.ui-resizable-handle {
- position: absolute;
- font-size: 0.1px;
- display: block;
- -ms-touch-action: none;
- touch-action: none;
-}
-.ui-resizable-disabled .ui-resizable-handle,
-.ui-resizable-autohide .ui-resizable-handle {
- display: none;
-}
-.ui-resizable-n {
- cursor: n-resize;
- height: 7px;
- width: 100%;
- top: -5px;
- left: 0;
-}
-.ui-resizable-s {
- cursor: s-resize;
- height: 7px;
- width: 100%;
- bottom: -5px;
- left: 0;
-}
-.ui-resizable-e {
- cursor: e-resize;
- width: 7px;
- right: -5px;
- top: 0;
- height: 100%;
-}
-.ui-resizable-w {
- cursor: w-resize;
- width: 7px;
- left: -5px;
- top: 0;
- height: 100%;
-}
-.ui-resizable-se {
- cursor: se-resize;
- width: 12px;
- height: 12px;
- right: 1px;
- bottom: 1px;
-}
-.ui-resizable-sw {
- cursor: sw-resize;
- width: 9px;
- height: 9px;
- left: -5px;
- bottom: -5px;
-}
-.ui-resizable-nw {
- cursor: nw-resize;
- width: 9px;
- height: 9px;
- left: -5px;
- top: -5px;
-}
-.ui-resizable-ne {
- cursor: ne-resize;
- width: 9px;
- height: 9px;
- right: -5px;
- top: -5px;
-}
-.ui-selectable {
- -ms-touch-action: none;
- touch-action: none;
-}
-.ui-selectable-helper {
- position: absolute;
- z-index: 100;
- border: 1px dotted black;
-}
-.ui-sortable-handle {
- -ms-touch-action: none;
- touch-action: none;
-}
-.ui-accordion .ui-accordion-header {
- display: block;
- cursor: pointer;
- position: relative;
- margin: 2px 0 0 0;
- padding: .5em .5em .5em .7em;
- min-height: 0; /* support: IE7 */
- font-size: 100%;
-}
-.ui-accordion .ui-accordion-icons {
- padding-left: 2.2em;
-}
-.ui-accordion .ui-accordion-icons .ui-accordion-icons {
- padding-left: 2.2em;
-}
-.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
- position: absolute;
- left: .5em;
- top: 50%;
- margin-top: -8px;
-}
-.ui-accordion .ui-accordion-content {
- padding: 1em 2.2em;
- border-top: 0;
- overflow: auto;
-}
-.ui-autocomplete {
- position: absolute;
- top: 0;
- left: 0;
- cursor: default;
-}
-.ui-button {
- display: inline-block;
- position: relative;
- padding: 0;
- line-height: normal;
- margin-right: .1em;
- cursor: pointer;
- vertical-align: middle;
- text-align: center;
- overflow: visible; /* removes extra width in IE */
-}
-.ui-button,
-.ui-button:link,
-.ui-button:visited,
-.ui-button:hover,
-.ui-button:active {
- text-decoration: none;
-}
-/* to make room for the icon, a width needs to be set here */
-.ui-button-icon-only {
- width: 2.2em;
-}
-/* button elements seem to need a little more width */
-button.ui-button-icon-only {
- width: 2.4em;
-}
-.ui-button-icons-only {
- width: 3.4em;
-}
-button.ui-button-icons-only {
- width: 3.7em;
-}
-
-/* button text element */
-.ui-button .ui-button-text {
- display: block;
- line-height: normal;
-}
-.ui-button-text-only .ui-button-text {
- padding: .4em 1em;
-}
-.ui-button-icon-only .ui-button-text,
-.ui-button-icons-only .ui-button-text {
- padding: .4em;
- text-indent: -9999999px;
-}
-.ui-button-text-icon-primary .ui-button-text,
-.ui-button-text-icons .ui-button-text {
- padding: .4em 1em .4em 2.1em;
-}
-.ui-button-text-icon-secondary .ui-button-text,
-.ui-button-text-icons .ui-button-text {
- padding: .4em 2.1em .4em 1em;
-}
-.ui-button-text-icons .ui-button-text {
- padding-left: 2.1em;
- padding-right: 2.1em;
-}
-/* no icon support for input elements, provide padding by default */
-input.ui-button {
- padding: .4em 1em;
-}
-
-/* button icon element(s) */
-.ui-button-icon-only .ui-icon,
-.ui-button-text-icon-primary .ui-icon,
-.ui-button-text-icon-secondary .ui-icon,
-.ui-button-text-icons .ui-icon,
-.ui-button-icons-only .ui-icon {
- position: absolute;
- top: 50%;
- margin-top: -8px;
-}
-.ui-button-icon-only .ui-icon {
- left: 50%;
- margin-left: -8px;
-}
-.ui-button-text-icon-primary .ui-button-icon-primary,
-.ui-button-text-icons .ui-button-icon-primary,
-.ui-button-icons-only .ui-button-icon-primary {
- left: .5em;
-}
-.ui-button-text-icon-secondary .ui-button-icon-secondary,
-.ui-button-text-icons .ui-button-icon-secondary,
-.ui-button-icons-only .ui-button-icon-secondary {
- right: .5em;
-}
-
-/* button sets */
-.ui-buttonset {
- margin-right: 7px;
-}
-.ui-buttonset .ui-button {
- margin-left: 0;
- margin-right: -.3em;
-}
-
-/* workarounds */
-/* reset extra padding in Firefox, see h5bp.com/l */
-input.ui-button::-moz-focus-inner,
-button.ui-button::-moz-focus-inner {
- border: 0;
- padding: 0;
-}
-.ui-datepicker {
- width: 17em;
- padding: .2em .2em 0;
- display: none;
-}
-.ui-datepicker .ui-datepicker-header {
- position: relative;
- padding: .2em 0;
-}
-.ui-datepicker .ui-datepicker-prev,
-.ui-datepicker .ui-datepicker-next {
- position: absolute;
- top: 2px;
- width: 1.8em;
- height: 1.8em;
-}
-.ui-datepicker .ui-datepicker-prev-hover,
-.ui-datepicker .ui-datepicker-next-hover {
- top: 1px;
-}
-.ui-datepicker .ui-datepicker-prev {
- left: 2px;
-}
-.ui-datepicker .ui-datepicker-next {
- right: 2px;
-}
-.ui-datepicker .ui-datepicker-prev-hover {
- left: 1px;
-}
-.ui-datepicker .ui-datepicker-next-hover {
- right: 1px;
-}
-.ui-datepicker .ui-datepicker-prev span,
-.ui-datepicker .ui-datepicker-next span {
- display: block;
- position: absolute;
- left: 50%;
- margin-left: -8px;
- top: 50%;
- margin-top: -8px;
-}
-.ui-datepicker .ui-datepicker-title {
- margin: 0 2.3em;
- line-height: 1.8em;
- text-align: center;
-}
-.ui-datepicker .ui-datepicker-title select {
- font-size: 1em;
- margin: 1px 0;
-}
-.ui-datepicker select.ui-datepicker-month,
-.ui-datepicker select.ui-datepicker-year {
- width: 45%;
-}
-.ui-datepicker table {
- width: 100%;
- font-size: .9em;
- border-collapse: collapse;
- margin: 0 0 .4em;
-}
-.ui-datepicker th {
- padding: .7em .3em;
- text-align: center;
- font-weight: bold;
- border: 0;
-}
-.ui-datepicker td {
- border: 0;
- padding: 1px;
-}
-.ui-datepicker td span,
-.ui-datepicker td a {
- display: block;
- padding: .2em;
- text-align: right;
- text-decoration: none;
-}
-.ui-datepicker .ui-datepicker-buttonpane {
- background-image: none;
- margin: .7em 0 0 0;
- padding: 0 .2em;
- border-left: 0;
- border-right: 0;
- border-bottom: 0;
-}
-.ui-datepicker .ui-datepicker-buttonpane button {
- float: right;
- margin: .5em .2em .4em;
- cursor: pointer;
- padding: .2em .6em .3em .6em;
- width: auto;
- overflow: visible;
-}
-.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
- float: left;
-}
-
-/* with multiple calendars */
-.ui-datepicker.ui-datepicker-multi {
- width: auto;
-}
-.ui-datepicker-multi .ui-datepicker-group {
- float: left;
-}
-.ui-datepicker-multi .ui-datepicker-group table {
- width: 95%;
- margin: 0 auto .4em;
-}
-.ui-datepicker-multi-2 .ui-datepicker-group {
- width: 50%;
-}
-.ui-datepicker-multi-3 .ui-datepicker-group {
- width: 33.3%;
-}
-.ui-datepicker-multi-4 .ui-datepicker-group {
- width: 25%;
-}
-.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
-.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
- border-left-width: 0;
-}
-.ui-datepicker-multi .ui-datepicker-buttonpane {
- clear: left;
-}
-.ui-datepicker-row-break {
- clear: both;
- width: 100%;
- font-size: 0;
-}
-
-/* RTL support */
-.ui-datepicker-rtl {
- direction: rtl;
-}
-.ui-datepicker-rtl .ui-datepicker-prev {
- right: 2px;
- left: auto;
-}
-.ui-datepicker-rtl .ui-datepicker-next {
- left: 2px;
- right: auto;
-}
-.ui-datepicker-rtl .ui-datepicker-prev:hover {
- right: 1px;
- left: auto;
-}
-.ui-datepicker-rtl .ui-datepicker-next:hover {
- left: 1px;
- right: auto;
-}
-.ui-datepicker-rtl .ui-datepicker-buttonpane {
- clear: right;
-}
-.ui-datepicker-rtl .ui-datepicker-buttonpane button {
- float: left;
-}
-.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
-.ui-datepicker-rtl .ui-datepicker-group {
- float: right;
-}
-.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
-.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
- border-right-width: 0;
- border-left-width: 1px;
-}
-.ui-dialog {
- overflow: hidden;
- position: absolute;
- top: 0;
- left: 0;
- padding: .2em;
- outline: 0;
-}
-.ui-dialog .ui-dialog-titlebar {
- padding: .4em 1em;
- position: relative;
-}
-.ui-dialog .ui-dialog-title {
- float: left;
- margin: .1em 0;
- white-space: nowrap;
- width: 90%;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-.ui-dialog .ui-dialog-titlebar-close {
- position: absolute;
- right: .3em;
- top: 50%;
- width: 20px;
- margin: -10px 0 0 0;
- padding: 1px;
- height: 20px;
-}
-.ui-dialog .ui-dialog-content {
- position: relative;
- border: 0;
- padding: .5em 1em;
- background: none;
- overflow: auto;
-}
-.ui-dialog .ui-dialog-buttonpane {
- text-align: left;
- border-width: 1px 0 0 0;
- background-image: none;
- margin-top: .5em;
- padding: .3em 1em .5em .4em;
-}
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
- float: right;
-}
-.ui-dialog .ui-dialog-buttonpane button {
- margin: .5em .4em .5em 0;
- cursor: pointer;
-}
-.ui-dialog .ui-resizable-se {
- width: 12px;
- height: 12px;
- right: -5px;
- bottom: -5px;
- background-position: 16px 16px;
-}
-.ui-draggable .ui-dialog-titlebar {
- cursor: move;
-}
-.ui-menu {
- list-style: none;
- padding: 0;
- margin: 0;
- display: block;
- outline: none;
-}
-.ui-menu .ui-menu {
- position: absolute;
-}
-.ui-menu .ui-menu-item {
- position: relative;
- margin: 0;
- padding: 3px 1em 3px .4em;
- cursor: pointer;
- min-height: 0; /* support: IE7 */
- /* support: IE10, see #8844 */
- list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
-}
-.ui-menu .ui-menu-divider {
- margin: 5px 0;
- height: 0;
- font-size: 0;
- line-height: 0;
- border-width: 1px 0 0 0;
-}
-.ui-menu .ui-state-focus,
-.ui-menu .ui-state-active {
- margin: -1px;
-}
-
-/* icon support */
-.ui-menu-icons {
- position: relative;
-}
-.ui-menu-icons .ui-menu-item {
- padding-left: 2em;
-}
-
-/* left-aligned */
-.ui-menu .ui-icon {
- position: absolute;
- top: 0;
- bottom: 0;
- left: .2em;
- margin: auto 0;
-}
-
-/* right-aligned */
-.ui-menu .ui-menu-icon {
- left: auto;
- right: 0;
-}
-.ui-progressbar {
- height: 2em;
- text-align: left;
- overflow: hidden;
-}
-.ui-progressbar .ui-progressbar-value {
- margin: -1px;
- height: 100%;
-}
-.ui-progressbar .ui-progressbar-overlay {
- background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmo [...]
- height: 100%;
- filter: alpha(opacity=25); /* support: IE8 */
- opacity: 0.25;
-}
-.ui-progressbar-indeterminate .ui-progressbar-value {
- background-image: none;
-}
-.ui-selectmenu-menu {
- padding: 0;
- margin: 0;
- position: absolute;
- top: 0;
- left: 0;
- display: none;
-}
-.ui-selectmenu-menu .ui-menu {
- overflow: auto;
- /* Support: IE7 */
- overflow-x: hidden;
- padding-bottom: 1px;
-}
-.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
- font-size: 1em;
- font-weight: bold;
- line-height: 1.5;
- padding: 2px 0.4em;
- margin: 0.5em 0 0 0;
- height: auto;
- border: 0;
-}
-.ui-selectmenu-open {
- display: block;
-}
-.ui-selectmenu-button {
- display: inline-block;
- overflow: hidden;
- position: relative;
- text-decoration: none;
- cursor: pointer;
-}
-.ui-selectmenu-button span.ui-icon {
- right: 0.5em;
- left: auto;
- margin-top: -8px;
- position: absolute;
- top: 50%;
-}
-.ui-selectmenu-button span.ui-selectmenu-text {
- text-align: left;
- padding: 0.4em 2.1em 0.4em 1em;
- display: block;
- line-height: 1.4;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-.ui-slider {
- position: relative;
- text-align: left;
-}
-.ui-slider .ui-slider-handle {
- position: absolute;
- z-index: 2;
- width: 1.2em;
- height: 1.2em;
- cursor: default;
- -ms-touch-action: none;
- touch-action: none;
-}
-.ui-slider .ui-slider-range {
- position: absolute;
- z-index: 1;
- font-size: .7em;
- display: block;
- border: 0;
- background-position: 0 0;
-}
-
-/* support: IE8 - See #6727 */
-.ui-slider.ui-state-disabled .ui-slider-handle,
-.ui-slider.ui-state-disabled .ui-slider-range {
- filter: inherit;
-}
-
-.ui-slider-horizontal {
- height: .8em;
-}
-.ui-slider-horizontal .ui-slider-handle {
- top: -.3em;
- margin-left: -.6em;
-}
-.ui-slider-horizontal .ui-slider-range {
- top: 0;
- height: 100%;
-}
-.ui-slider-horizontal .ui-slider-range-min {
- left: 0;
-}
-.ui-slider-horizontal .ui-slider-range-max {
- right: 0;
-}
-
-.ui-slider-vertical {
- width: .8em;
- height: 100px;
-}
-.ui-slider-vertical .ui-slider-handle {
- left: -.3em;
- margin-left: 0;
- margin-bottom: -.6em;
-}
-.ui-slider-vertical .ui-slider-range {
- left: 0;
- width: 100%;
-}
-.ui-slider-vertical .ui-slider-range-min {
- bottom: 0;
-}
-.ui-slider-vertical .ui-slider-range-max {
- top: 0;
-}
-.ui-spinner {
- position: relative;
- display: inline-block;
- overflow: hidden;
- padding: 0;
- vertical-align: middle;
-}
-.ui-spinner-input {
- border: none;
- background: none;
- color: inherit;
- padding: 0;
- margin: .2em 0;
- vertical-align: middle;
- margin-left: .4em;
- margin-right: 22px;
-}
-.ui-spinner-button {
- width: 16px;
- height: 50%;
- font-size: .5em;
- padding: 0;
- margin: 0;
- text-align: center;
- position: absolute;
- cursor: default;
- display: block;
- overflow: hidden;
- right: 0;
-}
-/* more specificity required here to override default borders */
-.ui-spinner a.ui-spinner-button {
- border-top: none;
- border-bottom: none;
- border-right: none;
-}
-/* vertically center icon */
-.ui-spinner .ui-icon {
- position: absolute;
- margin-top: -8px;
- top: 50%;
- left: 0;
-}
-.ui-spinner-up {
- top: 0;
-}
-.ui-spinner-down {
- bottom: 0;
-}
-
-/* TR overrides */
-.ui-spinner .ui-icon-triangle-1-s {
- /* need to fix icons sprite */
- background-position: -65px -16px;
-}
-.ui-tabs {
- position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
- padding: .2em;
-}
-.ui-tabs .ui-tabs-nav {
- margin: 0;
- padding: .2em .2em 0;
-}
-.ui-tabs .ui-tabs-nav li {
- list-style: none;
- float: left;
- position: relative;
- top: 0;
- margin: 1px .2em 0 0;
- border-bottom-width: 0;
- padding: 0;
- white-space: nowrap;
-}
-.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
- float: left;
- padding: .5em 1em;
- text-decoration: none;
-}
-.ui-tabs .ui-tabs-nav li.ui-tabs-active {
- margin-bottom: -1px;
- padding-bottom: 1px;
-}
-.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
-.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
-.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
- cursor: text;
-}
-.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
- cursor: pointer;
-}
-.ui-tabs .ui-tabs-panel {
- display: block;
- border-width: 0;
- padding: 1em 1.4em;
- background: none;
-}
-.ui-tooltip {
- padding: 8px;
- position: absolute;
- z-index: 9999;
- max-width: 300px;
- -webkit-box-shadow: 0 0 5px #aaa;
- box-shadow: 0 0 5px #aaa;
-}
-body .ui-tooltip {
- border-width: 2px;
-}
diff --git a/traffic_ops/app/public/css/jquery.tree.min.css b/traffic_ops/app/public/css/jquery.tree.min.css
deleted file mode 100644
index db1d6d9..0000000
--- a/traffic_ops/app/public/css/jquery.tree.min.css
+++ /dev/null
@@ -1 +0,0 @@
-.daredevel-tree li{list-style-type:none;position:relative}.daredevel-tree li span.daredevel-tree-label{cursor:default;z-index:1}.daredevel-tree li span.daredevel-tree-anchor{cursor:default;position:absolute;top:1px;left:-16px}.daredevel-tree li span.prepended{position:absolute;left:0;top:-5px;z-index:2;visibility:hidden;height:10px;width:100px;overflow:hidden;background-image:url("/images/anchor.gif")}.daredevel-tree li span.prepended.over{visibility:visible}.daredevel-tree li span.dropp [...]
diff --git a/traffic_ops/app/public/css/select2.css b/traffic_ops/app/public/css/select2.css
deleted file mode 100644
index c695925..0000000
--- a/traffic_ops/app/public/css/select2.css
+++ /dev/null
@@ -1,704 +0,0 @@
-/*
-Version: 3.5.1 Timestamp: Tue Jul 22 18:58:56 EDT 2014
-*/
-.select2-container {
- margin: 0;
- position: relative;
- display: inline-block;
- /* inline-block for ie7 */
- zoom: 1;
- *display: inline;
- vertical-align: middle;
-}
-
-.select2-container,
-.select2-drop,
-.select2-search,
-.select2-search input {
- /*
- Force border-box so that % widths fit the parent
- container without overlap because of margin/padding.
- More Info : http://www.quirksmode.org/css/box.html
- */
- -webkit-box-sizing: border-box; /* webkit */
- -moz-box-sizing: border-box; /* firefox */
- box-sizing: border-box; /* css3 */
-}
-
-.select2-container .select2-choice {
- display: block;
- height: 26px;
- padding: 0 0 0 8px;
- overflow: hidden;
- position: relative;
-
- border: 1px solid #aaa;
- white-space: nowrap;
- line-height: 26px;
- color: #444;
- text-decoration: none;
-
- border-radius: 4px;
-
- background-clip: padding-box;
-
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-
- background-color: #fff;
- background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.5, #fff));
- background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 50%);
- background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 50%);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
- background-image: linear-gradient(to top, #eee 0%, #fff 50%);
-}
-
-html[dir="rtl"] .select2-container .select2-choice {
- padding: 0 8px 0 0;
-}
-
-.select2-container.select2-drop-above .select2-choice {
- border-bottom-color: #aaa;
-
- border-radius: 0 0 4px 4px;
-
- background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.9, #fff));
- background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 90%);
- background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 90%);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);
- background-image: linear-gradient(to bottom, #eee 0%, #fff 90%);
-}
-
-.select2-container.select2-allowclear .select2-choice .select2-chosen {
- margin-right: 42px;
-}
-
-.select2-container .select2-choice > .select2-chosen {
- margin-right: 26px;
- display: block;
- overflow: hidden;
-
- white-space: nowrap;
-
- text-overflow: ellipsis;
- float: none;
- width: auto;
-}
-
-html[dir="rtl"] .select2-container .select2-choice > .select2-chosen {
- margin-left: 26px;
- margin-right: 0;
-}
-
-.select2-container .select2-choice abbr {
- display: none;
- width: 12px;
- height: 12px;
- position: absolute;
- right: 24px;
- top: 8px;
-
- font-size: 1px;
- text-decoration: none;
-
- border: 0;
- background: url('/images/select2.png') right top no-repeat;
- cursor: pointer;
- outline: 0;
-}
-
-.select2-container.select2-allowclear .select2-choice abbr {
- display: inline-block;
-}
-
-.select2-container .select2-choice abbr:hover {
- background-position: right -11px;
- cursor: pointer;
-}
-
-.select2-drop-mask {
- border: 0;
- margin: 0;
- padding: 0;
- position: fixed;
- left: 0;
- top: 0;
- min-height: 100%;
- min-width: 100%;
- height: auto;
- width: auto;
- opacity: 0;
- z-index: 9998;
- /* styles required for IE to work */
- background-color: #fff;
- filter: alpha(opacity=0);
-}
-
-.select2-drop {
- width: 100%;
- margin-top: -1px;
- position: absolute;
- z-index: 9999;
- top: 100%;
-
- background: #fff;
- color: #000;
- border: 1px solid #aaa;
- border-top: 0;
-
- border-radius: 0 0 4px 4px;
-
- -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
- box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
-}
-
-.select2-drop.select2-drop-above {
- margin-top: 1px;
- border-top: 1px solid #aaa;
- border-bottom: 0;
-
- border-radius: 4px 4px 0 0;
-
- -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
- box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
-}
-
-.select2-drop-active {
- border: 1px solid #5897fb;
- border-top: none;
-}
-
-.select2-drop.select2-drop-above.select2-drop-active {
- border-top: 1px solid #5897fb;
-}
-
-.select2-drop-auto-width {
- border-top: 1px solid #aaa;
- width: auto;
-}
-
-.select2-drop-auto-width .select2-search {
- padding-top: 4px;
-}
-
-.select2-container .select2-choice .select2-arrow {
- display: inline-block;
- width: 18px;
- height: 100%;
- position: absolute;
- right: 0;
- top: 0;
-
- border-left: 1px solid #aaa;
- border-radius: 0 4px 4px 0;
-
- background-clip: padding-box;
-
- background: #ccc;
- background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
- background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
- background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0);
- background-image: linear-gradient(to top, #ccc 0%, #eee 60%);
-}
-
-html[dir="rtl"] .select2-container .select2-choice .select2-arrow {
- left: 0;
- right: auto;
-
- border-left: none;
- border-right: 1px solid #aaa;
- border-radius: 4px 0 0 4px;
-}
-
-.select2-container .select2-choice .select2-arrow b {
- display: block;
- width: 100%;
- height: 100%;
- background: url('/images/select2.png') no-repeat 0 1px;
-}
-
-html[dir="rtl"] .select2-container .select2-choice .select2-arrow b {
- background-position: 2px 1px;
-}
-
-.select2-search {
- display: inline-block;
- width: 100%;
- min-height: 26px;
- margin: 0;
- padding-left: 4px;
- padding-right: 4px;
-
- position: relative;
- z-index: 10000;
-
- white-space: nowrap;
-}
-
-.select2-search input {
- width: 100%;
- height: auto !important;
- min-height: 26px;
- padding: 4px 20px 4px 5px;
- margin: 0;
-
- outline: 0;
- font-family: sans-serif;
- font-size: 1em;
-
- border: 1px solid #aaa;
- border-radius: 0;
-
- -webkit-box-shadow: none;
- box-shadow: none;
-
- background: #fff url('/images/select2.png') no-repeat 100% -22px;
- background: url('/images/select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
- background: url('/images/select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
- background: url('/images/select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
- background: url('/images/select2.png') no-repeat 100% -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
-}
-
-html[dir="rtl"] .select2-search input {
- padding: 4px 5px 4px 20px;
-
- background: #fff url('/images/select2.png') no-repeat -37px -22px;
- background: url('/images/select2.png') no-repeat -37px -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
- background: url('/images/select2.png') no-repeat -37px -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
- background: url('/images/select2.png') no-repeat -37px -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
- background: url('/images/select2.png') no-repeat -37px -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
-}
-
-.select2-drop.select2-drop-above .select2-search input {
- margin-top: 4px;
-}
-
-.select2-search input.select2-active {
- background: #fff url('/images/select2-spinner.gif') no-repeat 100%;
- background: url('/images/select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
- background: url('/images/select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
- background: url('/images/select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
- background: url('/images/select2-spinner.gif') no-repeat 100%, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
-}
-
-.select2-container-active .select2-choice,
-.select2-container-active .select2-choices {
- border: 1px solid #5897fb;
- outline: none;
-
- -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
- box-shadow: 0 0 5px rgba(0, 0, 0, .3);
-}
-
-.select2-dropdown-open .select2-choice {
- border-bottom-color: transparent;
- -webkit-box-shadow: 0 1px 0 #fff inset;
- box-shadow: 0 1px 0 #fff inset;
-
- border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
-
- background-color: #eee;
- background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #fff), color-stop(0.5, #eee));
- background-image: -webkit-linear-gradient(center bottom, #fff 0%, #eee 50%);
- background-image: -moz-linear-gradient(center bottom, #fff 0%, #eee 50%);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
- background-image: linear-gradient(to top, #fff 0%, #eee 50%);
-}
-
-.select2-dropdown-open.select2-drop-above .select2-choice,
-.select2-dropdown-open.select2-drop-above .select2-choices {
- border: 1px solid #5897fb;
- border-top-color: transparent;
-
- background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(0.5, #eee));
- background-image: -webkit-linear-gradient(center top, #fff 0%, #eee 50%);
- background-image: -moz-linear-gradient(center top, #fff 0%, #eee 50%);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
- background-image: linear-gradient(to bottom, #fff 0%, #eee 50%);
-}
-
-.select2-dropdown-open .select2-choice .select2-arrow {
- background: transparent;
- border-left: none;
- filter: none;
-}
-html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow {
- border-right: none;
-}
-
-.select2-dropdown-open .select2-choice .select2-arrow b {
- background-position: -18px 1px;
-}
-
-html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow b {
- background-position: -16px 1px;
-}
-
-.select2-hidden-accessible {
- border: 0;
- clip: rect(0 0 0 0);
- height: 1px;
- margin: -1px;
- overflow: hidden;
- padding: 0;
- position: absolute;
- width: 1px;
-}
-
-/* results */
-.select2-results {
- max-height: 200px;
- padding: 0 0 0 4px;
- margin: 4px 4px 4px 0;
- position: relative;
- overflow-x: hidden;
- overflow-y: auto;
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-}
-
-html[dir="rtl"] .select2-results {
- padding: 0 4px 0 0;
- margin: 4px 0 4px 4px;
-}
-
-.select2-results ul.select2-result-sub {
- margin: 0;
- padding-left: 0;
-}
-
-.select2-results li {
- list-style: none;
- display: list-item;
- background-image: none;
-}
-
-.select2-results li.select2-result-with-children > .select2-result-label {
- font-weight: bold;
-}
-
-.select2-results .select2-result-label {
- padding: 3px 7px 4px;
- margin: 0;
- cursor: pointer;
-
- min-height: 1em;
-
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-
-.select2-results-dept-1 .select2-result-label { padding-left: 20px }
-.select2-results-dept-2 .select2-result-label { padding-left: 40px }
-.select2-results-dept-3 .select2-result-label { padding-left: 60px }
-.select2-results-dept-4 .select2-result-label { padding-left: 80px }
-.select2-results-dept-5 .select2-result-label { padding-left: 100px }
-.select2-results-dept-6 .select2-result-label { padding-left: 110px }
-.select2-results-dept-7 .select2-result-label { padding-left: 120px }
-
-.select2-results .select2-highlighted {
- background: #3875d7;
- color: #fff;
-}
-
-.select2-results li em {
- background: #feffde;
- font-style: normal;
-}
-
-.select2-results .select2-highlighted em {
- background: transparent;
-}
-
-.select2-results .select2-highlighted ul {
- background: #fff;
- color: #000;
-}
-
-.select2-results .select2-no-results,
-.select2-results .select2-searching,
-.select2-results .select2-ajax-error,
-.select2-results .select2-selection-limit {
- background: #f4f4f4;
- display: list-item;
- padding-left: 5px;
-}
-
-/*
-disabled look for disabled choices in the results dropdown
-*/
-.select2-results .select2-disabled.select2-highlighted {
- color: #666;
- background: #f4f4f4;
- display: list-item;
- cursor: default;
-}
-.select2-results .select2-disabled {
- background: #f4f4f4;
- display: list-item;
- cursor: default;
-}
-
-.select2-results .select2-selected {
- display: none;
-}
-
-.select2-more-results.select2-active {
- background: #f4f4f4 url('/images/select2-spinner.gif') no-repeat 100%;
-}
-
-.select2-results .select2-ajax-error {
- background: rgba(255, 50, 50, .2);
-}
-
-.select2-more-results {
- background: #f4f4f4;
- display: list-item;
-}
-
-/* disabled styles */
-
-.select2-container.select2-container-disabled .select2-choice {
- background-color: #f4f4f4;
- background-image: none;
- border: 1px solid #ddd;
- cursor: default;
-}
-
-.select2-container.select2-container-disabled .select2-choice .select2-arrow {
- background-color: #f4f4f4;
- background-image: none;
- border-left: 0;
-}
-
-.select2-container.select2-container-disabled .select2-choice abbr {
- display: none;
-}
-
-
-/* multiselect */
-
-.select2-container-multi .select2-choices {
- height: auto !important;
- height: 1%;
- margin: 0;
- padding: 0 5px 0 0;
- position: relative;
-
- border: 1px solid #aaa;
- cursor: text;
- overflow: hidden;
-
- background-color: #fff;
- background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eee), color-stop(15%, #fff));
- background-image: -webkit-linear-gradient(top, #eee 1%, #fff 15%);
- background-image: -moz-linear-gradient(top, #eee 1%, #fff 15%);
- background-image: linear-gradient(to bottom, #eee 1%, #fff 15%);
-}
-
-html[dir="rtl"] .select2-container-multi .select2-choices {
- padding: 0 0 0 5px;
-}
-
-.select2-locked {
- padding: 3px 5px 3px 5px !important;
-}
-
-.select2-container-multi .select2-choices {
- min-height: 26px;
-}
-
-.select2-container-multi.select2-container-active .select2-choices {
- border: 1px solid #5897fb;
- outline: none;
-
- -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
- box-shadow: 0 0 5px rgba(0, 0, 0, .3);
-}
-.select2-container-multi .select2-choices li {
- float: left;
- list-style: none;
-}
-html[dir="rtl"] .select2-container-multi .select2-choices li
-{
- float: right;
-}
-.select2-container-multi .select2-choices .select2-search-field {
- margin: 0;
- padding: 0;
- white-space: nowrap;
-}
-
-.select2-container-multi .select2-choices .select2-search-field input {
- padding: 5px;
- margin: 1px 0;
-
- font-family: sans-serif;
- font-size: 100%;
- color: #666;
- outline: 0;
- border: 0;
- -webkit-box-shadow: none;
- box-shadow: none;
- background: transparent !important;
-}
-
-.select2-container-multi .select2-choices .select2-search-field input.select2-active {
- background: #fff url('/images/select2-spinner.gif') no-repeat 100% !important;
-}
-
-.select2-default {
- color: #999 !important;
-}
-
-.select2-container-multi .select2-choices .select2-search-choice {
- padding: 3px 5px 3px 18px;
- margin: 3px 0 3px 5px;
- position: relative;
-
- line-height: 13px;
- color: #333;
- cursor: default;
- border: 1px solid #aaaaaa;
-
- border-radius: 3px;
-
- -webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
- box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
-
- background-clip: padding-box;
-
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-
- background-color: #e4e4e4;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0);
- background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee));
- background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
- background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
- background-image: linear-gradient(to top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
-}
-html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice
-{
- margin: 3px 5px 3px 0;
- padding: 3px 18px 3px 5px;
-}
-.select2-container-multi .select2-choices .select2-search-choice .select2-chosen {
- cursor: default;
-}
-.select2-container-multi .select2-choices .select2-search-choice-focus {
- background: #d4d4d4;
-}
-
-.select2-search-choice-close {
- display: block;
- width: 12px;
- height: 13px;
- position: absolute;
- right: 3px;
- top: 4px;
-
- font-size: 1px;
- outline: none;
- background: url('/images/select2.png') right top no-repeat;
-}
-html[dir="rtl"] .select2-search-choice-close {
- right: auto;
- left: 3px;
-}
-
-.select2-container-multi .select2-search-choice-close {
- left: 3px;
-}
-
-html[dir="rtl"] .select2-container-multi .select2-search-choice-close {
- left: auto;
- right: 2px;
-}
-
-.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
- background-position: right -11px;
-}
-.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
- background-position: right -11px;
-}
-
-/* disabled styles */
-.select2-container-multi.select2-container-disabled .select2-choices {
- background-color: #f4f4f4;
- background-image: none;
- border: 1px solid #ddd;
- cursor: default;
-}
-
-.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
- padding: 3px 5px 3px 5px;
- border: 1px solid #ddd;
- background-image: none;
- background-color: #f4f4f4;
-}
-
-.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { display: none;
- background: none;
-}
-/* end multiselect */
-
-
-.select2-result-selectable .select2-match,
-.select2-result-unselectable .select2-match {
- text-decoration: underline;
-}
-
-.select2-offscreen, .select2-offscreen:focus {
- clip: rect(0 0 0 0) !important;
- width: 1px !important;
- height: 1px !important;
- border: 0 !important;
- margin: 0 !important;
- padding: 0 !important;
- overflow: hidden !important;
- position: absolute !important;
- outline: 0 !important;
- left: 0px !important;
- top: 0px !important;
-}
-
-.select2-display-none {
- display: none;
-}
-
-.select2-measure-scrollbar {
- position: absolute;
- top: -10000px;
- left: -10000px;
- width: 100px;
- height: 100px;
- overflow: scroll;
-}
-
-/* Retina-ize icons */
-
-@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 2dppx) {
- .select2-search input,
- .select2-search-choice-close,
- .select2-container .select2-choice abbr,
- .select2-container .select2-choice .select2-arrow b {
- background-image: url('/images/select2x2.png') !important;
- background-repeat: no-repeat !important;
- background-size: 60px 40px !important;
- }
-
- .select2-search input {
- background-position: 100% -21px !important;
- }
-}
diff --git a/traffic_ops/app/public/css/site.css b/traffic_ops/app/public/css/site.css
deleted file mode 100644
index e42baae..0000000
--- a/traffic_ops/app/public/css/site.css
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
-
-input:focus, select:focus, textarea:focus{background-image:url("/images/input_field_background.png");-webkit-border-radius:0px;-moz-border-radius:0px;border-radius:0px;border-color: rgba(82, 168, 236, 0.8); -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);}
-
-/* blue = #2e7db2, orange = #ffc73d*/
-table { color: white }
-th:nth-child(odd), tr:nth-child(odd) { background: #222222; }
-th:nth-child(even), tr:nth-child(even) { background: #111111; }
-tr:hover {background: #2e7db2 ; outline: #ffc73d}
-/*thead { font-weight: bold; }*/
-thead.bul { font-weight: bold; text-decoration: underline; }
-
-a:link, a:visited { color: #eeeeee; text-decoration: underline; }
-div.right { float: right; }
-
-/* JvD added for login thingie */
-.ui-tab-float-right-on-table{
- float: right;
- margin: 7px;
- color:#FFFFFF;
-}
-h1, h2, h3 {
- color: white;
-
-}
-
-table.dataTable td {
- padding-right: 10px;
- padding-left: 0px;
- padding-top: 1px;
- padding-bottom: 0px;
-}
-
-body{
- margin-top: 0;
- margin-bottom: 0;
- margin-left: 0;
- margin-left: 0;
- background-color:#010101;
-}
-
-body#edge_health a#nav-eh
-{
- background:#0972A5;
- color:#ff00ff;
- font-size: 11px;
- width:90px;
-}
-
-
-body#delivery_services a#nav-ds,
-body#servers a#nav-s,
-body#parameters a#nav-p,
-body#tools a#nav-t,
-body#misc a#nav-mi,
-body#log a#nav-l
-{
- background:#0972A5;
- color:#ffffff;
- font-size: 11px;
- width:90px;
-}
-
-.mark {
- display: inline-block;
- /*background-color: #322f32;*/
- background-color: #000000;
- margin: 10px;
- padding: 10px;
- border-color: #322f32;
- border-style:solid;
- border-width:1px;
- border-top-left-radius: 1px;
- border-bottom-left-radius: 1px;
- border-top-right-radius: 1px;
- border-bottom-right-radius: 1px;
- width: 90%;
- text-color: white;
-}
-
-.required {
- width: .1%;
-}
-.user_form_fields{
- width:500px;
-}
-.table td{
- width: 30px;
-}
-.label td{
- padding:2px;
- width:20px;
-}
-.disabled_field {
- background-color: black; color:white;
-}
-.field, .field input textarea{
- padding:5px;
- width:45%;
-}
-
-.readonly_field, .readonly_field input textarea{
- padding:5px;
- background-color: gray;
- width:45%;
- /*color:white;*/
-}
-
-.dialog_body {
- width:650px;
-}
-.input_field {
- width:100%;
-}
-
-.field-with-error {
- color: red;
-}
-
-div.form-row {
- margin-bottom: 1em;
-}
-
-div.block{
- overflow:hidden;
- background-color:#222222;
-}
-div.block label{
- width:40%;
- display:block;
- float:left;
- text-align:left;
- color: white;
- padding:5px;
-}
-div.block .input{
- margin-left:4px;
- float:left;
-}
-div.block .textarea{
- margin-left:4px;
- margin-bottom:4px;
- float:left;
- width:483px;
- height:100px;
-}
-.main { margin-top:10px;}
-.popup { padding-left: 10px; height: 650px; width: 900px; margin-top:10px;}
-.send_registration_popup { height: 140px; width: 300px;}
-.fancybox.iframe { padding: 3px; }
-.fancybox-skin { padding: 3px; height: 200px; }
-
-.flash-section{
- overflow-y: auto; overflow-x: hidden; margin-left: 10px; margin-top: 10px; width: 40%; padding: 10px; background: #2682AF; color:white; border:1px solid #aaa;border:1px solid #d7d7d7;-moz-box-shadow: 3px 3px 4px #000; -webkit-box-shadow: 3px 3px 4px #000; box-shadow: 3px 3px 4px #000;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-transition:all .1s ease-in;
-}
-
-.error-section {
- overflow-y: auto; overflow-x: hidden; height: 30px; width: 60%; padding: 10px; background: white; color: red; border:1px solid #aaa;border:1px solid #d7d7d7;-moz-box-shadow: 3px 3px 4px #000; -webkit-box-shadow: 3px 3px 4px #000; box-shadow: 3px 3px 4px #000;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-transition:all .1s ease-in;
-}
-
-
-.deliveryServicesWidget { width: 550px; }
-
-.bottomButtons { margin-top: 10px; }
-
-div.button, a.button, .button:hover{ border-color: rgba(82, 168, 236, 0.8); -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); background-position: 0 -15px; cursor: pointer; text-decoration: none; text-align; center;}
-a.button, .button{ -moz-border-bottom-colors: none; -moz-border-image: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; -moz-transition: all 0.1s linear 0s; border-radius: 4px 4px 4px 4px; border-style: solid; border-width: 1px; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); display: inline-block; font-size: 13px; line-height: normal; padding: 5px 14px 6px; background-color: #1D7DAC; background-image: - [...]
-div.disabled_button, a.disabled_button, .disabled_button:hover{ border-color: rgba(82, 168, 236, 0.8); -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); background-position: 0 -15px; cursor: not-allowed; text-decoration: none; text-align; center;}
-a.disabled_button, .disabled_button{ -moz-border-bottom-colors: none; -moz-border-image: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; -moz-transition: all 0.1s linear 0s; border-radius: 4px 4px 4px 4px; border-style: solid; border-width: 1px; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); display: inline-block; font-size: 13px; line-height: normal; padding: 5px 14px 6px; background-color: #0E3E56; b [...]
-
-.ui-autocomplete-loading {
- background: white url("images/ui-anim_basic_16x16.gif") right center no-repeat;
-}
-.ui-autocomplete {
- max-height: 300px;
- overflow-y: auto;
- /* prevent horizontal scrollbar */
- overflow-x: hidden;
- }
- /* IE 6 doesn't support max-height
- * we use height instead, but this forces the menu to always be this tall
- */
-
-* html .ui-autocomplete {
- height: 300px;
-}
-.select2-container {color: black; width:480px; }
-.select2-results { font-size: 13px; }
-.fancybox-skin {
- background: transparent;
- box-shadow: none !important;
-}
-
-.ui-accordion {
- margin-left: 18px;
- margin-right: 18px;
- margin-top: 18px;
- margin-bottom: 18px;
-}
-/* cyrillic-ext */
-@font-face {
- font-family: 'Roboto';
- font-style: normal;
- font-weight: 400;
- src: local('Roboto'), local('Roboto-Regular'), url(/fonts/sTdaA6j0Psb920Vjv-mrzH-_kf6ByYO6CLYdB4HQE-Y.woff2) format('woff2');
- unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
-}
-/* cyrillic */
-@font-face {
- font-family: 'Roboto';
- font-style: normal;
- font-weight: 400;
- src: local('Roboto'), local('Roboto-Regular'), url(/fonts/uYECMKoHcO9x1wdmbyHIm3-_kf6ByYO6CLYdB4HQE-Y.woff2) format('woff2');
- unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
-}
-/* greek-ext */
-@font-face {
- font-family: 'Roboto';
- font-style: normal;
- font-weight: 400;
- src: local('Roboto'), local('Roboto-Regular'), url(/fonts/tnj4SB6DNbdaQnsM8CFqBX-_kf6ByYO6CLYdB4HQE-Y.woff2) format('woff2');
- unicode-range: U+1F00-1FFF;
-}
-/* greek */
-@font-face {
- font-family: 'Roboto';
- font-style: normal;
- font-weight: 400;
- src: local('Roboto'), local('Roboto-Regular'), url(/fonts/_VYFx-s824kXq_Ul2BHqYH-_kf6ByYO6CLYdB4HQE-Y.woff2) format('woff2');
- unicode-range: U+0370-03FF;
-}
-/* vietnamese */
-@font-face {
- font-family: 'Roboto';
- font-style: normal;
- font-weight: 400;
- src: local('Roboto'), local('Roboto-Regular'), url(/fonts/NJ4vxlgWwWbEsv18dAhqnn-_kf6ByYO6CLYdB4HQE-Y.woff2) format('woff2');
- unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
-}
-/* latin-ext */
-@font-face {
- font-family: 'Roboto';
- font-style: normal;
- font-weight: 400;
- src: local('Roboto'), local('Roboto-Regular'), url(/fonts/Ks_cVxiCiwUWVsFWFA3Bjn-_kf6ByYO6CLYdB4HQE-Y.woff2) format('woff2');
- unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
-}
-/* latin */
-@font-face {
- font-family: 'Roboto';
- font-style: normal;
- font-weight: 400;
- src: local('Roboto'), local('Roboto-Regular'), url(/fonts/oMMgfZMQthOryQo9n22dcuvvDin1pK8aKteLpeZ5c0A.woff2) format('woff2');
- unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
-}
-
-.jMenu ul {
- width: 120px !important;
- text-align: center !important;
-}
-
-.jMenu li {
- text-align: center !important;
- display: inline-block !important;
- background-color: #000000 !important;
- font-size: 12px !important;
- margin: 0px !important;
- border-color: #322f32 !important;
- border-style:solid !important;
- border-width:1px !important;
- border-top-left-radius: 1px !important;
- border-bottom-left-radius: 1px !important;
- border-top-right-radius: 1px !important;
- border-bottom-right-radius: 1px !important;
- width: 120px !important;
-}
-
-.jMenu li a {
- color: white !important;
- text-decoration:none !important;
- border-top-left-radius: 1px !important;
- border-bottom-left-radius: 1px !important;
- border-top-right-radius: 1px !important;
- border-bottom-right-radius: 1px !important;
- text-align: center !important;
- text-transform: none !important;
- text-align: center !important;
- font-size: 10px !important;
- border-color: #322f32 !important;
- border-style:solid !important;
- border-width:1px !important;
-}
-
-.jMenu li ul li a:hover {
- background-color: #322f32 !important;
-}
-.tickLabel {
- color: white !important;
-}
-.ui-dialog .ui-dialog-titlebar-close span { display: block; }
-
-.deprecatedBar {
- border-bottom: solid 2px #000;
- padding: 3px 0;
- text-align: left;
- color: red;
- font-size: 20px;
-}
diff --git a/traffic_ops/app/public/favicon.ico b/traffic_ops/app/public/favicon.ico
deleted file mode 100644
index b0a7633..0000000
Binary files a/traffic_ops/app/public/favicon.ico and /dev/null differ
diff --git a/traffic_ops/app/public/good.csv b/traffic_ops/app/public/good.csv
deleted file mode 100644
index 24f721e..0000000
--- a/traffic_ops/app/public/good.csv
+++ /dev/null
@@ -1,2 +0,0 @@
-HEADER: host_name,domain_name,interface_name,ip_address,ip_netmask,ip_gateway,ip6_address,ip6_gateway,interface_mtu,cdn_name,cachegroup,phys_location,rack,type,profile,tcp_port,mgmt_ip_address,mgmt_ip_netmask,mgmt_ip_gateway,ilo_ip_address,ilo_ip_netmask,ilo_ip_gateway,ilo_username,ilo_password,router_host_name,router_port_name,https_port,offline_reason
-"hostname1","domain.net","eth1","127.0.0.1","255.255.255.0","127.0.0.1",,,"1500","ALL","cachegroup1","location1",,"EDGE","profile1","8088",,,,,,,,,,,,"N/A"
diff --git a/traffic_ops/app/public/images/anchor.gif b/traffic_ops/app/public/images/anchor.gif
deleted file mode 100644
index 2e011b9..0000000
Binary files a/traffic_ops/app/public/images/anchor.gif and /dev/null differ
diff --git a/traffic_ops/app/public/images/bad.png b/traffic_ops/app/public/images/bad.png
deleted file mode 100644
index 485e3da..0000000
Binary files a/traffic_ops/app/public/images/bad.png and /dev/null differ
diff --git a/traffic_ops/app/public/images/blank.png b/traffic_ops/app/public/images/blank.png
deleted file mode 100644
index 1c87878..0000000
Binary files a/traffic_ops/app/public/images/blank.png and /dev/null differ
diff --git a/traffic_ops/app/public/images/clock-black.png b/traffic_ops/app/public/images/clock-black.png
deleted file mode 100644
index 4783c01..0000000
Binary files a/traffic_ops/app/public/images/clock-black.png and /dev/null differ
diff --git a/traffic_ops/app/public/images/clock.png b/traffic_ops/app/public/images/clock.png
deleted file mode 100644
index a4a5f1f..0000000
Binary files a/traffic_ops/app/public/images/clock.png and /dev/null differ
diff --git a/traffic_ops/app/public/images/good.png b/traffic_ops/app/public/images/good.png
deleted file mode 100644
index 84d96cd..0000000
Binary files a/traffic_ops/app/public/images/good.png and /dev/null differ
diff --git a/traffic_ops/app/public/images/graph.png b/traffic_ops/app/public/images/graph.png
deleted file mode 100644
index 4502a2d..0000000
Binary files a/traffic_ops/app/public/images/graph.png and /dev/null differ
diff --git a/traffic_ops/app/public/images/info.png b/traffic_ops/app/public/images/info.png
deleted file mode 100644
index 3e1125c..0000000
Binary files a/traffic_ops/app/public/images/info.png and /dev/null differ
diff --git a/traffic_ops/app/public/images/input_field_background.png b/traffic_ops/app/public/images/input_field_background.png
deleted file mode 100644
index 195449a..0000000
Binary files a/traffic_ops/app/public/images/input_field_background.png and /dev/null differ
diff --git a/traffic_ops/app/public/images/na.png b/traffic_ops/app/public/images/na.png
deleted file mode 100644
index 672ffa2..0000000
Binary files a/traffic_ops/app/public/images/na.png and /dev/null differ
diff --git a/traffic_ops/app/public/images/notrun.png b/traffic_ops/app/public/images/notrun.png
deleted file mode 100644
index 6a63c8d..0000000
Binary files a/traffic_ops/app/public/images/notrun.png and /dev/null differ
diff --git a/traffic_ops/app/public/images/select2-spinner.gif b/traffic_ops/app/public/images/select2-spinner.gif
deleted file mode 100644
index 5b33f7e..0000000
Binary files a/traffic_ops/app/public/images/select2-spinner.gif and /dev/null differ
diff --git a/traffic_ops/app/public/images/select2.png b/traffic_ops/app/public/images/select2.png
deleted file mode 100644
index 1d804ff..0000000
Binary files a/traffic_ops/app/public/images/select2.png and /dev/null differ
diff --git a/traffic_ops/app/public/images/select2x2.png b/traffic_ops/app/public/images/select2x2.png
deleted file mode 100644
index 4bdd5c9..0000000
Binary files a/traffic_ops/app/public/images/select2x2.png and /dev/null differ
diff --git a/traffic_ops/app/public/images/spinner-small.gif b/traffic_ops/app/public/images/spinner-small.gif
deleted file mode 100644
index d0bce15..0000000
Binary files a/traffic_ops/app/public/images/spinner-small.gif and /dev/null differ
diff --git a/traffic_ops/app/public/images/tc_logo.png b/traffic_ops/app/public/images/tc_logo.png
deleted file mode 100644
index 9ea6966..0000000
Binary files a/traffic_ops/app/public/images/tc_logo.png and /dev/null differ
diff --git a/traffic_ops/app/public/images/tc_logo_c_only.png b/traffic_ops/app/public/images/tc_logo_c_only.png
deleted file mode 100644
index 749fd7f..0000000
Binary files a/traffic_ops/app/public/images/tc_logo_c_only.png and /dev/null differ
diff --git a/traffic_ops/app/public/images/traffic_operations_logo.png b/traffic_ops/app/public/images/traffic_operations_logo.png
deleted file mode 100644
index 14b796d..0000000
Binary files a/traffic_ops/app/public/images/traffic_operations_logo.png and /dev/null differ
diff --git a/traffic_ops/app/public/images/warning.png b/traffic_ops/app/public/images/warning.png
deleted file mode 100644
index 57cccda..0000000
Binary files a/traffic_ops/app/public/images/warning.png and /dev/null differ
diff --git a/traffic_ops/app/public/js/application.js b/traffic_ops/app/public/js/application.js
deleted file mode 100644
index 179bf6e..0000000
--- a/traffic_ops/app/public/js/application.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
-$(document).ready(function() {
- $("#close_button").on('click', function() {
- parent.$.fancybox.close();
- parent.location.reload(true);
- });
-});
-
-function submitForm (form) {
- form.submit ();
- parent.location.reload (true);
-}
diff --git a/traffic_ops/app/public/js/jMenu.jquery.js b/traffic_ops/app/public/js/jMenu.jquery.js
deleted file mode 100755
index 9bc280f..0000000
--- a/traffic_ops/app/public/js/jMenu.jquery.js
+++ /dev/null
@@ -1,185 +0,0 @@
-/************************************************************************
-*************************************************************************
-@Name : jMenu - jQuery Plugin
-@Revison : 2.0
-@Date : 08/2013
-@Author : ALPIXEL - (www.myjqueryplugins.com - www.alpixel.fr)
-@Support : FF, IE7, IE8, MAC Firefox, MAC Safari
-@License : Open Source - MIT License : http://www.opensource.org/licenses/mit-license.php
-
-**************************************************************************
-*************************************************************************/
-
-/** jMenu Plugin **/
-(function($) {
- $.jMenu = {
- /**************/
- /** OPTIONS **/
- /**************/
- defaults: {
- ulWidth: 'auto',
- absoluteTop: 33,
- absoluteLeft: 0,
- TimeBeforeOpening: 100,
- TimeBeforeClosing: 100,
- animatedText: true,
- paddingLeft: 7,
- openClick: false,
- effects: {
- effectSpeedOpen: 150,
- effectSpeedClose: 150,
- effectTypeOpen: 'slide',
- effectTypeClose: 'slide',
- effectOpen: 'swing',
- effectClose: 'swing'
- }
- },
-
- /*****************/
- /** Init Method **/
- /*****************/
- init: function(options) {
- /* vars **/
- opts = $.extend({}, $.jMenu.defaults, options);
-
- // Set global width of the sub-menus links
- if(opts.ulWidth == 'auto')
- $width = $('.fNiv').outerWidth(false);
- else
- $width = opts.ulWidth;
-
-
-
- $(".jMenu li").each(function() {
- var
- $thisChild = $(this).find('a:first'),
- $allUl = $(this).find('ul');
-
- if($.jMenu._IsParent($thisChild))
- {
- $thisChild.addClass('isParent');
-
- var
- $ul = $thisChild.next(),
- $position = $thisChild.position();
-
- if($(this).hasClass('jmenu-level-0'))
- $ul.css({
- top: $position.top + opts.absoluteTop,
- left: $position.left + opts.absoluteLeft,
- width : $width
- });
- else
- $ul.css({
- top: $position.top,
- left: $position.left + $width,
- width : $width
- });
-
-
- if(!opts.openClick)
- $(this).bind({
- mouseenter:function() {
- if($(this).hasClass('jmenu-level-0')) {
- $position = $(this).position();
- $ul.css({
- left: $position.left + opts.absoluteLeft,
- top: $position.top + opts.absoluteTop
- });
- }
- $.jMenu._show($ul);
- },
- mouseleave:function(){
- $.jMenu._closeList($ul);
- }
- });
- else
- $(this).bind({
- click:function(e) {
- e.preventDefault();
- $.jMenu._show($ul);
- },
- mouseleave:function(){
- $.jMenu._closeList($ul);
- }
- });
- }
- });
- },
-
-
- /****************************
- *****************************
- ** jMenu Methods Below **
- *****************************
- ****************************/
- _show: function(el) {
- switch(opts.effects.effectTypeOpen) {
- case 'slide':
- el.stop(true, true).delay(opts.TimeBeforeOpening).slideDown(opts.effects.effectSpeedOpen, opts.effects.effectOpen);
- break;
- case 'fade':
- el.stop(true, true).delay(opts.TimeBeforeOpening).fadeIn(opts.effects.effectSpeedOpen, opts.effects.effectOpen);
- break;
- default:
- el.stop(true, true).delay(opts.TimeBeforeOpening).show();
- }
- },
-
- _closeList: function(el) {
- switch(opts.effects.effectTypeClose) {
- case 'slide':
- el.stop(true,true).delay(opts.TimeBeforeClosing).slideUp(opts.effects.effectSpeedClose, opts.effects.effectClose);
- break;
- case 'fade':
- el.stop(true,true).delay(opts.TimeBeforeClosing).fadeOut(opts.effects.effectSpeedClose, opts.effects.effectClose);
- break;
- default:
- el.delay(opts.TimeBeforeClosing).hide();
- }
- },
-
- _animateText: function(el) {
- var paddingInit = parseInt(el.css('padding-left'));
- el.hover(
- function() {
- $(this).stop(true,false).animate({paddingLeft: paddingInit + opts.paddingLeft}, 100);
- },
- function() {
- $(this).stop(true,false).animate({paddingLeft:paddingInit}, 100);
- }
- );
- },
-
- _IsParent: function(el) {
- if (el.next().is('ul'))
- return true;
- else
- return false;
- },
-
- _isReadable: function() {
- if ($(".jmenu-level-0").length > 0)
- return true;
- else
- return false;
- },
-
- _error: function() {
- alert('jMenu plugin can\'t be initialized. Please, check you have the \'.jmenu-level-0\' class on your first level <li> elements.');
- }
- };
-
- jQuery.fn.jMenu = function(options){
- $(this).addClass('jMenu');
- $(this)
- .children('li').addClass('jmenu-level-0')
- .children('a').addClass('fNiv');
-
- if($.jMenu._isReadable()) {
- $.jMenu.init(options);
- } else {
- $.jMenu._error();
- }
- };
-})(jQuery);
diff --git a/traffic_ops/app/public/js/jMenu.jquery.min.js b/traffic_ops/app/public/js/jMenu.jquery.min.js
deleted file mode 100644
index 998288f..0000000
--- a/traffic_ops/app/public/js/jMenu.jquery.min.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/************************************************************************
-*************************************************************************
-@Name : jMenu - jQuery Plugin
-@Revison : 2.0
-@Date : 08/2013
-@Author : ALPIXEL - (www.myjqueryplugins.com - www.alpixel.fr)
-@Support : FF, IE7, IE8, MAC Firefox, MAC Safari
-@License : Open Source - MIT License : http://www.opensource.org/licenses/mit-license.php
-
-**************************************************************************
-*************************************************************************/
-(function(e){e.jMenu={defaults:{ulWidth:"auto",absoluteTop:33,absoluteLeft:0,TimeBeforeOpening:100,TimeBeforeClosing:100,animatedText:true,paddingLeft:7,openClick:false,effects:{effectSpeedOpen:150,effectSpeedClose:150,effectTypeOpen:"slide",effectTypeClose:"slide",effectOpen:"swing",effectClose:"swing"}},init:function(t){opts=e.extend({},e.jMenu.defaults,t);if(opts.ulWidth=="auto")$width=e(".fNiv").outerWidth(false);else $width=opts.ulWidth;e(".jMenu li").each(function(){var t=e(this).f [...]
diff --git a/traffic_ops/app/public/js/jqtree/tree.jquery.js b/traffic_ops/app/public/js/jqtree/tree.jquery.js
deleted file mode 100644
index e02a9f3..0000000
--- a/traffic_ops/app/public/js/jqtree/tree.jquery.js
+++ /dev/null
@@ -1,3341 +0,0 @@
-(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-var $, DragAndDropHandler, DragElement, HitAreasGenerator, Position, VisibleNodeIterator, node_module,
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty;
-
-node_module = require('./node');
-
-Position = node_module.Position;
-
-$ = jQuery;
-
-DragAndDropHandler = (function() {
- function DragAndDropHandler(tree_widget) {
- this.tree_widget = tree_widget;
- this.hovered_area = null;
- this.$ghost = null;
- this.hit_areas = [];
- this.is_dragging = false;
- this.current_item = null;
- }
-
- DragAndDropHandler.prototype.mouseCapture = function(position_info) {
- var $element, node_element;
- $element = $(position_info.target);
- if (!this.mustCaptureElement($element)) {
- return null;
- }
- if (this.tree_widget.options.onIsMoveHandle && !this.tree_widget.options.onIsMoveHandle($element)) {
- return null;
- }
- node_element = this.tree_widget._getNodeElement($element);
- if (node_element && this.tree_widget.options.onCanMove) {
- if (!this.tree_widget.options.onCanMove(node_element.node)) {
- node_element = null;
- }
- }
- this.current_item = node_element;
- return this.current_item !== null;
- };
-
- DragAndDropHandler.prototype.mouseStart = function(position_info) {
- var offset;
- this.refresh();
- offset = $(position_info.target).offset();
- this.drag_element = new DragElement(this.current_item.node, position_info.page_x - offset.left, position_info.page_y - offset.top, this.tree_widget.element);
- this.is_dragging = true;
- this.current_item.$element.addClass('jqtree-moving');
- return true;
- };
-
- DragAndDropHandler.prototype.mouseDrag = function(position_info) {
- var area, can_move_to;
- this.drag_element.move(position_info.page_x, position_info.page_y);
- area = this.findHoveredArea(position_info.page_x, position_info.page_y);
- can_move_to = this.canMoveToArea(area);
- if (can_move_to && area) {
- if (!area.node.isFolder()) {
- this.stopOpenFolderTimer();
- }
- if (this.hovered_area !== area) {
- this.hovered_area = area;
- if (this.mustOpenFolderTimer(area)) {
- this.startOpenFolderTimer(area.node);
- } else {
- this.stopOpenFolderTimer();
- }
- this.updateDropHint();
- }
- } else {
- this.removeHover();
- this.removeDropHint();
- this.stopOpenFolderTimer();
- }
- return true;
- };
-
- DragAndDropHandler.prototype.mustCaptureElement = function($element) {
- return !$element.is('input,select');
- };
-
- DragAndDropHandler.prototype.canMoveToArea = function(area) {
- var position_name;
- if (!area) {
- return false;
- } else if (this.tree_widget.options.onCanMoveTo) {
- position_name = Position.getName(area.position);
- return this.tree_widget.options.onCanMoveTo(this.current_item.node, area.node, position_name);
- } else {
- return true;
- }
- };
-
- DragAndDropHandler.prototype.mouseStop = function(position_info) {
- this.moveItem(position_info);
- this.clear();
- this.removeHover();
- this.removeDropHint();
- this.removeHitAreas();
- if (this.current_item) {
- this.current_item.$element.removeClass('jqtree-moving');
- this.current_item = null;
- }
- this.is_dragging = false;
- return false;
- };
-
- DragAndDropHandler.prototype.refresh = function() {
- this.removeHitAreas();
- if (this.current_item) {
- this.generateHitAreas();
- this.current_item = this.tree_widget._getNodeElementForNode(this.current_item.node);
- if (this.is_dragging) {
- return this.current_item.$element.addClass('jqtree-moving');
- }
- }
- };
-
- DragAndDropHandler.prototype.removeHitAreas = function() {
- return this.hit_areas = [];
- };
-
- DragAndDropHandler.prototype.clear = function() {
- this.drag_element.remove();
- return this.drag_element = null;
- };
-
- DragAndDropHandler.prototype.removeDropHint = function() {
- if (this.previous_ghost) {
- return this.previous_ghost.remove();
- }
- };
-
- DragAndDropHandler.prototype.removeHover = function() {
- return this.hovered_area = null;
- };
-
- DragAndDropHandler.prototype.generateHitAreas = function() {
- var hit_areas_generator;
- hit_areas_generator = new HitAreasGenerator(this.tree_widget.tree, this.current_item.node, this.getTreeDimensions().bottom);
- return this.hit_areas = hit_areas_generator.generate();
- };
-
- DragAndDropHandler.prototype.findHoveredArea = function(x, y) {
- var area, dimensions, high, low, mid;
- dimensions = this.getTreeDimensions();
- if (x < dimensions.left || y < dimensions.top || x > dimensions.right || y > dimensions.bottom) {
- return null;
- }
- low = 0;
- high = this.hit_areas.length;
- while (low < high) {
- mid = (low + high) >> 1;
- area = this.hit_areas[mid];
- if (y < area.top) {
- high = mid;
- } else if (y > area.bottom) {
- low = mid + 1;
- } else {
- return area;
- }
- }
- return null;
- };
-
- DragAndDropHandler.prototype.mustOpenFolderTimer = function(area) {
- var node;
- node = area.node;
- return node.isFolder() && !node.is_open && area.position === Position.INSIDE;
- };
-
- DragAndDropHandler.prototype.updateDropHint = function() {
- var node_element;
- if (!this.hovered_area) {
- return;
- }
- this.removeDropHint();
- node_element = this.tree_widget._getNodeElementForNode(this.hovered_area.node);
- return this.previous_ghost = node_element.addDropHint(this.hovered_area.position);
- };
-
- DragAndDropHandler.prototype.startOpenFolderTimer = function(folder) {
- var openFolder;
- openFolder = (function(_this) {
- return function() {
- return _this.tree_widget._openNode(folder, _this.tree_widget.options.slide, function() {
- _this.refresh();
- return _this.updateDropHint();
- });
- };
- })(this);
- this.stopOpenFolderTimer();
- return this.open_folder_timer = setTimeout(openFolder, this.tree_widget.options.openFolderDelay);
- };
-
- DragAndDropHandler.prototype.stopOpenFolderTimer = function() {
- if (this.open_folder_timer) {
- clearTimeout(this.open_folder_timer);
- return this.open_folder_timer = null;
- }
- };
-
- DragAndDropHandler.prototype.moveItem = function(position_info) {
- var doMove, event, moved_node, position, previous_parent, target_node;
- if (this.hovered_area && this.hovered_area.position !== Position.NONE && this.canMoveToArea(this.hovered_area)) {
- moved_node = this.current_item.node;
- target_node = this.hovered_area.node;
- position = this.hovered_area.position;
- previous_parent = moved_node.parent;
- if (position === Position.INSIDE) {
- this.hovered_area.node.is_open = true;
- }
- doMove = (function(_this) {
- return function() {
- _this.tree_widget.tree.moveNode(moved_node, target_node, position);
- _this.tree_widget.element.empty();
- return _this.tree_widget._refreshElements();
- };
- })(this);
- event = this.tree_widget._triggerEvent('tree.move', {
- move_info: {
- moved_node: moved_node,
- target_node: target_node,
- position: Position.getName(position),
- previous_parent: previous_parent,
- do_move: doMove,
- original_event: position_info.original_event
- }
- });
- if (!event.isDefaultPrevented()) {
- return doMove();
- }
- }
- };
-
- DragAndDropHandler.prototype.getTreeDimensions = function() {
- var offset;
- offset = this.tree_widget.element.offset();
- return {
- left: offset.left,
- top: offset.top,
- right: offset.left + this.tree_widget.element.width(),
- bottom: offset.top + this.tree_widget.element.height() + 16
- };
- };
-
- return DragAndDropHandler;
-
-})();
-
-VisibleNodeIterator = (function() {
- function VisibleNodeIterator(tree) {
- this.tree = tree;
- }
-
- VisibleNodeIterator.prototype.iterate = function() {
- var _iterateNode, is_first_node;
- is_first_node = true;
- _iterateNode = (function(_this) {
- return function(node, next_node) {
- var $element, child, children_length, i, j, len, must_iterate_inside, ref;
- must_iterate_inside = (node.is_open || !node.element) && node.hasChildren();
- if (node.element) {
- $element = $(node.element);
- if (!$element.is(':visible')) {
- return;
- }
- if (is_first_node) {
- _this.handleFirstNode(node, $element);
- is_first_node = false;
- }
- if (!node.hasChildren()) {
- _this.handleNode(node, next_node, $element);
- } else if (node.is_open) {
- if (!_this.handleOpenFolder(node, $element)) {
- must_iterate_inside = false;
- }
- } else {
- _this.handleClosedFolder(node, next_node, $element);
- }
- }
- if (must_iterate_inside) {
- children_length = node.children.length;
- ref = node.children;
- for (i = j = 0, len = ref.length; j < len; i = ++j) {
- child = ref[i];
- if (i === (children_length - 1)) {
- _iterateNode(node.children[i], null);
- } else {
- _iterateNode(node.children[i], node.children[i + 1]);
- }
- }
- if (node.is_open) {
- return _this.handleAfterOpenFolder(node, next_node, $element);
- }
- }
- };
- })(this);
- return _iterateNode(this.tree, null);
- };
-
- VisibleNodeIterator.prototype.handleNode = function(node, next_node, $element) {};
-
- VisibleNodeIterator.prototype.handleOpenFolder = function(node, $element) {};
-
- VisibleNodeIterator.prototype.handleClosedFolder = function(node, next_node, $element) {};
-
- VisibleNodeIterator.prototype.handleAfterOpenFolder = function(node, next_node, $element) {};
-
- VisibleNodeIterator.prototype.handleFirstNode = function(node, $element) {};
-
- return VisibleNodeIterator;
-
-})();
-
-HitAreasGenerator = (function(superClass) {
- extend(HitAreasGenerator, superClass);
-
- function HitAreasGenerator(tree, current_node, tree_bottom) {
- HitAreasGenerator.__super__.constructor.call(this, tree);
- this.current_node = current_node;
- this.tree_bottom = tree_bottom;
- }
-
- HitAreasGenerator.prototype.generate = function() {
- this.positions = [];
- this.last_top = 0;
- this.iterate();
- return this.generateHitAreas(this.positions);
- };
-
- HitAreasGenerator.prototype.getTop = function($element) {
- return $element.offset().top;
- };
-
- HitAreasGenerator.prototype.addPosition = function(node, position, top) {
- var area;
- area = {
- top: top,
- node: node,
- position: position
- };
- this.positions.push(area);
- return this.last_top = top;
- };
-
- HitAreasGenerator.prototype.handleNode = function(node, next_node, $element) {
- var top;
- top = this.getTop($element);
- if (node === this.current_node) {
- this.addPosition(node, Position.NONE, top);
- } else {
- this.addPosition(node, Position.INSIDE, top);
- }
- if (next_node === this.current_node || node === this.current_node) {
- return this.addPosition(node, Position.NONE, top);
- } else {
- return this.addPosition(node, Position.AFTER, top);
- }
- };
-
- HitAreasGenerator.prototype.handleOpenFolder = function(node, $element) {
- if (node === this.current_node) {
- return false;
- }
- if (node.children[0] !== this.current_node) {
- this.addPosition(node, Position.INSIDE, this.getTop($element));
- }
- return true;
- };
-
- HitAreasGenerator.prototype.handleClosedFolder = function(node, next_node, $element) {
- var top;
- top = this.getTop($element);
- if (node === this.current_node) {
- return this.addPosition(node, Position.NONE, top);
- } else {
- this.addPosition(node, Position.INSIDE, top);
- if (next_node !== this.current_node) {
- return this.addPosition(node, Position.AFTER, top);
- }
- }
- };
-
- HitAreasGenerator.prototype.handleFirstNode = function(node, $element) {
- if (node !== this.current_node) {
- return this.addPosition(node, Position.BEFORE, this.getTop($(node.element)));
- }
- };
-
- HitAreasGenerator.prototype.handleAfterOpenFolder = function(node, next_node, $element) {
- if (node === this.current_node.node || next_node === this.current_node.node) {
- return this.addPosition(node, Position.NONE, this.last_top);
- } else {
- return this.addPosition(node, Position.AFTER, this.last_top);
- }
- };
-
- HitAreasGenerator.prototype.generateHitAreas = function(positions) {
- var group, hit_areas, j, len, position, previous_top;
- previous_top = -1;
- group = [];
- hit_areas = [];
- for (j = 0, len = positions.length; j < len; j++) {
- position = positions[j];
- if (position.top !== previous_top && group.length) {
- if (group.length) {
- this.generateHitAreasForGroup(hit_areas, group, previous_top, position.top);
- }
- previous_top = position.top;
- group = [];
- }
- group.push(position);
- }
- this.generateHitAreasForGroup(hit_areas, group, previous_top, this.tree_bottom);
- return hit_areas;
- };
-
- HitAreasGenerator.prototype.generateHitAreasForGroup = function(hit_areas, positions_in_group, top, bottom) {
- var area_height, area_top, i, position, position_count;
- position_count = Math.min(positions_in_group.length, 4);
- area_height = Math.round((bottom - top) / position_count);
- area_top = top;
- i = 0;
- while (i < position_count) {
- position = positions_in_group[i];
- hit_areas.push({
- top: area_top,
- bottom: area_top + area_height,
- node: position.node,
- position: position.position
- });
- area_top += area_height;
- i += 1;
- }
- return null;
- };
-
- return HitAreasGenerator;
-
-})(VisibleNodeIterator);
-
-DragElement = (function() {
- function DragElement(node, offset_x, offset_y, $tree) {
- this.offset_x = offset_x;
- this.offset_y = offset_y;
- this.$element = $("<span class=\"jqtree-title jqtree-dragging\">" + node.name + "</span>");
- this.$element.css("position", "absolute");
- $tree.append(this.$element);
- }
-
- DragElement.prototype.move = function(page_x, page_y) {
- return this.$element.offset({
- left: page_x - this.offset_x,
- top: page_y - this.offset_y
- });
- };
-
- DragElement.prototype.remove = function() {
- return this.$element.remove();
- };
-
- return DragElement;
-
-})();
-
-module.exports = DragAndDropHandler;
-
-},{"./node":5}],2:[function(require,module,exports){
-var $, ElementsRenderer, NodeElement, html_escape, node_element, util;
-
-node_element = require('./node_element');
-
-NodeElement = node_element.NodeElement;
-
-util = require('./util');
-
-html_escape = util.html_escape;
-
-$ = jQuery;
-
-ElementsRenderer = (function() {
- function ElementsRenderer(tree_widget) {
- this.tree_widget = tree_widget;
- this.opened_icon_element = this.createButtonElement(tree_widget.options.openedIcon);
- this.closed_icon_element = this.createButtonElement(tree_widget.options.closedIcon);
- }
-
- ElementsRenderer.prototype.render = function(from_node) {
- if (from_node && from_node.parent) {
- return this.renderFromNode(from_node);
- } else {
- return this.renderFromRoot();
- }
- };
-
- ElementsRenderer.prototype.renderFromRoot = function() {
- var $element;
- $element = this.tree_widget.element;
- $element.empty();
- return this.createDomElements($element[0], this.tree_widget.tree.children, true, true);
- };
-
- ElementsRenderer.prototype.renderFromNode = function(node) {
- var $previous_li, li;
- $previous_li = $(node.element);
- li = this.createLi(node);
- this.attachNodeData(node, li);
- $previous_li.after(li);
- $previous_li.remove();
- if (node.children) {
- return this.createDomElements(li, node.children, false, false);
- }
- };
-
- ElementsRenderer.prototype.createDomElements = function(element, children, is_root_node, is_open) {
- var child, i, len, li, ul;
- ul = this.createUl(is_root_node);
- element.appendChild(ul);
- for (i = 0, len = children.length; i < len; i++) {
- child = children[i];
- li = this.createLi(child);
- ul.appendChild(li);
- this.attachNodeData(child, li);
- if (child.hasChildren()) {
- this.createDomElements(li, child.children, false, child.is_open);
- }
- }
- return null;
- };
-
- ElementsRenderer.prototype.attachNodeData = function(node, li) {
- node.element = li;
- return $(li).data('node', node);
- };
-
- ElementsRenderer.prototype.createUl = function(is_root_node) {
- var class_string, ul;
- if (!is_root_node) {
- class_string = '';
- } else {
- class_string = 'jqtree-tree';
- if (this.tree_widget.options.rtl) {
- class_string += ' jqtree-rtl';
- }
- }
- ul = document.createElement('ul');
- ul.className = "jqtree_common " + class_string;
- return ul;
- };
-
- ElementsRenderer.prototype.createLi = function(node) {
- var li;
- if (node.isFolder()) {
- li = this.createFolderLi(node);
- } else {
- li = this.createNodeLi(node);
- }
- if (this.tree_widget.options.onCreateLi) {
- this.tree_widget.options.onCreateLi(node, $(li));
- }
- return li;
- };
-
- ElementsRenderer.prototype.createFolderLi = function(node) {
- var button_classes, button_link, div, escaped_name, folder_classes, icon_element, li, title_span;
- button_classes = this.getButtonClasses(node);
- folder_classes = this.getFolderClasses(node);
- escaped_name = this.escapeIfNecessary(node.name);
- if (node.is_open) {
- icon_element = this.opened_icon_element;
- } else {
- icon_element = this.closed_icon_element;
- }
- li = document.createElement('li');
- li.className = "jqtree_common " + folder_classes;
- div = document.createElement('div');
- div.className = "jqtree-element jqtree_common";
- li.appendChild(div);
- button_link = document.createElement('a');
- button_link.className = "jqtree_common " + button_classes;
- button_link.appendChild(icon_element.cloneNode(false));
- div.appendChild(button_link);
- title_span = document.createElement('span');
- title_span.className = "jqtree_common jqtree-title jqtree-title-folder";
- div.appendChild(title_span);
- title_span.innerHTML = escaped_name;
- return li;
- };
-
- ElementsRenderer.prototype.createNodeLi = function(node) {
- var class_string, div, escaped_name, li, li_classes, title_span;
- li_classes = ['jqtree_common'];
- if (this.tree_widget.select_node_handler && this.tree_widget.select_node_handler.isNodeSelected(node)) {
- li_classes.push('jqtree-selected');
- }
- class_string = li_classes.join(' ');
- escaped_name = this.escapeIfNecessary(node.name);
- li = document.createElement('li');
- li.className = class_string;
- div = document.createElement('div');
- div.className = "jqtree-element jqtree_common";
- li.appendChild(div);
- title_span = document.createElement('span');
- title_span.className = "jqtree-title jqtree_common";
- title_span.innerHTML = escaped_name;
- div.appendChild(title_span);
- return li;
- };
-
- ElementsRenderer.prototype.getButtonClasses = function(node) {
- var classes;
- classes = ['jqtree-toggler'];
- if (!node.is_open) {
- classes.push('jqtree-closed');
- }
- return classes.join(' ');
- };
-
- ElementsRenderer.prototype.getFolderClasses = function(node) {
- var classes;
- classes = ['jqtree-folder'];
- if (!node.is_open) {
- classes.push('jqtree-closed');
- }
- if (this.tree_widget.select_node_handler && this.tree_widget.select_node_handler.isNodeSelected(node)) {
- classes.push('jqtree-selected');
- }
- if (node.is_loading) {
- classes.push('jqtree-loading');
- }
- return classes.join(' ');
- };
-
- ElementsRenderer.prototype.escapeIfNecessary = function(value) {
- if (this.tree_widget.options.autoEscape) {
- return html_escape(value);
- } else {
- return value;
- }
- };
-
- ElementsRenderer.prototype.createButtonElement = function(value) {
- var div;
- if (typeof value === 'string') {
- div = document.createElement('div');
- div.innerHTML = value;
- return document.createTextNode(div.innerHTML);
- } else {
- return $(value)[0];
- }
- };
-
- return ElementsRenderer;
-
-})();
-
-module.exports = ElementsRenderer;
-
-},{"./node_element":6,"./util":12}],3:[function(require,module,exports){
-var $, KeyHandler,
- bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
-
-$ = jQuery;
-
-KeyHandler = (function() {
- var DOWN, LEFT, RIGHT, UP;
-
- LEFT = 37;
-
- UP = 38;
-
- RIGHT = 39;
-
- DOWN = 40;
-
- function KeyHandler(tree_widget) {
- this.selectNode = bind(this.selectNode, this);
- this.tree_widget = tree_widget;
- if (tree_widget.options.keyboardSupport) {
- $(document).bind('keydown.jqtree', $.proxy(this.handleKeyDown, this));
- }
- }
-
- KeyHandler.prototype.deinit = function() {
- return $(document).unbind('keydown.jqtree');
- };
-
- KeyHandler.prototype.moveDown = function() {
- var node;
- node = this.tree_widget.getSelectedNode();
- if (node) {
- return this.selectNode(node.getNextNode());
- } else {
- return false;
- }
- };
-
- KeyHandler.prototype.moveUp = function() {
- var node;
- node = this.tree_widget.getSelectedNode();
- if (node) {
- return this.selectNode(node.getPreviousNode());
- } else {
- return false;
- }
- };
-
- KeyHandler.prototype.moveRight = function() {
- var node;
- node = this.tree_widget.getSelectedNode();
- if (node && node.isFolder() && !node.is_open) {
- this.tree_widget.openNode(node);
- return false;
- } else {
- return true;
- }
- };
-
- KeyHandler.prototype.moveLeft = function() {
- var node;
- node = this.tree_widget.getSelectedNode();
- if (node && node.isFolder() && node.is_open) {
- this.tree_widget.closeNode(node);
- return false;
- } else {
- return true;
- }
- };
-
- KeyHandler.prototype.handleKeyDown = function(e) {
- var key;
- if (!this.tree_widget.options.keyboardSupport) {
- return true;
- }
- if ($(document.activeElement).is('textarea,input,select')) {
- return true;
- }
- if (!this.tree_widget.getSelectedNode()) {
- return true;
- }
- key = e.which;
- switch (key) {
- case DOWN:
- return this.moveDown();
- case UP:
- return this.moveUp();
- case RIGHT:
- return this.moveRight();
- case LEFT:
- return this.moveLeft();
- }
- return true;
- };
-
- KeyHandler.prototype.selectNode = function(node) {
- if (!node) {
- return true;
- } else {
- this.tree_widget.selectNode(node);
- if (this.tree_widget.scroll_handler && (!this.tree_widget.scroll_handler.isScrolledIntoView($(node.element).find('.jqtree-element')))) {
- this.tree_widget.scrollToNode(node);
- }
- return false;
- }
- };
-
- return KeyHandler;
-
-})();
-
-module.exports = KeyHandler;
-
-},{}],4:[function(require,module,exports){
-
-/*
-This widget does the same a the mouse widget in jqueryui.
- */
-var $, MouseWidget, SimpleWidget,
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty;
-
-SimpleWidget = require('./simple.widget');
-
-$ = jQuery;
-
-MouseWidget = (function(superClass) {
- extend(MouseWidget, superClass);
-
- function MouseWidget() {
- return MouseWidget.__super__.constructor.apply(this, arguments);
- }
-
- MouseWidget.is_mouse_handled = false;
-
- MouseWidget.prototype._init = function() {
- this.$el.bind('mousedown.mousewidget', $.proxy(this._mouseDown, this));
- this.$el.bind('touchstart.mousewidget', $.proxy(this._touchStart, this));
- this.is_mouse_started = false;
- this.mouse_delay = 0;
- this._mouse_delay_timer = null;
- this._is_mouse_delay_met = true;
- return this.mouse_down_info = null;
- };
-
- MouseWidget.prototype._deinit = function() {
- var $document;
- this.$el.unbind('mousedown.mousewidget');
- this.$el.unbind('touchstart.mousewidget');
- $document = $(document);
- $document.unbind('mousemove.mousewidget');
- return $document.unbind('mouseup.mousewidget');
- };
-
- MouseWidget.prototype._mouseDown = function(e) {
- var result;
- if (e.which !== 1) {
- return;
- }
- result = this._handleMouseDown(e, this._getPositionInfo(e));
- if (result) {
- e.preventDefault();
- }
- return result;
- };
-
- MouseWidget.prototype._handleMouseDown = function(e, position_info) {
- if (MouseWidget.is_mouse_handled) {
- return;
- }
- if (this.is_mouse_started) {
- this._handleMouseUp(position_info);
- }
- this.mouse_down_info = position_info;
- if (!this._mouseCapture(position_info)) {
- return;
- }
- this._handleStartMouse();
- this.is_mouse_handled = true;
- return true;
- };
-
- MouseWidget.prototype._handleStartMouse = function() {
- var $document;
- $document = $(document);
- $document.bind('mousemove.mousewidget', $.proxy(this._mouseMove, this));
- $document.bind('touchmove.mousewidget', $.proxy(this._touchMove, this));
- $document.bind('mouseup.mousewidget', $.proxy(this._mouseUp, this));
- $document.bind('touchend.mousewidget', $.proxy(this._touchEnd, this));
- if (this.mouse_delay) {
- return this._startMouseDelayTimer();
- }
- };
-
- MouseWidget.prototype._startMouseDelayTimer = function() {
- if (this._mouse_delay_timer) {
- clearTimeout(this._mouse_delay_timer);
- }
- this._mouse_delay_timer = setTimeout((function(_this) {
- return function() {
- return _this._is_mouse_delay_met = true;
- };
- })(this), this.mouse_delay);
- return this._is_mouse_delay_met = false;
- };
-
- MouseWidget.prototype._mouseMove = function(e) {
- return this._handleMouseMove(e, this._getPositionInfo(e));
- };
-
- MouseWidget.prototype._handleMouseMove = function(e, position_info) {
- if (this.is_mouse_started) {
- this._mouseDrag(position_info);
- return e.preventDefault();
- }
- if (this.mouse_delay && !this._is_mouse_delay_met) {
- return true;
- }
- this.is_mouse_started = this._mouseStart(this.mouse_down_info) !== false;
- if (this.is_mouse_started) {
- this._mouseDrag(position_info);
- } else {
- this._handleMouseUp(position_info);
- }
- return !this.is_mouse_started;
- };
-
- MouseWidget.prototype._getPositionInfo = function(e) {
- return {
- page_x: e.pageX,
- page_y: e.pageY,
- target: e.target,
- original_event: e
- };
- };
-
- MouseWidget.prototype._mouseUp = function(e) {
- return this._handleMouseUp(this._getPositionInfo(e));
- };
-
- MouseWidget.prototype._handleMouseUp = function(position_info) {
- var $document;
- $document = $(document);
- $document.unbind('mousemove.mousewidget');
- $document.unbind('touchmove.mousewidget');
- $document.unbind('mouseup.mousewidget');
- $document.unbind('touchend.mousewidget');
- if (this.is_mouse_started) {
- this.is_mouse_started = false;
- this._mouseStop(position_info);
- }
- };
-
- MouseWidget.prototype._mouseCapture = function(position_info) {
- return true;
- };
-
- MouseWidget.prototype._mouseStart = function(position_info) {
- return null;
- };
-
- MouseWidget.prototype._mouseDrag = function(position_info) {
- return null;
- };
-
- MouseWidget.prototype._mouseStop = function(position_info) {
- return null;
- };
-
- MouseWidget.prototype.setMouseDelay = function(mouse_delay) {
- return this.mouse_delay = mouse_delay;
- };
-
- MouseWidget.prototype._touchStart = function(e) {
- var touch;
- if (e.originalEvent.touches.length > 1) {
- return;
- }
- touch = e.originalEvent.changedTouches[0];
- return this._handleMouseDown(e, this._getPositionInfo(touch));
- };
-
- MouseWidget.prototype._touchMove = function(e) {
- var touch;
- if (e.originalEvent.touches.length > 1) {
- return;
- }
- touch = e.originalEvent.changedTouches[0];
- return this._handleMouseMove(e, this._getPositionInfo(touch));
- };
-
- MouseWidget.prototype._touchEnd = function(e) {
- var touch;
- if (e.originalEvent.touches.length > 1) {
- return;
- }
- touch = e.originalEvent.changedTouches[0];
- return this._handleMouseUp(this._getPositionInfo(touch));
- };
-
- return MouseWidget;
-
-})(SimpleWidget);
-
-module.exports = MouseWidget;
-
-},{"./simple.widget":10}],5:[function(require,module,exports){
-var $, Node, Position;
-
-$ = jQuery;
-
-Position = {
- getName: function(position) {
- return Position.strings[position - 1];
- },
- nameToIndex: function(name) {
- var i, j, ref;
- for (i = j = 1, ref = Position.strings.length; 1 <= ref ? j <= ref : j >= ref; i = 1 <= ref ? ++j : --j) {
- if (Position.strings[i - 1] === name) {
- return i;
- }
- }
- return 0;
- }
-};
-
-Position.BEFORE = 1;
-
-Position.AFTER = 2;
-
-Position.INSIDE = 3;
-
-Position.NONE = 4;
-
-Position.strings = ['before', 'after', 'inside', 'none'];
-
-Node = (function() {
- function Node(o, is_root, node_class) {
- if (is_root == null) {
- is_root = false;
- }
- if (node_class == null) {
- node_class = Node;
- }
- this.setData(o);
- this.children = [];
- this.parent = null;
- if (is_root) {
- this.id_mapping = {};
- this.tree = this;
- this.node_class = node_class;
- }
- }
-
- Node.prototype.setData = function(o) {
- var key, value;
- if (typeof o !== 'object') {
- this.name = o;
- } else {
- for (key in o) {
- value = o[key];
- if (key === 'label') {
- this.name = value;
- } else {
- this[key] = value;
- }
- }
- }
- return null;
- };
-
- Node.prototype.initFromData = function(data) {
- var addChildren, addNode;
- addNode = (function(_this) {
- return function(node_data) {
- _this.setData(node_data);
- if (node_data.children) {
- return addChildren(node_data.children);
- }
- };
- })(this);
- addChildren = (function(_this) {
- return function(children_data) {
- var child, j, len, node;
- for (j = 0, len = children_data.length; j < len; j++) {
- child = children_data[j];
- node = new _this.tree.node_class('');
- node.initFromData(child);
- _this.addChild(node);
- }
- return null;
- };
- })(this);
- addNode(data);
- return null;
- };
-
-
- /*
- Create tree from data.
-
- Structure of data is:
- [
- {
- label: 'node1',
- children: [
- { label: 'child1' },
- { label: 'child2' }
- ]
- },
- {
- label: 'node2'
- }
- ]
- */
-
- Node.prototype.loadFromData = function(data) {
- var j, len, node, o;
- this.removeChildren();
- for (j = 0, len = data.length; j < len; j++) {
- o = data[j];
- node = new this.tree.node_class(o);
- this.addChild(node);
- if (typeof o === 'object' && o.children) {
- node.loadFromData(o.children);
- }
- }
- return null;
- };
-
-
- /*
- Add child.
-
- tree.addChild(
- new Node('child1')
- );
- */
-
- Node.prototype.addChild = function(node) {
- this.children.push(node);
- return node._setParent(this);
- };
-
-
- /*
- Add child at position. Index starts at 0.
-
- tree.addChildAtPosition(
- new Node('abc'),
- 1
- );
- */
-
- Node.prototype.addChildAtPosition = function(node, index) {
- this.children.splice(index, 0, node);
- return node._setParent(this);
- };
-
- Node.prototype._setParent = function(parent) {
- this.parent = parent;
- this.tree = parent.tree;
- return this.tree.addNodeToIndex(this);
- };
-
-
- /*
- Remove child. This also removes the children of the node.
-
- tree.removeChild(tree.children[0]);
- */
-
- Node.prototype.removeChild = function(node) {
- node.removeChildren();
- return this._removeChild(node);
- };
-
- Node.prototype._removeChild = function(node) {
- this.children.splice(this.getChildIndex(node), 1);
- return this.tree.removeNodeFromIndex(node);
- };
-
-
- /*
- Get child index.
-
- var index = getChildIndex(node);
- */
-
- Node.prototype.getChildIndex = function(node) {
- return $.inArray(node, this.children);
- };
-
-
- /*
- Does the tree have children?
-
- if (tree.hasChildren()) {
- //
- }
- */
-
- Node.prototype.hasChildren = function() {
- return this.children.length !== 0;
- };
-
- Node.prototype.isFolder = function() {
- return this.hasChildren() || this.load_on_demand;
- };
-
-
- /*
- Iterate over all the nodes in the tree.
-
- Calls callback with (node, level).
-
- The callback must return true to continue the iteration on current node.
-
- tree.iterate(
- function(node, level) {
- console.log(node.name);
-
- // stop iteration after level 2
- return (level <= 2);
- }
- );
- */
-
- Node.prototype.iterate = function(callback) {
- var _iterate;
- _iterate = function(node, level) {
- var child, j, len, ref, result;
- if (node.children) {
- ref = node.children;
- for (j = 0, len = ref.length; j < len; j++) {
- child = ref[j];
- result = callback(child, level);
- if (result && child.hasChildren()) {
- _iterate(child, level + 1);
- }
- }
- return null;
- }
- };
- _iterate(this, 0);
- return null;
- };
-
-
- /*
- Move node relative to another node.
-
- Argument position: Position.BEFORE, Position.AFTER or Position.Inside
-
- // move node1 after node2
- tree.moveNode(node1, node2, Position.AFTER);
- */
-
- Node.prototype.moveNode = function(moved_node, target_node, position) {
- if (moved_node.isParentOf(target_node)) {
- return;
- }
- moved_node.parent._removeChild(moved_node);
- if (position === Position.AFTER) {
- return target_node.parent.addChildAtPosition(moved_node, target_node.parent.getChildIndex(target_node) + 1);
- } else if (position === Position.BEFORE) {
- return target_node.parent.addChildAtPosition(moved_node, target_node.parent.getChildIndex(target_node));
- } else if (position === Position.INSIDE) {
- return target_node.addChildAtPosition(moved_node, 0);
- }
- };
-
-
- /*
- Get the tree as data.
- */
-
- Node.prototype.getData = function(include_parent) {
- var getDataFromNodes;
- if (include_parent == null) {
- include_parent = false;
- }
- getDataFromNodes = function(nodes) {
- var data, j, k, len, node, tmp_node, v;
- data = [];
- for (j = 0, len = nodes.length; j < len; j++) {
- node = nodes[j];
- tmp_node = {};
- for (k in node) {
- v = node[k];
- if ((k !== 'parent' && k !== 'children' && k !== 'element' && k !== 'tree') && Object.prototype.hasOwnProperty.call(node, k)) {
- tmp_node[k] = v;
- }
- }
- if (node.hasChildren()) {
- tmp_node.children = getDataFromNodes(node.children);
- }
- data.push(tmp_node);
- }
- return data;
- };
- if (include_parent) {
- return getDataFromNodes([this]);
- } else {
- return getDataFromNodes(this.children);
- }
- };
-
- Node.prototype.getNodeByName = function(name) {
- var result;
- result = null;
- this.iterate(function(node) {
- if (node.name === name) {
- result = node;
- return false;
- } else {
- return true;
- }
- });
- return result;
- };
-
- Node.prototype.addAfter = function(node_info) {
- var child_index, node;
- if (!this.parent) {
- return null;
- } else {
- node = new this.tree.node_class(node_info);
- child_index = this.parent.getChildIndex(this);
- this.parent.addChildAtPosition(node, child_index + 1);
- return node;
- }
- };
-
- Node.prototype.addBefore = function(node_info) {
- var child_index, node;
- if (!this.parent) {
- return null;
- } else {
- node = new this.tree.node_class(node_info);
- child_index = this.parent.getChildIndex(this);
- this.parent.addChildAtPosition(node, child_index);
- return node;
- }
- };
-
- Node.prototype.addParent = function(node_info) {
- var child, j, len, new_parent, original_parent, ref;
- if (!this.parent) {
- return null;
- } else {
- new_parent = new this.tree.node_class(node_info);
- new_parent._setParent(this.tree);
- original_parent = this.parent;
- ref = original_parent.children;
- for (j = 0, len = ref.length; j < len; j++) {
- child = ref[j];
- new_parent.addChild(child);
- }
- original_parent.children = [];
- original_parent.addChild(new_parent);
- return new_parent;
- }
- };
-
- Node.prototype.remove = function() {
- if (this.parent) {
- this.parent.removeChild(this);
- return this.parent = null;
- }
- };
-
- Node.prototype.append = function(node_info) {
- var node;
- node = new this.tree.node_class(node_info);
- this.addChild(node);
- return node;
- };
-
- Node.prototype.prepend = function(node_info) {
- var node;
- node = new this.tree.node_class(node_info);
- this.addChildAtPosition(node, 0);
- return node;
- };
-
- Node.prototype.isParentOf = function(node) {
- var parent;
- parent = node.parent;
- while (parent) {
- if (parent === this) {
- return true;
- }
- parent = parent.parent;
- }
- return false;
- };
-
- Node.prototype.getLevel = function() {
- var level, node;
- level = 0;
- node = this;
- while (node.parent) {
- level += 1;
- node = node.parent;
- }
- return level;
- };
-
- Node.prototype.getNodeById = function(node_id) {
- return this.id_mapping[node_id];
- };
-
- Node.prototype.addNodeToIndex = function(node) {
- if (node.id != null) {
- return this.id_mapping[node.id] = node;
- }
- };
-
- Node.prototype.removeNodeFromIndex = function(node) {
- if (node.id != null) {
- return delete this.id_mapping[node.id];
- }
- };
-
- Node.prototype.removeChildren = function() {
- this.iterate((function(_this) {
- return function(child) {
- _this.tree.removeNodeFromIndex(child);
- return true;
- };
- })(this));
- return this.children = [];
- };
-
- Node.prototype.getPreviousSibling = function() {
- var previous_index;
- if (!this.parent) {
- return null;
- } else {
- previous_index = this.parent.getChildIndex(this) - 1;
- if (previous_index >= 0) {
- return this.parent.children[previous_index];
- } else {
- return null;
- }
- }
- };
-
- Node.prototype.getNextSibling = function() {
- var next_index;
- if (!this.parent) {
- return null;
- } else {
- next_index = this.parent.getChildIndex(this) + 1;
- if (next_index < this.parent.children.length) {
- return this.parent.children[next_index];
- } else {
- return null;
- }
- }
- };
-
- Node.prototype.getNodesByProperty = function(key, value) {
- return this.filter(function(node) {
- return node[key] === value;
- });
- };
-
- Node.prototype.filter = function(f) {
- var result;
- result = [];
- this.iterate(function(node) {
- if (f(node)) {
- result.push(node);
- }
- return true;
- });
- return result;
- };
-
- Node.prototype.getNextNode = function(include_children) {
- var next_sibling;
- if (include_children == null) {
- include_children = true;
- }
- if (include_children && this.hasChildren() && this.is_open) {
- return this.children[0];
- } else {
- if (!this.parent) {
- return null;
- } else {
- next_sibling = this.getNextSibling();
- if (next_sibling) {
- return next_sibling;
- } else {
- return this.parent.getNextNode(false);
- }
- }
- }
- };
-
- Node.prototype.getPreviousNode = function() {
- var previous_sibling;
- if (!this.parent) {
- return null;
- } else {
- previous_sibling = this.getPreviousSibling();
- if (previous_sibling) {
- if (!previous_sibling.hasChildren() || !previous_sibling.is_open) {
- return previous_sibling;
- } else {
- return previous_sibling.getLastChild();
- }
- } else {
- if (this.parent.parent) {
- return this.parent;
- } else {
- return null;
- }
- }
- }
- };
-
- Node.prototype.getLastChild = function() {
- var last_child;
- if (!this.hasChildren()) {
- return null;
- } else {
- last_child = this.children[this.children.length - 1];
- if (!last_child.hasChildren() || !last_child.is_open) {
- return last_child;
- } else {
- return last_child.getLastChild();
- }
- }
- };
-
- return Node;
-
-})();
-
-module.exports = {
- Node: Node,
- Position: Position
-};
-
-},{}],6:[function(require,module,exports){
-var $, BorderDropHint, FolderElement, GhostDropHint, NodeElement, Position, node,
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty;
-
-node = require('./node');
-
-Position = node.Position;
-
-$ = jQuery;
-
-NodeElement = (function() {
- function NodeElement(node, tree_widget) {
- this.init(node, tree_widget);
- }
-
- NodeElement.prototype.init = function(node, tree_widget) {
- this.node = node;
- this.tree_widget = tree_widget;
- if (!node.element) {
- node.element = this.tree_widget.element;
- }
- return this.$element = $(node.element);
- };
-
- NodeElement.prototype.getUl = function() {
- return this.$element.children('ul:first');
- };
-
- NodeElement.prototype.getSpan = function() {
- return this.$element.children('.jqtree-element').find('span.jqtree-title');
- };
-
- NodeElement.prototype.getLi = function() {
- return this.$element;
- };
-
- NodeElement.prototype.addDropHint = function(position) {
- if (position === Position.INSIDE) {
- return new BorderDropHint(this.$element);
- } else {
- return new GhostDropHint(this.node, this.$element, position);
- }
- };
-
- NodeElement.prototype.select = function() {
- return this.getLi().addClass('jqtree-selected');
- };
-
- NodeElement.prototype.deselect = function() {
- return this.getLi().removeClass('jqtree-selected');
- };
-
- return NodeElement;
-
-})();
-
-FolderElement = (function(superClass) {
- extend(FolderElement, superClass);
-
- function FolderElement() {
- return FolderElement.__super__.constructor.apply(this, arguments);
- }
-
- FolderElement.prototype.open = function(on_finished, slide) {
- var $button, doOpen;
- if (slide == null) {
- slide = true;
- }
- if (!this.node.is_open) {
- this.node.is_open = true;
- $button = this.getButton();
- $button.removeClass('jqtree-closed');
- $button.html('');
- $button.append(this.tree_widget.renderer.opened_icon_element.cloneNode(false));
- doOpen = (function(_this) {
- return function() {
- _this.getLi().removeClass('jqtree-closed');
- if (on_finished) {
- on_finished();
- }
- return _this.tree_widget._triggerEvent('tree.open', {
- node: _this.node
- });
- };
- })(this);
- if (slide) {
- return this.getUl().slideDown('fast', doOpen);
- } else {
- this.getUl().show();
- return doOpen();
- }
- }
- };
-
- FolderElement.prototype.close = function(slide) {
- var $button, doClose;
- if (slide == null) {
- slide = true;
- }
- if (this.node.is_open) {
- this.node.is_open = false;
- $button = this.getButton();
- $button.addClass('jqtree-closed');
- $button.html('');
- $button.append(this.tree_widget.renderer.closed_icon_element.cloneNode(false));
- doClose = (function(_this) {
- return function() {
- _this.getLi().addClass('jqtree-closed');
- return _this.tree_widget._triggerEvent('tree.close', {
- node: _this.node
- });
- };
- })(this);
- if (slide) {
- return this.getUl().slideUp('fast', doClose);
- } else {
- this.getUl().hide();
- return doClose();
- }
- }
- };
-
- FolderElement.prototype.getButton = function() {
- return this.$element.children('.jqtree-element').find('a.jqtree-toggler');
- };
-
- FolderElement.prototype.addDropHint = function(position) {
- if (!this.node.is_open && position === Position.INSIDE) {
- return new BorderDropHint(this.$element);
- } else {
- return new GhostDropHint(this.node, this.$element, position);
- }
- };
-
- return FolderElement;
-
-})(NodeElement);
-
-BorderDropHint = (function() {
- function BorderDropHint($element) {
- var $div, width;
- $div = $element.children('.jqtree-element');
- width = $element.width() - 4;
- this.$hint = $('<span class="jqtree-border"></span>');
- $div.append(this.$hint);
- this.$hint.css({
- width: width,
- height: $div.outerHeight() - 4
- });
- }
-
- BorderDropHint.prototype.remove = function() {
- return this.$hint.remove();
- };
-
- return BorderDropHint;
-
-})();
-
-GhostDropHint = (function() {
- function GhostDropHint(node, $element, position) {
- this.$element = $element;
- this.node = node;
- this.$ghost = $('<li class="jqtree_common jqtree-ghost"><span class="jqtree_common jqtree-circle"></span><span class="jqtree_common jqtree-line"></span></li>');
- if (position === Position.AFTER) {
- this.moveAfter();
- } else if (position === Position.BEFORE) {
- this.moveBefore();
- } else if (position === Position.INSIDE) {
- if (node.isFolder() && node.is_open) {
- this.moveInsideOpenFolder();
- } else {
- this.moveInside();
- }
- }
- }
-
- GhostDropHint.prototype.remove = function() {
- return this.$ghost.remove();
- };
-
- GhostDropHint.prototype.moveAfter = function() {
- return this.$element.after(this.$ghost);
- };
-
- GhostDropHint.prototype.moveBefore = function() {
- return this.$element.before(this.$ghost);
- };
-
- GhostDropHint.prototype.moveInsideOpenFolder = function() {
- return $(this.node.children[0].element).before(this.$ghost);
- };
-
- GhostDropHint.prototype.moveInside = function() {
- this.$element.after(this.$ghost);
- return this.$ghost.addClass('jqtree-inside');
- };
-
- return GhostDropHint;
-
-})();
-
-module.exports = {
- FolderElement: FolderElement,
- NodeElement: NodeElement
-};
-
-},{"./node":5}],7:[function(require,module,exports){
-var $, SaveStateHandler, indexOf, isInt, util;
-
-util = require('./util');
-
-indexOf = util.indexOf;
-
-isInt = util.isInt;
-
-$ = jQuery;
-
-SaveStateHandler = (function() {
- function SaveStateHandler(tree_widget) {
- this.tree_widget = tree_widget;
- }
-
- SaveStateHandler.prototype.saveState = function() {
- var state;
- state = JSON.stringify(this.getState());
- if (this.tree_widget.options.onSetStateFromStorage) {
- return this.tree_widget.options.onSetStateFromStorage(state);
- } else if (this.supportsLocalStorage()) {
- return localStorage.setItem(this.getCookieName(), state);
- } else if ($.cookie) {
- $.cookie.raw = true;
- return $.cookie(this.getCookieName(), state, {
- path: '/'
- });
- }
- };
-
- SaveStateHandler.prototype.getStateFromStorage = function() {
- var json_data;
- json_data = this._loadFromStorage();
- if (json_data) {
- return this._parseState(json_data);
- } else {
- return null;
- }
- };
-
- SaveStateHandler.prototype._parseState = function(json_data) {
- var state;
- state = $.parseJSON(json_data);
- if (state && state.selected_node && isInt(state.selected_node)) {
- state.selected_node = [state.selected_node];
- }
- return state;
- };
-
- SaveStateHandler.prototype._loadFromStorage = function() {
- if (this.tree_widget.options.onGetStateFromStorage) {
- return this.tree_widget.options.onGetStateFromStorage();
- } else if (this.supportsLocalStorage()) {
- return localStorage.getItem(this.getCookieName());
- } else if ($.cookie) {
- $.cookie.raw = true;
- return $.cookie(this.getCookieName());
- } else {
- return null;
- }
- };
-
- SaveStateHandler.prototype.getState = function() {
- var getOpenNodeIds, getSelectedNodeIds;
- getOpenNodeIds = (function(_this) {
- return function() {
- var open_nodes;
- open_nodes = [];
- _this.tree_widget.tree.iterate(function(node) {
- if (node.is_open && node.id && node.hasChildren()) {
- open_nodes.push(node.id);
- }
- return true;
- });
- return open_nodes;
- };
- })(this);
- getSelectedNodeIds = (function(_this) {
- return function() {
- var n;
- return (function() {
- var i, len, ref, results;
- ref = this.tree_widget.getSelectedNodes();
- results = [];
- for (i = 0, len = ref.length; i < len; i++) {
- n = ref[i];
- results.push(n.id);
- }
- return results;
- }).call(_this);
- };
- })(this);
- return {
- open_nodes: getOpenNodeIds(),
- selected_node: getSelectedNodeIds()
- };
- };
-
- SaveStateHandler.prototype.setInitialState = function(state) {
- var must_load_on_demand;
- if (!state) {
- return false;
- } else {
- must_load_on_demand = this._openInitialNodes(state.open_nodes);
- this._selectInitialNodes(state.selected_node);
- return must_load_on_demand;
- }
- };
-
- SaveStateHandler.prototype._openInitialNodes = function(node_ids) {
- var i, len, must_load_on_demand, node, node_id;
- must_load_on_demand = false;
- for (i = 0, len = node_ids.length; i < len; i++) {
- node_id = node_ids[i];
- node = this.tree_widget.getNodeById(node_id);
- if (node) {
- if (!node.load_on_demand) {
- node.is_open = true;
- } else {
- must_load_on_demand = true;
- }
- }
- }
- return must_load_on_demand;
- };
-
- SaveStateHandler.prototype._selectInitialNodes = function(node_ids) {
- var i, len, node, node_id, select_count;
- select_count = 0;
- for (i = 0, len = node_ids.length; i < len; i++) {
- node_id = node_ids[i];
- node = this.tree_widget.getNodeById(node_id);
- if (node) {
- select_count += 1;
- this.tree_widget.select_node_handler.addToSelection(node);
- }
- }
- return select_count !== 0;
- };
-
- SaveStateHandler.prototype.setInitialStateOnDemand = function(state) {
- if (state) {
- return this._setInitialStateOnDemand(state.open_nodes, state.selected_node);
- }
- };
-
- SaveStateHandler.prototype._setInitialStateOnDemand = function(node_ids, selected_nodes) {
- var loadAndOpenNode, openNodes;
- openNodes = (function(_this) {
- return function() {
- var i, len, new_nodes_ids, node, node_id;
- new_nodes_ids = [];
- for (i = 0, len = node_ids.length; i < len; i++) {
- node_id = node_ids[i];
- node = _this.tree_widget.getNodeById(node_id);
- if (!node) {
- new_nodes_ids.push(node_id);
- } else {
- if (!node.is_loading) {
- if (node.load_on_demand) {
- loadAndOpenNode(node);
- } else {
- _this.tree_widget._openNode(node, false);
- }
- }
- }
- }
- node_ids = new_nodes_ids;
- if (_this._selectInitialNodes(selected_nodes)) {
- return _this.tree_widget._refreshElements();
- }
- };
- })(this);
- loadAndOpenNode = (function(_this) {
- return function(node) {
- return _this.tree_widget._openNode(node, false, openNodes);
- };
- })(this);
- return openNodes();
- };
-
- SaveStateHandler.prototype.getCookieName = function() {
- if (typeof this.tree_widget.options.saveState === 'string') {
- return this.tree_widget.options.saveState;
- } else {
- return 'tree';
- }
- };
-
- SaveStateHandler.prototype.supportsLocalStorage = function() {
- var testSupport;
- testSupport = function() {
- var error, key;
- if (typeof localStorage === "undefined" || localStorage === null) {
- return false;
- } else {
- try {
- key = '_storage_test';
- sessionStorage.setItem(key, true);
- sessionStorage.removeItem(key);
- } catch (_error) {
- error = _error;
- return false;
- }
- return true;
- }
- };
- if (this._supportsLocalStorage == null) {
- this._supportsLocalStorage = testSupport();
- }
- return this._supportsLocalStorage;
- };
-
- SaveStateHandler.prototype.getNodeIdToBeSelected = function() {
- var state;
- state = this.getStateFromStorage();
- if (state && state.selected_node) {
- return state.selected_node[0];
- } else {
- return null;
- }
- };
-
- return SaveStateHandler;
-
-})();
-
-module.exports = SaveStateHandler;
-
-},{"./util":12}],8:[function(require,module,exports){
-var $, ScrollHandler;
-
-$ = jQuery;
-
-ScrollHandler = (function() {
- function ScrollHandler(tree_widget) {
- this.tree_widget = tree_widget;
- this.previous_top = -1;
- this._initScrollParent();
- }
-
- ScrollHandler.prototype._initScrollParent = function() {
- var $scroll_parent, getParentWithOverflow, setDocumentAsScrollParent;
- getParentWithOverflow = (function(_this) {
- return function() {
- var css_values, el, hasOverFlow, i, len, ref;
- css_values = ['overflow', 'overflow-y'];
- hasOverFlow = function(el) {
- var css_value, i, len, ref;
- for (i = 0, len = css_values.length; i < len; i++) {
- css_value = css_values[i];
- if ((ref = $.css(el, css_value)) === 'auto' || ref === 'scroll') {
- return true;
- }
- }
- return false;
- };
- if (hasOverFlow(_this.tree_widget.$el[0])) {
- return _this.tree_widget.$el;
- }
- ref = _this.tree_widget.$el.parents();
- for (i = 0, len = ref.length; i < len; i++) {
- el = ref[i];
- if (hasOverFlow(el)) {
- return $(el);
- }
- }
- return null;
- };
- })(this);
- setDocumentAsScrollParent = (function(_this) {
- return function() {
- _this.scroll_parent_top = 0;
- return _this.$scroll_parent = null;
- };
- })(this);
- if (this.tree_widget.$el.css('position') === 'fixed') {
- setDocumentAsScrollParent();
- }
- $scroll_parent = getParentWithOverflow();
- if ($scroll_parent && $scroll_parent.length && $scroll_parent[0].tagName !== 'HTML') {
- this.$scroll_parent = $scroll_parent;
- return this.scroll_parent_top = this.$scroll_parent.offset().top;
- } else {
- return setDocumentAsScrollParent();
- }
- };
-
- ScrollHandler.prototype.checkScrolling = function() {
- var hovered_area;
- hovered_area = this.tree_widget.dnd_handler.hovered_area;
- if (hovered_area && hovered_area.top !== this.previous_top) {
- this.previous_top = hovered_area.top;
- if (this.$scroll_parent) {
- return this._handleScrollingWithScrollParent(hovered_area);
- } else {
- return this._handleScrollingWithDocument(hovered_area);
- }
- }
- };
-
- ScrollHandler.prototype._handleScrollingWithScrollParent = function(area) {
- var distance_bottom;
- distance_bottom = this.scroll_parent_top + this.$scroll_parent[0].offsetHeight - area.bottom;
- if (distance_bottom < 20) {
- this.$scroll_parent[0].scrollTop += 20;
- this.tree_widget.refreshHitAreas();
- return this.previous_top = -1;
- } else if ((area.top - this.scroll_parent_top) < 20) {
- this.$scroll_parent[0].scrollTop -= 20;
- this.tree_widget.refreshHitAreas();
- return this.previous_top = -1;
- }
- };
-
- ScrollHandler.prototype._handleScrollingWithDocument = function(area) {
- var distance_top;
- distance_top = area.top - $(document).scrollTop();
- if (distance_top < 20) {
- return $(document).scrollTop($(document).scrollTop() - 20);
- } else if ($(window).height() - (area.bottom - $(document).scrollTop()) < 20) {
- return $(document).scrollTop($(document).scrollTop() + 20);
- }
- };
-
- ScrollHandler.prototype.scrollTo = function(top) {
- var tree_top;
- if (this.$scroll_parent) {
- return this.$scroll_parent[0].scrollTop = top;
- } else {
- tree_top = this.tree_widget.$el.offset().top;
- return $(document).scrollTop(top + tree_top);
- }
- };
-
- ScrollHandler.prototype.isScrolledIntoView = function(element) {
- var $element, element_bottom, element_top, view_bottom, view_top;
- $element = $(element);
- if (this.$scroll_parent) {
- view_top = 0;
- view_bottom = this.$scroll_parent.height();
- element_top = $element.offset().top - this.scroll_parent_top;
- element_bottom = element_top + $element.height();
- } else {
- view_top = $(window).scrollTop();
- view_bottom = view_top + $(window).height();
- element_top = $element.offset().top;
- element_bottom = element_top + $element.height();
- }
- return (element_bottom <= view_bottom) && (element_top >= view_top);
- };
-
- return ScrollHandler;
-
-})();
-
-module.exports = ScrollHandler;
-
-},{}],9:[function(require,module,exports){
-var $, SelectNodeHandler;
-
-$ = jQuery;
-
-SelectNodeHandler = (function() {
- function SelectNodeHandler(tree_widget) {
- this.tree_widget = tree_widget;
- this.clear();
- }
-
- SelectNodeHandler.prototype.getSelectedNode = function() {
- var selected_nodes;
- selected_nodes = this.getSelectedNodes();
- if (selected_nodes.length) {
- return selected_nodes[0];
- } else {
- return false;
- }
- };
-
- SelectNodeHandler.prototype.getSelectedNodes = function() {
- var id, node, selected_nodes;
- if (this.selected_single_node) {
- return [this.selected_single_node];
- } else {
- selected_nodes = [];
- for (id in this.selected_nodes) {
- node = this.tree_widget.getNodeById(id);
- if (node) {
- selected_nodes.push(node);
- }
- }
- return selected_nodes;
- }
- };
-
- SelectNodeHandler.prototype.getSelectedNodesUnder = function(parent) {
- var id, node, selected_nodes;
- if (this.selected_single_node) {
- if (parent.isParentOf(this.selected_single_node)) {
- return [this.selected_single_node];
- } else {
- return [];
- }
- } else {
- selected_nodes = [];
- for (id in this.selected_nodes) {
- node = this.tree_widget.getNodeById(id);
- if (node && parent.isParentOf(node)) {
- selected_nodes.push(node);
- }
- }
- return selected_nodes;
- }
- };
-
- SelectNodeHandler.prototype.isNodeSelected = function(node) {
- if (node.id) {
- return this.selected_nodes[node.id];
- } else if (this.selected_single_node) {
- return this.selected_single_node.element === node.element;
- } else {
- return false;
- }
- };
-
- SelectNodeHandler.prototype.clear = function() {
- this.selected_nodes = {};
- return this.selected_single_node = null;
- };
-
- SelectNodeHandler.prototype.removeFromSelection = function(node, include_children) {
- if (include_children == null) {
- include_children = false;
- }
- if (!node.id) {
- if (this.selected_single_node && node.element === this.selected_single_node.element) {
- return this.selected_single_node = null;
- }
- } else {
- delete this.selected_nodes[node.id];
- if (include_children) {
- return node.iterate((function(_this) {
- return function(n) {
- delete _this.selected_nodes[node.id];
- return true;
- };
- })(this));
- }
- }
- };
-
- SelectNodeHandler.prototype.addToSelection = function(node) {
- if (node.id) {
- return this.selected_nodes[node.id] = true;
- } else {
- return this.selected_single_node = node;
- }
- };
-
- return SelectNodeHandler;
-
-})();
-
-module.exports = SelectNodeHandler;
-
-},{}],10:[function(require,module,exports){
-
-/*
-Copyright 2013 Marco Braak
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
- */
-var $, SimpleWidget,
- slice = [].slice;
-
-$ = jQuery;
-
-SimpleWidget = (function() {
- SimpleWidget.prototype.defaults = {};
-
- function SimpleWidget(el, options) {
- this.$el = $(el);
- this.options = $.extend({}, this.defaults, options);
- }
-
- SimpleWidget.prototype.destroy = function() {
- return this._deinit();
- };
-
- SimpleWidget.prototype._init = function() {
- return null;
- };
-
- SimpleWidget.prototype._deinit = function() {
- return null;
- };
-
- SimpleWidget.register = function(widget_class, widget_name) {
- var callFunction, createWidget, destroyWidget, getDataKey, getWidgetData;
- getDataKey = function() {
- return "simple_widget_" + widget_name;
- };
- getWidgetData = function(el, data_key) {
- var widget;
- widget = $.data(el, data_key);
- if (widget && (widget instanceof SimpleWidget)) {
- return widget;
- } else {
- return null;
- }
- };
- createWidget = function($el, options) {
- var data_key, el, existing_widget, i, len, widget;
- data_key = getDataKey();
- for (i = 0, len = $el.length; i < len; i++) {
- el = $el[i];
- existing_widget = getWidgetData(el, data_key);
- if (!existing_widget) {
- widget = new widget_class(el, options);
- if (!$.data(el, data_key)) {
- $.data(el, data_key, widget);
- }
- widget._init();
- }
- }
- return $el;
- };
- destroyWidget = function($el) {
- var data_key, el, i, len, results, widget;
- data_key = getDataKey();
- results = [];
- for (i = 0, len = $el.length; i < len; i++) {
- el = $el[i];
- widget = getWidgetData(el, data_key);
- if (widget) {
- widget.destroy();
- }
- results.push($.removeData(el, data_key));
- }
- return results;
- };
- callFunction = function($el, function_name, args) {
- var el, i, len, result, widget, widget_function;
- result = null;
- for (i = 0, len = $el.length; i < len; i++) {
- el = $el[i];
- widget = $.data(el, getDataKey());
- if (widget && (widget instanceof SimpleWidget)) {
- widget_function = widget[function_name];
- if (widget_function && (typeof widget_function === 'function')) {
- result = widget_function.apply(widget, args);
- }
- }
- }
- return result;
- };
- return $.fn[widget_name] = function() {
- var $el, args, argument1, function_name, options;
- argument1 = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : [];
- $el = this;
- if (argument1 === void 0 || typeof argument1 === 'object') {
- options = argument1;
- return createWidget($el, options);
- } else if (typeof argument1 === 'string' && argument1[0] !== '_') {
- function_name = argument1;
- if (function_name === 'destroy') {
- return destroyWidget($el);
- } else if (function_name === 'get_widget_class') {
- return widget_class;
- } else {
- return callFunction($el, function_name, args);
- }
- }
- };
- };
-
- return SimpleWidget;
-
-})();
-
-module.exports = SimpleWidget;
-
-},{}],11:[function(require,module,exports){
-
-/*
-Copyright 2013 Marco Braak
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
- */
-var $, DragAndDropHandler, ElementsRenderer, FolderElement, JqTreeWidget, KeyHandler, MouseWidget, Node, NodeElement, Position, SaveStateHandler, ScrollHandler, SelectNodeHandler, SimpleWidget, __version__, node_element, node_module, util_module,
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty;
-
-__version__ = require('./version');
-
-DragAndDropHandler = require('./drag_and_drop_handler');
-
-ElementsRenderer = require('./elements_renderer');
-
-KeyHandler = require('./key_handler');
-
-MouseWidget = require('./mouse.widget');
-
-SaveStateHandler = require('./save_state_handler');
-
-ScrollHandler = require('./scroll_handler');
-
-SelectNodeHandler = require('./select_node_handler');
-
-SimpleWidget = require('./simple.widget');
-
-node_module = require('./node');
-
-Node = node_module.Node;
-
-Position = node_module.Position;
-
-util_module = require('./util');
-
-node_element = require('./node_element');
-
-NodeElement = node_element.NodeElement;
-
-FolderElement = node_element.FolderElement;
-
-$ = jQuery;
-
-JqTreeWidget = (function(superClass) {
- extend(JqTreeWidget, superClass);
-
- function JqTreeWidget() {
- return JqTreeWidget.__super__.constructor.apply(this, arguments);
- }
-
- JqTreeWidget.prototype.defaults = {
- autoOpen: false,
- saveState: false,
- dragAndDrop: false,
- selectable: true,
- useContextMenu: true,
- onCanSelectNode: null,
- onSetStateFromStorage: null,
- onGetStateFromStorage: null,
- onCreateLi: null,
- onIsMoveHandle: null,
- onCanMove: null,
- onCanMoveTo: null,
- onLoadFailed: null,
- autoEscape: true,
- dataUrl: null,
- closedIcon: null,
- openedIcon: '▼',
- slide: true,
- nodeClass: Node,
- dataFilter: null,
- keyboardSupport: true,
- openFolderDelay: 500,
- rtl: null
- };
-
- JqTreeWidget.prototype.toggle = function(node, slide) {
- if (slide == null) {
- slide = null;
- }
- if (slide === null) {
- slide = this.options.slide;
- }
- if (node.is_open) {
- return this.closeNode(node, slide);
- } else {
- return this.openNode(node, slide);
- }
- };
-
- JqTreeWidget.prototype.getTree = function() {
- return this.tree;
- };
-
- JqTreeWidget.prototype.selectNode = function(node) {
- return this._selectNode(node, false);
- };
-
- JqTreeWidget.prototype._selectNode = function(node, must_toggle) {
- var canSelect, deselected_node, openParents, saveState;
- if (must_toggle == null) {
- must_toggle = false;
- }
- if (!this.select_node_handler) {
- return;
- }
- canSelect = (function(_this) {
- return function() {
- if (_this.options.onCanSelectNode) {
- return _this.options.selectable && _this.options.onCanSelectNode(node);
- } else {
- return _this.options.selectable;
- }
- };
- })(this);
- openParents = (function(_this) {
- return function() {
- var parent;
- parent = node.parent;
- if (parent && parent.parent && !parent.is_open) {
- return _this.openNode(parent, false);
- }
- };
- })(this);
- saveState = (function(_this) {
- return function() {
- if (_this.options.saveState) {
- return _this.save_state_handler.saveState();
- }
- };
- })(this);
- if (!node) {
- this._deselectCurrentNode();
- saveState();
- return;
- }
- if (!canSelect()) {
- return;
- }
- if (this.select_node_handler.isNodeSelected(node)) {
- if (must_toggle) {
- this._deselectCurrentNode();
- this._triggerEvent('tree.select', {
- node: null,
- previous_node: node
- });
- }
- } else {
- deselected_node = this.getSelectedNode();
- this._deselectCurrentNode();
- this.addToSelection(node);
- this._triggerEvent('tree.select', {
- node: node,
- deselected_node: deselected_node
- });
- openParents();
- }
- return saveState();
- };
-
- JqTreeWidget.prototype.getSelectedNode = function() {
- if (this.select_node_handler) {
- return this.select_node_handler.getSelectedNode();
- } else {
- return null;
- }
- };
-
- JqTreeWidget.prototype.toJson = function() {
- return JSON.stringify(this.tree.getData());
- };
-
- JqTreeWidget.prototype.loadData = function(data, parent_node) {
- return this._loadData(data, parent_node);
- };
-
- JqTreeWidget.prototype.loadDataFromUrl = function(url, parent_node, on_finished) {
- if ($.type(url) !== 'string') {
- on_finished = parent_node;
- parent_node = url;
- url = null;
- }
- return this._loadDataFromUrl(url, parent_node, on_finished);
- };
-
- JqTreeWidget.prototype.reload = function() {
- return this.loadDataFromUrl();
- };
-
- JqTreeWidget.prototype._loadDataFromUrl = function(url_info, parent_node, on_finished) {
- var $el, addLoadingClass, handeLoadData, loadDataFromUrlInfo, parseUrlInfo, removeLoadingClass;
- $el = null;
- addLoadingClass = (function(_this) {
- return function() {
- if (parent_node) {
- $el = $(parent_node.element);
- } else {
- $el = _this.element;
- }
- return $el.addClass('jqtree-loading');
- };
- })(this);
- removeLoadingClass = function() {
- if ($el) {
- return $el.removeClass('jqtree-loading');
- }
- };
- parseUrlInfo = function() {
- if ($.type(url_info) === 'string') {
- url_info = {
- url: url_info
- };
- }
- if (!url_info.method) {
- return url_info.method = 'get';
- }
- };
- handeLoadData = (function(_this) {
- return function(data) {
- removeLoadingClass();
- _this._loadData(data, parent_node);
- if (on_finished && $.isFunction(on_finished)) {
- return on_finished();
- }
- };
- })(this);
- loadDataFromUrlInfo = (function(_this) {
- return function() {
- parseUrlInfo();
- return $.ajax({
- url: url_info.url,
- data: url_info.data,
- type: url_info.method.toUpperCase(),
- cache: false,
- dataType: 'json',
- success: function(response) {
- var data;
- if ($.isArray(response) || typeof response === 'object') {
- data = response;
- } else {
- data = $.parseJSON(response);
- }
- if (_this.options.dataFilter) {
- data = _this.options.dataFilter(data);
- }
- return handeLoadData(data);
- },
- error: function(response) {
- removeLoadingClass();
- if (_this.options.onLoadFailed) {
- return _this.options.onLoadFailed(response);
- }
- }
- });
- };
- })(this);
- if (!url_info) {
- url_info = this._getDataUrlInfo(parent_node);
- }
- addLoadingClass();
- if (!url_info) {
- removeLoadingClass();
- } else if ($.isArray(url_info)) {
- handeLoadData(url_info);
- } else {
- return loadDataFromUrlInfo();
- }
- };
-
- JqTreeWidget.prototype._loadData = function(data, parent_node) {
- var deselectNodes, loadSubtree;
- if (parent_node == null) {
- parent_node = null;
- }
- deselectNodes = (function(_this) {
- return function() {
- var i, len, n, selected_nodes_under_parent;
- if (_this.select_node_handler) {
- selected_nodes_under_parent = _this.select_node_handler.getSelectedNodesUnder(parent_node);
- for (i = 0, len = selected_nodes_under_parent.length; i < len; i++) {
- n = selected_nodes_under_parent[i];
- _this.select_node_handler.removeFromSelection(n);
- }
- }
- return null;
- };
- })(this);
- loadSubtree = (function(_this) {
- return function() {
- parent_node.loadFromData(data);
- parent_node.load_on_demand = false;
- parent_node.is_loading = false;
- return _this._refreshElements(parent_node);
- };
- })(this);
- if (!data) {
- return;
- }
- this._triggerEvent('tree.load_data', {
- tree_data: data
- });
- if (!parent_node) {
- this._initTree(data);
- } else {
- deselectNodes();
- loadSubtree();
- }
- if (this.isDragging()) {
- return this.dnd_handler.refresh();
- }
- };
-
- JqTreeWidget.prototype.getNodeById = function(node_id) {
- return this.tree.getNodeById(node_id);
- };
-
- JqTreeWidget.prototype.getNodeByName = function(name) {
- return this.tree.getNodeByName(name);
- };
-
- JqTreeWidget.prototype.getNodesByProperty = function(key, value) {
- return this.tree.getNodesByProperty(key, value);
- };
-
- JqTreeWidget.prototype.openNode = function(node, slide) {
- if (slide == null) {
- slide = null;
- }
- if (slide === null) {
- slide = this.options.slide;
- }
- return this._openNode(node, slide);
- };
-
- JqTreeWidget.prototype._openNode = function(node, slide, on_finished) {
- var doOpenNode, parent;
- if (slide == null) {
- slide = true;
- }
- doOpenNode = (function(_this) {
- return function(_node, _slide, _on_finished) {
- var folder_element;
- folder_element = new FolderElement(_node, _this);
- return folder_element.open(_on_finished, _slide);
- };
- })(this);
- if (node.isFolder()) {
- if (node.load_on_demand) {
- return this._loadFolderOnDemand(node, slide, on_finished);
- } else {
- parent = node.parent;
- while (parent) {
- if (parent.parent) {
- doOpenNode(parent, false, null);
- }
- parent = parent.parent;
- }
- doOpenNode(node, slide, on_finished);
- return this._saveState();
- }
- }
- };
-
- JqTreeWidget.prototype._loadFolderOnDemand = function(node, slide, on_finished) {
- if (slide == null) {
- slide = true;
- }
- node.is_loading = true;
- return this._loadDataFromUrl(null, node, (function(_this) {
- return function() {
- return _this._openNode(node, slide, on_finished);
- };
- })(this));
- };
-
- JqTreeWidget.prototype.closeNode = function(node, slide) {
- if (slide == null) {
- slide = null;
- }
- if (slide === null) {
- slide = this.options.slide;
- }
- if (node.isFolder()) {
- new FolderElement(node, this).close(slide);
- return this._saveState();
- }
- };
-
- JqTreeWidget.prototype.isDragging = function() {
- if (this.dnd_handler) {
- return this.dnd_handler.is_dragging;
- } else {
- return false;
- }
- };
-
- JqTreeWidget.prototype.refreshHitAreas = function() {
- return this.dnd_handler.refresh();
- };
-
- JqTreeWidget.prototype.addNodeAfter = function(new_node_info, existing_node) {
- var new_node;
- new_node = existing_node.addAfter(new_node_info);
- this._refreshElements(existing_node.parent);
- return new_node;
- };
-
- JqTreeWidget.prototype.addNodeBefore = function(new_node_info, existing_node) {
- var new_node;
- new_node = existing_node.addBefore(new_node_info);
- this._refreshElements(existing_node.parent);
- return new_node;
- };
-
- JqTreeWidget.prototype.addParentNode = function(new_node_info, existing_node) {
- var new_node;
- new_node = existing_node.addParent(new_node_info);
- this._refreshElements(new_node.parent);
- return new_node;
- };
-
- JqTreeWidget.prototype.removeNode = function(node) {
- var parent;
- parent = node.parent;
- if (parent) {
- this.select_node_handler.removeFromSelection(node, true);
- node.remove();
- return this._refreshElements(parent);
- }
- };
-
- JqTreeWidget.prototype.appendNode = function(new_node_info, parent_node) {
- var node;
- parent_node = parent_node || this.tree;
- node = parent_node.append(new_node_info);
- this._refreshElements(parent_node);
- return node;
- };
-
- JqTreeWidget.prototype.prependNode = function(new_node_info, parent_node) {
- var node;
- if (!parent_node) {
- parent_node = this.tree;
- }
- node = parent_node.prepend(new_node_info);
- this._refreshElements(parent_node);
- return node;
- };
-
- JqTreeWidget.prototype.updateNode = function(node, data) {
- var id_is_changed;
- id_is_changed = data.id && data.id !== node.id;
- if (id_is_changed) {
- this.tree.removeNodeFromIndex(node);
- }
- node.setData(data);
- if (id_is_changed) {
- this.tree.addNodeToIndex(node);
- }
- this.renderer.renderFromNode(node);
- return this._selectCurrentNode();
- };
-
- JqTreeWidget.prototype.moveNode = function(node, target_node, position) {
- var position_index;
- position_index = Position.nameToIndex(position);
- this.tree.moveNode(node, target_node, position_index);
- return this._refreshElements();
- };
-
- JqTreeWidget.prototype.getStateFromStorage = function() {
- return this.save_state_handler.getStateFromStorage();
- };
-
- JqTreeWidget.prototype.addToSelection = function(node) {
- if (node) {
- this.select_node_handler.addToSelection(node);
- this._getNodeElementForNode(node).select();
- return this._saveState();
- }
- };
-
- JqTreeWidget.prototype.getSelectedNodes = function() {
- return this.select_node_handler.getSelectedNodes();
- };
-
- JqTreeWidget.prototype.isNodeSelected = function(node) {
- return this.select_node_handler.isNodeSelected(node);
- };
-
- JqTreeWidget.prototype.removeFromSelection = function(node) {
- this.select_node_handler.removeFromSelection(node);
- this._getNodeElementForNode(node).deselect();
- return this._saveState();
- };
-
- JqTreeWidget.prototype.scrollToNode = function(node) {
- var $element, top;
- $element = $(node.element);
- top = $element.offset().top - this.$el.offset().top;
- return this.scroll_handler.scrollTo(top);
- };
-
- JqTreeWidget.prototype.getState = function() {
- return this.save_state_handler.getState();
- };
-
- JqTreeWidget.prototype.setState = function(state) {
- this.save_state_handler.setInitialState(state);
- return this._refreshElements();
- };
-
- JqTreeWidget.prototype.setOption = function(option, value) {
- return this.options[option] = value;
- };
-
- JqTreeWidget.prototype.moveDown = function() {
- if (this.key_handler) {
- return this.key_handler.moveDown();
- }
- };
-
- JqTreeWidget.prototype.moveUp = function() {
- if (this.key_handler) {
- return this.key_handler.moveUp();
- }
- };
-
- JqTreeWidget.prototype.getVersion = function() {
- return __version__;
- };
-
- JqTreeWidget.prototype._init = function() {
- JqTreeWidget.__super__._init.call(this);
- this.element = this.$el;
- this.mouse_delay = 300;
- this.is_initialized = false;
- this.options.rtl = this._getRtlOption();
- if (!this.options.closedIcon) {
- this.options.closedIcon = this._getDefaultClosedIcon();
- }
- this.renderer = new ElementsRenderer(this);
- if (SaveStateHandler != null) {
- this.save_state_handler = new SaveStateHandler(this);
- } else {
- this.options.saveState = false;
- }
- if (SelectNodeHandler != null) {
- this.select_node_handler = new SelectNodeHandler(this);
- }
- if (DragAndDropHandler != null) {
- this.dnd_handler = new DragAndDropHandler(this);
- } else {
- this.options.dragAndDrop = false;
- }
- if (ScrollHandler != null) {
- this.scroll_handler = new ScrollHandler(this);
- }
- if ((KeyHandler != null) && (SelectNodeHandler != null)) {
- this.key_handler = new KeyHandler(this);
- }
- this._initData();
- this.element.click($.proxy(this._click, this));
- this.element.dblclick($.proxy(this._dblclick, this));
- if (this.options.useContextMenu) {
- return this.element.bind('contextmenu', $.proxy(this._contextmenu, this));
- }
- };
-
- JqTreeWidget.prototype._deinit = function() {
- this.element.empty();
- this.element.unbind();
- if (this.key_handler) {
- this.key_handler.deinit();
- }
- this.tree = null;
- return JqTreeWidget.__super__._deinit.call(this);
- };
-
- JqTreeWidget.prototype._initData = function() {
- if (this.options.data) {
- return this._loadData(this.options.data);
- } else {
- return this._loadDataFromUrl(this._getDataUrlInfo());
- }
- };
-
- JqTreeWidget.prototype._getDataUrlInfo = function(node) {
- var data_url, getUrlFromString;
- data_url = this.options.dataUrl || this.element.data('url');
- getUrlFromString = (function(_this) {
- return function() {
- var data, selected_node_id, url_info;
- url_info = {
- url: data_url
- };
- if (node && node.id) {
- data = {
- node: node.id
- };
- url_info['data'] = data;
- } else {
- selected_node_id = _this._getNodeIdToBeSelected();
- if (selected_node_id) {
- data = {
- selected_node: selected_node_id
- };
- url_info['data'] = data;
- }
- }
- return url_info;
- };
- })(this);
- if ($.isFunction(data_url)) {
- return data_url(node);
- } else if ($.type(data_url) === 'string') {
- return getUrlFromString();
- } else {
- return data_url;
- }
- };
-
- JqTreeWidget.prototype._getNodeIdToBeSelected = function() {
- if (this.options.saveState) {
- return this.save_state_handler.getNodeIdToBeSelected();
- } else {
- return null;
- }
- };
-
- JqTreeWidget.prototype._initTree = function(data) {
- var must_load_on_demand;
- this.tree = new this.options.nodeClass(null, true, this.options.nodeClass);
- if (this.select_node_handler) {
- this.select_node_handler.clear();
- }
- this.tree.loadFromData(data);
- must_load_on_demand = this._setInitialState();
- this._refreshElements();
- if (must_load_on_demand) {
- this._setInitialStateOnDemand();
- }
- if (!this.is_initialized) {
- this.is_initialized = true;
- return this._triggerEvent('tree.init');
- }
- };
-
- JqTreeWidget.prototype._setInitialState = function() {
- var autoOpenNodes, is_restored, must_load_on_demand, ref, restoreState;
- restoreState = (function(_this) {
- return function() {
- var must_load_on_demand, state;
- if (!(_this.options.saveState && _this.save_state_handler)) {
- return [false, false];
- } else {
- state = _this.save_state_handler.getStateFromStorage();
- if (!state) {
- return [false, false];
- } else {
- must_load_on_demand = _this.save_state_handler.setInitialState(state);
- return [true, must_load_on_demand];
- }
- }
- };
- })(this);
- autoOpenNodes = (function(_this) {
- return function() {
- var max_level, must_load_on_demand;
- if (_this.options.autoOpen === false) {
- return false;
- }
- max_level = _this._getAutoOpenMaxLevel();
- must_load_on_demand = false;
- _this.tree.iterate(function(node, level) {
- if (node.load_on_demand) {
- must_load_on_demand = true;
- return false;
- } else if (!node.hasChildren()) {
- return false;
- } else {
- node.is_open = true;
- return level !== max_level;
- }
- });
- return must_load_on_demand;
- };
- })(this);
- ref = restoreState(), is_restored = ref[0], must_load_on_demand = ref[1];
- if (!is_restored) {
- must_load_on_demand = autoOpenNodes();
- }
- return must_load_on_demand;
- };
-
- JqTreeWidget.prototype._setInitialStateOnDemand = function() {
- var autoOpenNodes, restoreState;
- restoreState = (function(_this) {
- return function() {
- var state;
- if (!(_this.options.saveState && _this.save_state_handler)) {
- return false;
- } else {
- state = _this.save_state_handler.getStateFromStorage();
- if (!state) {
- return false;
- } else {
- _this.save_state_handler.setInitialStateOnDemand(state);
- return true;
- }
- }
- };
- })(this);
- autoOpenNodes = (function(_this) {
- return function() {
- var loadAndOpenNode, loading_ids, max_level, openNodes;
- max_level = _this._getAutoOpenMaxLevel();
- loading_ids = [];
- loadAndOpenNode = function(node) {
- return _this._openNode(node, false, openNodes);
- };
- openNodes = function() {
- return _this.tree.iterate(function(node, level) {
- if (node.load_on_demand) {
- if (!node.is_loading) {
- loadAndOpenNode(node);
- }
- return false;
- } else {
- _this._openNode(node, false);
- return level !== max_level;
- }
- });
- };
- return openNodes();
- };
- })(this);
- if (!restoreState()) {
- return autoOpenNodes();
- }
- };
-
- JqTreeWidget.prototype._getAutoOpenMaxLevel = function() {
- if (this.options.autoOpen === true) {
- return -1;
- } else {
- return parseInt(this.options.autoOpen);
- }
- };
-
-
- /*
- Redraw the tree or part of the tree.
- * from_node: redraw this subtree
- */
-
- JqTreeWidget.prototype._refreshElements = function(from_node) {
- if (from_node == null) {
- from_node = null;
- }
- this.renderer.render(from_node);
- return this._triggerEvent('tree.refresh');
- };
-
- JqTreeWidget.prototype._click = function(e) {
- var click_target, event, node;
- click_target = this._getClickTarget(e.target);
- if (click_target) {
- if (click_target.type === 'button') {
- this.toggle(click_target.node, this.options.slide);
- e.preventDefault();
- return e.stopPropagation();
- } else if (click_target.type === 'label') {
- node = click_target.node;
- event = this._triggerEvent('tree.click', {
- node: node,
- click_event: e
- });
- if (!event.isDefaultPrevented()) {
- return this._selectNode(node, true);
- }
- }
- }
- };
-
- JqTreeWidget.prototype._dblclick = function(e) {
- var click_target;
- click_target = this._getClickTarget(e.target);
- if (click_target && click_target.type === 'label') {
- return this._triggerEvent('tree.dblclick', {
- node: click_target.node,
- click_event: e
- });
- }
- };
-
- JqTreeWidget.prototype._getClickTarget = function(element) {
- var $button, $el, $target, node;
- $target = $(element);
- $button = $target.closest('.jqtree-toggler');
- if ($button.length) {
- node = this._getNode($button);
- if (node) {
- return {
- type: 'button',
- node: node
- };
- }
- } else {
- $el = $target.closest('.jqtree-element');
- if ($el.length) {
- node = this._getNode($el);
- if (node) {
- return {
- type: 'label',
- node: node
- };
- }
- }
- }
- return null;
- };
-
- JqTreeWidget.prototype._getNode = function($element) {
- var $li;
- $li = $element.closest('li.jqtree_common');
- if ($li.length === 0) {
- return null;
- } else {
- return $li.data('node');
- }
- };
-
- JqTreeWidget.prototype._getNodeElementForNode = function(node) {
- if (node.isFolder()) {
- return new FolderElement(node, this);
- } else {
- return new NodeElement(node, this);
- }
- };
-
- JqTreeWidget.prototype._getNodeElement = function($element) {
- var node;
- node = this._getNode($element);
- if (node) {
- return this._getNodeElementForNode(node);
- } else {
- return null;
- }
- };
-
- JqTreeWidget.prototype._contextmenu = function(e) {
- var $div, node;
- $div = $(e.target).closest('ul.jqtree-tree .jqtree-element');
- if ($div.length) {
- node = this._getNode($div);
- if (node) {
- e.preventDefault();
- e.stopPropagation();
- this._triggerEvent('tree.contextmenu', {
- node: node,
- click_event: e
- });
- return false;
- }
- }
- };
-
- JqTreeWidget.prototype._saveState = function() {
- if (this.options.saveState) {
- return this.save_state_handler.saveState();
- }
- };
-
- JqTreeWidget.prototype._mouseCapture = function(position_info) {
- if (this.options.dragAndDrop) {
- return this.dnd_handler.mouseCapture(position_info);
- } else {
- return false;
- }
- };
-
- JqTreeWidget.prototype._mouseStart = function(position_info) {
- if (this.options.dragAndDrop) {
- return this.dnd_handler.mouseStart(position_info);
- } else {
- return false;
- }
- };
-
- JqTreeWidget.prototype._mouseDrag = function(position_info) {
- var result;
- if (this.options.dragAndDrop) {
- result = this.dnd_handler.mouseDrag(position_info);
- if (this.scroll_handler) {
- this.scroll_handler.checkScrolling();
- }
- return result;
- } else {
- return false;
- }
- };
-
- JqTreeWidget.prototype._mouseStop = function(position_info) {
- if (this.options.dragAndDrop) {
- return this.dnd_handler.mouseStop(position_info);
- } else {
- return false;
- }
- };
-
- JqTreeWidget.prototype._triggerEvent = function(event_name, values) {
- var event;
- event = $.Event(event_name);
- $.extend(event, values);
- this.element.trigger(event);
- return event;
- };
-
- JqTreeWidget.prototype.testGenerateHitAreas = function(moving_node) {
- this.dnd_handler.current_item = this._getNodeElementForNode(moving_node);
- this.dnd_handler.generateHitAreas();
- return this.dnd_handler.hit_areas;
- };
-
- JqTreeWidget.prototype._selectCurrentNode = function() {
- var node;
- node = this.getSelectedNode();
- if (node) {
- node_element = this._getNodeElementForNode(node);
- if (node_element) {
- return node_element.select();
- }
- }
- };
-
- JqTreeWidget.prototype._deselectCurrentNode = function() {
- var node;
- node = this.getSelectedNode();
- if (node) {
- return this.removeFromSelection(node);
- }
- };
-
- JqTreeWidget.prototype._getDefaultClosedIcon = function() {
- if (this.options.rtl) {
- return '◀';
- } else {
- return '►';
- }
- };
-
- JqTreeWidget.prototype._getRtlOption = function() {
- var data_rtl;
- if (this.options.rtl !== null) {
- return this.options.rtl;
- } else {
- data_rtl = this.element.data('rtl');
- if ((data_rtl != null) && data_rtl !== false) {
- return true;
- } else {
- return false;
- }
- }
- };
-
- return JqTreeWidget;
-
-})(MouseWidget);
-
-JqTreeWidget.getModule = function(name) {
- var modules;
- modules = {
- 'node': node_module,
- 'util': util_module
- };
- return modules[name];
-};
-
-SimpleWidget.register(JqTreeWidget, 'tree');
-
-},{"./drag_and_drop_handler":1,"./elements_renderer":2,"./key_handler":3,"./mouse.widget":4,"./node":5,"./node_element":6,"./save_state_handler":7,"./scroll_handler":8,"./select_node_handler":9,"./simple.widget":10,"./util":12,"./version":13}],12:[function(require,module,exports){
-var _indexOf, html_escape, indexOf, isInt;
-
-_indexOf = function(array, item) {
- var i, j, len, value;
- for (i = j = 0, len = array.length; j < len; i = ++j) {
- value = array[i];
- if (value === item) {
- return i;
- }
- }
- return -1;
-};
-
-indexOf = function(array, item) {
- if (array.indexOf) {
- return array.indexOf(item);
- } else {
- return _indexOf(array, item);
- }
-};
-
-isInt = function(n) {
- return typeof n === 'number' && n % 1 === 0;
-};
-
-html_escape = function(string) {
- return ('' + string).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''').replace(/\//g, '/');
-};
-
-module.exports = {
- _indexOf: _indexOf,
- html_escape: html_escape,
- indexOf: indexOf,
- isInt: isInt
-};
-
-},{}],13:[function(require,module,exports){
-module.exports = '1.2.1';
-
-},{}]},{},[11]);
diff --git a/traffic_ops/app/public/js/jquery.dataTables.js b/traffic_ops/app/public/js/jquery.dataTables.js
deleted file mode 100644
index e749018..0000000
--- a/traffic_ops/app/public/js/jquery.dataTables.js
+++ /dev/null
@@ -1,15345 +0,0 @@
-/*! DataTables 1.10.15
- * ©2008-2017 SpryMedia Ltd - datatables.net/license
- */
-
-/**
- * @summary DataTables
- * @description Paginate, search and order HTML tables
- * @version 1.10.15
- * @file jquery.dataTables.js
- * @author SpryMedia Ltd
- * @contact www.datatables.net
- * @copyright Copyright 2008-2017 SpryMedia Ltd.
- *
- * This source file is free software, available under the following license:
- * MIT license - http://datatables.net/license
- *
- * This source file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
- *
- * For details please refer to: http://www.datatables.net
- */
-
-/*jslint evil: true, undef: true, browser: true */
-/*globals $,require,jQuery,define,_selector_run,_selector_opts,_selector_first,_selector_row_indexes,_ext,_Api,_api_register,_api_registerPlural,_re_new_lines,_re_html,_re_formatted_numeric,_re_escape_regex,_empty,_intVal,_numToDecimal,_isNumber,_isHtml,_htmlNumeric,_pluck,_pluck_order,_range,_stripHtml,_unique,_fnBuildAjax,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnAjaxDataSrc,_fnAddColumn,_fnColumnOptions,_fnAdjustColumnSizing,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_ [...]
-
-(function( factory ) {
- "use strict";
-
- if ( typeof define === 'function' && define.amd ) {
- // AMD
- define( ['jquery'], function ( $ ) {
- return factory( $, window, document );
- } );
- }
- else if ( typeof exports === 'object' ) {
- // CommonJS
- module.exports = function (root, $) {
- if ( ! root ) {
- // CommonJS environments without a window global must pass a
- // root. This will give an error otherwise
- root = window;
- }
-
- if ( ! $ ) {
- $ = typeof window !== 'undefined' ? // jQuery's factory checks for a global window
- require('jquery') :
- require('jquery')( root );
- }
-
- return factory( $, root, root.document );
- };
- }
- else {
- // Browser
- factory( jQuery, window, document );
- }
-}
-(function( $, window, document, undefined ) {
- "use strict";
-
- /**
- * DataTables is a plug-in for the jQuery Javascript library. It is a highly
- * flexible tool, based upon the foundations of progressive enhancement,
- * which will add advanced interaction controls to any HTML table. For a
- * full list of features please refer to
- * [DataTables.net](href="http://datatables.net).
- *
- * Note that the `DataTable` object is not a global variable but is aliased
- * to `jQuery.fn.DataTable` and `jQuery.fn.dataTable` through which it may
- * be accessed.
- *
- * @class
- * @param {object} [init={}] Configuration object for DataTables. Options
- * are defined by {@link DataTable.defaults}
- * @requires jQuery 1.7+
- *
- * @example
- * // Basic initialisation
- * $(document).ready( function {
- * $('#example').dataTable();
- * } );
- *
- * @example
- * // Initialisation with configuration options - in this case, disable
- * // pagination and sorting.
- * $(document).ready( function {
- * $('#example').dataTable( {
- * "paginate": false,
- * "sort": false
- * } );
- * } );
- */
- var DataTable = function ( options )
- {
- /**
- * Perform a jQuery selector action on the table's TR elements (from the tbody) and
- * return the resulting jQuery object.
- * @param {string|node|jQuery} sSelector jQuery selector or node collection to act on
- * @param {object} [oOpts] Optional parameters for modifying the rows to be included
- * @param {string} [oOpts.filter=none] Select TR elements that meet the current filter
- * criterion ("applied") or all TR elements (i.e. no filter).
- * @param {string} [oOpts.order=current] Order of the TR elements in the processed array.
- * Can be either 'current', whereby the current sorting of the table is used, or
- * 'original' whereby the original order the data was read into the table is used.
- * @param {string} [oOpts.page=all] Limit the selection to the currently displayed page
- * ("current") or not ("all"). If 'current' is given, then order is assumed to be
- * 'current' and filter is 'applied', regardless of what they might be given as.
- * @returns {object} jQuery object, filtered by the given selector.
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable = $('#example').dataTable();
- *
- * // Highlight every second row
- * oTable.$('tr:odd').css('backgroundColor', 'blue');
- * } );
- *
- * @example
- * $(document).ready(function() {
- * var oTable = $('#example').dataTable();
- *
- * // Filter to rows with 'Webkit' in them, add a background colour and then
- * // remove the filter, thus highlighting the 'Webkit' rows only.
- * oTable.fnFilter('Webkit');
- * oTable.$('tr', {"search": "applied"}).css('backgroundColor', 'blue');
- * oTable.fnFilter('');
- * } );
- */
- this.$ = function ( sSelector, oOpts )
- {
- return this.api(true).$( sSelector, oOpts );
- };
-
-
- /**
- * Almost identical to $ in operation, but in this case returns the data for the matched
- * rows - as such, the jQuery selector used should match TR row nodes or TD/TH cell nodes
- * rather than any descendants, so the data can be obtained for the row/cell. If matching
- * rows are found, the data returned is the original data array/object that was used to
- * create the row (or a generated array if from a DOM source).
- *
- * This method is often useful in-combination with $ where both functions are given the
- * same parameters and the array indexes will match identically.
- * @param {string|node|jQuery} sSelector jQuery selector or node collection to act on
- * @param {object} [oOpts] Optional parameters for modifying the rows to be included
- * @param {string} [oOpts.filter=none] Select elements that meet the current filter
- * criterion ("applied") or all elements (i.e. no filter).
- * @param {string} [oOpts.order=current] Order of the data in the processed array.
- * Can be either 'current', whereby the current sorting of the table is used, or
- * 'original' whereby the original order the data was read into the table is used.
- * @param {string} [oOpts.page=all] Limit the selection to the currently displayed page
- * ("current") or not ("all"). If 'current' is given, then order is assumed to be
- * 'current' and filter is 'applied', regardless of what they might be given as.
- * @returns {array} Data for the matched elements. If any elements, as a result of the
- * selector, were not TR, TD or TH elements in the DataTable, they will have a null
- * entry in the array.
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable = $('#example').dataTable();
- *
- * // Get the data from the first row in the table
- * var data = oTable._('tr:first');
- *
- * // Do something useful with the data
- * alert( "First cell is: "+data[0] );
- * } );
- *
- * @example
- * $(document).ready(function() {
- * var oTable = $('#example').dataTable();
- *
- * // Filter to 'Webkit' and get all data for
- * oTable.fnFilter('Webkit');
- * var data = oTable._('tr', {"search": "applied"});
- *
- * // Do something with the data
- * alert( data.length+" rows matched the search" );
- * } );
- */
- this._ = function ( sSelector, oOpts )
- {
- return this.api(true).rows( sSelector, oOpts ).data();
- };
-
-
- /**
- * Create a DataTables Api instance, with the currently selected tables for
- * the Api's context.
- * @param {boolean} [traditional=false] Set the API instance's context to be
- * only the table referred to by the `DataTable.ext.iApiIndex` option, as was
- * used in the API presented by DataTables 1.9- (i.e. the traditional mode),
- * or if all tables captured in the jQuery object should be used.
- * @return {DataTables.Api}
- */
- this.api = function ( traditional )
- {
- return traditional ?
- new _Api(
- _fnSettingsFromNode( this[ _ext.iApiIndex ] )
- ) :
- new _Api( this );
- };
-
-
- /**
- * Add a single new row or multiple rows of data to the table. Please note
- * that this is suitable for client-side processing only - if you are using
- * server-side processing (i.e. "bServerSide": true), then to add data, you
- * must add it to the data source, i.e. the server-side, through an Ajax call.
- * @param {array|object} data The data to be added to the table. This can be:
- * <ul>
- * <li>1D array of data - add a single row with the data provided</li>
- * <li>2D array of arrays - add multiple rows in a single call</li>
- * <li>object - data object when using <i>mData</i></li>
- * <li>array of objects - multiple data objects when using <i>mData</i></li>
- * </ul>
- * @param {bool} [redraw=true] redraw the table or not
- * @returns {array} An array of integers, representing the list of indexes in
- * <i>aoData</i> ({@link DataTable.models.oSettings}) that have been added to
- * the table.
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * // Global var for counter
- * var giCount = 2;
- *
- * $(document).ready(function() {
- * $('#example').dataTable();
- * } );
- *
- * function fnClickAddRow() {
- * $('#example').dataTable().fnAddData( [
- * giCount+".1",
- * giCount+".2",
- * giCount+".3",
- * giCount+".4" ]
- * );
- *
- * giCount++;
- * }
- */
- this.fnAddData = function( data, redraw )
- {
- var api = this.api( true );
-
- /* Check if we want to add multiple rows or not */
- var rows = $.isArray(data) && ( $.isArray(data[0]) || $.isPlainObject(data[0]) ) ?
- api.rows.add( data ) :
- api.row.add( data );
-
- if ( redraw === undefined || redraw ) {
- api.draw();
- }
-
- return rows.flatten().toArray();
- };
-
-
- /**
- * This function will make DataTables recalculate the column sizes, based on the data
- * contained in the table and the sizes applied to the columns (in the DOM, CSS or
- * through the sWidth parameter). This can be useful when the width of the table's
- * parent element changes (for example a window resize).
- * @param {boolean} [bRedraw=true] Redraw the table or not, you will typically want to
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable = $('#example').dataTable( {
- * "sScrollY": "200px",
- * "bPaginate": false
- * } );
- *
- * $(window).on('resize', function () {
- * oTable.fnAdjustColumnSizing();
- * } );
- * } );
- */
- this.fnAdjustColumnSizing = function ( bRedraw )
- {
- var api = this.api( true ).columns.adjust();
- var settings = api.settings()[0];
- var scroll = settings.oScroll;
-
- if ( bRedraw === undefined || bRedraw ) {
- api.draw( false );
- }
- else if ( scroll.sX !== "" || scroll.sY !== "" ) {
- /* If not redrawing, but scrolling, we want to apply the new column sizes anyway */
- _fnScrollDraw( settings );
- }
- };
-
-
- /**
- * Quickly and simply clear a table
- * @param {bool} [bRedraw=true] redraw the table or not
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable = $('#example').dataTable();
- *
- * // Immediately 'nuke' the current rows (perhaps waiting for an Ajax callback...)
- * oTable.fnClearTable();
- * } );
- */
- this.fnClearTable = function( bRedraw )
- {
- var api = this.api( true ).clear();
-
- if ( bRedraw === undefined || bRedraw ) {
- api.draw();
- }
- };
-
-
- /**
- * The exact opposite of 'opening' a row, this function will close any rows which
- * are currently 'open'.
- * @param {node} nTr the table row to 'close'
- * @returns {int} 0 on success, or 1 if failed (can't find the row)
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable;
- *
- * // 'open' an information row when a row is clicked on
- * $('#example tbody tr').click( function () {
- * if ( oTable.fnIsOpen(this) ) {
- * oTable.fnClose( this );
- * } else {
- * oTable.fnOpen( this, "Temporary row opened", "info_row" );
- * }
- * } );
- *
- * oTable = $('#example').dataTable();
- * } );
- */
- this.fnClose = function( nTr )
- {
- this.api( true ).row( nTr ).child.hide();
- };
-
-
- /**
- * Remove a row for the table
- * @param {mixed} target The index of the row from aoData to be deleted, or
- * the TR element you want to delete
- * @param {function|null} [callBack] Callback function
- * @param {bool} [redraw=true] Redraw the table or not
- * @returns {array} The row that was deleted
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable = $('#example').dataTable();
- *
- * // Immediately remove the first row
- * oTable.fnDeleteRow( 0 );
- * } );
- */
- this.fnDeleteRow = function( target, callback, redraw )
- {
- var api = this.api( true );
- var rows = api.rows( target );
- var settings = rows.settings()[0];
- var data = settings.aoData[ rows[0][0] ];
-
- rows.remove();
-
- if ( callback ) {
- callback.call( this, settings, data );
- }
-
- if ( redraw === undefined || redraw ) {
- api.draw();
- }
-
- return data;
- };
-
-
- /**
- * Restore the table to it's original state in the DOM by removing all of DataTables
- * enhancements, alterations to the DOM structure of the table and event listeners.
- * @param {boolean} [remove=false] Completely remove the table from the DOM
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * // This example is fairly pointless in reality, but shows how fnDestroy can be used
- * var oTable = $('#example').dataTable();
- * oTable.fnDestroy();
- * } );
- */
- this.fnDestroy = function ( remove )
- {
- this.api( true ).destroy( remove );
- };
-
-
- /**
- * Redraw the table
- * @param {bool} [complete=true] Re-filter and resort (if enabled) the table before the draw.
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable = $('#example').dataTable();
- *
- * // Re-draw the table - you wouldn't want to do it here, but it's an example :-)
- * oTable.fnDraw();
- * } );
- */
- this.fnDraw = function( complete )
- {
- // Note that this isn't an exact match to the old call to _fnDraw - it takes
- // into account the new data, but can hold position.
- this.api( true ).draw( complete );
- };
-
-
- /**
- * Filter the input based on data
- * @param {string} sInput String to filter the table on
- * @param {int|null} [iColumn] Column to limit filtering to
- * @param {bool} [bRegex=false] Treat as regular expression or not
- * @param {bool} [bSmart=true] Perform smart filtering or not
- * @param {bool} [bShowGlobal=true] Show the input global filter in it's input box(es)
- * @param {bool} [bCaseInsensitive=true] Do case-insensitive matching (true) or not (false)
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable = $('#example').dataTable();
- *
- * // Sometime later - filter...
- * oTable.fnFilter( 'test string' );
- * } );
- */
- this.fnFilter = function( sInput, iColumn, bRegex, bSmart, bShowGlobal, bCaseInsensitive )
- {
- var api = this.api( true );
-
- if ( iColumn === null || iColumn === undefined ) {
- api.search( sInput, bRegex, bSmart, bCaseInsensitive );
- }
- else {
- api.column( iColumn ).search( sInput, bRegex, bSmart, bCaseInsensitive );
- }
-
- api.draw();
- };
-
-
- /**
- * Get the data for the whole table, an individual row or an individual cell based on the
- * provided parameters.
- * @param {int|node} [src] A TR row node, TD/TH cell node or an integer. If given as
- * a TR node then the data source for the whole row will be returned. If given as a
- * TD/TH cell node then iCol will be automatically calculated and the data for the
- * cell returned. If given as an integer, then this is treated as the aoData internal
- * data index for the row (see fnGetPosition) and the data for that row used.
- * @param {int} [col] Optional column index that you want the data of.
- * @returns {array|object|string} If mRow is undefined, then the data for all rows is
- * returned. If mRow is defined, just data for that row, and is iCol is
- * defined, only data for the designated cell is returned.
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * // Row data
- * $(document).ready(function() {
- * oTable = $('#example').dataTable();
- *
- * oTable.$('tr').click( function () {
- * var data = oTable.fnGetData( this );
- * // ... do something with the array / object of data for the row
- * } );
- * } );
- *
- * @example
- * // Individual cell data
- * $(document).ready(function() {
- * oTable = $('#example').dataTable();
- *
- * oTable.$('td').click( function () {
- * var sData = oTable.fnGetData( this );
- * alert( 'The cell clicked on had the value of '+sData );
- * } );
- * } );
- */
- this.fnGetData = function( src, col )
- {
- var api = this.api( true );
-
- if ( src !== undefined ) {
- var type = src.nodeName ? src.nodeName.toLowerCase() : '';
-
- return col !== undefined || type == 'td' || type == 'th' ?
- api.cell( src, col ).data() :
- api.row( src ).data() || null;
- }
-
- return api.data().toArray();
- };
-
-
- /**
- * Get an array of the TR nodes that are used in the table's body. Note that you will
- * typically want to use the '$' API method in preference to this as it is more
- * flexible.
- * @param {int} [iRow] Optional row index for the TR element you want
- * @returns {array|node} If iRow is undefined, returns an array of all TR elements
- * in the table's body, or iRow is defined, just the TR element requested.
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable = $('#example').dataTable();
- *
- * // Get the nodes from the table
- * var nNodes = oTable.fnGetNodes( );
- * } );
- */
- this.fnGetNodes = function( iRow )
- {
- var api = this.api( true );
-
- return iRow !== undefined ?
- api.row( iRow ).node() :
- api.rows().nodes().flatten().toArray();
- };
-
-
- /**
- * Get the array indexes of a particular cell from it's DOM element
- * and column index including hidden columns
- * @param {node} node this can either be a TR, TD or TH in the table's body
- * @returns {int} If nNode is given as a TR, then a single index is returned, or
- * if given as a cell, an array of [row index, column index (visible),
- * column index (all)] is given.
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * $('#example tbody td').click( function () {
- * // Get the position of the current data from the node
- * var aPos = oTable.fnGetPosition( this );
- *
- * // Get the data array for this row
- * var aData = oTable.fnGetData( aPos[0] );
- *
- * // Update the data array and return the value
- * aData[ aPos[1] ] = 'clicked';
- * this.innerHTML = 'clicked';
- * } );
- *
- * // Init DataTables
- * oTable = $('#example').dataTable();
- * } );
- */
- this.fnGetPosition = function( node )
- {
- var api = this.api( true );
- var nodeName = node.nodeName.toUpperCase();
-
- if ( nodeName == 'TR' ) {
- return api.row( node ).index();
- }
- else if ( nodeName == 'TD' || nodeName == 'TH' ) {
- var cell = api.cell( node ).index();
-
- return [
- cell.row,
- cell.columnVisible,
- cell.column
- ];
- }
- return null;
- };
-
-
- /**
- * Check to see if a row is 'open' or not.
- * @param {node} nTr the table row to check
- * @returns {boolean} true if the row is currently open, false otherwise
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable;
- *
- * // 'open' an information row when a row is clicked on
- * $('#example tbody tr').click( function () {
- * if ( oTable.fnIsOpen(this) ) {
- * oTable.fnClose( this );
- * } else {
- * oTable.fnOpen( this, "Temporary row opened", "info_row" );
- * }
- * } );
- *
- * oTable = $('#example').dataTable();
- * } );
- */
- this.fnIsOpen = function( nTr )
- {
- return this.api( true ).row( nTr ).child.isShown();
- };
-
-
- /**
- * This function will place a new row directly after a row which is currently
- * on display on the page, with the HTML contents that is passed into the
- * function. This can be used, for example, to ask for confirmation that a
- * particular record should be deleted.
- * @param {node} nTr The table row to 'open'
- * @param {string|node|jQuery} mHtml The HTML to put into the row
- * @param {string} sClass Class to give the new TD cell
- * @returns {node} The row opened. Note that if the table row passed in as the
- * first parameter, is not found in the table, this method will silently
- * return.
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable;
- *
- * // 'open' an information row when a row is clicked on
- * $('#example tbody tr').click( function () {
- * if ( oTable.fnIsOpen(this) ) {
- * oTable.fnClose( this );
- * } else {
- * oTable.fnOpen( this, "Temporary row opened", "info_row" );
- * }
- * } );
- *
- * oTable = $('#example').dataTable();
- * } );
- */
- this.fnOpen = function( nTr, mHtml, sClass )
- {
- return this.api( true )
- .row( nTr )
- .child( mHtml, sClass )
- .show()
- .child()[0];
- };
-
-
- /**
- * Change the pagination - provides the internal logic for pagination in a simple API
- * function. With this function you can have a DataTables table go to the next,
- * previous, first or last pages.
- * @param {string|int} mAction Paging action to take: "first", "previous", "next" or "last"
- * or page number to jump to (integer), note that page 0 is the first page.
- * @param {bool} [bRedraw=true] Redraw the table or not
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable = $('#example').dataTable();
- * oTable.fnPageChange( 'next' );
- * } );
- */
- this.fnPageChange = function ( mAction, bRedraw )
- {
- var api = this.api( true ).page( mAction );
-
- if ( bRedraw === undefined || bRedraw ) {
- api.draw(false);
- }
- };
-
-
- /**
- * Show a particular column
- * @param {int} iCol The column whose display should be changed
- * @param {bool} bShow Show (true) or hide (false) the column
- * @param {bool} [bRedraw=true] Redraw the table or not
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable = $('#example').dataTable();
- *
- * // Hide the second column after initialisation
- * oTable.fnSetColumnVis( 1, false );
- * } );
- */
- this.fnSetColumnVis = function ( iCol, bShow, bRedraw )
- {
- var api = this.api( true ).column( iCol ).visible( bShow );
-
- if ( bRedraw === undefined || bRedraw ) {
- api.columns.adjust().draw();
- }
- };
-
-
- /**
- * Get the settings for a particular table for external manipulation
- * @returns {object} DataTables settings object. See
- * {@link DataTable.models.oSettings}
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable = $('#example').dataTable();
- * var oSettings = oTable.fnSettings();
- *
- * // Show an example parameter from the settings
- * alert( oSettings._iDisplayStart );
- * } );
- */
- this.fnSettings = function()
- {
- return _fnSettingsFromNode( this[_ext.iApiIndex] );
- };
-
-
- /**
- * Sort the table by a particular column
- * @param {int} iCol the data index to sort on. Note that this will not match the
- * 'display index' if you have hidden data entries
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable = $('#example').dataTable();
- *
- * // Sort immediately with columns 0 and 1
- * oTable.fnSort( [ [0,'asc'], [1,'asc'] ] );
- * } );
- */
- this.fnSort = function( aaSort )
- {
- this.api( true ).order( aaSort ).draw();
- };
-
-
- /**
- * Attach a sort listener to an element for a given column
- * @param {node} nNode the element to attach the sort listener to
- * @param {int} iColumn the column that a click on this node will sort on
- * @param {function} [fnCallback] callback function when sort is run
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable = $('#example').dataTable();
- *
- * // Sort on column 1, when 'sorter' is clicked on
- * oTable.fnSortListener( document.getElementById('sorter'), 1 );
- * } );
- */
- this.fnSortListener = function( nNode, iColumn, fnCallback )
- {
- this.api( true ).order.listener( nNode, iColumn, fnCallback );
- };
-
-
- /**
- * Update a table cell or row - this method will accept either a single value to
- * update the cell with, an array of values with one element for each column or
- * an object in the same format as the original data source. The function is
- * self-referencing in order to make the multi column updates easier.
- * @param {object|array|string} mData Data to update the cell/row with
- * @param {node|int} mRow TR element you want to update or the aoData index
- * @param {int} [iColumn] The column to update, give as null or undefined to
- * update a whole row.
- * @param {bool} [bRedraw=true] Redraw the table or not
- * @param {bool} [bAction=true] Perform pre-draw actions or not
- * @returns {int} 0 on success, 1 on error
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable = $('#example').dataTable();
- * oTable.fnUpdate( 'Example update', 0, 0 ); // Single cell
- * oTable.fnUpdate( ['a', 'b', 'c', 'd', 'e'], $('tbody tr')[0] ); // Row
- * } );
- */
- this.fnUpdate = function( mData, mRow, iColumn, bRedraw, bAction )
- {
- var api = this.api( true );
-
- if ( iColumn === undefined || iColumn === null ) {
- api.row( mRow ).data( mData );
- }
- else {
- api.cell( mRow, iColumn ).data( mData );
- }
-
- if ( bAction === undefined || bAction ) {
- api.columns.adjust();
- }
-
- if ( bRedraw === undefined || bRedraw ) {
- api.draw();
- }
- return 0;
- };
-
-
- /**
- * Provide a common method for plug-ins to check the version of DataTables being used, in order
- * to ensure compatibility.
- * @param {string} sVersion Version string to check for, in the format "X.Y.Z". Note that the
- * formats "X" and "X.Y" are also acceptable.
- * @returns {boolean} true if this version of DataTables is greater or equal to the required
- * version, or false if this version of DataTales is not suitable
- * @method
- * @dtopt API
- * @deprecated Since v1.10
- *
- * @example
- * $(document).ready(function() {
- * var oTable = $('#example').dataTable();
- * alert( oTable.fnVersionCheck( '1.9.0' ) );
- * } );
- */
- this.fnVersionCheck = _ext.fnVersionCheck;
-
-
- var _that = this;
- var emptyInit = options === undefined;
- var len = this.length;
-
- if ( emptyInit ) {
- options = {};
- }
-
- this.oApi = this.internal = _ext.internal;
-
- // Extend with old style plug-in API methods
- for ( var fn in DataTable.ext.internal ) {
- if ( fn ) {
- this[fn] = _fnExternApiFunc(fn);
- }
- }
-
- this.each(function() {
- // For each initialisation we want to give it a clean initialisation
- // object that can be bashed around
- var o = {};
- var oInit = len > 1 ? // optimisation for single table case
- _fnExtend( o, options, true ) :
- options;
-
- /*global oInit,_that,emptyInit*/
- var i=0, iLen, j, jLen, k, kLen;
- var sId = this.getAttribute( 'id' );
- var bInitHandedOff = false;
- var defaults = DataTable.defaults;
- var $this = $(this);
-
-
- /* Sanity check */
- if ( this.nodeName.toLowerCase() != 'table' )
- {
- _fnLog( null, 0, 'Non-table node initialisation ('+this.nodeName+')', 2 );
- return;
- }
-
- /* Backwards compatibility for the defaults */
- _fnCompatOpts( defaults );
- _fnCompatCols( defaults.column );
-
- /* Convert the camel-case defaults to Hungarian */
- _fnCamelToHungarian( defaults, defaults, true );
- _fnCamelToHungarian( defaults.column, defaults.column, true );
-
- /* Setting up the initialisation object */
- _fnCamelToHungarian( defaults, $.extend( oInit, $this.data() ) );
-
-
-
- /* Check to see if we are re-initialising a table */
- var allSettings = DataTable.settings;
- for ( i=0, iLen=allSettings.length ; i<iLen ; i++ )
- {
- var s = allSettings[i];
-
- /* Base check on table node */
- if ( s.nTable == this || s.nTHead.parentNode == this || (s.nTFoot && s.nTFoot.parentNode == this) )
- {
- var bRetrieve = oInit.bRetrieve !== undefined ? oInit.bRetrieve : defaults.bRetrieve;
- var bDestroy = oInit.bDestroy !== undefined ? oInit.bDestroy : defaults.bDestroy;
-
- if ( emptyInit || bRetrieve )
- {
- return s.oInstance;
- }
- else if ( bDestroy )
- {
- s.oInstance.fnDestroy();
- break;
- }
- else
- {
- _fnLog( s, 0, 'Cannot reinitialise DataTable', 3 );
- return;
- }
- }
-
- /* If the element we are initialising has the same ID as a table which was previously
- * initialised, but the table nodes don't match (from before) then we destroy the old
- * instance by simply deleting it. This is under the assumption that the table has been
- * destroyed by other methods. Anyone using non-id selectors will need to do this manually
- */
- if ( s.sTableId == this.id )
- {
- allSettings.splice( i, 1 );
- break;
- }
- }
-
- /* Ensure the table has an ID - required for accessibility */
- if ( sId === null || sId === "" )
- {
- sId = "DataTables_Table_"+(DataTable.ext._unique++);
- this.id = sId;
- }
-
- /* Create the settings object for this table and set some of the default parameters */
- var oSettings = $.extend( true, {}, DataTable.models.oSettings, {
- "sDestroyWidth": $this[0].style.width,
- "sInstance": sId,
- "sTableId": sId
- } );
- oSettings.nTable = this;
- oSettings.oApi = _that.internal;
- oSettings.oInit = oInit;
-
- allSettings.push( oSettings );
-
- // Need to add the instance after the instance after the settings object has been added
- // to the settings array, so we can self reference the table instance if more than one
- oSettings.oInstance = (_that.length===1) ? _that : $this.dataTable();
-
- // Backwards compatibility, before we apply all the defaults
- _fnCompatOpts( oInit );
-
- if ( oInit.oLanguage )
- {
- _fnLanguageCompat( oInit.oLanguage );
- }
-
- // If the length menu is given, but the init display length is not, use the length menu
- if ( oInit.aLengthMenu && ! oInit.iDisplayLength )
- {
- oInit.iDisplayLength = $.isArray( oInit.aLengthMenu[0] ) ?
- oInit.aLengthMenu[0][0] : oInit.aLengthMenu[0];
- }
-
- // Apply the defaults and init options to make a single init object will all
- // options defined from defaults and instance options.
- oInit = _fnExtend( $.extend( true, {}, defaults ), oInit );
-
-
- // Map the initialisation options onto the settings object
- _fnMap( oSettings.oFeatures, oInit, [
- "bPaginate",
- "bLengthChange",
- "bFilter",
- "bSort",
- "bSortMulti",
- "bInfo",
- "bProcessing",
- "bAutoWidth",
- "bSortClasses",
- "bServerSide",
- "bDeferRender"
- ] );
- _fnMap( oSettings, oInit, [
- "asStripeClasses",
- "ajax",
- "fnServerData",
- "fnFormatNumber",
- "sServerMethod",
- "aaSorting",
- "aaSortingFixed",
- "aLengthMenu",
- "sPaginationType",
- "sAjaxSource",
- "sAjaxDataProp",
- "iStateDuration",
- "sDom",
- "bSortCellsTop",
- "iTabIndex",
- "fnStateLoadCallback",
- "fnStateSaveCallback",
- "renderer",
- "searchDelay",
- "rowId",
- [ "iCookieDuration", "iStateDuration" ], // backwards compat
- [ "oSearch", "oPreviousSearch" ],
- [ "aoSearchCols", "aoPreSearchCols" ],
- [ "iDisplayLength", "_iDisplayLength" ],
- [ "bJQueryUI", "bJUI" ]
- ] );
- _fnMap( oSettings.oScroll, oInit, [
- [ "sScrollX", "sX" ],
- [ "sScrollXInner", "sXInner" ],
- [ "sScrollY", "sY" ],
- [ "bScrollCollapse", "bCollapse" ]
- ] );
- _fnMap( oSettings.oLanguage, oInit, "fnInfoCallback" );
-
- /* Callback functions which are array driven */
- _fnCallbackReg( oSettings, 'aoDrawCallback', oInit.fnDrawCallback, 'user' );
- _fnCallbackReg( oSettings, 'aoServerParams', oInit.fnServerParams, 'user' );
- _fnCallbackReg( oSettings, 'aoStateSaveParams', oInit.fnStateSaveParams, 'user' );
- _fnCallbackReg( oSettings, 'aoStateLoadParams', oInit.fnStateLoadParams, 'user' );
- _fnCallbackReg( oSettings, 'aoStateLoaded', oInit.fnStateLoaded, 'user' );
- _fnCallbackReg( oSettings, 'aoRowCallback', oInit.fnRowCallback, 'user' );
- _fnCallbackReg( oSettings, 'aoRowCreatedCallback', oInit.fnCreatedRow, 'user' );
- _fnCallbackReg( oSettings, 'aoHeaderCallback', oInit.fnHeaderCallback, 'user' );
- _fnCallbackReg( oSettings, 'aoFooterCallback', oInit.fnFooterCallback, 'user' );
- _fnCallbackReg( oSettings, 'aoInitComplete', oInit.fnInitComplete, 'user' );
- _fnCallbackReg( oSettings, 'aoPreDrawCallback', oInit.fnPreDrawCallback, 'user' );
-
- oSettings.rowIdFn = _fnGetObjectDataFn( oInit.rowId );
-
- /* Browser support detection */
- _fnBrowserDetect( oSettings );
-
- var oClasses = oSettings.oClasses;
-
- // @todo Remove in 1.11
- if ( oInit.bJQueryUI )
- {
- /* Use the JUI classes object for display. You could clone the oStdClasses object if
- * you want to have multiple tables with multiple independent classes
- */
- $.extend( oClasses, DataTable.ext.oJUIClasses, oInit.oClasses );
-
- if ( oInit.sDom === defaults.sDom && defaults.sDom === "lfrtip" )
- {
- /* Set the DOM to use a layout suitable for jQuery UI's theming */
- oSettings.sDom = '<"H"lfr>t<"F"ip>';
- }
-
- if ( ! oSettings.renderer ) {
- oSettings.renderer = 'jqueryui';
- }
- else if ( $.isPlainObject( oSettings.renderer ) && ! oSettings.renderer.header ) {
- oSettings.renderer.header = 'jqueryui';
- }
- }
- else
- {
- $.extend( oClasses, DataTable.ext.classes, oInit.oClasses );
- }
- $this.addClass( oClasses.sTable );
-
-
- if ( oSettings.iInitDisplayStart === undefined )
- {
- /* Display start point, taking into account the save saving */
- oSettings.iInitDisplayStart = oInit.iDisplayStart;
- oSettings._iDisplayStart = oInit.iDisplayStart;
- }
-
- if ( oInit.iDeferLoading !== null )
- {
- oSettings.bDeferLoading = true;
- var tmp = $.isArray( oInit.iDeferLoading );
- oSettings._iRecordsDisplay = tmp ? oInit.iDeferLoading[0] : oInit.iDeferLoading;
- oSettings._iRecordsTotal = tmp ? oInit.iDeferLoading[1] : oInit.iDeferLoading;
- }
-
- /* Language definitions */
- var oLanguage = oSettings.oLanguage;
- $.extend( true, oLanguage, oInit.oLanguage );
-
- if ( oLanguage.sUrl )
- {
- /* Get the language definitions from a file - because this Ajax call makes the language
- * get async to the remainder of this function we use bInitHandedOff to indicate that
- * _fnInitialise will be fired by the returned Ajax handler, rather than the constructor
- */
- $.ajax( {
- dataType: 'json',
- url: oLanguage.sUrl,
- success: function ( json ) {
- _fnLanguageCompat( json );
- _fnCamelToHungarian( defaults.oLanguage, json );
- $.extend( true, oLanguage, json );
- _fnInitialise( oSettings );
- },
- error: function () {
- // Error occurred loading language file, continue on as best we can
- _fnInitialise( oSettings );
- }
- } );
- bInitHandedOff = true;
- }
-
- /*
- * Stripes
- */
- if ( oInit.asStripeClasses === null )
- {
- oSettings.asStripeClasses =[
- oClasses.sStripeOdd,
- oClasses.sStripeEven
- ];
- }
-
- /* Remove row stripe classes if they are already on the table row */
- var stripeClasses = oSettings.asStripeClasses;
- var rowOne = $this.children('tbody').find('tr').eq(0);
- if ( $.inArray( true, $.map( stripeClasses, function(el, i) {
- return rowOne.hasClass(el);
- } ) ) !== -1 ) {
- $('tbody tr', this).removeClass( stripeClasses.join(' ') );
- oSettings.asDestroyStripes = stripeClasses.slice();
- }
-
- /*
- * Columns
- * See if we should load columns automatically or use defined ones
- */
- var anThs = [];
- var aoColumnsInit;
- var nThead = this.getElementsByTagName('thead');
- if ( nThead.length !== 0 )
- {
- _fnDetectHeader( oSettings.aoHeader, nThead[0] );
- anThs = _fnGetUniqueThs( oSettings );
- }
-
- /* If not given a column array, generate one with nulls */
- if ( oInit.aoColumns === null )
- {
- aoColumnsInit = [];
- for ( i=0, iLen=anThs.length ; i<iLen ; i++ )
- {
- aoColumnsInit.push( null );
- }
- }
- else
- {
- aoColumnsInit = oInit.aoColumns;
- }
-
- /* Add the columns */
- for ( i=0, iLen=aoColumnsInit.length ; i<iLen ; i++ )
- {
- _fnAddColumn( oSettings, anThs ? anThs[i] : null );
- }
-
- /* Apply the column definitions */
- _fnApplyColumnDefs( oSettings, oInit.aoColumnDefs, aoColumnsInit, function (iCol, oDef) {
- _fnColumnOptions( oSettings, iCol, oDef );
- } );
-
- /* HTML5 attribute detection - build an mData object automatically if the
- * attributes are found
- */
- if ( rowOne.length ) {
- var a = function ( cell, name ) {
- return cell.getAttribute( 'data-'+name ) !== null ? name : null;
- };
-
- $( rowOne[0] ).children('th, td').each( function (i, cell) {
- var col = oSettings.aoColumns[i];
-
- if ( col.mData === i ) {
- var sort = a( cell, 'sort' ) || a( cell, 'order' );
- var filter = a( cell, 'filter' ) || a( cell, 'search' );
-
- if ( sort !== null || filter !== null ) {
- col.mData = {
- _: i+'.display',
- sort: sort !== null ? i+'.@data-'+sort : undefined,
- type: sort !== null ? i+'.@data-'+sort : undefined,
- filter: filter !== null ? i+'.@data-'+filter : undefined
- };
-
- _fnColumnOptions( oSettings, i );
- }
- }
- } );
- }
-
- var features = oSettings.oFeatures;
- var loadedInit = function () {
- /*
- * Sorting
- * @todo For modularisation (1.11) this needs to do into a sort start up handler
- */
-
- // If aaSorting is not defined, then we use the first indicator in asSorting
- // in case that has been altered, so the default sort reflects that option
- if ( oInit.aaSorting === undefined ) {
- var sorting = oSettings.aaSorting;
- for ( i=0, iLen=sorting.length ; i<iLen ; i++ ) {
- sorting[i][1] = oSettings.aoColumns[ i ].asSorting[0];
- }
- }
-
- /* Do a first pass on the sorting classes (allows any size changes to be taken into
- * account, and also will apply sorting disabled classes if disabled
- */
- _fnSortingClasses( oSettings );
-
- if ( features.bSort ) {
- _fnCallbackReg( oSettings, 'aoDrawCallback', function () {
- if ( oSettings.bSorted ) {
- var aSort = _fnSortFlatten( oSettings );
- var sortedColumns = {};
-
- $.each( aSort, function (i, val) {
- sortedColumns[ val.src ] = val.dir;
- } );
-
- _fnCallbackFire( oSettings, null, 'order', [oSettings, aSort, sortedColumns] );
- _fnSortAria( oSettings );
- }
- } );
- }
-
- _fnCallbackReg( oSettings, 'aoDrawCallback', function () {
- if ( oSettings.bSorted || _fnDataSource( oSettings ) === 'ssp' || features.bDeferRender ) {
- _fnSortingClasses( oSettings );
- }
- }, 'sc' );
-
-
- /*
- * Final init
- * Cache the header, body and footer as required, creating them if needed
- */
-
- // Work around for Webkit bug 83867 - store the caption-side before removing from doc
- var captions = $this.children('caption').each( function () {
- this._captionSide = $(this).css('caption-side');
- } );
-
- var thead = $this.children('thead');
- if ( thead.length === 0 ) {
- thead = $('<thead/>').appendTo($this);
- }
- oSettings.nTHead = thead[0];
-
- var tbody = $this.children('tbody');
- if ( tbody.length === 0 ) {
- tbody = $('<tbody/>').appendTo($this);
- }
- oSettings.nTBody = tbody[0];
-
- var tfoot = $this.children('tfoot');
- if ( tfoot.length === 0 && captions.length > 0 && (oSettings.oScroll.sX !== "" || oSettings.oScroll.sY !== "") ) {
- // If we are a scrolling table, and no footer has been given, then we need to create
- // a tfoot element for the caption element to be appended to
- tfoot = $('<tfoot/>').appendTo($this);
- }
-
- if ( tfoot.length === 0 || tfoot.children().length === 0 ) {
- $this.addClass( oClasses.sNoFooter );
- }
- else if ( tfoot.length > 0 ) {
- oSettings.nTFoot = tfoot[0];
- _fnDetectHeader( oSettings.aoFooter, oSettings.nTFoot );
- }
-
- /* Check if there is data passing into the constructor */
- if ( oInit.aaData ) {
- for ( i=0 ; i<oInit.aaData.length ; i++ ) {
- _fnAddData( oSettings, oInit.aaData[ i ] );
- }
- }
- else if ( oSettings.bDeferLoading || _fnDataSource( oSettings ) == 'dom' ) {
- /* Grab the data from the page - only do this when deferred loading or no Ajax
- * source since there is no point in reading the DOM data if we are then going
- * to replace it with Ajax data
- */
- _fnAddTr( oSettings, $(oSettings.nTBody).children('tr') );
- }
-
- /* Copy the data index array */
- oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
-
- /* Initialisation complete - table can be drawn */
- oSettings.bInitialised = true;
-
- /* Check if we need to initialise the table (it might not have been handed off to the
- * language processor)
- */
- if ( bInitHandedOff === false ) {
- _fnInitialise( oSettings );
- }
- };
-
- /* Must be done after everything which can be overridden by the state saving! */
- if ( oInit.bStateSave )
- {
- features.bStateSave = true;
- _fnCallbackReg( oSettings, 'aoDrawCallback', _fnSaveState, 'state_save' );
- _fnLoadState( oSettings, oInit, loadedInit );
- }
- else {
- loadedInit();
- }
-
- } );
- _that = null;
- return this;
- };
-
-
- /*
- * It is useful to have variables which are scoped locally so only the
- * DataTables functions can access them and they don't leak into global space.
- * At the same time these functions are often useful over multiple files in the
- * core and API, so we list, or at least document, all variables which are used
- * by DataTables as private variables here. This also ensures that there is no
- * clashing of variable names and that they can easily referenced for reuse.
- */
-
-
- // Defined else where
- // _selector_run
- // _selector_opts
- // _selector_first
- // _selector_row_indexes
-
- var _ext; // DataTable.ext
- var _Api; // DataTable.Api
- var _api_register; // DataTable.Api.register
- var _api_registerPlural; // DataTable.Api.registerPlural
-
- var _re_dic = {};
- var _re_new_lines = /[\r\n]/g;
- var _re_html = /<.*?>/g;
-
- // This is not strict ISO8601 - Date.parse() is quite lax, although
- // implementations differ between browsers.
- var _re_date = /^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/;
-
- // Escape regular expression special characters
- var _re_escape_regex = new RegExp( '(\\' + [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^', '-' ].join('|\\') + ')', 'g' );
-
- // http://en.wikipedia.org/wiki/Foreign_exchange_market
- // - \u20BD - Russian ruble.
- // - \u20a9 - South Korean Won
- // - \u20BA - Turkish Lira
- // - \u20B9 - Indian Rupee
- // - R - Brazil (R$) and South Africa
- // - fr - Swiss Franc
- // - kr - Swedish krona, Norwegian krone and Danish krone
- // - \u2009 is thin space and \u202F is narrow no-break space, both used in many
- // standards as thousands separators.
- var _re_formatted_numeric = /[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi;
-
-
- var _empty = function ( d ) {
- return !d || d === true || d === '-' ? true : false;
- };
-
-
- var _intVal = function ( s ) {
- var integer = parseInt( s, 10 );
- return !isNaN(integer) && isFinite(s) ? integer : null;
- };
-
- // Convert from a formatted number with characters other than `.` as the
- // decimal place, to a Javascript number
- var _numToDecimal = function ( num, decimalPoint ) {
- // Cache created regular expressions for speed as this function is called often
- if ( ! _re_dic[ decimalPoint ] ) {
- _re_dic[ decimalPoint ] = new RegExp( _fnEscapeRegex( decimalPoint ), 'g' );
- }
- return typeof num === 'string' && decimalPoint !== '.' ?
- num.replace( /\./g, '' ).replace( _re_dic[ decimalPoint ], '.' ) :
- num;
- };
-
-
- var _isNumber = function ( d, decimalPoint, formatted ) {
- var strType = typeof d === 'string';
-
- // If empty return immediately so there must be a number if it is a
- // formatted string (this stops the string "k", or "kr", etc being detected
- // as a formatted number for currency
- if ( _empty( d ) ) {
- return true;
- }
-
- if ( decimalPoint && strType ) {
- d = _numToDecimal( d, decimalPoint );
- }
-
- if ( formatted && strType ) {
- d = d.replace( _re_formatted_numeric, '' );
- }
-
- return !isNaN( parseFloat(d) ) && isFinite( d );
- };
-
-
- // A string without HTML in it can be considered to be HTML still
- var _isHtml = function ( d ) {
- return _empty( d ) || typeof d === 'string';
- };
-
-
- var _htmlNumeric = function ( d, decimalPoint, formatted ) {
- if ( _empty( d ) ) {
- return true;
- }
-
- var html = _isHtml( d );
- return ! html ?
- null :
- _isNumber( _stripHtml( d ), decimalPoint, formatted ) ?
- true :
- null;
- };
-
-
- var _pluck = function ( a, prop, prop2 ) {
- var out = [];
- var i=0, ien=a.length;
-
- // Could have the test in the loop for slightly smaller code, but speed
- // is essential here
- if ( prop2 !== undefined ) {
- for ( ; i<ien ; i++ ) {
- if ( a[i] && a[i][ prop ] ) {
- out.push( a[i][ prop ][ prop2 ] );
- }
- }
- }
- else {
- for ( ; i<ien ; i++ ) {
- if ( a[i] ) {
- out.push( a[i][ prop ] );
- }
- }
- }
-
- return out;
- };
-
-
- // Basically the same as _pluck, but rather than looping over `a` we use `order`
- // as the indexes to pick from `a`
- var _pluck_order = function ( a, order, prop, prop2 )
- {
- var out = [];
- var i=0, ien=order.length;
-
- // Could have the test in the loop for slightly smaller code, but speed
- // is essential here
- if ( prop2 !== undefined ) {
- for ( ; i<ien ; i++ ) {
- if ( a[ order[i] ][ prop ] ) {
- out.push( a[ order[i] ][ prop ][ prop2 ] );
- }
- }
- }
- else {
- for ( ; i<ien ; i++ ) {
- out.push( a[ order[i] ][ prop ] );
- }
- }
-
- return out;
- };
-
-
- var _range = function ( len, start )
- {
- var out = [];
- var end;
-
- if ( start === undefined ) {
- start = 0;
- end = len;
- }
- else {
- end = start;
- start = len;
- }
-
- for ( var i=start ; i<end ; i++ ) {
- out.push( i );
- }
-
- return out;
- };
-
-
- var _removeEmpty = function ( a )
- {
- var out = [];
-
- for ( var i=0, ien=a.length ; i<ien ; i++ ) {
- if ( a[i] ) { // careful - will remove all falsy values!
- out.push( a[i] );
- }
- }
-
- return out;
- };
-
-
- var _stripHtml = function ( d ) {
- return d.replace( _re_html, '' );
- };
-
-
- /**
- * Determine if all values in the array are unique. This means we can short
- * cut the _unique method at the cost of a single loop. A sorted array is used
- * to easily check the values.
- *
- * @param {array} src Source array
- * @return {boolean} true if all unique, false otherwise
- * @ignore
- */
- var _areAllUnique = function ( src ) {
- if ( src.length < 2 ) {
- return true;
- }
-
- var sorted = src.slice().sort();
- var last = sorted[0];
-
- for ( var i=1, ien=sorted.length ; i<ien ; i++ ) {
- if ( sorted[i] === last ) {
- return false;
- }
-
- last = sorted[i];
- }
-
- return true;
- };
-
-
- /**
- * Find the unique elements in a source array.
- *
- * @param {array} src Source array
- * @return {array} Array of unique items
- * @ignore
- */
- var _unique = function ( src )
- {
- if ( _areAllUnique( src ) ) {
- return src.slice();
- }
-
- // A faster unique method is to use object keys to identify used values,
- // but this doesn't work with arrays or objects, which we must also
- // consider. See jsperf.com/compare-array-unique-versions/4 for more
- // information.
- var
- out = [],
- val,
- i, ien=src.length,
- j, k=0;
-
- again: for ( i=0 ; i<ien ; i++ ) {
- val = src[i];
-
- for ( j=0 ; j<k ; j++ ) {
- if ( out[j] === val ) {
- continue again;
- }
- }
-
- out.push( val );
- k++;
- }
-
- return out;
- };
-
-
- /**
- * DataTables utility methods
- *
- * This namespace provides helper methods that DataTables uses internally to
- * create a DataTable, but which are not exclusively used only for DataTables.
- * These methods can be used by extension authors to save the duplication of
- * code.
- *
- * @namespace
- */
- DataTable.util = {
- /**
- * Throttle the calls to a function. Arguments and context are maintained
- * for the throttled function.
- *
- * @param {function} fn Function to be called
- * @param {integer} freq Call frequency in mS
- * @return {function} Wrapped function
- */
- throttle: function ( fn, freq ) {
- var
- frequency = freq !== undefined ? freq : 200,
- last,
- timer;
-
- return function () {
- var
- that = this,
- now = +new Date(),
- args = arguments;
-
- if ( last && now < last + frequency ) {
- clearTimeout( timer );
-
- timer = setTimeout( function () {
- last = undefined;
- fn.apply( that, args );
- }, frequency );
- }
- else {
- last = now;
- fn.apply( that, args );
- }
- };
- },
-
-
- /**
- * Escape a string such that it can be used in a regular expression
- *
- * @param {string} val string to escape
- * @returns {string} escaped string
- */
- escapeRegex: function ( val ) {
- return val.replace( _re_escape_regex, '\\$1' );
- }
- };
-
-
-
- /**
- * Create a mapping object that allows camel case parameters to be looked up
- * for their Hungarian counterparts. The mapping is stored in a private
- * parameter called `_hungarianMap` which can be accessed on the source object.
- * @param {object} o
- * @memberof DataTable#oApi
- */
- function _fnHungarianMap ( o )
- {
- var
- hungarian = 'a aa ai ao as b fn i m o s ',
- match,
- newKey,
- map = {};
-
- $.each( o, function (key, val) {
- match = key.match(/^([^A-Z]+?)([A-Z])/);
-
- if ( match && hungarian.indexOf(match[1]+' ') !== -1 )
- {
- newKey = key.replace( match[0], match[2].toLowerCase() );
- map[ newKey ] = key;
-
- if ( match[1] === 'o' )
- {
- _fnHungarianMap( o[key] );
- }
- }
- } );
-
- o._hungarianMap = map;
- }
-
-
- /**
- * Convert from camel case parameters to Hungarian, based on a Hungarian map
- * created by _fnHungarianMap.
- * @param {object} src The model object which holds all parameters that can be
- * mapped.
- * @param {object} user The object to convert from camel case to Hungarian.
- * @param {boolean} force When set to `true`, properties which already have a
- * Hungarian value in the `user` object will be overwritten. Otherwise they
- * won't be.
- * @memberof DataTable#oApi
- */
- function _fnCamelToHungarian ( src, user, force )
- {
- if ( ! src._hungarianMap ) {
- _fnHungarianMap( src );
- }
-
- var hungarianKey;
-
- $.each( user, function (key, val) {
- hungarianKey = src._hungarianMap[ key ];
-
- if ( hungarianKey !== undefined && (force || user[hungarianKey] === undefined) )
- {
- // For objects, we need to buzz down into the object to copy parameters
- if ( hungarianKey.charAt(0) === 'o' )
- {
- // Copy the camelCase options over to the hungarian
- if ( ! user[ hungarianKey ] ) {
- user[ hungarianKey ] = {};
- }
- $.extend( true, user[hungarianKey], user[key] );
-
- _fnCamelToHungarian( src[hungarianKey], user[hungarianKey], force );
- }
- else {
- user[hungarianKey] = user[ key ];
- }
- }
- } );
- }
-
-
- /**
- * Language compatibility - when certain options are given, and others aren't, we
- * need to duplicate the values over, in order to provide backwards compatibility
- * with older language files.
- * @param {object} oSettings dataTables settings object
- * @memberof DataTable#oApi
- */
- function _fnLanguageCompat( lang )
- {
- var defaults = DataTable.defaults.oLanguage;
- var zeroRecords = lang.sZeroRecords;
-
- /* Backwards compatibility - if there is no sEmptyTable given, then use the same as
- * sZeroRecords - assuming that is given.
- */
- if ( ! lang.sEmptyTable && zeroRecords &&
- defaults.sEmptyTable === "No data available in table" )
- {
- _fnMap( lang, lang, 'sZeroRecords', 'sEmptyTable' );
- }
-
- /* Likewise with loading records */
- if ( ! lang.sLoadingRecords && zeroRecords &&
- defaults.sLoadingRecords === "Loading..." )
- {
- _fnMap( lang, lang, 'sZeroRecords', 'sLoadingRecords' );
- }
-
- // Old parameter name of the thousands separator mapped onto the new
- if ( lang.sInfoThousands ) {
- lang.sThousands = lang.sInfoThousands;
- }
-
- var decimal = lang.sDecimal;
- if ( decimal ) {
- _addNumericSort( decimal );
- }
- }
-
-
- /**
- * Map one parameter onto another
- * @param {object} o Object to map
- * @param {*} knew The new parameter name
- * @param {*} old The old parameter name
- */
- var _fnCompatMap = function ( o, knew, old ) {
- if ( o[ knew ] !== undefined ) {
- o[ old ] = o[ knew ];
- }
- };
-
-
- /**
- * Provide backwards compatibility for the main DT options. Note that the new
- * options are mapped onto the old parameters, so this is an external interface
- * change only.
- * @param {object} init Object to map
- */
- function _fnCompatOpts ( init )
- {
- _fnCompatMap( init, 'ordering', 'bSort' );
- _fnCompatMap( init, 'orderMulti', 'bSortMulti' );
- _fnCompatMap( init, 'orderClasses', 'bSortClasses' );
- _fnCompatMap( init, 'orderCellsTop', 'bSortCellsTop' );
- _fnCompatMap( init, 'order', 'aaSorting' );
- _fnCompatMap( init, 'orderFixed', 'aaSortingFixed' );
- _fnCompatMap( init, 'paging', 'bPaginate' );
- _fnCompatMap( init, 'pagingType', 'sPaginationType' );
- _fnCompatMap( init, 'pageLength', 'iDisplayLength' );
- _fnCompatMap( init, 'searching', 'bFilter' );
-
- // Boolean initialisation of x-scrolling
- if ( typeof init.sScrollX === 'boolean' ) {
- init.sScrollX = init.sScrollX ? '100%' : '';
- }
- if ( typeof init.scrollX === 'boolean' ) {
- init.scrollX = init.scrollX ? '100%' : '';
- }
-
- // Column search objects are in an array, so it needs to be converted
- // element by element
- var searchCols = init.aoSearchCols;
-
- if ( searchCols ) {
- for ( var i=0, ien=searchCols.length ; i<ien ; i++ ) {
- if ( searchCols[i] ) {
- _fnCamelToHungarian( DataTable.models.oSearch, searchCols[i] );
- }
- }
- }
- }
-
-
- /**
- * Provide backwards compatibility for column options. Note that the new options
- * are mapped onto the old parameters, so this is an external interface change
- * only.
- * @param {object} init Object to map
- */
- function _fnCompatCols ( init )
- {
- _fnCompatMap( init, 'orderable', 'bSortable' );
- _fnCompatMap( init, 'orderData', 'aDataSort' );
- _fnCompatMap( init, 'orderSequence', 'asSorting' );
- _fnCompatMap( init, 'orderDataType', 'sortDataType' );
-
- // orderData can be given as an integer
- var dataSort = init.aDataSort;
- if ( typeof dataSort === 'number' && ! $.isArray( dataSort ) ) {
- init.aDataSort = [ dataSort ];
- }
- }
-
-
- /**
- * Browser feature detection for capabilities, quirks
- * @param {object} settings dataTables settings object
- * @memberof DataTable#oApi
- */
- function _fnBrowserDetect( settings )
- {
- // We don't need to do this every time DataTables is constructed, the values
- // calculated are specific to the browser and OS configuration which we
- // don't expect to change between initialisations
- if ( ! DataTable.__browser ) {
- var browser = {};
- DataTable.__browser = browser;
-
- // Scrolling feature / quirks detection
- var n = $('<div/>')
- .css( {
- position: 'fixed',
- top: 0,
- left: $(window).scrollLeft()*-1, // allow for scrolling
- height: 1,
- width: 1,
- overflow: 'hidden'
- } )
- .append(
- $('<div/>')
- .css( {
- position: 'absolute',
- top: 1,
- left: 1,
- width: 100,
- overflow: 'scroll'
- } )
- .append(
- $('<div/>')
- .css( {
- width: '100%',
- height: 10
- } )
- )
- )
- .appendTo( 'body' );
-
- var outer = n.children();
- var inner = outer.children();
-
- // Numbers below, in order, are:
- // inner.offsetWidth, inner.clientWidth, outer.offsetWidth, outer.clientWidth
- //
- // IE6 XP: 100 100 100 83
- // IE7 Vista: 100 100 100 83
- // IE 8+ Windows: 83 83 100 83
- // Evergreen Windows: 83 83 100 83
- // Evergreen Mac with scrollbars: 85 85 100 85
- // Evergreen Mac without scrollbars: 100 100 100 100
-
- // Get scrollbar width
- browser.barWidth = outer[0].offsetWidth - outer[0].clientWidth;
-
- // IE6/7 will oversize a width 100% element inside a scrolling element, to
- // include the width of the scrollbar, while other browsers ensure the inner
- // element is contained without forcing scrolling
- browser.bScrollOversize = inner[0].offsetWidth === 100 && outer[0].clientWidth !== 100;
-
- // In rtl text layout, some browsers (most, but not all) will place the
- // scrollbar on the left, rather than the right.
- browser.bScrollbarLeft = Math.round( inner.offset().left ) !== 1;
-
- // IE8- don't provide height and width for getBoundingClientRect
- browser.bBounding = n[0].getBoundingClientRect().width ? true : false;
-
- n.remove();
- }
-
- $.extend( settings.oBrowser, DataTable.__browser );
- settings.oScroll.iBarWidth = DataTable.__browser.barWidth;
- }
-
-
- /**
- * Array.prototype reduce[Right] method, used for browsers which don't support
- * JS 1.6. Done this way to reduce code size, since we iterate either way
- * @param {object} settings dataTables settings object
- * @memberof DataTable#oApi
- */
- function _fnReduce ( that, fn, init, start, end, inc )
- {
- var
- i = start,
- value,
- isSet = false;
-
- if ( init !== undefined ) {
- value = init;
- isSet = true;
- }
-
- while ( i !== end ) {
- if ( ! that.hasOwnProperty(i) ) {
- continue;
- }
-
- value = isSet ?
- fn( value, that[i], i, that ) :
- that[i];
-
- isSet = true;
- i += inc;
- }
-
- return value;
- }
-
- /**
- * Add a column to the list used for the table with default values
- * @param {object} oSettings dataTables settings object
- * @param {node} nTh The th element for this column
- * @memberof DataTable#oApi
- */
- function _fnAddColumn( oSettings, nTh )
- {
- // Add column to aoColumns array
- var oDefaults = DataTable.defaults.column;
- var iCol = oSettings.aoColumns.length;
- var oCol = $.extend( {}, DataTable.models.oColumn, oDefaults, {
- "nTh": nTh ? nTh : document.createElement('th'),
- "sTitle": oDefaults.sTitle ? oDefaults.sTitle : nTh ? nTh.innerHTML : '',
- "aDataSort": oDefaults.aDataSort ? oDefaults.aDataSort : [iCol],
- "mData": oDefaults.mData ? oDefaults.mData : iCol,
- idx: iCol
- } );
- oSettings.aoColumns.push( oCol );
-
- // Add search object for column specific search. Note that the `searchCols[ iCol ]`
- // passed into extend can be undefined. This allows the user to give a default
- // with only some of the parameters defined, and also not give a default
- var searchCols = oSettings.aoPreSearchCols;
- searchCols[ iCol ] = $.extend( {}, DataTable.models.oSearch, searchCols[ iCol ] );
-
- // Use the default column options function to initialise classes etc
- _fnColumnOptions( oSettings, iCol, $(nTh).data() );
- }
-
-
- /**
- * Apply options for a column
- * @param {object} oSettings dataTables settings object
- * @param {int} iCol column index to consider
- * @param {object} oOptions object with sType, bVisible and bSearchable etc
- * @memberof DataTable#oApi
- */
- function _fnColumnOptions( oSettings, iCol, oOptions )
- {
- var oCol = oSettings.aoColumns[ iCol ];
- var oClasses = oSettings.oClasses;
- var th = $(oCol.nTh);
-
- // Try to get width information from the DOM. We can't get it from CSS
- // as we'd need to parse the CSS stylesheet. `width` option can override
- if ( ! oCol.sWidthOrig ) {
- // Width attribute
- oCol.sWidthOrig = th.attr('width') || null;
-
- // Style attribute
- var t = (th.attr('style') || '').match(/width:\s*(\d+[pxem%]+)/);
- if ( t ) {
- oCol.sWidthOrig = t[1];
- }
- }
-
- /* User specified column options */
- if ( oOptions !== undefined && oOptions !== null )
- {
- // Backwards compatibility
- _fnCompatCols( oOptions );
-
- // Map camel case parameters to their Hungarian counterparts
- _fnCamelToHungarian( DataTable.defaults.column, oOptions );
-
- /* Backwards compatibility for mDataProp */
- if ( oOptions.mDataProp !== undefined && !oOptions.mData )
- {
- oOptions.mData = oOptions.mDataProp;
- }
-
- if ( oOptions.sType )
- {
- oCol._sManualType = oOptions.sType;
- }
-
- // `class` is a reserved word in Javascript, so we need to provide
- // the ability to use a valid name for the camel case input
- if ( oOptions.className && ! oOptions.sClass )
- {
- oOptions.sClass = oOptions.className;
- }
-
- $.extend( oCol, oOptions );
- _fnMap( oCol, oOptions, "sWidth", "sWidthOrig" );
-
- /* iDataSort to be applied (backwards compatibility), but aDataSort will take
- * priority if defined
- */
- if ( oOptions.iDataSort !== undefined )
- {
- oCol.aDataSort = [ oOptions.iDataSort ];
- }
- _fnMap( oCol, oOptions, "aDataSort" );
- }
-
- /* Cache the data get and set functions for speed */
- var mDataSrc = oCol.mData;
- var mData = _fnGetObjectDataFn( mDataSrc );
- var mRender = oCol.mRender ? _fnGetObjectDataFn( oCol.mRender ) : null;
-
- var attrTest = function( src ) {
- return typeof src === 'string' && src.indexOf('@') !== -1;
- };
- oCol._bAttrSrc = $.isPlainObject( mDataSrc ) && (
- attrTest(mDataSrc.sort) || attrTest(mDataSrc.type) || attrTest(mDataSrc.filter)
- );
- oCol._setter = null;
-
- oCol.fnGetData = function (rowData, type, meta) {
- var innerData = mData( rowData, type, undefined, meta );
-
- return mRender && type ?
- mRender( innerData, type, rowData, meta ) :
- innerData;
- };
- oCol.fnSetData = function ( rowData, val, meta ) {
- return _fnSetObjectDataFn( mDataSrc )( rowData, val, meta );
- };
-
- // Indicate if DataTables should read DOM data as an object or array
- // Used in _fnGetRowElements
- if ( typeof mDataSrc !== 'number' ) {
- oSettings._rowReadObject = true;
- }
-
- /* Feature sorting overrides column specific when off */
- if ( !oSettings.oFeatures.bSort )
- {
- oCol.bSortable = false;
- th.addClass( oClasses.sSortableNone ); // Have to add class here as order event isn't called
- }
-
- /* Check that the class assignment is correct for sorting */
- var bAsc = $.inArray('asc', oCol.asSorting) !== -1;
- var bDesc = $.inArray('desc', oCol.asSorting) !== -1;
- if ( !oCol.bSortable || (!bAsc && !bDesc) )
- {
- oCol.sSortingClass = oClasses.sSortableNone;
- oCol.sSortingClassJUI = "";
- }
- else if ( bAsc && !bDesc )
- {
- oCol.sSortingClass = oClasses.sSortableAsc;
- oCol.sSortingClassJUI = oClasses.sSortJUIAscAllowed;
- }
- else if ( !bAsc && bDesc )
- {
- oCol.sSortingClass = oClasses.sSortableDesc;
- oCol.sSortingClassJUI = oClasses.sSortJUIDescAllowed;
- }
- else
- {
- oCol.sSortingClass = oClasses.sSortable;
- oCol.sSortingClassJUI = oClasses.sSortJUI;
- }
- }
-
-
- /**
- * Adjust the table column widths for new data. Note: you would probably want to
- * do a redraw after calling this function!
- * @param {object} settings dataTables settings object
- * @memberof DataTable#oApi
- */
- function _fnAdjustColumnSizing ( settings )
- {
- /* Not interested in doing column width calculation if auto-width is disabled */
- if ( settings.oFeatures.bAutoWidth !== false )
- {
- var columns = settings.aoColumns;
-
- _fnCalculateColumnWidths( settings );
- for ( var i=0 , iLen=columns.length ; i<iLen ; i++ )
- {
- columns[i].nTh.style.width = columns[i].sWidth;
- }
- }
-
- var scroll = settings.oScroll;
- if ( scroll.sY !== '' || scroll.sX !== '')
- {
- _fnScrollDraw( settings );
- }
-
- _fnCallbackFire( settings, null, 'column-sizing', [settings] );
- }
-
-
- /**
- * Covert the index of a visible column to the index in the data array (take account
- * of hidden columns)
- * @param {object} oSettings dataTables settings object
- * @param {int} iMatch Visible column index to lookup
- * @returns {int} i the data index
- * @memberof DataTable#oApi
- */
- function _fnVisibleToColumnIndex( oSettings, iMatch )
- {
- var aiVis = _fnGetColumns( oSettings, 'bVisible' );
-
- return typeof aiVis[iMatch] === 'number' ?
- aiVis[iMatch] :
- null;
- }
-
-
- /**
- * Covert the index of an index in the data array and convert it to the visible
- * column index (take account of hidden columns)
- * @param {int} iMatch Column index to lookup
- * @param {object} oSettings dataTables settings object
- * @returns {int} i the data index
- * @memberof DataTable#oApi
- */
- function _fnColumnIndexToVisible( oSettings, iMatch )
- {
- var aiVis = _fnGetColumns( oSettings, 'bVisible' );
- var iPos = $.inArray( iMatch, aiVis );
-
- return iPos !== -1 ? iPos : null;
- }
-
-
- /**
- * Get the number of visible columns
- * @param {object} oSettings dataTables settings object
- * @returns {int} i the number of visible columns
- * @memberof DataTable#oApi
- */
- function _fnVisbleColumns( oSettings )
- {
- var vis = 0;
-
- // No reduce in IE8, use a loop for now
- $.each( oSettings.aoColumns, function ( i, col ) {
- if ( col.bVisible && $(col.nTh).css('display') !== 'none' ) {
- vis++;
- }
- } );
-
- return vis;
- }
-
-
- /**
- * Get an array of column indexes that match a given property
- * @param {object} oSettings dataTables settings object
- * @param {string} sParam Parameter in aoColumns to look for - typically
- * bVisible or bSearchable
- * @returns {array} Array of indexes with matched properties
- * @memberof DataTable#oApi
- */
- function _fnGetColumns( oSettings, sParam )
- {
- var a = [];
-
- $.map( oSettings.aoColumns, function(val, i) {
- if ( val[sParam] ) {
- a.push( i );
- }
- } );
-
- return a;
- }
-
-
- /**
- * Calculate the 'type' of a column
- * @param {object} settings dataTables settings object
- * @memberof DataTable#oApi
- */
- function _fnColumnTypes ( settings )
- {
- var columns = settings.aoColumns;
- var data = settings.aoData;
- var types = DataTable.ext.type.detect;
- var i, ien, j, jen, k, ken;
- var col, cell, detectedType, cache;
-
- // For each column, spin over the
- for ( i=0, ien=columns.length ; i<ien ; i++ ) {
- col = columns[i];
- cache = [];
-
- if ( ! col.sType && col._sManualType ) {
- col.sType = col._sManualType;
- }
- else if ( ! col.sType ) {
- for ( j=0, jen=types.length ; j<jen ; j++ ) {
- for ( k=0, ken=data.length ; k<ken ; k++ ) {
- // Use a cache array so we only need to get the type data
- // from the formatter once (when using multiple detectors)
- if ( cache[k] === undefined ) {
- cache[k] = _fnGetCellData( settings, k, i, 'type' );
- }
-
- detectedType = types[j]( cache[k], settings );
-
- // If null, then this type can't apply to this column, so
- // rather than testing all cells, break out. There is an
- // exception for the last type which is `html`. We need to
- // scan all rows since it is possible to mix string and HTML
- // types
- if ( ! detectedType && j !== types.length-1 ) {
- break;
- }
-
- // Only a single match is needed for html type since it is
- // bottom of the pile and very similar to string
- if ( detectedType === 'html' ) {
- break;
- }
- }
-
- // Type is valid for all data points in the column - use this
- // type
- if ( detectedType ) {
- col.sType = detectedType;
- break;
- }
- }
-
- // Fall back - if no type was detected, always use string
- if ( ! col.sType ) {
- col.sType = 'string';
- }
- }
- }
- }
-
-
- /**
- * Take the column definitions and static columns arrays and calculate how
- * they relate to column indexes. The callback function will then apply the
- * definition found for a column to a suitable configuration object.
- * @param {object} oSettings dataTables settings object
- * @param {array} aoColDefs The aoColumnDefs array that is to be applied
- * @param {array} aoCols The aoColumns array that defines columns individually
- * @param {function} fn Callback function - takes two parameters, the calculated
- * column index and the definition for that column.
- * @memberof DataTable#oApi
- */
- function _fnApplyColumnDefs( oSettings, aoColDefs, aoCols, fn )
- {
- var i, iLen, j, jLen, k, kLen, def;
- var columns = oSettings.aoColumns;
-
- // Column definitions with aTargets
- if ( aoColDefs )
- {
- /* Loop over the definitions array - loop in reverse so first instance has priority */
- for ( i=aoColDefs.length-1 ; i>=0 ; i-- )
- {
- def = aoColDefs[i];
-
- /* Each definition can target multiple columns, as it is an array */
- var aTargets = def.targets !== undefined ?
- def.targets :
- def.aTargets;
-
- if ( ! $.isArray( aTargets ) )
- {
- aTargets = [ aTargets ];
- }
-
- for ( j=0, jLen=aTargets.length ; j<jLen ; j++ )
- {
- if ( typeof aTargets[j] === 'number' && aTargets[j] >= 0 )
- {
- /* Add columns that we don't yet know about */
- while( columns.length <= aTargets[j] )
- {
- _fnAddColumn( oSettings );
- }
-
- /* Integer, basic index */
- fn( aTargets[j], def );
- }
- else if ( typeof aTargets[j] === 'number' && aTargets[j] < 0 )
- {
- /* Negative integer, right to left column counting */
- fn( columns.length+aTargets[j], def );
- }
- else if ( typeof aTargets[j] === 'string' )
- {
- /* Class name matching on TH element */
- for ( k=0, kLen=columns.length ; k<kLen ; k++ )
- {
- if ( aTargets[j] == "_all" ||
- $(columns[k].nTh).hasClass( aTargets[j] ) )
- {
- fn( k, def );
- }
- }
- }
- }
- }
- }
-
- // Statically defined columns array
- if ( aoCols )
- {
- for ( i=0, iLen=aoCols.length ; i<iLen ; i++ )
- {
- fn( i, aoCols[i] );
- }
- }
- }
-
- /**
- * Add a data array to the table, creating DOM node etc. This is the parallel to
- * _fnGatherData, but for adding rows from a Javascript source, rather than a
- * DOM source.
- * @param {object} oSettings dataTables settings object
- * @param {array} aData data array to be added
- * @param {node} [nTr] TR element to add to the table - optional. If not given,
- * DataTables will create a row automatically
- * @param {array} [anTds] Array of TD|TH elements for the row - must be given
- * if nTr is.
- * @returns {int} >=0 if successful (index of new aoData entry), -1 if failed
- * @memberof DataTable#oApi
- */
- function _fnAddData ( oSettings, aDataIn, nTr, anTds )
- {
- /* Create the object for storing information about this new row */
- var iRow = oSettings.aoData.length;
- var oData = $.extend( true, {}, DataTable.models.oRow, {
- src: nTr ? 'dom' : 'data',
- idx: iRow
- } );
-
- oData._aData = aDataIn;
- oSettings.aoData.push( oData );
-
- /* Create the cells */
- var nTd, sThisType;
- var columns = oSettings.aoColumns;
-
- // Invalidate the column types as the new data needs to be revalidated
- for ( var i=0, iLen=columns.length ; i<iLen ; i++ )
- {
- columns[i].sType = null;
- }
-
- /* Add to the display array */
- oSettings.aiDisplayMaster.push( iRow );
-
- var id = oSettings.rowIdFn( aDataIn );
- if ( id !== undefined ) {
- oSettings.aIds[ id ] = oData;
- }
-
- /* Create the DOM information, or register it if already present */
- if ( nTr || ! oSettings.oFeatures.bDeferRender )
- {
- _fnCreateTr( oSettings, iRow, nTr, anTds );
- }
-
- return iRow;
- }
-
-
- /**
- * Add one or more TR elements to the table. Generally we'd expect to
- * use this for reading data from a DOM sourced table, but it could be
- * used for an TR element. Note that if a TR is given, it is used (i.e.
- * it is not cloned).
- * @param {object} settings dataTables settings object
- * @param {array|node|jQuery} trs The TR element(s) to add to the table
- * @returns {array} Array of indexes for the added rows
- * @memberof DataTable#oApi
- */
- function _fnAddTr( settings, trs )
- {
- var row;
-
- // Allow an individual node to be passed in
- if ( ! (trs instanceof $) ) {
- trs = $(trs);
- }
-
- return trs.map( function (i, el) {
- row = _fnGetRowElements( settings, el );
- return _fnAddData( settings, row.data, el, row.cells );
- } );
- }
-
-
- /**
- * Take a TR element and convert it to an index in aoData
- * @param {object} oSettings dataTables settings object
- * @param {node} n the TR element to find
- * @returns {int} index if the node is found, null if not
- * @memberof DataTable#oApi
- */
- function _fnNodeToDataIndex( oSettings, n )
- {
- return (n._DT_RowIndex!==undefined) ? n._DT_RowIndex : null;
- }
-
-
- /**
- * Take a TD element and convert it into a column data index (not the visible index)
- * @param {object} oSettings dataTables settings object
- * @param {int} iRow The row number the TD/TH can be found in
- * @param {node} n The TD/TH element to find
- * @returns {int} index if the node is found, -1 if not
- * @memberof DataTable#oApi
- */
- function _fnNodeToColumnIndex( oSettings, iRow, n )
- {
- return $.inArray( n, oSettings.aoData[ iRow ].anCells );
- }
-
-
- /**
- * Get the data for a given cell from the internal cache, taking into account data mapping
- * @param {object} settings dataTables settings object
- * @param {int} rowIdx aoData row id
- * @param {int} colIdx Column index
- * @param {string} type data get type ('display', 'type' 'filter' 'sort')
- * @returns {*} Cell data
- * @memberof DataTable#oApi
- */
- function _fnGetCellData( settings, rowIdx, colIdx, type )
- {
- var draw = settings.iDraw;
- var col = settings.aoColumns[colIdx];
- var rowData = settings.aoData[rowIdx]._aData;
- var defaultContent = col.sDefaultContent;
- var cellData = col.fnGetData( rowData, type, {
- settings: settings,
- row: rowIdx,
- col: colIdx
- } );
-
- if ( cellData === undefined ) {
- if ( settings.iDrawError != draw && defaultContent === null ) {
- _fnLog( settings, 0, "Requested unknown parameter "+
- (typeof col.mData=='function' ? '{function}' : "'"+col.mData+"'")+
- " for row "+rowIdx+", column "+colIdx, 4 );
- settings.iDrawError = draw;
- }
- return defaultContent;
- }
-
- // When the data source is null and a specific data type is requested (i.e.
- // not the original data), we can use default column data
- if ( (cellData === rowData || cellData === null) && defaultContent !== null && type !== undefined ) {
- cellData = defaultContent;
- }
- else if ( typeof cellData === 'function' ) {
- // If the data source is a function, then we run it and use the return,
- // executing in the scope of the data object (for instances)
- return cellData.call( rowData );
- }
-
- if ( cellData === null && type == 'display' ) {
- return '';
- }
- return cellData;
- }
-
-
- /**
- * Set the value for a specific cell, into the internal data cache
- * @param {object} settings dataTables settings object
- * @param {int} rowIdx aoData row id
- * @param {int} colIdx Column index
- * @param {*} val Value to set
- * @memberof DataTable#oApi
- */
- function _fnSetCellData( settings, rowIdx, colIdx, val )
- {
- var col = settings.aoColumns[colIdx];
- var rowData = settings.aoData[rowIdx]._aData;
-
- col.fnSetData( rowData, val, {
- settings: settings,
- row: rowIdx,
- col: colIdx
- } );
- }
-
-
- // Private variable that is used to match action syntax in the data property object
- var __reArray = /\[.*?\]$/;
- var __reFn = /\(\)$/;
-
- /**
- * Split string on periods, taking into account escaped periods
- * @param {string} str String to split
- * @return {array} Split string
- */
- function _fnSplitObjNotation( str )
- {
- return $.map( str.match(/(\\.|[^\.])+/g) || [''], function ( s ) {
- return s.replace(/\\\./g, '.');
- } );
- }
-
-
- /**
- * Return a function that can be used to get data from a source object, taking
- * into account the ability to use nested objects as a source
- * @param {string|int|function} mSource The data source for the object
- * @returns {function} Data get function
- * @memberof DataTable#oApi
- */
- function _fnGetObjectDataFn( mSource )
- {
- if ( $.isPlainObject( mSource ) )
- {
- /* Build an object of get functions, and wrap them in a single call */
- var o = {};
- $.each( mSource, function (key, val) {
- if ( val ) {
- o[key] = _fnGetObjectDataFn( val );
- }
- } );
-
- return function (data, type, row, meta) {
- var t = o[type] || o._;
- return t !== undefined ?
- t(data, type, row, meta) :
- data;
- };
- }
- else if ( mSource === null )
- {
- /* Give an empty string for rendering / sorting etc */
- return function (data) { // type, row and meta also passed, but not used
- return data;
- };
- }
- else if ( typeof mSource === 'function' )
- {
- return function (data, type, row, meta) {
- return mSource( data, type, row, meta );
- };
- }
- else if ( typeof mSource === 'string' && (mSource.indexOf('.') !== -1 ||
- mSource.indexOf('[') !== -1 || mSource.indexOf('(') !== -1) )
- {
- /* If there is a . in the source string then the data source is in a
- * nested object so we loop over the data for each level to get the next
- * level down. On each loop we test for undefined, and if found immediately
- * return. This allows entire objects to be missing and sDefaultContent to
- * be used if defined, rather than throwing an error
- */
- var fetchData = function (data, type, src) {
- var arrayNotation, funcNotation, out, innerSrc;
-
- if ( src !== "" )
- {
- var a = _fnSplitObjNotation( src );
-
- for ( var i=0, iLen=a.length ; i<iLen ; i++ )
- {
- // Check if we are dealing with special notation
- arrayNotation = a[i].match(__reArray);
- funcNotation = a[i].match(__reFn);
-
- if ( arrayNotation )
- {
- // Array notation
- a[i] = a[i].replace(__reArray, '');
-
- // Condition allows simply [] to be passed in
- if ( a[i] !== "" ) {
- data = data[ a[i] ];
- }
- out = [];
-
- // Get the remainder of the nested object to get
- a.splice( 0, i+1 );
- innerSrc = a.join('.');
-
- // Traverse each entry in the array getting the properties requested
- if ( $.isArray( data ) ) {
- for ( var j=0, jLen=data.length ; j<jLen ; j++ ) {
- out.push( fetchData( data[j], type, innerSrc ) );
- }
- }
-
- // If a string is given in between the array notation indicators, that
- // is used to join the strings together, otherwise an array is returned
- var join = arrayNotation[0].substring(1, arrayNotation[0].length-1);
- data = (join==="") ? out : out.join(join);
-
- // The inner call to fetchData has already traversed through the remainder
- // of the source requested, so we exit from the loop
- break;
- }
- else if ( funcNotation )
- {
- // Function call
- a[i] = a[i].replace(__reFn, '');
- data = data[ a[i] ]();
- continue;
- }
-
- if ( data === null || data[ a[i] ] === undefined )
- {
- return undefined;
- }
- data = data[ a[i] ];
- }
- }
-
- return data;
- };
-
- return function (data, type) { // row and meta also passed, but not used
- return fetchData( data, type, mSource );
- };
- }
- else
- {
- /* Array or flat object mapping */
- return function (data, type) { // row and meta also passed, but not used
- return data[mSource];
- };
- }
- }
-
-
- /**
- * Return a function that can be used to set data from a source object, taking
- * into account the ability to use nested objects as a source
- * @param {string|int|function} mSource The data source for the object
- * @returns {function} Data set function
- * @memberof DataTable#oApi
- */
- function _fnSetObjectDataFn( mSource )
- {
- if ( $.isPlainObject( mSource ) )
- {
- /* Unlike get, only the underscore (global) option is used for for
- * setting data since we don't know the type here. This is why an object
- * option is not documented for `mData` (which is read/write), but it is
- * for `mRender` which is read only.
- */
- return _fnSetObjectDataFn( mSource._ );
- }
- else if ( mSource === null )
- {
- /* Nothing to do when the data source is null */
- return function () {};
- }
- else if ( typeof mSource === 'function' )
- {
- return function (data, val, meta) {
- mSource( data, 'set', val, meta );
- };
- }
- else if ( typeof mSource === 'string' && (mSource.indexOf('.') !== -1 ||
- mSource.indexOf('[') !== -1 || mSource.indexOf('(') !== -1) )
- {
- /* Like the get, we need to get data from a nested object */
- var setData = function (data, val, src) {
- var a = _fnSplitObjNotation( src ), b;
- var aLast = a[a.length-1];
- var arrayNotation, funcNotation, o, innerSrc;
-
- for ( var i=0, iLen=a.length-1 ; i<iLen ; i++ )
- {
- // Check if we are dealing with an array notation request
- arrayNotation = a[i].match(__reArray);
- funcNotation = a[i].match(__reFn);
-
- if ( arrayNotation )
- {
- a[i] = a[i].replace(__reArray, '');
- data[ a[i] ] = [];
-
- // Get the remainder of the nested object to set so we can recurse
- b = a.slice();
- b.splice( 0, i+1 );
- innerSrc = b.join('.');
-
- // Traverse each entry in the array setting the properties requested
- if ( $.isArray( val ) )
- {
- for ( var j=0, jLen=val.length ; j<jLen ; j++ )
- {
- o = {};
- setData( o, val[j], innerSrc );
- data[ a[i] ].push( o );
- }
- }
- else
- {
- // We've been asked to save data to an array, but it
- // isn't array data to be saved. Best that can be done
- // is to just save the value.
- data[ a[i] ] = val;
- }
-
- // The inner call to setData has already traversed through the remainder
- // of the source and has set the data, thus we can exit here
- return;
- }
- else if ( funcNotation )
- {
- // Function call
- a[i] = a[i].replace(__reFn, '');
- data = data[ a[i] ]( val );
- }
-
- // If the nested object doesn't currently exist - since we are
- // trying to set the value - create it
- if ( data[ a[i] ] === null || data[ a[i] ] === undefined )
- {
- data[ a[i] ] = {};
- }
- data = data[ a[i] ];
- }
-
- // Last item in the input - i.e, the actual set
- if ( aLast.match(__reFn ) )
- {
- // Function call
- data = data[ aLast.replace(__reFn, '') ]( val );
- }
- else
- {
- // If array notation is used, we just want to strip it and use the property name
- // and assign the value. If it isn't used, then we get the result we want anyway
- data[ aLast.replace(__reArray, '') ] = val;
- }
- };
-
- return function (data, val) { // meta is also passed in, but not used
- return setData( data, val, mSource );
- };
- }
- else
- {
- /* Array or flat object mapping */
- return function (data, val) { // meta is also passed in, but not used
- data[mSource] = val;
- };
- }
- }
-
-
- /**
- * Return an array with the full table data
- * @param {object} oSettings dataTables settings object
- * @returns array {array} aData Master data array
- * @memberof DataTable#oApi
- */
- function _fnGetDataMaster ( settings )
- {
- return _pluck( settings.aoData, '_aData' );
- }
-
-
- /**
- * Nuke the table
- * @param {object} oSettings dataTables settings object
- * @memberof DataTable#oApi
- */
- function _fnClearTable( settings )
- {
- settings.aoData.length = 0;
- settings.aiDisplayMaster.length = 0;
- settings.aiDisplay.length = 0;
- settings.aIds = {};
- }
-
-
- /**
- * Take an array of integers (index array) and remove a target integer (value - not
- * the key!)
- * @param {array} a Index array to target
- * @param {int} iTarget value to find
- * @memberof DataTable#oApi
- */
- function _fnDeleteIndex( a, iTarget, splice )
- {
- var iTargetIndex = -1;
-
- for ( var i=0, iLen=a.length ; i<iLen ; i++ )
- {
- if ( a[i] == iTarget )
- {
- iTargetIndex = i;
- }
- else if ( a[i] > iTarget )
- {
- a[i]--;
- }
- }
-
- if ( iTargetIndex != -1 && splice === undefined )
- {
- a.splice( iTargetIndex, 1 );
- }
- }
-
-
- /**
- * Mark cached data as invalid such that a re-read of the data will occur when
- * the cached data is next requested. Also update from the data source object.
- *
- * @param {object} settings DataTables settings object
- * @param {int} rowIdx Row index to invalidate
- * @param {string} [src] Source to invalidate from: undefined, 'auto', 'dom'
- * or 'data'
- * @param {int} [colIdx] Column index to invalidate. If undefined the whole
- * row will be invalidated
- * @memberof DataTable#oApi
- *
- * @todo For the modularisation of v1.11 this will need to become a callback, so
- * the sort and filter methods can subscribe to it. That will required
- * initialisation options for sorting, which is why it is not already baked in
- */
- function _fnInvalidate( settings, rowIdx, src, colIdx )
- {
- var row = settings.aoData[ rowIdx ];
- var i, ien;
- var cellWrite = function ( cell, col ) {
- // This is very frustrating, but in IE if you just write directly
- // to innerHTML, and elements that are overwritten are GC'ed,
- // even if there is a reference to them elsewhere
- while ( cell.childNodes.length ) {
- cell.removeChild( cell.firstChild );
- }
-
- cell.innerHTML = _fnGetCellData( settings, rowIdx, col, 'display' );
- };
-
- // Are we reading last data from DOM or the data object?
- if ( src === 'dom' || ((! src || src === 'auto') && row.src === 'dom') ) {
- // Read the data from the DOM
- row._aData = _fnGetRowElements(
- settings, row, colIdx, colIdx === undefined ? undefined : row._aData
- )
- .data;
- }
- else {
- // Reading from data object, update the DOM
- var cells = row.anCells;
-
- if ( cells ) {
- if ( colIdx !== undefined ) {
- cellWrite( cells[colIdx], colIdx );
- }
- else {
- for ( i=0, ien=cells.length ; i<ien ; i++ ) {
- cellWrite( cells[i], i );
- }
- }
- }
- }
-
- // For both row and cell invalidation, the cached data for sorting and
- // filtering is nulled out
- row._aSortData = null;
- row._aFilterData = null;
-
- // Invalidate the type for a specific column (if given) or all columns since
- // the data might have changed
- var cols = settings.aoColumns;
- if ( colIdx !== undefined ) {
- cols[ colIdx ].sType = null;
- }
- else {
- for ( i=0, ien=cols.length ; i<ien ; i++ ) {
- cols[i].sType = null;
- }
-
- // Update DataTables special `DT_*` attributes for the row
- _fnRowAttributes( settings, row );
- }
- }
-
-
- /**
- * Build a data source object from an HTML row, reading the contents of the
- * cells that are in the row.
- *
- * @param {object} settings DataTables settings object
- * @param {node|object} TR element from which to read data or existing row
- * object from which to re-read the data from the cells
- * @param {int} [colIdx] Optional column index
- * @param {array|object} [d] Data source object. If `colIdx` is given then this
- * parameter should also be given and will be used to write the data into.
- * Only the column in question will be written
- * @returns {object} Object with two parameters: `data` the data read, in
- * document order, and `cells` and array of nodes (they can be useful to the
- * caller, so rather than needing a second traversal to get them, just return
- * them from here).
- * @memberof DataTable#oApi
- */
- function _fnGetRowElements( settings, row, colIdx, d )
- {
- var
- tds = [],
- td = row.firstChild,
- name, col, o, i=0, contents,
- columns = settings.aoColumns,
- objectRead = settings._rowReadObject;
-
- // Allow the data object to be passed in, or construct
- d = d !== undefined ?
- d :
- objectRead ?
- {} :
- [];
-
- var attr = function ( str, td ) {
- if ( typeof str === 'string' ) {
- var idx = str.indexOf('@');
-
- if ( idx !== -1 ) {
- var attr = str.substring( idx+1 );
- var setter = _fnSetObjectDataFn( str );
- setter( d, td.getAttribute( attr ) );
- }
- }
- };
-
- // Read data from a cell and store into the data object
- var cellProcess = function ( cell ) {
- if ( colIdx === undefined || colIdx === i ) {
- col = columns[i];
- contents = $.trim(cell.innerHTML);
-
- if ( col && col._bAttrSrc ) {
- var setter = _fnSetObjectDataFn( col.mData._ );
- setter( d, contents );
-
- attr( col.mData.sort, cell );
- attr( col.mData.type, cell );
- attr( col.mData.filter, cell );
- }
- else {
- // Depending on the `data` option for the columns the data can
- // be read to either an object or an array.
- if ( objectRead ) {
- if ( ! col._setter ) {
- // Cache the setter function
- col._setter = _fnSetObjectDataFn( col.mData );
- }
- col._setter( d, contents );
- }
- else {
- d[i] = contents;
- }
- }
- }
-
- i++;
- };
-
- if ( td ) {
- // `tr` element was passed in
- while ( td ) {
- name = td.nodeName.toUpperCase();
-
- if ( name == "TD" || name == "TH" ) {
- cellProcess( td );
- tds.push( td );
- }
-
- td = td.nextSibling;
- }
- }
- else {
- // Existing row object passed in
- tds = row.anCells;
-
- for ( var j=0, jen=tds.length ; j<jen ; j++ ) {
- cellProcess( tds[j] );
- }
- }
-
- // Read the ID from the DOM if present
- var rowNode = row.firstChild ? row : row.nTr;
-
- if ( rowNode ) {
- var id = rowNode.getAttribute( 'id' );
-
- if ( id ) {
- _fnSetObjectDataFn( settings.rowId )( d, id );
- }
- }
-
- return {
- data: d,
- cells: tds
- };
- }
- /**
- * Create a new TR element (and it's TD children) for a row
- * @param {object} oSettings dataTables settings object
- * @param {int} iRow Row to consider
- * @param {node} [nTrIn] TR element to add to the table - optional. If not given,
- * DataTables will create a row automatically
- * @param {array} [anTds] Array of TD|TH elements for the row - must be given
- * if nTr is.
- * @memberof DataTable#oApi
- */
- function _fnCreateTr ( oSettings, iRow, nTrIn, anTds )
- {
- var
- row = oSettings.aoData[iRow],
- rowData = row._aData,
- cells = [],
- nTr, nTd, oCol,
- i, iLen;
-
- if ( row.nTr === null )
- {
- nTr = nTrIn || document.createElement('tr');
-
- row.nTr = nTr;
- row.anCells = cells;
-
- /* Use a private property on the node to allow reserve mapping from the node
- * to the aoData array for fast look up
- */
- nTr._DT_RowIndex = iRow;
-
- /* Special parameters can be given by the data source to be used on the row */
- _fnRowAttributes( oSettings, row );
-
- /* Process each column */
- for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
- {
- oCol = oSettings.aoColumns[i];
-
- nTd = nTrIn ? anTds[i] : document.createElement( oCol.sCellType );
- nTd._DT_CellIndex = {
- row: iRow,
- column: i
- };
-
- cells.push( nTd );
-
- // Need to create the HTML if new, or if a rendering function is defined
- if ( (!nTrIn || oCol.mRender || oCol.mData !== i) &&
- (!$.isPlainObject(oCol.mData) || oCol.mData._ !== i+'.display')
- ) {
- nTd.innerHTML = _fnGetCellData( oSettings, iRow, i, 'display' );
- }
-
- /* Add user defined class */
- if ( oCol.sClass )
- {
- nTd.className += ' '+oCol.sClass;
- }
-
- // Visibility - add or remove as required
- if ( oCol.bVisible && ! nTrIn )
- {
- nTr.appendChild( nTd );
- }
- else if ( ! oCol.bVisible && nTrIn )
- {
- nTd.parentNode.removeChild( nTd );
- }
-
- if ( oCol.fnCreatedCell )
- {
- oCol.fnCreatedCell.call( oSettings.oInstance,
- nTd, _fnGetCellData( oSettings, iRow, i ), rowData, iRow, i
- );
- }
- }
-
- _fnCallbackFire( oSettings, 'aoRowCreatedCallback', null, [nTr, rowData, iRow] );
- }
-
- // Remove once webkit bug 131819 and Chromium bug 365619 have been resolved
- // and deployed
- row.nTr.setAttribute( 'role', 'row' );
- }
-
-
- /**
- * Add attributes to a row based on the special `DT_*` parameters in a data
- * source object.
- * @param {object} settings DataTables settings object
- * @param {object} DataTables row object for the row to be modified
- * @memberof DataTable#oApi
- */
- function _fnRowAttributes( settings, row )
- {
- var tr = row.nTr;
- var data = row._aData;
-
- if ( tr ) {
- var id = settings.rowIdFn( data );
-
- if ( id ) {
- tr.id = id;
- }
-
- if ( data.DT_RowClass ) {
- // Remove any classes added by DT_RowClass before
- var a = data.DT_RowClass.split(' ');
- row.__rowc = row.__rowc ?
- _unique( row.__rowc.concat( a ) ) :
- a;
-
- $(tr)
- .removeClass( row.__rowc.join(' ') )
- .addClass( data.DT_RowClass );
- }
-
- if ( data.DT_RowAttr ) {
- $(tr).attr( data.DT_RowAttr );
- }
-
- if ( data.DT_RowData ) {
- $(tr).data( data.DT_RowData );
- }
- }
- }
-
-
- /**
- * Create the HTML header for the table
- * @param {object} oSettings dataTables settings object
- * @memberof DataTable#oApi
- */
- function _fnBuildHead( oSettings )
- {
- var i, ien, cell, row, column;
- var thead = oSettings.nTHead;
- var tfoot = oSettings.nTFoot;
- var createHeader = $('th, td', thead).length === 0;
- var classes = oSettings.oClasses;
- var columns = oSettings.aoColumns;
-
- if ( createHeader ) {
- row = $('<tr/>').appendTo( thead );
- }
-
- for ( i=0, ien=columns.length ; i<ien ; i++ ) {
- column = columns[i];
- cell = $( column.nTh ).addClass( column.sClass );
-
- if ( createHeader ) {
- cell.appendTo( row );
- }
-
- // 1.11 move into sorting
- if ( oSettings.oFeatures.bSort ) {
- cell.addClass( column.sSortingClass );
-
- if ( column.bSortable !== false ) {
- cell
- .attr( 'tabindex', oSettings.iTabIndex )
- .attr( 'aria-controls', oSettings.sTableId );
-
- _fnSortAttachListener( oSettings, column.nTh, i );
- }
- }
-
- if ( column.sTitle != cell[0].innerHTML ) {
- cell.html( column.sTitle );
- }
-
- _fnRenderer( oSettings, 'header' )(
- oSettings, cell, column, classes
- );
- }
-
- if ( createHeader ) {
- _fnDetectHeader( oSettings.aoHeader, thead );
- }
-
- /* ARIA role for the rows */
- $(thead).find('>tr').attr('role', 'row');
-
- /* Deal with the footer - add classes if required */
- $(thead).find('>tr>th, >tr>td').addClass( classes.sHeaderTH );
- $(tfoot).find('>tr>th, >tr>td').addClass( classes.sFooterTH );
-
- // Cache the footer cells. Note that we only take the cells from the first
- // row in the footer. If there is more than one row the user wants to
- // interact with, they need to use the table().foot() method. Note also this
- // allows cells to be used for multiple columns using colspan
- if ( tfoot !== null ) {
- var cells = oSettings.aoFooter[0];
-
- for ( i=0, ien=cells.length ; i<ien ; i++ ) {
- column = columns[i];
- column.nTf = cells[i].cell;
-
- if ( column.sClass ) {
- $(column.nTf).addClass( column.sClass );
- }
- }
- }
- }
-
-
- /**
- * Draw the header (or footer) element based on the column visibility states. The
- * methodology here is to use the layout array from _fnDetectHeader, modified for
- * the instantaneous column visibility, to construct the new layout. The grid is
- * traversed over cell at a time in a rows x columns grid fashion, although each
- * cell insert can cover multiple elements in the grid - which is tracks using the
- * aApplied array. Cell inserts in the grid will only occur where there isn't
- * already a cell in that position.
- * @param {object} oSettings dataTables settings object
- * @param array {objects} aoSource Layout array from _fnDetectHeader
- * @param {boolean} [bIncludeHidden=false] If true then include the hidden columns in the calc,
- * @memberof DataTable#oApi
- */
- function _fnDrawHead( oSettings, aoSource, bIncludeHidden )
- {
- var i, iLen, j, jLen, k, kLen, n, nLocalTr;
- var aoLocal = [];
- var aApplied = [];
- var iColumns = oSettings.aoColumns.length;
- var iRowspan, iColspan;
-
- if ( ! aoSource )
- {
- return;
- }
-
- if ( bIncludeHidden === undefined )
- {
- bIncludeHidden = false;
- }
-
- /* Make a copy of the master layout array, but without the visible columns in it */
- for ( i=0, iLen=aoSource.length ; i<iLen ; i++ )
- {
- aoLocal[i] = aoSource[i].slice();
- aoLocal[i].nTr = aoSource[i].nTr;
-
- /* Remove any columns which are currently hidden */
- for ( j=iColumns-1 ; j>=0 ; j-- )
- {
- if ( !oSettings.aoColumns[j].bVisible && !bIncludeHidden )
- {
- aoLocal[i].splice( j, 1 );
- }
- }
-
- /* Prep the applied array - it needs an element for each row */
- aApplied.push( [] );
- }
-
- for ( i=0, iLen=aoLocal.length ; i<iLen ; i++ )
- {
- nLocalTr = aoLocal[i].nTr;
-
- /* All cells are going to be replaced, so empty out the row */
- if ( nLocalTr )
- {
- while( (n = nLocalTr.firstChild) )
- {
- nLocalTr.removeChild( n );
- }
- }
-
- for ( j=0, jLen=aoLocal[i].length ; j<jLen ; j++ )
- {
- iRowspan = 1;
- iColspan = 1;
-
- /* Check to see if there is already a cell (row/colspan) covering our target
- * insert point. If there is, then there is nothing to do.
- */
- if ( aApplied[i][j] === undefined )
- {
- nLocalTr.appendChild( aoLocal[i][j].cell );
- aApplied[i][j] = 1;
-
- /* Expand the cell to cover as many rows as needed */
- while ( aoLocal[i+iRowspan] !== undefined &&
- aoLocal[i][j].cell == aoLocal[i+iRowspan][j].cell )
- {
- aApplied[i+iRowspan][j] = 1;
- iRowspan++;
- }
-
- /* Expand the cell to cover as many columns as needed */
- while ( aoLocal[i][j+iColspan] !== undefined &&
- aoLocal[i][j].cell == aoLocal[i][j+iColspan].cell )
- {
- /* Must update the applied array over the rows for the columns */
- for ( k=0 ; k<iRowspan ; k++ )
- {
- aApplied[i+k][j+iColspan] = 1;
- }
- iColspan++;
- }
-
- /* Do the actual expansion in the DOM */
- $(aoLocal[i][j].cell)
- .attr('rowspan', iRowspan)
- .attr('colspan', iColspan);
- }
- }
- }
- }
-
-
- /**
- * Insert the required TR nodes into the table for display
- * @param {object} oSettings dataTables settings object
- * @memberof DataTable#oApi
- */
- function _fnDraw( oSettings )
- {
- /* Provide a pre-callback function which can be used to cancel the draw is false is returned */
- var aPreDraw = _fnCallbackFire( oSettings, 'aoPreDrawCallback', 'preDraw', [oSettings] );
- if ( $.inArray( false, aPreDraw ) !== -1 )
- {
- _fnProcessingDisplay( oSettings, false );
- return;
- }
-
- var i, iLen, n;
- var anRows = [];
- var iRowCount = 0;
- var asStripeClasses = oSettings.asStripeClasses;
- var iStripes = asStripeClasses.length;
- var iOpenRows = oSettings.aoOpenRows.length;
- var oLang = oSettings.oLanguage;
- var iInitDisplayStart = oSettings.iInitDisplayStart;
- var bServerSide = _fnDataSource( oSettings ) == 'ssp';
- var aiDisplay = oSettings.aiDisplay;
-
- oSettings.bDrawing = true;
-
- /* Check and see if we have an initial draw position from state saving */
- if ( iInitDisplayStart !== undefined && iInitDisplayStart !== -1 )
- {
- oSettings._iDisplayStart = bServerSide ?
- iInitDisplayStart :
- iInitDisplayStart >= oSettings.fnRecordsDisplay() ?
- 0 :
- iInitDisplayStart;
-
- oSettings.iInitDisplayStart = -1;
- }
-
- var iDisplayStart = oSettings._iDisplayStart;
- var iDisplayEnd = oSettings.fnDisplayEnd();
-
- /* Server-side processing draw intercept */
- if ( oSettings.bDeferLoading )
- {
- oSettings.bDeferLoading = false;
- oSettings.iDraw++;
- _fnProcessingDisplay( oSettings, false );
- }
- else if ( !bServerSide )
- {
- oSettings.iDraw++;
- }
- else if ( !oSettings.bDestroying && !_fnAjaxUpdate( oSettings ) )
- {
- return;
- }
-
- if ( aiDisplay.length !== 0 )
- {
- var iStart = bServerSide ? 0 : iDisplayStart;
- var iEnd = bServerSide ? oSettings.aoData.length : iDisplayEnd;
-
- for ( var j=iStart ; j<iEnd ; j++ )
- {
- var iDataIndex = aiDisplay[j];
- var aoData = oSettings.aoData[ iDataIndex ];
- if ( aoData.nTr === null )
- {
- _fnCreateTr( oSettings, iDataIndex );
- }
-
- var nRow = aoData.nTr;
-
- /* Remove the old striping classes and then add the new one */
- if ( iStripes !== 0 )
- {
- var sStripe = asStripeClasses[ iRowCount % iStripes ];
- if ( aoData._sRowStripe != sStripe )
- {
- $(nRow).removeClass( aoData._sRowStripe ).addClass( sStripe );
- aoData._sRowStripe = sStripe;
- }
- }
-
- // Row callback functions - might want to manipulate the row
- // iRowCount and j are not currently documented. Are they at all
- // useful?
- _fnCallbackFire( oSettings, 'aoRowCallback', null,
- [nRow, aoData._aData, iRowCount, j] );
-
- anRows.push( nRow );
- iRowCount++;
- }
- }
- else
- {
- /* Table is empty - create a row with an empty message in it */
- var sZero = oLang.sZeroRecords;
- if ( oSettings.iDraw == 1 && _fnDataSource( oSettings ) == 'ajax' )
- {
- sZero = oLang.sLoadingRecords;
- }
- else if ( oLang.sEmptyTable && oSettings.fnRecordsTotal() === 0 )
- {
- sZero = oLang.sEmptyTable;
- }
-
- anRows[ 0 ] = $( '<tr/>', { 'class': iStripes ? asStripeClasses[0] : '' } )
- .append( $('<td />', {
- 'valign': 'top',
- 'colSpan': _fnVisbleColumns( oSettings ),
- 'class': oSettings.oClasses.sRowEmpty
- } ).html( sZero ) )[0];
- }
-
- /* Header and footer callbacks */
- _fnCallbackFire( oSettings, 'aoHeaderCallback', 'header', [ $(oSettings.nTHead).children('tr')[0],
- _fnGetDataMaster( oSettings ), iDisplayStart, iDisplayEnd, aiDisplay ] );
-
- _fnCallbackFire( oSettings, 'aoFooterCallback', 'footer', [ $(oSettings.nTFoot).children('tr')[0],
- _fnGetDataMaster( oSettings ), iDisplayStart, iDisplayEnd, aiDisplay ] );
-
- var body = $(oSettings.nTBody);
-
- body.children().detach();
- body.append( $(anRows) );
-
- /* Call all required callback functions for the end of a draw */
- _fnCallbackFire( oSettings, 'aoDrawCallback', 'draw', [oSettings] );
-
- /* Draw is complete, sorting and filtering must be as well */
- oSettings.bSorted = false;
- oSettings.bFiltered = false;
- oSettings.bDrawing = false;
- }
-
-
- /**
- * Redraw the table - taking account of the various features which are enabled
- * @param {object} oSettings dataTables settings object
- * @param {boolean} [holdPosition] Keep the current paging position. By default
- * the paging is reset to the first page
- * @memberof DataTable#oApi
- */
- function _fnReDraw( settings, holdPosition )
- {
- var
- features = settings.oFeatures,
- sort = features.bSort,
- filter = features.bFilter;
-
- if ( sort ) {
- _fnSort( settings );
- }
-
- if ( filter ) {
- _fnFilterComplete( settings, settings.oPreviousSearch );
- }
- else {
- // No filtering, so we want to just use the display master
- settings.aiDisplay = settings.aiDisplayMaster.slice();
- }
-
- if ( holdPosition !== true ) {
- settings._iDisplayStart = 0;
- }
-
- // Let any modules know about the draw hold position state (used by
- // scrolling internally)
- settings._drawHold = holdPosition;
-
- _fnDraw( settings );
-
- settings._drawHold = false;
- }
-
-
- /**
- * Add the options to the page HTML for the table
- * @param {object} oSettings dataTables settings object
- * @memberof DataTable#oApi
- */
- function _fnAddOptionsHtml ( oSettings )
- {
- var classes = oSettings.oClasses;
- var table = $(oSettings.nTable);
- var holding = $('<div/>').insertBefore( table ); // Holding element for speed
- var features = oSettings.oFeatures;
-
- // All DataTables are wrapped in a div
- var insert = $('<div/>', {
- id: oSettings.sTableId+'_wrapper',
- 'class': classes.sWrapper + (oSettings.nTFoot ? '' : ' '+classes.sNoFooter)
- } );
-
- oSettings.nHolding = holding[0];
- oSettings.nTableWrapper = insert[0];
- oSettings.nTableReinsertBefore = oSettings.nTable.nextSibling;
-
- /* Loop over the user set positioning and place the elements as needed */
- var aDom = oSettings.sDom.split('');
- var featureNode, cOption, nNewNode, cNext, sAttr, j;
- for ( var i=0 ; i<aDom.length ; i++ )
- {
- featureNode = null;
- cOption = aDom[i];
-
- if ( cOption == '<' )
- {
- /* New container div */
- nNewNode = $('<div/>')[0];
-
- /* Check to see if we should append an id and/or a class name to the container */
- cNext = aDom[i+1];
- if ( cNext == "'" || cNext == '"' )
- {
- sAttr = "";
- j = 2;
- while ( aDom[i+j] != cNext )
- {
- sAttr += aDom[i+j];
- j++;
- }
-
- /* Replace jQuery UI constants @todo depreciated */
- if ( sAttr == "H" )
- {
- sAttr = classes.sJUIHeader;
- }
- else if ( sAttr == "F" )
- {
- sAttr = classes.sJUIFooter;
- }
-
- /* The attribute can be in the format of "#id.class", "#id" or "class" This logic
- * breaks the string into parts and applies them as needed
- */
- if ( sAttr.indexOf('.') != -1 )
- {
- var aSplit = sAttr.split('.');
- nNewNode.id = aSplit[0].substr(1, aSplit[0].length-1);
- nNewNode.className = aSplit[1];
- }
- else if ( sAttr.charAt(0) == "#" )
- {
- nNewNode.id = sAttr.substr(1, sAttr.length-1);
- }
- else
- {
- nNewNode.className = sAttr;
- }
-
- i += j; /* Move along the position array */
- }
-
- insert.append( nNewNode );
- insert = $(nNewNode);
- }
- else if ( cOption == '>' )
- {
- /* End container div */
- insert = insert.parent();
- }
- // @todo Move options into their own plugins?
- else if ( cOption == 'l' && features.bPaginate && features.bLengthChange )
- {
- /* Length */
- featureNode = _fnFeatureHtmlLength( oSettings );
- }
- else if ( cOption == 'f' && features.bFilter )
- {
- /* Filter */
- featureNode = _fnFeatureHtmlFilter( oSettings );
- }
- else if ( cOption == 'r' && features.bProcessing )
- {
- /* pRocessing */
- featureNode = _fnFeatureHtmlProcessing( oSettings );
- }
- else if ( cOption == 't' )
- {
- /* Table */
- featureNode = _fnFeatureHtmlTable( oSettings );
- }
- else if ( cOption == 'i' && features.bInfo )
- {
- /* Info */
- featureNode = _fnFeatureHtmlInfo( oSettings );
- }
- else if ( cOption == 'p' && features.bPaginate )
- {
- /* Pagination */
- featureNode = _fnFeatureHtmlPaginate( oSettings );
- }
- else if ( DataTable.ext.feature.length !== 0 )
- {
- /* Plug-in features */
- var aoFeatures = DataTable.ext.feature;
- for ( var k=0, kLen=aoFeatures.length ; k<kLen ; k++ )
- {
- if ( cOption == aoFeatures[k].cFeature )
- {
- featureNode = aoFeatures[k].fnInit( oSettings );
- break;
- }
- }
- }
-
- /* Add to the 2D features array */
- if ( featureNode )
- {
- var aanFeatures = oSettings.aanFeatures;
-
- if ( ! aanFeatures[cOption] )
- {
- aanFeatures[cOption] = [];
- }
-
- aanFeatures[cOption].push( featureNode );
- insert.append( featureNode );
- }
- }
-
- /* Built our DOM structure - replace the holding div with what we want */
- holding.replaceWith( insert );
- oSettings.nHolding = null;
- }
-
-
- /**
- * Use the DOM source to create up an array of header cells. The idea here is to
- * create a layout grid (array) of rows x columns, which contains a reference
- * to the cell that that point in the grid (regardless of col/rowspan), such that
- * any column / row could be removed and the new grid constructed
- * @param array {object} aLayout Array to store the calculated layout in
- * @param {node} nThead The header/footer element for the table
- * @memberof DataTable#oApi
- */
- function _fnDetectHeader ( aLayout, nThead )
- {
- var nTrs = $(nThead).children('tr');
- var nTr, nCell;
- var i, k, l, iLen, jLen, iColShifted, iColumn, iColspan, iRowspan;
- var bUnique;
- var fnShiftCol = function ( a, i, j ) {
- var k = a[i];
- while ( k[j] ) {
- j++;
- }
- return j;
- };
-
- aLayout.splice( 0, aLayout.length );
-
- /* We know how many rows there are in the layout - so prep it */
- for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
- {
- aLayout.push( [] );
- }
-
- /* Calculate a layout array */
- for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
- {
- nTr = nTrs[i];
- iColumn = 0;
-
- /* For every cell in the row... */
- nCell = nTr.firstChild;
- while ( nCell ) {
- if ( nCell.nodeName.toUpperCase() == "TD" ||
- nCell.nodeName.toUpperCase() == "TH" )
- {
- /* Get the col and rowspan attributes from the DOM and sanitise them */
- iColspan = nCell.getAttribute('colspan') * 1;
- iRowspan = nCell.getAttribute('rowspan') * 1;
- iColspan = (!iColspan || iColspan===0 || iColspan===1) ? 1 : iColspan;
- iRowspan = (!iRowspan || iRowspan===0 || iRowspan===1) ? 1 : iRowspan;
-
- /* There might be colspan cells already in this row, so shift our target
- * accordingly
- */
- iColShifted = fnShiftCol( aLayout, i, iColumn );
-
- /* Cache calculation for unique columns */
- bUnique = iColspan === 1 ? true : false;
-
- /* If there is col / rowspan, copy the information into the layout grid */
- for ( l=0 ; l<iColspan ; l++ )
- {
- for ( k=0 ; k<iRowspan ; k++ )
... 16539 lines suppressed ...