Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ferranmesas committed Feb 21, 2017
2 parents 4fc97bb + cbd8491 commit 8ff1659
Show file tree
Hide file tree
Showing 36 changed files with 269 additions and 101 deletions.
78 changes: 69 additions & 9 deletions build/examples.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,19 @@
// Styling libraries
// When updating these files, make sure you also update the `karma.config` tests
// file to match versions.
DT_Example::$lookup_libraries['js' ]['jquery'] = '//code.jquery.com/jquery-1.12.3.js';
DT_Example::$lookup_libraries['js' ]['jquery'] = '//code.jquery.com/jquery-1.12.4.js';
DT_Example::$lookup_libraries['js' ]['jqueryui'] = '//code.jquery.com/ui/1.11.4/jquery-ui.js';
DT_Example::$lookup_libraries['css']['jqueryui'] = '//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css';
DT_Example::$lookup_libraries['js' ]['bootstrap'] = '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js';
DT_Example::$lookup_libraries['css']['bootstrap'] = '//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css';
DT_Example::$lookup_libraries['js']['bootstrap4'] = '//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/js/bootstrap.min.js';
DT_Example::$lookup_libraries['css' ]['bootstrap4'] = '//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.css';
DT_Example::$lookup_libraries['js' ]['semanticui'] = '//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.1/semantic.min.js';
DT_Example::$lookup_libraries['css']['semanticui'] = '//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.1/semantic.min.css';
DT_Example::$lookup_libraries['js' ]['bootstrap'] = '//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js';
DT_Example::$lookup_libraries['css']['bootstrap'] = '//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css';
DT_Example::$lookup_libraries['js']['bootstrap4'] = '//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/js/bootstrap.min.js';
DT_Example::$lookup_libraries['css' ]['bootstrap4'] = '//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap.css';
DT_Example::$lookup_libraries['js' ]['semanticui'] = '//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.6/semantic.min.js';
DT_Example::$lookup_libraries['css']['semanticui'] = '//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.6/semantic.min.css';
DT_Example::$lookup_libraries['js' ]['material'] = '//cdnjs.cloudflare.com/ajax/libs/material-design-lite/1.1.0/material.min.js';
DT_Example::$lookup_libraries['css']['material'] = '//cdnjs.cloudflare.com/ajax/libs/material-design-lite/1.1.0/material.min.css';
DT_Example::$lookup_libraries['js' ]['foundation'] = '//cdnjs.cloudflare.com/ajax/libs/foundation/6.1.1/foundation.min.js';
DT_Example::$lookup_libraries['css']['foundation'] = '//cdnjs.cloudflare.com/ajax/libs/foundation/6.1.1/foundation.min.css';
DT_Example::$lookup_libraries['js' ]['foundation'] = '//cdnjs.cloudflare.com/ajax/libs/foundation/6.2.4/foundation.min.js';
DT_Example::$lookup_libraries['css']['foundation'] = '//cdnjs.cloudflare.com/ajax/libs/foundation/6.2.4/foundation.min.css';
DT_Example::$lookup_libraries['js' ]['foundation'] = '//cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/js/foundation.min.js';
DT_Example::$lookup_libraries['css']['foundation'] = '//cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/css/foundation.min.css';
DT_Example::$lookup_libraries['js' ]['uikit'] = '//cdnjs.cloudflare.com/ajax/libs/uikit/2.24.3/js/uikit.min.js';
Expand Down Expand Up @@ -654,6 +654,66 @@ function sql_files ( $out_dir )
SET IDENTITY_INSERT datatables_demo OFF;
EOD;
file_put_contents( $out_dir.'/sqlserver.sql', $str );

