From afa09962dcdfcd172d98339be9d70187bdb22d61 Mon Sep 17 00:00:00 2001 From: zsloan Date: Mon, 20 Jul 2015 21:21:02 +0000 Subject: Fixed the code that generates the dataset selection drop-down for correlations Made changes to the tables of correlation results, collections, and search results: - Added resizeable columns to correlation results and collections, but not to search results because it seems that it requires Y scrolling to be set (I'll check if it makes sense to add scrolling to the search results) - Correlation results and collections are now in scrolling tables - The style is the same across all of these tables now Remaining issues: - It doesn't seem like I can set the column width when initializing dataTables in correlation results. I don't know why this is; it might be due to the table already being the size of a full page. I want to be able to default to some good widths, even if the user can resize them - I tried adding hoverForMore, but it doesn't seem to cooperate with datatable cells; I think this is due to having to put the text in a div. --- wqflask/base/data_set.py | 58 +- wqflask/wqflask/collect.py | 2 + wqflask/wqflask/correlation/show_corr_results.py | 2 + wqflask/wqflask/model.py | 7 +- wqflask/wqflask/search_results.py | 3 +- wqflask/wqflask/show_trait/show_trait.py | 2 - .../packages/DataTables/css/jquery.dataTables.css | 609 +- .../DataTables/css/jquery.dataTables.min.css | 1 + .../css/jquery.dataTables_themeroller.css | 614 +- .../DataTables/extensions/dataTables.colResize.js | 846 + .../packages/DataTables/js/jquery.dataTables.js | 18972 +++++++++++-------- .../DataTables/js/jquery.dataTables.min.js | 313 +- .../static/new/packages/DataTables/js/jquery.js | 7 +- wqflask/wqflask/templates/collections/list.html | 39 +- wqflask/wqflask/templates/collections/view.html | 56 +- wqflask/wqflask/templates/correlation_page.html | 283 +- wqflask/wqflask/templates/search_result_page.html | 76 +- 17 files changed, 13109 insertions(+), 8781 deletions(-) create mode 100644 wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.min.css create mode 100644 wqflask/wqflask/static/new/packages/DataTables/extensions/dataTables.colResize.js (limited to 'wqflask') diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index a572a607..c60efe65 100755 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -277,7 +277,7 @@ class DatasetGroup(object): """ def __init__(self, dataset): """This sets self.group and self.group_id""" - print("dataset name:", dataset.name) + print("DATASET NAME2:", dataset.name) self.name, self.id = g.db.execute(dataset.query_for_group).fetchone() if self.name == 'BXD300': self.name = "BXD" @@ -306,13 +306,13 @@ class DatasetGroup(object): self.markers = marker_class(self.name) def datasets(self): - key = "group_dataset_menu:v1:" + self.name - print("key is:", key) - with Bench("Loading cache"): - result = Redis.get(key) - if result: - self._datasets = pickle.loads(result) - return self._datasets + key = "group_dataset_menu:v2:" + self.name + print("key is2:", key) + #with Bench("Loading cache"): + # result = Redis.get(key) + #if result: + # self._datasets = pickle.loads(result) + # return self._datasets dataset_menu = [] print("[tape4] webqtlConfig.PUBLICTHRESH:", webqtlConfig.PUBLICTHRESH) @@ -342,18 +342,37 @@ class DatasetGroup(object): self.name, webqtlConfig.PUBLICTHRESH, "%" + self.name + "%", webqtlConfig.PUBLICTHRESH)) - for tissue_name, dataset in itertools.groupby(results.fetchall(), itemgetter(0)): + the_results = results.fetchall() + + #for tissue_name, dataset in itertools.groupby(the_results, itemgetter(0)): + for dataset_item in the_results: + tissue_name = dataset_item[0] + dataset = dataset_item[1] + dataset_short = dataset_item[2] if tissue_name in ['#PublishFreeze', '#GenoFreeze']: - for item in dataset: - dataset_menu.append(dict(tissue=None, datasets=[item[1:]])) + dataset_menu.append(dict(tissue=None, datasets=[(dataset, dataset_short)])) else: dataset_sub_menu = [item[1:] for item in dataset] - dataset_menu.append(dict(tissue=tissue_name, - datasets=dataset_sub_menu)) + + tissue_already_exists = False + tissue_position = None + for i, tissue_dict in enumerate(dataset_menu): + if tissue_dict['tissue'] == tissue_name: + tissue_already_exists = True + tissue_position = i + break + + if tissue_already_exists: + print("dataset_menu:", dataset_menu[i]['datasets']) + dataset_menu[i]['datasets'].append((dataset, dataset_short)) + else: + dataset_menu.append(dict(tissue=tissue_name, + datasets=[(dataset, dataset_short)])) Redis.set(key, pickle.dumps(dataset_menu, pickle.HIGHEST_PROTOCOL)) Redis.expire(key, 60*5) self._datasets = dataset_menu + return self._datasets def get_f1_parent_strains(self): @@ -499,6 +518,8 @@ class DataSet(object): self.group.get_samplelist() self.species = species.TheSpecies(self) + print("TESTING!!!") + def get_desc(self): """Gets overridden later, at least for Temp...used by trait's get_given_name""" @@ -699,13 +720,13 @@ class PhenotypeDataSet(DataSet): # Fields displayed in the search results table header self.header_fields = ['Index', - 'ID', + 'Record', 'Description', 'Authors', 'Year', 'Max LRS', 'Max LRS Location', - 'Add. Effect ?'] + 'Additive Effect'] self.type = 'Publish' @@ -784,7 +805,6 @@ class PhenotypeDataSet(DataSet): Geno.Name = %s and Geno.SpeciesId = Species.Id """, (species, this_trait.locus)).fetchone() - #result = self.cursor.fetchone() if result: if result[0] and result[1]: @@ -961,14 +981,14 @@ class MrnaAssayDataSet(DataSet): # Fields displayed in the search results table header self.header_fields = ['Index', - 'ID', + 'Record', 'Symbol', 'Description', 'Location', - 'Mean Expr', + 'Mean', 'Max LRS', 'Max LRS Location', - 'Add. Effect ?'] + 'Additive Effect'] # Todo: Obsolete or rename this field self.type = 'ProbeSet' diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py index df4507fb..c7c1e744 100755 --- a/wqflask/wqflask/collect.py +++ b/wqflask/wqflask/collect.py @@ -329,6 +329,8 @@ def view_collection(): # dis=trait_ob.description)) #json_version.append(trait_ob.__dict__th) + print("trait_obs:", trait_obs) + if "uc_id" in params: collection_info = dict(trait_obs=trait_obs, uc = uc) diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py index aa37c29e..63631350 100755 --- a/wqflask/wqflask/correlation/show_corr_results.py +++ b/wqflask/wqflask/correlation/show_corr_results.py @@ -185,6 +185,8 @@ class CorrelationResults(object): elif self.corr_type == "lit": trait_object.lit_corr = lit_corr_data[trait][1] self.correlation_results.append(trait_object) + + self.target_dataset.get_trait_info(self.correlation_results, self.target_dataset.group.species) if self.corr_type != "lit" and self.dataset.type == "ProbeSet" and self.target_dataset.type == "ProbeSet": self.do_lit_correlation_for_trait_list() diff --git a/wqflask/wqflask/model.py b/wqflask/wqflask/model.py index 042cb8df..5ea32e1f 100755 --- a/wqflask/wqflask/model.py +++ b/wqflask/wqflask/model.py @@ -172,8 +172,11 @@ class UserCollection(Base): @property def num_members(self): - print("members are:", json.loads(self.members)) - return len(json.loads(self.members)) + try: + return len(json.loads(self.members)) + except: + return 0 + #@property #def display_num_members(self): diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py index 01d65278..12ea44d8 100755 --- a/wqflask/wqflask/search_results.py +++ b/wqflask/wqflask/search_results.py @@ -119,8 +119,7 @@ class SearchResultPage(object): print("foo locals are:", locals()) trait_id = result[0] - this_trait = GeneralTrait(dataset=self.dataset, name=trait_id) - this_trait.retrieve_info(get_qtl_info=True) + this_trait = GeneralTrait(dataset=self.dataset, name=trait_id, get_qtl_info=True) self.trait_list.append(this_trait) self.dataset.get_trait_info(self.trait_list, species) diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py index 02472267..871d1880 100755 --- a/wqflask/wqflask/show_trait/show_trait.py +++ b/wqflask/wqflask/show_trait/show_trait.py @@ -153,8 +153,6 @@ class ShowTrait(object): '''Only display mapping methods when the dataset group's genotype file exists''' def check_plink_gemma(): if (os.path.isfile(PLINK_PATH+"/"+self.dataset.group.name+".bed") and - os.path.isfile(PLINK_PATH+"/"+self.dataset.group.name+".bim") and - os.path.isfile(PLINK_PATH+"/"+self.dataset.group.name+".fam") and os.path.isfile(PLINK_PATH+"/"+self.dataset.group.name+".map")): return True diff --git a/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css index 7a674d3a..eec02ef5 100755 --- a/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css +++ b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css @@ -1,224 +1,455 @@ - /* - * Table + * Table styles */ table.dataTable { - margin: 0 auto; - clear: both; - width: 100%; -} - -table.dataTable thead th { - padding: 3px 18px 3px 10px; - border-bottom: 1px solid black; - font-weight: bold; - cursor: pointer; - *cursor: hand; + width: 100%; + margin: 0 auto; + clear: both; + border-collapse: separate; + border-spacing: 0; + /* + * Header and footer styles + */ + /* + * Body styles + */ } - +table.dataTable thead th, table.dataTable tfoot th { - padding: 3px 18px 3px 10px; - border-top: 1px solid black; - font-weight: bold; + font-weight: bold; } - -table.dataTable td { - padding: 3px 10px; +table.dataTable thead th, +table.dataTable thead td { + padding: 10px 18px; + border-bottom: 1px solid #111; } - -table.dataTable td.center, +table.dataTable thead th:active, +table.dataTable thead td:active { + outline: none; +} +table.dataTable tfoot th, +table.dataTable tfoot td { + padding: 10px 18px 6px 18px; + border-top: 1px solid #111; +} +table.dataTable thead .sorting, +table.dataTable thead .sorting_asc, +table.dataTable thead .sorting_desc { + cursor: pointer; + *cursor: hand; +} +table.dataTable thead .sorting, +table.dataTable thead .sorting_asc, +table.dataTable thead .sorting_desc, +table.dataTable thead .sorting_asc_disabled, +table.dataTable thead .sorting_desc_disabled { + background-repeat: no-repeat; + background-position: center right; +} +table.dataTable thead .sorting { + background-image: url("../images/sort_both.png"); +} +table.dataTable thead .sorting_asc { + background-image: url("../images/sort_asc.png"); +} +table.dataTable thead .sorting_desc { + background-image: url("../images/sort_desc.png"); +} +table.dataTable thead .sorting_asc_disabled { + background-image: url("../images/sort_asc_disabled.png"); +} +table.dataTable thead .sorting_desc_disabled { + background-image: url("../images/sort_desc_disabled.png"); +} +table.dataTable tbody tr { + background-color: #ffffff; +} +table.dataTable tbody tr.selected { + background-color: #B0BED9; +} +table.dataTable tbody th, +table.dataTable tbody td { + padding: 8px 10px; +} +table.dataTable.row-border tbody th, table.dataTable.row-border tbody td, table.dataTable.display tbody th, table.dataTable.display tbody td { + border-top: 1px solid #ddd; +} +table.dataTable.row-border tbody tr:first-child th, +table.dataTable.row-border tbody tr:first-child td, table.dataTable.display tbody tr:first-child th, +table.dataTable.display tbody tr:first-child td { + border-top: none; +} +table.dataTable.cell-border tbody th, table.dataTable.cell-border tbody td { + border-top: 1px solid #ddd; + border-right: 1px solid #ddd; +} +table.dataTable.cell-border tbody tr th:first-child, +table.dataTable.cell-border tbody tr td:first-child { + border-left: 1px solid #ddd; +} +table.dataTable.cell-border tbody tr:first-child th, +table.dataTable.cell-border tbody tr:first-child td { + border-top: none; +} +table.dataTable.stripe tbody tr.odd, table.dataTable.display tbody tr.odd { + background-color: #f9f9f9; +} +table.dataTable.stripe tbody tr.odd.selected, table.dataTable.display tbody tr.odd.selected { + background-color: #abb9d3; +} +table.dataTable.hover tbody tr:hover, table.dataTable.display tbody tr:hover { + background-color: whitesmoke; +} +table.dataTable.hover tbody tr:hover.selected, table.dataTable.display tbody tr:hover.selected { + background-color: #a9b7d1; +} +table.dataTable.order-column tbody tr > .sorting_1, +table.dataTable.order-column tbody tr > .sorting_2, +table.dataTable.order-column tbody tr > .sorting_3, table.dataTable.display tbody tr > .sorting_1, +table.dataTable.display tbody tr > .sorting_2, +table.dataTable.display tbody tr > .sorting_3 { + background-color: #f9f9f9; +} +table.dataTable.order-column tbody tr.selected > .sorting_1, +table.dataTable.order-column tbody tr.selected > .sorting_2, +table.dataTable.order-column tbody tr.selected > .sorting_3, table.dataTable.display tbody tr.selected > .sorting_1, +table.dataTable.display tbody tr.selected > .sorting_2, +table.dataTable.display tbody tr.selected > .sorting_3 { + background-color: #acbad4; +} +table.dataTable.display tbody tr.odd > .sorting_1, table.dataTable.order-column.stripe tbody tr.odd > .sorting_1 { + background-color: #f1f1f1; +} +table.dataTable.display tbody tr.odd > .sorting_2, table.dataTable.order-column.stripe tbody tr.odd > .sorting_2 { + background-color: #f3f3f3; +} +table.dataTable.display tbody tr.odd > .sorting_3, table.dataTable.order-column.stripe tbody tr.odd > .sorting_3 { + background-color: whitesmoke; +} +table.dataTable.display tbody tr.odd.selected > .sorting_1, table.dataTable.order-column.stripe tbody tr.odd.selected > .sorting_1 { + background-color: #a6b3cd; +} +table.dataTable.display tbody tr.odd.selected > .sorting_2, table.dataTable.order-column.stripe tbody tr.odd.selected > .sorting_2 { + background-color: #a7b5ce; +} +table.dataTable.display tbody tr.odd.selected > .sorting_3, table.dataTable.order-column.stripe tbody tr.odd.selected > .sorting_3 { + background-color: #a9b6d0; +} +table.dataTable.display tbody tr.even > .sorting_1, table.dataTable.order-column.stripe tbody tr.even > .sorting_1 { + background-color: #f9f9f9; +} +table.dataTable.display tbody tr.even > .sorting_2, table.dataTable.order-column.stripe tbody tr.even > .sorting_2 { + background-color: #fbfbfb; +} +table.dataTable.display tbody tr.even > .sorting_3, table.dataTable.order-column.stripe tbody tr.even > .sorting_3 { + background-color: #fdfdfd; +} +table.dataTable.display tbody tr.even.selected > .sorting_1, table.dataTable.order-column.stripe tbody tr.even.selected > .sorting_1 { + background-color: #acbad4; +} +table.dataTable.display tbody tr.even.selected > .sorting_2, table.dataTable.order-column.stripe tbody tr.even.selected > .sorting_2 { + background-color: #adbbd6; +} +table.dataTable.display tbody tr.even.selected > .sorting_3, table.dataTable.order-column.stripe tbody tr.even.selected > .sorting_3 { + background-color: #afbdd8; +} +table.dataTable.display tbody tr:hover > .sorting_1, table.dataTable.order-column.hover tbody tr:hover > .sorting_1 { + background-color: #eaeaea; +} +table.dataTable.display tbody tr:hover > .sorting_2, table.dataTable.order-column.hover tbody tr:hover > .sorting_2 { + background-color: #ebebeb; +} +table.dataTable.display tbody tr:hover > .sorting_3, table.dataTable.order-column.hover tbody tr:hover > .sorting_3 { + background-color: #eeeeee; +} +table.dataTable.display tbody tr:hover.selected > .sorting_1, table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_1 { + background-color: #a1aec7; +} +table.dataTable.display tbody tr:hover.selected > .sorting_2, table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_2 { + background-color: #a2afc8; +} +table.dataTable.display tbody tr:hover.selected > .sorting_3, table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_3 { + background-color: #a4b2cb; +} +table.dataTable.no-footer { + border-bottom: 1px solid #111; +} +table.dataTable.nowrap th, table.dataTable.nowrap td { + white-space: nowrap; +} +table.dataTable.compact thead th, +table.dataTable.compact thead td { + padding: 4px 17px 4px 4px; +} +table.dataTable.compact tfoot th, +table.dataTable.compact tfoot td { + padding: 4px; +} +table.dataTable.compact tbody th, +table.dataTable.compact tbody td { + padding: 4px; +} +table.dataTable th.dt-left, +table.dataTable td.dt-left { + text-align: left; +} +table.dataTable th.dt-center, +table.dataTable td.dt-center, table.dataTable td.dataTables_empty { - text-align: center; + text-align: center; +} +table.dataTable th.dt-right, +table.dataTable td.dt-right { + text-align: right; +} +table.dataTable th.dt-justify, +table.dataTable td.dt-justify { + text-align: justify; +} +table.dataTable th.dt-nowrap, +table.dataTable td.dt-nowrap { + white-space: nowrap; +} +table.dataTable thead th.dt-head-left, +table.dataTable thead td.dt-head-left, +table.dataTable tfoot th.dt-head-left, +table.dataTable tfoot td.dt-head-left { + text-align: left; +} +table.dataTable thead th.dt-head-center, +table.dataTable thead td.dt-head-center, +table.dataTable tfoot th.dt-head-center, +table.dataTable tfoot td.dt-head-center { + text-align: center; +} +table.dataTable thead th.dt-head-right, +table.dataTable thead td.dt-head-right, +table.dataTable tfoot th.dt-head-right, +table.dataTable tfoot td.dt-head-right { + text-align: right; +} +table.dataTable thead th.dt-head-justify, +table.dataTable thead td.dt-head-justify, +table.dataTable tfoot th.dt-head-justify, +table.dataTable tfoot td.dt-head-justify { + text-align: justify; +} +table.dataTable thead th.dt-head-nowrap, +table.dataTable thead td.dt-head-nowrap, +table.dataTable tfoot th.dt-head-nowrap, +table.dataTable tfoot td.dt-head-nowrap { + white-space: nowrap; +} +table.dataTable tbody th.dt-body-left, +table.dataTable tbody td.dt-body-left { + text-align: left; +} +table.dataTable tbody th.dt-body-center, +table.dataTable tbody td.dt-body-center { + text-align: center; +} +table.dataTable tbody th.dt-body-right, +table.dataTable tbody td.dt-body-right { + text-align: right; +} +table.dataTable tbody th.dt-body-justify, +table.dataTable tbody td.dt-body-justify { + text-align: justify; +} +table.dataTable tbody th.dt-body-nowrap, +table.dataTable tbody td.dt-body-nowrap { + white-space: nowrap; } -table.dataTable tr.odd { background-color: #E2E4FF; } -table.dataTable tr.even { background-color: white; } - -table.dataTable tr.odd td.sorting_1 { background-color: #D3D6FF; } -table.dataTable tr.odd td.sorting_2 { background-color: #DADCFF; } -table.dataTable tr.odd td.sorting_3 { background-color: #E0E2FF; } -table.dataTable tr.even td.sorting_1 { background-color: #EAEBFF; } -table.dataTable tr.even td.sorting_2 { background-color: #F2F3FF; } -table.dataTable tr.even td.sorting_3 { background-color: #F9F9FF; } - -table.dataTable tr.outlier td{ background-color: #FFFF00; } - +table.dataTable, +table.dataTable th, +table.dataTable td { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} /* - * Table wrapper + * Control feature layout */ .dataTables_wrapper { - position: relative; - clear: both; - float: left; - *zoom: 1; + position: relative; + clear: both; + *zoom: 1; + zoom: 1; } - - -/* - * Page length menu - */ -.dataTables_length { - float: left; +.dataTables_wrapper .dataTables_length { + float: left; } - - -/* - * Filter - */ -.dataTables_filter { - float: right; - text-align: right; +.dataTables_wrapper .dataTables_filter { + float: right; + text-align: right; } - - -/* - * Table information - */ -.dataTables_info { - clear: both; - float: left; +.dataTables_wrapper .dataTables_filter input { + margin-left: 0.5em; } - - -/* - * Pagination - */ -.dataTables_paginate { - float: right; - text-align: right; +.dataTables_wrapper .dataTables_info { + clear: both; + float: left; + padding-top: 0.755em; } - -/* Two button pagination - previous / next */ -.paginate_disabled_previous, -.paginate_enabled_previous, -.paginate_disabled_next, -.paginate_enabled_next { - height: 19px; - float: left; - cursor: pointer; - *cursor: hand; - color: #111 !important; -} -.paginate_disabled_previous:hover, -.paginate_enabled_previous:hover, -.paginate_disabled_next:hover, -.paginate_enabled_next:hover { - text-decoration: none !important; -} -.paginate_disabled_previous:active, -.paginate_enabled_previous:active, -.paginate_disabled_next:active, -.paginate_enabled_next:active { - outline: none; +.dataTables_wrapper .dataTables_paginate { + float: right; + text-align: right; + padding-top: 0.25em; } - -.paginate_disabled_previous, -.paginate_disabled_next { - color: #666 !important; +.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; } -.paginate_disabled_previous, -.paginate_enabled_previous { - padding-left: 23px; +.dataTables_wrapper .dataTables_paginate .paginate_button.current, .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover { + color: #333 !important; + border: 1px solid #cacaca; + background-color: white; + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, white), color-stop(100%, #dcdcdc)); + /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, white 0%, #dcdcdc 100%); + /* Chrome10+,Safari5.1+ */ + background: -moz-linear-gradient(top, white 0%, #dcdcdc 100%); + /* FF3.6+ */ + background: -ms-linear-gradient(top, white 0%, #dcdcdc 100%); + /* IE10+ */ + background: -o-linear-gradient(top, white 0%, #dcdcdc 100%); + /* Opera 11.10+ */ + background: linear-gradient(to bottom, white 0%, #dcdcdc 100%); + /* W3C */ } -.paginate_disabled_next, -.paginate_enabled_next { - padding-right: 23px; - margin-left: 10px; +.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; } - -.paginate_enabled_previous { background: url('../images/back_enabled.png') no-repeat top left; } -.paginate_enabled_previous:hover { background: url('../images/back_enabled_hover.png') no-repeat top left; } -.paginate_disabled_previous { background: url('../images/back_disabled.png') no-repeat top left; } - -.paginate_enabled_next { background: url('../images/forward_enabled.png') no-repeat top right; } -.paginate_enabled_next:hover { background: url('../images/forward_enabled_hover.png') no-repeat top right; } -.paginate_disabled_next { background: url('../images/forward_disabled.png') no-repeat top right; } - -/* Full number pagination */ -.paging_full_numbers { - height: 22px; - line-height: 22px; +.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)); + /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #585858 0%, #111 100%); + /* Chrome10+,Safari5.1+ */ + background: -moz-linear-gradient(top, #585858 0%, #111 100%); + /* FF3.6+ */ + background: -ms-linear-gradient(top, #585858 0%, #111 100%); + /* IE10+ */ + background: -o-linear-gradient(top, #585858 0%, #111 100%); + /* Opera 11.10+ */ + background: linear-gradient(to bottom, #585858 0%, #111 100%); + /* W3C */ } -.paging_full_numbers a:active { - outline: none +.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)); + /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%); + /* Chrome10+,Safari5.1+ */ + background: -moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%); + /* FF3.6+ */ + background: -ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%); + /* IE10+ */ + background: -o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%); + /* Opera 11.10+ */ + background: linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%); + /* W3C */ + box-shadow: inset 0 0 3px #111; } -.paging_full_numbers a:hover { - text-decoration: none; +.dataTables_wrapper .dataTables_paginate .ellipsis { + padding: 0 1em; } - -.paging_full_numbers a.paginate_button, -.paging_full_numbers a.paginate_active { - border: 1px solid #aaa; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; - padding: 2px 5px; - margin: 0 3px; - cursor: pointer; - *cursor: hand; - color: #333 !important; +.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))); + /* Chrome,Safari4+ */ + 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%); + /* Chrome10+,Safari5.1+ */ + 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%); + /* FF3.6+ */ + 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%); + /* IE10+ */ + 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%); + /* Opera 11.10+ */ + 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%); + /* W3C */ } - -.paging_full_numbers a.paginate_button { - background-color: #ddd; +.dataTables_wrapper .dataTables_length, +.dataTables_wrapper .dataTables_filter, +.dataTables_wrapper .dataTables_info, +.dataTables_wrapper .dataTables_processing, +.dataTables_wrapper .dataTables_paginate { + color: #333; } - -.paging_full_numbers a.paginate_button:hover { - background-color: #ccc; - text-decoration: none !important; +.dataTables_wrapper .dataTables_scroll { + clear: both; } - -.paging_full_numbers a.paginate_active { - background-color: #99B3FF; +.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody { + *margin-top: -1px; + -webkit-overflow-scrolling: touch; } - - -/* - * Processing indicator - */ -.dataTables_processing { - position: absolute; - top: 50%; - left: 50%; - width: 250px; - height: 30px; - margin-left: -125px; - margin-top: -15px; - padding: 14px 0 2px 0; - border: 1px solid #ddd; - text-align: center; - color: #999; - font-size: 14px; - background-color: white; +.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th > div.dataTables_sizing, +.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td > div.dataTables_sizing { + height: 0; + overflow: hidden; + margin: 0 !important; + padding: 0 !important; } - - -/* - * Sorting - */ -.sorting { background: url('../images/sort_both.png') no-repeat center right; } -.sorting_asc { background: url('../images/sort_asc.png') no-repeat center right; } -.sorting_desc { background: url('../images/sort_desc.png') no-repeat center right; } - -.sorting_asc_disabled { background: url('../images/sort_asc_disabled.png') no-repeat center right; } -.sorting_desc_disabled { background: url('../images/sort_desc_disabled.png') no-repeat center right; } - -table.dataTable thead th:active, -table.dataTable thead td:active { - outline: none; +.dataTables_wrapper.no-footer .dataTables_scrollBody { + border-bottom: 1px solid #111; } - - -/* - * Scrolling - */ -.dataTables_scroll { - clear: both; +.dataTables_wrapper.no-footer div.dataTables_scrollHead table, +.dataTables_wrapper.no-footer div.dataTables_scrollBody table { + border-bottom: none; } - -.dataTables_scrollBody { - *margin-top: -1px; - -webkit-overflow-scrolling: touch; +.dataTables_wrapper:after { + visibility: hidden; + display: block; + content: ""; + clear: both; + height: 0; } +@media screen and (max-width: 767px) { + .dataTables_wrapper .dataTables_info, + .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_length, + .dataTables_wrapper .dataTables_filter { + float: none; + text-align: center; + } + .dataTables_wrapper .dataTables_filter { + margin-top: 0.5em; + } +} diff --git a/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.min.css b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.min.css new file mode 100644 index 00000000..2edb32f7 --- /dev/null +++ b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.min.css @@ -0,0 +1 @@ +table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;border-spacing:0}table.dataTable thead th,table.dataTable tfoot th{font-weight:bold}table.dataTable thead th,table.dataTable thead td{padding:10px 18px;border-bottom:1px solid #111}table.dataTable thead th:active,table.dataTable thead td:active{outline:none}table.dataTable tfoot th,table.dataTable tfoot td{padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc{cursor:pointer;*cursor:hand}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{background-repeat:no-repeat;background-position:center right}table.dataTable thead .sorting{background-image:url("../images/sort_both.png")}table.dataTable thead .sorting_asc{background-image:url("../images/sort_asc.png")}table.dataTable thead .sorting_desc{background-image:url("../images/sort_desc.png")}table.dataTable thead .sorting_asc_disabled{background-image:url("../images/sort_asc_disabled.png")}table.dataTable thead .sorting_desc_disabled{background-image:url("../images/sort_desc_disabled.png")}table.dataTable tbody tr{background-color:#fff}table.dataTable tbody tr.selected{background-color:#B0BED9}table.dataTable tbody th,table.dataTable tbody td{padding:8px 10px}table.dataTable.row-border tbody th,table.dataTable.row-border tbody td,table.dataTable.display tbody th,table.dataTable.display tbody td{border-top:1px solid #ddd}table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td{border-top:none}table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td{border-top:1px solid #ddd;border-right:1px solid #ddd}table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child{border-left:1px solid #ddd}table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td{border-top:none}table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd{background-color:#f9f9f9}table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected{background-color:#abb9d3}table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover{background-color:#f5f5f5}table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected{background-color:#a9b7d1}table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3{background-color:#f9f9f9}table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3{background-color:#acbad4}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:#f5f5f5}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b3cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a7b5ce}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b6d0}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#f9f9f9}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fbfbfb}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fdfdfd}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad4}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#adbbd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ebebeb}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#eee}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a1aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a2afc8}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a4b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px 4px 4px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th.dt-left,table.dataTable td.dt-left{text-align:left}table.dataTable th.dt-center,table.dataTable td.dt-center,table.dataTable td.dataTables_empty{text-align:center}table.dataTable th.dt-right,table.dataTable td.dt-right{text-align:right}table.dataTable th.dt-justify,table.dataTable td.dt-justify{text-align:justify}table.dataTable th.dt-nowrap,table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable thead th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody th.dt-body-left,table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center,table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right,table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify,table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable,table.dataTable th,table.dataTable td{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both;*zoom:1;zoom:1}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{margin-left:0.5em}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:0.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top: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}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{color:#333 !important;border:1px solid #cacaca;background-color:#fff;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 .ellipsis{padding:0 1em}.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_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollHead table,.dataTables_wrapper.no-footer div.dataTables_scrollBody table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width: 767px){.dataTables_wrapper .dataTables_info,.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_length,.dataTables_wrapper .dataTables_filter{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:0.5em}} diff --git a/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables_themeroller.css b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables_themeroller.css index cf1d4ed7..1426a44a 100755 --- a/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables_themeroller.css +++ b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables_themeroller.css @@ -1,244 +1,416 @@ - - /* - * Table + * Table styles */ table.dataTable { - margin: 0 auto; - clear: both; - width: 100%; - border-collapse: collapse; -} - -table.dataTable thead th { - padding: 3px 0px 3px 10px; - cursor: pointer; - *cursor: hand; -} - + width: 100%; + margin: 0 auto; + clear: both; + border-collapse: separate; + border-spacing: 0; + /* + * Header and footer styles + */ + /* + * Body styles + */ +} +table.dataTable thead th, +table.dataTable thead td, +table.dataTable tfoot th, +table.dataTable tfoot td { + padding: 4px 10px; +} +table.dataTable thead th, table.dataTable tfoot th { - padding: 3px 10px; -} - -table.dataTable td { - padding: 3px 10px; -} - -table.dataTable td.center, -table.dataTable td.dataTables_empty { - text-align: center; + font-weight: bold; } - -table.dataTable tr.odd { background-color: #E2E4FF; } -table.dataTable tr.even { background-color: white; } - -table.dataTable tr.odd td.sorting_1 { background-color: #D3D6FF; } -table.dataTable tr.odd td.sorting_2 { background-color: #DADCFF; } -table.dataTable tr.odd td.sorting_3 { background-color: #E0E2FF; } -table.dataTable tr.even td.sorting_1 { background-color: #EAEBFF; } -table.dataTable tr.even td.sorting_2 { background-color: #F2F3FF; } -table.dataTable tr.even td.sorting_3 { background-color: #F9F9FF; } - - -/* - * Table wrapper - */ -.dataTables_wrapper { - position: relative; - clear: both; - *zoom: 1; -} -.dataTables_wrapper .ui-widget-header { - font-weight: normal; +table.dataTable thead th:active, +table.dataTable thead td:active { + outline: none; } -.dataTables_wrapper .ui-toolbar { - padding: 5px; -} - - -/* - * Page length menu - */ -.dataTables_length { - float: left; -} - - -/* - * Filter - */ -.dataTables_filter { - float: right; - text-align: right; -} - - -/* - * Table information - */ -.dataTables_info { - padding-top: 3px; - clear: both; - float: left; -} - - -/* - * Pagination - */ -.dataTables_paginate { - float: right; - text-align: right; +table.dataTable thead .sorting_asc, +table.dataTable thead .sorting_desc, +table.dataTable thead .sorting { + cursor: pointer; + *cursor: hand; } - -.dataTables_paginate .ui-button { - margin-right: -0.1em !important; +table.dataTable thead th div.DataTables_sort_wrapper { + position: relative; + padding-right: 10px; } - -.paging_two_button .ui-button { - float: left; - cursor: pointer; - * cursor: hand; +table.dataTable thead th div.DataTables_sort_wrapper span { + position: absolute; + top: 50%; + margin-top: -8px; + right: -5px; } - -.paging_full_numbers .ui-button { - padding: 2px 6px; - margin: 0; - cursor: pointer; - * cursor: hand; - color: #333 !important; +table.dataTable thead th.ui-state-default { + border-right-width: 0; } - -/* Two button pagination - previous / next */ -.paginate_disabled_previous, -.paginate_enabled_previous, -.paginate_disabled_next, -.paginate_enabled_next { - height: 19px; - float: left; - cursor: pointer; - *cursor: hand; - color: #111 !important; -} -.paginate_disabled_previous:hover, -.paginate_enabled_previous:hover, -.paginate_disabled_next:hover, -.paginate_enabled_next:hover { - text-decoration: none !important; -} -.paginate_disabled_previous:active, -.paginate_enabled_previous:active, -.paginate_disabled_next:active, -.paginate_enabled_next:active { - outline: none; +table.dataTable thead th.ui-state-default:last-child { + border-right-width: 1px; } - -.paginate_disabled_previous, -.paginate_disabled_next { - color: #666 !important; -} -.paginate_disabled_previous, -.paginate_enabled_previous { - padding-left: 23px; +table.dataTable tbody tr { + background-color: #ffffff; } -.paginate_disabled_next, -.paginate_enabled_next { - padding-right: 23px; - margin-left: 10px; +table.dataTable tbody tr.selected { + background-color: #B0BED9; } - -.paginate_enabled_previous { background: url('../images/back_enabled.png') no-repeat top left; } -.paginate_enabled_previous:hover { background: url('../images/back_enabled_hover.png') no-repeat top left; } -.paginate_disabled_previous { background: url('../images/back_disabled.png') no-repeat top left; } - -.paginate_enabled_next { background: url('../images/forward_enabled.png') no-repeat top right; } -.paginate_enabled_next:hover { background: url('../images/forward_enabled_hover.png') no-repeat top right; } -.paginate_disabled_next { background: url('../images/forward_disabled.png') no-repeat top right; } - -/* Full number pagination */ -.paging_full_numbers a:active { - outline: none +table.dataTable tbody th, +table.dataTable tbody td { + padding: 8px 10px; } -.paging_full_numbers a:hover { - text-decoration: none; -} - -.paging_full_numbers a.paginate_button, -.paging_full_numbers a.paginate_active { - border: 1px solid #aaa; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; - padding: 2px 5px; - margin: 0 3px; - cursor: pointer; - *cursor: hand; - color: #333 !important; -} - -.paging_full_numbers a.paginate_button { - background-color: #ddd; -} - -.paging_full_numbers a.paginate_button:hover { - background-color: #ccc; - text-decoration: none !important; +table.dataTable th.center, +table.dataTable td.center, +table.dataTable td.dataTables_empty { + text-align: center; } - -.paging_full_numbers a.paginate_active { - background-color: #99B3FF; +table.dataTable th.right, +table.dataTable td.right { + text-align: right; } - - -/* - * Processing indicator - */ -.dataTables_processing { - position: absolute; - top: 50%; - left: 50%; - width: 250px; - height: 30px; - margin-left: -125px; - margin-top: -15px; - padding: 14px 0 2px 0; - border: 1px solid #ddd; - text-align: center; - color: #999; - font-size: 14px; - background-color: white; +table.dataTable.row-border tbody th, table.dataTable.row-border tbody td, table.dataTable.display tbody th, table.dataTable.display tbody td { + border-top: 1px solid #ddd; +} +table.dataTable.row-border tbody tr:first-child th, +table.dataTable.row-border tbody tr:first-child td, table.dataTable.display tbody tr:first-child th, +table.dataTable.display tbody tr:first-child td { + border-top: none; +} +table.dataTable.cell-border tbody th, table.dataTable.cell-border tbody td { + border-top: 1px solid #ddd; + border-right: 1px solid #ddd; +} +table.dataTable.cell-border tbody tr th:first-child, +table.dataTable.cell-border tbody tr td:first-child { + border-left: 1px solid #ddd; +} +table.dataTable.cell-border tbody tr:first-child th, +table.dataTable.cell-border tbody tr:first-child td { + border-top: none; +} +table.dataTable.stripe tbody tr.odd, table.dataTable.display tbody tr.odd { + background-color: #f9f9f9; +} +table.dataTable.stripe tbody tr.odd.selected, table.dataTable.display tbody tr.odd.selected { + background-color: #abb9d3; +} +table.dataTable.hover tbody tr:hover, +table.dataTable.hover tbody tr.odd:hover, +table.dataTable.hover tbody tr.even:hover, table.dataTable.display tbody tr:hover, +table.dataTable.display tbody tr.odd:hover, +table.dataTable.display tbody tr.even:hover { + background-color: whitesmoke; +} +table.dataTable.hover tbody tr:hover.selected, +table.dataTable.hover tbody tr.odd:hover.selected, +table.dataTable.hover tbody tr.even:hover.selected, table.dataTable.display tbody tr:hover.selected, +table.dataTable.display tbody tr.odd:hover.selected, +table.dataTable.display tbody tr.even:hover.selected { + background-color: #a9b7d1; +} +table.dataTable.order-column tbody tr > .sorting_1, +table.dataTable.order-column tbody tr > .sorting_2, +table.dataTable.order-column tbody tr > .sorting_3, table.dataTable.display tbody tr > .sorting_1, +table.dataTable.display tbody tr > .sorting_2, +table.dataTable.display tbody tr > .sorting_3 { + background-color: #f9f9f9; +} +table.dataTable.order-column tbody tr.selected > .sorting_1, +table.dataTable.order-column tbody tr.selected > .sorting_2, +table.dataTable.order-column tbody tr.selected > .sorting_3, table.dataTable.display tbody tr.selected > .sorting_1, +table.dataTable.display tbody tr.selected > .sorting_2, +table.dataTable.display tbody tr.selected > .sorting_3 { + background-color: #acbad4; +} +table.dataTable.display tbody tr.odd > .sorting_1, table.dataTable.order-column.stripe tbody tr.odd > .sorting_1 { + background-color: #f1f1f1; +} +table.dataTable.display tbody tr.odd > .sorting_2, table.dataTable.order-column.stripe tbody tr.odd > .sorting_2 { + background-color: #f3f3f3; +} +table.dataTable.display tbody tr.odd > .sorting_3, table.dataTable.order-column.stripe tbody tr.odd > .sorting_3 { + background-color: whitesmoke; +} +table.dataTable.display tbody tr.odd.selected > .sorting_1, table.dataTable.order-column.stripe tbody tr.odd.selected > .sorting_1 { + background-color: #a6b3cd; +} +table.dataTable.display tbody tr.odd.selected > .sorting_2, table.dataTable.order-column.stripe tbody tr.odd.selected > .sorting_2 { + background-color: #a7b5ce; +} +table.dataTable.display tbody tr.odd.selected > .sorting_3, table.dataTable.order-column.stripe tbody tr.odd.selected > .sorting_3 { + background-color: #a9b6d0; +} +table.dataTable.display tbody tr.even > .sorting_1, table.dataTable.order-column.stripe tbody tr.even > .sorting_1 { + background-color: #f9f9f9; +} +table.dataTable.display tbody tr.even > .sorting_2, table.dataTable.order-column.stripe tbody tr.even > .sorting_2 { + background-color: #fbfbfb; +} +table.dataTable.display tbody tr.even > .sorting_3, table.dataTable.order-column.stripe tbody tr.even > .sorting_3 { + background-color: #fdfdfd; +} +table.dataTable.display tbody tr.even.selected > .sorting_1, table.dataTable.order-column.stripe tbody tr.even.selected > .sorting_1 { + background-color: #acbad4; +} +table.dataTable.display tbody tr.even.selected > .sorting_2, table.dataTable.order-column.stripe tbody tr.even.selected > .sorting_2 { + background-color: #adbbd6; +} +table.dataTable.display tbody tr.even.selected > .sorting_3, table.dataTable.order-column.stripe tbody tr.even.selected > .sorting_3 { + background-color: #afbdd8; +} +table.dataTable.display tbody tr:hover > .sorting_1, +table.dataTable.display tbody tr.odd:hover > .sorting_1, +table.dataTable.display tbody tr.even:hover > .sorting_1, table.dataTable.order-column.hover tbody tr:hover > .sorting_1, +table.dataTable.order-column.hover tbody tr.odd:hover > .sorting_1, +table.dataTable.order-column.hover tbody tr.even:hover > .sorting_1 { + background-color: #eaeaea; +} +table.dataTable.display tbody tr:hover > .sorting_2, +table.dataTable.display tbody tr.odd:hover > .sorting_2, +table.dataTable.display tbody tr.even:hover > .sorting_2, table.dataTable.order-column.hover tbody tr:hover > .sorting_2, +table.dataTable.order-column.hover tbody tr.odd:hover > .sorting_2, +table.dataTable.order-column.hover tbody tr.even:hover > .sorting_2 { + background-color: #ebebeb; +} +table.dataTable.display tbody tr:hover > .sorting_3, +table.dataTable.display tbody tr.odd:hover > .sorting_3, +table.dataTable.display tbody tr.even:hover > .sorting_3, table.dataTable.order-column.hover tbody tr:hover > .sorting_3, +table.dataTable.order-column.hover tbody tr.odd:hover > .sorting_3, +table.dataTable.order-column.hover tbody tr.even:hover > .sorting_3 { + background-color: #eeeeee; +} +table.dataTable.display tbody tr:hover.selected > .sorting_1, +table.dataTable.display tbody tr.odd:hover.selected > .sorting_1, +table.dataTable.display tbody tr.even:hover.selected > .sorting_1, table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_1, +table.dataTable.order-column.hover tbody tr.odd:hover.selected > .sorting_1, +table.dataTable.order-column.hover tbody tr.even:hover.selected > .sorting_1 { + background-color: #a1aec7; +} +table.dataTable.display tbody tr:hover.selected > .sorting_2, +table.dataTable.display tbody tr.odd:hover.selected > .sorting_2, +table.dataTable.display tbody tr.even:hover.selected > .sorting_2, table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_2, +table.dataTable.order-column.hover tbody tr.odd:hover.selected > .sorting_2, +table.dataTable.order-column.hover tbody tr.even:hover.selected > .sorting_2 { + background-color: #a2afc8; +} +table.dataTable.display tbody tr:hover.selected > .sorting_3, +table.dataTable.display tbody tr.odd:hover.selected > .sorting_3, +table.dataTable.display tbody tr.even:hover.selected > .sorting_3, table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_3, +table.dataTable.order-column.hover tbody tr.odd:hover.selected > .sorting_3, +table.dataTable.order-column.hover tbody tr.even:hover.selected > .sorting_3 { + background-color: #a4b2cb; +} +table.dataTable.nowrap th, table.dataTable.nowrap td { + white-space: nowrap; +} +table.dataTable.compact thead th, +table.dataTable.compact thead td { + padding: 5px 9px; +} +table.dataTable.compact tfoot th, +table.dataTable.compact tfoot td { + padding: 5px 9px 3px 9px; +} +table.dataTable.compact tbody th, +table.dataTable.compact tbody td { + padding: 4px 5px; +} +table.dataTable th.dt-left, +table.dataTable td.dt-left { + text-align: left; +} +table.dataTable th.dt-center, +table.dataTable td.dt-center, +table.dataTable td.dataTables_empty { + text-align: center; +} +table.dataTable th.dt-right, +table.dataTable td.dt-right { + text-align: right; +} +table.dataTable th.dt-justify, +table.dataTable td.dt-justify { + text-align: justify; +} +table.dataTable th.dt-nowrap, +table.dataTable td.dt-nowrap { + white-space: nowrap; +} +table.dataTable thead th.dt-head-left, +table.dataTable thead td.dt-head-left, +table.dataTable tfoot th.dt-head-left, +table.dataTable tfoot td.dt-head-left { + text-align: left; +} +table.dataTable thead th.dt-head-center, +table.dataTable thead td.dt-head-center, +table.dataTable tfoot th.dt-head-center, +table.dataTable tfoot td.dt-head-center { + text-align: center; +} +table.dataTable thead th.dt-head-right, +table.dataTable thead td.dt-head-right, +table.dataTable tfoot th.dt-head-right, +table.dataTable tfoot td.dt-head-right { + text-align: right; +} +table.dataTable thead th.dt-head-justify, +table.dataTable thead td.dt-head-justify, +table.dataTable tfoot th.dt-head-justify, +table.dataTable tfoot td.dt-head-justify { + text-align: justify; +} +table.dataTable thead th.dt-head-nowrap, +table.dataTable thead td.dt-head-nowrap, +table.dataTable tfoot th.dt-head-nowrap, +table.dataTable tfoot td.dt-head-nowrap { + white-space: nowrap; +} +table.dataTable tbody th.dt-body-left, +table.dataTable tbody td.dt-body-left { + text-align: left; +} +table.dataTable tbody th.dt-body-center, +table.dataTable tbody td.dt-body-center { + text-align: center; +} +table.dataTable tbody th.dt-body-right, +table.dataTable tbody td.dt-body-right { + text-align: right; +} +table.dataTable tbody th.dt-body-justify, +table.dataTable tbody td.dt-body-justify { + text-align: justify; +} +table.dataTable tbody th.dt-body-nowrap, +table.dataTable tbody td.dt-body-nowrap { + white-space: nowrap; +} + +table.dataTable, +table.dataTable th, +table.dataTable td { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; } - /* - * Sorting + * Control feature layout */ -table.dataTable thead th div.DataTables_sort_wrapper { - position: relative; - padding-right: 20px; -} - -table.dataTable thead th div.DataTables_sort_wrapper span { - position: absolute; - top: 50%; - margin-top: -8px; - right: 0; -} - -table.dataTable th:active { - outline: none; +.dataTables_wrapper { + position: relative; + clear: both; + *zoom: 1; + zoom: 1; +} +.dataTables_wrapper .dataTables_length { + float: left; +} +.dataTables_wrapper .dataTables_filter { + float: right; + text-align: right; +} +.dataTables_wrapper .dataTables_filter input { + margin-left: 0.5em; +} +.dataTables_wrapper .dataTables_info { + clear: both; + float: left; + padding-top: 0.55em; +} +.dataTables_wrapper .dataTables_paginate { + float: right; + text-align: right; +} +.dataTables_wrapper .dataTables_paginate .fg-button { + box-sizing: border-box; + display: inline-block; + min-width: 1.5em; + padding: 0.5em; + margin-left: 2px; + text-align: center; + text-decoration: none !important; + cursor: pointer; + *cursor: hand; + color: #333 !important; + border: 1px solid transparent; +} +.dataTables_wrapper .dataTables_paginate .fg-button:active { + outline: none; +} +.dataTables_wrapper .dataTables_paginate .fg-button:first-child { + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; +} +.dataTables_wrapper .dataTables_paginate .fg-button:last-child { + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; +} +.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))); + /* Chrome,Safari4+ */ + 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%); + /* Chrome10+,Safari5.1+ */ + 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%); + /* FF3.6+ */ + 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%); + /* IE10+ */ + 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%); + /* Opera 11.10+ */ + 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%); + /* W3C */ +} +.dataTables_wrapper .dataTables_length, +.dataTables_wrapper .dataTables_filter, +.dataTables_wrapper .dataTables_info, +.dataTables_wrapper .dataTables_processing, +.dataTables_wrapper .dataTables_paginate { + color: #333; +} +.dataTables_wrapper .dataTables_scroll { + clear: both; +} +.dataTables_wrapper .dataTables_scrollBody { + *margin-top: -1px; + -webkit-overflow-scrolling: touch; } - - -/* - * Scrolling - */ -.dataTables_scroll { - clear: both; +.dataTables_wrapper .ui-widget-header { + font-weight: normal; } - -.dataTables_scrollBody { - *margin-top: -1px; - -webkit-overflow-scrolling: touch; +.dataTables_wrapper .ui-toolbar { + padding: 8px; +} +.dataTables_wrapper:after { + visibility: hidden; + display: block; + content: ""; + clear: both; + height: 0; +} + +@media screen and (max-width: 767px) { + .dataTables_wrapper .dataTables_length, + .dataTables_wrapper .dataTables_filter, + .dataTables_wrapper .dataTables_info, + .dataTables_wrapper .dataTables_paginate { + float: none; + text-align: center; + } + .dataTables_wrapper .dataTables_filter, + .dataTables_wrapper .dataTables_paginate { + margin-top: 0.5em; + } } - diff --git a/wqflask/wqflask/static/new/packages/DataTables/extensions/dataTables.colResize.js b/wqflask/wqflask/static/new/packages/DataTables/extensions/dataTables.colResize.js new file mode 100644 index 00000000..2712750a --- /dev/null +++ b/wqflask/wqflask/static/new/packages/DataTables/extensions/dataTables.colResize.js @@ -0,0 +1,846 @@ +/*! ColResize 0.0.10 + */ + +/** + * @summary ColResize + * @description Provide the ability to resize columns in a DataTable + * @version 0.0.10 + * @file dataTables.colResize.js + * @author Silvacom Ltd. + * + * For details please refer to: http://www.datatables.net + * + * Special thank to everyone who has contributed to this plug in + * - dykstrad + * - tdillan (for 0.0.3 and 0.0.5 bug fixes) + * - kylealonius (for 0.0.8 bug fix) + * - the86freak (for 0.0.9 bug fix) + */ + +(function (window, document, undefined) { + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * DataTables plug-in API functions test + * + * This are required by ColResize in order to perform the tasks required, and also keep this + * code portable, to be used for other column resize projects with DataTables, if needed. + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + var factory = function ($, DataTable) { + "use strict"; + + /** + * Plug-in for DataTables which will resize the columns depending on the handle clicked + * @method $.fn.dataTableExt.oApi.fnColResize + * @param object oSettings DataTables settings object - automatically added by DataTables! + * @param int iCol Take the column to be resized + * @returns void + */ + $.fn.dataTableExt.oApi.fnColResize = function (oSettings, iCol) { + var v110 = $.fn.dataTable.Api ? true : false; + + /* + * Update DataTables' event handlers + */ + + /* Fire an event so other plug-ins can update */ + $(oSettings.oInstance).trigger('column-resize', [ oSettings, { + "iCol": iCol + } ]); + }; + + /** + * ColResize provides column resize control for DataTables + * @class ColResize + * @constructor + * @param {object} dt DataTables settings object + * @param {object} opts ColResize options + */ + var ColResize = function (dt, opts) { + var oDTSettings; + + if ($.fn.dataTable.Api) { + oDTSettings = new $.fn.dataTable.Api(dt).settings()[0]; + } + // 1.9 compatibility + else if (dt.fnSettings) { + // DataTables object, convert to the settings object + oDTSettings = dt.fnSettings(); + } + else if (typeof dt === 'string') { + // jQuery selector + if ($.fn.dataTable.fnIsDataTable($(dt)[0])) { + oDTSettings = $(dt).eq(0).dataTable().fnSettings(); + } + } + else if (dt.nodeName && dt.nodeName.toLowerCase() === 'table') { + // Table node + if ($.fn.dataTable.fnIsDataTable(dt.nodeName)) { + oDTSettings = $(dt.nodeName).dataTable().fnSettings(); + } + } + else if (dt instanceof jQuery) { + // jQuery object + if ($.fn.dataTable.fnIsDataTable(dt[0])) { + oDTSettings = dt.eq(0).dataTable().fnSettings(); + } + } + else { + // DataTables settings object + oDTSettings = dt; + } + + // Convert from camelCase to Hungarian, just as DataTables does + if ($.fn.dataTable.camelToHungarian) { + $.fn.dataTable.camelToHungarian(ColResize.defaults, opts || {}); + } + + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Public class variables + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /** + * @namespace Settings object which contains customizable information for ColResize instance + */ + this.s = { + /** + * DataTables settings object + * @property dt + * @type Object + * @default null + */ + "dt": null, + + /** + * Initialisation object used for this instance + * @property init + * @type object + * @default {} + */ + "init": $.extend(true, {}, ColResize.defaults, opts), + + /** + * @namespace Information used for the mouse drag + */ + "mouse": { + "startX": -1, + "startY": -1, + "targetIndex": -1, + "targetColumn": -1, + "neighbourIndex": -1, + "neighbourColumn": -1 + }, + + /** + * Status variable keeping track of mouse down status + * @property isMousedown + * @type boolean + * @default false + */ + "isMousedown": false + }; + + + /** + * @namespace Common and useful DOM elements for the class instance + */ + this.dom = { + /** + * Resizing element (the one the mouse is resizing) + * @property resize + * @type element + * @default null + */ + "resizeCol": null, + + /** + * Resizing element neighbour (the column next to the one the mouse is resizing) + * This is for fixed table resizing. + * @property resize + * @type element + * @default null + */ + "resizeColNeighbour": null, + + /** + * Array of events to be restored, used for overriding existing events from other plugins for a time. + * @property restoreEvents + * @type array + * @default [] + */ + "restoreEvents": [] + }; + + + /* Constructor logic */ + this.s.dt = oDTSettings.oInstance.fnSettings(); + this.s.dt._colResize = this; + this._fnConstruct(); + + /* Add destroy callback */ + oDTSettings.oApi._fnCallbackReg(oDTSettings, 'aoDestroyCallback', $.proxy(this._fnDestroy, this), 'ColResize'); + + return this; + }; + + + ColResize.prototype = { + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Public methods + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /** + * Reset the column widths to the original widths that was detected on + * start up. + * @return {this} Returns `this` for chaining. + * + * @example + * // DataTables initialisation with ColResize + * var table = $('#example').dataTable( { + * "sDom": 'Zlfrtip' + * } ); + * + * // Add click event to a button to reset the ordering + * $('#resetOrdering').click( function (e) { + * e.preventDefault(); + * $.fn.dataTable.ColResize( table ).fnReset(); + * } ); + */ + "fnReset": function () { + var a = []; + for (var i = 0, iLen = this.s.dt.aoColumns.length; i < iLen; i++) { + this.s.dt.aoColumns[i].width = this.s.dt.aoColumns[i]._ColResize_iOrigWidth; + } + + this.s.dt.adjust().draw(); + + return this; + }, + + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Private methods (they are of course public in JS, but recommended as private) + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /** + * Constructor logic + * @method _fnConstruct + * @returns void + * @private + */ + "_fnConstruct": function () { + var that = this; + var iLen = that.s.dt.aoColumns.length; + var i; + + that._fnSetupMouseListeners(); + + /* Add event handlers for the resize handles */ + for (i = 0; i < iLen; i++) { + /* Mark the original column width for later reference */ + this.s.dt.aoColumns[i]._ColResize_iOrigWidth = this.s.dt.aoColumns[i].width; + } + + this._fnSetColumnIndexes(); + + /* State saving */ + this.s.dt.oApi._fnCallbackReg( this.s.dt, 'aoStateSaveParams', function (oS, oData) { + that._fnStateSave.call(that, oData); + }, "ColResize_State" ); + + // State loading + this._fnStateLoad(); + }, + + /** + * @method _fnStateSave + * @param object oState DataTables state + * @private + */ + "_fnStateSave": function (oState) { + this.s.dt.aoColumns.forEach(function(col, index) { + oState.columns[index].width = col.sWidthOrig; + }); + }, + + /** + * If state has been loaded, apply the saved widths to the columns + * @method _fnStateLoad + * @private + */ + "_fnStateLoad": function() { + var that = this, + loadedState = this.s.dt.oLoadedState; + if (loadedState && loadedState.columns) { + var colStates = loadedState.columns, + currCols = this.s.dt.aoColumns; + // Only apply the saved widths if the number of columns is the same. + // Otherwise, we don't know if we're applying the width to the correct column. + if (colStates.length > 0 && colStates.length === currCols.length) { + colStates.forEach(function(state, index) { + var col = that.s.dt.aoColumns[index]; + if (state.width) { + col.sWidthOrig = col.sWidth = state.width; + } + }); + } + } + }, + + /** + * Remove events of type from obj add it to restoreEvents array to be restored at a later time + * @param until string flag when to restore the event + * @param obj Object to remove events from + * @param type type of event to remove + * @param namespace namespace of the event being removed + */ + "_fnDelayEvents": function (until, obj, type, namespace) { + var that = this; + //Get the events for the object + var events = $._data($(obj).get(0), 'events'); + $.each(events, function (i, o) { + //If the event type matches + if (i == type) { + //Loop through the possible many events with that type + $.each(o, function (k, v) { + //Somehow it is possible for the event to be undefined make sure it is defined first + if (v) { + if (namespace) { + //Add the event to the array of events to be restored later + that.dom.restoreEvents.push({"until": until, "obj": obj, "type": v.type, "namespace": v.namespace, "handler": v.handler}); + //If the namespace matches + if (v.namespace == namespace) { + //Turn off/unbind the event + $(obj).off(type + "." + namespace); + } + } else { + //Add the event to the array of events to be restored later + that.dom.restoreEvents.push({"until": until, "obj": obj, "type": v.type, "namespace": null, "handler": v.handler}); + //Turn off/unbind the event + $(obj).off(type); + } + } + }); + } + }); + }, + + /** + * Loop through restoreEvents array and restore the events on the elements provided + */ + "_fnRestoreEvents": function (until) { + var that = this; + //Loop through the events to be restored + var i; + for (i = that.dom.restoreEvents.length; i--;) { + if (that.dom.restoreEvents[i].until == undefined || that.dom.restoreEvents[i].until == null || that.dom.restoreEvents[i].until == until) { + if (that.dom.restoreEvents[i].namespace) { + //Turn on the event for the object provided + $(that.dom.restoreEvents[i].obj).off(that.dom.restoreEvents[i].type + "." + that.dom.restoreEvents[i].namespace).on(that.dom.restoreEvents[i].type + "." + that.dom.restoreEvents[i].namespace, that.dom.restoreEvents[i].handler); + that.dom.restoreEvents.splice(i, 1); + } else { + //Turn on the event for the object provided + $(that.dom.restoreEvents[i].obj).off(that.dom.restoreEvents[i].type).on(that.dom.restoreEvents[i].type, that.dom.restoreEvents[i].handler); + that.dom.restoreEvents.splice(i, 1); + } + } + } + }, + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mouse drop and drag + */ + + "_fnSetupMouseListeners":function() { + var that = this; + $(that.s.dt.nTableWrapper).off("mouseenter.ColResize").on("mouseenter.ColResize","th",function(e) { + e.preventDefault(); + that._fnMouseEnter.call(that, e, this); + }); + $(that.s.dt.nTableWrapper).off("mouseleave.ColResize").on("mouseleave.ColResize","th",function(e) { + e.preventDefault(); + that._fnMouseLeave.call(that, e, this); + }); + }, + + /** + * Add mouse listeners to the resize handle on TH element + * @method _fnMouseListener + * @param i Column index + * @param nTh TH resize handle element clicked on + * @returns void + * @private + */ + "_fnMouseListener": function (i, nTh) { + var that = this; + $(nTh).off('mouseenter.ColResize').on('mouseenter.ColResize', function (e) { + e.preventDefault(); + that._fnMouseEnter.call(that, e, nTh); + }); + $(nTh).off('mouseleave.ColResize').on('mouseleave.ColResize', function (e) { + e.preventDefault(); + that._fnMouseLeave.call(that, e, nTh); + }); + }, + + /** + * + * @param e Mouse event + * @param nTh TH element that the mouse is over + */ + "_fnMouseEnter": function (e, nTh) { + var that = this; + if(!that.s.isMousedown) { + //Once the mouse has entered the cell add mouse move event to see if the mouse is over resize handle + $(nTh).off('mousemove.ColResizeHandle').on('mousemove.ColResizeHandle', function (e) { + e.preventDefault(); + that._fnResizeHandleCheck.call(that, e, nTh); + }); + } + }, + + /** + * Clear mouse events when the mouse has left the th + * @param e Mouse event + * @param nTh TH element that the mouse has just left + */ + "_fnMouseLeave": function (e, nTh) { + //Once the mouse has left the TH make suure to remove the mouse move listener + $(nTh).off('mousemove.ColResizeHandle'); + }, + + /** + * Mouse down on a TH element in the table header + * @method _fnMouseDown + * @param event e Mouse event + * @param element nTh TH element to be resized + * @returns void + * @private + */ + "_fnMouseDown": function (e, nTh) { + var that = this; + + that.s.isMousedown = true; + + /* Store information about the mouse position */ + var target = $(e.target).closest('th, td'); + var offset = target.offset(); + + /* Store information about the mouse position for resize calculations in mouse move function */ + this.s.mouse.startX = e.pageX; + this.s.mouse.startY = e.pageY; + + //Store the indexes of the columns the mouse is down on + var idx = that.dom.resizeCol[0].cellIndex; + + // the last column has no 'right-side' neighbour + // with fixed this can make the table smaller + if (that.dom.resizeColNeighbour[0] === undefined){ + var idxNeighbour = 0; + } else { + var idxNeighbour = that.dom.resizeColNeighbour[0].cellIndex; + } + + + + if (idx === undefined) { + return; + } + + this.s.mouse.targetIndex = idx; + this.s.mouse.targetColumn = this.s.dt.aoColumns[ idx ]; + + this.s.mouse.neighbourIndex = idxNeighbour; + this.s.mouse.neighbourColumn = this.s.dt.aoColumns[ idxNeighbour ]; + + /* Add event handlers to the document */ + $(document) + .off('mousemove.ColResize').on('mousemove.ColResize', function (e) { + that._fnMouseMove.call(that, e); + }) + .off('mouseup.ColResize').on('mouseup.ColResize', function (e) { + that._fnMouseUp.call(that, e); + }); + }, + + /** + * Deal with a mouse move event while dragging to resize a column + * @method _fnMouseMove + * @param e Mouse event + * @returns void + * @private + */ + "_fnMouseMove": function (e) { + var that = this; + + var offset = $(that.s.mouse.targetColumn.nTh).offset(); + var relativeX = (e.pageX - offset.left); + var distFromLeft = relativeX; + var distFromRight = $(that.s.mouse.targetColumn.nTh).outerWidth() - relativeX - 1; + + //Change in mouse x position + var dx = e.pageX - that.s.mouse.startX; + //Get the minimum width of the column (default minimum 10px) + var minColumnWidth = Math.max(parseInt($(that.s.mouse.targetColumn.nTh).css('min-width')), 10); + //Store the previous width of the column + var prevWidth = $(that.s.mouse.targetColumn.nTh).width(); + //As long as the cursor is past the handle, resize the columns + if ((dx > 0 && distFromRight <= 0) || (dx < 0 && distFromRight >= 0)) { + if (!that.s.init.tableWidthFixed) { + //As long as the width is larger than the minimum + var newColWidth = Math.max(minColumnWidth, prevWidth + dx); + //Get the width difference (take into account the columns minimum width) + var widthDiff = newColWidth - prevWidth; + var colResizeIdx = parseInt(that.dom.resizeCol.attr("data-column-index")); + //Set datatable column widths + that.s.mouse.targetColumn.sWidthOrig = that.s.mouse.targetColumn.sWidth = that.s.mouse.targetColumn.width = newColWidth + "px"; + var domCols = $(that.s.dt.nTableWrapper).find("th[data-column-index='"+colResizeIdx+"']"); + //For each table expand the width by the same amount as the column + //This accounts for other datatable plugins like FixedColumns + domCols.parents("table").each(function() { + if(!$(this).parent().hasClass("DTFC_LeftBodyLiner")) { + var newWidth = $(this).width() + widthDiff; + $(this).width(newWidth); + } else { + var newWidth =$(that.s.dt.nTableWrapper).find(".DTFC_LeftHeadWrapper").children("table").width(); + $(this).parents(".DTFC_LeftWrapper").width(newWidth); + $(this).parent().width(newWidth+15); + $(this).width(newWidth); + } + }); + //Apply the new width to the columns after the table has been resized + domCols.width(that.s.mouse.targetColumn.width); + } else { + //A neighbour column must exist in order to resize a column in a table with a fixed width + if (that.s.mouse.neighbourColumn) { + //Get the minimum width of the neighbor column (default minimum 10px) + var minColumnNeighbourWidth = Math.max(parseInt($(that.s.mouse.neighbourColumn.nTh).css('min-width')), 10); + //Store the previous width of the neighbour column + var prevNeighbourWidth = $(that.s.mouse.neighbourColumn.nTh).width(); + //As long as the width is larger than the minimum + var newColWidth = Math.max(minColumnWidth, prevWidth + dx); + var newColNeighbourWidth = Math.max(minColumnNeighbourWidth, prevNeighbourWidth - dx); + //Get the width difference (take into account the columns minimum width) + var widthDiff = newColWidth - prevWidth; + var widthDiffNeighbour = newColNeighbourWidth - prevNeighbourWidth; + //Get the column index for the column being changed + var colResizeIdx = parseInt(that.dom.resizeCol.attr("data-column-index")); + var neighbourColResizeIdx = parseInt(that.dom.resizeColNeighbour.attr("data-column-index")); + //Set datatable column widths + that.s.mouse.neighbourColumn.sWidthOrig = that.s.mouse.neighbourColumn.sWidth = that.s.mouse.neighbourColumn.width = newColNeighbourWidth + "px"; + that.s.mouse.targetColumn.sWidthOrig = that.s.mouse.targetColumn.sWidth = that.s.mouse.targetColumn.width = newColWidth + "px"; + //Get list of columns based on column index in all affected tables tables. This accounts for other plugins like FixedColumns + var domNeighbourCols = $(that.s.dt.nTableWrapper).find("th[data-column-index='" + neighbourColResizeIdx + "']"); + var domCols = $(that.s.dt.nTableWrapper).find("th[data-column-index='" + colResizeIdx + "']"); + //If dx if positive (the width is getting larger) shrink the neighbour columns first + if(dx>0) { + domNeighbourCols.width(that.s.mouse.neighbourColumn.width); + domCols.width(that.s.mouse.targetColumn.width); + } else { + //Apply the new width to the columns then to the neighbour columns + domCols.width(that.s.mouse.targetColumn.width); + domNeighbourCols.width(that.s.mouse.neighbourColumn.width); + } + } + } + } + that.s.mouse.startX = e.pageX; + }, + + /** + * Check to see if the mouse is over the resize handle area + * @param e + * @param nTh + */ + "_fnResizeHandleCheck": function (e, nTh) { + var that = this; + + var offset = $(nTh).offset(); + var relativeX = (e.pageX - offset.left); + var relativeY = (e.pageY - offset.top); + var distFromLeft = relativeX; + var distFromRight = $(nTh).outerWidth() - relativeX - 1; + + var handleBuffer = this.s.init.handleWidth / 2; + var leftHandleOn = distFromLeft < handleBuffer; + var rightHandleOn = distFromRight < handleBuffer; + + //If this is the first table cell + if ($(nTh).prev("th").length == 0) { + if(this.s.init.rtl) + rightHandleOn = false; + else + leftHandleOn = false; + } + //If this is the last cell and the table is fixed width don't let them expand the last cell directly + if ($(nTh).next("th").length == 0 && this.s.init.tableWidthFixed) { + if(this.s.init.rtl) + leftHandleOn = false; + else + rightHandleOn = false; + } + + var resizeAvailable = leftHandleOn||rightHandleOn; + + //If table is in right to left mode flip which TH is being resized + if (that.s.init.rtl) { + //Handle is to the left + if (leftHandleOn) { + that.dom.resizeCol = $(nTh); + that.dom.resizeColNeighbour = $(nTh).next(); + } else if (rightHandleOn) { + that.dom.resizeCol = $(nTh).prev(); + that.dom.resizeColNeighbour = $(nTh); + } + } else { + //Handle is to the right + if (rightHandleOn) { + that.dom.resizeCol = $(nTh); + that.dom.resizeColNeighbour = $(nTh).next(); + } else if (leftHandleOn) { + that.dom.resizeCol = $(nTh).prev(); + that.dom.resizeColNeighbour = $(nTh); + } + } + + //If table width is fixed make sure both columns are resizable else just check the one. + if(this.s.init.tableWidthFixed) + resizeAvailable &= this.s.init.exclude.indexOf(parseInt($(that.dom.resizeCol).attr("data-column-index"))) == -1 && this.s.init.exclude.indexOf(parseInt($(that.dom.resizeColNeighbour).attr("data-column-index"))) == -1; + else + resizeAvailable &= this.s.init.exclude.indexOf(parseInt($(that.dom.resizeCol).attr("data-column-index"))) == -1; + + $(nTh).off('mousedown.ColResize'); + if (resizeAvailable) { + $(nTh).css("cursor", "ew-resize"); + + //Delay other mousedown events from the Reorder plugin + that._fnDelayEvents(null, nTh, "mousedown", "ColReorder"); + that._fnDelayEvents("click", nTh, "click", "DT"); + + $(nTh).off('mousedown.ColResize').on('mousedown.ColResize', function (e) { + e.preventDefault(); + that._fnMouseDown.call(that, e, nTh); + }) + .off('click.ColResize').on('click.ColResize', function (e) { + that._fnClick.call(that, e); + }); + } else { + $(nTh).css("cursor", "pointer"); + $(nTh).off('mousedown.ColResize click.ColResize'); + //Restore any events that were removed + that._fnRestoreEvents(); + //This is to restore column sorting on click functionality + if (!that.s.isMousedown) + //Restore click event if mouse is not down + this._fnRestoreEvents("click"); + } + }, + + "_fnClick": function (e) { + var that = this; + that.s.isMousedown = false; + e.stopImmediatePropagation(); + }, + + /** + * Finish off the mouse drag + * @method _fnMouseUp + * @param e Mouse event + * @returns void + * @private + */ + "_fnMouseUp": function (e) { + var that = this; + that.s.isMousedown = false; + + //Fix width of column to be the size the dom is limited to (for when user sets min-width on a column) + that.s.mouse.targetColumn.width = that.dom.resizeCol.width(); + + $(document).off('mousemove.ColResize mouseup.ColResize'); + this.s.dt.oInstance.fnAdjustColumnSizing(); + //Table width fix, prevents extra gaps between tables + var LeftWrapper = $(that.s.dt.nTableWrapper).find(".DTFC_LeftWrapper"); + var DTFC_LeftWidth = LeftWrapper.width(); + LeftWrapper.children(".DTFC_LeftHeadWrapper").children("table").width(DTFC_LeftWidth); + + if (that.s.init.resizeCallback) { + that.s.init.resizeCallback.call(that, that.s.mouse.targetColumn); + } + }, + + /** + * Clean up ColResize memory references and event handlers + * @method _fnDestroy + * @returns void + * @private + */ + "_fnDestroy": function () { + var i, iLen; + + for (i = 0, iLen = this.s.dt.aoDrawCallback.length; i < iLen; i++) { + if (this.s.dt.aoDrawCallback[i].sName === 'ColResize_Pre') { + this.s.dt.aoDrawCallback.splice(i, 1); + break; + } + } + + $(this.s.dt.nTHead).find('*').off('.ColResize'); + + $.each(this.s.dt.aoColumns, function (i, column) { + $(column.nTh).removeAttr('data-column-index'); + }); + + this.s.dt._colResize = null; + this.s = null; + }, + + + /** + * Add a data attribute to the column headers, so we know the index of + * the row to be reordered. This allows fast detection of the index, and + * for this plug-in to work with FixedHeader which clones the nodes. + * @private + */ + "_fnSetColumnIndexes": function () { + $.each(this.s.dt.aoColumns, function (i, column) { + $(column.nTh).attr('data-column-index', i); + }); + } + }; + + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Static parameters + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + + /** + * ColResize default settings for initialisation + * @namespace + * @static + */ + ColResize.defaults = { + /** + * Callback function that is fired when columns are resized + * @type function():void + * @default null + * @static + */ + "resizeCallback": null, + + /** + * Exclude array for columns that are not resizable + * @property exclude + * @type array of indexes that are excluded from resizing + * @default [] + */ + "exclude": [], + + /** + * Check to see if user is using a fixed table width or dynamic + * if true: + * -Columns will resize themselves and their neighbour + * -If neighbour is excluded resize will not occur + * if false: + * -Columns will resize themselves and increase or decrease the width of the table accordingly + */ + "tableWidthFixed": true, + + /** + * Width of the resize handle in pixels + * @property handleWidth + * @type int (pixels) + * @default 10 + */ + "handleWidth": 10, + + /** + * Right to left support, when true flips which column they are resizing on mouse down + * @property rtl + * @type bool + * @default false + */ + "rtl": false + }; + + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Constants + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /** + * ColResize version + * @constant version + * @type String + * @default As code + */ + ColResize.version = "0.0.10"; + + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * DataTables interfaces + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + // Expose + $.fn.dataTable.ColResize = ColResize; + $.fn.DataTable.ColResize = ColResize; + + + // Register a new feature with DataTables + if (typeof $.fn.dataTable == "function" && + typeof $.fn.dataTableExt.fnVersionCheck == "function" && + $.fn.dataTableExt.fnVersionCheck('1.9.3')) { + $.fn.dataTableExt.aoFeatures.push({ + "fnInit": function (settings) { + var table = settings.oInstance; + + if (!settings._colResize) { + var dtInit = settings.oInit; + var opts = dtInit.colResize || dtInit.oColResize || {}; + + new ColResize(settings, opts); + } + else { + table.oApi._fnLog(settings, 1, "ColResize attempted to initialise twice. Ignoring second"); + } + + return null; + /* No node for DataTables to insert */ + }, + "cFeature": "Z", + "sFeature": "ColResize" + }); + } else { + alert("Warning: ColResize requires DataTables 1.9.3 or greater - www.datatables.net/download"); + } + + +// API augmentation + if ($.fn.dataTable.Api) { + $.fn.dataTable.Api.register('colResize.reset()', function () { + return this.iterator('table', function (ctx) { + ctx._colResize.fnReset(); + }); + }); + } + + return ColResize; + }; // /factory + + +// Define as an AMD module if possible +if ( typeof define === 'function' && define.amd ) { + define( ['jquery', 'datatables'], factory ); +} +else if ( typeof exports === 'object' ) { + // Node/CommonJS + factory( require('jquery'), require('datatables') ); +} +else if (jQuery && !jQuery.fn.dataTable.ColResize) { + // Otherwise simply initialise as normal, stopping multiple evaluation + factory(jQuery, jQuery.fn.dataTable); +} + + +})(window, document); \ No newline at end of file diff --git a/wqflask/wqflask/static/new/packages/DataTables/js/jquery.dataTables.js b/wqflask/wqflask/static/new/packages/DataTables/js/jquery.dataTables.js index 1d8a220b..2a9bdb36 100755 --- a/wqflask/wqflask/static/new/packages/DataTables/js/jquery.dataTables.js +++ b/wqflask/wqflask/static/new/packages/DataTables/js/jquery.dataTables.js @@ -1,4942 +1,5321 @@ +/*! DataTables 1.10.7 + * ©2008-2014 SpryMedia Ltd - datatables.net/license + */ + /** * @summary DataTables - * @description Paginate, search and sort HTML tables - * @version 1.9.4 + * @description Paginate, search and order HTML tables + * @version 1.10.7 * @file jquery.dataTables.js - * @author Allan Jardine (www.sprymedia.co.uk) + * @author SpryMedia Ltd (www.sprymedia.co.uk) * @contact www.sprymedia.co.uk/contact + * @copyright Copyright 2008-2014 SpryMedia Ltd. * - * @copyright Copyright 2008-2012 Allan Jardine, all rights reserved. + * This source file is free software, available under the following license: + * MIT license - http://datatables.net/license * - * This source file is free software, under either the GPL v2 license or a - * BSD style license, available at: - * http://datatables.net/license_gpl2 - * http://datatables.net/license_bsd - * - * This source file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * 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 $, jQuery,define,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnReOrderIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnJsonString,_fnRender,_fnNodeToColumnIndex,_fnInfoMacros,_fnBrowserDetect,_fnGetColumns*/ +/*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,_fnVisbleColumns,_fnGetColumns,_fnColumnTypes,_fnApplyColumnDefs,_fnHungarianMap,_fnCamelToHungarian,_fnLanguageCompat,_fnBrowserDetect,_fnAddData,_fnAddTr,_fnNodeToDataIndex,_fnNodeToColumnIndex,_fnGetCellData,_fnSetCellData,_fnSplitObjNotation,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnGetDataMaster,_fnClearTable,_fnDeleteIndex,_fnInvalidate,_fnGetRowElements,_fnCreateTr,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAddOptionsHtml,_fnDetectHeader,_fnGetUniqueThs,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnFilterCreateSearch,_fnEscapeRegex,_fnFilterData,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnInfoMacros,_fnInitialise,_fnInitComplete,_fnLengthChange,_fnFeatureHtmlLength,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnFeatureHtmlTable,_fnScrollDraw,_fnApplyToChildren,_fnCalculateColumnWidths,_fnThrottle,_fnConvertToWidth,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnScrollBarWidth,_fnSortFlatten,_fnSort,_fnSortAria,_fnSortListener,_fnSortAttachListener,_fnSortingClasses,_fnSortData,_fnSaveState,_fnLoadState,_fnSettingsFromNode,_fnLog,_fnMap,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnLengthOverflow,_fnRenderer,_fnDataSource,_fnRowAttributes*/ (/** @lends */function( window, document, undefined ) { (function( factory ) { "use strict"; - // Define as an AMD module if possible - if ( typeof define === 'function' && define.amd ) - { - define( ['jquery'], factory ); + if ( typeof define === 'function' && define.amd ) { + // Define as an AMD module if possible + define( 'datatables', ['jquery'], factory ); } - /* Define using browser globals otherwise - * Prevent multiple instantiations if the script is loaded twice - */ - else if ( jQuery && !jQuery.fn.dataTable ) - { + else if ( typeof exports === 'object' ) { + // Node/CommonJS + module.exports = factory( require( 'jquery' ) ); + } + else if ( jQuery && !jQuery.fn.dataTable ) { + // Define using browser globals otherwise + // Prevent multiple instantiations if the script is loaded twice factory( jQuery ); } } (/** @lends */function( $ ) { "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. + + /** + * 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. + * 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} [oInit={}] Configuration object for DataTables. Options + * @param {object} [init={}] Configuration object for DataTables. Options * are defined by {@link DataTable.defaults} - * @requires jQuery 1.3+ - * + * @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( { - * "bPaginate": false, - * "bSort": false + * "paginate": false, + * "sort": false * } ); * } ); */ - var DataTable = function( oInit ) - { - - - /** - * 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 ) - { - var oDefaults = DataTable.defaults.columns; - var iCol = oSettings.aoColumns.length; - var oCol = $.extend( {}, DataTable.models.oColumn, oDefaults, { - "sSortingClass": oSettings.oClasses.sSortable, - "sSortingClassJUI": oSettings.oClasses.sSortJUI, - "nTh": nTh ? nTh : document.createElement('th'), - "sTitle": oDefaults.sTitle ? oDefaults.sTitle : nTh ? nTh.innerHTML : '', - "aDataSort": oDefaults.aDataSort ? oDefaults.aDataSort : [iCol], - "mData": oDefaults.mData ? oDefaults.oDefaults : iCol - } ); - oSettings.aoColumns.push( oCol ); - - /* Add a column specific filter */ - if ( oSettings.aoPreSearchCols[ iCol ] === undefined || oSettings.aoPreSearchCols[ iCol ] === null ) - { - oSettings.aoPreSearchCols[ iCol ] = $.extend( {}, DataTable.models.oSearch ); - } - else - { - var oPre = oSettings.aoPreSearchCols[ iCol ]; - - /* Don't require that the user must specify bRegex, bSmart or bCaseInsensitive */ - if ( oPre.bRegex === undefined ) - { - oPre.bRegex = true; - } - - if ( oPre.bSmart === undefined ) - { - oPre.bSmart = true; - } - - if ( oPre.bCaseInsensitive === undefined ) - { - oPre.bCaseInsensitive = true; + var DataTable; + + + /* + * 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; + var _re_date_start = /^[\w\+\-]/; + var _re_date_end = /[\w\+\-]$/; + + // 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