From e95a9f14ea66a05155e83a7c9a1247df656e34b3 Mon Sep 17 00:00:00 2001 From: jefry Date: Tue, 13 Sep 2022 17:04:18 +0700 Subject: [PATCH] asdasdas --- .DS_Store | Bin 10244 -> 10244 bytes public/.DS_Store | Bin 6148 -> 8196 bytes public/css/main.css | 25 ++ public/img/.DS_Store | Bin 0 -> 6148 bytes public/js/.DS_Store | Bin 0 -> 6148 bytes public/js/main.js | 11 + public/js/page/dashboard.js | 16 +- public/scss/.DS_Store | Bin 6148 -> 6148 bytes public/vendor/.DS_Store | Bin 10244 -> 10244 bytes public/vendor/multiselect-master/.DS_Store | Bin 0 -> 6148 bytes public/vendor/multiselect-master/css/style.css | 278 ++++++++++++++++++++++ public/vendor/multiselect-master/index.html | 51 ++++ public/vendor/multiselect-master/js/index.js | 180 ++++++++++++++ views/.DS_Store | Bin 6148 -> 6148 bytes views/layout.ejs | 36 +-- views/partials/.DS_Store | Bin 0 -> 6148 bytes views/partials/dashboard/modal_form.ejs | 1 + views/partials/dashboard/modal_pintar_summary.ejs | 1 + views/partials/scripts.ejs | 4 +- 19 files changed, 587 insertions(+), 16 deletions(-) create mode 100644 public/img/.DS_Store create mode 100644 public/js/.DS_Store create mode 100644 public/vendor/multiselect-master/.DS_Store create mode 100644 public/vendor/multiselect-master/css/style.css create mode 100644 public/vendor/multiselect-master/index.html create mode 100644 public/vendor/multiselect-master/js/index.js create mode 100644 views/partials/.DS_Store diff --git a/.DS_Store b/.DS_Store index 3787778551b63729d467aa5589f7ad17ef453999..75548c025904b2222680f5e10278de6420b67dc0 100644 GIT binary patch delta 734 zcmZn(XbG6$<QhU^hQw@Ma!?U5w#|4;dI3m>Cio3K%kT^Icq$a`KaaA{@oZg&7T%Ll_K^n`|c{ z!I-c)T*RM=De&jy3u0oE_la?_S+{^RPCh55gkXwI<`L&(T(DVMJcx0!sf1*GPCCLN zygE0WfiB=-$YaO{x+0Y!o*@^^DrLw4@`{mNrM>c`giQw6!+6vqT#7@zG>Qetp(5rq zI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q zM98J!lq<+UHm_iEw2)Lh%aLxNRu+b0hGZZvMm9RxISpnsl03qAZ1N~p@G&qkl?GllhJ{J?B5fLRAjL{*c9^-u;I~IxO2x#0riq+j@Hm}Nh zCsrMQQvrT<2b9wz-OvMt&o8RK!rijUvV2wL@Ft&c`PupH`{i~-@k>O#?7SgSgLLrU z)0`^suY>m|ezD+?ITGE0_S_J&#&%RgKfoAbB% zUH<-vfPbt%6n+3|s(>o6cLh+h*^;40omBxYa z5GoM+%MsWAtDpP-FiEde0af5%DPRWKESus;Qd@Tp$Fi|&<>`QNE9vE4 zcJesozuk;;hpuV1`)-R^eSB@NuAe?u(|r45zJDG++dHT$M4f2mdnEdN~$v#XxVx*jOvR9MvVeMm`rD0-cVy(}DaEFkNU=;5QWb E1imCFO#lD@ literal 0 HcmV?d00001 diff --git a/public/js/main.js b/public/js/main.js index e29cecc..d4f17be 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -215,6 +215,7 @@ $('input[type=file]').not('[multiple]').change(function(e){ }); function clearAlert(){ + $("#alertBox").html(''); } @@ -232,13 +233,23 @@ function showAlert(type,text){ ); } +function showSpinner(){ + $("#spinnerLoading").show(); +} + +function hideSpinner(){ + $("#spinnerLoading").hide(); +} + function loading(percent,show){ if(show){ + showSpinner(); $("#loadingBar").removeClass('hide'); $("#loadingBar div[role=progressbar]").attr("aria-valuenow",percent); $("#loadingBar div[role=progressbar]").css("width",`${percent}%`); } else{ + hideSpinner(); $("#loadingBar").addClass('hide'); } } diff --git a/public/js/page/dashboard.js b/public/js/page/dashboard.js index 7c77885..8103f8c 100644 --- a/public/js/page/dashboard.js +++ b/public/js/page/dashboard.js @@ -1,8 +1,19 @@ /* eslint-disable no-undef */ + let list; let attachment; let removeMedia = []; +var selectCompanyList = new drop({ + selector: '.modalCompanySelect' +}); + +var selectDivisiList = new drop({ + selector: '.modalDivisionSelect' +}); + + + var rowPage = 9; async function paginationSummary(pageSize,page,id,token){ @@ -534,9 +545,12 @@ $('#modal-form').on('shown.bs.modal', async function() { .serializeArray() .filter(item => item.value == '').length > 0 ) { - showAlert('error', 'Cek kembali data yang belum diisi!'); + showAlert('error', `Cek kembali data (${$(event.target) + .serializeArray() + .filter(item => item.value == '').map(i=>i.name).join(',')}) yang belum diisi!`); } else if ( $('input#videoFile').prop('files').length <= 0 || + $('input#thumbnail').prop('files').length <= 0|| list.files.length <= 0 || attachment.files.length <= 0 ) { diff --git a/public/scss/.DS_Store b/public/scss/.DS_Store index 3f8829cfbf7c205b05a873f0263eb54b0347f910..7cdbff7ba2b83ae3b78e21099c5df8aa39a6c445 100644 GIT binary patch delta 298 zcmZoMXfc@J&&abeU^gQp&tx7Z6{eRJlVg}9CVMe)vGFDANoJ={j$%@QFN?_xDxZQ^z97ReI5|JJ0H}w7 zfmHxRvH{I5WhiDS0ost8la3_Mux2eo8kz!R2P|((lU7LsI{?Ly+LUAC2%MD`nAv-)m_{C%)h{J^#>WQ#4Hy`066wO5FMfeotM{vM$ z0Yf?;=v9z6b0+^0=h%Eld^2M`4^Xfi=xbe|uM-)Hz)Ha3fa>S9WS5T0p!2zam*5s&){J$j2JK0#kV+M*&YDHPA<9egDp#*6RZ_w9^r5`#w( znStGJcYc!(vYQbRT|95*B2y75Fo?>Q}pDzN~N8y1qEpa@(m= z-!@Q(wL*e{U?3O>27-Y;1Guv(#hGEu!9Xw&3>+EY`H(P(rDJ25j}A<^1prQ<&Vn_2 z3C1MH(y=jw1)>%Tv{3aHLoFQo^6B1J}@Cyul0#*t<`2YX_ literal 0 HcmV?d00001 diff --git a/public/vendor/multiselect-master/css/style.css b/public/vendor/multiselect-master/css/style.css new file mode 100644 index 0000000..6c70fa8 --- /dev/null +++ b/public/vendor/multiselect-master/css/style.css @@ -0,0 +1,278 @@ +@charset "UTF-8"; +/* CSS Document * Varun Dewan 2019 */ + +html, body { + padding: 0px; + margin: 0px; + font-family: 'Raleway', sans-serif; +} + +body * { + box-sizing: border-box; + margin: 0px; + padding: 0px; +} +body section { + margin-bottom: 10px; +} + +.container { + max-width: 600px; + margin: 40px auto; + background: #cdcdcd; + min-height: 330px; + height: 400px; + padding: 20px 20px; +} + +.drop { + position: relative; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + width: 100%; +} +.drop.open { + z-index: 100; +} +.drop.open .drop-screen { + z-index: 100; + display: block; +} +.drop.open .drop-options { + z-index: 200; + max-height: 200px; +} +.drop.open .drop-display { + z-index: 200; + border-color: #465; +} +.drop select { + display: none; +} +.drop .drop-screen { + position: fixed; + width: 100%; + height: 100%; + background: #000; + top: 0px; + left: 0px; + opacity: 0; + display: none; + z-index: 1; +} + +.link { + text-align: center; + margin: 20px 0px; + color:#8CACD7; +} + + +.drop .drop-display { + position: relative; + padding: 0px 20px 5px 5px; + border: 4px solid #444; + width: 100%; + background: #FFF; + z-index: 1; + margin: 0px; + font-size: 16px; + min-height: 58px; +} +.drop .drop-display:hover:after { + opacity: 0.75; +} +.drop .drop-display:after { + font-family: 'Material Icons'; + content: "\e5c6"; + position: absolute; + right: 10px; + top: 12px; + font-size: 24px; + color: #444; +} +.drop .drop-display .item { + position: relative; + display: inline-block; + border: 2px solid #333; + margin: 5px 5px -4px 0px; + padding: 0px 25px 0px 10px; + overflow: hidden; + height: 40px; + line-height: 36px; +} +.drop .drop-display .item .btnclose { + color: #444; + position: absolute; + font-size: 16px; + right: 5px; + top: 10px; + cursor: pointer; +} +.drop .drop-display .item .btnclose:hover { + opacity: 0.75; +} +.drop .drop-display .item.remove { + -webkit-animation: removeSelected 0.2s, hide 1s infinite; + animation: removeSelected 0.2s, hide 1s infinite; + -webkit-animation-delay: 0s, 0.2s; + animation-delay: 0s, 0.2s; +} +.drop .drop-display .item.add { + -webkit-animation: addSelected 0.2s; + animation: addSelected 0.2s; +} +.drop .drop-display .item.hide { + display: none; +} +.drop .drop-options { + background: #444; + box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.25); + position: absolute; + width: 100%; + max-height: 0px; + overflow-y: auto; + transition: all 0.25s linear; + z-index: 1; +} +.drop .drop-options a { + display: block; + height: 40px; + line-height: 40px; + padding: 0px 20px; + color: white; + position: relative; + max-height: 40px; + transition: all 1s; + overflow: hidden; +} +.drop .drop-options a:hover { + background: #465; + cursor: pointer; +} +.drop .drop-options a.remove { + -webkit-animation: removeOption 0.2s; + animation: removeOption 0.2s; + max-height: 0px; +} +.drop .drop-options a.add { + -webkit-animation: addOption 0.2s; + animation: addOption 0.2s; +} +.drop .drop-options a.hide { + display: none; +} + +@-webkit-keyframes pop { + from { + -webkit-transform: scale(0); + transform: scale(0); + } + to { + -webkit-transform: scale(1); + transform: scale(1); + } +} + +@keyframes pop { + from { + -webkit-transform: scale(0); + transform: scale(0); + } + to { + -webkit-transform: scale(1); + transform: scale(1); + } +} +@-webkit-keyframes removeOption { + from { + max-height: 40px; + } + to { + max-height: 0px; + } +} +@keyframes removeOption { + from { + max-height: 40px; + } + to { + max-height: 0px; + } +} +@-webkit-keyframes addOption { + from { + max-height: 0px; + } + to { + max-height: 40px; + } +} +@keyframes addOption { + from { + max-height: 0px; + } + to { + max-height: 40px; + } +} +@-webkit-keyframes removeSelected { + from { + -webkit-transform: scale(1); + transform: scale(1); + } + to { + -webkit-transform: scale(0); + transform: scale(0); + } +} +@keyframes removeSelected { + from { + -webkit-transform: scale(1); + transform: scale(1); + } + to { + -webkit-transform: scale(0); + transform: scale(0); + } +} +@-webkit-keyframes addSelected { + from { + -webkit-transform: scale(0); + transform: scale(0); + } + to { + -webkit-transform: scale(1); + transform: scale(1); + } +} +@keyframes addSelected { + from { + -webkit-transform: scale(0); + transform: scale(0); + } + to { + -webkit-transform: scale(1); + transform: scale(1); + } +} +@-webkit-keyframes hide { + from, to { + max-height: 0px; + max-width: 0px; + padding: 0px; + margin: 0px; + border-width: 0px; + } +} +@keyframes hide { + from, to { + max-height: 0px; + max-width: 0px; + padding: 0px; + margin: 0px; + border-width: 0px; + } +} diff --git a/public/vendor/multiselect-master/index.html b/public/vendor/multiselect-master/index.html new file mode 100644 index 0000000..9a312e2 --- /dev/null +++ b/public/vendor/multiselect-master/index.html @@ -0,0 +1,51 @@ + + + + + + + MultiSelect + + + + + + + + + + + + + +
+
+

Multiselect Drop Down

+

An example of a drop down select plugin using vanilla JavaScript.

+

By Varun Dewan

+ + +
+
+

Preselected

+ +
+
+ + + + + + + + + + + + diff --git a/public/vendor/multiselect-master/js/index.js b/public/vendor/multiselect-master/js/index.js new file mode 100644 index 0000000..2eb0b59 --- /dev/null +++ b/public/vendor/multiselect-master/js/index.js @@ -0,0 +1,180 @@ +//Varun Dewan 2019 +var render = { + get: function(selector){ + var ele = document.querySelectorAll(selector); + for(var i = 0; i < ele.length; i++){ + this.init(ele[i]); + } + return ele; + }, + template: function(html){ + var template = document.createElement('div'); + template.innerHTML = html.trim(); + return this.init(template.childNodes[0]); + }, + init: function(ele){ + ele.on = function(event, func){ this.addEventListener(event, func); } + return ele; + } +}; + +//Build the plugin +var drop = function(info){var o = { + options: info.options, + selected: info.selected || [], + preselected: info.preselected || [], + open: false, + html: { + select: render.get(info.selector)[0], + options: render.get(info.selector + ' option'), + parent: undefined, + }, + init: function(){ + //Setup Drop HTML + this.html.parent = render.get(info.selector)[0].parentNode + this.html.drop = render.template('
') + this.html.dropDisplay = render.template('
Display
') + this.html.dropOptions = render.template('
Options
') + this.html.dropScreen = render.template('
') + + this.html.parent.insertBefore(this.html.drop, this.html.select) + this.html.drop.appendChild(this.html.dropDisplay) + this.html.drop.appendChild(this.html.dropOptions) + this.html.drop.appendChild(this.html.dropScreen) + //Hide old select + this.html.drop.appendChild(this.html.select); + + //Core Events + var that = this; + this.html.dropDisplay.on('click', function(){ that.toggle() }); + this.html.dropScreen.on('click', function(){ that.toggle() }); + //Run Render + this.load() + this.preselect() + this.render(); + }, + toggle: function(){ + this.html.drop.classList.toggle('open'); + }, + addOption: function(e, element){ + var index = Number(element.dataset.index); + this.clearStates() + this.selected.push({ + index: Number(index), + state: 'add', + removed: false + }) + this.options[index].state = 'remove'; + this.render() + }, + removeOption: function(e, element){ + e.stopPropagation(); + this.clearStates() + var index = Number(element.dataset.index); + this.selected.forEach(function(select){ + if(select.index == index && !select.removed){ + select.removed = true + select.state = 'remove' + } + }) + this.options[index].state = 'add' + this.render(); + }, + load: function(){ + this.options = []; + for(var i = 0; i < this.html.options.length; i++){ + var option = this.html.options[i] + this.options[i] = { + html: option.innerHTML, + value: option.value, + selected: option.selected, + state: '' + } + } + }, + preselect: function(){ + var that = this; + this.selected = []; + this.preselected.forEach(function(pre){ + that.selected.push({ + index: pre, + state: 'add', + removed: false + }) + that.options[pre].state = 'remove'; + }) + }, + render: function(){ + this.renderDrop() + this.renderOptions() + }, + renderDrop: function(){ + var that = this; + var parentHTML = render.template('
') + this.selected.forEach(function(select, index){ + var option = that.options[select.index]; + var childHTML = render.template(''+ option.html +'') + var childCloseHTML = render.template( + '') + childCloseHTML.on('click', function(e){ that.removeOption(e, this) }) + childHTML.appendChild(childCloseHTML) + parentHTML.appendChild(childHTML) + }) + this.html.dropDisplay.innerHTML = ''; + this.html.dropDisplay.appendChild(parentHTML) + }, + renderOptions: function(){ + var that = this; + var parentHTML = render.template('
') + this.options.forEach(function(option, index){ + var childHTML = render.template( + ''+ option.html +'') + childHTML.on('click', function(e){ that.addOption(e, this) }) + parentHTML.appendChild(childHTML) + }) + this.html.dropOptions.innerHTML = ''; + this.html.dropOptions.appendChild(parentHTML) + }, + clearStates: function(){ + var that = this; + this.selected.forEach(function(select, index){ + select.state = that.changeState(select.state) + }) + this.options.forEach(function(option){ + option.state = that.changeState(option.state) + }) + }, + changeState: function(state){ + switch(state){ + case 'remove': + return 'hide' + case 'hide': + return 'hide' + default: + return '' + } + }, + isSelected: function(index){ + var check = false + this.selected.forEach(function(select){ + if(select.index == index && select.removed == false) check = true + }) + return check + } +}; o.init(); return o;} + + +//Set up some data +// var options = [ +// { html: 'cats', value: 'cats' }, +// { html: 'fish', value: 'fish' }, +// { html: 'squids', value: 'squids' }, +// { html: 'cats', value: 'whales' }, +// { html: 'cats', value: 'bikes' }, +// ]; + +// var myDrop = new drop({ +// selector: '#myMulti', +// preselected: [0, 2] +// }); +// myDrop.toggle(); \ No newline at end of file diff --git a/views/.DS_Store b/views/.DS_Store index b81324273de114c269f782168ab851ed2ff83465..224b407b8f33a3b3a55a9a7018aa8ad8183bbaca 100644 GIT binary patch delta 63 zcmZoMXffEJ$;9Y6S&ONK$uM^E1||g#smXgJY%-2G0y$!n-!XBqK?ElMV^U!}u-TCL O8q356zRm0$fB6B4Too|@ delta 63 zcmZoMXffEJ$;7BXS&ONKNm6|B1||iLAhSwom9!&{K#thtcT8Mt5P`}6m{b@SY&K-R O#xk*iZ!4; diff --git a/views/layout.ejs b/views/layout.ejs index 0d28cde..ba7bcbe 100644 --- a/views/layout.ejs +++ b/views/layout.ejs @@ -17,23 +17,31 @@ + + -
-
-
-
- <% if(locals.alert) {%> - + <%- body %> <% include partials/modal/modal-register %> <% include partials/modal/modal-reset-password %> diff --git a/views/partials/.DS_Store b/views/partials/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..e8459c9a3e81a6358fc1d03b6ac85b2cba09f8e7 GIT binary patch literal 6148 zcmeHKK~BRk5M0wB1vtAT>$_?ST_{5Rc%%7kC42;KuCQ z1e=5&5ujbk9%sF4PbNw>CL%Lh=0l=B5yfbX(I&bM<9Ti^TXP;xHoV5{dN{tQ%6ThN z9jbsT@EaA77oR4yqy-h>`@4M%!qLZES!LODR!!lHANu!${j2BGa6Vr-KQH`m!x3w- zK{-~xqk^VXVRTD*$l!6*9p!U*8#G)x)+?(|R;wdJeoxFVrV^|cbO~lR7|lXzTJ&ump($crBrt%Fx3+I?ZPdlJt2TwV_wE?&ORqB|noU!EItQ2YA|pk}kh zTNbrf1yli5pizLo4+$D$>aeybpAK|#1OP^Gi(xD^3Yf41m^!R2!UHol6=+k9J7O4{ z4u9g}Qirugn@&b{#yW0i<4!0>c85Qaa5AYy?NtF)AXK1dFZ*2o&%QtZhe>*+3aA4A zN&ypP<7|Xma<#Q}b6jf^v~x5zj;k$73OZMgWx%C)2Tcrf2@im&!`dP|F#Qn_8MIRc HepG>X<@SX# literal 0 HcmV?d00001 diff --git a/views/partials/dashboard/modal_form.ejs b/views/partials/dashboard/modal_form.ejs index ade4771..c579bc4 100644 --- a/views/partials/dashboard/modal_form.ejs +++ b/views/partials/dashboard/modal_form.ejs @@ -1,3 +1,4 @@ +