diff --git a/public/cms/sleepingowl/default/css/dataTables.bootstrap.css b/public/cms/sleepingowl/default/css/dataTables.bootstrap.css new file mode 100644 index 0000000..3a57c65 --- /dev/null +++ b/public/cms/sleepingowl/default/css/dataTables.bootstrap.css @@ -0,0 +1,224 @@ +.dataTables_wrapper { + margin-top: 15px; +} + +div.dataTables_length label { + float: left; + text-align: left; + font-weight: normal; +} + +div.dataTables_length select { + width: 75px; +} + +div.dataTables_filter label { + float: right; + font-weight: normal; +} + +div.dataTables_filter input { + width: 16em; +} + +div.dataTables_info { + padding-top: 8px; +} + +div.dataTables_paginate { + float: right; + margin: 0; +} + +div.dataTables_paginate ul.pagination { + margin: 2px 0; + white-space: nowrap; +} + +table.dataTable, +table.dataTable td, +table.dataTable th { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +table.dataTable { + clear: both; + margin-top: 6px !important; + margin-bottom: 6px !important; + max-width: none !important; +} + +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 { + cursor: pointer; +} + +table.dataTable th:active { + outline: none; +} + +/* Scrolling */ + +div.dataTables_scrollHead table { + margin-bottom: 0 !important; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; +} + +div.dataTables_scrollHead table thead tr:last-child th:first-child, +div.dataTables_scrollHead table thead tr:last-child td:first-child { + border-bottom-left-radius: 0 !important; + border-bottom-right-radius: 0 !important; +} + +div.dataTables_scrollBody table { + margin-top: 0 !important; + margin-bottom: 0 !important; + border-top: none; +} + +div.dataTables_scrollBody tbody tr:first-child th, +div.dataTables_scrollBody tbody tr:first-child td { + border-top: none; +} + +div.dataTables_scrollFoot table { + margin-top: 0 !important; + border-top: none; +} + +/* + * TableTools styles + */ + +.table tbody tr.active td, +.table tbody tr.active th { + color: white; + background-color: #08C; +} + +.table tbody tr.active:hover td, +.table tbody tr.active:hover th { + background-color: #0075b0 !important; +} + +.table tbody tr.active a { + color: white; +} + +.table-striped tbody tr.active:nth-child(odd) td, +.table-striped tbody tr.active:nth-child(odd) th { + background-color: #017ebc; +} + +table.DTTT_selectable tbody tr { + cursor: pointer; +} + +div.DTTT .btn { + font-size: 12px; + color: #333 !important; +} + +div.DTTT .btn:hover { + text-decoration: none !important; +} + +ul.DTTT_dropdown.dropdown-menu { + z-index: 2003; +} + +ul.DTTT_dropdown.dropdown-menu a { + color: #333 !important; /* needed only when demo_page.css is included */ +} + +ul.DTTT_dropdown.dropdown-menu li { + position: relative; +} + +ul.DTTT_dropdown.dropdown-menu li:hover a { + color: white !important; + background-color: #0088cc; +} + +div.DTTT_collection_background { + z-index: 2002; +} + +/* TableTools information display */ + +div.DTTT_print_info.modal { + height: 150px; + margin-top: -75px; + text-align: center; +} + +div.DTTT_print_info h6 { + margin: 1em; + font-size: 28px; + font-weight: normal; + line-height: 28px; +} + +div.DTTT_print_info p { + font-size: 14px; + line-height: 20px; +} + +/* + * FixedColumns styles + */ + +div.DTFC_LeftHeadWrapper table, +div.DTFC_LeftFootWrapper table, +div.DTFC_RightHeadWrapper table, +div.DTFC_RightFootWrapper table, +table.DTFC_Cloned tr.even { + background-color: white; +} + +div.DTFC_RightHeadWrapper table, +div.DTFC_LeftHeadWrapper table { + margin-bottom: 0 !important; + border-top-right-radius: 0 !important; + border-bottom-left-radius: 0 !important; + border-bottom-right-radius: 0 !important; +} + +div.DTFC_RightHeadWrapper table thead tr:last-child th:first-child, +div.DTFC_RightHeadWrapper table thead tr:last-child td:first-child, +div.DTFC_LeftHeadWrapper table thead tr:last-child th:first-child, +div.DTFC_LeftHeadWrapper table thead tr:last-child td:first-child { + border-bottom-left-radius: 0 !important; + border-bottom-right-radius: 0 !important; +} + +div.DTFC_RightBodyWrapper table, +div.DTFC_LeftBodyWrapper table { + margin-bottom: 0 !important; + border-top: none; +} + +div.DTFC_RightBodyWrapper tbody tr:first-child th, +div.DTFC_RightBodyWrapper tbody tr:first-child td, +div.DTFC_LeftBodyWrapper tbody tr:first-child th, +div.DTFC_LeftBodyWrapper tbody tr:first-child td { + border-top: none; +} + +div.DTFC_RightFootWrapper table, +div.DTFC_LeftFootWrapper table { + border-top: none; +} + +.dataTables_processing { + position: absolute; + left: 50%; + top: 140px; + margin-left: -35px; +} \ No newline at end of file diff --git a/public/cms/sleepingowl/default/css/formitems/datetime/style.css b/public/cms/sleepingowl/default/css/formitems/datetime/style.css new file mode 100644 index 0000000..d0ecaa3 --- /dev/null +++ b/public/cms/sleepingowl/default/css/formitems/datetime/style.css @@ -0,0 +1,7 @@ +.input-group-addon .fa-calendar, .input-group-addon .fa-clock-o { + cursor: pointer; +} + +.form-group.datepicker, .form-group.timepicker { + width: 250px; +} \ No newline at end of file diff --git a/public/cms/sleepingowl/default/css/formitems/image/images.css b/public/cms/sleepingowl/default/css/formitems/image/images.css new file mode 100644 index 0000000..24c7a4e --- /dev/null +++ b/public/cms/sleepingowl/default/css/formitems/image/images.css @@ -0,0 +1,3 @@ +.images-group .imageThumbnail { + cursor: move; +} \ No newline at end of file diff --git a/public/cms/sleepingowl/default/js/columnfilters/base.js b/public/cms/sleepingowl/default/js/columnfilters/base.js new file mode 100644 index 0000000..28bccf3 --- /dev/null +++ b/public/cms/sleepingowl/default/js/columnfilters/base.js @@ -0,0 +1 @@ +window.columnFilters = {}; \ No newline at end of file diff --git a/public/cms/sleepingowl/default/js/columnfilters/range.js b/public/cms/sleepingowl/default/js/columnfilters/range.js new file mode 100644 index 0000000..b948258 --- /dev/null +++ b/public/cms/sleepingowl/default/js/columnfilters/range.js @@ -0,0 +1,70 @@ +window.columnFilters.range = function (container, table) +{ + var $container = $(container); + var $input = $container.find('input'); + var from = $input.filter(':first'); + var to = $input.filter(':last'); + var index = $container.closest('td').data('index'); + + from.data('ajax-data-name', 'from'); + to.data('ajax-data-name', 'to'); + + $.fn.dataTable.ext.search.push(function (settings, data, dataIndex) + { + if (table.settings()[0].sTableId != settings.sTableId) + { + return true; + } + var value = table.data()[dataIndex][index]; + if (value['@data-order'] !== undefined) + { + value = value['@data-order']; + } + + var fromValue = from.val(); + var toValue = to.val(); + if ((from.closest('.datepicker').length > 0) && (to.closest('.datepicker').length > 0)) + { + if (fromValue != '') + { + fromValue = from.closest('.datepicker').data('DateTimePicker').getDate(); + } else + { + fromValue = Number.NEGATIVE_INFINITY; + } + if (toValue != '') + { + toValue = to.closest('.datepicker').data('DateTimePicker').getDate(); + } else + { + toValue = Number.POSITIVE_INFINITY; + } + + value = moment(value); + } else + { + value = parseInt(value); + if (fromValue != '') + { + fromValue = parseInt(fromValue); + } else + { + fromValue = Number.NEGATIVE_INFINITY; + } + if (toValue != '') + { + toValue = parseInt(toValue); + } else + { + toValue = Number.POSITIVE_INFINITY; + } + } + + return (value >= fromValue && value <= toValue); + }); + + $input.on('keyup change', function () + { + table.draw(); + }); +}; \ No newline at end of file diff --git a/public/cms/sleepingowl/default/js/columnfilters/select.js b/public/cms/sleepingowl/default/js/columnfilters/select.js new file mode 100644 index 0000000..4e7c391 --- /dev/null +++ b/public/cms/sleepingowl/default/js/columnfilters/select.js @@ -0,0 +1,9 @@ +window.columnFilters.select = function (input, table) +{ + var $input = $(input); + var index = $input.closest('td').data('index'); + $input.on('change', function () + { + table.column(index).search($input.val()).draw(); + }); +}; \ No newline at end of file diff --git a/public/cms/sleepingowl/default/js/columnfilters/text.js b/public/cms/sleepingowl/default/js/columnfilters/text.js new file mode 100644 index 0000000..0a5313a --- /dev/null +++ b/public/cms/sleepingowl/default/js/columnfilters/text.js @@ -0,0 +1,9 @@ +window.columnFilters.text = function (input, table) +{ + var $input = $(input); + var index = $input.closest('td').data('index'); + $input.on('keyup change', function () + { + table.column(index).search($input.val()).draw(); + }); +}; \ No newline at end of file diff --git a/public/cms/sleepingowl/default/js/columns/checkbox.js b/public/cms/sleepingowl/default/js/columns/checkbox.js new file mode 100644 index 0000000..1d4f3c5 --- /dev/null +++ b/public/cms/sleepingowl/default/js/columns/checkbox.js @@ -0,0 +1,22 @@ +$(function () +{ + $('.adminCheckboxAll').change(function () + { + var checked = $(this).is(':checked'); + $('.adminCheckboxRow').prop('checked', checked).filter(':first').change(); + }); + $(document).delegate('.adminCheckboxRow', 'change', function () + { + var selected = []; + $('.adminCheckboxRow:checked').each(function () + { + selected.push($(this).val()); + }); + $('.tableActions .btnAction').each(function () + { + var $this = $(this); + var url = $this.data('href') + selected.join(','); + $this.attr('href', url); + }); + }); +}); \ No newline at end of file diff --git a/public/cms/sleepingowl/default/js/columns/control.js b/public/cms/sleepingowl/default/js/columns/control.js new file mode 100644 index 0000000..372d518 --- /dev/null +++ b/public/cms/sleepingowl/default/js/columns/control.js @@ -0,0 +1,16 @@ +$(function () +{ + $(document).delegate('.btn-delete', 'click', function (e) + { + e.preventDefault(); + var form = $(this).closest('form'); + bootbox.confirm(window.admin.lang.table['delete-confirm'], function (result) + { + if (result) + { + form.submit(); + } + }); + }); + bootbox.setDefaults('locale', window.admin.locale); +}); \ No newline at end of file diff --git a/public/cms/sleepingowl/default/js/columns/image.js b/public/cms/sleepingowl/default/js/columns/image.js new file mode 100644 index 0000000..885563e --- /dev/null +++ b/public/cms/sleepingowl/default/js/columns/image.js @@ -0,0 +1,10 @@ +$(function () +{ + $(document).delegate('*[data-toggle="lightbox"]', 'click', function (e) + { + e.preventDefault(); + $(this).ekkoLightbox({ + always_show_close: false + }); + }); +}); \ No newline at end of file diff --git a/public/cms/sleepingowl/default/js/datatables/init.js b/public/cms/sleepingowl/default/js/datatables/init.js new file mode 100644 index 0000000..c5aa2b9 --- /dev/null +++ b/public/cms/sleepingowl/default/js/datatables/init.js @@ -0,0 +1,50 @@ +$(function () +{ + $.fn.dataTable.ext.errMode = function () + { + $.notify(window.admin.lang.table.error, 'error'); + }; + $('.datatables').each(function () + { + var $this = $(this); + var params = { + language: window.admin.lang.table, + stateSave: true, + lengthMenu: [ + [10, 25, 50, -1], + [10, 25, 50, window.admin.lang.table.all] + ] + }; + params = $.extend(params, $this.data('attributes')); + + var url; + if (url = $this.data('url')) + { + params.serverSide = true; + params.processing = true; + params.ajax = { + url: url, + data: function (d) + { + $this.find('.column-filter').each(function () + { + var $this = $(this); + var index = $this.closest('td').data('index'); + if (name = $this.data('ajax-data-name')) + { + d.columns[index]['search'][name] = $this.val(); + } + }); + } + }; + } + var table = $this.DataTable(params); + + $this.find('.column-filter').each(function () + { + if ($(this).parent().closest('.column-filter').length > 0) return; + var type = $(this).data('type'); + window.columnFilters[type](this, table); + }); + }); +}); \ No newline at end of file diff --git a/public/cms/sleepingowl/default/js/datatables/jquery.dataTables.min.js b/public/cms/sleepingowl/default/js/datatables/jquery.dataTables.min.js new file mode 100644 index 0000000..b696e89 --- /dev/null +++ b/public/cms/sleepingowl/default/js/datatables/jquery.dataTables.min.js @@ -0,0 +1,158 @@ +/*! DataTables 1.10.6 + * ©2008-2015 SpryMedia Ltd - datatables.net/license + */ +(function(Ea,P,k){var O=function(h){function V(a){var b,c,e={};h.each(a,function(d){if((b=d.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" "))c=d.replace(b[0],b[2].toLowerCase()),e[c]=d,"o"===b[1]&&V(a[d])});a._hungarianMap=e}function H(a,b,c){a._hungarianMap||V(a);var e;h.each(b,function(d){e=a._hungarianMap[d];if(e!==k&&(c||b[e]===k))"o"===e.charAt(0)?(b[e]||(b[e]={}),h.extend(!0,b[e],b[d]),H(a[e],b[e],c)):b[e]=b[d]})}function O(a){var b=m.defaults.oLanguage,c=a.sZeroRecords; +!a.sEmptyTable&&(c&&"No data available in table"===b.sEmptyTable)&&E(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(c&&"Loading..."===b.sLoadingRecords)&&E(a,a,"sZeroRecords","sLoadingRecords");a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&db(a)}function eb(a){A(a,"ordering","bSort");A(a,"orderMulti","bSortMulti");A(a,"orderClasses","bSortClasses");A(a,"orderCellsTop","bSortCellsTop");A(a,"order","aaSorting");A(a,"orderFixed","aaSortingFixed");A(a,"paging","bPaginate"); +A(a,"pagingType","sPaginationType");A(a,"pageLength","iDisplayLength");A(a,"searching","bFilter");if(a=a.aoSearchCols)for(var b=0,c=a.length;b").css({position:"absolute",top:0,left:0,height:1,width:1,overflow:"hidden"}).append(h("
").css({position:"absolute", +top:1,left:1,width:100,overflow:"scroll"}).append(h('
').css({width:"100%",height:10}))).appendTo("body"),c=b.find(".test");a.bScrollOversize=100===c[0].offsetWidth;a.bScrollbarLeft=1!==Math.round(c.offset().left);b.remove()}function hb(a,b,c,e,d,f){var g,i=!1;c!==k&&(g=c,i=!0);for(;e!==d;)a.hasOwnProperty(e)&&(g=i?b(g,a[e],e,a):a[e],i=!0,e+=f);return g}function Fa(a,b){var c=m.defaults.column,e=a.aoColumns.length,c=h.extend({},m.models.oColumn,c,{nTh:b?b:P.createElement("th"),sTitle:c.sTitle? +c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[e],mData:c.mData?c.mData:e,idx:e});a.aoColumns.push(c);c=a.aoPreSearchCols;c[e]=h.extend({},m.models.oSearch,c[e]);ka(a,e,h(b).data())}function ka(a,b,c){var b=a.aoColumns[b],e=a.oClasses,d=h(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=d.attr("width")||null;var f=(d.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);f&&(b.sWidthOrig=f[1])}c!==k&&null!==c&&(fb(c),H(m.defaults.column,c),c.mDataProp!==k&&!c.mData&&(c.mData=c.mDataProp),c.sType&& +(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),h.extend(b,c),E(b,c,"sWidth","sWidthOrig"),c.iDataSort!==k&&(b.aDataSort=[c.iDataSort]),E(b,c,"aDataSort"));var g=b.mData,i=W(g),j=b.mRender?W(b.mRender):null,c=function(a){return"string"===typeof a&&-1!==a.indexOf("@")};b._bAttrSrc=h.isPlainObject(g)&&(c(g.sort)||c(g.type)||c(g.filter));b.fnGetData=function(a,b,c){var e=i(a,b,k,c);return j&&b?j(e,b,a,c):e};b.fnSetData=function(a,b,c){return Q(g)(a,b,c)};"number"!==typeof g&& +(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,d.addClass(e.sSortableNone));a=-1!==h.inArray("asc",b.asSorting);c=-1!==h.inArray("desc",b.asSorting);!b.bSortable||!a&&!c?(b.sSortingClass=e.sSortableNone,b.sSortingClassJUI=""):a&&!c?(b.sSortingClass=e.sSortableAsc,b.sSortingClassJUI=e.sSortJUIAscAllowed):!a&&c?(b.sSortingClass=e.sSortableDesc,b.sSortingClassJUI=e.sSortJUIDescAllowed):(b.sSortingClass=e.sSortable,b.sSortingClassJUI=e.sSortJUI)}function X(a){if(!1!==a.oFeatures.bAutoWidth){var b= +a.aoColumns;Ga(a);for(var c=0,e=b.length;cq[f])e(l.length+q[f],n);else if("string"===typeof q[f]){i=0;for(j=l.length;ib&&a[d]--; -1!=e&&c===k&&a.splice(e,1)}function ca(a,b,c,e){var d=a.aoData[b],f,g=function(c,f){for(;c.childNodes.length;)c.removeChild(c.firstChild);c.innerHTML=y(a,b,f,"display")};if("dom"===c||(!c||"auto"===c)&&"dom"===d.src)d._aData=na(a,d,e,e===k?k:d._aData).data;else{var i=d.anCells;if(i)if(e!==k)g(i[e],e);else{c=0;for(f=i.length;c").appendTo(g));b=0;for(c=l.length;btr").attr("role","row");h(g).find(">tr>th, >tr>td").addClass(n.sHeaderTH); +h(i).find(">tr>th, >tr>td").addClass(n.sFooterTH);if(null!==i){a=a.aoFooter[0];b=0;for(c=a.length;b=a.fnRecordsDisplay()?0:g,a.iInitDisplayStart=-1);var g=a._iDisplayStart,n=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,C(a,!1);else if(i){if(!a.bDestroying&&!kb(a))return}else a.iDraw++;if(0!==j.length){f=i?a.aoData.length:n;for(i=i?0:g;i",{"class":d?e[0]:""}).append(h("",{valign:"top",colSpan:aa(a),"class":a.oClasses.sRowEmpty}).html(c))[0];w(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],La(a),g,n,j]);w(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],La(a),g,n,j]);e=h(a.nTBody);e.children().detach();e.append(h(b));w(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing= +!1}}function N(a,b){var c=a.oFeatures,e=c.bFilter;c.bSort&&lb(a);e?fa(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;M(a);a._drawHold=!1}function mb(a){var b=a.oClasses,c=h(a.nTable),c=h("
").insertBefore(c),e=a.oFeatures,d=h("
",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=d[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var f=a.sDom.split(""),g,i,j,n,l,q,o=0;o")[0];n=f[o+1];if("'"==n||'"'==n){l="";for(q=2;f[o+q]!=n;)l+=f[o+q],q++;"H"==l?l=b.sJUIHeader:"F"==l&&(l=b.sJUIFooter);-1!=l.indexOf(".")?(n=l.split("."),j.id=n[0].substr(1,n[0].length-1),j.className=n[1]):"#"==l.charAt(0)?j.id=l.substr(1,l.length-1):j.className=l;o+=q}d.append(j);d=h(j)}else if(">"==i)d=d.parent();else if("l"==i&&e.bPaginate&&e.bLengthChange)g=nb(a);else if("f"==i&&e.bFilter)g=ob(a);else if("r"==i&&e.bProcessing)g=pb(a);else if("t"==i)g=qb(a);else if("i"== +i&&e.bInfo)g=rb(a);else if("p"==i&&e.bPaginate)g=sb(a);else if(0!==m.ext.feature.length){j=m.ext.feature;q=0;for(n=j.length;q',i=e.sSearch,i=i.match(/_INPUT_/)?i.replace("_INPUT_",g):i+g,b=h("
",{id:!f.f?c+"_filter":null,"class":b.sFilter}).append(h("
").addClass(b.sLength); +a.aanFeatures.l||(j[0].id=c+"_length");j.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",d[0].outerHTML));h("select",j).val(a._iDisplayLength).bind("change.DT",function(){Ra(a,h(this).val());M(a)});h(a.nTable).bind("length.dt.DT",function(b,c,f){a===c&&h("select",j).val(f)});return j[0]}function sb(a){var b=a.sPaginationType,c=m.ext.pager[b],e="function"===typeof c,d=function(a){M(a)},b=h("
").addClass(a.oClasses.sPaging+b)[0],f=a.aanFeatures;e||c.fnInit(a,b,d);f.p||(b.id=a.sTableId+ +"_paginate",a.aoDrawCallback.push({fn:function(a){if(e){var b=a._iDisplayStart,h=a._iDisplayLength,n=a.fnRecordsDisplay(),l=-1===h,b=l?0:Math.ceil(b/h),h=l?1:Math.ceil(n/h),n=c(b,h),q,l=0;for(q=f.p.length;lf&&(e=0)):"first"==b?e=0:"previous"==b?(e=0<=d?e-d:0,0>e&&(e=0)):"next"== +b?e+d",{id:!a.aanFeatures.r?a.sTableId+"_processing":null,"class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function C(a,b){a.oFeatures.bProcessing&&h(a.aanFeatures.r).css("display",b?"block":"none");w(a,null,"processing",[a,b])}function qb(a){var b=h(a.nTable);b.attr("role", +"grid");var c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var e=c.sX,d=c.sY,f=a.oClasses,g=b.children("caption"),i=g.length?g[0]._captionSide:null,j=h(b[0].cloneNode(!1)),n=h(b[0].cloneNode(!1)),l=b.children("tfoot");c.sX&&"100%"===b.attr("width")&&b.removeAttr("width");l.length||(l=null);c=h("
",{"class":f.sScrollWrapper}).append(h("
",{"class":f.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:e?!e?null:s(e):"100%"}).append(h("
",{"class":f.sScrollHeadInner}).css({"box-sizing":"content-box", +width:c.sXInner||"100%"}).append(j.removeAttr("id").css("margin-left",0).append("top"===i?g:null).append(b.children("thead"))))).append(h("
",{"class":f.sScrollBody}).css({overflow:"auto",height:!d?null:s(d),width:!e?null:s(e)}).append(b));l&&c.append(h("
",{"class":f.sScrollFoot}).css({overflow:"hidden",border:0,width:e?!e?null:s(e):"100%"}).append(h("
",{"class":f.sScrollFootInner}).append(n.removeAttr("id").css("margin-left",0).append("bottom"===i?g:null).append(b.children("tfoot"))))); +var b=c.children(),q=b[0],f=b[1],o=l?b[2]:null;if(e)h(f).on("scroll.DT",function(){var a=this.scrollLeft;q.scrollLeft=a;l&&(o.scrollLeft=a)});a.nScrollHead=q;a.nScrollBody=f;a.nScrollFoot=o;a.aoDrawCallback.push({fn:Y,sName:"scrolling"});return c[0]}function Y(a){var b=a.oScroll,c=b.sX,e=b.sXInner,d=b.sY,f=b.iBarWidth,g=h(a.nScrollHead),i=g[0].style,j=g.children("div"),n=j[0].style,l=j.children("table"),j=a.nScrollBody,q=h(j),o=j.style,k=h(a.nScrollFoot).children("div"),p=k.children("table"),m=h(a.nTHead), +r=h(a.nTable),t=r[0],u=t.style,K=a.nTFoot?h(a.nTFoot):null,ha=a.oBrowser,w=ha.bScrollOversize,x,v,y,L,z,A=[],B=[],C=[],D,E=function(a){a=a.style;a.paddingTop="0";a.paddingBottom="0";a.borderTopWidth="0";a.borderBottomWidth="0";a.height=0};r.children("thead, tfoot").remove();z=m.clone().prependTo(r);x=m.find("tr");y=z.find("tr");z.find("th, td").removeAttr("tabindex");K&&(L=K.clone().prependTo(r),v=K.find("tr"),L=L.find("tr"));c||(o.width="100%",g[0].style.width="100%");h.each(qa(a,z),function(b,c){D= +la(a,b);c.style.width=a.aoColumns[D].sWidth});K&&G(function(a){a.style.width=""},L);b.bCollapse&&""!==d&&(o.height=q[0].offsetHeight+m[0].offsetHeight+"px");g=r.outerWidth();if(""===c){if(u.width="100%",w&&(r.find("tbody").height()>j.offsetHeight||"scroll"==q.css("overflow-y")))u.width=s(r.outerWidth()-f)}else""!==e?u.width=s(e):g==q.width()&&q.height()g-f&&(u.width=s(g))):u.width=s(g);g=r.outerWidth();G(E,y);G(function(a){C.push(a.innerHTML);A.push(s(h(a).css("width")))}, +y);G(function(a,b){a.style.width=A[b]},x);h(y).height(0);K&&(G(E,L),G(function(a){B.push(s(h(a).css("width")))},L),G(function(a,b){a.style.width=B[b]},v),h(L).height(0));G(function(a,b){a.innerHTML='
'+C[b]+"
";a.style.width=A[b]},y);K&&G(function(a,b){a.innerHTML="";a.style.width=B[b]},L);if(r.outerWidth()j.offsetHeight||"scroll"==q.css("overflow-y")?g+f:g;if(w&&(j.scrollHeight>j.offsetHeight||"scroll"==q.css("overflow-y")))u.width= +s(v-f);(""===c||""!==e)&&R(a,1,"Possible column misalignment",6)}else v="100%";o.width=s(v);i.width=s(v);K&&(a.nScrollFoot.style.width=s(v));!d&&w&&(o.height=s(t.offsetHeight+f));d&&b.bCollapse&&(o.height=s(d),b=c&&t.offsetWidth>j.offsetWidth?f:0,t.offsetHeightj.clientHeight||"scroll"==q.css("overflow-y");ha="padding"+(ha.bScrollbarLeft?"Left":"Right");n[ha]=l?f+"px":"0px";K&&(p[0].style.width= +s(b),k[0].style.width=s(b),k[0].style[ha]=l?f+"px":"0px");q.scroll();if((a.bSorted||a.bFiltered)&&!a._drawHold)j.scrollTop=0}function G(a,b,c){for(var e=0,d=0,f=b.length,g,i;d"));i.find("tfoot th, tfoot td").css("width","");var p=i.find("tbody tr"),j=qa(a,i.find("thead")[0]);for(o=0;o").css("width",s(a)).appendTo(b||P.body),e=c[0].offsetWidth;c.remove(); +return e}function Fb(a,b){var c=a.oScroll;if(c.sX||c.sY)c=!c.sX?c.iBarWidth:0,b.style.width=s(h(b).outerWidth()-c)}function Eb(a,b){var c=Gb(a,b);if(0>c)return null;var e=a.aoData[c];return!e.nTr?h("").html(y(a,c,b,"display"))[0]:e.anCells[b]}function Gb(a,b){for(var c,e=-1,d=-1,f=0,g=a.aoData.length;fe&&(e=c.length,d=f);return d}function s(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function Hb(){var a= +m.__scrollbarWidth;if(a===k){var b=h("

").css({position:"absolute",top:0,left:0,width:"100%",height:150,padding:0,overflow:"scroll",visibility:"hidden"}).appendTo("body"),a=b[0].offsetWidth-b[0].clientWidth;m.__scrollbarWidth=a;b.remove()}return a}function T(a){var b,c,e=[],d=a.aoColumns,f,g,i,j;b=a.aaSortingFixed;c=h.isPlainObject(b);var n=[];f=function(a){a.length&&!h.isArray(a[0])?n.push(a):n.push.apply(n,a)};h.isArray(b)&&f(b);c&&b.pre&&f(b.pre);f(a.aaSorting);c&&b.post&&f(b.post);for(a=0;a< +n.length;a++){j=n[a][0];f=d[j].aDataSort;b=0;for(c=f.length;bd?1:0,0!==c)return"asc"===h.dir?c:-c;c=e[a];d=e[b];return cd?1:0}):h.sort(function(a,b){var c,g,h,i,j=n.length,k=f[a]._aSortData,m=f[b]._aSortData;for(h=0;hg?1:0})}a.bSorted=!0}function Jb(a){for(var b,c,e=a.aoColumns,d= +T(a),a=a.oLanguage.oAria,f=0,g=e.length;f/g,"");var h=c.nTh;h.removeAttribute("aria-sort");c.bSortable&&(0d?d+1:3));d=0;for(f=e.length;dd?d+1:3))}a.aLastSort=e}function Ib(a,b){var c=a.aoColumns[b],e=m.ext.order[c.sSortDataType],d;e&&(d=e.call(a.oInstance, +a,b,$(a,b)));for(var f,g=m.ext.type.order[c.sType+"-pre"],h=0,j=a.aoData.length;h=e.length?[0,c[1]]:c)}));d.search!==k&&h.extend(a.oPreviousSearch,Ab(d.search));b=0;for(c=d.columns.length;b=c&&(b=c-e);b-=b%e;if(-1===e||0>b)b=0;a._iDisplayStart=b}function Pa(a,b){var c=a.renderer,e=m.ext.renderer[b];return h.isPlainObject(c)&&c[b]?e[c[b]]||e._:"string"===typeof c?e[c]||e._:e._}function B(a){return a.oFeatures.bServerSide?"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function Wa(a,b){var c=[],c=Mb.numbers_length,e=Math.floor(c/2);b<=c?c=U(0,b):a<=e?(c=U(0,c-2),c.push("ellipsis"), +c.push(b-1)):(a>=b-1-e?c=U(b-(c-2),b):(c=U(a-e+2,a+e-1),c.push("ellipsis"),c.push(b-1)),c.splice(0,0,"ellipsis"),c.splice(0,0,0));c.DT_el="span";return c}function db(a){h.each({num:function(b){return Aa(b,a)},"num-fmt":function(b){return Aa(b,a,Xa)},"html-num":function(b){return Aa(b,a,Ba)},"html-num-fmt":function(b){return Aa(b,a,Ba,Xa)}},function(b,c){x.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(x.type.search[b+a]=x.type.search.html)})}function Nb(a){return function(){var b=[za(this[m.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments)); +return m.ext.internal[a].apply(this,b)}}var m,x,t,r,u,Ya={},Ob=/[\r\n]/g,Ba=/<.*?>/g,ac=/^[\w\+\-]/,bc=/[\w\+\-]$/,Yb=RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g"),Xa=/[',$\u00a3\u20ac\u00a5%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi,I=function(a){return!a||!0===a||"-"===a?!0:!1},Pb=function(a){var b=parseInt(a,10);return!isNaN(b)&&isFinite(a)?b:null},Qb=function(a,b){Ya[b]||(Ya[b]=RegExp(va(b),"g"));return"string"===typeof a&&"."!==b?a.replace(/\./g,"").replace(Ya[b], +"."):a},Za=function(a,b,c){var e="string"===typeof a;if(I(a))return!0;b&&e&&(a=Qb(a,b));c&&e&&(a=a.replace(Xa,""));return!isNaN(parseFloat(a))&&isFinite(a)},Rb=function(a,b,c){return I(a)?!0:!(I(a)||"string"===typeof a)?null:Za(a.replace(Ba,""),b,c)?!0:null},D=function(a,b,c){var e=[],d=0,f=a.length;if(c!==k)for(;d")[0],Zb=wa.textContent!==k,$b=/<.*?>/g;m=function(a){this.$=function(a, +b){return this.api(!0).$(a,b)};this._=function(a,b){return this.api(!0).rows(a,b).data()};this.api=function(a){return a?new t(za(this[x.iApiIndex])):new t(this)};this.fnAddData=function(a,b){var c=this.api(!0),e=h.isArray(a)&&(h.isArray(a[0])||h.isPlainObject(a[0]))?c.rows.add(a):c.row.add(a);(b===k||b)&&c.draw();return e.flatten().toArray()};this.fnAdjustColumnSizing=function(a){var b=this.api(!0).columns.adjust(),c=b.settings()[0],e=c.oScroll;a===k||a?b.draw(!1):(""!==e.sX||""!==e.sY)&&Y(c)};this.fnClearTable= +function(a){var b=this.api(!0).clear();(a===k||a)&&b.draw()};this.fnClose=function(a){this.api(!0).row(a).child.hide()};this.fnDeleteRow=function(a,b,c){var e=this.api(!0),a=e.rows(a),d=a.settings()[0],h=d.aoData[a[0][0]];a.remove();b&&b.call(this,d,h);(c===k||c)&&e.draw();return h};this.fnDestroy=function(a){this.api(!0).destroy(a)};this.fnDraw=function(a){this.api(!0).draw(a)};this.fnFilter=function(a,b,c,e,d,h){d=this.api(!0);null===b||b===k?d.search(a,c,e,h):d.column(b).search(a,c,e,h);d.draw()}; +this.fnGetData=function(a,b){var c=this.api(!0);if(a!==k){var e=a.nodeName?a.nodeName.toLowerCase():"";return b!==k||"td"==e||"th"==e?c.cell(a,b).data():c.row(a).data()||null}return c.data().toArray()};this.fnGetNodes=function(a){var b=this.api(!0);return a!==k?b.row(a).node():b.rows().nodes().flatten().toArray()};this.fnGetPosition=function(a){var b=this.api(!0),c=a.nodeName.toUpperCase();return"TR"==c?b.row(a).index():"TD"==c||"TH"==c?(a=b.cell(a).index(),[a.row,a.columnVisible,a.column]):null}; +this.fnIsOpen=function(a){return this.api(!0).row(a).child.isShown()};this.fnOpen=function(a,b,c){return this.api(!0).row(a).child(b,c).show().child()[0]};this.fnPageChange=function(a,b){var c=this.api(!0).page(a);(b===k||b)&&c.draw(!1)};this.fnSetColumnVis=function(a,b,c){a=this.api(!0).column(a).visible(b);(c===k||c)&&a.columns.adjust().draw()};this.fnSettings=function(){return za(this[x.iApiIndex])};this.fnSort=function(a){this.api(!0).order(a).draw()};this.fnSortListener=function(a,b,c){this.api(!0).order.listener(a, +b,c)};this.fnUpdate=function(a,b,c,e,d){var h=this.api(!0);c===k||null===c?h.row(b).data(a):h.cell(b,c).data(a);(d===k||d)&&h.columns.adjust();(e===k||e)&&h.draw();return 0};this.fnVersionCheck=x.fnVersionCheck;var b=this,c=a===k,e=this.length;c&&(a={});this.oApi=this.internal=x.internal;for(var d in m.ext.internal)d&&(this[d]=Nb(d));this.each(function(){var d={},d=1t<"F"ip>'),p.renderer)?h.isPlainObject(p.renderer)&&!p.renderer.header&&(p.renderer.header="jqueryui"):p.renderer="jqueryui":h.extend(j,m.ext.classes,d.oClasses);q.addClass(j.sTable);if(""!==p.oScroll.sX||""!==p.oScroll.sY)p.oScroll.iBarWidth=Hb();!0===p.oScroll.sX&& +(p.oScroll.sX="100%");p.iInitDisplayStart===k&&(p.iInitDisplayStart=d.iDisplayStart,p._iDisplayStart=d.iDisplayStart);null!==d.iDeferLoading&&(p.bDeferLoading=!0,g=h.isArray(d.iDeferLoading),p._iRecordsDisplay=g?d.iDeferLoading[0]:d.iDeferLoading,p._iRecordsTotal=g?d.iDeferLoading[1]:d.iDeferLoading);var t=p.oLanguage;h.extend(!0,t,d.oLanguage);""!==t.sUrl&&(h.ajax({dataType:"json",url:t.sUrl,success:function(a){O(a);H(l.oLanguage,a);h.extend(true,t,a);ga(p)},error:function(){ga(p)}}),n=!0);null=== +d.asStripeClasses&&(p.asStripeClasses=[j.sStripeOdd,j.sStripeEven]);var g=p.asStripeClasses,s=q.children("tbody").find("tr").eq(0);-1!==h.inArray(!0,h.map(g,function(a){return s.hasClass(a)}))&&(h("tbody tr",this).removeClass(g.join(" ")),p.asDestroyStripes=g.slice());o=[];g=this.getElementsByTagName("thead");0!==g.length&&(da(p.aoHeader,g[0]),o=qa(p));if(null===d.aoColumns){r=[];g=0;for(i=o.length;g").appendTo(this));p.nTHead=i[0];i=q.children("tbody"); +0===i.length&&(i=h("").appendTo(this));p.nTBody=i[0];i=q.children("tfoot");if(0===i.length&&0").appendTo(this);0===i.length||0===i.children().length?q.addClass(j.sNoFooter):0a?new t(b[a],this[a]):null},filter:function(a){var b=[]; +if(v.filter)b=v.filter.call(this,a,this);else for(var c=0,e=this.length;c").addClass(b),h("td",c).addClass(b).html(a)[0].colSpan=aa(e),d.push(c[0]))};f(a,b);c._details&&c._details.remove();c._details=h(d);c._detailsShow&&c._details.insertAfter(c.nTr)}return this});r(["row().child.show()","row().child().show()"],function(){Vb(this,!0);return this});r(["row().child.hide()","row().child().hide()"],function(){Vb(this,!1);return this});r(["row().child.remove()", +"row().child().remove()"],function(){cb(this);return this});r("row().child.isShown()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var dc=/^(.+):(name|visIdx|visible)$/,Wb=function(a,b,c,e,d){for(var c=[],e=0,f=d.length;e=0?b:g.length+b];if(typeof a==="function"){var d=Ca(c,f);return h.map(g,function(b,f){return a(f,Wb(c,f,0,0,d),j[f])?f:null})}var k=typeof a==="string"?a.match(dc):"";if(k)switch(k[2]){case "visIdx":case "visible":b=parseInt(k[1],10);if(b<0){var m=h.map(g,function(a,b){return a.bVisible?b:null});return[m[m.length+b]]}return[la(c,b)];case "name":return h.map(i,function(a,b){return a===k[1]?b:null})}else return h(j).filter(a).map(function(){return h.inArray(this, +j)}).toArray()})},1);c.selector.cols=a;c.selector.opts=b;return c});u("columns().header()","column().header()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTh},1)});u("columns().footer()","column().footer()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTf},1)});u("columns().data()","column().data()",function(){return this.iterator("column-rows",Wb,1)});u("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column", +function(a,b){return a.aoColumns[b].mData},1)});u("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b,c,e,d,f){return ia(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)},1)});u("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,e,d){return ia(a.aoData,d,"anCells",b)},1)});u("columns().visible()","column().visible()",function(a,b){return this.iterator("column",function(c,e){if(a===k)return c.aoColumns[e].bVisible; +var d=c.aoColumns,f=d[e],g=c.aoData,i,j,n;if(a!==k&&f.bVisible!==a){if(a){var l=h.inArray(!0,D(d,"bVisible"),e+1);i=0;for(j=g.length;ie;return!0};m.isDataTable=m.fnIsDataTable=function(a){var b=h(a).get(0),c=!1;h.each(m.settings, +function(a,d){var f=d.nScrollHead?h("table",d.nScrollHead)[0]:null,g=d.nScrollFoot?h("table",d.nScrollFoot)[0]:null;if(d.nTable===b||f===b||g===b)c=!0});return c};m.tables=m.fnTables=function(a){return h.map(m.settings,function(b){if(!a||a&&h(b.nTable).is(":visible"))return b.nTable})};m.util={throttle:ua,escapeRegex:va};m.camelToHungarian=H;r("$()",function(a,b){var c=this.rows(b).nodes(),c=h(c);return h([].concat(c.filter(a).toArray(),c.find(a).toArray()))});h.each(["on","one","off"],function(a, +b){r(b+"()",function(){var a=Array.prototype.slice.call(arguments);a[0].match(/\.dt\b/)||(a[0]+=".dt");var e=h(this.tables().nodes());e[b].apply(e,a);return this})});r("clear()",function(){return this.iterator("table",function(a){oa(a)})});r("settings()",function(){return new t(this.context,this.context)});r("init()",function(){var a=this.context;return a.length?a[0].oInit:null});r("data()",function(){return this.iterator("table",function(a){return D(a.aoData,"_aData")}).flatten()});r("destroy()", +function(a){a=a||!1;return this.iterator("table",function(b){var c=b.nTableWrapper.parentNode,e=b.oClasses,d=b.nTable,f=b.nTBody,g=b.nTHead,i=b.nTFoot,j=h(d),f=h(f),k=h(b.nTableWrapper),l=h.map(b.aoData,function(a){return a.nTr}),q;b.bDestroying=!0;w(b,"aoDestroyCallback","destroy",[b]);a||(new t(b)).columns().visible(!0);k.unbind(".DT").find(":not(tbody *)").unbind(".DT");h(Ea).unbind(".DT-"+b.sInstance);d!=g.parentNode&&(j.children("thead").detach(),j.append(g));i&&d!=i.parentNode&&(j.children("tfoot").detach(), +j.append(i));j.detach();k.detach();b.aaSorting=[];b.aaSortingFixed=[];xa(b);h(l).removeClass(b.asStripeClasses.join(" "));h("th, td",g).removeClass(e.sSortable+" "+e.sSortableAsc+" "+e.sSortableDesc+" "+e.sSortableNone);b.bJUI&&(h("th span."+e.sSortIcon+", td span."+e.sSortIcon,g).detach(),h("th, td",g).each(function(){var a=h("div."+e.sSortJUIWrapper,this);h(this).append(a.contents());a.detach()}));!a&&c&&c.insertBefore(d,b.nTableReinsertBefore);f.children().detach();f.append(l);j.css("width",b.sDestroyWidth).removeClass(e.sTable); +(q=b.asDestroyStripes.length)&&f.children().each(function(a){h(this).addClass(b.asDestroyStripes[a%q])});c=h.inArray(b,m.settings);-1!==c&&m.settings.splice(c,1)})});h.each(["column","row","cell"],function(a,b){r(b+"s().every()",function(a){return this.iterator(b,function(e,d,f){a.call((new t(e))[b](d,f))})})});m.version="1.10.6";m.settings=[];m.models={};m.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};m.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null, +_sFilterRow:null,_sRowStripe:"",src:null};m.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};m.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[], +ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)}, +fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+a.sInstance+"_"+location.pathname))}catch(b){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+"_"+location.pathname, +JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)", +sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},m.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null};V(m.defaults);m.defaults.column={aDataSort:null,iDataSort:-1, +asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};V(m.defaults.column);m.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null, +iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[], +aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:k,oAjaxData:k,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1, +_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==B(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==B(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=this._iDisplayLength,b=this._iDisplayStart,c=b+a,e=this.aiDisplay.length,d=this.oFeatures,f=d.bPaginate;return d.bServerSide? +!1===f||-1===a?b+e:Math.min(b+a,this._iRecordsDisplay):!f||c>e||-1===a?e:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{}};m.ext=x={buttons:{},classes:{},errMode:"alert",feature:[],search:[],internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:m.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:m.version};h.extend(x,{afnFiltering:x.search,aTypes:x.type.detect, +ofnSearch:x.type.search,oSort:x.type.order,afnSortData:x.order,aoFeatures:x.feature,oApi:x.internal,oStdClasses:x.classes,oPagination:x.pager});h.extend(m.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length", +sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner", +sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var Da="",Da="",F=Da+"ui-state-default",ja=Da+"css_right ui-icon ui-icon-",Xb=Da+"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix";h.extend(m.ext.oJUIClasses,m.ext.classes,{sPageButton:"fg-button ui-button "+F,sPageButtonActive:"ui-state-disabled",sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_", +sSortAsc:F+" sorting_asc",sSortDesc:F+" sorting_desc",sSortable:F+" sorting",sSortableAsc:F+" sorting_asc_disabled",sSortableDesc:F+" sorting_desc_disabled",sSortableNone:F+" sorting_disabled",sSortJUIAsc:ja+"triangle-1-n",sSortJUIDesc:ja+"triangle-1-s",sSortJUI:ja+"carat-2-n-s",sSortJUIAscAllowed:ja+"carat-1-n",sSortJUIDescAllowed:ja+"carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead "+F,sScrollFoot:"dataTables_scrollFoot "+F, +sHeaderTH:F,sFooterTH:F,sJUIHeader:Xb+" ui-corner-tl ui-corner-tr",sJUIFooter:Xb+" ui-corner-bl ui-corner-br"});var Mb=m.ext.pager;h.extend(Mb,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},simple_numbers:function(a,b){return["previous",Wa(a,b),"next"]},full_numbers:function(a,b){return["first","previous",Wa(a,b),"next","last"]},_numbers:Wa,numbers_length:7});h.extend(!0,m.ext.renderer,{pageButton:{_:function(a,b,c,e,d,f){var g=a.oClasses,i= +a.oLanguage.oPaginate,j,k,l=0,m=function(b,e){var o,r,t,s,u=function(b){Ta(a,b.data.action,true)};o=0;for(r=e.length;o").appendTo(b);m(t,s)}else{k=j="";switch(s){case "ellipsis":b.append('');break;case "first":j=i.sFirst;k=s+(d>0?"":" "+g.sPageButtonDisabled);break;case "previous":j=i.sPrevious;k=s+(d>0?"":" "+g.sPageButtonDisabled);break;case "next":j=i.sNext;k=s+(d",{"class":g.sPageButton+" "+k,"aria-controls":a.sTableId,"data-dt-idx":l,tabindex:a.iTabIndex,id:c===0&&typeof s==="string"?a.sTableId+"_"+s:null}).html(j).appendTo(b);Va(t,{action:s},u);l++}}}},o;try{o=h(P.activeElement).data("dt-idx")}catch(r){}m(h(b).empty(),e);o&&h(b).find("[data-dt-idx="+o+"]").focus()}}});h.extend(m.ext.type.detect,[function(a,b){var c=b.oLanguage.sDecimal; +return Za(a,c)?"num"+c:null},function(a){if(a&&!(a instanceof Date)&&(!ac.test(a)||!bc.test(a)))return null;var b=Date.parse(a);return null!==b&&!isNaN(b)||I(a)?"date":null},function(a,b){var c=b.oLanguage.sDecimal;return Za(a,c,!0)?"num-fmt"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Rb(a,c)?"html-num"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Rb(a,c,!0)?"html-num-fmt"+c:null},function(a){return I(a)||"string"===typeof a&&-1!==a.indexOf("<")?"html":null}]);h.extend(m.ext.type.search, +{html:function(a){return I(a)?a:"string"===typeof a?a.replace(Ob," ").replace(Ba,""):""},string:function(a){return I(a)?a:"string"===typeof a?a.replace(Ob," "):a}});var Aa=function(a,b,c,e){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=Qb(a,b));a.replace&&(c&&(a=a.replace(c,"")),e&&(a=a.replace(e,"")));return 1*a};h.extend(x.type.order,{"date-pre":function(a){return Date.parse(a)||0},"html-pre":function(a){return I(a)?"":a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return I(a)? +"":"string"===typeof a?a.toLowerCase():!a.toString?"":a.toString()},"string-asc":function(a,b){return ab?1:0},"string-desc":function(a,b){return ab?-1:0}});db("");h.extend(!0,m.ext.renderer,{header:{_:function(a,b,c,e){h(a.nTable).on("order.dt.DT",function(d,f,g,h){if(a===f){d=c.idx;b.removeClass(c.sSortingClass+" "+e.sSortAsc+" "+e.sSortDesc).addClass(h[d]=="asc"?e.sSortAsc:h[d]=="desc"?e.sSortDesc:c.sSortingClass)}})},jqueryui:function(a,b,c,e){h("

").addClass(e.sSortJUIWrapper).append(b.contents()).append(h("").addClass(e.sSortIcon+ +" "+c.sSortingClassJUI)).appendTo(b);h(a.nTable).on("order.dt.DT",function(d,f,g,h){if(a===f){d=c.idx;b.removeClass(e.sSortAsc+" "+e.sSortDesc).addClass(h[d]=="asc"?e.sSortAsc:h[d]=="desc"?e.sSortDesc:c.sSortingClass);b.find("span."+e.sSortIcon).removeClass(e.sSortJUIAsc+" "+e.sSortJUIDesc+" "+e.sSortJUI+" "+e.sSortJUIAscAllowed+" "+e.sSortJUIDescAllowed).addClass(h[d]=="asc"?e.sSortJUIAsc:h[d]=="desc"?e.sSortJUIDesc:c.sSortingClassJUI)}})}}});m.render={number:function(a,b,c,e){return{display:function(d){if("number"!== +typeof d&&"string"!==typeof d)return d;var f=0>d?"-":"",d=Math.abs(parseFloat(d)),g=parseInt(d,10),d=c?b+(d-g).toFixed(c).substring(2):"";return f+(e||"")+g.toString().replace(/\B(?=(\d{3})+(?!\d))/g,a)+d}}}};h.extend(m.ext.internal,{_fnExternApiFunc:Nb,_fnBuildAjax:ra,_fnAjaxUpdate:kb,_fnAjaxParameters:tb,_fnAjaxUpdateDraw:ub,_fnAjaxDataSrc:sa,_fnAddColumn:Fa,_fnColumnOptions:ka,_fnAdjustColumnSizing:X,_fnVisibleToColumnIndex:la,_fnColumnIndexToVisible:$,_fnVisbleColumns:aa,_fnGetColumns:Z,_fnColumnTypes:Ha, +_fnApplyColumnDefs:ib,_fnHungarianMap:V,_fnCamelToHungarian:H,_fnLanguageCompat:O,_fnBrowserDetect:gb,_fnAddData:J,_fnAddTr:ma,_fnNodeToDataIndex:function(a,b){return b._DT_RowIndex!==k?b._DT_RowIndex:null},_fnNodeToColumnIndex:function(a,b,c){return h.inArray(c,a.aoData[b].anCells)},_fnGetCellData:y,_fnSetCellData:Ia,_fnSplitObjNotation:Ka,_fnGetObjectDataFn:W,_fnSetObjectDataFn:Q,_fnGetDataMaster:La,_fnClearTable:oa,_fnDeleteIndex:pa,_fnInvalidate:ca,_fnGetRowElements:na,_fnCreateTr:Ja,_fnBuildHead:jb, +_fnDrawHead:ea,_fnDraw:M,_fnReDraw:N,_fnAddOptionsHtml:mb,_fnDetectHeader:da,_fnGetUniqueThs:qa,_fnFeatureHtmlFilter:ob,_fnFilterComplete:fa,_fnFilterCustom:xb,_fnFilterColumn:wb,_fnFilter:vb,_fnFilterCreateSearch:Qa,_fnEscapeRegex:va,_fnFilterData:yb,_fnFeatureHtmlInfo:rb,_fnUpdateInfo:Bb,_fnInfoMacros:Cb,_fnInitialise:ga,_fnInitComplete:ta,_fnLengthChange:Ra,_fnFeatureHtmlLength:nb,_fnFeatureHtmlPaginate:sb,_fnPageChange:Ta,_fnFeatureHtmlProcessing:pb,_fnProcessingDisplay:C,_fnFeatureHtmlTable:qb, +_fnScrollDraw:Y,_fnApplyToChildren:G,_fnCalculateColumnWidths:Ga,_fnThrottle:ua,_fnConvertToWidth:Db,_fnScrollingWidthAdjust:Fb,_fnGetWidestNode:Eb,_fnGetMaxLenString:Gb,_fnStringToCss:s,_fnScrollBarWidth:Hb,_fnSortFlatten:T,_fnSort:lb,_fnSortAria:Jb,_fnSortListener:Ua,_fnSortAttachListener:Oa,_fnSortingClasses:xa,_fnSortData:Ib,_fnSaveState:ya,_fnLoadState:Kb,_fnSettingsFromNode:za,_fnLog:R,_fnMap:E,_fnBindAction:Va,_fnCallbackReg:z,_fnCallbackFire:w,_fnLengthOverflow:Sa,_fnRenderer:Pa,_fnDataSource:B, +_fnRowAttributes:Ma,_fnCalculateEnd:function(){}});h.fn.dataTable=m;h.fn.dataTableSettings=m.settings;h.fn.dataTableExt=m.ext;h.fn.DataTable=function(a){return h(this).dataTable(a).api()};h.each(m,function(a,b){h.fn.DataTable[a]=b});return h.fn.dataTable};"function"===typeof define&&define.amd?define("datatables",["jquery"],O):"object"===typeof exports?module.exports=O(require("jquery")):jQuery&&!jQuery.fn.dataTable&&O(jQuery)})(window,document); diff --git a/public/cms/sleepingowl/default/js/datatables/jquery.dataTables_bootstrap.js b/public/cms/sleepingowl/default/js/datatables/jquery.dataTables_bootstrap.js new file mode 100644 index 0000000..c2fba68 --- /dev/null +++ b/public/cms/sleepingowl/default/js/datatables/jquery.dataTables_bootstrap.js @@ -0,0 +1,245 @@ +/* Set the defaults for DataTables initialisation */ +$.extend(true, $.fn.dataTable.defaults, { + "sDom": "<'row'<'col-sm-6'l><'col-sm-6'f>r>" + "t" + "<'row'<'col-sm-6'i><'col-sm-6'p>>", + "oLanguage": { + "sLengthMenu": "_MENU_ records per page" + } +}); + + +/* Default class modification */ +$.extend($.fn.dataTableExt.oStdClasses, { + "sWrapper": "dataTables_wrapper form-inline", + "sFilterInput": "form-control input-sm", + "sLengthSelect": "form-control input-sm" +}); + +// In 1.10 we use the pagination renderers to draw the Bootstrap paging, +// rather than custom plug-in +if ($.fn.dataTable.Api) { + $.fn.dataTable.defaults.renderer = 'bootstrap'; + $.fn.dataTable.ext.renderer.pageButton.bootstrap = function(settings, host, idx, buttons, page, pages) { + var api = new $.fn.dataTable.Api(settings); + var classes = settings.oClasses; + var lang = settings.oLanguage.oPaginate; + var btnDisplay, btnClass; + + var attach = function(container, buttons) { + var i, ien, node, button; + var clickHandler = function(e) { + e.preventDefault(); + if (e.data.action !== 'ellipsis') { + api.page(e.data.action).draw(false); + } + }; + + for (i = 0, ien = buttons.length; i < ien; i++) { + button = buttons[i]; + + if ($.isArray(button)) { + attach(container, button); + } else { + btnDisplay = ''; + btnClass = ''; + + switch (button) { + case 'ellipsis': + btnDisplay = '…'; + btnClass = 'disabled'; + break; + + case 'first': + btnDisplay = lang.sFirst; + btnClass = button + (page > 0 ? + '' : ' disabled'); + break; + + case 'previous': + btnDisplay = lang.sPrevious; + btnClass = button + (page > 0 ? + '' : ' disabled'); + break; + + case 'next': + btnDisplay = lang.sNext; + btnClass = button + (page < pages - 1 ? + '' : ' disabled'); + break; + + case 'last': + btnDisplay = lang.sLast; + btnClass = button + (page < pages - 1 ? + '' : ' disabled'); + break; + + default: + btnDisplay = button + 1; + btnClass = page === button ? + 'active' : ''; + break; + } + + if (btnDisplay) { + node = $('
  • ', { + 'class': classes.sPageButton + ' ' + btnClass, + 'aria-controls': settings.sTableId, + 'tabindex': settings.iTabIndex, + 'id': idx === 0 && typeof button === 'string' ? settings.sTableId + '_' + button : null + }) + .append($('', { + 'href': '#' + }) + .html(btnDisplay) + ) + .appendTo(container); + + settings.oApi._fnBindAction( + node, { + action: button + }, clickHandler + ); + } + } + } + }; + + attach( + $(host).empty().html('
      ').children('ul'), + buttons + ); + } +} else { + // Integration for 1.9- + $.fn.dataTable.defaults.sPaginationType = 'bootstrap'; + + /* API method to get paging information */ + $.fn.dataTableExt.oApi.fnPagingInfo = function(oSettings) { + return { + "iStart": oSettings._iDisplayStart, + "iEnd": oSettings.fnDisplayEnd(), + "iLength": oSettings._iDisplayLength, + "iTotal": oSettings.fnRecordsTotal(), + "iFilteredTotal": oSettings.fnRecordsDisplay(), + "iPage": oSettings._iDisplayLength === -1 ? 0 : Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength), + "iTotalPages": oSettings._iDisplayLength === -1 ? 0 : Math.ceil(oSettings.fnRecordsDisplay() / oSettings._iDisplayLength) + }; + }; + + /* Bootstrap style pagination control */ + $.extend($.fn.dataTableExt.oPagination, { + "bootstrap": { + "fnInit": function(oSettings, nPaging, fnDraw) { + var oLang = oSettings.oLanguage.oPaginate; + var fnClickHandler = function(e) { + e.preventDefault(); + if (oSettings.oApi._fnPageChange(oSettings, e.data.action)) { + fnDraw(oSettings); + } + }; + + $(nPaging).append( + '' + ); + var els = $('a', nPaging); + $(els[0]).bind('click.DT', { + action: "previous" + }, fnClickHandler); + $(els[1]).bind('click.DT', { + action: "next" + }, fnClickHandler); + }, + + "fnUpdate": function(oSettings, fnDraw) { + var iListLength = 5; + var oPaging = oSettings.oInstance.fnPagingInfo(); + var an = oSettings.aanFeatures.p; + var i, ien, j, sClass, iStart, iEnd, iHalf = Math.floor(iListLength / 2); + + if (oPaging.iTotalPages < iListLength) { + iStart = 1; + iEnd = oPaging.iTotalPages; + } else if (oPaging.iPage <= iHalf) { + iStart = 1; + iEnd = iListLength; + } else if (oPaging.iPage >= (oPaging.iTotalPages - iHalf)) { + iStart = oPaging.iTotalPages - iListLength + 1; + iEnd = oPaging.iTotalPages; + } else { + iStart = oPaging.iPage - iHalf + 1; + iEnd = iStart + iListLength - 1; + } + + for (i = 0, ien = an.length; i < ien; i++) { + // Remove the middle elements + $('li:gt(0)', an[i]).filter(':not(:last)').remove(); + + // Add the new list items and their event handlers + for (j = iStart; j <= iEnd; j++) { + sClass = (j == oPaging.iPage + 1) ? 'class="active"' : ''; + $('
    • ' + j + '
    • ') + .insertBefore($('li:last', an[i])[0]) + .bind('click', function(e) { + e.preventDefault(); + oSettings._iDisplayStart = (parseInt($('a', this).text(), 10) - 1) * oPaging.iLength; + fnDraw(oSettings); + }); + } + + // Add / remove disabled classes from the static elements + if (oPaging.iPage === 0) { + $('li:first', an[i]).addClass('disabled'); + } else { + $('li:first', an[i]).removeClass('disabled'); + } + + if (oPaging.iPage === oPaging.iTotalPages - 1 || oPaging.iTotalPages === 0) { + $('li:last', an[i]).addClass('disabled'); + } else { + $('li:last', an[i]).removeClass('disabled'); + } + } + } + } + }); +} + + +/* + * TableTools Bootstrap compatibility + * Required TableTools 2.1+ + */ +if ($.fn.DataTable.TableTools) { + // Set the classes that TableTools uses to something suitable for Bootstrap + $.extend(true, $.fn.DataTable.TableTools.classes, { + "container": "DTTT btn-group", + "buttons": { + "normal": "btn btn-default", + "disabled": "disabled" + }, + "collection": { + "container": "DTTT_dropdown dropdown-menu", + "buttons": { + "normal": "", + "disabled": "disabled" + } + }, + "print": { + "info": "DTTT_print_info modal" + }, + "select": { + "row": "active" + } + }); + + // Have the collection use a bootstrap compatible dropdown + $.extend(true, $.fn.DataTable.TableTools.DEFAULTS.oTags, { + "collection": { + "container": "ul", + "button": "li", + "liner": "a" + } + }); +} diff --git a/public/cms/sleepingowl/default/js/formitems/image/init.js b/public/cms/sleepingowl/default/js/formitems/image/init.js new file mode 100644 index 0000000..ebcabe6 --- /dev/null +++ b/public/cms/sleepingowl/default/js/formitems/image/init.js @@ -0,0 +1,56 @@ +$(function () +{ + $('.imageUpload').each(function (index, item) + { + var $item = $(item); + var $group = $item.closest('.form-group'); + var $errors = $item.find('.errors'); + var $noValue = $item.find('.no-value'); + var $hasValue = $item.find('.has-value'); + var $thumbnail = $item.find('.thumbnail img.has-value'); + var $input = $item.find('.imageValue'); + var flow = new Flow({ + target: $item.data('target'), + testChunks: false, + chunkSize: 1024 * 1024 * 1024, + query: { + _token: $item.data('token') + } + }); + flow.assignBrowse($item.find('.imageBrowse'), false, true); + flow.on('filesSubmitted', function(file) { + flow.upload(); + }); + flow.on('fileSuccess', function(file,message){ + flow.removeFile(file); + + $errors.html(''); + $group.removeClass('has-error'); + + var result = $.parseJSON(message); + $thumbnail.attr('src', result.url); + $hasValue.find('span').text(result.value); + $input.val(result.value); + $noValue.addClass('hidden'); + $hasValue.removeClass('hidden'); + }); + flow.on('fileError', function(file, message){ + flow.removeFile(file); + + var response = $.parseJSON(message); + var errors = ''; + $.each(response, function (index, error) + { + errors += '

      ' + error + '

      ' + }); + $errors.html(errors); + $group.addClass('has-error'); + }); + $item.find('.imageRemove').click(function () + { + $input.val(''); + $noValue.removeClass('hidden'); + $hasValue.addClass('hidden'); + }); + }); +}); \ No newline at end of file diff --git a/public/cms/sleepingowl/default/js/formitems/image/initMultiple.js b/public/cms/sleepingowl/default/js/formitems/image/initMultiple.js new file mode 100644 index 0000000..6e97889 --- /dev/null +++ b/public/cms/sleepingowl/default/js/formitems/image/initMultiple.js @@ -0,0 +1,71 @@ +$(function () +{ + $('.imageUploadMultiple').each(function (index, item) + { + var $item = $(item); + var $group = $item.closest('.form-group'); + var $innerGroup = $item.find('.form-group'); + var $errors = $item.find('.errors'); + var $input = $item.find('.imageValue'); + var flow = new Flow({ + target: $item.data('target'), + testChunks: false, + chunkSize: 1024 * 1024 * 1024, + query: { + _token: $item.data('token') + } + }); + var updateValue = function () + { + var values = []; + $item.find('img[data-value]').each(function () + { + values.push($(this).data('value')); + }); + $input.val(values.join(',')); + }; + flow.assignBrowse($item.find('.imageBrowse')); + flow.on('filesSubmitted', function(file) { + flow.upload(); + }); + flow.on('fileSuccess', function(file,message){ + flow.removeFile(file); + + $errors.html(''); + $group.removeClass('has-error'); + + var result = $.parseJSON(message); + + $innerGroup.append('
      ' + + '' + + 'Remove
      '); + updateValue(); + }); + flow.on('fileError', function(file, message){ + flow.removeFile(file); + + var response = $.parseJSON(message); + var errors = ''; + $.each(response, function (index, error) + { + errors += '

      ' + error + '

      ' + }); + $errors.html(errors); + $group.addClass('has-error'); + }); + $item.on('click', '.imageRemove', function (e) + { + e.preventDefault(); + $(this).closest('.imageThumbnail').remove(); + updateValue(); + }); + + $innerGroup.sortable({ + onUpdate: function () + { + updateValue(); + } + }); + + }); +}); \ No newline at end of file diff --git a/public/cms/sleepingowl/default/js/formitems/select/init.js b/public/cms/sleepingowl/default/js/formitems/select/init.js new file mode 100644 index 0000000..c51bb24 --- /dev/null +++ b/public/cms/sleepingowl/default/js/formitems/select/init.js @@ -0,0 +1,14 @@ +$(function () +{ + $('.multiselect').each(function () + { + var $this = $(this); + var nullable = $this.data('nullable'); + $this.chosen({ + allow_single_deselect: nullable, + no_results_text: window.admin.lang.select.nothing, + placeholder_text_single: window.admin.lang.select.placeholder, + placeholder_text_multiple: window.admin.lang.select.placeholder, + }); + }); +}); \ No newline at end of file diff --git a/src/Providers/ModuleServiceProvider.php b/src/Providers/ModuleServiceProvider.php index 45a75cc..d58ebec 100644 --- a/src/Providers/ModuleServiceProvider.php +++ b/src/Providers/ModuleServiceProvider.php @@ -61,6 +61,10 @@ public function boot() Event::listen('navigation.inited', function (Navigation $navigation) { $this->app['sleeping_owl']->buildMenu($navigation); }); + + $this->publishes([ + __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . 'cms' => public_path('cms') + ], 'kodicms'); } protected function registerRoutePatterns()