diff --git a/plugins/bc-admin-third/src/bc_uploader/js/admin/uploader_files/index_panel.js b/plugins/bc-admin-third/src/bc_uploader/js/admin/uploader_files/index_panel.js index d4f47dcc0a..94a674bcbe 100755 --- a/plugins/bc-admin-third/src/bc_uploader/js/admin/uploader_files/index_panel.js +++ b/plugins/bc-admin-third/src/bc_uploader/js/admin/uploader_files/index_panel.js @@ -174,7 +174,11 @@ $(function () { cache: false, success: uploadSuccessHandler, error: function (response) { - $.bcUtil.showApiError(response); + if (response.responseJSON) { + $.bcUtil.showApiError(response); + } else { + $.bcUtil.showAlertMessage('処理中にエラーが発生しました。ファイルが大きすぎる可能性があります。'); + } $.bcUtil.hideLoader() }, }); diff --git a/plugins/bc-admin-third/webroot/bc_uploader/js/admin/uploader_files/index_panel.bundle.js b/plugins/bc-admin-third/webroot/bc_uploader/js/admin/uploader_files/index_panel.bundle.js index ce614435d4..714b6a1ea1 100644 --- a/plugins/bc-admin-third/webroot/bc_uploader/js/admin/uploader_files/index_panel.bundle.js +++ b/plugins/bc-admin-third/webroot/bc_uploader/js/admin/uploader_files/index_panel.bundle.js @@ -7,5 +7,5 @@ * @since 5.0.0 * @license https://basercms.net/license/index.html MIT License */ -$((function(){var e=$("#ListId").html();$("#ListId").remove();var l=$([]).add($("#name")).add($("#alt")),i=($.baseUrl(),$("#AdminPrefix").html(),null);function t(){var l=$.bcUtil.apiAdminBaseUrl+"bc-uploader/uploader_files/upload.json",i=$(this);$.bcUtil.showLoader(),$("#UploaderFileFile"+e).val()&&$.bcToken.check((function(){var t=new FormData;return t.append("file",i.prop("files")[0]),t.append("_csrfToken",$.bcToken.key),$("#UploaderFileUploaderCategoryId"+e).length&&t.append("uploader_category_id",$("#UploaderFileUploaderCategoryId"+e).val()),$.ajax({url:l,type:"post",data:t,dataType:"json",processData:!1,contentType:!1,cache:!1,success:a,error:function(e){$.bcUtil.showApiError(e),$.bcUtil.hideLoader()}})}),{useUpdate:!1,hideLoader:!1})}function a(l){l?($("#UploaderFileUploaderCategoryId"+e).length&&($("#FilterUploaderCategoryId"+e).val($("#UploaderFileUploaderCategoryId"+e).val()),i=$("#UploaderFileUploaderCategoryId"+e).val()),n()):($("#ErrorMessage").remove(),$("#FileList"+e).prepend('

'+bcI18n.uploaderAlertMessage2+"