// Oracle style
$str = <<<EOD
--
-- DataTables Ajax and server-side processing database (SQL Server)
--
BEGIN
EditorDelObject('datatables_demo', 'TABLE');
EditorDelObject('datatables_demo_seq', 'SEQUENCE');
END;
CREATE TABLE datatables_demo (
id INT PRIMARY KEY NOT NULL,
first_name VARCHAR(250),
last_name VARCHAR(250),
position VARCHAR(250),
email VARCHAR(250),
office VARCHAR(250),
start_date DATE,
age INT,
salary INT,
seq INT,
extn VARCHAR(8)
);
CREATE SEQUENCE datatables_demo_seq;
CREATE OR REPLACE TRIGGER datatables_demo_on_insert
BEFORE INSERT ON datatables_demo
FOR EACH ROW
BEGIN
SELECT datatables_demo_seq.nextval
INTO :new.id
FROM dual;
END;
EOD;

for ( $i=0, $ien=count($json) ; $i<$ien ; $i++ ) {
$str .= "INSERT INTO datatables_demo ".
"( first_name, last_name, age, position, salary, start_date, extn, email, office, seq ) ".
"VALUES ";

$str .= "( ".
"'".$json[$i]['first_name']."', ".
"'".$json[$i]['last_name']."', ".
$json[$i]['age'].", ".
"'".$json[$i]['position']."', ".
$json[$i]['salary'].", ".
"'".date('d-M-Y', strtotime($json[$i]['start_date']))."', ".
$json[$i]['extn'].", ".
"'".$json[$i]['email']."', ".
"'".$json[$i]['office']."', ".
$json[$i]['sequence']." ".
");\n";
}

$str .= "\nCOMMIT;\n";

file_put_contents( $out_dir.'/oracle.sql', $str );
}


