From 7b0fb579810bd9999a9f749a656b2e0a9cf8cacf Mon Sep 17 00:00:00 2001 From: Bayu Hendra Winata Date: Thu, 17 Nov 2022 11:46:11 +0700 Subject: [PATCH] split vendor and platform build --- public/js/platform.js | 1 + public/js/vendor.js | 1 + public/mix-manifest.json | 2 ++ webpack.mix.js | 17 +++++++++++++++++ 4 files changed, 21 insertions(+) create mode 100644 public/js/platform.js create mode 100644 public/js/vendor.js diff --git a/public/js/platform.js b/public/js/platform.js new file mode 100644 index 0000000..fd169b0 --- /dev/null +++ b/public/js/platform.js @@ -0,0 +1 @@ +$(function(){var e=$('[data-role="sidebar"]');if(e.length>0){new SimpleBar(e[0]);var t=$('[data-role="sidebar-visibility-switcher"]');t.length>0&&t.on("click",function(){e.parent().toggleClass("show")}),$(document).click(function(e){$("nav.sidebar").hasClass("show")&&($(e.target).closest("nav.sidebar").length||$(e.target).closest('[data-role="sidebar-visibility-switcher"]').length||$("nav.sidebar").removeClass("show"))})}$('[data-role="sidebar-accordion"]').accordion({selector:{trigger:".title:not(.empty)"}})}),$(function(){$("table.unstackable.responsive").basictable(),$(".ui.checkbox").checkbox(),$(".ui.dropdown:not(.tag)").dropdown({forceSelection:!1,fullTextSearch:"exact"}),$(".ui.dropdown.tag").each(function(){var e=$(this).data("value").toString().split(",");1==e.length&&""==e[0]&&(e=!1),$(this).dropdown({forceSelection:!1,allowAdditions:!0,keys:{delimiter:13}}).dropdown("set selected",e)}),$.fn.destroyDropdown=function(){return $(this).each(function(){$(this).parent().dropdown("destroy").replaceWith($(this).addClass($(this).data("class")))})};let e=[];for(var t of($("select[data-depend-on]").each(function(t,a){let o=$(a),n=o.data("depend-on");void 0===e[n]&&(e[n]=[]),e[n].push(o)}),Object.keys(e))){let a=$("[name="+t+"]"),o=e[t];a.destroyDropdown(),a.dropdown({forceSelection:!1,fullTextSearch:"exact",onChange:function(e,t,a){jQuery.each(o,function(t,a){if(e){let t=a.data("api"),o=a.data("payload");a.api({url:t,urlData:{parent:e,payload:o},on:"now",beforeSend:function(e){return a.dropdown("clear"),a.parent().addClass("loading"),e},onSuccess:function(e,t,o){let n=e.results;a.dropdown("change values",n)},onComplete:function(e,t,o){a.parent().removeClass("loading")}})}else a.dropdown("clear"),a.dropdown("setup menu",{values:[]})})}})}$('.checkbox[data-toggle="checkall"]').each(function(){var e=$(this),t=$(document).find(e.data("selector")),a=$(document).find(e.data("storage"));e.checkbox({onChecked:function(){t.checkbox("check")},onUnchecked:function(){t.checkbox("uncheck")}}),t.checkbox({fireOnInit:!0,onChange:function(){var o=e,n=!0,r=!0,i=[];t.each(function(){$(this).checkbox("is checked")?(r=!1,i.push($(this).children().first().val())):n=!1});var l=$('form[data-type="delete-multiple"]');if(l.length>0){var d=$('form[data-type="delete-multiple"]').attr("action"),c=d.lastIndexOf("/"),s=d.substr(0,c)+"/"+i.join(",");$('form[data-type="delete-multiple"]').attr("action",s)}a.length>0&&a.val(i.join(",")).trigger("change"),n?(o.checkbox("set checked"),l.find('[type="submit"]').removeClass("disabled")):r?(o.checkbox("set unchecked"),l.find('[type="submit"]').addClass("disabled")):(o.checkbox("set indeterminate"),l.find('[type="submit"]').removeClass("disabled"))}})}),$(".ui.input.calendar").each(function(e,t){var a=(t=$(t)).data("calendar-type");a||(a="date");var o=t.data("calendar-format");o||(o="YYYY-MM-DD"),t.calendar({type:a,ampm:!1,formatter:{date:function(e,t){if(!e)return"";e.getHours(),e.getMinutes(),e.getSeconds();var a=e.getDate(),n=d=("0"+e.getDate()).slice(-2),r=e.getMonth()+1,i=m=("0"+(e.getMonth()+1)).slice(-2),l=F=t.text.months[e.getMonth()],c=t.text.monthsShort[e.getMonth()],s=e.getFullYear().toString().substr(2,2),u=(e.getFullYear().toString().substr(2,2),e.getFullYear()),p=e.getFullYear();return o.replace("j",a).replace("d",d).replace("n",r).replace("m",m).replace("F",F).replace("M",c).replace("Y",u).replace("DD",n).replace("MMMM",l).replace("MM",i).replace("YYYY",p).replace("YY",s)}}})}),$("input[type=file].uploader").each(function(e,t){var a=$(t).data("extensions");a=a?a.split(","):null;var o=null;$(t).data("media-url")&&(o={url:$(t).data("media-url"),data:{_token:$(t).data("token"),_key:$(t).attr("name"),_action:"upload"},type:"POST",enctype:"multipart/form-data",start:!0,synchron:!0,chunk:!1,onSuccess:function(e,t,a,o,n,r,i,l){t.local=e.files[0].file,t.html.find(".fileuploader-action-remove").addClass("fileuploader-action-success"),setTimeout(function(){t.html.find(".progress-bar2").fadeOut(400)},400)},onError:function(e,t,a,o,n,r,i,l){var d=e.html.find(".progress-bar2");d.length>0&&(d.find("span").html("0%"),d.find(".fileuploader-progressbar .bar").width("0%"),e.html.find(".progress-bar2").fadeOut(400)),"cancelled"!=e.upload.status&&0==e.html.find(".fileuploader-action-retry").length&&e.html.find(".column-actions").prepend('')},onProgress:function(e,t,a,o,n,r){var i=t.html.find(".progress-bar2");i.length>0&&(i.show(),i.find("span").html(e.percentage+"%"),i.find(".fileuploader-progressbar .bar").width(e.percentage+"%"))},onComplete:function(e,t,a,o,n,r){}}),$(t).fileuploader({theme:"simple",limit:$(t).data("limit"),extensions:a,addMore:!0,upload:o,onRemove:function(e){return $(t).data("media-url")&&(console.log(e),$.post($(t).data("media-url"),{_token:$(t).data("token"),_action:"delete",file:e.file,id:e.data.id})),!0},changeInput:'
${captions.browse}
',captions:{browse:"Browse or drop files here"},thumbnails:{removeConfirmation:!1}})}),"function"==typeof AutoNumeric&&AutoNumeric.multiple('input[data-role="rupiah"]',{currencySymbol:"",decimalCharacter:",",digitGroupSeparator:".",decimalPlaces:0,unformatOnSubmit:!0}),jQuery().redactor&&$('[data-role="redactor"]').each(function(){$(this).redactor({plugins:["fontcolor","alignment","video","fullscreen","table"],toolbarFixedTopOffset:50,minHeight:"300px",imageUpload:$(this).data("upload-url"),imageResizable:!0,imagePosition:!0,imageData:{_token:$(this).data("token")},fontcolors:["#000000","#111111","#222222","#333333","#666666","#999999","#BBBBBB","#CCCCCC","#DDDDDD","#EEEEEE","#FFFFFF","#f44336","#f44336","#E91E63","#9C27B0","#673AB7","#3F51B5","#2196F3","#03A9F4","#00BCD4","#009688","#4CAF50","#8BC34A","#CDDC39","#FFC107","#FF9800","#FF5722","#FF0000","#b026fe","#0000ff","#00FF00","#fff000","#ff6000"]})}),"object"==typeof google&&"object"==typeof google.maps&&$("[data-form-coordinate]").each(function(){var e,t,a=$(this);[t,e]=a.val().split(","),t=t||-7.451808,e=e||111.035929;var o=$("
").css("width","100%").css("height",300).css("border-radius",4).css("margin-top","5px");o.insertAfter($(this));var n=new google.maps.LatLng(t,e),r={zoom:17,center:n,mapTypeId:google.maps.MapTypeId.ROADMAP},i=$(this).is("[disabled]");i&&$.extend(r,{gestureHandling:"none",zoomControl:!1});var l=new google.maps.Map(o[0],r),d=new google.maps.Marker({position:n,map:l,draggable:!i});google.maps.event.addListener(d,"drag",function(){a.val(d.position.lat()+","+d.position.lng())})})}),$(function(){key("⌘+k, ctrl+k",function(){$('[data-role="quick-switcher-modal"]').modal({onHide:function(){$('[data-role="quick-menu-searchbox"]').val("").trigger("keyup")}}).modal("show")}),$('[data-role="quick-menu-searchbox"]').on("keyup",function(e){var t=$(e.currentTarget).val();if($('[data-role="quick-menu-searchbox"]').val(t),$('[data-role="quick-menu"] .items').html(""),""==t)$('[data-role="original-menu"]').show();else{$('[data-role="original-menu"]').hide();var a=[];$('[data-role="original-menu"] a').each(function(e,t){a.push({text:$(t).html(),url:$(t).attr("href")})});var o=new Fuse(a,{tokenize:!0,threshold:.5,keys:["text"]}).search(t),n="";for(var r in o){var i=o[r];n+=""+i.text+""}$('[data-role="quick-menu"] .items').append(n)}});var e=$('[data-role="quick-switcher-dropdown"]');$('[data-role="original-menu"] a').each(function(t,a){var o=$(a).data("parent"),n=$(a).html();o&&(n+='
'+o+"
");var r=$("