"),$("#Waiting").hide()),$("#UploaderFileFile"+e).remove(),$("#SpanUploadFile"+e).append(''),$("#UploaderFileFile"+e).change(t),$.bcToken.key=null}function n(){$.bcUtil.ajax(function(){var l=$("#ListUrl"+e).attr("href"),i=[];$("#FilterUploaderCategoryId"+e).length?i.push("uploader_category_id="+$("#FilterUploaderCategoryId"+e).val()):i.push("uploader_category_id="),$('input[name="uploader_type"]:checked').length?i.push("uploader_type="+$('input[name="uploader_type"]:checked').val()):i.push("uploader_type=all"),$("#FilterName"+e).val()?i.push("name="+encodeURI($("#FilterName"+e).val())):i.push("name=");var t=location.search.match("limit=([0-9]+)");return t&&i.push("limit="+t[1]),i.length&&(l+="?"+i.join("&")),l}(),r,{hideLoader:!1,type:"GET"})}function o(e){var l=$("#LoginUserId").html(),i=$("#LoginUserGroupId").html(),t=Number($("#UsePermission").html()),a=!1;return 1!=i&&t&&l!=e&&(a=!0),a}function r(l){$("#FileList"+e).html(l),function(){$("#UsePermission").html(),i&&$("#UploaderFileUploaderCategoryId"+e).val(i),$(".selectable-file").unbind("click.selectEvent"),$(".selectable-file").unbind("mouseenter.selectEvent"),$(".selectable-file").unbind("mouseleave.selectEvent"),$(".page-numbers a").unbind("click.paginationEvent"),$(".selectable-file").unbind("dblclick.dblclickEvent"),$(".filter-control").unbind("click.filterEvent"),$(".btn-delete").unbind("click");var l="#bbb";$.fn.contextMenu&&!e&&$("#DivPanelList").length&&$("#DivPanelList").contextMenu({selector:".selectable-file",callback:s,build:function(e,l){var i=o($(e).find(".user-id").html());return{items:{edit:{name:bcI18n.uploaderEdit,icon:"edit",disabled:function(e,l){return i}},delete:{name:bcI18n.uploaderDelete,icon:"delete",disabled:function(e,l){return i}}}}}}),$("#DivPanelList .selectable-file").each((function(){$.fn.contextMenu&&!e?o($(this).find(".user-id").html())?$(this).bind("dblclick.dblclickEvent",(function(){alert(bcI18n.uploaderAlertMessage3)})):$(this).bind("dblclick.dblclickEvent",(function(){$("#EditDialog").dialog("open")})):$(this).bind("contextmenu",(function(e){return!1})),$(this).hasClass("unpublish")&&$(this).css("background-color",l)})),$("#UploaderFileFile"+e).change(t),e?($(".selectable-file").bind("mouseenter.selectEvent",(function(){$(this).css("background-color","#fffae7")})),$(".selectable-file").bind("mouseleave.selectEvent",(function(){$(this).css("background-color","#FFFFFF"),$(this).hasClass("unpublish")&&$(this).css("background-color",l)})),$(".selectable-file").each((function(){$(this).bind("mousedown",(function(){$(".selectable-file").removeClass("selected"),$(this).addClass("selected")}))}))):($("#DivPanelList .selectable-file").bind("mouseenter.selectEvent",(function(){$(this).css("background-color","#fffae7")})),$("#DivPanelList .selectable-file").bind("mouseleave.selectEvent",(function(){$(this).css("background-color","#FFFFFF"),$(this).hasClass("unpublish")&&$(this).css("background-color",l)})),$("#DivPanelList .selectable-file").each((function(){$(this).bind("mousedown",(function(){$(".selectable-file").removeClass("selected"),$(this).addClass("selected")}))}))),$(".page-numbers a").bind("click.paginationEvent",(function(){return $("#Waiting").show(),$.get($(this).attr("href"),r),!1})),$(".bca-list-num a").on("click.listNumEvent",(function(){return $("#Waiting").show(),$.get($(this).attr("href"),r),!1})),$("#FileList"+e).trigger("filelistload"),$("#FileList"+e).effect("highlight",{},1500)}(),$("#FileList"+e).trigger("loadTableComplete"),$("#Waiting").hide()}function s(l,i){var t=$("#FileList"+e+" .selected .id").html().trim(),a=$.bcUtil.apiAdminBaseUrl+"bc-uploader/uploader_files/delete/"+t+".json",o=l.indexOf("#");switch(-1!==o&&(l=l.substring(o+1,l.length)),l){case"edit":$("#EditDialog").dialog("open");break;case"delete":confirm(bcI18n.uploaderConfirmMessage1)&&$.bcToken.check((function(){$.ajax({url:a,headers:{"X-CSRF-Token":$.bcToken.key},type:"post",dataType:"json",beforeSend:function(){$("#Waiting").show()},success:function(){$("#FileList"+e).trigger("deletecomplete"),n()},error:function(){alert(bcI18n.uploaderAlertMessage4)},complete:function(){$("#Waiting").hide(),$.bcToken.key=null}})}),{useUpdate:!1,hideLoader:!1})}}n(),$("#BtnFilter").click((function(){return n(),!1})),$("#EditDialog").dialog({bgiframe:!0,autoOpen:!1,position:{at:"center center",of:window},width:960,modal:!0,open:function(){var l=$("#FileList"+e+" .selected .name").html();$("#UploaderFileImage"+e+" .uploader-file-image-inner").remove(),$("#UploadFileImageLoader"+e).show(),$("#UploaderFileId"+e).val($("#FileList"+e+" .selected .id").html().trim()),$("#UploaderFileName"+e).val(l),$("#UploaderFileAlt"+e).val($("#FileList"+e+" .selected .alt").html());var i=$("#FileList"+e+" .selected .publish-begin").html().trim(),t=$("#FileList"+e+" .selected .publish-begin-time").html().trim();$("#UploaderFilePublishBegin-date").val(i),$("#UploaderFilePublishBegin-time").val(t);var a=i;t&&(a+=" "+t),$("#UploaderFilePublishBegin").val(a);var n=$("#FileList"+e+" .selected .publish-end").html().trim(),o=$("#FileList"+e+" .selected .publish-end-time").html().trim();$("#UploaderFilePublishEnd-date").val(n),$("#UploaderFilePublishEnd-time").val(o);var r=n;o&&(r+=" "+o),$("#UploaderFilePublishEnd").val(r),$("#UploaderFileUserId"+e).val($("#FileList"+e+" .selected .user-id").html()),$("#UploaderFileUserName"+e).html($("#FileList"+e+" .selected .user-name").html()),$("#_UploaderFileUploaderCategoryId"+e).length&&$("#_UploaderFileUploaderCategoryId"+e).val($("#FileList"+e+" .selected .uploader-category-id").html()),$.ajax({url:$.bcUtil.adminBaseUrl+"bc-uploader/uploader_files/ajax_image/"+l+"/large",type:"get",dataType:"html",success:function(l){$("#UploadFileImageLoader"+e).hide(),$("#UploadFileImageLoader"+e).after(l)}})},buttons:{cancel:{text:bcI18n.uploaderCancel,click:function(){$(this).dialog("close")}},save:{text:bcI18n.uploaderSave,click:function(){var i=$(this),t=$("#UploaderFileId"+e).val();$.bcToken.check((function(){var a={id:t,name:$("#UploaderFileName"+e).val(),alt:$("#UploaderFileAlt"+e).val(),publish_begin:$("#UploaderFilePublishBegin"+e).val(),publish_end:$("#UploaderFilePublishEnd"+e).val(),user_id:$("#UploaderFileUserId"+e).val(),uploader_category_id:$("#_UploaderFileUploaderCategoryId"+e).val(),_csrfToken:$.bcToken.key};return $.ajax({url:$.bcUtil.apiAdminBaseUrl+"bc-uploader/uploader_files/edit/"+t+".json",type:"post",data:a,dataType:"json",success:function(){n(),l.removeClass("ui-state-error"),i.dialog("close")},error:function(e){var l={name:bcI18n.uploaderFile,publish_begin:bcI18n.uploaderPublishBegin,publish_end:bcI18n.uploaderPublishEnd},i=e.responseJSON.message;void 0!==e.responseJSON.errors&&(i+="\n",Object.keys(e.responseJSON.errors).forEach((function(t){Object.keys(e.responseJSON.errors[t]).forEach((function(a){i+="\n・"+l[t]+":"+e.responseJSON.errors[t][a]}))}))),alert(i)}})}),{hideLoader:!1,useUpdate:!1})}}},close:function(){l.val("").removeClass("ui-state-error")}})})); +$((function(){var e=$("#ListId").html();$("#ListId").remove();var l=$([]).add($("#name")).add($("#alt")),i=($.baseUrl(),$("#AdminPrefix").html(),null);function t(){var l=$.bcUtil.apiAdminBaseUrl+"bc-uploader/uploader_files/upload.json",i=$(this);$.bcUtil.showLoader(),$("#UploaderFileFile"+e).val()&&$.bcToken.check((function(){var t=new FormData;return t.append("file",i.prop("files")[0]),t.append("_csrfToken",$.bcToken.key),$("#UploaderFileUploaderCategoryId"+e).length&&t.append("uploader_category_id",$("#UploaderFileUploaderCategoryId"+e).val()),$.ajax({url:l,type:"post",data:t,dataType:"json",processData:!1,contentType:!1,cache:!1,success:a,error:function(e){e.responseJSON?$.bcUtil.showApiError(e):$.bcUtil.showAlertMessage("処理中にエラーが発生しました。ファイルが大きすぎる可能性があります。"),$.bcUtil.hideLoader()}})}),{useUpdate:!1,hideLoader:!1})}function a(l){l?($("#UploaderFileUploaderCategoryId"+e).length&&($("#FilterUploaderCategoryId"+e).val($("#UploaderFileUploaderCategoryId"+e).val()),i=$("#UploaderFileUploaderCategoryId"+e).val()),n()):($("#ErrorMessage").remove(),$("#FileList"+e).prepend('

'+bcI18n.uploaderAlertMessage2+"