Expand Down
2 changes: 1 addition & 1 deletion build/lib/DT_Example.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ private function _htmlTidy( $html )
$tidy->parseString( $html, array(
'indent' => 2,
'indent-spaces' => 4,
'new-blocklevel-tags' => 'section',
'new-blocklevel-tags' => 'section,editor-field',
'new-pre-tags' => 'script',
'new-empty-tags' => 'tbody',
'output-html' => 1,
Expand Down
22 changes: 19 additions & 3 deletions build/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ function build_extension {
# If there is a make file, then leave it to the extension to do its own
# build and copy files into place
echo_msg "Running $EXTENSION build script"
sh ${BASE_DIR}/extensions/${EXTENSION}/make.sh \
bash ${BASE_DIR}/extensions/${EXTENSION}/make.sh \
${BUILD_DIR}/DataTables/extensions/${EXTENSION} $DEBUG
else
# Otherwise, just copy the whole lot over
Expand Down Expand Up @@ -314,10 +314,11 @@ function usage {
test - Build the unit tests
all [debug] - Build DataTables core and all extensions
extension <ext> [debug] - Extension to build where <ext> is one of:
- AutoFill
- Buttons
- ColVis
- ColReorder
- FixedColumns
- FixedHeader
Expand All @@ -326,7 +327,6 @@ function usage {
- Responsive
- Scroller
- Select
- TableTools
and the optional [debug] parameter can be used to disable JS and CSS
compression for faster development build times."
Expand Down Expand Up @@ -357,6 +357,22 @@ case "$1" in
build_repo
;;

"all")
build_repo
build_extension AutoFill
build_extension Buttons
build_extension ColReorder
build_extension FixedColumns
build_extension FixedHeader
build_extension KeyTable
build_extension Responsive
build_extension Scroller
build_extension Select
if [ -d ../extensions/Editor ]; then
build_extension Editor
fi
;;

"examples")
build_examples
;;
Expand Down
4 changes: 3 additions & 1 deletion build/templates/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ <h1>{software} example <span>{title}</span></h1>
{info}
</div>

{demo-html}
<div class="demo-html">
{demo-html}
</div>
{table}

<ul class="tabs">
Expand Down
11 changes: 5 additions & 6 deletions css/dataTables.bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ table.dataTable {
td,
th {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;

&.dataTables_empty {
Expand Down Expand Up @@ -147,27 +146,27 @@ div.dataTables_scrollHead table.dataTable {
}

div.dataTables_scrollBody {
table {
> table {
border-top: none;
margin-top: 0 !important;
margin-bottom: 0 !important;

thead { // Hide sort icons
> thead { // Hide sort icons
.sorting:after,
.sorting_asc:after,
.sorting_desc:after {
display: none;
}
}

tbody tr:first-child th,
tbody tr:first-child td {
> tbody > tr:first-child > th,
> tbody > tr:first-child > td {
border-top: none;
}
}
}

div.dataTables_scrollFoot table {
div.dataTables_scrollFoot > table {
margin-top: 0 !important;
border-top: none;
}
Expand Down
1 change: 1 addition & 0 deletions css/dataTables.bootstrap4.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ div.dataTables_wrapper {
ul.pagination {
margin: 2px 0;
white-space: nowrap;
justify-content: flex-end;
}
}

Expand Down
1 change: 0 additions & 1 deletion css/dataTables.semanticui.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ table.dataTable.table {
td,
th {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;

&.dataTables_empty {
Expand Down
32 changes: 17 additions & 15 deletions css/jquery.dataTables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -530,19 +530,21 @@ table.dataTable td {
*margin-top: -1px;
-webkit-overflow-scrolling: touch;

th, td {
// Setting v-align baseline can cause the headers to be visible
vertical-align: middle;
}

th > div.dataTables_sizing,
td > div.dataTables_sizing {
// Hide the element used to wrap the content in the header for
// the body scrolling table
height: 0;
overflow: hidden;
margin: 0 !important;
padding: 0 !important;
> table > thead > tr, > table > tbody > tr {
> th, > td {
// Setting v-align baseline can cause the headers to be visible
vertical-align: middle;
}

> th > div.dataTables_sizing,
> td > div.dataTables_sizing {
// Hide the element used to wrap the content in the header for
// the body scrolling table
height: 0;
overflow: hidden;
margin: 0 !important;
padding: 0 !important;
}
}
}
}
Expand All @@ -552,8 +554,8 @@ table.dataTable td {
border-bottom: $table-header-border;
}

div.dataTables_scrollHead table,
div.dataTables_scrollBody table {
div.dataTables_scrollHead > table,
div.dataTables_scrollBody > table {
border-bottom: none;
}
}
Expand Down
4 changes: 2 additions & 2 deletions docs/option/columns.orderData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
</default>

<description>
Allows a column's sorting to take multiple columns into account when doing a order.
Allows a column's sorting to take either the data from a different (often hidden) column as the data to sort, or data from multiple columns.

For example with first name / last name columns next to each other, it is intuitive that they would be linked together to multi-column sort.
A common example of this is a table which contains first and last name columns next to each other, it is intuitive that they would be linked together to multi-column sort. Another example, with a single column, is the case where the data shown to the end user is not directly sortable itself (a column with images in it), but there is some meta data than can be sorted (e.g. file name) - note that [orthogonal data](/manual/data/orthogonal) is an alternative method that can be used for this.
</description>

<example title="Using `orderData` to define multi-column sorting with `dt-init columnDefs`"><![CDATA[
Expand Down
2 changes: 1 addition & 1 deletion docs/option/language.infoEmpty.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dt-option group="i18n">
<name>language.infoEmpty</name>
<summary>Table summary information string used when the table is empty or records</summary>
<summary>Table summary information string used when the table is empty of records</summary>
<since>1.10</since>

<type type="string" />
Expand Down
3 changes: 2 additions & 1 deletion docs/option/pagingType.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
<![CDATA[
The pagination option of DataTables will display a pagination control below the table (by default, its position can be changed using `dt-init dom` and CSS) with buttons that the end user can use to navigate the pages of the table. Which buttons are shown in the pagination control are defined by the option given here.
DataTables has four built-in paging button arrangements:
DataTables has six built-in paging button arrangements:
* `string numbers` - Page number buttons only (<span class="since">1.10.8</span>)
* `string simple` - 'Previous' and 'Next' buttons only
* `string simple_numbers` - 'Previous' and 'Next' buttons, plus page numbers
* `string full` - 'First', 'Previous', 'Next' and 'Last' buttons
* `string full_numbers` - 'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers
* `string first_last_numbers` - 'First' and 'Last' buttons, plus page numbers
Further methods can be added using plug-ins.
]]>
Expand Down
2 changes: 1 addition & 1 deletion docs/option/rowCallback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<description>
This callback allows you to 'post process' each row after it have been generated for each table draw, but _before_ it is rendered into the document. This means that the contents of the row might not have dimensions (`$().width()` for example) if it is not already in the document.

This function might be used for setting the row class name or otherwise manipulating the row's `tag TR` element (although note that `dt-init createdRow can often be more efficient).
This function might be used for setting the row class name or otherwise manipulating the row's `-tag tr` element (although note that `dt-init createdRow` can often be more efficient).
</description>

<example title="Highlight cells based on their content (object data source)"><![CDATA[
Expand Down
3 changes: 2 additions & 1 deletion examples/basic_init/alt_pagination.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ $(document).ready(function() {
The default page control presented by DataTables (forward and backward buttons with up to 7 page numbers in-between) is fine for most situations, but there are cases where you may wish to customise the options presented to the end user. This is done through DataTables' extensible pagination mechanism, the `dt-init pagingType` option.
There are four built-in options for which pagination controls DataTables should show:
There are six built-in options for which pagination controls DataTables should show:
* `string numbers` - Page number buttons only
* `string simple` - 'Previous' and 'Next' buttons only
* `string simple_numbers` - 'Previous' and 'Next' buttons, plus page numbers
* `string full` - 'First', 'Previous', 'Next' and 'Last' buttons
* `string full_numbers` - 'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers
* `string first_last_numbers` - 'First' and 'Last' buttons, plus page numbers
The language strings of 'First', 'Previous' etc can be optionally through the internationalisation options of DataTables; `dt-init language.paginate.first`, `dt-init language.paginate.previous` etc.
Expand Down
8 changes: 7 additions & 1 deletion examples/resources/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ if ( window.$ ) {

// init html
var table = $('<p/>').append( $('table').clone() ).html();
var demoHtml = $.trim( $('div.demo-html').html() );

if ( demoHtml ) {
demoHtml = demoHtml+'\n\n';
}

$('div.tabs div.table').append(
'<code class="multiline language-html">\t\t\t'+
escapeHtml( table )+
escapeHtml( demoHtml + table )+
'</code>'
);
//SyntaxHighlighter.highlight({}, $('#display-init-html')[0]);
Expand Down
2 changes: 1 addition & 1 deletion examples/styling/bootstrap4.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dt-example table-type="html" order="12" framework="bootstrap4">
<dt-example table-type="html" order="13" framework="bootstrap4">

<css lib="datatables" />
<js lib="jquery datatables" />
Expand Down
2 changes: 1 addition & 1 deletion examples/styling/jqueryUI.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dt-example table-type="html" order="11" framework="jqueryui">
<dt-example table-type="html" order="12" framework="jqueryui">

<css lib="datatables" />
<js lib="jquery datatables" />
Expand Down
6 changes: 2 additions & 4 deletions examples/styling/semanticui.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dt-example table-type="html" order="13" framework="semanticui">
<dt-example table-type="html" order="11" framework="semanticui">

<css lib="datatables" />
<js lib="jquery datatables semanticui" />

<title>Semantic UI (Tech. preview)</title>
<title>Semantic UI</title>
<js><![CDATA[
$(document).ready(function() {
$('#example').DataTable();
Expand All @@ -15,8 +15,6 @@ $(document).ready(function() {
This example shows DataTables integrated with [Semantic UI](http://semantic-ui.com/). Semantic UI is a comprehensive framework that uses CSS class names like words to create natural language styling library.
The DataTables integration with Semantic UI is still in development and not all elements might work correctly yet. Only once all of DataTables extensions fully support Semantic UI will the integration be complete and available via the DataTables download builder.
]]></info>

</dt-example>
Loading

0 comments on commit 8ff1659

Please sign in to comment.