"),$("#Waiting").hide()),$("#UploaderFileFile"+e).remove(),$("#SpanUploadFile"+e).append(''),$("#UploaderFileFile"+e).change(t),$.bcToken.key=null}function n(){$.bcUtil.ajax(function(){var l=$("#ListUrl"+e).attr("href"),i=[];$("#FilterUploaderCategoryId"+e).length?i.push("uploader_category_id="+$("#FilterUploaderCategoryId"+e).val()):i.push("uploader_category_id="),$('input[name="uploader_type"]:checked').length?i.push("uploader_type="+$('input[name="uploader_type"]:checked').val()):i.push("uploader_type=all"),$("#FilterName"+e).val()?i.push("name="+encodeURI($("#FilterName"+e).val())):i.push("name=");var t=location.search.match("limit=([0-9]+)");return t&&i.push("limit="+t[1]),i.length&&(l+="?"+i.join("&")),l}(),r,{hideLoader:!1,type:"GET"})}function o(e){var l=$("#LoginUserId").html(),i=$("#LoginUserGroupId").html(),t=Number($("#UsePermission").html()),a=!1;return 1!=i&&t&&l!=e&&(a=!0),a}function r(l){$("#FileList"+e).html(l),function(){$("#UsePermission").html(),i&&$("#UploaderFileUploaderCategoryId"+e).val(i),$(".selectable-file").unbind("click.selectEvent"),$(".selectable-file").unbind("mouseenter.selectEvent"),$(".selectable-file").unbind("mouseleave.selectEvent"),$(".page-numbers a").unbind("click.paginationEvent"),$(".selectable-file").unbind("dblclick.dblclickEvent"),$(".filter-control").unbind("click.filterEvent"),$(".btn-delete").unbind("click");var l="#bbb";$.fn.contextMenu&&!e&&$("#DivPanelList").length&&$("#DivPanelList").contextMenu({selector:".selectable-file",callback:s,build:function(e,l){var i=o($(e).find(".user-id").html());return{items:{edit:{name:bcI18n.uploaderEdit,icon:"edit",disabled:function(e,l){return i}},delete:{name:bcI18n.uploaderDelete,icon:"delete",disabled:function(e,l){return i}}}}}}),$("#DivPanelList .selectable-file").each((function(){$.fn.contextMenu&&!e?o($(this).find(".user-id").html())?$(this).bind("dblclick.dblclickEvent",(function(){alert(bcI18n.uploaderAlertMessage3)})):$(this).bind("dblclick.dblclickEvent",(function(){$("#EditDialog").dialog("open")})):$(this).bind("contextmenu",(function(e){return!1})),$(this).hasClass("unpublish")&&$(this).css("background-color",l)})),$("#UploaderFileFile"+e).change(t),e?($(".selectable-file").bind("mouseenter.selectEvent",(function(){$(this).css("background-color","#fffae7")})),$(".selectable-file").bind("mouseleave.selectEvent",(function(){$(this).css("background-color","#FFFFFF"),$(this).hasClass("unpublish")&&$(this).css("background-color",l)})),$(".selectable-file").each((function(){$(this).bind("mousedown",(function(){$(".selectable-file").removeClass("selected"),$(this).addClass("selected")}))}))):($("#DivPanelList .selectable-file").bind("mouseenter.selectEvent",(function(){$(this).css("background-color","#fffae7")})),$("#DivPanelList .selectable-file").bind("mouseleave.selectEvent",(function(){$(this).css("background-color","#FFFFFF"),$(this).hasClass("unpublish")&&$(this).css("background-color",l)})),$("#DivPanelList .selectable-file").each((function(){$(this).bind("mousedown",(function(){$(".selectable-file").removeClass("selected"),$(this).addClass("selected")}))}))),$(".page-numbers a").bind("click.paginationEvent",(function(){return $("#Waiting").show(),$.get($(this).attr("href"),r),!1})),$(".bca-list-num a").on("click.listNumEvent",(function(){return $("#Waiting").show(),$.get($(this).attr("href"),r),!1})),$("#FileList"+e).trigger("filelistload"),$("#FileList"+e).effect("highlight",{},1500)}(),$("#FileList"+e).trigger("loadTableComplete"),$("#Waiting").hide()}function s(l,i){var t=$("#FileList"+e+" .selected .id").html().trim(),a=$.bcUtil.apiAdminBaseUrl+"bc-uploader/uploader_files/delete/"+t+".json",o=l.indexOf("#");switch(-1!==o&&(l=l.substring(o+1,l.length)),l){case"edit":$("#EditDialog").dialog("open");break;case"delete":confirm(bcI18n.uploaderConfirmMessage1)&&$.bcToken.check((function(){$.ajax({url:a,headers:{"X-CSRF-Token":$.bcToken.key},type:"post",dataType:"json",beforeSend:function(){$("#Waiting").show()},success:function(){$("#FileList"+e).trigger("deletecomplete"),n()},error:function(){alert(bcI18n.uploaderAlertMessage4)},complete:function(){$("#Waiting").hide(),$.bcToken.key=null}})}),{useUpdate:!1,hideLoader:!1})}}n(),$("#BtnFilter").click((function(){return n(),!1})),$("#EditDialog").dialog({bgiframe:!0,autoOpen:!1,position:{at:"center center",of:window},width:960,modal:!0,open:function(){var l=$("#FileList"+e+" .selected .name").html();$("#UploaderFileImage"+e+" .uploader-file-image-inner").remove(),$("#UploadFileImageLoader"+e).show(),$("#UploaderFileId"+e).val($("#FileList"+e+" .selected .id").html().trim()),$("#UploaderFileName"+e).val(l),$("#UploaderFileAlt"+e).val($("#FileList"+e+" .selected .alt").html());var i=$("#FileList"+e+" .selected .publish-begin").html().trim(),t=$("#FileList"+e+" .selected .publish-begin-time").html().trim();$("#UploaderFilePublishBegin-date").val(i),$("#UploaderFilePublishBegin-time").val(t);var a=i;t&&(a+=" "+t),$("#UploaderFilePublishBegin").val(a);var n=$("#FileList"+e+" .selected .publish-end").html().trim(),o=$("#FileList"+e+" .selected .publish-end-time").html().trim();$("#UploaderFilePublishEnd-date").val(n),$("#UploaderFilePublishEnd-time").val(o);var r=n;o&&(r+=" "+o),$("#UploaderFilePublishEnd").val(r),$("#UploaderFileUserId"+e).val($("#FileList"+e+" .selected .user-id").html()),$("#UploaderFileUserName"+e).html($("#FileList"+e+" .selected .user-name").html()),$("#_UploaderFileUploaderCategoryId"+e).length&&$("#_UploaderFileUploaderCategoryId"+e).val($("#FileList"+e+" .selected .uploader-category-id").html()),$.ajax({url:$.bcUtil.adminBaseUrl+"bc-uploader/uploader_files/ajax_image/"+l+"/large",type:"get",dataType:"html",success:function(l){$("#UploadFileImageLoader"+e).hide(),$("#UploadFileImageLoader"+e).after(l)}})},buttons:{cancel:{text:bcI18n.uploaderCancel,click:function(){$(this).dialog("close")}},save:{text:bcI18n.uploaderSave,click:function(){var i=$(this),t=$("#UploaderFileId"+e).val();$.bcToken.check((function(){var a={id:t,name:$("#UploaderFileName"+e).val(),alt:$("#UploaderFileAlt"+e).val(),publish_begin:$("#UploaderFilePublishBegin"+e).val(),publish_end:$("#UploaderFilePublishEnd"+e).val(),user_id:$("#UploaderFileUserId"+e).val(),uploader_category_id:$("#_UploaderFileUploaderCategoryId"+e).val(),_csrfToken:$.bcToken.key};return $.ajax({url:$.bcUtil.apiAdminBaseUrl+"bc-uploader/uploader_files/edit/"+t+".json",type:"post",data:a,dataType:"json",success:function(){n(),l.removeClass("ui-state-error"),i.dialog("close")},error:function(e){var l={name:bcI18n.uploaderFile,publish_begin:bcI18n.uploaderPublishBegin,publish_end:bcI18n.uploaderPublishEnd},i=e.responseJSON.message;void 0!==e.responseJSON.errors&&(i+="\n",Object.keys(e.responseJSON.errors).forEach((function(t){Object.keys(e.responseJSON.errors[t]).forEach((function(a){i+="\n・"+l[t]+":"+e.responseJSON.errors[t][a]}))}))),alert(i)}})}),{hideLoader:!1,useUpdate:!1})}}},close:function(){l.val("").removeClass("ui-state-error")}})})); //# sourceMappingURL=index_panel.bundle.js.map \ No newline at end of file diff --git a/plugins/bc-admin-third/webroot/bc_uploader/js/admin/uploader_files/index_panel.bundle.js.map b/plugins/bc-admin-third/webroot/bc_uploader/js/admin/uploader_files/index_panel.bundle.js.map index bc7b52c12b..99d4ceb377 100644 --- a/plugins/bc-admin-third/webroot/bc_uploader/js/admin/uploader_files/index_panel.bundle.js.map +++ b/plugins/bc-admin-third/webroot/bc_uploader/js/admin/uploader_files/index_panel.bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"bc_uploader/js/admin/uploader_files/index_panel.bundle.js","mappings":";;;;;;;;;AAaAA,GAAE,WAEE,IAAIC,EAASD,EAAE,WAAWE,OAM1BF,EAAE,WAAWG,SAEb,IAAIC,EAAYJ,EAAE,IAAIK,IAAIL,EAAE,UAAUK,IAAIL,EAAE,SAGxCM,GAFUN,EAAEO,UACEP,EAAE,gBAAgBE,OACnB,MAgIjB,SAASM,IACL,IAAIC,EAAMT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AAS+G,aAAaD,aACAE,IAAjChH,EAAS+G,aAAaE,SACrBH,GAAW,KACXI,OAAOC,KAAKnH,EAAS+G,aAAaE,QAAQG,SAAQ,SAAUhI,GACxD8H,OAAOC,KAAKnH,EAAS+G,aAAaE,OAAO7H,IAAMgI,SAAQ,SAAUC,GAC7DP,GAAW,MAAQN,EAAOpH,GAAO,IAAMY,EAAS+G,aAAaE,OAAO7H,GAAKiI,EAC7E,GACJ,KAEJjE,MAAM0D,EACV,GAER,GAAG,CAAC5G,YAAY,EAAOC,WAAW,GACtC,IAGRmH,MAAO,WACHpJ,EAAUW,IAAI,IAAI4E,YAAY,iBAClC,GAgUR","sources":["webpack://bc-admin-third/./src/bc_uploader/js/admin/uploader_files/index_panel.js"],"sourcesContent":["/**\n * baserCMS : Based Website Development Project \n * Copyright (c) NPO baser foundation \n *\n * @copyright Copyright (c) NPO baser foundation\n * @link https://basercms.net baserCMS Project\n * @since 5.0.0\n * @license https://basercms.net/license/index.html MIT License\n */\n\n/**\n * 起動時処理\n */\n$(function () {\n\n var listId = $(\"#ListId\").html();\n\n //==========================================================================\n // 複数のエディタよりリストが呼出される可能性がある為、#ListIdの値を読み込んだら削除する\n // TODO 強引すぎるので他の方法がないか検討要\n //==========================================================================\n $(\"#ListId\").remove();\n\n var allFields = $([]).add($(\"#name\")).add($(\"#alt\"));\n var baseUrl = $.baseUrl() + '/';\n var adminPrefix = $(\"#AdminPrefix\").html();\n var categoryId = null;\n\n // 一覧を更新する\n updateFileList();\n\n $(\"#BtnFilter\").click(function(){\n updateFileList();\n return false;\n });\n\n /* ダイアログを初期化 */\n $(\"#EditDialog\").dialog({\n bgiframe: true,\n autoOpen: false,\n position: {at: \"center center\", of: window},\n width: 960,\n modal: true,\n open: function () {\n var name = $(\"#FileList\" + listId + \" .selected .name\").html();\n $(\"#UploaderFileImage\" + listId + ' .uploader-file-image-inner').remove();\n $(\"#UploadFileImageLoader\" + listId).show();\n $(\"#UploaderFileId\" + listId).val($(\"#FileList\" + listId + \" .selected .id\").html().trim());\n $(\"#UploaderFileName\" + listId).val(name);\n $(\"#UploaderFileAlt\" + listId).val($(\"#FileList\" + listId + \" .selected .alt\").html());\n\n /* ダイアログ初期化時、hidden値が空になるため公開期間開始日時を取得して hidden値に入れ込む */\n var publishBeginDate = $(\"#FileList\" + listId + \" .selected .publish-begin\").html().trim();\n var publishBeginTime = $(\"#FileList\" + listId + \" .selected .publish-begin-time\").html().trim();\n $(\"#UploaderFilePublishBegin-date\").val(publishBeginDate);\n $(\"#UploaderFilePublishBegin-time\").val(publishBeginTime);\n var publishBeginDateTime = publishBeginDate;\n if (publishBeginTime) {\n publishBeginDateTime += ' ' + publishBeginTime;\n }\n $(\"#UploaderFilePublishBegin\").val(publishBeginDateTime);\n\n /* ダイアログ初期化時、hidden値が空になるため公開期間終了日時を取得して hidden値に入れ込む */\n var publishEndDate = $(\"#FileList\" + listId + \" .selected .publish-end\").html().trim();\n var publishEndTime = $(\"#FileList\" + listId + \" .selected .publish-end-time\").html().trim();\n $(\"#UploaderFilePublishEnd-date\").val(publishEndDate);\n $(\"#UploaderFilePublishEnd-time\").val(publishEndTime);\n var publishEndDateTime = publishEndDate;\n if (publishEndTime) {\n publishEndDateTime += ' ' + publishEndTime;\n }\n $(\"#UploaderFilePublishEnd\").val(publishEndDateTime);\n\n $(\"#UploaderFileUserId\" + listId).val($(\"#FileList\" + listId + \" .selected .user-id\").html());\n $(\"#UploaderFileUserName\" + listId).html($(\"#FileList\" + listId + \" .selected .user-name\").html());\n if ($(\"#_UploaderFileUploaderCategoryId\" + listId).length) {\n $(\"#_UploaderFileUploaderCategoryId\" + listId).val($(\"#FileList\" + listId + \" .selected .uploader-category-id\").html());\n }\n $.ajax({\n url: $.bcUtil.adminBaseUrl + 'bc-uploader/uploader_files/ajax_image/' + name + '/large',\n type: 'get',\n dataType: 'html',\n success: function (res) {\n $(\"#UploadFileImageLoader\" + listId).hide();\n $(\"#UploadFileImageLoader\" + listId).after(res);\n }\n });\n },\n buttons: {\n cancel: {\n text: bcI18n.uploaderCancel,\n click: function () {\n $(this).dialog('close');\n }\n },\n save: {\n text: bcI18n.uploaderSave,\n click: function () {\n // 保存処理\n let saveButton = $(this);\n let id = $(\"#UploaderFileId\" + listId).val();\n $.bcToken.check(function () {\n // IEでform.serializeを利用した場合、Formタグの中にTableタグがあるとデータが取得できなかった\n var data = {\n \"id\": id,\n \"name\": $(\"#UploaderFileName\" + listId).val(),\n \"alt\": $(\"#UploaderFileAlt\" + listId).val(),\n \"publish_begin\": $(\"#UploaderFilePublishBegin\" + listId).val(),\n \"publish_end\": $(\"#UploaderFilePublishEnd\" + listId).val(),\n \"user_id\": $(\"#UploaderFileUserId\" + listId).val(),\n \"uploader_category_id\": $(\"#_UploaderFileUploaderCategoryId\" + listId).val(),\n \"_csrfToken\": $.bcToken.key\n };\n return $.ajax({\n url: $.bcUtil.apiAdminBaseUrl + 'bc-uploader/uploader_files/edit/' + id + '.json',\n type: 'post',\n data: data,\n dataType: 'json',\n success: function () {\n updateFileList();\n allFields.removeClass('ui-state-error');\n saveButton.dialog('close');\n },\n error: function (response) {\n const fields = {\n name: bcI18n.uploaderFile,\n publish_begin: bcI18n.uploaderPublishBegin,\n publish_end: bcI18n.uploaderPublishEnd\n };\n let message = response.responseJSON.message;\n if(response.responseJSON.errors !== undefined) {\n message += \"\\n\";\n Object.keys(response.responseJSON.errors).forEach(function (key) {\n Object.keys(response.responseJSON.errors[key]).forEach(function (field) {\n message += \"\\n・\" + fields[key] + ':' + response.responseJSON.errors[key][field];\n });\n });\n }\n alert(message);\n }\n });\n }, {hideLoader: false, useUpdate: false});\n }\n }\n },\n close: function () {\n allFields.val('').removeClass('ui-state-error');\n }\n\n });\n\n /**\n * アップロードファイル選択時イベント\n */\n function uploaderFileFileChangeHandler() {\n var url = $.bcUtil.apiAdminBaseUrl + 'bc-uploader/uploader_files/upload.json';\n var $file = $(this);\n $.bcUtil.showLoader();\n if ($('#UploaderFileFile' + listId).val()) {\n $.bcToken.check(function () {\n let fd = new FormData();\n fd.append('file', $file.prop('files')[0]);\n fd.append('_csrfToken', $.bcToken.key);\n if ($(\"#UploaderFileUploaderCategoryId\" + listId).length) {\n fd.append('uploader_category_id', $(\"#UploaderFileUploaderCategoryId\" + listId).val());\n }\n return $.ajax({\n url: url,\n type: 'post',\n data: fd,\n dataType: 'json',\n processData: false,\n contentType: false,\n cache: false,\n success: uploadSuccessHandler,\n error: function (response) {\n $.bcUtil.showApiError(response);\n $.bcUtil.hideLoader()\n },\n });\n }, {useUpdate: false, hideLoader: false});\n }\n }\n\n /**\n * アップロード完了後イベント\n */\n function uploadSuccessHandler(res) {\n\n if (res) {\n if ($('#UploaderFileUploaderCategoryId' + listId).length) {\n $('#FilterUploaderCategoryId' + listId).val($('#UploaderFileUploaderCategoryId' + listId).val());\n categoryId = $('#UploaderFileUploaderCategoryId' + listId).val();\n }\n updateFileList();\n } else {\n $('#ErrorMessage').remove();\n $('#FileList' + listId).prepend('

' + bcI18n.uploaderAlertMessage2 + '

');\n $(\"#Waiting\").hide();\n }\n // フォームを初期化\n // セキュリティ上の関係でvalue値を直接消去する事はできないので、一旦エレメントごと削除し、\n // spanタグ内に新しく作りなおす。\n $(\"#UploaderFileFile\" + listId).remove();\n $(\"#SpanUploadFile\" + listId).append('');\n $('#UploaderFileFile' + listId).change(uploaderFileFileChangeHandler);\n $.bcToken.key = null;\n\n }\n\n /**\n * 一覧を更新する\n */\n function updateFileList() {\n $.bcUtil.ajax(getListUrl(), updateFileListCompleteHander, {hideLoader: false, type: 'GET'});\n }\n\n /**\n * 指定したファイルの編集ができない状態か確認\n *\n * @param fileUserId\n * @returns {boolean}\n */\n function isFileEditDisabled(fileUserId) {\n var loginUserId = $(\"#LoginUserId\").html();\n var loginUserGroupId = $(\"#LoginUserGroupId\").html();\n var usePermission = Number($(\"#UsePermission\").html());\n var disabled = false;\n if (loginUserGroupId != 1 && usePermission) {\n if (loginUserId != fileUserId) {\n disabled = true;\n }\n }\n return disabled;\n }\n\n /**\n * 選択イベントを初期化する\n */\n function initFileList() {\n\n var usePermission = $(\"#UsePermission\").html();\n\n if (categoryId) {\n $('#UploaderFileUploaderCategoryId' + listId).val(categoryId);\n }\n /* 一旦イベントを全て解除 */\n $(\".selectable-file\").unbind('click.selectEvent');\n $(\".selectable-file\").unbind('mouseenter.selectEvent');\n $(\".selectable-file\").unbind('mouseleave.selectEvent');\n $(\".page-numbers a\").unbind('click.paginationEvent');\n $(\".selectable-file\").unbind('dblclick.dblclickEvent');\n $(\".filter-control\").unbind('click.filterEvent');\n $(\".btn-delete\").unbind('click');\n\n /* 公開制限期間にあるファイルの背景色を定義 */\n var unpublishBackGroundColor = '#bbb';\n\n if ($.fn.contextMenu && !listId && $(\"#DivPanelList\").length) {\n /* 右クリックメニューを追加 */\n $(\"#DivPanelList\").contextMenu({\n selector: '.selectable-file',\n callback: contextMenuHander,\n build: function ($trigger, e) {\n var disabled = isFileEditDisabled($($trigger).find('.user-id').html());\n return {\n items: {\n edit: {\n name: bcI18n.uploaderEdit,\n icon: 'edit',\n disabled: function (key, opt) {\n return disabled;\n }\n },\n delete: {\n name: bcI18n.uploaderDelete,\n icon: 'delete',\n disabled: function (key, opt) {\n return disabled;\n }\n }\n }\n }\n }\n });\n }\n\n $(\"#DivPanelList .selectable-file\").each(function () {\n\n if ($.fn.contextMenu && !listId) {\n if (!isFileEditDisabled($(this).find('.user-id').html())) {\n $(this).bind('dblclick.dblclickEvent', function () {\n $('#EditDialog').dialog('open');\n });\n } else {\n $(this).bind('dblclick.dblclickEvent', function () {\n alert(bcI18n.uploaderAlertMessage3);\n });\n }\n } else {\n $(this).bind(\"contextmenu\", function (e) {\n return false;\n });\n }\n\n /* 公開制限期間にあるファイルは背景色をグレーにする */\n if ($(this).hasClass('unpublish')) {\n $(this).css('background-color', unpublishBackGroundColor);\n }\n });\n\n // ファイルアップロードイベントを登録\n $('#UploaderFileFile' + listId).change(uploaderFileFileChangeHandler);\n\n if (listId) {\n $(\".selectable-file\").bind('mouseenter.selectEvent', function () {\n $(this).css('background-color', '#fffae7');\n });\n $(\".selectable-file\").bind('mouseleave.selectEvent', function () {\n $(this).css('background-color', '#FFFFFF');\n if ($(this).hasClass('unpublish')) {\n $(this).css('background-color', unpublishBackGroundColor);\n }\n });\n $(\".selectable-file\").each(function () {\n // IEの場合contextmenuを検出できなかったので、mousedownに変更した\n $(this).bind('mousedown', function () {\n $(\".selectable-file\").removeClass('selected');\n $(this).addClass('selected');\n });\n });\n } else {\n $(\"#DivPanelList .selectable-file\").bind('mouseenter.selectEvent', function () {\n $(this).css('background-color', '#fffae7');\n });\n $(\"#DivPanelList .selectable-file\").bind('mouseleave.selectEvent', function () {\n $(this).css('background-color', '#FFFFFF');\n if ($(this).hasClass('unpublish')) {\n $(this).css('background-color', unpublishBackGroundColor);\n }\n });\n $(\"#DivPanelList .selectable-file\").each(function () {\n // IEの場合contextmenuを検出できなかったので、mousedownに変更した\n $(this).bind('mousedown', function () {\n $(\".selectable-file\").removeClass('selected');\n $(this).addClass('selected');\n });\n });\n }\n\n /* ページネーションイベントを追加 */\n $('.page-numbers a').bind('click.paginationEvent', function () {\n $(\"#Waiting\").show();\n $.get($(this).attr('href'), updateFileListCompleteHander);\n return false;\n });\n\n $('.bca-list-num a').on('click.listNumEvent', function(){\n $(\"#Waiting\").show();\n $.get($(this).attr('href'), updateFileListCompleteHander);\n return false;\n });\n\n /*$('#FilterUploaderCategoryId'+listId).bind('change.filterEvent', function() {\n $(\"#Waiting\").show();\n $.get(getListUrl(),updateFileListCompleteHander);\n });\n $('input[name=\"data[Filter][uploader_type]\"]').bind('click.filterEvent', function() {\n $(\"#Waiting\").show();\n $.get(getListUrl(),updateFileListCompleteHander);\n });*/\n\n $(\"#FileList\" + listId).trigger(\"filelistload\");\n $(\"#FileList\" + listId).effect(\"highlight\", {}, 1500);\n\n }\n\n /**\n * ファイルリスト取得完了イベント\n */\n function updateFileListCompleteHander(result) {\n\n $(\"#FileList\" + listId).html(result);\n initFileList();\n $(\"#FileList\" + listId).trigger('loadTableComplete');\n $(\"#Waiting\").hide();\n\n }\n\n /**\n * Ajax List 取得用のURLを取得する\n */\n function getListUrl() {\n let listUrl = $(\"#ListUrl\" + listId).attr('href');\n let query = [];\n if ($('#FilterUploaderCategoryId' + listId).length) {\n query.push('uploader_category_id=' + $('#FilterUploaderCategoryId' + listId).val());\n } else {\n query.push('uploader_category_id=');\n }\n if ($('input[name=\"uploader_type\"]:checked').length) {\n query.push('uploader_type=' + $('input[name=\"uploader_type\"]:checked').val());\n } else {\n query.push('uploader_type=all');\n }\n if ($('#FilterName' + listId).val()) {\n query.push('name=' + encodeURI($('#FilterName' + listId).val()));\n } else {\n query.push('name=');\n }\n const num = location.search.match('limit=([0-9]+)');\n if(num) {\n query.push('limit=' + num[1]);\n }\n if (query.length) {\n listUrl += '?' + query.join('&');\n }\n return listUrl;\n }\n\n /**\n * コンテキストメニューハンドラ\n */\n function contextMenuHander(action, el) {\n let id = $(\"#FileList\" + listId + \" .selected .id\").html().trim();\n let delUrl = $.bcUtil.apiAdminBaseUrl + 'bc-uploader/uploader_files/delete/' + id + '.json';\n\n // IEの場合、action値が正常に取得できないので整形する\n let pos = action.indexOf(\"#\");\n if (pos !== -1) action = action.substring(pos + 1, action.length);\n\n switch (action) {\n case 'edit':\n $('#EditDialog').dialog('open');\n break;\n\n case 'delete':\n if (confirm(bcI18n.uploaderConfirmMessage1)) {\n $.bcToken.check(function () {\n $.ajax({\n url: delUrl,\n headers: {\n \"X-CSRF-Token\": $.bcToken.key,\n },\n type: 'post',\n dataType: 'json',\n beforeSend: function() {\n $(\"#Waiting\").show();\n },\n success: function () {\n $(\"#FileList\" + listId).trigger(\"deletecomplete\");\n updateFileList();\n },\n error: function () {\n alert(bcI18n.uploaderAlertMessage4);\n },\n complete: function(){\n $(\"#Waiting\").hide();\n $.bcToken.key = null;\n }\n });\n }, {useUpdate: false, hideLoader: false});\n }\n break;\n }\n }\n\n});\n"],"names":["$","listId","html","remove","allFields","add","categoryId","baseUrl","uploaderFileFileChangeHandler","url","bcUtil","apiAdminBaseUrl","$file","this","showLoader","val","bcToken","check","fd","FormData","append","prop","key","length","ajax","type","data","dataType","processData","contentType","cache","success","uploadSuccessHandler","error","response","showApiError","hideLoader","useUpdate","res","updateFileList","prepend","bcI18n","uploaderAlertMessage2","hide","change","listUrl","attr","query","push","encodeURI","num","location","search","match","join","getListUrl","updateFileListCompleteHander","isFileEditDisabled","fileUserId","loginUserId","loginUserGroupId","usePermission","Number","disabled","result","unbind","unpublishBackGroundColor","fn","contextMenu","selector","callback","contextMenuHander","build","$trigger","e","find","items","edit","name","uploaderEdit","icon","opt","delete","uploaderDelete","each","bind","alert","uploaderAlertMessage3","dialog","hasClass","css","removeClass","addClass","show","get","on","trigger","effect","initFileList","action","el","id","trim","delUrl","pos","indexOf","substring","confirm","uploaderConfirmMessage1","headers","beforeSend","uploaderAlertMessage4","complete","click","bgiframe","autoOpen","position","at","of","window","width","modal","open","publishBeginDate","publishBeginTime","publishBeginDateTime","publishEndDate","publishEndTime","publishEndDateTime","adminBaseUrl","after","buttons","cancel","text","uploaderCancel","save","uploaderSave","saveButton","fields","uploaderFile","publish_begin","uploaderPublishBegin","publish_end","uploaderPublishEnd","message","responseJSON","undefined","errors","Object","keys","forEach","field","close"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"bc_uploader/js/admin/uploader_files/index_panel.bundle.js","mappings":";;;;;;;;;AAaAA,GAAE,WAEE,IAAIC,EAASD,EAAE,WAAWE,OAM1BF,EAAE,WAAWG,SAEb,IAAIC,EAAYJ,EAAE,IAAIK,IAAIL,EAAE,UAAUK,IAAIL,EAAE,SAGxCM,GAFUN,EAAEO,UACEP,EAAE,gBAAgBE,OACnB,MAgIjB,SAASM,IACL,IAAIC,EAAMT,EAAEU,OAAOC,gBAAkB,yCACjCC,EAAQZ,EAAEa,MACdb,EAAEU,OAAOI,aACLd,EAAE,oBAAsBC,GAAQc,OAChCf,EAAEgB,QAAQC,OAAM,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AASC,aAAaiH,QAAQG,SAAQ,SAAUjI,GACxD+H,OAAOC,KAAKpH,EAASC,aAAaiH,OAAO9H,IAAMiI,SAAQ,SAAUC,GAC7DN,GAAW,MAAQN,EAAOtH,GAAO,IAAMY,EAASC,aAAaiH,OAAO9H,GAAKkI,EAC7E,GACJ,KAEJhE,MAAM0D,EACV,GAER,GAAG,CAAC5G,YAAY,EAAOC,WAAW,GACtC,IAGRkH,MAAO,WACHrJ,EAAUW,IAAI,IAAI8E,YAAY,iBAClC,GAoUR","sources":["webpack://bc-admin-third/./src/bc_uploader/js/admin/uploader_files/index_panel.js"],"sourcesContent":["/**\n * baserCMS : Based Website Development Project \n * Copyright (c) NPO baser foundation \n *\n * @copyright Copyright (c) NPO baser foundation\n * @link https://basercms.net baserCMS Project\n * @since 5.0.0\n * @license https://basercms.net/license/index.html MIT License\n */\n\n/**\n * 起動時処理\n */\n$(function () {\n\n var listId = $(\"#ListId\").html();\n\n //==========================================================================\n // 複数のエディタよりリストが呼出される可能性がある為、#ListIdの値を読み込んだら削除する\n // TODO 強引すぎるので他の方法がないか検討要\n //==========================================================================\n $(\"#ListId\").remove();\n\n var allFields = $([]).add($(\"#name\")).add($(\"#alt\"));\n var baseUrl = $.baseUrl() + '/';\n var adminPrefix = $(\"#AdminPrefix\").html();\n var categoryId = null;\n\n // 一覧を更新する\n updateFileList();\n\n $(\"#BtnFilter\").click(function(){\n updateFileList();\n return false;\n });\n\n /* ダイアログを初期化 */\n $(\"#EditDialog\").dialog({\n bgiframe: true,\n autoOpen: false,\n position: {at: \"center center\", of: window},\n width: 960,\n modal: true,\n open: function () {\n var name = $(\"#FileList\" + listId + \" .selected .name\").html();\n $(\"#UploaderFileImage\" + listId + ' .uploader-file-image-inner').remove();\n $(\"#UploadFileImageLoader\" + listId).show();\n $(\"#UploaderFileId\" + listId).val($(\"#FileList\" + listId + \" .selected .id\").html().trim());\n $(\"#UploaderFileName\" + listId).val(name);\n $(\"#UploaderFileAlt\" + listId).val($(\"#FileList\" + listId + \" .selected .alt\").html());\n\n /* ダイアログ初期化時、hidden値が空になるため公開期間開始日時を取得して hidden値に入れ込む */\n var publishBeginDate = $(\"#FileList\" + listId + \" .selected .publish-begin\").html().trim();\n var publishBeginTime = $(\"#FileList\" + listId + \" .selected .publish-begin-time\").html().trim();\n $(\"#UploaderFilePublishBegin-date\").val(publishBeginDate);\n $(\"#UploaderFilePublishBegin-time\").val(publishBeginTime);\n var publishBeginDateTime = publishBeginDate;\n if (publishBeginTime) {\n publishBeginDateTime += ' ' + publishBeginTime;\n }\n $(\"#UploaderFilePublishBegin\").val(publishBeginDateTime);\n\n /* ダイアログ初期化時、hidden値が空になるため公開期間終了日時を取得して hidden値に入れ込む */\n var publishEndDate = $(\"#FileList\" + listId + \" .selected .publish-end\").html().trim();\n var publishEndTime = $(\"#FileList\" + listId + \" .selected .publish-end-time\").html().trim();\n $(\"#UploaderFilePublishEnd-date\").val(publishEndDate);\n $(\"#UploaderFilePublishEnd-time\").val(publishEndTime);\n var publishEndDateTime = publishEndDate;\n if (publishEndTime) {\n publishEndDateTime += ' ' + publishEndTime;\n }\n $(\"#UploaderFilePublishEnd\").val(publishEndDateTime);\n\n $(\"#UploaderFileUserId\" + listId).val($(\"#FileList\" + listId + \" .selected .user-id\").html());\n $(\"#UploaderFileUserName\" + listId).html($(\"#FileList\" + listId + \" .selected .user-name\").html());\n if ($(\"#_UploaderFileUploaderCategoryId\" + listId).length) {\n $(\"#_UploaderFileUploaderCategoryId\" + listId).val($(\"#FileList\" + listId + \" .selected .uploader-category-id\").html());\n }\n $.ajax({\n url: $.bcUtil.adminBaseUrl + 'bc-uploader/uploader_files/ajax_image/' + name + '/large',\n type: 'get',\n dataType: 'html',\n success: function (res) {\n $(\"#UploadFileImageLoader\" + listId).hide();\n $(\"#UploadFileImageLoader\" + listId).after(res);\n }\n });\n },\n buttons: {\n cancel: {\n text: bcI18n.uploaderCancel,\n click: function () {\n $(this).dialog('close');\n }\n },\n save: {\n text: bcI18n.uploaderSave,\n click: function () {\n // 保存処理\n let saveButton = $(this);\n let id = $(\"#UploaderFileId\" + listId).val();\n $.bcToken.check(function () {\n // IEでform.serializeを利用した場合、Formタグの中にTableタグがあるとデータが取得できなかった\n var data = {\n \"id\": id,\n \"name\": $(\"#UploaderFileName\" + listId).val(),\n \"alt\": $(\"#UploaderFileAlt\" + listId).val(),\n \"publish_begin\": $(\"#UploaderFilePublishBegin\" + listId).val(),\n \"publish_end\": $(\"#UploaderFilePublishEnd\" + listId).val(),\n \"user_id\": $(\"#UploaderFileUserId\" + listId).val(),\n \"uploader_category_id\": $(\"#_UploaderFileUploaderCategoryId\" + listId).val(),\n \"_csrfToken\": $.bcToken.key\n };\n return $.ajax({\n url: $.bcUtil.apiAdminBaseUrl + 'bc-uploader/uploader_files/edit/' + id + '.json',\n type: 'post',\n data: data,\n dataType: 'json',\n success: function () {\n updateFileList();\n allFields.removeClass('ui-state-error');\n saveButton.dialog('close');\n },\n error: function (response) {\n const fields = {\n name: bcI18n.uploaderFile,\n publish_begin: bcI18n.uploaderPublishBegin,\n publish_end: bcI18n.uploaderPublishEnd\n };\n let message = response.responseJSON.message;\n if(response.responseJSON.errors !== undefined) {\n message += \"\\n\";\n Object.keys(response.responseJSON.errors).forEach(function (key) {\n Object.keys(response.responseJSON.errors[key]).forEach(function (field) {\n message += \"\\n・\" + fields[key] + ':' + response.responseJSON.errors[key][field];\n });\n });\n }\n alert(message);\n }\n });\n }, {hideLoader: false, useUpdate: false});\n }\n }\n },\n close: function () {\n allFields.val('').removeClass('ui-state-error');\n }\n\n });\n\n /**\n * アップロードファイル選択時イベント\n */\n function uploaderFileFileChangeHandler() {\n var url = $.bcUtil.apiAdminBaseUrl + 'bc-uploader/uploader_files/upload.json';\n var $file = $(this);\n $.bcUtil.showLoader();\n if ($('#UploaderFileFile' + listId).val()) {\n $.bcToken.check(function () {\n let fd = new FormData();\n fd.append('file', $file.prop('files')[0]);\n fd.append('_csrfToken', $.bcToken.key);\n if ($(\"#UploaderFileUploaderCategoryId\" + listId).length) {\n fd.append('uploader_category_id', $(\"#UploaderFileUploaderCategoryId\" + listId).val());\n }\n return $.ajax({\n url: url,\n type: 'post',\n data: fd,\n dataType: 'json',\n processData: false,\n contentType: false,\n cache: false,\n success: uploadSuccessHandler,\n error: function (response) {\n if (response.responseJSON) {\n $.bcUtil.showApiError(response);\n } else {\n $.bcUtil.showAlertMessage('処理中にエラーが発生しました。ファイルが大きすぎる可能性があります。');\n }\n $.bcUtil.hideLoader()\n },\n });\n }, {useUpdate: false, hideLoader: false});\n }\n }\n\n /**\n * アップロード完了後イベント\n */\n function uploadSuccessHandler(res) {\n\n if (res) {\n if ($('#UploaderFileUploaderCategoryId' + listId).length) {\n $('#FilterUploaderCategoryId' + listId).val($('#UploaderFileUploaderCategoryId' + listId).val());\n categoryId = $('#UploaderFileUploaderCategoryId' + listId).val();\n }\n updateFileList();\n } else {\n $('#ErrorMessage').remove();\n $('#FileList' + listId).prepend('

' + bcI18n.uploaderAlertMessage2 + '

');\n $(\"#Waiting\").hide();\n }\n // フォームを初期化\n // セキュリティ上の関係でvalue値を直接消去する事はできないので、一旦エレメントごと削除し、\n // spanタグ内に新しく作りなおす。\n $(\"#UploaderFileFile\" + listId).remove();\n $(\"#SpanUploadFile\" + listId).append('');\n $('#UploaderFileFile' + listId).change(uploaderFileFileChangeHandler);\n $.bcToken.key = null;\n\n }\n\n /**\n * 一覧を更新する\n */\n function updateFileList() {\n $.bcUtil.ajax(getListUrl(), updateFileListCompleteHander, {hideLoader: false, type: 'GET'});\n }\n\n /**\n * 指定したファイルの編集ができない状態か確認\n *\n * @param fileUserId\n * @returns {boolean}\n */\n function isFileEditDisabled(fileUserId) {\n var loginUserId = $(\"#LoginUserId\").html();\n var loginUserGroupId = $(\"#LoginUserGroupId\").html();\n var usePermission = Number($(\"#UsePermission\").html());\n var disabled = false;\n if (loginUserGroupId != 1 && usePermission) {\n if (loginUserId != fileUserId) {\n disabled = true;\n }\n }\n return disabled;\n }\n\n /**\n * 選択イベントを初期化する\n */\n function initFileList() {\n\n var usePermission = $(\"#UsePermission\").html();\n\n if (categoryId) {\n $('#UploaderFileUploaderCategoryId' + listId).val(categoryId);\n }\n /* 一旦イベントを全て解除 */\n $(\".selectable-file\").unbind('click.selectEvent');\n $(\".selectable-file\").unbind('mouseenter.selectEvent');\n $(\".selectable-file\").unbind('mouseleave.selectEvent');\n $(\".page-numbers a\").unbind('click.paginationEvent');\n $(\".selectable-file\").unbind('dblclick.dblclickEvent');\n $(\".filter-control\").unbind('click.filterEvent');\n $(\".btn-delete\").unbind('click');\n\n /* 公開制限期間にあるファイルの背景色を定義 */\n var unpublishBackGroundColor = '#bbb';\n\n if ($.fn.contextMenu && !listId && $(\"#DivPanelList\").length) {\n /* 右クリックメニューを追加 */\n $(\"#DivPanelList\").contextMenu({\n selector: '.selectable-file',\n callback: contextMenuHander,\n build: function ($trigger, e) {\n var disabled = isFileEditDisabled($($trigger).find('.user-id').html());\n return {\n items: {\n edit: {\n name: bcI18n.uploaderEdit,\n icon: 'edit',\n disabled: function (key, opt) {\n return disabled;\n }\n },\n delete: {\n name: bcI18n.uploaderDelete,\n icon: 'delete',\n disabled: function (key, opt) {\n return disabled;\n }\n }\n }\n }\n }\n });\n }\n\n $(\"#DivPanelList .selectable-file\").each(function () {\n\n if ($.fn.contextMenu && !listId) {\n if (!isFileEditDisabled($(this).find('.user-id').html())) {\n $(this).bind('dblclick.dblclickEvent', function () {\n $('#EditDialog').dialog('open');\n });\n } else {\n $(this).bind('dblclick.dblclickEvent', function () {\n alert(bcI18n.uploaderAlertMessage3);\n });\n }\n } else {\n $(this).bind(\"contextmenu\", function (e) {\n return false;\n });\n }\n\n /* 公開制限期間にあるファイルは背景色をグレーにする */\n if ($(this).hasClass('unpublish')) {\n $(this).css('background-color', unpublishBackGroundColor);\n }\n });\n\n // ファイルアップロードイベントを登録\n $('#UploaderFileFile' + listId).change(uploaderFileFileChangeHandler);\n\n if (listId) {\n $(\".selectable-file\").bind('mouseenter.selectEvent', function () {\n $(this).css('background-color', '#fffae7');\n });\n $(\".selectable-file\").bind('mouseleave.selectEvent', function () {\n $(this).css('background-color', '#FFFFFF');\n if ($(this).hasClass('unpublish')) {\n $(this).css('background-color', unpublishBackGroundColor);\n }\n });\n $(\".selectable-file\").each(function () {\n // IEの場合contextmenuを検出できなかったので、mousedownに変更した\n $(this).bind('mousedown', function () {\n $(\".selectable-file\").removeClass('selected');\n $(this).addClass('selected');\n });\n });\n } else {\n $(\"#DivPanelList .selectable-file\").bind('mouseenter.selectEvent', function () {\n $(this).css('background-color', '#fffae7');\n });\n $(\"#DivPanelList .selectable-file\").bind('mouseleave.selectEvent', function () {\n $(this).css('background-color', '#FFFFFF');\n if ($(this).hasClass('unpublish')) {\n $(this).css('background-color', unpublishBackGroundColor);\n }\n });\n $(\"#DivPanelList .selectable-file\").each(function () {\n // IEの場合contextmenuを検出できなかったので、mousedownに変更した\n $(this).bind('mousedown', function () {\n $(\".selectable-file\").removeClass('selected');\n $(this).addClass('selected');\n });\n });\n }\n\n /* ページネーションイベントを追加 */\n $('.page-numbers a').bind('click.paginationEvent', function () {\n $(\"#Waiting\").show();\n $.get($(this).attr('href'), updateFileListCompleteHander);\n return false;\n });\n\n $('.bca-list-num a').on('click.listNumEvent', function(){\n $(\"#Waiting\").show();\n $.get($(this).attr('href'), updateFileListCompleteHander);\n return false;\n });\n\n /*$('#FilterUploaderCategoryId'+listId).bind('change.filterEvent', function() {\n $(\"#Waiting\").show();\n $.get(getListUrl(),updateFileListCompleteHander);\n });\n $('input[name=\"data[Filter][uploader_type]\"]').bind('click.filterEvent', function() {\n $(\"#Waiting\").show();\n $.get(getListUrl(),updateFileListCompleteHander);\n });*/\n\n $(\"#FileList\" + listId).trigger(\"filelistload\");\n $(\"#FileList\" + listId).effect(\"highlight\", {}, 1500);\n\n }\n\n /**\n * ファイルリスト取得完了イベント\n */\n function updateFileListCompleteHander(result) {\n\n $(\"#FileList\" + listId).html(result);\n initFileList();\n $(\"#FileList\" + listId).trigger('loadTableComplete');\n $(\"#Waiting\").hide();\n\n }\n\n /**\n * Ajax List 取得用のURLを取得する\n */\n function getListUrl() {\n let listUrl = $(\"#ListUrl\" + listId).attr('href');\n let query = [];\n if ($('#FilterUploaderCategoryId' + listId).length) {\n query.push('uploader_category_id=' + $('#FilterUploaderCategoryId' + listId).val());\n } else {\n query.push('uploader_category_id=');\n }\n if ($('input[name=\"uploader_type\"]:checked').length) {\n query.push('uploader_type=' + $('input[name=\"uploader_type\"]:checked').val());\n } else {\n query.push('uploader_type=all');\n }\n if ($('#FilterName' + listId).val()) {\n query.push('name=' + encodeURI($('#FilterName' + listId).val()));\n } else {\n query.push('name=');\n }\n const num = location.search.match('limit=([0-9]+)');\n if(num) {\n query.push('limit=' + num[1]);\n }\n if (query.length) {\n listUrl += '?' + query.join('&');\n }\n return listUrl;\n }\n\n /**\n * コンテキストメニューハンドラ\n */\n function contextMenuHander(action, el) {\n let id = $(\"#FileList\" + listId + \" .selected .id\").html().trim();\n let delUrl = $.bcUtil.apiAdminBaseUrl + 'bc-uploader/uploader_files/delete/' + id + '.json';\n\n // IEの場合、action値が正常に取得できないので整形する\n let pos = action.indexOf(\"#\");\n if (pos !== -1) action = action.substring(pos + 1, action.length);\n\n switch (action) {\n case 'edit':\n $('#EditDialog').dialog('open');\n break;\n\n case 'delete':\n if (confirm(bcI18n.uploaderConfirmMessage1)) {\n $.bcToken.check(function () {\n $.ajax({\n url: delUrl,\n headers: {\n \"X-CSRF-Token\": $.bcToken.key,\n },\n type: 'post',\n dataType: 'json',\n beforeSend: function() {\n $(\"#Waiting\").show();\n },\n success: function () {\n $(\"#FileList\" + listId).trigger(\"deletecomplete\");\n updateFileList();\n },\n error: function () {\n alert(bcI18n.uploaderAlertMessage4);\n },\n complete: function(){\n $(\"#Waiting\").hide();\n $.bcToken.key = null;\n }\n });\n }, {useUpdate: false, hideLoader: false});\n }\n break;\n }\n }\n\n});\n"],"names":["$","listId","html","remove","allFields","add","categoryId","baseUrl","uploaderFileFileChangeHandler","url","bcUtil","apiAdminBaseUrl","$file","this","showLoader","val","bcToken","check","fd","FormData","append","prop","key","length","ajax","type","data","dataType","processData","contentType","cache","success","uploadSuccessHandler","error","response","responseJSON","showApiError","showAlertMessage","hideLoader","useUpdate","res","updateFileList","prepend","bcI18n","uploaderAlertMessage2","hide","change","listUrl","attr","query","push","encodeURI","num","location","search","match","join","getListUrl","updateFileListCompleteHander","isFileEditDisabled","fileUserId","loginUserId","loginUserGroupId","usePermission","Number","disabled","result","unbind","unpublishBackGroundColor","fn","contextMenu","selector","callback","contextMenuHander","build","$trigger","e","find","items","edit","name","uploaderEdit","icon","opt","delete","uploaderDelete","each","bind","alert","uploaderAlertMessage3","dialog","hasClass","css","removeClass","addClass","show","get","on","trigger","effect","initFileList","action","el","id","trim","delUrl","pos","indexOf","substring","confirm","uploaderConfirmMessage1","headers","beforeSend","uploaderAlertMessage4","complete","click","bgiframe","autoOpen","position","at","of","window","width","modal","open","publishBeginDate","publishBeginTime","publishBeginDateTime","publishEndDate","publishEndTime","publishEndDateTime","adminBaseUrl","after","buttons","cancel","text","uploaderCancel","save","uploaderSave","saveButton","fields","uploaderFile","publish_begin","uploaderPublishBegin","publish_end","uploaderPublishEnd","message","undefined","errors","Object","keys","forEach","field","close"],"sourceRoot":""} \ No newline at end of file