{"version":3,"sources":["webpack:///./app/javascript/packs/application.js","webpack:///./app/javascript/channels/index.js","webpack:///./app/javascript/channels sync _channel\\.js$","webpack:///./app/javascript/packs/admin.js","webpack:///./app/javascript/packs/application_view.js","webpack:///./app/javascript/packs/m.js","webpack:///./app/javascript/packs/communication_management.js","webpack:///./app/javascript/packs/product_update.js","webpack:///./app/javascript/packs/manual_my_post.js","webpack:///./app/javascript/packs/manual_my_post_display.js","webpack:///./app/javascript/packs/ugc_optimization.js","webpack:///./app/javascript/packs/darkmode.js","webpack:///./app/javascript/packs/chat_bot.js","webpack:///./app/javascript/packs/chat_option.js","webpack:///./app/javascript/packs/crm.js","webpack:///./app/javascript/packs/contents.js","webpack:///./app/javascript/packs/contents_list.js","webpack:///./app/javascript/packs/popup.js","webpack:///./app/javascript/packs/site_insert.js","webpack:///./app/javascript/packs/block_exit.js","webpack:///./app/javascript/packs/push_notification.js","webpack:///./app/javascript/packs/personalize.js","webpack:///./app/javascript/packs/personalize_list.js","webpack:///./app/javascript/packs/heatmap_preset.js","webpack:///./app/javascript/packs/recommend_settings.js","webpack:///./app/javascript/packs/recommend_group_setting.js","webpack:///./app/javascript/packs/recommend_search_settings.js","webpack:///./app/javascript/packs/recommend_tuning_setting.js","webpack:///./app/javascript/packs/recommend_retargeting_setting.js","webpack:///./app/javascript/packs/recommend_preview.js","webpack:///./app/javascript/packs/sales_index.js","webpack:///./app/javascript/packs/recommend_campaign_setting.js","webpack:///./app/javascript/packs/non_deletable_sns_post.js","webpack:///./app/javascript/packs/staff.js"],"names":["Rails","start","Turbolinks","ActiveStorage","channels","require","keys","forEach","webpackEmptyContext","req","e","Error","code","resolve","module","exports","id","document","addEventListener","$","on","account_id","val","img_size","location","href","img_height","Number","this","data","resize_val","img_url","alert","ajax","url","type","dataType","done","ret","reload","related_flag","index","file","files","key","formData","FormData","append","processData","contentType","success","error","jqXHR","textStatus","errorThrown","row","closest","fadeOut","remove","title","content","flag","length","text","replace","html","includes","sidebar_hide_mark_el","throttled","_","throttle","pageX","fadeIn","event","ulElement","attr","is","slideUp","slideDown","stopPropagation","console","log","getDefaultHashtagDates","todayEndOfDay","Date","setHours","hashtagInitialDate","hashtagEndDate","toISOString","split","ERROR_MSG","MAIL_PATTERN","S3_MEDIA_URL","DOMAIN","current_url","window","pathname","eq","focus","keypress","keyCode","target","nodeName","click","setTimeout","each","i","trim","trigger","next_page","this_action","animate","scrollTop","this_page","next_action","pages","actions","urls","push","j","guide_no","confirm","css","name","fail","service_flag","login_name","company_name","is_smm_checkbox","is_ai_checkbox","dir_key","password","account","ym","prop","recommend_item_id","not","parent_items","parent_item","maxLength","isChecked","child_items","some","child_item","related_item_id","image_url","item_url","substring","removeClass","addClass","child_id","parent_checkbox","parent_id","parent_relate_box","siblings","consumable_flag","gender_target_flag","find","acId","acName","always","children","match","person_name","division","mail","tel","post","address","insta_business_id","insta_access_token","login_id","now_password","new_password","value","back_button","fadein_speed","background_opacity","next_color","cv_color","none_element_case","new_flow_case","search","indexOf","color","display","flow_selected","month_selected","URL","preventDefault","originalEvent","dataTransfer","reader","FileReader","onload","result","readAsDataURL","oFile","getElementById","undefined","m_file_name","size","data_url_scheme","file_name","encodeURIComponent","image","image_id","tag_group_input_val","tgg_id","registeredTime","waitTime","now","datetime","toLocaleString","timeZone","localStorage","getItem","platta_tag_registered_time_str","JSON","parse","waitUntil","setTime","getTime","toLocaleTimeString","hour","minute","setItem","stringify","hash_tag_register_interval","hashtag_id","removeItem","future_restriction_lifted_data","checked_tags","map","get","tag_ids","next","slideToggle","toggleClass","hasClass","generate_hashtag_list_url_params","show_hashtag","off","sns_post_id","ugc_group_ids","ugc_group_id","change","ready","moreClass","post_content","inputText","outputText","post_text_length","c","substr","$files","len","fr","src","img","pre_img","post_type","post_time","app_types","following_type","comment_type","repost_type","win_types","follower_type","comment_count_type","image_datas","url_scheme","caption","ic_id","save_type","message","min_length","num","comment_list","parents","box_count","ig_post_id","comments_count","instagram_campaign_comment","username","timestamp","instagram_campaign","like_count","parent_group_id","parent_group_input_val","parent_group","checked_values","new_parent_name","parent","parent_amount_element","parent_amount_condition","parent_amount","parent_amount_upper_condition","parent_amount_upper","parent_amount_filter","parent_text_element","parent_text_condition","parent_text","startsWith","parent_img_element","parent_img_condition","parent_img","element","condition","ugc_group","is_ab_test","error_message","ab_test_id","ugc_group_ab_test_id","is_device","ugc_edit_name_val","ugc_order_select","searchParams","has","set","history","replaceState","toString","ugc_show_valid_val","show_valid","ugc_display_count_select_val","display_count","ugc_display_type_val","ugc_display_order_val","display_type","display_order","ugc_group_input_val","element_change_mode_val","element_id_val","element_class_val","element_index_val","parent_id_val","parent_class_val","parent_index_val","grand_id_val","grand_class_val","grand_index_val","great_grand_id_val","great_grand_class_val","ugc_element_placement","element_id","element_class","element_index","parent_class","parent_index","grand_id","grand_class","grand_index","great_grand_id","great_grand_class","element_placement","element_hierarchy_input_val","element_hierarchy_input","ugc_add_tab_name","tab_name","check_flag","tab_id","sns_post_ugc_group_id","ugc_edit_tab_name_input","ugc_tab_style_id","edit_tab_name","is_category_title","is_category_title_icon","category_title_margin","category_title_height","category_title_justify_content","category_title_icon_size","category_title_original_icon_width","category_title_original_icon_height","category_title_original_icon_img_url","category_title_icon_margin","category_title_text","category_title_font_family","category_title_font_size","category_title_font_weight","category_title_font_color","category_subtitle_margin","category_subtitle_height","category_subtitle_text","category_subtitle_font_family","category_subtitle_font_size","category_subtitle_font_weight","category_subtitle_font_color","clickable_subtitle_margin","clickable_subtitle_height","clickable_subtitle_text","clickable_subtitle_font_family","clickable_subtitle_font_size","clickable_subtitle_font_weight","clickable_subtitle_font_color","clickable_subtitle_text_align","clickable_subtitle_a_text","clickable_subtitle_a_url","clickable_subtitle_a_font_family","clickable_subtitle_a_font_size","clickable_subtitle_a_font_weight","clickable_subtitle_a_font_color","clickable_subtitle_a_margin","clickable_subtitle_a_text_decoration","container_justify_content","container_width","container_margin","container_margin_x","container_left","container_transform","img_column_count","img_box_width","img_box_height","img_box_border_radius","img_box_object_fit","img_box_margin","img_box_background_color","is_caption","is_hover","caption_font_size","caption_font_family","caption_font_weight","caption_font_color","caption_height","caption_max_height","caption_line_height","caption_margin","caption_blur_height","caption_blur_width","caption_blur_top","caption_blur_left","caption_blur_background_color","is_username","username_justify_content","username_margin","is_username_icon","username_icon_width","username_icon_height","username_icon_margin","username_font_size","username_font_family","username_font_weight","username_font_color","grid_first_display_img_count","grid_view_more_display_img_count","is_scroll_flag","grid_display_btn_width","grid_display_btn_font_size","grid_display_btn_font_family","grid_display_btn_font_weight","grid_display_btn_font_color","grid_view_more_btn_text","grid_view_more_text_align","grid_view_more_btn_padding","grid_view_more_btn_border","grid_view_more_btn_border_radius","grid_view_more_btn_plus_minus_border_color","grid_view_more_btn_plus_minus_before_right","grid_view_more_btn_plus_minus_before_top","grid_view_more_btn_plus_minus_before_width","grid_view_more_btn_plus_minus_before_height","grid_view_more_btn_plus_minus_before_transform","grid_view_more_btn_plus_minus_after_right","grid_view_more_btn_plus_minus_after_top","grid_view_more_btn_plus_minus_after_width","grid_view_more_btn_plus_minus_after_height","grid_view_more_btn_plus_minus_after_transform","is_grid_view_more_btn_plus_minus","grid_close_btn_text","grid_view_more_btn_margin","is_slider_prev_btn","slider_prev_btn_top","slider_prev_btn_left","slider_prev_btn_width","slider_prev_btn_height","slider_prev_btn_border_radius","slider_prev_btn_text_color","slider_prev_btn_backgroud_color","slider_prev_btn_backgroud_opacity","slider_prev_btn_text_line_width","slider_prev_btn_text_line_height","slider_prev_btn_text_line_weight","slider_prev_btn_text_position_right","slider_prev_btn_text_position_top","slider_prev_btn_text_line_rotate","slider_prev_btn_text_line_translatey","slider_prev_btn_text_line_skew","is_slider_next_btn","slider_next_btn_top","slider_next_btn_left","slider_next_btn_width","slider_next_btn_height","slider_next_btn_border_radius","slider_next_btn_text_color","slider_next_btn_backgroud_color","slider_next_btn_backgroud_opacity","slider_next_btn_text_line_width","slider_next_btn_text_line_height","slider_next_btn_text_line_weight","slider_next_btn_text_position_right","slider_next_btn_text_position_top","slider_next_btn_text_line_rotate","slider_next_btn_text_line_translatey","slider_next_btn_text_line_skew","slider_btn_z_index","tab_name_container_justify_content","tab_name_container_margin","tab_name_font_size","tab_name_font_family","tab_name_font_weight","tab_name_font_color","tab_name_border_radius","tab_name_border","tab_name_padding","tab_name_margin","tab_name_max_width","tab_name_background_color","tab_name_transition","tab_name_hover_background_color","tab_name_hover_font_color","tab_name_hover_opacity","tab_name_selected_background_color","tab_name_selected_font_color","tab_loading_text","tab_loading_width","tab_loading_height","tab_loading_font_size","tab_loading_font_family","tab_loading_font_weight","tab_loading_font_color","tab_first_display_img_count","tab_view_more_display_img_count","tab_display_btn_width","tab_display_btn_font_size","tab_display_btn_font_family","tab_display_btn_font_weight","tab_display_btn_font_color","tab_view_more_btn_text","tab_view_more_text_align","tab_view_more_btn_padding","tab_view_more_btn_border","tab_view_more_btn_border_radius","tab_view_more_btn_plus_minus_border_color","tab_view_more_btn_plus_minus_before_right","tab_view_more_btn_plus_minus_before_top","tab_view_more_btn_plus_minus_before_width","tab_view_more_btn_plus_minus_before_height","tab_view_more_btn_plus_minus_before_transform","tab_view_more_btn_plus_minus_after_right","tab_view_more_btn_plus_minus_after_top","tab_view_more_btn_plus_minus_after_width","tab_view_more_btn_plus_minus_after_height","tab_view_more_btn_plus_minus_after_transform","is_tab_view_more_btn_plus_minus","tab_close_btn_text","tab_view_more_btn_margin","modal_max_width","modal_max_height","modal_left_width","modal_right_width","modal_right_height","is_modal_related_items","is_modal_related_items_title","modal_related_items_title_text","modal_related_items_title_font_family","modal_related_items_title_font_size","modal_related_items_title_font_weight","modal_related_items_title_font_color","is_modal_related_items_link","modal_related_items_img_column_margin","modal_related_items_img_column_height","modal_related_items_img_column_width","modal_related_items_initial_img_count","modal_related_items_img_height","modal_related_items_img_width","modal_related_items_img_margin","modal_related_items_name_line_height","modal_related_items_name_font_size","modal_related_items_name_font_family","modal_related_items_name_font_weight","modal_related_items_name_text_align","modal_related_items_name_font_color","modal_related_items_price_font_size","modal_related_items_price_font_family","modal_related_items_price_font_weight","modal_related_items_price_text_align","modal_related_items_price_font_color","modal_related_items_price_unit_text","is_modal_photo_by_link","modal_photo_by_icon_size","modal_photo_by_margin","modal_photo_by_text_align","modal_photo_by_text","modal_photo_by_font_size","modal_photo_by_font_family","modal_photo_by_font_weight","modal_photo_by_font_color","is_modal_related_items_product_comment","modal_related_items_product_comment_height","modal_related_items_product_comment_line_height","modal_related_items_product_comment_position","modal_related_items_product_comment_font_size","modal_related_items_product_comment_font_family","modal_related_items_product_comment_font_weight","modal_related_items_product_comment_font_color","modal_del_btn_size","modal_sns_post_img_object_fit","modal_prev_post_btn_bg_color","modal_prev_post_btn_opacity","modal_prev_post_btn_top","modal_prev_post_btn_left","modal_prev_post_btn_width","modal_prev_post_btn_height","modal_prev_post_btn_line_color","modal_prev_post_btn_line_width","modal_prev_post_btn_line_height","modal_prev_post_btn_line_right","modal_prev_post_btn_line_top","modal_prev_post_btn_line_weight","modal_prev_post_btn_line_rotate","modal_prev_post_btn_line_translatey","modal_next_post_btn_bg_color","modal_next_post_btn_opacity","modal_next_post_btn_top","modal_next_post_btn_left","modal_next_post_btn_width","modal_next_post_btn_height","modal_next_post_btn_line_color","modal_next_post_btn_line_width","modal_next_post_btn_line_height","modal_next_post_btn_line_right","modal_next_post_btn_line_top","modal_next_post_btn_line_weight","modal_next_post_btn_line_rotate","modal_next_post_btn_line_translatey","modal_dot_left_display","modal_dot_left_bg_color","modal_dot_left_height","modal_dot_left_width","modal_dot_left_opacity","modal_dot_left_border","modal_dot_left_border_radius","modal_dot_left_margin","modal_dot_left_line_height","modal_dot_left_line_width","modal_dot_left_line_top","modal_dot_left_line_right","modal_dot_left_line_border_top","modal_dot_left_line_border_right","modal_dot_left_line_transform","modal_dot_right_display","modal_dot_right_bg_color","modal_dot_right_height","modal_dot_right_width","modal_dot_right_opacity","modal_dot_right_border","modal_dot_right_border_radius","modal_dot_right_margin","modal_dot_right_line_height","modal_dot_right_line_width","modal_dot_right_line_top","modal_dot_right_line_right","modal_dot_right_line_border_top","modal_dot_right_line_border_right","modal_dot_right_line_transform","modal_dot_display","modal_dot_height","modal_dot_width","modal_dot_opacity","modal_dot_border","modal_dot_border_radius","modal_dot_margin","is_top_dividing_line","top_dividing_line_width","top_dividing_line_height","top_dividing_line_color","top_dividing_line_margin","is_jump_other_page_btn","jump_other_page_btn_text","jump_other_page_url","jump_other_page_btn_text_font_color","jump_other_page_btn_text_font_size","jump_other_page_btn_text_font_family","jump_other_page_btn_text_font_weight","jump_other_page_btn_border_color","jump_other_page_btn_border_radius","jump_other_page_btn_text_align","jump_other_page_btn_margin","jump_other_page_btn_width","jump_other_page_btn_height","is_ig_cta_container","ig_cta_container_margin","ig_cta_container_padding","ig_cta_container_text_align","ig_cta_box_text","ig_cta_box_text_font_color","ig_cta_box_text_font_size","ig_cta_box_text_font_family","ig_cta_box_text_font_weight","ig_cta_box_text_align","ig_cta_img_height","ig_cta_img_width","ig_cta_img_margin","ig_cta_img_url","is_cta_title","is_cta_title_icon","cta_title_margin","cta_title_height","cta_title_justify_content","cta_title_icon_size","cta_title_icon_margin","cta_title_text","cta_title_font_family","cta_title_font_size","cta_title_font_weight","cta_title_font_color","custom_css","when","video_src","img_src","media_type","media_url","post_type_name","media_id","created_at","my_post_media_order_file_name","my_post_media_order_media_type","original_file_name","media_html","permalink","str","truncate","ret1","products","product","price","ret2","linked_products","linked_product","product_id","lp","p","which","search_word","toLowerCase","sns_post_ids","firstChecked","updateUrlAndRedirect","params","baseUrl","Object","entries","start_day","end_day","pushState","getParameters","device","gf","ab","show","hide","s3_img_url","img_urls","user_names","currentUrl","checked_sns_posts_id_and_src","post_card","imgSrc","videoSrc","media_src","tag_check","preview_url","html_name","product_name","product_img_name","product_price","ugc_detail_page_display_count_select_val","selected_month","add_params","ugc_group_ab","URLSearchParams","month","new_value","current_value","p_vap","product_code","product_image_url","product_url","is_product_price_visible","is_post_visible","product_comment","product_page_url","product_sale_price","product_stock_status","delete_flag","imageInput","previewContainer","selectedFiles","Array","from","imageId","imageWrapper","createElement","classList","add","setAttribute","removeButton","textContent","filter","querySelector","removeImage","appendChild","message_contents","scrollHeight","campaign_id","category","service_url","service_name","description","task","persona","precaution","postscript","recruitment_numbers","is_open","campaign_image_edit","campaign_url","user_id","nick_name","parseInt","room_id","emoji","message_id","copyText","navigator","clipboard","writeText","then","style","err","textarea","body","select","execCommand","removeChild","dropArea","handleFiles","response","xhr","status","preview_html_name","preview_id","html_content","placeholder","url_hashtag_list_dev","url_hashtag_list_pro","lstorage_hashtag_list_display_type","lstorage_per_page_num","lstorage_hashtag_initial_date","lstorage_hashtag_end_date","lstorage_hashtag_group","lstorage_search_condition","lstorage_hashtag_list","lstorage_excluded_words_list","lstorage_ugc_urls_list","selected_tag_ids","selected_tag_names","initial_date","end_date","all_tag_check_box","el","checked","search_condition","per_page_num","url_query_path","tag_id","today","revised_my_post_url_query_path","join","tag_info_list","allChecked","idk","tag","excluded_words_list","excluded_list","excluded_word","ugc_urls","ugc_urls_list","idx","ugc_urls_list_str","hashtag_group","get_all_filter_condition","excluded_words_str","slice","excluded_words","excluded_word_list","grep","data_fr_ruby","switch_url","filter_condition","loader","clickedElementId","current_date_time","errorResponse","responseText","currentTime","recentButtonClickedTime","popularButtonClickedTime","lstorage_cmm_sub_ugc_urls_list","get_hashtag_related_posts","ajax_url_path","yes","comment","get_local_storage_item_overwrite_value","id_name","get_local_storage_item_checked","get_local_storage_item_selected","selectedValue","cmm_main_media_type_pic","cmm_main_media_type_carousel","cmm_main_media_type_video","cmm_main_status_need_confirm","cmm_main_status_ok_ugc","cmm_main_status_ng_ugc","cmm_main_status_done_ugc","cmm_main_status_cancel_ugc","cmm_main_status_thanked_ugc","cmm_main_username","cmm_main_comment_keyword","cmm_main_initial_date","cmm_main_end_date","cmm_main_per_page_num","cmm_main_display_order","lstorage_cmm_main_ugc_urls_list","lstorage_cmm_main_ugc_urls_list_str","cmm_sub_media_type_pic","cmm_sub_media_type_carousel","cmm_sub_media_type_video","cmm_sub_status_waiting_reply","cmm_sub_status_waiting_seven_days","cmm_sub_comment_keyword","cmm_sub_initial_date","cmm_sub_end_date","cmm_sub_per_page_num","cmm_sub_display_order","lstorage_cmm_sub_ugc_urls_list_str","cmm_url_path","isAnyUndefined","v","status_type","copied_text","lstorage_free_comment_one","lstorage_free_comment_two","this_el","saved_text","change_btn_text","btn_element","indexInArray","button","overflow","permission_state_btn","sns_post_state","parent_media_id","post_tag_card","ugc_communication_permalink","ugc_communication_media_src","media_container","permission_state_id","background","hp_index","sns_post_parent_media_id","ugc_permission","complete","done_thanks_message","permission_done_btn","tagName","media","cmm_status_string_for_pic","closeTag","common_media_count_up","prepend","prependMedia","sentJapanFormattedTime","year","day","second","dateAndTime","dateParts","carousel_parent_media_id","state","all_selected_ugc_state_color_css","this_permission_state_label","selectedOption","set_all_filter_condition","cmm_main_ugc_urls","cmm_main_ugc_urls_list","cmm_sub_ugc_urls","cmm_sub_ugc_urls_list","cmm_sub__toggle_all","cmm_sub__toggle_media_type","cmm_sub__toggle_status","all_sub_media_check_boxes","all_sub_status_check_boxes","cmm_main__toggle_all","cmm_main__toggle_media_type","cmm_main__toggle_status","all_main_media_check_boxes","all_main_status_check_boxes","toggle_filters","check_boxes","area_toggle","official_comment","before","$this","input_username","input_comment","cmm_change_ugc_permission_state_flag","no_data","date","blob","Blob","createObjectURL","a","download","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","position","left","top","transform","padding","cursor","width","height","margin","opacity","main_object","sub_object","file_for_update","file_for_delete","send_product_csv_data","form_id","uploaded_file_id","filename","NOKOGIRI_ACCOUNT_IDS","MERGED_ACCOUNT_IDS","seconds_per_line","extension","pop","target_url","timeout","is_db_changed_successfully","confirm_yes_or_no","fileObject","mpm_files","conduct_sortable","new_or_edit","inputFile","my_post_media_drop_input","mpm_preview_own_media_area","previewArea","delete_existing_media_orders_flag","mpm_instagram_url_obj","all_db_permalink_list","sns_post_id_for_update","fileIndex","open_modal_container_btn","platta_ig_modal_container","first","submit_btn","mpm_username_obj","empty","validVideoTypes","clicked_inserted_files","MPM_MAX_SIZE_MB","dup_common_media_count_up","processFiles","dropEffect","sortableInstance","Sortable","animation","handle","Promise","reject","dataUrlScheme","fileName","appendMediaWithCheck","parentElement","parentElementDataId","item","String","hasAlerted","hasAlertedCount","appendMedia","mpm_instagram_url","endsWith","mpm_caption","mpm_username","modified_reordered_list","toArray","o","obj","newObj","reorderedFileArray","reorderedMediaUrlArray","reorderedExistingDataArray","FormDataOrderList","MediaUrlOrderList","DbExistingDataList","File","file_index","lastModified","mpm_reordered_media_url_list","mpm_file_type_list","mpm_media_url_order_list","mpm_reordered_media_url","fileExtension","mpm_reordered_existing_data_list","mpm_existing_data_order_list","mpm_db_id","ajax_save_manual_my_post","alarm_flag","customMessage","responseJSON","ajax_save_manual_my_post_media_url","created_records_hash","mpm_delete_existing_media_orders_flag","ajax_update_manual_my_post","sns_post_id_and_created_records_hash_list","mpm_sns_post_id","insert_media_to_preview_area","preview_area","mpm_media_url_list","media_url_count_up","mmu_idx","get_url_list","$preview_shown_media_area","mpm_item_instagram_url","mpm_item_caption","mpm_item_list","dataSnsPostId","data_mpm","mpm_id","mpm_item","mpm_idx","data_mpm_id","tmp_obj","existing_media_html_elements","$preview_shown_media_area_for_edit","mpm_post_type","clickedElement","my_post_media_order_ids","get_delete_subject_my_post_media_order_ids","mas_ugc_urls_list","mas_ugc_urls_list_str","mas_get_all_filter_condition","storage_mas_ugc_urls_list","tgg_name","tag_name","initialize_ugc_optimization_button","param","selected_group_el","group_ugc_item_actual_total_count","toggleDeviceButtons","activeElement","inactiveElement","device_change_get_display_count","data_target","rank_container","selected_device","device_type","selected_group_id","selected_group_name","selected_device_type","ranks","display_num_list","max_num_list","current_display_num_list","display_num","m_idx","each_rank_max_ugc_count_list","current_display_num","prioritized_ugc_flag","ugc_prioritized_position","ajax_save_ugc_display_num","ugc_previous_prioritized_period","ugc_prioritized_period","ugc_display_num_list","ugc_display_max_num_list","alert_flag","isSpecialURL","cookie","chat_bot_update_url","chat_id","chat_option_id","gf_value","chat_bot_input_val","chat","new_chat_bot_name","chat_bot_img_url","chat_bot_title_img_url","chat_bot_icon_url","title_img_url","icon_url","is_content_side_position","content_side_position","content_bottom_position","is_default_display","is_default_icon_side_position","default_icon_side_position","default_icon_bottom_position","default_icon_img_height","default_icon_img_width","default_icon_img_border_radius","is_default_text_side_position","default_text_side_position","default_text_bottom_position","default_text_width","default_text_border_radius","default_text_word","default_text_padding","default_text_bg_color","default_text_font_color","default_text_font_size","default_text_font_weight","main_container_bg_color","main_container_border_radius","main_container_width","main_container_height","main_container_border","main_container_opacity","main_container_box_shadow","title_area_title_justify_content","title_area_title_margin","title_area_bg","title_area_border_radius","title_area_height","title_area_img_width","title_area_img_height","title_area_img_margin","title_area_font_color","close_btn_width","close_btn_height","close_btn_bg_color","is_header_area","header_area_height","header_area_padding","header_area_text_one","header_area_text_two","header_area_text_padding","header_area_text_font_size","comment_area_padding","comment_area_icon_width","comment_area_icon_height","comment_area_icon_margin","comment_area_icon_border_radius","comment_box_margin","comment_box_padding","comment_box_width","comment_box_border_radius","comment_box_bg_color","comment_text_padding","comment_text_font_size","comment_text_font_weight","comment_text_font_color","comment_btn_margin","comment_btn_padding","comment_btn_border","comment_btn_border_radius","comment_btn_white_space","comment_btn_bg_color","comment_btn_font_color","comment_btn_font_size","comment_btn_box_shadow","comment_btn_font_weight","is_footer_area","loading_container_margin","loading_container_padding","loading_box_border_radius","loading_box_bg_color","loading_box_font_color","loading_box_font_weight","delete_icon_top","delete_icon_right","delete_icon_width","delete_icon_height","is_content_side_position_sp","content_side_position_sp","content_bottom_position_sp","is_default_display_sp","is_default_icon_side_position_sp","default_icon_side_position_sp","default_icon_bottom_position_sp","default_icon_img_height_sp","default_icon_img_width_sp","default_icon_img_border_radius_sp","is_default_text_side_position_sp","default_text_side_position_sp","default_text_bottom_position_sp","default_text_width_sp","default_text_border_radius_sp","default_text_word_sp","default_text_padding_sp","default_text_bg_color_sp","default_text_font_color_sp","default_text_font_size_sp","default_text_font_weight_sp","main_container_bg_color_sp","main_container_border_radius_sp","main_container_width_sp","main_container_height_sp","main_container_border_sp","main_container_opacity_sp","main_container_box_shadow_sp","title_area_title_justify_content_sp","title_area_title_margin_sp","title_area_bg_sp","title_area_border_radius_sp","title_area_height_sp","title_area_img_width_sp","title_area_img_height_sp","title_area_img_margin_sp","title_area_font_color_sp","close_btn_width_sp","close_btn_height_sp","close_btn_bg_color_sp","is_header_area_sp","header_area_height_sp","header_area_padding_sp","header_area_text_one_sp","header_area_text_two_sp","header_area_text_padding_sp","header_area_text_font_size_sp","comment_area_padding_sp","comment_area_icon_width_sp","comment_area_icon_height_sp","comment_area_icon_margin_sp","comment_area_icon_border_radius_sp","comment_box_margin_sp","comment_box_padding_sp","comment_box_width_sp","comment_box_border_radius_sp","comment_box_bg_color_sp","comment_text_padding_sp","comment_text_font_size_sp","comment_text_font_weight_sp","comment_text_font_color_sp","comment_btn_margin_sp","comment_btn_padding_sp","comment_btn_border_sp","comment_btn_border_radius_sp","comment_btn_white_space_sp","comment_btn_bg_color_sp","comment_btn_font_color_sp","comment_btn_font_size_sp","comment_btn_box_shadow_sp","comment_btn_font_weight_sp","is_footer_area_sp","loading_container_margin_sp","loading_container_padding_sp","loading_box_border_radius_sp","loading_box_bg_color_sp","loading_box_font_color_sp","loading_box_font_weight_sp","delete_icon_top_sp","delete_icon_right_sp","delete_icon_width_sp","delete_icon_height_sp","chat_bot_id","file_data","form_data","_treeData","_treeHistory","_addNodeModal","_saveTreeTimer","_savingFlg","_treeElement","_maxHistory","createTree","treeData","whenHistory","firstSection","nodes","sections","canvasElementId","createSection","setAddNodeButtonEvent","setNodeEvent","setSectionEvent","checkLinkButtonEvent","setSortable","updateCanvasHeight","updateTreeData","modal","ev","eventPhase","modalHide","createAddNodeModal","addHistory","nodeData","parentElementId","isFirst","sectionLabel","section","childNodes","node","parentId","sort","b","localIndex","createNode","updateNodeListHeight","after","nodeAnchor","targetNode","scrollToTarget","nextSectionId","sectionNodeData","getSectionData","newNodes","nodeElement","nodeElementId","getNodeData","newSections","clearTimeout","savingFlg","uploadData","firstSectionData","uploadNode","content_type","saveTreeData","sectionElement","sectionElementId","callerSectionId","addNodeContent","addSectionContent","callerElement","chatId","nodeContentType","nodeContent","sectionContentType","sectionContent","newNodeData","newSectionData","addNode","link","open","jQueryObject","destroy","create","draggable","ghostClass","onStart","onStartEvent","onEnd","onEndEvent","onChange","onChangeEvent","onSort","onSortEvent","nodeList","sortableIds","nodeWrapper","detach","targetElement","deleteButton","targetNodeId","removeNode","parentSection","nodeListElement","nodeHeight","outerHeight","canvasElement","boolean","targetjQueryElement","targetOffsetTop","offset","newScrollTop","shift","req_name","person","preferred_date","domain","account_name","cv_tag","stat","tag_stat","tag_fire","access_token","customer_posts","customer_preview","customer_release","cv_tag_check","log_check","top_page","detail_page","cart_page","thanks_page","cid","pid","create_date","contents_update_url","content_id","contents_id","is_mode","delete_btn_position","contents_popup_width_val","contents_popup_height_val","contents_img_border_color_val","img_width","img_border_color","widthStr","aspectWidth","newHeight","toFixed","heightStr","newWidth","is_delete_btn_bg_color","contents_popup_bg_color_val","contents_popup_text_color_val","bg_color","text_color","redisplay","contents_display_position","contents_position","contents_offset","is_background","background_color","contents","mode","preview_btn","unique_styles","delete_btn_style","append_html","cantent_id","popup_update_url","popup_id","popup_setting_id","popup_ab_test_id","personalize_id","publication_start","publication_end","startDate","setMonth","is_display_condition","display_time_ms","scroll_percent","priority","Math","abs","site_insert_update_url","site_insert_id","site_insert_setting_id","site_insert_ab_test_id","site_insert_element_placement","block_exit_update_url","block_exit_id","block_exit_setting_id","out_domain_flag","push_notification_update_url","push_topic_id","hours","minutes","seconds","push_name","ac_id","current_time","padStart","complete_topic","topic","topic_name","modal_transition_second","modal_whole_margin","modal_whole_padding","modal_whole_width","modal_whole_height","modal_whole_border","modal_whole_radius","paragraph_text","paragraph_text_color","modal_whole_background_color","modal_container_margin","modal_container_padding","is_reverse_icon_position","modal_icon_object_fit","modal_icon_width","modal_icon_height","modal_icon_margin","modal_icon_padding","paragraph_text_size","paragraph_font_family","paragraph_font_weight","paragraph_margin","paragraph_padding","paragraph_line_height","is_reverse_buttons_position","buttons_justify_content","is_permission_button","permission_button_text","permission_button_margin","permission_button_padding","permission_button_background_color","permission_button_text_size","permission_button_text_color","permission_button_font_family","permission_button_font_weight","permission_button_text_style","permission_button_border","permission_button_border_radius","is_cancel_button","cancel_button_text","cancel_button_margin","cancel_button_padding","cancel_button_background_color","cancel_button_text_size","cancel_button_text_color","cancel_button_font_family","cancel_button_font_weight","cancel_button_font_text_style","cancel_button_border","cancel_button_border_radius","is_modal_close_mark","modal_close_mark_top","modal_close_mark_right","modal_close_mark_margin","modal_close_mark_padding","modal_close_mark_background_color","modal_close_mark_text_size","modal_close_mark_text_color","modal_close_mark_font_family","modal_close_mark_font_weight","modal_display_position","modal_top_offset","modal_bottom_offset","modal_left_offset","modal_right_offset","push_position","push_offset","is_other_page","shop_name","targetSize","targetFileSize","callback","wrapper","preview","compressedBlob","Image","canvas","ctx","getContext","sourceX","sourceY","sourceWidth","sourceHeight","sourceAspect","targetAspect","drawImage","compress","quality","toBlob","checkLimit","limit","countUpElement","changeScheduleDateEditable","caller","isSchedule","loadingModal","topicId","time","scheduleDate","scheduleTime","scheduleDateTime","jumpToUrl","schedule","showModal","push_post_id","is_schedule","schedule_datetime","jump_to_url","close","cookie_name","local_storage_key","url_condition_flag","personalize","heatmap_preset_id","heatmapTitle","update_heatmap_report","endDate","tmp","_heatmapPresetId","_heatmapDevice","_heatmapReportType","initializeScrollHeatmapElements","scroll_heatmap","create_scroll_heatmap_css_style_element","top_to_end_user_ratio","options","convertShmStyle","k","reduce","prev","curr","updated_top_to_end_user_ratio","key_array","create_linear_gradient_style","gradation","val_key","_index","heatmap__content_width","heatmap__content_height","heatmap__content_right","heatmap__container_width","heatmap__container_height","heatmap__container_top","heatmap__container_right","heatmap__label_0_top","heatmap__label_25_top","heatmap__label_50_top","heatmap__label_75_top","heatmap__label_100_top","linear_gradient_style_content","scroll_heatmap_style","label_common_style","docHeight","platta_scroll_heatmap_css","config","container","radius","maxOpacity","minOpacity","blur","heatmapInstance","h337","dataPoint","_heatmap_data_json","calcDataPoint","iframeDoc","getElementsByTagName","contentWindow","point","evaluate","xpath","XPathResult","FIRST_ORDERED_NODE_TYPE","singleNodeValue","getComputedStyle","rect","getBoundingClientRect","x","round","localX","y","localY","addData","changeCartSystem","cartSystem","pcPrefixItem","pcPrefixImage","spPrefixItem","spPrefixImage","resetInputRemove","itemUrl","activityUrl","cartSystemName","ftpHost","ftpUser","ftpPassword","ftpFilePath","itemUrlPrefix","imageUrlPrefix","spItemUrlPrefix","spImageUrlPrefix","item_csv_url","activity_csv_url","cart_system_name","ftp_host","ftp_user","ftp_password","ftp_file_path","item_url_prefix","image_url_prefix","sp_item_url_prefix","sp_image_url_prefix","table","tr","clone","td","urlType","isExcluded","targetTable","url_type","is_excluded","selectorType","selectors","selector_type","recommend_group_update_url","recommend_group_setting_id","editor","editor2","ace","edit","session","setMode","setTheme","getSession","setTabSize","annotations","getAnnotations","test","splice","setAnnotations","recommend_group_setting_type_data","setting_type","recommend_group_id","recommend_group_device_setting_id","recommend_group_setting_element_placement","sw_navigation_flag_val","sw_pagination_flag_val","sw_slides_per_view_val","sw_slides_per_group_val","sw_grid_rows_val","sw_space_between_val","sw_loop_flag_val","sw_navigation_flag","sw_pagination_flag","sw_slides_per_group","sw_slides_per_view","sw_grid_rows","sw_space_between","sw_loop_flag","css_val","getValue","word","values","input","recommend_search_setting_id","excludedUrls","search_element_selector","append_element_selector","matchItemCount","recommendItemCount","match_item_count","recommend_item_count","cssVal","column","setupChangeHandler","setting_name","recommend_retargeting_update_url","recommend_retargeting_setting_id","days_after_purchase","htmlVal","html_val","editModal","qrCodeModal","setOptions","maxLines","minLines","createPreview","previewId","setValue","editPreview","htmlContent","inputTimer","updateData","attachValue","categoryName","suffix","getContactHistories","customer_id","redirectWithQueries","queries","contactStatuses","selectOption","sortName","sortDirection","query","detailModal","importModal","elm","bool","isLetterBodyWrote","isLetterAddressWrote","letterPostedAt","memo","contact_type","customer","searchQueries","statusId","removeAttr","recommend_campaign_update_url","recommend_campaign_setting_id","pc_show_valid","sp_show_valid","gender_segment_flag","loyalty_segment_flag","days_after_display","pc_html","sp_html","post_val","post_url_val","newUrl","sns_posts","postHtml","s3_base_url","created_at_date","mediaContent","generateMediaContent","staff_name","staff_ugc_name","staff_login_id","staff_login_password","staff_group_name","staff_remark","staff_id","staff_is_active","updateStaffUrlAndRedirect","getStaffParameters","s3_staff_img_url","company_login_id","isValid","errorMessage","sns_post_caption"],"mappings":";+KAAA,uQAYAA,IAAMC,QACNC,IAAWD,QACXE,S,sBCXA,IAAMC,EAAWC,OACjBD,EAASE,OAAOC,QAAQH,E,oBCJxB,SAASI,EAAoBC,GAC5B,IAAIC,EAAI,IAAIC,MAAM,uBAAyBF,EAAM,KAEjD,MADAC,EAAEE,KAAO,mBACHF,CACP,CACAF,EAAoBF,KAAO,WAAa,MAAO,EAAI,EACnDE,EAAoBK,QAAUL,EAC9BM,EAAOC,QAAUP,EACjBA,EAAoBQ,GAAK,G,sBCRzBC,qBAASC,iBAAiB,mBAAmB,WAC3CC,EAAE,+DAA+DC,GAAG,UAAU,WAC5E,IAAIC,EAAaF,EAAE,gDAAgDG,MAC/DC,EAAWJ,EAAE,iDAAiDG,MAElEE,SAASC,KAAT,8CAAuDJ,EAAvD,qBAA8EE,EAC/E,IAEDJ,EAAE,4BAA4BC,GAAG,SAAS,WACxC,IAAIC,EAAaF,EAAE,gDAAgDG,MAC/DC,EAAWJ,EAAE,iDAAiDG,MAE9DI,EAAaC,OAAOR,EAAES,MAAMC,KAAK,eACjCC,EAAaH,OAAOR,EAAES,MAAMC,KAAK,WACjCE,EAAUZ,EAAES,MAAMC,KAAK,WAEvBH,EAAaI,EACfE,MAAM,gKAIRb,EAAEc,KAAK,CACLC,IAAK,uBACLC,KAAM,OACNN,KAAM,CAC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0BAC1B6f,EAAOQ,OAAS,IACPjuB,EAAES,MAAMmN,SAAS,+BAC1B6f,EAAOQ,OAAS,KAElB2oC,EAA0BnpC,EAC3B,IAEDztB,EAAE,sEAAsEC,GAAG,SAAS,WAClF,IAAIwtB,EACAztB,EAAES,MAAMmN,SAAS,oCACnB6f,EAASopC,KACF3oC,GAAK,KACZT,EAAOI,UAAY7tB,EAAE,2BAA2BG,MAChDstB,EAAOK,QAAU9tB,EAAE,yBAAyBG,OACnCH,EAAES,MAAMmN,SAAS,uCAC1B6f,EAASopC,KACF3oC,GAAK,KACZT,EAAOI,UAAY7tB,EAAE,2BAA2BG,MAChDstB,EAAOK,QAAU9tB,EAAE,yBAAyBG,OAI9Cy2D,EAA0BnpC,EAC3B,IAEDztB,EAAE,iCAAiCC,GAAG,UAAU,WAC9C,IAAIyvB,EAAQ1vB,EAAE,iDAAiDG,MAC3DY,EAAM,IAAI0J,IAAI7F,OAAOvE,SAASC,MAElC,GAAa,IAATovB,EAAa,CACf,GAAI3uB,EAAI2R,aAAaC,IAAI,KAAM,CAE7B,IAAIgd,EAAYD,EAEhB3uB,EAAI2R,aAAaE,IAAI,IAAK+c,EAC3B,MAGC5uB,EAAI2R,aAAa9Q,OAAO,IAAK8tB,GAI/BrvB,SAASC,KAAOS,EAAIgS,UACrB,MAEC1S,SAASC,KAAO,cAEnB,IAEDN,EAAE,uBAAuBC,GAAG,SAAS,WACnC,IAAIK,EAAO,sBACXA,GAAI,oBAAiBN,EAAE,0CAA0CG,OACjEG,GAAI,kBAAeN,EAAE,wBAAwBU,KAAK,WAClDJ,GAAI,qBAAkBN,EAAE,2BAA2BG,OACnDG,GAAI,mBAAgBN,EAAE,yBAAyBG,OAC/CE,SAASC,KAAOA,CACjB,GAEF,G","file":"js/application-8e197df93d64d9711fab.chunk.js","sourcesContent":["// This file is automatically compiled by Webpack, along with any other files\n// present in this directory. You're encouraged to place your actual application logic in\n// a relevant structure within app/javascript and only use these pack files to reference\n// that code so it'll be compiled.\n\nimport Rails from '@rails/ujs';\nimport Turbolinks from 'turbolinks';\nimport * as ActiveStorage from '@rails/activestorage';\nimport 'channels';\n\nimport 'jquery';\n\nRails.start();\nTurbolinks.start();\nActiveStorage.start();\n\nimport 'chartkick/chart.js';\nimport './m';\nimport './application_view';\nimport './communication_management';\nimport './product_update';\nimport './manual_my_post';\nimport './manual_my_post_display';\nimport './ugc_optimization';\nimport './darkmode';\nimport './chat_bot';\nimport './chat_option';\nimport './crm';\nimport './contents';\nimport './contents_list';\nimport './popup';\nimport './site_insert';\nimport './block_exit';\nimport './push_notification';\nimport './personalize';\nimport './personalize_list';\nimport './heatmap_preset';\nimport './recommend_settings';\nimport './recommend_group_setting';\nimport './recommend_search_settings';\nimport './recommend_tuning_setting';\nimport './recommend_retargeting_setting';\nimport './recommend_preview';\nimport './sales_index';\nimport './recommend_campaign_setting';\nimport './admin';\nimport './non_deletable_sns_post';\nimport './staff';\n","// Load all the channels within this directory and all subdirectories.\n// Channel files must be named *_channel.js.\n\nconst channels = require.context('.', true, /_channel\\.js$/)\nchannels.keys().forEach(channels)\n","function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = 148;","document.addEventListener('turbolinks:load', function () {\n $('#admin_resize_account_select, #admin_resize_img_size_select').on('change', function () {\n let account_id = $('#admin_resize_account_select option:selected').val();\n let img_size = $('#admin_resize_img_size_select option:selected').val();\n\n location.href = `/admin_resize_image_list?account_id=${account_id}&img_size=${img_size}`;\n });\n\n $('.admin_resize_img_submit').on('click', function () {\n let account_id = $('#admin_resize_account_select option:selected').val();\n let img_size = $('#admin_resize_img_size_select option:selected').val();\n\n let img_height = Number($(this).data('img_height'));\n let resize_val = Number($(this).data('resize'));\n let img_url = $(this).data('img_url');\n\n if (img_height < resize_val) {\n alert('現在の画像の高さより小さいサイズを選択してください。');\n return;\n }\n\n $.ajax({\n url: '/admin_resize_submit',\n type: 'POST',\n data: {\n account_id: account_id,\n img_size: img_size,\n resize_val: resize_val,\n img_url: img_url,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n $('#admin_resize_video_account_select').on('change', function () {\n let account_id = $('#admin_resize_video_account_select option:selected').val();\n let related_flag = $('#admin_resize_video_account_relation_flag option:selected').val();\n\n location.href = `/admin_resize_video_list?account_id=${account_id}&related_flag=${related_flag}`;\n });\n\n $('#admin_resize_video_account_relation_flag').on('change', function () {\n let account_id = $('#admin_resize_video_account_select option:selected').val();\n let related_flag = $('#admin_resize_video_account_relation_flag option:selected').val();\n\n location.href = `/admin_resize_video_list?account_id=${account_id}&related_flag=${related_flag}`;\n });\n\n // 新たに追加されるアップロード処理\n // $(document).on('click', '.upload_admin_resize_video', function() {\n $('.upload_admin_resize_video').on('click', function () {\n let index = $(this).data('index');\n let fileInput = $('#fileInput_' + index); // 不要な代入を削除\n let file = fileInput[0].files[0]; // 正しくファイルを取得\n\n if (!file) {\n alert('ファイルが選択されていません。');\n return;\n }\n\n let key = $(this).data('key'); // 正しくキーを取得\n\n let formData = new FormData();\n formData.append('video', file);\n formData.append('key', key);\n\n $.ajax({\n url: '/upload_admin_resize_video',\n type: 'POST',\n data: formData,\n processData: false, // jQueryがデータを処理しないように指定\n contentType: false, // contentTypeもfalseに設定\n success: function (data) {\n alert('アップロード成功!');\n location.reload();\n },\n error: function (jqXHR, textStatus, errorThrown) {\n alert('アップロード失敗');\n location.reload();\n },\n });\n });\n\n $('.delete_admin_video').on('click', function () {\n let account_id = $('#admin_resize_video_account_select option:selected').val();\n \n let key = $(this).data('key'); // 正しくキーを取得\n let row = $(this).closest('tr'); // 削除する行を選択\n\n $.ajax({\n url: '/delete_admin_resize_video',\n type: 'POST',\n data: {\n account_id: account_id,\n key: key,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n row.fadeOut(400, function () {\n // フェードアウトアニメーションで行を削除\n $(this).remove(); // アニメーションが完了したらDOMから行を削除\n });\n } else {\n alert('削除に失敗しました。');\n }\n });\n });\n\n $('#create_admin_news_btn').on('click', function () {\n let title = $(\".create_admin_news_title\").val();\n let content = $(\".create_admin_news_content\").val();\n let flag = 0;\n\n if (!title || !content) {\n alert(\"タイトルまたは本文が空欄です。入力してください。\");\n return;\n }\n\n if ($('.create_admin_news_flag:checked').length > 0) {\n flag = 1\n }\n\n $.ajax({\n url: '/create_admin_news',\n type: 'POST',\n data: {\n title: title,\n content: content,\n flag: flag\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n $('.admin_news_edit').on('click', function () {\n let id = $(this).data(\"id\");\n let title = $(this).data(\"title\");\n let content = $(this).data(\"content\");\n\n $(\".admin_news_edit_id\").val(id);\n $(\".admin_news_edit_title\").val(title);\n $(\".admin_news_edit_content\").val(content);\n\n });\n\n $('.admin_news_edit_submit_btn').on('click', function () {\n let id = $(\".admin_news_edit_id\").val();\n let title = $(\".admin_news_edit_title\").val();\n let content = $(\".admin_news_edit_content\").val();\n\n if (!id || !title || !content) {\n alert(\"タイトルまたは本文が空欄です。入力してください。\");\n return;\n }\n\n $.ajax({\n url: '/edit_admin_news',\n type: 'POST',\n data: {\n title: title,\n content: content,\n id: id\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n $('.admin_news_display').on('click', function () {\n let id = $(this).data(\"id\");\n let flag = $(this).data(\"flag\");\n\n $.ajax({\n url: '/edit_admin_news_flag',\n type: 'POST',\n data: {\n id: id,\n flag: flag\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // topページ(ダッシュボード)\n $('.news_modal_click').on('click', function () {\n let title = $(this).data(\"title\");\n let content = $(this).data(\"content\");\n\n $(\".news_modal_title\").text(title);\n content = content.replace(/\\n/g, '
');\n $(\".news_modal_content\").html(content);\n });\n});\n","document.addEventListener('turbolinks:load', function () {\n // 開発環境での開発スピードを上げるため青木の開発環境でのみ\n // manage/app/javascript/packs内の本jsファイルを走らせない\n if ((location.href.includes('dev-manage-ssl.platta.jp') || location.href.includes('http://18.177.103.115:3004')) && !location.href.includes('?dev27aoki')) {\n console.log('dev環境 public.jsを使用');\n return;\n }\n //!!!!!!!!!!!!!!!!!!!!!!!!!!! pack内の.jsファイルに上記を適用 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n const ERROR_MSG = 'エラー! 処理を完了できませんでした\\n時間おいて再度実行しても、このエラーが修正されない場合は\\nお手数ですがサポートチームにお問い合わせください';\n const MAIL_PATTERN = /^[a-zA-Z0-9_+-]+(.[a-zA-Z0-9_+-]+)*@([a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]*\\.)+[a-zA-Z]{2,}$/;\n const PASSWORD_PATTERN = /([0-9].*[a-zA-Z]|[a-zA-Z].*[0-9])/;\n const DOMAIN = $('#pl_domain').val();\n let current_url = location.href;\n\n const left_menu_el = $('.left_menu');\n // ログイン画面やアドミン画面で非表示させないようにする\n if (left_menu_el.length > 0) {\n const sidebar_hide_mark_el = $('.application_hide_sidebar');\n const sidebar_hide_mark_el_icon = $('.application_hide_sidebar__icon');\n const div_main_el = $('div.main');\n\n // サイドバーを開く、閉じるを実装\n // 上記だとmouse移動時に常にイベントが走って負荷が重いため下記に変更した\n let throttled = _.throttle(function (e) {\n if (e.pageX < 800) {\n sidebar_hide_mark_el.fadeIn(300);\n } else {\n sidebar_hide_mark_el.fadeOut(300);\n }\n }, 200);\n\n $(document).on('mousemove', throttled);\n\n $('.application_hide_sidebar, #menu_display')\n // .off('click')\n // .on('click', function () {\n // if (left_menu_el.is(':visible')) {\n // left_menu_el.hide(500);\n // div_main_el.animate({ 'padding-left': '0px' }, 500);\n // sidebar_hide_mark_el.animate({ left: '1%' });\n // sidebar_hide_mark_el_icon.removeClass('fa-angles-left');\n // sidebar_hide_mark_el_icon.addClass('fa-angles-right');\n // } else {\n // left_menu_el.show(500);\n // div_main_el.animate({ 'padding-left': '216px' }, 500);\n // sidebar_hide_mark_el.animate({ left: '200px' });\n // sidebar_hide_mark_el_icon.addClass('fa-angles-left');\n // sidebar_hide_mark_el_icon.removeClass('fa-angles-right');\n // }\n // });\n }\n\n // すべての投稿一覧、設定/upload関連, 分析 application.html.erb click時アコーディオン表示\n $('#to_all_post_type_display, #to_all_master_upload, #to_all_setting_upload, #to_all_analytics, #to_all_groups, #to_all_accounts, #to_hashframe').on('click', function (event) {\n let ulElement = $(`#${$(this).attr(\"id\")}_ul`);\n\n if (ulElement.is(':visible')) {\n // 非表示\n ulElement.slideUp();\n } else {\n // 表示\n ulElement.slideDown();\n }\n\n event.stopPropagation();\n });\n});\n","document.addEventListener('turbolinks:load', function () {\n const ERROR_MSG = 'エラー! 処理を完了できませんでした\\n時間おいて再度実行しても、このエラーが修正されない場合は\\nお手数ですがサポートチームにお問い合わせください';\n const MAIL_PATTERN = /^[a-zA-Z0-9_+-]+(.[a-zA-Z0-9_+-]+)*@([a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]*\\.)+[a-zA-Z]{2,}$/;\n const PASSWORD_PATTERN = /([0-9].*[a-zA-Z]|[a-zA-Z].*[0-9])/;\n // ! 本番と開発環境で異なるため注意!!\n // const S3_MEDIA_URL = 'https://d33l209u0sdjqk.cloudfront.net'; // 開発\n // const S3_MEDIA_URL = 'https://media.platta.jp'; // 本番\n\n // const S3_MEDIA_URL = 'https://platta-dev.s3.ap-northeast-1.amazonaws.com'; // 開発\n // const S3_MEDIA_URL = 'https://platta-pro.s3.ap-northeast-1.amazonaws.com'; // 本番\n\n const S3_MEDIA_URL = $('#pl_s3_media_domain').val();\n\n const DOMAIN = $('#pl_domain').val();\n\n // ハッシュタグ検索の初期の画面でフィルターをかける処理\n let current_url = window.location.href;\n\n //*********************************************************************\n // 初期処理系\n //*********************************************************************\n //############################################################\n // フォーカス\n //############################################################\n if (location.pathname == '/new' || location.pathname == '/login' || location.pathname == '/') {\n $(\"input[type='text']:visible\").eq(0).focus();\n }\n\n //############################################################\n // エンター押下\n //############################################################\n $(document).keypress(function (e) {\n if (e.keyCode == 13 && e.target.nodeName !== 'TEXTAREA') {\n $('.enter').click();\n return false;\n }\n });\n\n //############################################################\n // フラッシュメッセージフェードアウト\n //############################################################\n setTimeout(function() {\n $('#flash-message').fadeOut('slow');\n }, 3000);\n\n //############################################################\n // スペーストリム\n //############################################################\n $('input,textarea').on('blur', function () {\n $('input,textarea').each(function (i, e) {\n $(e).val($.trim($(e).val()));\n });\n $(\"input[type='text']\").trigger('keyup');\n $(\"input[type='email']\").trigger('keyup');\n $('textarea').trigger('keyup');\n });\n\n //############################################################\n // ベースレイアウトの切り替え\n //############################################################\n $('.to_chat_bot').on('click', function () {\n $.ajax({\n url: DOMAIN + '/change_chat_bot_layout',\n type: 'GET',\n data: {},\n dataType: 'json',\n }).done(function (data) {\n location.href = '/';\n });\n });\n\n $('.to_smm').on('click', function () {\n $.ajax({\n url: DOMAIN + '/change_smm_layout',\n type: 'GET',\n data: {},\n dataType: 'json',\n }).done(function (data) {\n location.href = '/';\n });\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // ガイドフロー\n //-----------------------------------------------------------------------------------------------------------------\n //############################################################\n // ガイドフロー 次のページフォームを表示\n //############################################################\n $('.next_page').on('click', function () {\n let next_page = $(this).data('page');\n let this_action = $(this).data('action');\n $('#page-' + next_page).fadeIn(360);\n $('#next_action_select-wrapper_' + (next_page * 1 - 1) + '_' + this_action).slideUp(500);\n $('html, body').animate(\n {\n scrollTop: $(window).scrollTop() + 260,\n },\n 500,\n 'swing'\n );\n });\n //############################################################\n // ガイドフロー 次のアクションフォームを表示\n //############################################################\n $('.next_action').on('click', function () {\n let this_page = $(this).data('page');\n let next_action = $(this).data('action');\n $('#action-' + this_page + '-' + next_action).fadeIn(360);\n $('#next_action_select_wrapper_' + this_page + '_' + (next_action * 1 - 1)).slideUp(500);\n $('html, body').animate(\n {\n scrollTop: $(window).scrollTop() + 260,\n },\n 500,\n 'swing'\n );\n });\n //############################################################\n // ガイドフロー登録\n //############################################################\n $('#create_guide').on('click', function () {\n let pages = [];\n let actions = {};\n for (let i = 1; i <= 10; i++) {\n let urls = [];\n if ($('#page_' + i).is(':visible')) {\n if ($('#url_' + i).val() != '') {\n urls.push($('#url_' + i).val());\n pages.push(urls);\n } else {\n break;\n }\n } else {\n break;\n }\n for (let j = 1; j <= 10; j++) {\n let guide_no = i + '-' + j;\n if ($('#action_' + guide_no).is(':visible') && $('#obj_' + guide_no).val() != '') {\n actions[guide_no] = {};\n actions[guide_no]['obj'] = $('#obj_' + guide_no).val();\n actions[guide_no]['message'] = $('#message_' + guide_no).val();\n } else {\n break;\n }\n }\n }\n\n if (!confirm('この内容でガイドフローを作成しますか?')) {\n return;\n }\n $('#create_guide').css('pointer-events', 'none');\n $.ajax({\n url: DOMAIN + '/create_guide',\n type: 'POST',\n data: {\n name: $('#name').val(),\n pages: pages,\n actions: actions,\n },\n dataType: 'json',\n })\n .done(function (data) {\n if (data.ret == 0) {\n alert('OK');\n }\n })\n .fail(function () {\n alert(ERROR_MSG);\n $('#create_guide').css('pointer-events', 'auto');\n });\n });\n\n //############################################################\n // ガイドフロー 一覧表示\n //############################################################\n $('.delete').on('click', function () {\n if (!confirm(`フロー${$(this).data('num')}を削除しますか?`)) {\n return;\n }\n $('.delete').css('pointer-events', 'none');\n $.ajax({\n url: DOMAIN + '/delete_flow',\n type: 'POST',\n data: {\n id: $(this).data('val'),\n },\n dataType: 'json',\n })\n .done(function () {\n alert('OK');\n $('.delete').css('pointer-events', 'auto');\n })\n .fail(function () {\n alert(ERROR_MSG);\n $('.delete').css('pointer-events', 'auto');\n });\n });\n\n //############################################################\n // ガイドフローの管理 トップページのグラフ選択\n //############################################################\n $('.flow_cv').on('click', function () {\n $(this).css('background-color', '#ffffd5');\n $('.flow_start').css('background-color', 'white');\n $('.next_click').css('background-color', 'white');\n $('.show_action').css('background-color', 'white');\n $('.flow_cv_chart').css('display', 'block');\n $('.flow_start_chart').css('display', 'none');\n $('.next_click_chart').css('display', 'none');\n $('.show_action_chart').css('display', 'none');\n });\n $('.flow_start').on('click', function () {\n $('.flow_cv').css('background-color', 'white');\n $(this).css('background-color', '#ffffd5');\n $('.next_click').css('background-color', 'white');\n $('.show_action').css('background-color', 'white');\n $('.flow_cv_chart').css('display', 'none');\n $('.flow_start_chart').css('display', 'block');\n $('.next_click_chart').css('display', 'none');\n $('.show_action_chart').css('display', 'none');\n });\n $('.next_click').on('click', function () {\n $('.flow_cv').css('background-color', 'white');\n $('.flow_start').css('background-color', 'white');\n $(this).css('background-color', '#ffffd5');\n $('.show_action').css('background-color', 'white');\n $('.flow_cv_chart').css('display', 'none');\n $('.flow_start_chart').css('display', 'none');\n $('.next_click_chart').css('display', 'block');\n $('.show_action_chart').css('display', 'none');\n });\n $('.show_action').on('click', function () {\n $('.flow_cv').css('background-color', 'white');\n $('.flow_start').css('background-color', 'white');\n $('.next_click').css('background-color', 'white');\n $(this).css('background-color', '#ffffd5');\n $('.flow_cv_chart').css('display', 'none');\n $('.flow_start_chart').css('display', 'none');\n $('.next_click_chart').css('display', 'none');\n $('.show_action_chart').css('display', 'block');\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // 管理者ログイン\n //-----------------------------------------------------------------------------------------------------------------\n //############################################################\n // admin_login\n //############################################################\n $('.admin_login_button').on('click', function () {\n $('.admin_login_button').css('pointer-events', 'none');\n $.ajax({\n url: DOMAIN + '/application/admin_login',\n type: 'POST',\n data: {\n id: $(this).data('val'),\n },\n dataType: 'json',\n })\n .done(function (data) {\n if (data.ret == 1) {\n location.href = '/';\n }\n })\n .fail(function () {\n alert(ERROR_MSG);\n $('#login').css('pointer-events', 'auto');\n });\n });\n\n $('#admin_report_ym').on('change', function () {\n let href = '/admin_report';\n href += `?ym=${$('#admin_report_ym').val()}`;\n location.href = href;\n });\n\n $('#admin_create_account').on('click', function () {\n let login_name = $('#create_login_name').val();\n let company_name = $('#create_company_name').val();\n\n let service_flag;\n let is_smm_checkbox = $('.platta_smm_checkbox').is(':checked');\n let is_ai_checkbox = $('.edit_ai_checkbox').is(':checked');\n\n if (is_smm_checkbox && is_ai_checkbox) {\n // SMMとレコメンド\n service_flag = 4;\n } else if (is_smm_checkbox) {\n // SMMのみ\n service_flag = 1;\n } else if (is_ai_checkbox) {\n // レコメンドのみ\n service_flag = 3;\n } else {\n // 利用なし\n service_flag = 0;\n }\n\n // 空の入力フィールドのバリデーション\n if (!login_name || !company_name) {\n alert('すべてのフィールドを入力してください');\n return;\n }\n\n $.ajax({\n url: DOMAIN + '/application/admin_create_account',\n type: 'POST',\n data: {\n login_name: login_name,\n company_name: company_name,\n service_flag: service_flag,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n $('#platta_customer_login_id').val(data.login_name);\n $('#platta_customer_dir_key').val(data.dir_key);\n $('#platta_customer_login_password').val(data.password);\n\n $('#normal_tag').val('');\n $('#cv_tag').val('');\n $('#create_tab_modal').css('display', 'block');\n $('#create_tab_modal_container').css('display', 'block');\n\n $('#create_tab_modal, #create_tab_modal_close').on('click', function () {\n location.reload();\n });\n\n $('#create_tab_modal_reload_button').on('click', function () {\n location.reload();\n });\n }\n });\n });\n\n $('#admin_pv_select').on('change', function () {\n let ym = $('#admin_pv_select option:selected').val();\n let href = '/admin_pv_report';\n href += `?year_month=${ym}`;\n location.href = href;\n });\n\n $('.admin_customer_list_name').on('click', function () {\n let account_id = $(this).data('id');\n let login_name = $(this).data('login_name');\n let company_name = $(this).data('company_name');\n let service_flag = $(this).data('service_flag');\n\n $('.edit_smm_checkbox').prop('checked', false);\n $('.edit_cx_checkbox').prop('checked', false);\n $('.edit_ai_checkbox').prop('checked', false);\n\n $('#edit_login_name').val(login_name);\n $('#edit_company_name').val(company_name);\n\n $('#edit_account_id').val(account_id);\n\n if (service_flag == 4 || service_flag == 999) {\n $('.edit_smm_checkbox').prop('checked', true);\n $('.edit_ai_checkbox').prop('checked', true);\n } else if (service_flag == 1) {\n $('.edit_smm_checkbox').prop('checked', true);\n } else if (service_flag == 3) {\n $('.edit_ai_checkbox').prop('checked', true);\n }\n });\n\n $('#admin_edit_account').on('click', function () {\n let account_id = $('#edit_account_id').val();\n let company_name = $('#edit_company_name').val();\n\n let service_flag;\n let is_smm_checkbox = $('.edit_smm_checkbox').is(':checked');\n let is_ai_checkbox = $('.edit_ai_checkbox').is(':checked');\n\n if (is_smm_checkbox && is_ai_checkbox) {\n // SMMとCXとレコメンド\n service_flag = 4;\n } else if (is_smm_checkbox) {\n // SMMのみ\n service_flag = 1;\n } else if (is_ai_checkbox) {\n // レコメンドのみ\n service_flag = 3;\n } else {\n // 利用なし\n service_flag = 0;\n }\n\n // 空の入力フィールドのバリデーション\n if (!company_name) {\n alert('すべてのフィールドを入力してください');\n return;\n }\n\n $.ajax({\n url: DOMAIN + '/application/admin_edit_account',\n type: 'POST',\n data: {\n account_id: account_id,\n company_name: company_name,\n service_flag: service_flag,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n $('.parent_checkbox').on('change', function () {\n let recommend_item_id = $(this).data('id');\n let account_id = $('.admin_associate_container').data('ac');\n\n if ($(this).is(':checked')) {\n // このチェックボックス以外のすべてのチェックボックスを無効にする\n $('.parent_checkbox').not(this).prop('disabled', true);\n\n let el = ``;\n\n $('.admin_associate_container').append(el);\n\n $.ajax({\n url: '/application/get_child_item_list',\n type: 'GET',\n data: {\n account_id: account_id,\n recommend_item_id: recommend_item_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n $.each(data.parent_items, function (index, parent_item) {\n let isChecked = data.child_items.some((child_item) => child_item.related_item_id === parent_item.id);\n $('.admin_child_associate_item').append(\n `\n \n \"\"\"\n \n
\n ${truncateText(parent_item.title, 15)}\n
\n \n `\n );\n });\n\n $('.admin_child_associate_item_container').removeClass('hidden');\n $('.admin_child_associate_item_container').addClass('block');\n }\n });\n\n function truncateText(text, maxLength) {\n if (text.length > maxLength) {\n return text.substring(0, maxLength) + '...';\n } else {\n return text;\n }\n }\n } else {\n // チェックボックスの選択が解除された場合、すべてのチェックボックスを再度有効にする\n $('.parent_checkbox').prop('disabled', false);\n $('.admin_child_associate_item_container').removeClass('block');\n $('.admin_child_associate_item_container').remove('.admin_child_associate_item_container');\n }\n });\n\n $(document).on('change', '.child_checkbox', function () {\n let child_id = $(this).data('id');\n let parent_checkbox = $('.parent_checkbox:checked');\n let parent_id = parent_checkbox.data('id');\n let account_id = $('.admin_associate_container').data('ac');\n\n let parent_relate_box = parent_checkbox.closest('td').siblings('.parent_relate_box');\n\n if ($(this).is(':checked')) {\n console.log('Child ID: ' + child_id + ', Parent ID: ' + parent_id);\n\n $.ajax({\n url: '/application/related_child_item',\n type: 'POST',\n data: {\n account_id: account_id,\n child_id: child_id,\n parent_id: parent_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n // parent_relate_boxのテキストを「連携中」に設定\n parent_relate_box.text('連携中');\n }\n });\n } else {\n // チェックボックスが外された時の処理\n console.log('Unchecked - Child ID: ' + child_id + ', Parent ID: ' + parent_id);\n\n // ここにチェックが外された時の処理を記述\n // 必要に応じてAJAXリクエストを送信する\n\n $.ajax({\n url: '/application/unrelated_child_item',\n type: 'POST',\n data: {\n account_id: account_id,\n child_id: child_id,\n parent_id: parent_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n if ($('.child_checkbox:checked').length === 0) {\n // parent_relate_boxのテキストを空白に設定\n parent_relate_box.text('');\n }\n }\n });\n }\n });\n\n $('.consumable_checkbox').on('change', function () {\n let recommend_item_id = $(this).data('id');\n let account_id = $('.admin_associate_container').data('ac');\n\n let consumable_flag = $(this).is(':checked') ? 1 : 0;\n\n console.log(consumable_flag);\n\n $.ajax({\n url: '/application/change_consumable_flag',\n type: 'POST',\n data: {\n account_id: account_id,\n recommend_item_id: recommend_item_id,\n consumable_flag: consumable_flag,\n },\n dataType: 'json',\n }).done(function (data) {});\n });\n\n $('.gender_target_flag').on('change', function () {\n let recommend_item_id = $(this).data('id');\n let account_id = $('.admin_associate_container').data('ac');\n\n let gender_target_flag = $(this).find('option:selected').val();\n\n console.log(gender_target_flag);\n\n $.ajax({\n url: '/application/change_gender_target_flag',\n type: 'POST',\n data: {\n account_id: account_id,\n recommend_item_id: recommend_item_id,\n gender_target_flag: gender_target_flag,\n },\n dataType: 'json',\n }).done(function (data) {});\n });\n\n // FB連携解除ボタン\n if ($('.clear-fb-token').length) {\n $('.clear-fb-token').on('click', function () {\n let acId = $(this).attr('data-val');\n let acName = $(this).attr('data-ac-name');\n if (!confirm(acId + '. ' + acName + ' のFaceBook連携情報を削除しますか?')) {\n return;\n }\n setTimeout(function () {\n $(this).css('pointer-events', 'none');\n }, 0);\n $.ajax({\n url: '/m/clear_fb_token',\n type: 'POST',\n data: {\n account_id: acId,\n },\n dataType: 'json',\n })\n .done(function (data) {\n if (data['ret'] == 0) {\n alert('FaceBook連携情報を削除しました。');\n location.reload();\n } else {\n alert(data['message']);\n }\n })\n .fail(function () {\n alert('FaceBook連携情報の削除に失敗しました。');\n })\n .always(function () {\n $(this).css('pointer-events', 'auto');\n });\n });\n $('.clear-fb-token').on('mouseenter', function () {\n $(this).css('background-color', 'red');\n $(this).text('連携解除');\n });\n $('.clear-fb-token').on('mouseleave', function () {\n $(this).css('background-color', '#1e40af');\n $(this).text('FB連携済');\n });\n }\n\n //-----------------------------------------------------------------------------------------------------------------\n // アカウント管理\n //-----------------------------------------------------------------------------------------------------------------\n\n //############################################################\n // account_edit / settings / facebook_connect タブで1つの項目にまとめる\n // タブの切替\n //############################################################\n $(function () {\n $('.sb_account__tab').on('click', function () {\n $('.sb_account__tab').removeClass('active');\n // $('.sb_account__panel').removeClass('active');\n $('.sb_account__panel').addClass('hidden');\n $('.sb_account__tab').children('.sb_account__tab_text').removeClass('border-b border-gray-500 dark:border-gray-700');\n $(this).children('.sb_account__tab_text').addClass('border-b border-gray-500 dark:border-gray-700');\n $(this).addClass('active');\n var index = $('.sb_account__tab').index(this);\n $('.sb_account__panel').eq(index).removeClass('hidden');\n });\n });\n\n // アカウント設定ページにいるときはクリックできないようにする\n if (current_url === DOMAIN + '/account_edit') {\n $('.to_account_edit').css('pointer-events', 'none');\n }\n\n $('.to_account_edit').on('click', function () {\n location.href = DOMAIN + '/account_edit';\n });\n\n //############################################################\n // アカウント更新リクエスト\n //############################################################\n $('#update_account').on('click', function () {\n // validation\n if ($('#company_name').val() == '') {\n alert('会社名を入力してください');\n return;\n }\n if ($('#person_name').val() == '') {\n alert('担当者名を入力してください');\n return;\n }\n if ($('#division').val() == '') {\n alert('担当者部署を入力してください');\n return;\n }\n if ($('#mail').val() == '') {\n alert('メールアドレスを入力してください');\n return;\n }\n if ($('#tel').val() == '') {\n alert('電話番号を入力してください');\n return;\n }\n if ($('#post').val() == '') {\n alert('会社郵便番号を入力してください');\n return;\n }\n if ($('#address').val() == '') {\n alert('会社住所を入力してください');\n return;\n }\n if ($('#mail').length && $('#mail').val() != '' && !$('#mail').val().match(MAIL_PATTERN)) {\n alert('メールアドレスを正しく入力してください');\n return false;\n }\n\n if (!confirm('アカウント情報を更新しますか?')) {\n return;\n }\n\n $('#update_account').css('pointer-events', 'none');\n $.ajax({\n url: DOMAIN + '/update_account',\n type: 'POST',\n data: {\n company_name: $('#company_name').val(),\n person_name: $('#person_name').val(),\n division: $('#division').val(),\n mail: $('#mail').val(),\n tel: $('#tel').val(),\n post: $('#post').val(),\n address: $('#address').val(),\n insta_business_id: $('#insta_business_id').val(),\n insta_access_token: $('#insta_access_token').val(),\n },\n dataType: 'json',\n })\n .done(function (data) {\n if (data.ret == 0) {\n alert('アカウント情報が正常に更新されました');\n $('#update_account').css('pointer-events', 'auto');\n } else {\n alert(ERROR_MSG);\n $('#update_account').css('pointer-events', 'auto');\n }\n })\n .fail(function () {\n alert(ERROR_MSG);\n $('#login').css('pointer-events', 'auto');\n });\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // ログイン\n //-----------------------------------------------------------------------------------------------------------------\n //############################################################\n // ログイン\n //############################################################\n $('#login').on('click', function () {\n $('#login').css('pointer-events', 'none');\n $.ajax({\n url: DOMAIN + '/application/create_session',\n type: 'POST',\n data: {\n login_id: $('#login_id').val(),\n password: $('#password').val(),\n },\n dataType: 'json',\n })\n .done(function (data) {\n if (data.ret == 1) {\n location.href = '/';\n } else if (data.ret == 2) {\n location.href = '/admin';\n } else {\n alert('ログインIDまたはパスワードが違います');\n $('#login').css('pointer-events', 'auto');\n }\n })\n .fail(function () {\n alert(ERROR_MSG);\n $('#login').css('pointer-events', 'auto');\n });\n });\n\n // パスワードを入力時にEnterを押下するとログインボタンを押下したときと同じ処理を走らせる\n $('#password').keypress(function (e) {\n if (e.keyCode == 13) {\n $('#login').click();\n return false;\n }\n });\n\n //############################################################\n // ログアウト\n //############################################################\n $('#logout').on('click', function () {\n if (!confirm('管理画面からログアウトしますか?')) {\n return;\n }\n location.href = '/logout';\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // パスワード再設定\n //-----------------------------------------------------------------------------------------------------------------\n //############################################################\n // パスワード再設定確認 新しいパスワードと確認用\n //############################################################\n\n $('#password_reset').on('click', function () {\n // validation\n if ($('#now_password').val() == '') {\n alert('現在のパスワードを入力してください');\n return;\n }\n if ($('#new_password').val() == '') {\n alert('新しいパスワードを入力してください');\n return;\n }\n if ($('#confirm_new_password').val() == '') {\n alert('確認用パスワードを入力してください');\n return;\n }\n\n // パスワード再設定確認 新しいパスワードと確認用\n if ($('#new_password').val() != $('#confirm_new_password').val()) {\n $('#password_error_message').css('display', 'block').text('パスワードと確認用パスワードが一致していません');\n setTimeout(function () {\n $('#password_error_message').fadeOut(300);\n }, 5000);\n return;\n }\n // 現在のパスワードチェック\n $('#password_reset').css('pointer-events', 'none');\n $.ajax({\n url: DOMAIN + '/password_reset',\n type: 'POST',\n data: {\n now_password: $('#now_password').val(),\n new_password: $('#new_password').val(),\n },\n dataType: 'json',\n })\n .done(function (data) {\n if (data.ret == 0) {\n alert('パスワードが変更されました。');\n $('#password_reset').css('pointer-events', 'auto');\n } else if (data.ret == 1) {\n alert('現在のパスワードが正しくありません。');\n $('#password_reset').css('pointer-events', 'auto');\n }\n })\n .fail(function () {\n alert(ERROR_MSG);\n $('#password_reset').css('pointer-events', 'auto');\n });\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // セッティンググループ\n //-----------------------------------------------------------------------------------------------------------------\n //############################################################\n // チェックボックス 一つだけ選択\n //############################################################\n $(function () {\n $('.check').on('click', function () {\n if ($(this).prop('checked')) {\n // 一旦全てをクリアして再チェックする\n $('.check').prop('checked', false);\n $(this).prop('checked', true);\n }\n });\n });\n //############################################################\n // カラーピッカー表示 「次へボタンの色」\n //############################################################\n $('#next_color').on('change', function (e) {\n let next_color = $('.next_color_value')[0];\n next_color.value = e.target.value;\n });\n //############################################################\n // カラーピッカー表示 「ガイド終了ボタンの色」\n //############################################################\n $('#cv_color').on('change', function (e) {\n let cv_color_value = $('.cv_color_value')[0];\n cv_color_value.value = e.target.value;\n });\n\n //############################################################\n // セッティンググループ画面切り替え\n //############################################################\n $('#setting_groups').on('change', function () {\n let href = DOMAIN + '/setting_groups';\n if ($(this).val() == 'new') {\n href += `?new=1`;\n } else {\n href += '?id=' + $(this).val();\n }\n location.href = href;\n });\n\n //############################################################\n // セッティンググループ更新リクエスト\n //############################################################\n $('#update_setting_groups').on('click', function () {\n // validation\n if ($('#name').val() == '') {\n alert('セッティンググループの名前を入力してください');\n return;\n }\n if ($('#fadein_speed').val() == '') {\n alert('ライトアップの表示スピードを入力してください');\n return;\n }\n if ($('#background_opacity').val() == '') {\n alert('グレイアウトの透明度を入力してください');\n return;\n }\n if ($('.next_color_value').val() == '') {\n alert('次へボタンの色を入力してください');\n return;\n }\n if ($('.cv_color_value').val() == '') {\n alert('ガイド終了ボタンの色を入力してください');\n return;\n }\n\n if (!confirm('セキュリティグループ情報を更新しますか?')) {\n return;\n }\n\n let back_button = 0;\n if ($('#back_button').prop('checked')) {\n back_button = 1;\n }\n\n $('#update_setting_groups').css('pointer-events', 'none');\n $.ajax({\n url: DOMAIN + '/update_setting_groups',\n type: 'POST',\n data: {\n id: $(this).data('id'),\n name: $('#name').val(),\n fadein_speed: $('#fadein_speed').val(),\n background_opacity: $('#background_opacity').val(),\n next_color: $('.next_color_value').val(),\n trigger: $('#trigger').val(),\n back_button: back_button,\n cv_color: $('.cv_color_value').val(),\n none_element_case: $('#none_element_case').val(),\n new_flow_case: $('#new_flow_case').val(),\n },\n dataType: 'json',\n })\n .done(function (data) {\n if (data.ret == 0) {\n alert('セキュリティグループ情報が正常に更新されました');\n $('#update_setting_groups').css('pointer-events', 'auto');\n } else {\n alert(ERROR_MSG);\n $('#update_setting_groups').css('pointer-events', 'auto');\n }\n })\n .fail(function () {\n alert(ERROR_MSG);\n $('#login').css('pointer-events', 'auto');\n });\n });\n\n //############################################################\n // セッティンググループ新規登録リクエスト\n //############################################################\n $('#create_setting_groups').on('click', function () {\n if ($('.name_check_error').text() == '既に同じセッティンググループ名が使われています。') {\n alert('既に同じセッティンググループ名が使われています。');\n $('.name_check_error').text('');\n $('#name').val('');\n return;\n }\n if ($('#name').val() == '') {\n alert('セッティンググループの名前を入力してください');\n return;\n }\n if ($('#fadein_speed').val() == '') {\n alert('ライトアップの表示スピードを入力してください');\n return;\n }\n if ($('#background_opacity').val() == '') {\n alert('グレイアウトの透明度を入力してください');\n return;\n }\n if ($('.next_color_value').val() == '') {\n alert('次へボタンの色を入力してください');\n return;\n }\n if ($('.cv_color_value').val() == '') {\n alert('ガイド終了ボタンの色を入力してください');\n return;\n }\n\n if (!confirm('セキュリティグループ情報を新規登録しますか?')) {\n return;\n }\n\n let back_button = 0;\n if ($('#back_button').prop('checked')) {\n back_button = 1;\n }\n\n $('#create_setting_groups').css('pointer-events', 'none');\n $.ajax({\n url: DOMAIN + '/create_setting_groups',\n type: 'POST',\n data: {\n name: $('#name').val(),\n fadein_speed: $('#fadein_speed').val(),\n background_opacity: $('#background_opacity').val(),\n next_color: $('.next_color_value').val(),\n trigger: $('#trigger').val(),\n back_button: back_button,\n cv_color: $('.cv_color_value').val(),\n },\n dataType: 'json',\n })\n .done(function (data) {\n if (data.ret == 0) {\n alert('セキュリティグループ情報が正常に新規登録されました');\n $('#new_setting_groups').css('pointer-events', 'auto');\n location.href = DOMAIN + '/setting_groups?id=' + data.id;\n } else {\n alert(ERROR_MSG);\n $('#new_setting_groups').css('pointer-events', 'auto');\n }\n })\n .fail(function () {\n alert(ERROR_MSG);\n $('#login').css('pointer-events', 'auto');\n });\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // レポート\n //-----------------------------------------------------------------------------------------------------------------\n\n $(function () {\n if (location.search.indexOf('device=2') != -1) {\n $('.all').css({\n 'background-color': 'rgb(255, 255, 136)',\n color: '#ababab',\n });\n $('.pc').css({\n 'background-color': '',\n color: '#ababab',\n display: 'block',\n });\n $('.phone').css({\n 'background-color': '',\n color: '#ababab',\n display: 'block',\n });\n }\n if (location.search.indexOf('device=0') != -1) {\n $('.all').css({\n 'background-color': '',\n color: '#ababab',\n display: 'block',\n });\n $('.pc').css({\n 'background-color': 'rgb(255, 255, 136)',\n color: '#ababab',\n });\n $('.phone').css({\n 'background-color': '',\n color: '#ababab',\n display: 'block',\n });\n }\n if (location.search.indexOf('device=1') != -1) {\n $('.all').css({\n 'background-color': '',\n color: '#ababab',\n display: 'block',\n });\n $('.pc').css({\n 'background-color': '',\n color: '#ababab',\n display: 'block',\n });\n $('.phone').css({\n 'background-color': 'rgb(255, 255, 136)',\n color: '#ababab',\n });\n }\n if (location.search.indexOf('month=') == -1 && location.search.indexOf('device=2') == -1) {\n $('.all').css({\n 'background-color': 'rgb(255, 255, 136)',\n color: '#ababab',\n });\n $('.pc').css({\n 'background-color': '',\n color: '#ababab',\n display: 'block',\n });\n $('.phone').css({\n 'background-color': '',\n color: '#ababab',\n display: 'block',\n });\n }\n });\n\n //############################################################\n // ガイドフローのセレクトボックス\n //############################################################\n $('.flow_select').on('change', function () {\n let flow_selected = $(this).val();\n let month_selected = $('.month_select').val();\n let href = DOMAIN + '/report_index';\n if (flow_selected == 'all') {\n href += `?flow_id=all&month=${month_selected}&device=2`;\n } else {\n href += `?flow_id=${flow_selected}&month=${month_selected}&device=2`;\n }\n location.href = href;\n });\n\n //############################################################\n // 月選択のセレクトボックス\n //############################################################\n $('.month_select').on('change', function () {\n let flow_selected = $('.flow_select').val();\n let month_selected = $(this).val();\n let href = DOMAIN + '/report_index';\n if ($(this).val() == 'all') {\n href += `?flow_id=all&month=${$('.month_select').val()}&device=2`;\n } else {\n href += `?flow_id=${flow_selected}&month=${month_selected}&device=2`;\n }\n location.href = href;\n });\n\n //############################################################\n // レポート 月毎, 日毎, デバイス毎 グラフ切り替え\n //############################################################\n\n // ガイドフロー一覧から遷移する時\n $('.report_button').on('click', function () {\n let flow_selected = $(this).data('val');\n let href = DOMAIN + '/report_index';\n href += `?flow_id=${flow_selected}&device=2`;\n location.href = href;\n });\n\n if (document.URL.match('/report_index')) {\n let flow_selected = $('.flow_select option:selected').val();\n let month_selected = $('.month_select option:selected').val();\n // デバイスボタン選択した時\n $('.device .all').on('mouseup', function () {\n if (location.search.indexOf('date_type=24') == -1) {\n let href = DOMAIN + '/report_index';\n href += `?flow_id=${flow_selected}&month=${month_selected}&device=2`;\n location.href = href;\n }\n if (location.search.indexOf('date_type=24') != -1) {\n let href = DOMAIN + '/report_index';\n href += `?flow_id=${flow_selected}&month=${month_selected}&device=2`;\n location.href = href;\n }\n });\n $('.device .pc').on('mouseup', function () {\n if (location.search.indexOf('date_type=24') == -1) {\n let href = DOMAIN + '/report_index';\n href += `?flow_id=${flow_selected}&month=${month_selected}&device=0`;\n location.href = href;\n }\n if (location.search.indexOf('date_type=24') != -1) {\n let href = DOMAIN + '/report_index';\n href += `?flow_id=${flow_selected}&month=${month_selected}&device=0`;\n location.href = href;\n }\n });\n $('.device .phone').on('mouseup', function () {\n if (location.search.indexOf('date_type=24') == -1) {\n let href = DOMAIN + '/report_index';\n href += `?flow_id=${flow_selected}&month=${month_selected}&device=1`;\n location.href = href;\n }\n if (location.search.indexOf('date_type=24') != -1) {\n let href = DOMAIN + '/report_index';\n href += `?flow_id=${flow_selected}&month=${month_selected}&device=1`;\n location.href = href;\n }\n });\n }\n\n //############################################################\n // 共通:写真をドラッグ&ドロップ\n //############################################################\n $(document).on('dragover drop', function (e) {\n e.preventDefault();\n });\n var target = $('.preview_area');\n target.on('drop', function (e) {\n $('.text').fadeOut(0);\n $('.preview_icon').fadeOut(0);\n $(\"[name='upfile']\").prop('files', e.originalEvent.dataTransfer.files);\n var reader = new FileReader();\n reader.onload = function (e) {\n target.attr('src', e.target.result);\n };\n reader.readAsDataURL(e.originalEvent.dataTransfer.files[0]);\n $('.preview_area').fadeIn(0);\n $('#delete_image').fadeIn(300);\n // カウンセラーの場合\n $('#delete_flg').val('0');\n });\n\n //############################################################\n // 写真選択 クリックアクション\n //############################################################\n $('.preview').on('click', function (e) {\n $('#upfile').click();\n });\n $('#upfile').on('change', function () {\n var files = $(this)[0].files;\n $('.text').fadeOut(0);\n $('.preview_icon').fadeOut(0);\n $(\"[name='upfile']\").prop('files', files);\n var reader = new FileReader();\n reader.onload = function (e) {\n target.attr('src', e.target.result);\n };\n reader.readAsDataURL(files[0]);\n $('.preview_area').fadeIn(0);\n $('#delete_image').fadeIn(300);\n // カウンセラーの場合\n $('#delete_flg').val('0');\n });\n\n //############################################################\n // 写真をアップロード\n //############################################################\n $('#upload_image').on('click', function () {\n let files = document.getElementById('upfile').files;\n let oFile = files[0];\n\n if (oFile == undefined) {\n alert('写真をドラッグ&ドロップしてください');\n return;\n }\n\n let m_file_name = oFile.name;\n let reader = new FileReader();\n reader.readAsDataURL(oFile);\n\n if (2097152 < oFile.size) {\n alert('アップロードできません \\n※ アップロードできる画像の最大サイズは2MBです\\n ファイルサイズを変更して、再度画像をセットしてください');\n return;\n }\n\n if (!confirm('写真をアップロードしますか?')) {\n return;\n }\n $('#upload_image').css('pointer-events', 'none');\n\n if (oFile != undefined) {\n // 写真あり\n m_file_name = oFile.name;\n\n if (2097152 < oFile.size) {\n alert('登録できませんでした \\n※ アップロードできる写真の最大サイズは2MBです\\n ファイルサイズを変更して、再度写真をセットしてください');\n $('#upload_image').css('pointer-events', 'auto');\n return;\n }\n\n let reader = new FileReader();\n reader.readAsDataURL(oFile);\n reader.onload = function () {\n // データURLスキームを取得\n let data_url_scheme = reader.result;\n let file_name = encodeURIComponent(m_file_name);\n $.ajax({\n url: DOMAIN + '/m/upload_image',\n type: 'POST',\n data: {\n image: data_url_scheme,\n name: $('#name').val(),\n file_name: file_name,\n },\n dataType: 'json',\n })\n .done(function (data) {\n if (data.ret == 0) {\n location.href = '/images';\n } else if (data.ret == 1) {\n alert('アップロードできませんでした\\n登録可能な拡張子は[jpg][jpeg][png]のみとなります');\n $('#upload_image').css('pointer-events', 'auto');\n } else if (data.ret == 2) {\n alert('アップロードできませんでした \\n※ アップロードできる画像の最大サイズは2MBです\\n ファイルサイズを変更して、再度画像をセットしてください');\n $('#upload_image').css('pointer-events', 'auto');\n }\n })\n .fail(function () {\n alert(ERROR_MSG);\n $('#upload_image').css('pointer-events', 'auto');\n });\n };\n }\n });\n\n //############################################################\n // 写真を削除\n //############################################################\n $('.delete_image').on('click', function () {\n if (!confirm('画像を削除しますか?')) {\n return;\n }\n $('.delete_image').css('pointer-events', 'none');\n $.ajax({\n url: DOMAIN + '/m/delete_image',\n type: 'POST',\n data: {\n image_id: $(this).data('val'),\n },\n dataType: 'json',\n })\n .done(function (data) {\n location.href = '/m/images';\n })\n .fail(function () {\n alert(ERROR_MSG);\n $('.delete_image').css('pointer-events', 'auto');\n });\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // タグ設定\n //-----------------------------------------------------------------------------------------------------------------\n $('.to_tag_setting').on('click', function () {\n let href = '/tag_setting';\n location.href = href;\n });\n\n // タググループの追加\n $('#tag_group_set').on('click', function () {\n let tag_group_input_val = $('#tag_group_input').val();\n if (!tag_group_input_val) {\n alert('ハッシュタググループ名を入力してください。');\n return;\n }\n $('#tag_group_set').css('pointer-events', 'none');\n $.ajax({\n url: DOMAIN + '/i/create_tag_group',\n type: 'POST',\n data: {\n name: tag_group_input_val,\n },\n dataType: 'json',\n }).done(function (data) {\n alert('タググループを作成しました。');\n location.href = '/tag_setting?tgg_id=' + data.tgg_id;\n });\n });\n\n // ハッシュタグ登録時に最近と人気の投稿を取得する処理で、\n // 続けて登録されるとサーバーが止まるため、連続で登録できないようにインターバルを設定する\n function hash_tag_register_interval() {\n let now = new Date();\n let opt = { timeZone: 'Asia/Tokyo' };\n let datetime = now.toLocaleString('ja-JP', opt);\n let registeredTime;\n let waitTime;\n\n if (!localStorage.getItem('platta_tag_registered_time')) {\n localStorage.setItem('platta_tag_registered_time', JSON.stringify(datetime));\n } else {\n const platta_tag_registered_time_str = localStorage.getItem('platta_tag_registered_time');\n console.log('platta_tag_registered_time_str :>> ', platta_tag_registered_time_str);\n registeredTime = new Date(JSON.parse(platta_tag_registered_time_str));\n\n // 5分追加 (300000ミリ秒)\n const waitUntil = new Date(registeredTime);\n waitUntil.setTime(registeredTime.getTime() + 300000);\n\n // Format wait time\n waitTime = waitUntil.toLocaleTimeString('ja-JP', { hour: '2-digit', minute: '2-digit' });\n }\n\n // 5分以上、経過していない場合、処理を中断する\n if (localStorage.getItem('platta_tag_registered_time') && now - registeredTime < 300000) {\n // if (now - registeredTime < 1) {\n alert(`現在、登録したハッシュタグの投稿を収集しております。${waitTime}以降になりましたら再度お試しください。`);\n location.reload();\n return true;\n } else {\n localStorage.setItem('platta_tag_registered_time', JSON.stringify(datetime));\n return false;\n }\n }\n\n // タグの登録\n $('#add_btn').on('click', function () {\n let text = $('#tag_input').val();\n\n if (text.length == 0) {\n alert('登録したいタグを入力してください。');\n $('#add_btn').css('pointer-events', 'auto');\n return;\n }\n\n if (hash_tag_register_interval() == true) {\n return;\n }\n\n $('#add_btn').css('pointer-events', 'none');\n\n $.ajax({\n url: DOMAIN + '/i/create_tags',\n type: 'POST',\n data: {\n tgg_id: $('.tag_group_select option:selected').val(),\n text: text,\n },\n dataType: 'json',\n })\n .done(function (data) {\n if (data.hashtag_id > 0) {\n alert(\n `タグを登録しました。\n 続けて登録したタグ名と合致した投稿を取得します。\n 取得処理は継続するため本ページから離れても問題ありません。\n 取得した投稿の反映には時間がかかる場合がございます。`.replace(/[ \\t]/g, '')\n );\n $.ajax({\n url: '/execute_get_recent_and_popular_sns_posts',\n type: 'POST',\n data: {\n hashtag_id: data.hashtag_id,\n },\n dataType: 'json',\n })\n // ajaxの処理が長引くと自動でjsがエラーを返すため alert は出さない\n .done(function (data) {\n // console.log('たった今追加したハッシュタグの最近の投稿、人気の投稿を取得する');\n })\n // ajaxの処理が長引くと自動でjsがエラーを返すため alert は出さない\n // エラーが出てもrails側でプログラムの処理は中断されない\n .fail(function (jqXHR, textStatus, errorThrown) {\n console.log(jqXHR, textStatus, errorThrown);\n })\n .always(function () {\n // location.reload();\n location.href = '/tag_setting?tgg_id=' + data.tgg_id;\n });\n // setTimeoutを設定しないと 2回目の .done()の処理が走らないことがある\n setTimeout(() => {\n location.href = '/tag_setting?tgg_id=' + data.tgg_id;\n }, 500);\n } else if (data.hashtag_id == -100) {\n localStorage.removeItem('platta_tag_registered_time');\n // 追加 大文字も小文字もハッシュタグ名はインスタグラムは区別しない\n alert(\n `そのハッシュタグはすでに登録済みです。\n (ハッシュタグ名が大文字や小文字、ひらがなやカタカナも同様に扱われます。)`.replace(/[ \\t]/g, '')\n );\n location.href = '/tag_setting?tgg_id=' + data.tgg_id;\n } else if (data.hashtag_id == -3) {\n localStorage.removeItem('platta_tag_registered_time');\n alert('連携時に登録されたトークンが有効ではありません。連携に失敗している可能性がございますので、お手数ですがサポートチームにお問い合わせください。');\n location.href = '/tag_setting?tgg_id=' + data.tgg_id;\n } else if (data.hashtag_id == -2) {\n localStorage.removeItem('platta_tag_registered_time');\n alert('連携時に登録されたインスタグラムIDが有効ではありません。連携に失敗している可能性がございますので、お手数ですがサポートチームにお問い合わせください。');\n location.href = '/tag_setting?tgg_id=' + data.tgg_id;\n } else if (data.hashtag_id == -1) {\n localStorage.removeItem('platta_tag_registered_time');\n alert('インスタグラム上で一致するハッシュタグが見つからないため登録できません。別のハッシュタグ名をお試しください。');\n location.href = '/tag_setting?tgg_id=' + data.tgg_id;\n } else if (data.hashtag_id == 0) {\n localStorage.removeItem('platta_tag_registered_time');\n alert(`1週間で保持、及び登録できるハッシュタグの限度数に達しました。\n\n ${data.future_restriction_lifted_data}以降に再度、お試しください。`);\n location.href = '/tag_setting?tgg_id=' + data.tgg_id;\n // 上記以外の全てのエラーをキャッチ\n } else {\n console.log('data :>> ', data);\n localStorage.removeItem('platta_tag_registered_time');\n alert('Error(HSS0001): 予期しないエラーが発生しました。時間を置いて再度お試しいただき、問題が継続するようでしたらお手数ですが、サポートチームにお問い合わせください。');\n location.reload();\n }\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n localStorage.removeItem('platta_tag_registered_time');\n alert('Error(HSS0002): 予期しないエラーが発生しました。時間を置いて再度お試しいただき、問題が継続するようでしたらお手数ですが、サポートチームにお問い合わせください。');\n location.reload();\n });\n });\n\n $('.del_checkbox').on('change', function () {\n if ($('.del_checkbox:checked').length > 0) {\n $('.del_tag').removeClass('hidden');\n } else {\n $('.del_tag').addClass('hidden');\n }\n });\n\n // タグの論理削除\n $('.del_tag').on('click', function () {\n $('.del_tag').css('pointer-events', 'none');\n let checked_tags = [];\n checked_tags = $('.del_checkbox:checked')\n .map(function () {\n return $(this).data('tag_id');\n })\n .get();\n\n if (checked_tags.length == 0) {\n alert('削除したいタグにチェックを入れてください。');\n $('.del_tag').css('pointer-events', 'auto');\n return;\n }\n\n $.ajax({\n url: DOMAIN + '/i/del_tags',\n type: 'POST',\n data: {\n tgg_id: $('.tag_group_select option:selected').val(),\n tag_ids: checked_tags,\n },\n dataType: 'json',\n }).done(function (data) {\n alert('タグを削除しました');\n location.href = '/tag_setting?tgg_id=' + data.tgg_id;\n });\n });\n\n // ハッシュタグ設定の説明\n // 検索条件の表示非表示 slideToggle\n $('.tag_setting_info__accordion_filter').click(function () {\n $(this)\n .next()\n .slideToggle(300, function () {\n $(this).toggleClass('open');\n });\n if ($(this).next().hasClass('open')) {\n $(this).text('ハッシュタグ設定の説明を表示する');\n } else {\n $(this).text('ハッシュタグ設定の説明を非表示する');\n }\n });\n\n // タググループの削除\n $('.delete_tag_group').on('click', function () {\n if (!confirm('選択中のタググループを本当に削除しますか?')) {\n return;\n }\n $('.delete_tag_group').css('pointer-events', 'none');\n $.ajax({\n url: DOMAIN + '/i/delete_tag_group',\n type: 'POST',\n data: {\n tgg_id: $('.tag_group_d_select option:selected').val(),\n },\n dataType: 'json',\n }).done(function (data) {\n alert('タググループを削除しました。');\n location.href = '/tag_setting';\n });\n });\n\n // タググループ選択\n $('.tag_group_select').on('change', function () {\n tgg_id = $('.tag_group_select option:selected').val();\n $('.tag').remove();\n // alert(data.tags);\n location.href = '/tag_setting?tgg_id=' + tgg_id;\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // ハッシュタグ収集一覧\n //-----------------------------------------------------------------------------------------------------------------\n if (current_url.includes('/hashtag_list?')) {\n $('.to_hashtag_list').css('pointer-events', 'none');\n }\n\n $('.to_hashtag_list').on('click', function (event) {\n $('.to_hashtag_list').css('pointer-events', 'none');\n event.preventDefault();\n\n const { hashtagInitialDate, hashtagEndDate } = getDefaultHashtagDates();\n\n // ハッシュタググ収集一覧に関するlocalstrageをリセットする\n // ハッシュタググループIDは削除する(管理者側で別アカウントに切り替えた時にハッシュタググループIDがあるとタグが正しく読み込まれないため)\n localStorage.removeItem('hashtag_group');\n localStorage.removeItem('hashtag_list');\n localStorage.removeItem('excluded_words_list');\n localStorage.removeItem('ugc_urls_list');\n\n localStorage.setItem('hashtag_list_display_type', \"1\");\n localStorage.setItem('hashtag_initial_date', hashtagInitialDate);\n localStorage.setItem('hashtag_end_date', hashtagEndDate);\n localStorage.setItem('search_condition', \"1\");\n localStorage.setItem('per_page_num', \"50\");\n\n // サイドメニューから表示時は全てのタグで検索する(all_tag_check)\n location.href = generate_hashtag_list_url_params() + `&all_tag_check=1`;\n });\n\n $('.post_regist_publish_btn').on('click', function () {\n let show_hashtag = $(this).data('show_hashtag');\n let id = $(this).data('id');\n if (show_hashtag == '0') {\n $.ajax({\n url: '/show_hashtag_ok',\n type: 'POST',\n data: {\n id: id,\n show_hashtag: show_hashtag,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n } else if (show_hashtag == '1') {\n $.ajax({\n url: '/show_hashtag_no',\n type: 'POST',\n data: {\n id: id,\n show_hashtag: show_hashtag,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n }\n });\n $('.ugc_set_btn')\n .off()\n .on('click', function () {\n $('.modal_container').css('display', 'block');\n\n let sns_post_id = $(this).data('id');\n $('.modal_submit').attr('data-sns_post_id', sns_post_id);\n\n // UGCグループ連携 モーダル表示\n $('.modal_del,.modal_bg').on('click', function () {\n $('.modal_container').css('display', 'none');\n });\n\n if (!$('.modal_submit').hasClass('event-bound')) {\n $('.modal_submit').addClass('event-bound');\n $('.modal_submit')\n .off()\n .on('click', function () {\n let ugc_group_ids = [];\n $('input[name=ugc_groups]:checked').each(function () {\n ugc_group_ids.push($(this).val());\n });\n if (ugc_group_ids.length == 0) {\n alert('UGCグループを選択してください。');\n return;\n }\n $.ajax({\n url: '/ugc_group_id_set',\n type: 'POST',\n data: {\n sns_post_id: sns_post_id,\n ugc_group_ids: ugc_group_ids,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('UGCグループに連携しました。');\n location.reload();\n }\n });\n });\n }\n\n $('.modal_cancel_submit').on('click', function () {\n let ugc_group_id = $('.ugc_modal_select option:selected').val();\n let sns_post_id = $(this).data('id');\n $.ajax({\n url: '/ugc_group_id_delete',\n type: 'POST',\n data: {\n sns_post_id: sns_post_id,\n ugc_group_id: ugc_group_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // キャンペーン投稿\n //-----------------------------------------------------------------------------------------------------------------\n //############################################################\n // 予約投稿選択した時\n //############################################################\n $('input[name=\"post_type\"]').change(function () {\n if ($(this).is(':checked')) {\n let value = $(this).val();\n if (value == '1') {\n $('.expected_date').css('display', 'block');\n } else if (value != '1') {\n $('.expected_date').css('display', 'none');\n }\n }\n });\n //############################################################\n // .textarea → phone\n //############################################################\n $('.post_content_textarea').ready(function () {\n let showChar = 40; // 表示する文字数\n // let ellipsestext = \"...\"; // 省略記号\n let moretext = '...続きを読む'; // 「続きを読む」リンクのテキスト\n let lesstext = '閉じる'; // 「閉じる」リンクのテキスト\n let moreClass = 'morelink'; // 「続きを読む」リンクのクラス名\n let lessClass = 'lesslink'; // 「閉じる」リンクのクラス名\n let max_text_length = 2200;\n\n $('.post_content_textarea').on('input', function () {\n let post_content = $('.post_content_textarea').val();\n let inputText = $(this).val();\n let outputText = '';\n let post_text_length = post_content.length;\n $('.now_cnt').text(post_text_length);\n if (post_text_length > 0 && max_text_length >= post_text_length) {\n //1文字以上かつ140文字以内の場合はボタンを有効化&黒字\n $('.preview_submit, .preview_draft_save').prop('disabled', false);\n $('.max_text_length').removeClass('text_length_over');\n } else {\n //0文字または140文字を超える場合はボタンを無効化&赤字\n $('.preview_submit, .preview_draft_save').prop('disabled', true);\n $('.max_text_length').addClass('text_length_over');\n }\n\n if (inputText.length > showChar) {\n let c = inputText.substr(0, showChar);\n\n outputText = `username ${c}${moretext}`;\n } else {\n outputText = 'username ' + inputText;\n }\n\n $('.post_display_content').html(outputText);\n\n // 2度と閉じない用\n if ($('#hidden_tmp_input').val() == '1') {\n $('.post_display_content').text('username ' + post_content);\n }\n\n $('.' + moreClass).css('cursor', 'pointer');\n $('.' + moreClass).on('click', function () {\n $('#hidden_tmp_input').val('1');\n $('.post_display_content').text('username ' + post_content);\n });\n });\n //リロード時に初期文字列が入っていた時の対策\n $('.post_content_textarea').trigger('input');\n });\n\n //############################################################\n // 写真選択 クリックアクション\n //############################################################\n $('.post_img_input').ready(function () {\n $('.post_img_input').on('click', function () {\n $('#post_img_reinput').click();\n });\n $('#post_img_reinput').on('change', function () {\n let $files = $(this).prop('files');\n let len = $files.length;\n for (var i = 0; i < len; i++) {\n let file = $files[i];\n let fr = new FileReader();\n\n fr.onload = function (e) {\n let data_url_scheme = fr.result;\n let file_name = encodeURIComponent(file.name);\n let src = e.target.result;\n let img = ``;\n let pre_img = `
`;\n $('.preview_img_area').append(img);\n $('.post_display_img').append(pre_img);\n };\n fr.readAsDataURL(file);\n }\n });\n });\n\n //############################################################\n // プレビュー この内容で確定ボタン\n //############################################################\n $('.preview_submit').ready(function () {\n $('.preview_submit').on('click', function () {\n $('.preview_submit').css('pointer-events', 'none');\n $('.loadding').css('display', 'block');\n\n // 即時投稿0か予約投稿1かの値\n let post_type = $(\"input[name='post_type']:checked\").val();\n\n // 予約投稿するかどうか次第\n let post_time = 'now';\n if (post_type == 1) {\n post_time = $(\"input[name='post_datetime']\").val();\n }\n\n // キャンペーンの応募条件\n let app_types = [];\n let following_type = 1;\n if ($('#follow_checkbox').is(':checked')) {\n following_type = 0;\n }\n app_types.push(following_type);\n let comment_type = 1;\n if ($('#comment_checkbox').is(':checked')) {\n comment_type = 0;\n }\n app_types.push(comment_type);\n let repost_type = 1;\n if ($('#repost_checkbox').is(':checked')) {\n repost_type = 0;\n }\n app_types.push(repost_type);\n\n // キャンペーン当選条件\n let win_types = [];\n\n let follower_type = 1;\n if ($('#follower_checkbox').is(':checked')) {\n follower_type = 0;\n }\n win_types.push(follower_type);\n let comment_count_type = 1;\n if ($('#comment_count_checkbox').is(':checked')) {\n comment_count_type = 0;\n }\n win_types.push(comment_count_type);\n\n // 投稿画像\n let image_datas = [];\n\n let i = 0;\n $('.preview_img').each(function () {\n let file_name = $(this).data('file_name');\n let url_scheme = $(this).data('url_scheme');\n\n image_datas.push([i, file_name, url_scheme]);\n i++;\n });\n\n if (image_datas.length == 0) {\n $('.loadding').css('display', 'none');\n alert('画像を選択してください。');\n return;\n }\n\n // 投稿内容 キャプション\n let caption = $('.post_content_textarea').val();\n if (caption.length <= 0) {\n $('.loadding').css('display', 'none');\n alert('キャプションを入力してください。');\n $('.preview_submit').css('pointer-events', 'auto');\n return;\n } else if (caption.length > 2200) {\n $('.loadding').css('display', 'none');\n alert('キャプションの最大文字数を超えています。2200文字未満に調整してください。');\n $('.preview_submit').css('pointer-events', 'auto');\n return;\n }\n\n let ic_id = $(this).data('ic_id');\n\n $.ajax({\n url: '/campaign_post',\n type: 'POST',\n data: {\n post_type: post_type,\n post_time: post_time,\n image_datas: image_datas,\n caption: caption,\n save_type: 0,\n ic_id: ic_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert(data.message);\n location.href = '/campaign_setting';\n } else {\n $('.loadding').css('display', 'none');\n alert(data.message);\n $('.preview_submit').css('pointer-events', 'auto');\n }\n });\n });\n });\n\n //############################################################\n // プレビュー 下書きに保存\n //############################################################\n $('.preview_draft_save').ready(function () {\n $('.preview_draft_save').on('click', function () {\n // 即時投稿0か予約投稿1かの値\n let post_type = $(\"input[name='post_type']:checked\").val();\n\n // 予約投稿するかどうか次第\n let post_time = 'now';\n if (post_type == 1) {\n post_time = $(\"input[name='post_datetime']\").val();\n }\n\n // キャンペーンの応募条件\n let app_types = [];\n let following_type = 1;\n if ($('#follow_checkbox').is(':checked')) {\n following_type = 0;\n }\n app_types.push(following_type);\n let comment_type = 1;\n if ($('#comment_checkbox').is(':checked')) {\n comment_type = 0;\n }\n app_types.push(comment_type);\n let repost_type = 1;\n if ($('#repost_checkbox').is(':checked')) {\n repost_type = 0;\n }\n app_types.push(repost_type);\n\n // キャンペーン当選条件\n let win_types = [];\n let follower_type = 1;\n if ($('#follower_checkbox').is(':checked')) {\n follower_type = 0;\n }\n win_types.push(follower_type);\n let comment_count_type = 1;\n if ($('#comment_count_checkbox').is(':checked')) {\n comment_count_type = 0;\n }\n win_types.push(comment_count_type);\n\n // 投稿内容 キャプション\n let caption = $('.post_content_textarea').val();\n\n let ic_id = $(this).data('ic_id');\n\n $.ajax({\n url: '/save_draft',\n type: 'POST',\n data: {\n post_type: post_type,\n post_time: post_time,\n caption: caption,\n save_type: 1,\n ic_id: ic_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert(data.message);\n location.href = '/campaign_setting';\n } else {\n alert(data.message);\n }\n });\n });\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // キャンペーン投稿一覧\n //-----------------------------------------------------------------------------------------------------------------\n //############################################################\n // 条件選択 コメント文字数\n //############################################################\n $('.post_num_input').on('change', function () {\n let min_length = $(this).val();\n let num = $(this).data('num');\n let comment_list = $(`.post_card_content_box_text_js_${num}`)\n .map(function () {\n return $(this).text();\n })\n .get();\n\n for (let i = 0; i < comment_list.length; i++) {\n if (Number(min_length) > comment_list[i].length) {\n $(`.post_card_content_container_js_${num}_${i}`).css('display', 'none');\n } else {\n $(`.post_card_content_container_js_${num}_${i}`).css('display', 'block');\n }\n }\n });\n\n $('.update_post').on('click', function () {\n $(this).parents().children('.update_loadding').css('display', 'block');\n let box_count = $(this).data('box_count');\n let id = $(this).data('id');\n let ig_post_id = $(this).data('ig_post_id');\n let comments_count = $(this).data('comments_count');\n $.ajax({\n url: '/update_ig_post',\n type: 'POST',\n data: {\n box_count: box_count,\n id: id,\n ig_post_id: ig_post_id,\n comments_count: comments_count,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n $(`.comment_list_${data.box_count}`).remove();\n $(`.post_card_content_link_${data.box_count}`).children().remove();\n $.each(data.instagram_campaign_comment, function (index, c) {\n $(`.post_card_comment_container_${data.box_count}`).append(\n `
\n
\n \n

username:${c.username}

\n
${c.text}
\n

投稿時刻:${c.timestamp}

\n
\n
\n
`\n );\n });\n $(`.post_card_content_link_${data.box_count}`).append(\n `${data.instagram_campaign.like_count}\n ${data.instagram_campaign.comments_count}`\n );\n $('.update_loadding').css('display', 'none');\n }\n });\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // 出しわけグループ設定\n //-----------------------------------------------------------------------------------------------------------------\n // 出しわけグループ選択\n $('#parent_group_select_box').on('change', function () {\n let parent_group_id = $('#parent_group_select_box option:selected').val();\n\n if (parent_group_id == 'new') {\n $('.parent_group_set_wrapper').css('display', 'block');\n $('.parent_edit_name_setting_wrapper').css('display', 'none');\n $('.parent_url_setting_wrapper').css('display', 'none');\n $('.parent_ugc_group_setting_wrapper').css('display', 'none');\n $('.parent_element_setting_wrapper').css('display', 'none');\n $('.parent_group_delete_setting_wrapper').css('display', 'none');\n } else {\n location.href = `/parent_group_setting?parent_group_id=${parent_group_id}`;\n }\n });\n // 出しわけグループ登録\n $('#parent_group_set').on('click', function () {\n let parent_group_input_val = $('#parent_group_input').val();\n if (!parent_group_input_val) {\n alert('出しわけグループ名を入力してください。');\n return;\n }\n $('#parent_group_set').css('pointer-events', 'none');\n $.ajax({\n url: DOMAIN + '/i/create_parent_group',\n type: 'POST',\n data: {\n name: parent_group_input_val,\n },\n dataType: 'json',\n }).done(function (data) {\n alert('出しわけグループ名を作成しました。');\n location.href = `/parent_group_setting?parent_group_id=${data.parent_group.id}`;\n });\n });\n\n // 選択したUGCグループの連携/連携解除\n $('#parent_ugc_group_set').on('click', function () {\n let parent_group_id = $('#parent_group_select_box option:selected').val();\n let checked_values = [];\n $(\"input[name='ugc_groups']:checked\").each(function () {\n checked_values.push($(this).val());\n });\n\n $.ajax({\n url: DOMAIN + '/i/update_parent_group_ugc_group',\n type: 'POST',\n data: {\n parent_group_id: parent_group_id,\n ugc_group_ids: checked_values,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('UGCグループを連携しました。');\n location.href = `/parent_group_setting?parent_group_id=${parent_group_id}`;\n }\n });\n });\n\n // 出しわけグループ名編集\n $('#parent_edit_name_submit').on('click', function () {\n let parent_group_id = $('#parent_group_select_box option:selected').val();\n let new_parent_name = $('.parent_edit_name_input').val();\n if (!new_parent_name) {\n alert('グループ名を入力してください。');\n return;\n }\n $.ajax({\n url: '/update_parent_name',\n type: 'POST',\n data: {\n parent_group_id: parent_group_id,\n name: new_parent_name,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('出しわけグループ名を編集しました。');\n location.href = `/parent_group_setting?parent_group_id=${data.parent_group.id}`;\n }\n });\n });\n\n // 出しわけグループのURL登録\n $('#parent_url_add_input').on('click', function () {\n $(this)\n .parent()\n .children('table')\n .append(\n `\n \n \n \n \n \n
\n \n `\n );\n $('.parent_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n $('.parent_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n $('#parent_url_set').on('click', function () {\n let parent_group_id = $('#parent_group_select_box option:selected').val();\n let urls = [];\n $('.parent_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/set_parent_url',\n type: 'POST',\n data: {\n parent_group_id: parent_group_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n alert('URLを登録しました');\n location.reload();\n });\n });\n\n // 出しわけグループの金額条件登録\n $('#parent_amount_set').on('click', function () {\n let parent_group_id = $('#parent_group_select_box option:selected').val();\n let parent_amount_element = $('#parent_amount_element_input').val();\n let parent_amount_condition = $('#parent_amount_condition_input option:selected').val();\n let parent_amount = $('#parent_amount_input').val();\n let parent_amount_upper_condition = $('#parent_amount_upper_condition_input option:selected').val();\n let parent_amount_upper = $('#parent_amount_upper_input').val();\n let parent_amount_filter = $('#parent_amount_filter option:selected').val();\n\n if (parent_amount_element == '') {\n alert('class名またはid名が未記入です。');\n return;\n }\n if (parent_amount == '') {\n alert('金額1が未記入です。');\n return;\n }\n\n if (parent_amount_upper && Number(parent_amount) >= Number(parent_amount_upper)) {\n alert('金額2は金額1より大きい数字にしてください。');\n return;\n }\n if (parent_amount_condition == 0 || parent_amount_condition == 2 || parent_amount_condition == 4) {\n parent_amount_upper = '';\n }\n\n $.ajax({\n url: '/update_amount_condition',\n type: 'POST',\n data: {\n parent_group_id: parent_group_id,\n parent_amount_element: parent_amount_element,\n parent_amount_condition: parent_amount_condition,\n parent_amount: parent_amount,\n parent_amount_upper_condition: parent_amount_upper_condition,\n parent_amount_upper: parent_amount_upper,\n parent_amount_filter: parent_amount_filter,\n },\n dataType: 'json',\n }).done(function (data) {\n alert('金額による出しわけ条件を設定しました。');\n location.reload();\n });\n });\n\n // 出しわけグループのテキスト条件登録\n $('#parent_text_set').on('click', function () {\n let parent_group_id = $('#parent_group_select_box option:selected').val();\n let parent_text_element = $('#parent_text_element_input').val();\n let parent_text_condition = $('#parent_text_condition_input option:selected').val();\n let parent_text = $('#parent_text_input').val();\n\n if (parent_text_element == '') {\n alert('class名またはid名が未記入です。');\n return;\n }\n if (parent_text == '') {\n alert('テキストが未記入です。');\n return;\n }\n if (!parent_text_element.startsWith('.') && !parent_text_element.startsWith('#')) {\n alert('文字列の先頭には . もしくは # を付けてください。');\n return;\n }\n $.ajax({\n url: '/update_text_condition',\n type: 'POST',\n data: {\n parent_group_id: parent_group_id,\n parent_text_element: parent_text_element,\n parent_text_condition: parent_text_condition,\n parent_text: parent_text,\n },\n dataType: 'json',\n }).done(function (data) {\n alert('テキストによる出しわけを設定しました。');\n location.reload();\n });\n });\n\n // 出しわけグループの金額条件登録\n $('#parent_img_set').on('click', function () {\n let parent_group_id = $('#parent_group_select_box option:selected').val();\n let parent_img_element = $('#parent_img_element_input').val();\n let parent_img_condition = $('#parent_img_condition_input option:selected').val();\n let parent_img = $('#parent_img_input').val();\n\n if (parent_img_element == '') {\n alert('class名またはid名が未記入です。');\n return;\n }\n if (parent_img == '') {\n alert('画像URLが未記入です。');\n return;\n }\n if (!parent_img_element.startsWith('.') && !parent_img_element.startsWith('#')) {\n alert('文字列の先頭には . もしくは # を付けてください。');\n return;\n }\n $.ajax({\n url: '/update_img_condition',\n type: 'POST',\n data: {\n parent_group_id: parent_group_id,\n parent_img_element: parent_img_element,\n parent_img_condition: parent_img_condition,\n parent_img: parent_img,\n },\n dataType: 'json',\n }).done(function (data) {\n alert('画像による出しわけ条件を設定しました。');\n location.reload();\n });\n });\n\n // 出しわけグループの条件をリセット\n $('#parent_amount_reset, #parent_text_reset, #parent_img_reset').on('click', function () {\n let parent_group_id = $('#parent_group_select_box option:selected').val();\n let flag = $(this).data('flag');\n let element = $(this).data('element');\n let condition = $(this).data('condition');\n let val = $(this).data('val');\n\n $.ajax({\n url: `/reset_condition`,\n type: 'POST',\n data: {\n parent_group_id: parent_group_id,\n flag: flag,\n element: element,\n condition: condition,\n value: val,\n },\n dataType: 'json',\n }).done(function (data) {\n alert('出しわけ条件をリセットしました。');\n location.reload();\n });\n });\n\n $('.jump_ugc_group').on('click', function () {\n let parent_group_id = $('#parent_group_select_box option:selected').val();\n let ugc_group_id = $(this).data('ugc_group_id');\n\n location.href = `/ugc_setting?ugc_group_id=${ugc_group_id}`;\n });\n\n $('#parent_group_delete_btn').on('click', function () {\n let parent_group_id = $('#parent_group_select_box option:selected').val();\n\n if (!confirm('完全に削除され復元することはできません。本当に削除しますか?')) {\n return;\n }\n\n $.ajax({\n url: '/i/delete_parent_group',\n type: 'POST',\n data: {\n parent_group_id: parent_group_id,\n },\n dataType: 'json',\n }).done(function (data) {\n alert('出しわけグループを削除しました。');\n location.href = `/parent_group_setting`;\n });\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // UGC設定\n //-----------------------------------------------------------------------------------------------------------------\n // UGCグループ選択\n $('.ugc_group_select_box').on('change', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n if (ugc_group_id == 'new') {\n $('.ugc_group_set_wrapper_display').css('display', 'block');\n $('.ugc_edit_name_setting_wrapper').css('display', 'none');\n $('.ugc_copy_setting_wrapper').css('display', 'none');\n $('.ugc_edit_title_setting_wrapper').css('display', 'none');\n $('.ugc_edit_related_items_title_setting_wrapper').css('display', 'none');\n $('.ugc_setting_wrapper_post_list').css('display', 'none');\n $('.ugc_element_setting_wrapper').css('display', 'none');\n $('.ugc_open_setting_wrapper').css('display', 'none');\n $('.ugc_display_count_setting_wrapper').css('display', 'none');\n $('.ugc_url_setting_wrapper').css('display', 'none');\n $('.ugc_display_pattern_setting_wrapper').css('display', 'none');\n $('.ugc_display_order_setting_wrapper').css('display', 'none');\n $('.ugc_custom_setting_wrapper').css('display', 'none');\n $('.ugc_device_setting_wrapper').css('display', 'none');\n $('.ugc_ab_test_setting_wrapper').css('display', 'none');\n $('.ugc_custom_css_wrapper').css('display', 'none');\n $('.ugc_delete_setting_wrapper').css('display', 'none');\n $('.ugc_add_tab_setting_wrapper').css('display', 'none');\n $('.ugc_tab_setting_wrapper').css('display', 'none');\n } else {\n location.href = `/ugc_setting?ugc_group_id=${ugc_group_id}`;\n }\n });\n\n $('.jump_parent_group').on('click', function () {\n parent_group_id = $(this).data('parent_group_id');\n location.href = `/parent_group_setting?parent_group_id=${parent_group_id}`;\n });\n\n // ABテストのモード切り替え\n $('#ugc_group_ab_test_btn').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n\n $.ajax({\n url: '/update_ugc_ab_test_mode',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n if (data.ugc_group.is_ab_test == '0') {\n alert('ABテストモードを停止しました。');\n } else {\n alert('ABテストモードを開始しました。');\n }\n location.reload();\n }\n });\n });\n\n // ABテストの新規作成\n $('#create_ugc_group_ab_test_btn').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n $.ajax({\n url: '/create_ugc_ab_test',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('テストを作成しました。');\n location.reload();\n } else {\n console.log(data.error_message);\n }\n });\n });\n\n // デフォルトのABテストの設定\n $('#update_default_ab_test_btn').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ab_test_id = $(\"input[name='ab_test_radio']:checked\").val();\n console.log(ab_test_id);\n $.ajax({\n url: '/update_default_ab_test',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n ab_test_id: ab_test_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('ABテストを実施していない時のデフォルトのテストを設定しました。');\n location.href = `/ugc_setting?ugc_group_id=${ugc_group_id}&ab=${ab_test_id}`;\n }\n });\n });\n\n // ABテスト選択\n $('.ugc_group_ab_test_select_box').on('change', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_select_box option:selected').val();\n\n location.href = `/ugc_setting?ugc_group_id=${ugc_group_id}&ab=${ugc_group_ab_test_id}`;\n });\n\n // デバイス選択\n $('.ugc_setting_device_pc, .ugc_setting_device_phone').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n let is_device = $(this).data('device');\n\n location.href = `/ugc_setting?ugc_group_id=${ugc_group_id}&ab=${ugc_group_ab_test_id}&is_device=${is_device}`;\n });\n\n // UGCグループ名編集\n $('#ugc_edit_name_submit').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_edit_name_val = $('.ugc_edit_name_input').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n $.ajax({\n url: '/update_ugc_name',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n name: ugc_edit_name_val,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('UGCグループ名を編集しました。');\n location.href = `/ugc_setting?ugc_group_id=${data.ugc_group.id}&ab=${ugc_group_ab_test_id}`;\n }\n });\n });\n\n // UGCグループコピー\n $('#ugc_copy_submit').on('click', function () {\n $('#ugc_copy_submit').css('pointer-events', 'none');\n $('.loadding').css('display', 'block');\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n $.ajax({\n url: '/create_ugc_copy',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('UGCグループのコピーを作成しました。');\n location.reload();\n } else {\n alert('UGCグループのコピーに失敗しました。');\n $('#ugc_copy_submit').css('pointer-events', 'auto');\n $('.loadding').css('display', 'none');\n }\n });\n });\n\n // ugc表示順選択\n $('#ugc_order_select').on('change', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n let ugc_order_select = $('#ugc_order_select option:selected').val();\n\n let url = new URL(window.location.href);\n if (url.searchParams.has('ugc_order_by')) {\n url.searchParams.set('ugc_order_by', ugc_order_select);\n } else {\n url.searchParams.append('ugc_order_by', ugc_order_select);\n }\n history.replaceState({}, null, url.toString());\n location.reload();\n });\n\n // UGCグループ公開設定\n $('.ugc_open_select').on('change', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n let ugc_show_valid_val = $('.ugc_open_select option:selected').val();\n let is_device = $('#ugc_setting_device_val').val();\n $.ajax({\n url: '/update_show_valid',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n show_valid: ugc_show_valid_val,\n is_device: is_device,\n ugc_group_ab_test_id: ugc_group_ab_test_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n if (data.show_valid == 1) {\n alert('UGCグループを公開しました。');\n } else {\n alert('UGCグループを非公開にしました。');\n }\n location.reload();\n }\n });\n });\n\n // UGC表示数設定\n $('#ugc_display_count_submit').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n let ugc_display_count_select_val = $('#ugc_display_count_select_val').val();\n let is_device = $('#ugc_setting_device_val').val();\n $.ajax({\n url: '/update_display_count',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n ugc_group_ab_test_id: ugc_group_ab_test_id,\n display_count: ugc_display_count_select_val,\n is_device: is_device,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('UGC表示数を設定しました。');\n location.reload();\n }\n });\n });\n // UGC表示パターン設定\n $('.ugc_display_type_select').on('change', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n let ugc_display_type_val = $('.ugc_display_type_select option:selected').val();\n let ugc_display_order_val = $('.ugc_display_order_select option:selected').val();\n let is_device = $('#ugc_setting_device_val').val();\n\n $.ajax({\n url: '/update_display_type',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n ugc_group_ab_test_id: ugc_group_ab_test_id,\n display_type: ugc_display_type_val,\n is_device: is_device,\n display_order: ugc_display_order_val,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('表示パターンを設定しました。');\n location.reload();\n }\n });\n });\n // UGC表示順設定\n $('.ugc_display_order_select').on('change', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n let ugc_display_order_val = $('.ugc_display_order_select option:selected').val();\n\n let ugc_display_type_val = $('.ugc_display_type_select option:selected').val();\n let is_device = $('#ugc_setting_device_val').val();\n $.ajax({\n url: '/update_display_order',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n ugc_group_ab_test_id: ugc_group_ab_test_id,\n display_order: ugc_display_order_val,\n is_device: is_device,\n display_type: ugc_display_type_val,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('表示順を設定しました。');\n location.reload();\n }\n });\n });\n\n $('#ugc_group_delete_btn').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n\n if (!confirm('完全に削除され復元することはできません。本当に削除しますか?')) {\n return;\n }\n\n $.ajax({\n url: '/i/delete_ugc_group',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n },\n dataType: 'json',\n }).done(function (data) {\n alert('UGCグループを削除しました。');\n location.href = `/ugc_setting`;\n });\n });\n\n $('#ugc_group_set').on('click', function () {\n let ugc_group_input_val = $('.ugc_group_input').val();\n if (!ugc_group_input_val) {\n alert('UGCグループ名を入力してください。');\n return;\n }\n $('#ugc_group_set').css('pointer-events', 'none');\n $.ajax({\n url: DOMAIN + '/i/create_ugc_group',\n type: 'POST',\n data: {\n name: ugc_group_input_val,\n },\n dataType: 'json',\n }).done(function (data) {\n alert('UGCグループを作成しました。');\n location.href = `/ugc_setting?ugc_group_id=${data.ugc_group.id}`;\n });\n });\n\n $('#element_change_mode').on('change', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let is_device = $('#ugc_setting_device_val').val();\n let element_change_mode_val = $(this).val();\n\n $.ajax({\n url: '/update_ugc_element_mode',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n is_device: is_device,\n element_change_mode_val: element_change_mode_val,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n $('#ugc_element_set').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n let is_device = $('#ugc_setting_device_val').val();\n let element_id_val = $('#element_id_input').val();\n let element_class_val = $('#element_class_input').val();\n let element_index_val = $('#element_index_input').val();\n let parent_id_val = $('#parent_id_input').val();\n let parent_class_val = $('#parent_class_input').val();\n let parent_index_val = $('#parent_index_input').val();\n let grand_id_val = $('#grand_id_input').val();\n let grand_class_val = $('#grand_class_input').val();\n let grand_index_val = $('#grand_index_input').val();\n let great_grand_id_val = $('#great_grand_id_input').val();\n let great_grand_class_val = $('#great_grand_class_input').val();\n let ugc_element_placement = $('.ugc_element_list .ugc_element_placement option:selected').val();\n\n $.ajax({\n url: '/create_ugc_element',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n ugc_group_ab_test_id: ugc_group_ab_test_id,\n is_device: is_device,\n element_id: element_id_val,\n element_class: element_class_val,\n element_index: element_index_val,\n parent_id: parent_id_val,\n parent_class: parent_class_val,\n parent_index: parent_index_val,\n grand_id: grand_id_val,\n grand_class: grand_class_val,\n grand_index: grand_index_val,\n great_grand_id: great_grand_id_val,\n great_grand_class: great_grand_class_val,\n element_placement: ugc_element_placement,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('要素の挿入先を登録しました。');\n location.reload();\n }\n });\n });\n\n $('#ugc_element_hierarchy_set').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n let is_device = $('#ugc_setting_device_val').val();\n let element_hierarchy_input_val = $('#element_hierarchy_input').val();\n let ugc_element_placement = $('.ugc_element_hierarchy_list .ugc_element_placement option:selected').val();\n\n $.ajax({\n url: '/create_ugc_element_hierarchy',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n ugc_group_ab_test_id: ugc_group_ab_test_id,\n is_device: is_device,\n element_hierarchy_input: element_hierarchy_input_val,\n element_placement: ugc_element_placement,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('要素の挿入先を登録しました。');\n location.reload();\n }\n });\n });\n\n $('#ugc_add_tab_submit').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n let is_device = $('#ugc_setting_device_val').val();\n let ugc_add_tab_name = $('.ugc_add_tab_input').val();\n\n if (!ugc_add_tab_name) {\n alert('タブ名を入力してください。');\n return;\n }\n\n $.ajax({\n url: '/add_tab_name',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n ugc_group_ab_test_id: ugc_group_ab_test_id,\n is_device: is_device,\n tab_name: ugc_add_tab_name,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('タブを追加しました。');\n location.reload();\n }\n });\n });\n\n $('.ugc_tag_check').on('change', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n let is_device = $('#ugc_setting_device_val').val();\n let tab_id = $('.ugc_tab_select option:selected').val();\n let sns_post_ugc_group_id = $(this).data('sns_post_ugc_group_id');\n let check_flag;\n\n if ($(this).prop('checked')) {\n // チェックボックスはチェックされています\n check_flag = 1;\n } else {\n // チェックボックスはチェックされていません\n check_flag = 0;\n }\n\n $.ajax({\n url: '/link_tab_to_post',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n ugc_group_ab_test_id: ugc_group_ab_test_id,\n is_device: is_device,\n tab_id: tab_id,\n sns_post_ugc_group_id: sns_post_ugc_group_id,\n check_flag: check_flag,\n },\n dataType: 'json',\n }).done(function (data) {});\n });\n\n $('.ugc_tab_select').on('change', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n let is_device = $('#ugc_setting_device_val').val();\n let tab_id = $('.ugc_tab_select option:selected').val();\n let sns_post_ugc_group_id = $(this).data('sns_post_ugc_group_id');\n\n let url = new URL(window.location.href);\n if (url.searchParams.has('tab_id')) {\n url.searchParams.set('tab_id', tab_id);\n } else {\n url.searchParams.append('tab_id', tab_id);\n }\n history.replaceState({}, null, url.toString());\n location.reload();\n });\n\n $('#ugc_edit_tab_name_submit').on('click', function () {\n let tab_id = $('.ugc_tab_select option:selected').val();\n let ugc_edit_tab_name_input = $('.ugc_edit_tab_name_input').val();\n let ugc_tab_style_id = $(this).data('ugc_tab_style_id');\n\n if (!ugc_edit_tab_name_input) {\n alert('名前を入れて下さい。');\n return;\n }\n\n $.ajax({\n url: '/edit_tab_name',\n type: 'POST',\n data: {\n tab_id: tab_id,\n edit_tab_name: ugc_edit_tab_name_input,\n ugc_tab_style_id: ugc_tab_style_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('タブ名を編集しました。');\n location.reload();\n }\n });\n });\n\n $('.ugc_tag_delete').on('click', function () {\n let tab_id = $('.ugc_tab_select option:selected').val();\n let ugc_tab_style_id = $(this).data('ugc_tab_style_id');\n\n $.ajax({\n url: '/delete_ugc_tag',\n type: 'POST',\n data: {\n tab_id: tab_id,\n ugc_tab_style_id: ugc_tab_style_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('カテゴリを削除しました。');\n let url = new URL(window.location.href);\n url.searchParams.delete('tab_id');\n history.replaceState({}, null, url.toString());\n location.reload();\n } else {\n alert('最後の一個のカテゴリは削除できません。');\n }\n });\n });\n\n $('#ugc_common_custom_set').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n let is_device = $('#ugc_setting_device_val').val();\n let is_category_title = $('#is_category_title').val();\n let is_category_title_icon = $('#is_category_title_icon').val();\n let category_title_margin = $('#category_title_margin').val();\n let category_title_height = $('#category_title_height').val();\n let category_title_justify_content = $('#category_title_justify_content').val();\n let category_title_icon_size = $('#category_title_icon_size').val();\n let category_title_original_icon_width = $('#category_title_original_icon_width').val();\n let category_title_original_icon_height = $('#category_title_original_icon_height').val();\n let category_title_original_icon_img_url = $('#category_title_original_icon_img_url').val();\n let category_title_icon_margin = $('#category_title_icon_margin').val();\n let category_title_text = $('#category_title_text').val();\n let category_title_font_family = $('#category_title_font_family').val();\n let category_title_font_size = $('#category_title_font_size').val();\n let category_title_font_weight = $('#category_title_font_weight').val();\n let category_title_font_color = $('#category_title_font_color').val();\n\n let category_subtitle_margin = $('#category_subtitle_margin').val();\n let category_subtitle_height = $('#category_subtitle_height').val();\n let category_subtitle_text = $('#category_subtitle_text').val();\n let category_subtitle_font_family = $('#category_subtitle_font_family').val();\n let category_subtitle_font_size = $('#category_subtitle_font_size').val();\n let category_subtitle_font_weight = $('#category_subtitle_font_weight').val();\n let category_subtitle_font_color = $('#category_subtitle_font_color').val();\n\n let clickable_subtitle_margin = $('#clickable_subtitle_margin').val();\n let clickable_subtitle_height = $('#clickable_subtitle_height').val();\n let clickable_subtitle_text = $('#clickable_subtitle_text').val();\n let clickable_subtitle_font_family = $('#clickable_subtitle_font_family').val();\n let clickable_subtitle_font_size = $('#clickable_subtitle_font_size').val();\n let clickable_subtitle_font_weight = $('#clickable_subtitle_font_weight').val();\n let clickable_subtitle_font_color = $('#clickable_subtitle_font_color').val();\n let clickable_subtitle_text_align = $('#clickable_subtitle_text_align').val();\n let clickable_subtitle_a_text = $('#clickable_subtitle_a_text').val();\n let clickable_subtitle_a_url = $('#clickable_subtitle_a_url').val();\n let clickable_subtitle_a_font_family = $('#clickable_subtitle_a_font_family').val();\n let clickable_subtitle_a_font_size = $('#clickable_subtitle_a_font_size').val();\n let clickable_subtitle_a_font_weight = $('#clickable_subtitle_a_font_weight').val();\n let clickable_subtitle_a_font_color = $('#clickable_subtitle_a_font_color').val();\n let clickable_subtitle_a_margin = $('#clickable_subtitle_a_margin').val();\n let clickable_subtitle_a_text_decoration = $('#clickable_subtitle_a_text_decoration').val();\n\n let container_justify_content = $('#container_justify_content').val();\n let container_width = $('#container_width').val();\n let container_margin = $('#container_margin').val();\n let container_margin_x = $('#container_margin_x').val();\n let container_left = $('#container_left').val();\n let container_transform = $('#container_transform').val();\n let img_column_count = $('#img_column_count').val();\n let img_box_width = $('#img_box_width').val();\n let img_box_height = $('#img_box_height').val();\n let img_box_border_radius = $('#img_box_border_radius').val();\n let img_box_object_fit = $('#img_box_object_fit').val();\n let img_box_margin = $('#img_box_margin').val();\n let img_box_background_color = $('#img_box_background_color').val();\n let is_caption = $('#is_caption').val();\n let is_hover = $('#is_hover').val();\n\n let caption_font_size = $('#caption_font_size').val();\n let caption_font_family = $('#caption_font_family').val();\n let caption_font_weight = $('#caption_font_weight').val();\n let caption_font_color = $('#caption_font_color').val();\n let caption_height = $('#caption_height').val();\n let caption_max_height = $('#caption_max_height').val();\n let caption_line_height = $('#caption_line_height').val();\n let caption_margin = $('#caption_margin').val();\n let caption_blur_height = $('#caption_blur_height').val();\n let caption_blur_width = $('#caption_blur_width').val();\n let caption_blur_top = $('#caption_blur_top').val();\n let caption_blur_left = $('#caption_blur_left').val();\n let caption_blur_background_color = $('#caption_blur_background_color').val();\n\n let is_username = $('#is_username').val();\n let username_justify_content = $('#username_justify_content').val();\n let username_margin = $('#username_margin').val();\n let is_username_icon = $('#is_username_icon').val();\n let username_icon_width = $('#username_icon_width').val();\n let username_icon_height = $('#username_icon_height').val();\n let username_icon_margin = $('#username_icon_margin').val();\n let username_font_size = $('#username_font_size').val();\n let username_font_family = $('#username_font_family').val();\n let username_font_weight = $('#username_font_weight').val();\n let username_font_color = $('#username_font_color').val();\n\n $.ajax({\n url: '/update_ugc_common_styles',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n ugc_group_ab_test_id: ugc_group_ab_test_id,\n is_device: is_device,\n is_category_title: is_category_title,\n is_category_title_icon: is_category_title_icon,\n category_title_margin: category_title_margin,\n category_title_height: category_title_height,\n category_title_justify_content: category_title_justify_content,\n category_title_icon_size: category_title_icon_size,\n category_title_original_icon_width: category_title_original_icon_width,\n category_title_original_icon_height: category_title_original_icon_height,\n category_title_original_icon_img_url: category_title_original_icon_img_url,\n category_title_icon_margin: category_title_icon_margin,\n category_title_text: category_title_text,\n category_title_font_family: category_title_font_family,\n category_title_font_size: category_title_font_size,\n category_title_font_weight: category_title_font_weight,\n category_title_font_color: category_title_font_color,\n category_subtitle_margin: category_subtitle_margin,\n category_subtitle_height: category_subtitle_height,\n category_subtitle_text: category_subtitle_text,\n category_subtitle_font_family: category_subtitle_font_family,\n category_subtitle_font_size: category_subtitle_font_size,\n category_subtitle_font_weight: category_subtitle_font_weight,\n category_subtitle_font_color: category_subtitle_font_color,\n clickable_subtitle_margin: clickable_subtitle_margin,\n clickable_subtitle_height: clickable_subtitle_height,\n clickable_subtitle_text: clickable_subtitle_text,\n clickable_subtitle_font_family: clickable_subtitle_font_family,\n clickable_subtitle_font_size: clickable_subtitle_font_size,\n clickable_subtitle_font_weight: clickable_subtitle_font_weight,\n clickable_subtitle_font_color: clickable_subtitle_font_color,\n clickable_subtitle_text_align: clickable_subtitle_text_align,\n clickable_subtitle_a_text: clickable_subtitle_a_text,\n clickable_subtitle_a_url: clickable_subtitle_a_url,\n clickable_subtitle_a_font_family: clickable_subtitle_a_font_family,\n clickable_subtitle_a_font_size: clickable_subtitle_a_font_size,\n clickable_subtitle_a_font_weight: clickable_subtitle_a_font_weight,\n clickable_subtitle_a_font_color: clickable_subtitle_a_font_color,\n clickable_subtitle_a_margin: clickable_subtitle_a_margin,\n clickable_subtitle_a_text_decoration: clickable_subtitle_a_text_decoration,\n container_justify_content: container_justify_content,\n container_width: container_width,\n container_margin: container_margin,\n container_margin_x: container_margin_x,\n container_left: container_left,\n container_transform: container_transform,\n img_column_count: img_column_count,\n img_box_width: img_box_width,\n img_box_height: img_box_height,\n img_box_border_radius: img_box_border_radius,\n img_box_object_fit: img_box_object_fit,\n img_box_margin: img_box_margin,\n img_box_background_color: img_box_background_color,\n is_caption: is_caption,\n is_hover: is_hover,\n caption_font_size: caption_font_size,\n caption_font_family: caption_font_family,\n caption_font_weight: caption_font_weight,\n caption_font_color: caption_font_color,\n caption_height: caption_height,\n caption_max_height: caption_max_height,\n caption_line_height: caption_line_height,\n caption_margin: caption_margin,\n caption_blur_height: caption_blur_height,\n caption_blur_width: caption_blur_width,\n caption_blur_top: caption_blur_top,\n caption_blur_left: caption_blur_left,\n caption_blur_background_color: caption_blur_background_color,\n is_username: is_username,\n username_justify_content: username_justify_content,\n username_margin: username_margin,\n is_username_icon: is_username_icon,\n username_icon_width: username_icon_width,\n username_icon_height: username_icon_height,\n username_icon_margin: username_icon_margin,\n username_font_size: username_font_size,\n username_font_family: username_font_family,\n username_font_weight: username_font_weight,\n username_font_color: username_font_color,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('共通デザインを登録しました。');\n location.reload();\n }\n });\n });\n\n $('#ugc_grid_custom_set').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n let is_device = $('#ugc_setting_device_val').val();\n let grid_first_display_img_count = $('#grid_first_display_img_count').val();\n let grid_view_more_display_img_count = $('#grid_view_more_display_img_count').val();\n let is_scroll_flag = $('#is_scroll_flag').val();\n let grid_display_btn_width = $('#grid_display_btn_width').val();\n let grid_display_btn_font_size = $('#grid_display_btn_font_size').val();\n let grid_display_btn_font_family = $('#grid_display_btn_font_family').val();\n let grid_display_btn_font_weight = $('#grid_display_btn_font_weight').val();\n let grid_display_btn_font_color = $('#grid_display_btn_font_color').val();\n let grid_view_more_btn_text = $('#grid_view_more_btn_text').val();\n\n let grid_view_more_text_align = $('#grid_view_more_text_align').val();\n let grid_view_more_btn_padding = $('#grid_view_more_btn_padding').val();\n let grid_view_more_btn_border = $('#grid_view_more_btn_border').val();\n let grid_view_more_btn_border_radius = $('#grid_view_more_btn_border_radius').val();\n\n let grid_view_more_btn_plus_minus_border_color = $('#grid_view_more_btn_plus_minus_border_color').val();\n let grid_view_more_btn_plus_minus_before_right = $('#grid_view_more_btn_plus_minus_before_right').val();\n let grid_view_more_btn_plus_minus_before_top = $('#grid_view_more_btn_plus_minus_before_top').val();\n let grid_view_more_btn_plus_minus_before_width = $('#grid_view_more_btn_plus_minus_before_width').val();\n let grid_view_more_btn_plus_minus_before_height = $('#grid_view_more_btn_plus_minus_before_height').val();\n let grid_view_more_btn_plus_minus_before_transform = $('#grid_view_more_btn_plus_minus_before_transform').val();\n let grid_view_more_btn_plus_minus_after_right = $('#grid_view_more_btn_plus_minus_after_right').val();\n let grid_view_more_btn_plus_minus_after_top = $('#grid_view_more_btn_plus_minus_after_top').val();\n let grid_view_more_btn_plus_minus_after_width = $('#grid_view_more_btn_plus_minus_after_width').val();\n let grid_view_more_btn_plus_minus_after_height = $('#grid_view_more_btn_plus_minus_after_height').val();\n let grid_view_more_btn_plus_minus_after_transform = $('#grid_view_more_btn_plus_minus_after_transform').val();\n\n let is_grid_view_more_btn_plus_minus = $('#is_grid_view_more_btn_plus_minus').val();\n let grid_close_btn_text = $('#grid_close_btn_text').val();\n let grid_view_more_btn_margin = $('#grid_view_more_btn_margin').val();\n\n $.ajax({\n url: '/update_ugc_grid_styles',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n ugc_group_ab_test_id: ugc_group_ab_test_id,\n is_device: is_device,\n grid_first_display_img_count: grid_first_display_img_count,\n grid_view_more_display_img_count: grid_view_more_display_img_count,\n is_scroll_flag: is_scroll_flag,\n grid_display_btn_width: grid_display_btn_width,\n grid_display_btn_font_family: grid_display_btn_font_family,\n grid_display_btn_font_weight: grid_display_btn_font_weight,\n grid_display_btn_font_color: grid_display_btn_font_color,\n grid_view_more_btn_text: grid_view_more_btn_text,\n grid_view_more_text_align: grid_view_more_text_align,\n grid_view_more_btn_padding: grid_view_more_btn_padding,\n grid_view_more_btn_border: grid_view_more_btn_border,\n grid_view_more_btn_border_radius: grid_view_more_btn_border_radius,\n is_grid_view_more_btn_plus_minus: is_grid_view_more_btn_plus_minus,\n grid_close_btn_text: grid_close_btn_text,\n grid_display_btn_font_size: grid_display_btn_font_size,\n grid_view_more_btn_margin: grid_view_more_btn_margin,\n grid_view_more_btn_plus_minus_border_color: grid_view_more_btn_plus_minus_border_color,\n grid_view_more_btn_plus_minus_before_right: grid_view_more_btn_plus_minus_before_right,\n grid_view_more_btn_plus_minus_before_top: grid_view_more_btn_plus_minus_before_top,\n grid_view_more_btn_plus_minus_before_width: grid_view_more_btn_plus_minus_before_width,\n grid_view_more_btn_plus_minus_before_height: grid_view_more_btn_plus_minus_before_height,\n grid_view_more_btn_plus_minus_before_transform: grid_view_more_btn_plus_minus_before_transform,\n grid_view_more_btn_plus_minus_after_right: grid_view_more_btn_plus_minus_after_right,\n grid_view_more_btn_plus_minus_after_top: grid_view_more_btn_plus_minus_after_top,\n grid_view_more_btn_plus_minus_after_width: grid_view_more_btn_plus_minus_after_width,\n grid_view_more_btn_plus_minus_after_height: grid_view_more_btn_plus_minus_after_height,\n grid_view_more_btn_plus_minus_after_transform: grid_view_more_btn_plus_minus_after_transform,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('グリッドデザインを登録しました。');\n location.reload();\n }\n });\n });\n\n $('#ugc_slider_custom_set').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n let is_device = $('#ugc_setting_device_val').val();\n\n let is_slider_prev_btn = $('#is_slider_prev_btn').val();\n let slider_prev_btn_top = $('#slider_prev_btn_top').val();\n let slider_prev_btn_left = $('#slider_prev_btn_left').val();\n let slider_prev_btn_width = $('#slider_prev_btn_width').val();\n let slider_prev_btn_height = $('#slider_prev_btn_height').val();\n let slider_prev_btn_border_radius = $('#slider_prev_btn_border_radius').val();\n let slider_prev_btn_text_color = $('#slider_prev_btn_text_color').val();\n let slider_prev_btn_backgroud_color = $('#slider_prev_btn_backgroud_color').val();\n let slider_prev_btn_backgroud_opacity = $('#slider_prev_btn_backgroud_opacity').val();\n let slider_prev_btn_text_line_width = $('#slider_prev_btn_text_line_width').val();\n let slider_prev_btn_text_line_height = $('#slider_prev_btn_text_line_height').val();\n let slider_prev_btn_text_line_weight = $('#slider_prev_btn_text_line_weight').val();\n let slider_prev_btn_text_position_right = $('#slider_prev_btn_text_position_right').val();\n let slider_prev_btn_text_position_top = $('#slider_prev_btn_text_position_top').val();\n let slider_prev_btn_text_line_rotate = $('#slider_prev_btn_text_line_rotate').val();\n let slider_prev_btn_text_line_translatey = $('#slider_prev_btn_text_line_translatey').val();\n let slider_prev_btn_text_line_skew = $('#slider_prev_btn_text_line_skew').val();\n let is_slider_next_btn = $('#is_slider_next_btn').val();\n let slider_next_btn_top = $('#slider_next_btn_top').val();\n let slider_next_btn_left = $('#slider_next_btn_left').val();\n let slider_next_btn_width = $('#slider_next_btn_width').val();\n let slider_next_btn_height = $('#slider_next_btn_height').val();\n let slider_next_btn_border_radius = $('#slider_next_btn_border_radius').val();\n let slider_next_btn_text_color = $('#slider_next_btn_text_color').val();\n let slider_next_btn_backgroud_color = $('#slider_next_btn_backgroud_color').val();\n let slider_next_btn_backgroud_opacity = $('#slider_next_btn_backgroud_opacity').val();\n let slider_next_btn_text_line_width = $('#slider_next_btn_text_line_width').val();\n let slider_next_btn_text_line_height = $('#slider_next_btn_text_line_height').val();\n let slider_next_btn_text_line_weight = $('#slider_next_btn_text_line_weight').val();\n let slider_next_btn_text_position_right = $('#slider_next_btn_text_position_right').val();\n let slider_next_btn_text_position_top = $('#slider_next_btn_text_position_top').val();\n let slider_next_btn_text_line_rotate = $('#slider_next_btn_text_line_rotate').val();\n let slider_next_btn_text_line_translatey = $('#slider_next_btn_text_line_translatey').val();\n let slider_next_btn_text_line_skew = $('#slider_next_btn_text_line_skew').val();\n let slider_btn_z_index = $('#slider_btn_z_index').val();\n\n $.ajax({\n url: '/update_ugc_slider_styles',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n ugc_group_ab_test_id: ugc_group_ab_test_id,\n is_device: is_device,\n is_slider_prev_btn: is_slider_prev_btn,\n slider_prev_btn_top: slider_prev_btn_top,\n slider_prev_btn_left: slider_prev_btn_left,\n slider_prev_btn_width: slider_prev_btn_width,\n slider_prev_btn_height: slider_prev_btn_height,\n slider_prev_btn_border_radius: slider_prev_btn_border_radius,\n slider_prev_btn_text_color: slider_prev_btn_text_color,\n slider_prev_btn_backgroud_color: slider_prev_btn_backgroud_color,\n slider_prev_btn_backgroud_opacity: slider_prev_btn_backgroud_opacity,\n slider_prev_btn_text_line_width: slider_prev_btn_text_line_width,\n slider_prev_btn_text_line_height: slider_prev_btn_text_line_height,\n slider_prev_btn_text_line_weight: slider_prev_btn_text_line_weight,\n slider_prev_btn_text_position_right: slider_prev_btn_text_position_right,\n slider_prev_btn_text_position_top: slider_prev_btn_text_position_top,\n slider_prev_btn_text_line_rotate: slider_prev_btn_text_line_rotate,\n slider_prev_btn_text_line_translatey: slider_prev_btn_text_line_translatey,\n slider_prev_btn_text_line_skew: slider_prev_btn_text_line_skew,\n is_slider_next_btn: is_slider_next_btn,\n slider_next_btn_top: slider_next_btn_top,\n slider_next_btn_left: slider_next_btn_left,\n slider_next_btn_width: slider_next_btn_width,\n slider_next_btn_height: slider_next_btn_height,\n slider_next_btn_border_radius: slider_next_btn_border_radius,\n slider_next_btn_text_color: slider_next_btn_text_color,\n slider_next_btn_backgroud_color: slider_next_btn_backgroud_color,\n slider_next_btn_backgroud_opacity: slider_next_btn_backgroud_opacity,\n slider_next_btn_text_line_width: slider_next_btn_text_line_width,\n slider_next_btn_text_line_height: slider_next_btn_text_line_height,\n slider_next_btn_text_line_weight: slider_next_btn_text_line_weight,\n slider_next_btn_text_position_right: slider_next_btn_text_position_right,\n slider_next_btn_text_position_top: slider_next_btn_text_position_top,\n slider_next_btn_text_line_rotate: slider_next_btn_text_line_rotate,\n slider_next_btn_text_line_translatey: slider_next_btn_text_line_translatey,\n slider_next_btn_text_line_skew: slider_next_btn_text_line_skew,\n slider_btn_z_index: slider_btn_z_index,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('スライダーのデザインを登録しました。');\n location.reload();\n }\n });\n });\n\n $('#ugc_tab_custom_set').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n let is_device = $('#ugc_setting_device_val').val();\n\n let tab_name_container_justify_content = $('#tab_name_container_justify_content').val();\n let tab_name_container_margin = $('#tab_name_container_margin').val();\n let tab_name_font_size = $('#tab_name_font_size').val();\n let tab_name_font_family = $('#tab_name_font_family').val();\n let tab_name_font_weight = $('#tab_name_font_weight').val();\n let tab_name_font_color = $('#tab_name_font_color').val();\n let tab_name_border_radius = $('#tab_name_border_radius').val();\n let tab_name_border = $('#tab_name_border').val();\n let tab_name_padding = $('#tab_name_padding').val();\n let tab_name_margin = $('#tab_name_margin').val();\n let tab_name_max_width = $('#tab_name_max_width').val();\n let tab_name_background_color = $('#tab_name_background_color').val();\n let tab_name_transition = $('#tab_name_transition').val();\n let tab_name_hover_background_color = $('#tab_name_hover_background_color').val();\n let tab_name_hover_font_color = $('#tab_name_hover_font_color').val();\n let tab_name_hover_opacity = $('#tab_name_hover_opacity').val();\n let tab_name_selected_background_color = $('#tab_name_selected_background_color').val();\n let tab_name_selected_font_color = $('#tab_name_selected_font_color').val();\n let tab_loading_text = $('#tab_loading_text').val();\n let tab_loading_width = $('#tab_loading_width').val();\n let tab_loading_height = $('#tab_loading_height').val();\n let tab_loading_font_size = $('#tab_loading_font_size').val();\n let tab_loading_font_family = $('#tab_loading_font_family').val();\n let tab_loading_font_weight = $('#tab_loading_font_weight').val();\n let tab_loading_font_color = $('#tab_loading_font_color').val();\n\n let tab_first_display_img_count = $('#tab_first_display_img_count').val();\n let tab_view_more_display_img_count = $('#tab_view_more_display_img_count').val();\n let tab_display_btn_width = $('#tab_display_btn_width').val();\n let tab_display_btn_font_size = $('#tab_display_btn_font_size').val();\n let tab_display_btn_font_family = $('#tab_display_btn_font_family').val();\n let tab_display_btn_font_weight = $('#tab_display_btn_font_weight').val();\n let tab_display_btn_font_color = $('#tab_display_btn_font_color').val();\n let tab_view_more_btn_text = $('#tab_view_more_btn_text').val();\n\n let tab_view_more_text_align = $('#tab_view_more_text_align').val();\n let tab_view_more_btn_padding = $('#tab_view_more_btn_padding').val();\n let tab_view_more_btn_border = $('#tab_view_more_btn_border').val();\n let tab_view_more_btn_border_radius = $('#tab_view_more_btn_border_radius').val();\n\n let tab_view_more_btn_plus_minus_border_color = $('#tab_view_more_btn_plus_minus_border_color').val();\n let tab_view_more_btn_plus_minus_before_right = $('#tab_view_more_btn_plus_minus_before_right').val();\n let tab_view_more_btn_plus_minus_before_top = $('#tab_view_more_btn_plus_minus_before_top').val();\n let tab_view_more_btn_plus_minus_before_width = $('#tab_view_more_btn_plus_minus_before_width').val();\n let tab_view_more_btn_plus_minus_before_height = $('#tab_view_more_btn_plus_minus_before_height').val();\n let tab_view_more_btn_plus_minus_before_transform = $('#tab_view_more_btn_plus_minus_before_transform').val();\n let tab_view_more_btn_plus_minus_after_right = $('#tab_view_more_btn_plus_minus_after_right').val();\n let tab_view_more_btn_plus_minus_after_top = $('#tab_view_more_btn_plus_minus_after_top').val();\n let tab_view_more_btn_plus_minus_after_width = $('#tab_view_more_btn_plus_minus_after_width').val();\n let tab_view_more_btn_plus_minus_after_height = $('#tab_view_more_btn_plus_minus_after_height').val();\n let tab_view_more_btn_plus_minus_after_transform = $('#tab_view_more_btn_plus_minus_after_transform').val();\n\n let is_tab_view_more_btn_plus_minus = $('#is_tab_view_more_btn_plus_minus').val();\n let tab_close_btn_text = $('#tab_close_btn_text').val();\n let tab_view_more_btn_margin = $('#tab_view_more_btn_margin').val();\n\n $.ajax({\n url: '/update_ugc_tab_styles',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n ugc_group_ab_test_id: ugc_group_ab_test_id,\n is_device: is_device,\n tab_name_container_justify_content: tab_name_container_justify_content,\n tab_name_container_margin: tab_name_container_margin,\n tab_name_font_size: tab_name_font_size,\n tab_name_font_family: tab_name_font_family,\n tab_name_font_weight: tab_name_font_weight,\n tab_name_font_color: tab_name_font_color,\n tab_name_border_radius: tab_name_border_radius,\n tab_name_border: tab_name_border,\n tab_name_padding: tab_name_padding,\n tab_name_margin: tab_name_margin,\n tab_name_max_width: tab_name_max_width,\n tab_name_background_color: tab_name_background_color,\n tab_name_transition: tab_name_transition,\n tab_name_hover_background_color: tab_name_hover_background_color,\n tab_name_hover_font_color: tab_name_hover_font_color,\n tab_name_hover_opacity: tab_name_hover_opacity,\n tab_name_selected_background_color: tab_name_selected_background_color,\n tab_name_selected_font_color: tab_name_selected_font_color,\n tab_loading_text: tab_loading_text,\n tab_loading_width: tab_loading_width,\n tab_loading_height: tab_loading_height,\n tab_loading_font_size: tab_loading_font_size,\n tab_loading_font_family: tab_loading_font_family,\n tab_loading_font_weight: tab_loading_font_weight,\n tab_loading_font_color: tab_loading_font_color,\n tab_first_display_img_count: tab_first_display_img_count,\n tab_view_more_display_img_count: tab_view_more_display_img_count,\n tab_display_btn_width: tab_display_btn_width,\n tab_display_btn_font_family: tab_display_btn_font_family,\n tab_display_btn_font_weight: tab_display_btn_font_weight,\n tab_display_btn_font_color: tab_display_btn_font_color,\n tab_view_more_btn_text: tab_view_more_btn_text,\n tab_view_more_text_align: tab_view_more_text_align,\n tab_view_more_btn_padding: tab_view_more_btn_padding,\n tab_view_more_btn_border: tab_view_more_btn_border,\n tab_view_more_btn_border_radius: tab_view_more_btn_border_radius,\n is_tab_view_more_btn_plus_minus: is_tab_view_more_btn_plus_minus,\n tab_close_btn_text: tab_close_btn_text,\n tab_display_btn_font_size: tab_display_btn_font_size,\n tab_view_more_btn_margin: tab_view_more_btn_margin,\n tab_view_more_btn_plus_minus_border_color: tab_view_more_btn_plus_minus_border_color,\n tab_view_more_btn_plus_minus_before_right: tab_view_more_btn_plus_minus_before_right,\n tab_view_more_btn_plus_minus_before_top: tab_view_more_btn_plus_minus_before_top,\n tab_view_more_btn_plus_minus_before_width: tab_view_more_btn_plus_minus_before_width,\n tab_view_more_btn_plus_minus_before_height: tab_view_more_btn_plus_minus_before_height,\n tab_view_more_btn_plus_minus_before_transform: tab_view_more_btn_plus_minus_before_transform,\n tab_view_more_btn_plus_minus_after_right: tab_view_more_btn_plus_minus_after_right,\n tab_view_more_btn_plus_minus_after_top: tab_view_more_btn_plus_minus_after_top,\n tab_view_more_btn_plus_minus_after_width: tab_view_more_btn_plus_minus_after_width,\n tab_view_more_btn_plus_minus_after_height: tab_view_more_btn_plus_minus_after_height,\n tab_view_more_btn_plus_minus_after_transform: tab_view_more_btn_plus_minus_after_transform,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('タブ表示デザインを登録しました。');\n location.reload();\n }\n });\n });\n\n $('#ugc_modal_custom_set').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n let is_device = $('#ugc_setting_device_val').val();\n\n let modal_max_width = $('#modal_max_width').val();\n let modal_max_height = $('#modal_max_height').val();\n let modal_left_width = $('#modal_left_width').val();\n let modal_right_width = $('#modal_right_width').val();\n let modal_right_height = $('#modal_right_height').val();\n let is_modal_related_items = $('#is_modal_related_items').val();\n let is_modal_related_items_title = $('#is_modal_related_items_title').val();\n let modal_related_items_title_text = $('#modal_related_items_title_text').val();\n let modal_related_items_title_font_family = $('#modal_related_items_title_font_family').val();\n let modal_related_items_title_font_size = $('#modal_related_items_title_font_size').val();\n let modal_related_items_title_font_weight = $('#modal_related_items_title_font_weight').val();\n let modal_related_items_title_font_color = $('#modal_related_items_title_font_color').val();\n let is_modal_related_items_link = $('#is_modal_related_items_link').val();\n let modal_related_items_img_column_margin = $('#modal_related_items_img_column_margin').val();\n let modal_related_items_img_column_height = $('#modal_related_items_img_column_height').val();\n let modal_related_items_img_column_width = $('#modal_related_items_img_column_width').val();\n let modal_related_items_initial_img_count = $('#modal_related_items_initial_img_count').val();\n let modal_related_items_img_height = $('#modal_related_items_img_height').val();\n let modal_related_items_img_width = $('#modal_related_items_img_width').val();\n let modal_related_items_img_margin = $('#modal_related_items_img_margin').val();\n let modal_related_items_name_line_height = $('#modal_related_items_name_line_height').val();\n let modal_related_items_name_font_size = $('#modal_related_items_name_font_size').val();\n let modal_related_items_name_font_family = $('#modal_related_items_name_font_family').val();\n let modal_related_items_name_font_weight = $('#modal_related_items_name_font_weight').val();\n let modal_related_items_name_text_align = $('#modal_related_items_name_text_align').val();\n let modal_related_items_name_font_color = $('#modal_related_items_name_font_color').val();\n let modal_related_items_price_font_size = $('#modal_related_items_price_font_size').val();\n let modal_related_items_price_font_family = $('#modal_related_items_price_font_family').val();\n let modal_related_items_price_font_weight = $('#modal_related_items_price_font_weight').val();\n let modal_related_items_price_text_align = $('#modal_related_items_price_text_align').val();\n let modal_related_items_price_font_color = $('#modal_related_items_price_font_color').val();\n let modal_related_items_price_unit_text = $('#modal_related_items_price_unit_text').val();\n let is_modal_photo_by_link = $('#is_modal_photo_by_link').val();\n let modal_photo_by_icon_size = $('#modal_photo_by_icon_size').val();\n let modal_photo_by_margin = $('#modal_photo_by_margin').val();\n let modal_photo_by_text_align = $('#modal_photo_by_text_align').val();\n let modal_photo_by_text = $('#modal_photo_by_text').val();\n let modal_photo_by_font_size = $('#modal_photo_by_font_size').val();\n let modal_photo_by_font_family = $('#modal_photo_by_font_family').val();\n let modal_photo_by_font_weight = $('#modal_photo_by_font_weight').val();\n let modal_photo_by_font_color = $('#modal_photo_by_font_color').val();\n let is_modal_related_items_product_comment = $('#is_modal_related_items_product_comment').val();\n let modal_related_items_product_comment_height = $('#modal_related_items_product_comment_height').val();\n let modal_related_items_product_comment_line_height = $('#modal_related_items_product_comment_line_height').val();\n let modal_related_items_product_comment_position = $('#modal_related_items_product_comment_position').val();\n let modal_related_items_product_comment_font_size = $('#modal_related_items_product_comment_font_size').val();\n let modal_related_items_product_comment_font_family = $('#modal_related_items_product_comment_font_family').val();\n let modal_related_items_product_comment_font_weight = $('#modal_related_items_product_comment_font_weight').val();\n let modal_related_items_product_comment_font_color = $('#modal_related_items_product_comment_font_color').val();\n let modal_del_btn_size = $('#modal_del_btn_size').val();\n let modal_sns_post_img_object_fit = $('#modal_sns_post_img_object_fit').val();\n\n let modal_prev_post_btn_bg_color = $('#modal_prev_post_btn_bg_color').val();\n let modal_prev_post_btn_opacity = $('#modal_prev_post_btn_opacity').val();\n let modal_prev_post_btn_top = $('#modal_prev_post_btn_top').val();\n let modal_prev_post_btn_left = $('#modal_prev_post_btn_left').val();\n let modal_prev_post_btn_width = $('#modal_prev_post_btn_width').val();\n let modal_prev_post_btn_height = $('#modal_prev_post_btn_height').val();\n let modal_prev_post_btn_line_color = $('#modal_prev_post_btn_line_color').val();\n let modal_prev_post_btn_line_width = $('#modal_prev_post_btn_line_width').val();\n let modal_prev_post_btn_line_height = $('#modal_prev_post_btn_line_height').val();\n let modal_prev_post_btn_line_right = $('#modal_prev_post_btn_line_right').val();\n let modal_prev_post_btn_line_top = $('#modal_prev_post_btn_line_top').val();\n let modal_prev_post_btn_line_weight = $('#modal_prev_post_btn_line_weight').val();\n let modal_prev_post_btn_line_rotate = $('#modal_prev_post_btn_line_rotate').val();\n let modal_prev_post_btn_line_translatey = $('#modal_prev_post_btn_line_translatey').val();\n\n let modal_next_post_btn_bg_color = $('#modal_next_post_btn_bg_color').val();\n let modal_next_post_btn_opacity = $('#modal_next_post_btn_opacity').val();\n let modal_next_post_btn_top = $('#modal_next_post_btn_top').val();\n let modal_next_post_btn_left = $('#modal_next_post_btn_left').val();\n let modal_next_post_btn_width = $('#modal_next_post_btn_width').val();\n let modal_next_post_btn_height = $('#modal_next_post_btn_height').val();\n let modal_next_post_btn_line_color = $('#modal_next_post_btn_line_color').val();\n let modal_next_post_btn_line_width = $('#modal_next_post_btn_line_width').val();\n let modal_next_post_btn_line_height = $('#modal_next_post_btn_line_height').val();\n let modal_next_post_btn_line_right = $('#modal_next_post_btn_line_right').val();\n let modal_next_post_btn_line_top = $('#modal_next_post_btn_line_top').val();\n let modal_next_post_btn_line_weight = $('#modal_next_post_btn_line_weight').val();\n let modal_next_post_btn_line_rotate = $('#modal_next_post_btn_line_rotate').val();\n let modal_next_post_btn_line_translatey = $('#modal_next_post_btn_line_translatey').val();\n\n let modal_dot_left_display = $('#modal_dot_left_display').val();\n let modal_dot_left_bg_color = $('#modal_dot_left_bg_color').val();\n let modal_dot_left_height = $('#modal_dot_left_height').val();\n let modal_dot_left_width = $('#modal_dot_left_width').val();\n let modal_dot_left_opacity = $('#modal_dot_left_opacity').val();\n let modal_dot_left_border = $('#modal_dot_left_border').val();\n let modal_dot_left_border_radius = $('#modal_dot_left_border_radius').val();\n let modal_dot_left_margin = $('#modal_dot_left_margin').val();\n let modal_dot_left_line_height = $('#modal_dot_left_line_height').val();\n let modal_dot_left_line_width = $('#modal_dot_left_line_width').val();\n let modal_dot_left_line_top = $('#modal_dot_left_line_top').val();\n let modal_dot_left_line_right = $('#modal_dot_left_line_right').val();\n let modal_dot_left_line_border_top = $('#modal_dot_left_line_border_top').val();\n let modal_dot_left_line_border_right = $('#modal_dot_left_line_border_right').val();\n let modal_dot_left_line_transform = $('#modal_dot_left_line_transform').val();\n\n let modal_dot_right_display = $('#modal_dot_right_display').val();\n let modal_dot_right_bg_color = $('#modal_dot_right_bg_color').val();\n let modal_dot_right_height = $('#modal_dot_right_height').val();\n let modal_dot_right_width = $('#modal_dot_right_width').val();\n let modal_dot_right_opacity = $('#modal_dot_right_opacity').val();\n let modal_dot_right_border = $('#modal_dot_right_border').val();\n let modal_dot_right_border_radius = $('#modal_dot_right_border_radius').val();\n let modal_dot_right_margin = $('#modal_dot_right_margin').val();\n let modal_dot_right_line_height = $('#modal_dot_right_line_height').val();\n let modal_dot_right_line_width = $('#modal_dot_right_line_width').val();\n let modal_dot_right_line_top = $('#modal_dot_right_line_top').val();\n let modal_dot_right_line_right = $('#modal_dot_right_line_right').val();\n let modal_dot_right_line_border_top = $('#modal_dot_right_line_border_top').val();\n let modal_dot_right_line_border_right = $('#modal_dot_right_line_border_right').val();\n let modal_dot_right_line_transform = $('#modal_dot_right_line_transform').val();\n\n let modal_dot_display = $('#modal_dot_display').val();\n let modal_dot_height = $('#modal_dot_height').val();\n let modal_dot_width = $('#modal_dot_width').val();\n let modal_dot_opacity = $('#modal_dot_opacity').val();\n let modal_dot_border = $('#modal_dot_border').val();\n let modal_dot_border_radius = $('#modal_dot_border_radius').val();\n let modal_dot_margin = $('#modal_dot_margin').val();\n\n $.ajax({\n url: '/update_ugc_modal_styles',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n ugc_group_ab_test_id: ugc_group_ab_test_id,\n is_device: is_device,\n\n modal_max_width: modal_max_width,\n modal_max_height: modal_max_height,\n modal_left_width: modal_left_width,\n modal_right_width: modal_right_width,\n modal_right_height: modal_right_height,\n is_modal_related_items: is_modal_related_items,\n is_modal_related_items_title: is_modal_related_items_title,\n modal_related_items_title_text: modal_related_items_title_text,\n modal_related_items_title_font_family: modal_related_items_title_font_family,\n modal_related_items_title_font_weight: modal_related_items_title_font_weight,\n modal_related_items_title_font_size: modal_related_items_title_font_size,\n modal_related_items_title_font_color: modal_related_items_title_font_color,\n is_modal_related_items_link: is_modal_related_items_link,\n modal_related_items_img_column_margin: modal_related_items_img_column_margin,\n modal_related_items_img_column_height: modal_related_items_img_column_height,\n modal_related_items_img_column_width: modal_related_items_img_column_width,\n modal_related_items_initial_img_count: modal_related_items_initial_img_count,\n modal_related_items_img_height: modal_related_items_img_height,\n modal_related_items_img_width: modal_related_items_img_width,\n modal_related_items_img_margin: modal_related_items_img_margin,\n modal_related_items_name_line_height: modal_related_items_name_line_height,\n modal_related_items_name_font_size: modal_related_items_name_font_size,\n modal_related_items_name_font_family: modal_related_items_name_font_family,\n modal_related_items_name_font_weight: modal_related_items_name_font_weight,\n modal_related_items_name_font_color: modal_related_items_name_font_color,\n modal_related_items_name_text_align: modal_related_items_name_text_align,\n modal_related_items_price_font_size: modal_related_items_price_font_size,\n modal_related_items_price_font_family: modal_related_items_price_font_family,\n modal_related_items_price_font_weight: modal_related_items_price_font_weight,\n modal_related_items_price_font_color: modal_related_items_price_font_color,\n modal_related_items_price_text_align: modal_related_items_price_text_align,\n modal_related_items_price_unit_text: modal_related_items_price_unit_text,\n is_modal_photo_by_link: is_modal_photo_by_link,\n modal_photo_by_icon_size: modal_photo_by_icon_size,\n modal_photo_by_margin: modal_photo_by_margin,\n modal_photo_by_text_align: modal_photo_by_text_align,\n modal_photo_by_text: modal_photo_by_text,\n modal_photo_by_font_size: modal_photo_by_font_size,\n modal_photo_by_font_family: modal_photo_by_font_family,\n modal_photo_by_font_weight: modal_photo_by_font_weight,\n modal_photo_by_font_color: modal_photo_by_font_color,\n is_modal_related_items_product_comment: is_modal_related_items_product_comment,\n modal_related_items_product_comment_height: modal_related_items_product_comment_height,\n modal_related_items_product_comment_line_height: modal_related_items_product_comment_line_height,\n modal_related_items_product_comment_position: modal_related_items_product_comment_position,\n modal_related_items_product_comment_font_size: modal_related_items_product_comment_font_size,\n modal_related_items_product_comment_font_family: modal_related_items_product_comment_font_family,\n modal_related_items_product_comment_font_weight: modal_related_items_product_comment_font_weight,\n modal_related_items_product_comment_font_color: modal_related_items_product_comment_font_color,\n modal_del_btn_size: modal_del_btn_size,\n modal_sns_post_img_object_fit: modal_sns_post_img_object_fit,\n modal_prev_post_btn_bg_color: modal_prev_post_btn_bg_color,\n modal_prev_post_btn_opacity: modal_prev_post_btn_opacity,\n modal_prev_post_btn_top: modal_prev_post_btn_top,\n modal_prev_post_btn_left: modal_prev_post_btn_left,\n modal_prev_post_btn_width: modal_prev_post_btn_width,\n modal_prev_post_btn_height: modal_prev_post_btn_height,\n modal_prev_post_btn_line_color: modal_prev_post_btn_line_color,\n modal_prev_post_btn_line_width: modal_prev_post_btn_line_width,\n modal_prev_post_btn_line_height: modal_prev_post_btn_line_height,\n modal_prev_post_btn_line_right: modal_prev_post_btn_line_right,\n modal_prev_post_btn_line_top: modal_prev_post_btn_line_top,\n modal_prev_post_btn_line_weight: modal_prev_post_btn_line_weight,\n modal_prev_post_btn_line_rotate: modal_prev_post_btn_line_rotate,\n modal_prev_post_btn_line_translatey: modal_prev_post_btn_line_translatey,\n modal_next_post_btn_bg_color: modal_next_post_btn_bg_color,\n modal_next_post_btn_opacity: modal_next_post_btn_opacity,\n modal_next_post_btn_top: modal_next_post_btn_top,\n modal_next_post_btn_left: modal_next_post_btn_left,\n modal_next_post_btn_width: modal_next_post_btn_width,\n modal_next_post_btn_height: modal_next_post_btn_height,\n modal_next_post_btn_line_color: modal_next_post_btn_line_color,\n modal_next_post_btn_line_width: modal_next_post_btn_line_width,\n modal_next_post_btn_line_height: modal_next_post_btn_line_height,\n modal_next_post_btn_line_right: modal_next_post_btn_line_right,\n modal_next_post_btn_line_top: modal_next_post_btn_line_top,\n modal_next_post_btn_line_weight: modal_next_post_btn_line_weight,\n modal_next_post_btn_line_rotate: modal_next_post_btn_line_rotate,\n modal_next_post_btn_line_translatey: modal_next_post_btn_line_translatey,\n modal_dot_left_display: modal_dot_left_display,\n modal_dot_left_bg_color: modal_dot_left_bg_color,\n modal_dot_left_height: modal_dot_left_height,\n modal_dot_left_width: modal_dot_left_width,\n modal_dot_left_opacity: modal_dot_left_opacity,\n modal_dot_left_border: modal_dot_left_border,\n modal_dot_left_border_radius: modal_dot_left_border_radius,\n modal_dot_left_margin: modal_dot_left_margin,\n modal_dot_left_line_height: modal_dot_left_line_height,\n modal_dot_left_line_width: modal_dot_left_line_width,\n modal_dot_left_line_top: modal_dot_left_line_top,\n modal_dot_left_line_right: modal_dot_left_line_right,\n modal_dot_left_line_border_top: modal_dot_left_line_border_top,\n modal_dot_left_line_border_right: modal_dot_left_line_border_right,\n modal_dot_left_line_transform: modal_dot_left_line_transform,\n modal_dot_right_display: modal_dot_right_display,\n modal_dot_right_bg_color: modal_dot_right_bg_color,\n modal_dot_right_height: modal_dot_right_height,\n modal_dot_right_width: modal_dot_right_width,\n modal_dot_right_opacity: modal_dot_right_opacity,\n modal_dot_right_border: modal_dot_right_border,\n modal_dot_right_border_radius: modal_dot_right_border_radius,\n modal_dot_right_margin: modal_dot_right_margin,\n modal_dot_right_line_height: modal_dot_right_line_height,\n modal_dot_right_line_width: modal_dot_right_line_width,\n modal_dot_right_line_top: modal_dot_right_line_top,\n modal_dot_right_line_right: modal_dot_right_line_right,\n modal_dot_right_line_border_top: modal_dot_right_line_border_top,\n modal_dot_right_line_border_right: modal_dot_right_line_border_right,\n modal_dot_right_line_transform: modal_dot_right_line_transform,\n modal_dot_display: modal_dot_display,\n modal_dot_height: modal_dot_height,\n modal_dot_width: modal_dot_width,\n modal_dot_opacity: modal_dot_opacity,\n modal_dot_border: modal_dot_border,\n modal_dot_border_radius: modal_dot_border_radius,\n modal_dot_margin: modal_dot_margin,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('モーダルのデザインを登録しました。');\n location.reload();\n }\n });\n });\n\n $('#ugc_part_custom_set').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let ugc_group_ab_test_id = $('.ugc_group_ab_test_id').val();\n let is_device = $('#ugc_setting_device_val').val();\n\n let is_top_dividing_line = $('#is_top_dividing_line').val();\n let top_dividing_line_width = $('#top_dividing_line_width').val();\n let top_dividing_line_height = $('#top_dividing_line_height').val();\n let top_dividing_line_color = $('#top_dividing_line_color').val();\n let top_dividing_line_margin = $('#top_dividing_line_margin').val();\n let is_jump_other_page_btn = $('#is_jump_other_page_btn').val();\n let jump_other_page_btn_text = $('#jump_other_page_btn_text').val();\n let jump_other_page_url = $('#jump_other_page_url').val();\n let jump_other_page_btn_text_font_color = $('#jump_other_page_btn_text_font_color').val();\n let jump_other_page_btn_text_font_size = $('#jump_other_page_btn_text_font_size').val();\n let jump_other_page_btn_text_font_family = $('#jump_other_page_btn_text_font_family').val();\n let jump_other_page_btn_text_font_weight = $('#jump_other_page_btn_text_font_weight').val();\n let jump_other_page_btn_border_color = $('#jump_other_page_btn_border_color').val();\n let jump_other_page_btn_border_radius = $('#jump_other_page_btn_border_radius').val();\n let jump_other_page_btn_text_align = $('#jump_other_page_btn_text_align').val();\n let jump_other_page_btn_margin = $('#jump_other_page_btn_margin').val();\n let jump_other_page_btn_width = $('#jump_other_page_btn_width').val();\n let jump_other_page_btn_height = $('#jump_other_page_btn_height').val();\n let is_ig_cta_container = $('#is_ig_cta_container').val();\n let ig_cta_container_margin = $('#ig_cta_container_margin').val();\n let ig_cta_container_padding = $('#ig_cta_container_padding').val();\n let ig_cta_container_text_align = $('#ig_cta_container_text_align').val();\n let ig_cta_box_text = $('#ig_cta_box_text').val();\n let ig_cta_box_text_font_color = $('#ig_cta_box_text_font_color').val();\n let ig_cta_box_text_font_size = $('#ig_cta_box_text_font_size').val();\n let ig_cta_box_text_font_family = $('#ig_cta_box_text_font_family').val();\n let ig_cta_box_text_font_weight = $('#ig_cta_box_text_font_weight').val();\n let ig_cta_box_text_align = $('#ig_cta_box_text_align').val();\n let ig_cta_img_height = $('#ig_cta_img_height').val();\n let ig_cta_img_width = $('#ig_cta_img_width').val();\n let ig_cta_img_margin = $('#ig_cta_img_margin').val();\n let ig_cta_img_url = $('#ig_cta_img_url').val();\n\n let is_cta_title = $('#is_cta_title').val();\n let is_cta_title_icon = $('#is_cta_title_icon').val();\n let cta_title_margin = $('#cta_title_margin').val();\n let cta_title_height = $('#cta_title_height').val();\n let cta_title_justify_content = $('#cta_title_justify_content').val();\n let cta_title_icon_size = $('#cta_title_icon_size').val();\n let cta_title_icon_margin = $('#cta_title_icon_margin').val();\n let cta_title_text = $('#cta_title_text').val();\n let cta_title_font_family = $('#cta_title_font_family').val();\n let cta_title_font_size = $('#cta_title_font_size').val();\n let cta_title_font_weight = $('#cta_title_font_weight').val();\n let cta_title_font_color = $('#cta_title_font_color').val();\n\n $.ajax({\n url: '/update_ugc_part_styles',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n ugc_group_ab_test_id: ugc_group_ab_test_id,\n is_device: is_device,\n is_top_dividing_line: is_top_dividing_line,\n top_dividing_line_width: top_dividing_line_width,\n top_dividing_line_height: top_dividing_line_height,\n top_dividing_line_color: top_dividing_line_color,\n top_dividing_line_margin: top_dividing_line_margin,\n is_jump_other_page_btn: is_jump_other_page_btn,\n jump_other_page_btn_text: jump_other_page_btn_text,\n jump_other_page_url: jump_other_page_url,\n jump_other_page_btn_text_font_color: jump_other_page_btn_text_font_color,\n jump_other_page_btn_text_font_size: jump_other_page_btn_text_font_size,\n jump_other_page_btn_text_font_family: jump_other_page_btn_text_font_family,\n jump_other_page_btn_text_font_weight: jump_other_page_btn_text_font_weight,\n jump_other_page_btn_border_color: jump_other_page_btn_border_color,\n jump_other_page_btn_border_radius: jump_other_page_btn_border_radius,\n jump_other_page_btn_text_align: jump_other_page_btn_text_align,\n jump_other_page_btn_margin: jump_other_page_btn_margin,\n jump_other_page_btn_width: jump_other_page_btn_width,\n jump_other_page_btn_height: jump_other_page_btn_height,\n is_ig_cta_container: is_ig_cta_container,\n ig_cta_container_margin: ig_cta_container_margin,\n ig_cta_container_padding: ig_cta_container_padding,\n ig_cta_container_text_align: ig_cta_container_text_align,\n is_cta_title: is_cta_title,\n is_cta_title_icon: is_cta_title_icon,\n cta_title_margin: cta_title_margin,\n cta_title_height: cta_title_height,\n cta_title_justify_content: cta_title_justify_content,\n cta_title_icon_size: cta_title_icon_size,\n cta_title_icon_margin: cta_title_icon_margin,\n cta_title_text: cta_title_text,\n cta_title_font_family: cta_title_font_family,\n cta_title_font_size: cta_title_font_size,\n cta_title_font_weight: cta_title_font_weight,\n cta_title_font_color: cta_title_font_color,\n ig_cta_box_text: ig_cta_box_text,\n ig_cta_box_text_font_color: ig_cta_box_text_font_color,\n ig_cta_box_text_font_size: ig_cta_box_text_font_size,\n ig_cta_box_text_font_family: ig_cta_box_text_font_family,\n ig_cta_box_text_font_weight: ig_cta_box_text_font_weight,\n ig_cta_box_text_align: ig_cta_box_text_align,\n ig_cta_img_height: ig_cta_img_height,\n ig_cta_img_width: ig_cta_img_width,\n ig_cta_img_margin: ig_cta_img_margin,\n ig_cta_img_url: ig_cta_img_url,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('部品のデザインを登録しました。');\n location.reload();\n }\n });\n });\n\n // カスタムCSS登録/更新\n $('#update_custom_css').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let custom_css = $('#custom_css').val();\n\n $.ajax({\n url: '/update_custom_css',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n custom_css: custom_css,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('カスタムCSSを更新しました');\n location.href = `/ugc_setting?ugc_group_id=${ugc_group_id}`\n }\n });\n });\n\n $('#ugc_url_add_imput').on('click', function () {\n $(this)\n .parent()\n .children('table')\n .append(\n `\n \n \n \n \n \n
\n \n `\n );\n $('.ugc_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n $('.ugc_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n\n $('#ugc_url_set').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let urls = [];\n $('.ugc_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/set_ugc_url',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n alert('URLを登録しました');\n location.reload();\n });\n });\n\n $('.ugc_slideup_btn, .parent_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.ugc_slide_flag, .parent_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.ugc_slidedown_btn, .parent_slidedown_btn').fadeIn(0));\n });\n\n $('.ugc_slidedown_btn, .parent_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.ugc_slide_flag, .parent_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.ugc_slideup_btn, .parent_slideup_btn').fadeIn(0));\n });\n\n $('.ugc_cancel_submit_btn').on('click', function () {\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n let sns_post_id = $(this).data('id');\n $('.loadding').css('display', 'block');\n $.ajax({\n url: '/ugc_group_id_delete',\n type: 'POST',\n data: {\n sns_post_id: sns_post_id,\n ugc_group_id: ugc_group_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n $('.ugc_setting_icon, .product_set_btn').on('click', function () {\n let sns_post_id = $(this).data('id');\n let ug_sp = $(this).data('ug_sp');\n let media_type = $(this).data('media_type');\n let media_url = $(this).data('media_url');\n let post_type_name = $(this).data('post_type_name');\n let account_id = $(this).data('account_id');\n let media_id = $(this).data('media_id');\n let created_at = $(this).data('created_at');\n let my_post_media_order_file_name = $(this).data('my_post_media_order_file_name');\n let my_post_media_order_media_type = $(this).data('my_post_media_order_media_type');\n let original_file_name = $(this).data('original_file_name');\n let video_src;\n let img_src;\n let ugc_group_id = $(this).data('ugc_group_id');\n\n console.log('my_post_media_order_file_name');\n console.log(my_post_media_order_file_name);\n\n let caption = $(this).data('caption');\n let permalink = $(this).data('permalink');\n let truncated_caption = truncate(caption, 40);\n\n function truncate(str, maxLength) {\n if (str.length <= maxLength) {\n return str;\n }\n return str.substring(0, maxLength) + '...';\n }\n\n let media_html;\n\n if (media_type === 'VIDEO') {\n video_src = `${S3_MEDIA_URL}/ig_hashtag_media/videos/${post_type_name}_ac${account_id}_${media_id}_${created_at}.mp4`;\n media_html = ``;\n } else if (media_type === 'CAROUSEL_ALBUM' && media_url && (media_url.includes('//video') || media_url.includes('mp4?') || (media_url.includes('vs=') && !media_url.includes('jpg')))) {\n video_src = `${S3_MEDIA_URL}/ig_hashtag_media/videos/${post_type_name}_ac${account_id}_${media_id}_${created_at}.mp4`;\n media_html = ``;\n } else if (media_type == 'MANUAL_OWN_POST') {\n if (my_post_media_order_media_type == 'VIDEO') {\n if (original_file_name) {\n video_src = `${S3_MEDIA_URL}/ig_hashtag_media/videos/${my_post_media_order_file_name}`;\n media_html = ``;\n } else {\n video_src = media_url;\n media_html = ``;\n }\n } else if (my_post_media_order_media_type == 'IMAGE') {\n img_src = `${S3_MEDIA_URL}/ig_hashtag_media/pictures/${my_post_media_order_file_name}`;\n media_html = `\"\"`;\n }\n } else {\n img_src = `${S3_MEDIA_URL}/ig_hashtag_media/pictures/${post_type_name}_ac${account_id}_${media_id}_${created_at}.jpg`;\n media_html = `\"\"`;\n }\n\n ////////////////////////////// manageサーバーの画像を見る場合 //////////////////////////////\n // if (media_type === 'VIDEO') {\n // video_src = `/ig_hashtag_media/videos/${post_type_name}_ac${account_id}_${media_id}_${created_at}.mp4`;\n // media_html = ``;\n // } else if (media_type === 'CAROUSEL_ALBUM' && media_url && (media_url.includes('//video') || media_url.includes('mp4?') || (media_url.includes('vs=') && !media_url.includes('jpg')))) {\n // video_src = `/ig_hashtag_media/videos/${post_type_name}_ac${account_id}_${media_id}_${created_at}.mp4`;\n // media_html = ``;\n // } else if (media_type == 'MANUAL_OWN_POST') {\n // if (my_post_media_order_media_type == 'VIDEO') {\n // if (original_file_name) {\n // video_src = `/ig_hashtag_media/videos/${my_post_media_order_file_name}`;\n // media_html = ``;\n // } else {\n // video_src = media_url;\n // media_html = ``;\n // }\n // } else if (my_post_media_order_media_type == 'IMAGE') {\n // img_src = `/ig_hashtag_media/pictures/${my_post_media_order_file_name}`;\n // media_html = `\"\"`;\n // }\n // } else {\n // img_src = `/ig_hashtag_media/pictures/${post_type_name}_ac${account_id}_${media_id}_${created_at}.jpg`;\n // media_html = `\"\"`;\n // }\n ////////////////////////////// manageサーバーの画像を見る場合 //////////////////////////////\n\n $('.main').append(\n `
\n
\n
\n ×\n
\n
商品連携
\n
\n \n
\n
\n 商品選択\n \n \n
\n
\n
\n \n
\n
連携済み商品
\n
\n
\n
\n
\n
\n
`\n );\n $.ajax({\n url: '/get_product_list',\n type: 'GET',\n data: {\n sns_post_id: sns_post_id,\n ugc_group_id: ugc_group_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret1 == '0') {\n $.each(data.products, function (index, product) {\n $('.ugc_modal_right_pr_container').append(\n `
\n \n
\n
${product.code}
\n
\n
${product.name}
\n
${product.price}円
\n
\n
\n \n
\n
`\n );\n });\n }\n if (data.ret2 == '0') {\n $.each(data.linked_products, function (index, linked_product) {\n $('.ugc_modal_right_linked_pr_container').append(\n `
\n \n
\n
${linked_product.code}
\n
\n
${linked_product.name}
\n
${linked_product.price}円
\n
\n
\n \n
\n
`\n );\n });\n }\n });\n $('.platta_pr_modal_del').on('click', function () {\n $('.platta_pr_modal_container').remove();\n });\n $('.platta_pr_modal_bg').on('click', function () {\n $('.platta_pr_modal_container').remove();\n });\n });\n\n $(document)\n .off('click', '.ugc_modal_right_pr_link_btn')\n .on('click', '.ugc_modal_right_pr_link_btn', function () {\n let product_id = $(this).data('product_id');\n let sns_post_id = $(this).data('sns_post_id');\n let ugc_group_id = $(this).data('ugc_group_id');\n $.ajax({\n url: '/link_product',\n type: 'POST',\n data: {\n sns_post_id: sns_post_id,\n product_id: product_id,\n ugc_group_id: ugc_group_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n let lp = JSON.stringify(data.linked_product);\n let linked_product = JSON.parse(lp);\n $(`.ugc_modal_right_pr_link_btn[data-product_id=\"${linked_product.id}\"]`).closest('.ugc_modal_right_pr_box').next('.ugc_modal_right_pr_line').remove();\n $(`.ugc_modal_right_pr_link_btn[data-product_id=\"${linked_product.id}\"]`).closest('.ugc_modal_right_pr_box').remove();\n\n $('.ugc_modal_right_linked_pr_container').append(\n `
\n \n
\n
${linked_product.code}
\n
\n
${linked_product.name}
\n
${linked_product.price}円
\n
\n
\n \n
\n
`\n );\n }\n });\n });\n\n $(document).on('click', '.ugc_modal_right_cancel_pr_link_btn', function () {\n let product_id = $(this).data('product_id');\n let sns_post_id = $(this).data('sns_post_id');\n let ugc_group_id = $(this).data('ugc_group_id');\n $.ajax({\n url: '/unlink_product',\n type: 'POST',\n data: {\n sns_post_id: sns_post_id,\n product_id: product_id,\n ugc_group_id: ugc_group_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n let p = JSON.stringify(data.products);\n let product = JSON.parse(p);\n\n $('.ugc_modal_right_pr_container').append(\n `
\n \n
\n
${product.code}
\n
\n
${product.name}
\n
${product.price}円
\n
\n
\n \n
\n
`\n );\n\n $(`.ugc_modal_right_cancel_pr_link_btn[data-product_id=\"${product_id}\"]`).closest('.ugc_modal_right_linked_pr_box').next('.ugc_modal_right_linked_pr_line').remove();\n $(`.ugc_modal_right_cancel_pr_link_btn[data-product_id=\"${product_id}\"]`).closest('.ugc_modal_right_linked_pr_box').remove();\n }\n });\n });\n\n // 検索ボックスでエンターキーが押されたときの処理\n $(document).on('keypress', '#ugc_setting_product_search', function (e) {\n if (e.which === 13) {\n e.preventDefault();\n\n $('.ugc_modal_right_pr_box, .ugc_modal_right_pr_line').remove();\n let sns_post_id = $(this).data('id');\n let search_word = $(this).val().toLowerCase();\n let ugc_group_id = $(this).data('ugc_group_id');\n\n $.ajax({\n url: '/get_product_list',\n type: 'GET',\n data: {\n sns_post_id: sns_post_id,\n p: search_word,\n ugc_group_id: ugc_group_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret1 == '0') {\n $.each(data.products, function (index, product) {\n $('.ugc_modal_right_pr_container').append(\n `
\n \n
\n
${product.code}
\n
\n
${product.name}
\n
${product.price}円
\n
\n
\n \n
\n
`\n );\n });\n }\n });\n }\n });\n\n $('.ugc_sns_posts_cancel_check').on('change', function () {\n if ($('.ugc_sns_posts_cancel_check:checked').length > 0) {\n // チェックボックスが1つでも選択されている場合\n $('#ugc_sns_posts_cancel_submit_btn').css('display', 'block');\n } else {\n // チェックボックスが1つも選択されていない場合\n $('#ugc_sns_posts_cancel_submit_btn').css('display', 'none');\n }\n });\n\n $('#ugc_sns_posts_cancel_submit_btn')\n .off()\n .on('click', function () {\n $(this).css('pointer-events', 'none');\n $(this).text('削除しています...');\n $(this).css('background', 'gray');\n let sns_post_ids = [];\n let ugc_group_id = $('.ugc_group_select_box option:selected').val();\n $('.ugc_sns_posts_cancel_check:checked').each(function () {\n sns_post_ids.push($(this).data('id'));\n });\n if (!sns_post_ids) {\n alert('連携解除したい投稿を選択してください。');\n return;\n }\n $.ajax({\n url: '/ugc_group_ids_delete',\n type: 'POST',\n data: {\n sns_post_ids: sns_post_ids,\n ugc_group_id: ugc_group_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('UGCグループ連携を一括解除しました。');\n location.reload();\n }\n });\n });\n\n $(document).on('click', '.ugc_setting_all_product_list', function () {\n $('.ugc_modal_right_pr_box, .ugc_modal_right_pr_line').remove();\n $('.ugc_modal_right_linked_pr_box, .ugc_modal_right_linked_pr_line').remove();\n $('#ugc_setting_product_search').val('');\n\n let sns_post_id = $(this).data('id');\n let ugc_group_id = $(this).data('ugc_group_id');\n\n $.ajax({\n url: '/get_product_list',\n type: 'GET',\n data: {\n sns_post_id: sns_post_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret1 == '0') {\n $.each(data.products, function (index, product) {\n $('.ugc_modal_right_pr_container').append(\n `
\n \n
\n
${product.code}
\n
\n
${product.name}
\n
${product.price}円
\n
\n
\n \n
\n
`\n );\n });\n }\n\n if (data.ret2 == '0') {\n $.each(data.linked_products, function (index, linked_product) {\n $('.ugc_modal_right_linked_pr_container').append(\n `
\n \n
\n
${linked_product.code}
\n
\n
${linked_product.name}
\n
${linked_product.price}円
\n
\n
\n \n
\n
`\n );\n });\n }\n });\n });\n\n // $('.ugc_group_link').on('change', function () {\n // if ($(this).data('ugc_username') == '' && location.href.includes('communication_management')) {\n // alert(\n // `ユーザーネームが登録されていないUGCです。\n // UGC設定ボタンから設定の上、再度お試しください。`.replace(/[ \\t]/g, '')\n // );\n // location.reload();\n // }\n\n // if ($('.ugc_group_link:checked').length > 0) {\n // // チェックボックスが1つでも選択されている場合\n // $('#ugc_group_link_btn').show();\n // $('#ugc_create_btn').show();\n // } else {\n // // チェックボックスが1つも選択されていない場合\n // $('#ugc_group_link_btn').hide();\n // $('#ugc_create_btn').hide();\n // }\n // });\n\n let firstChecked = false;\n\n $('.ugc_group_link').on('change', function() {\n if ($(this).data('ugc_username') == '' && location.href.includes('communication_management')) {\n alert(\n `ユーザーネームが登録されていないUGCです。\n UGC設定ボタンから設定の上、再度お試しください。`.replace(/[ \\t]/g, '')\n );\n location.reload();\n }\n\n if ($(this).is(':checked') && !firstChecked) {\n let caption = $(this).data('caption');\n console.log(\"First checked caption: \", caption); // デバッグ用ログ\n $('#ugc_create_btn').attr('data-caption', caption); // attrメソッドで属性を設定\n firstChecked = true;\n }\n\n // すべてのチェックボックスが未チェックの場合、フラグをリセット\n if (!$('.ugc_group_link:checked').length) {\n firstChecked = false;\n $('#ugc_create_btn').attr('data-caption', ''); // データキャプションをクリア\n }\n\n if ($('.ugc_group_link:checked').length > 0) {\n // チェックボックスが1つでも選択されている場合\n $('#ugc_group_link_btn').show();\n $('#ugc_create_btn').show();\n } else {\n // チェックボックスが1つも選択されていない場合\n $('#ugc_group_link_btn').hide();\n $('#ugc_create_btn').hide();\n }\n });\n\n $('#ugc_create_btn').on('click', function () {\n let s3_img_url = [];\n let caption = $(this).data('caption');\n\n $('.ugc_group_link:checked').each(function () {\n s3_img_url.push($(this).data(\"img_url\"));\n });\n if (s3_img_url.length == 0) {\n alert('投稿を選択してください。');\n return;\n }\n\n $.ajax({\n url: '/create_ugc_posts',\n type: 'POST',\n data: {\n img_urls: s3_img_url,\n caption: caption\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('登録が完了しました。左メニューの手動投稿管理でご確認ください。');\n location.reload();\n }\n });\n });\n\n $('#ugc_group_link_btn')\n .off()\n .on('click', function () {\n let sns_post_ids = [];\n let user_names = [];\n $('.ugc_group_link:checked').each(function () {\n sns_post_ids.push($(this).data('id'));\n user_names.push($(this).data('ugc_username'));\n console.log('user_names:', user_names);\n return;\n });\n $('.modal_submit').attr('data-sns_post_id', sns_post_ids);\n $('.modal_submit')\n .off()\n .on('click', function () {\n let ugc_group_ids = [];\n $('input[name=ugc_groups]:checked').each(function () {\n ugc_group_ids.push($(this).val());\n });\n if (ugc_group_ids.length == 0) {\n alert('UGCグループを選択してください。');\n return;\n }\n $.ajax({\n url: '/ugc_group_id_set',\n type: 'POST',\n data: {\n sns_post_ids: sns_post_ids,\n ugc_group_ids: ugc_group_ids,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n if (!location.href.includes('communication_management')) {\n alert('UGCグループに連携しました。');\n location.reload();\n } else {\n $.ajax({\n url: '/cmm_update_multiple_ugc_permissions',\n type: 'POST',\n data: {\n sns_post_ids: sns_post_ids,\n },\n dataType: 'json',\n })\n .done(function (data) {\n // alert('Linked to UGC group.');\n // alert(\n // `指定されたUGCグループに本投稿を連携しました。\n // 本投稿のラベルの状態を自動的に\"連携済み\"に変更します。`.trim()\n // );\n // 改行を残してそれ以外の不要な空白を削除する\n alert(\n `指定されたUGCグループに本投稿を連携しました。\n 本投稿のラベルの状態を自動的に\"連携済み\"に変更します。`.replace(/[ \\t]/g, '')\n );\n })\n .fail(function () {\n alert(\n `指定されたUGCグループに本投稿を連携しました。\n\n Notice:\n 予期しないエラーにより、本投稿のラベルの状態を自動的に\"連携済み\"に変更できませんでした。\n\n お手数ですが、手動で本投稿のラベルの状態を\"連携済み\"にしていただくようお願い致します。`.replace(/[ \\t]/g, '')\n );\n })\n .always(function () {\n location.reload();\n });\n }\n }\n });\n });\n });\n\n // delete_mode_submitがクリックされた時の処理\n $('#delete_sns_post_mode_submit').on('click', function () {\n // 現在のURLを取得\n let currentUrl = new URL(window.location.href);\n\n // URLパラメーターにdelete_mode=1を追加\n currentUrl.searchParams.set('delete_mode', '1');\n\n // 新しいURLにリダイレクト\n window.location.href = currentUrl.toString();\n });\n\n // not_delete_sns_post_mode_submitがクリックされた時の処理\n $('#not_delete_sns_post_mode_submit').on('click', function () {\n // 現在のURLを取得\n let currentUrl = new URL(window.location.href);\n\n // URLパラメーターのdelete_mode=1を削除\n currentUrl.searchParams.delete('delete_mode');\n\n // 新しいURLにリダイレクト\n window.location.href = currentUrl.toString();\n });\n\n $('.sns_post_delete_checkbox').on('change', function () {\n if ($('.sns_post_delete_checkbox:checked').length > 0) {\n // チェックボックスが1つでも選択されている場合\n $('#sns_post_checked_delete_btn').show();\n } else {\n // チェックボックスが1つも選択されていない場合\n $('#sns_post_checked_delete_btn').hide();\n }\n });\n\n // UGCの一括削除\n $('#sns_post_checked_delete_btn').on('click', function () {\n // data-idの値を格納するための配列を初期化\n let checked_sns_posts_id_and_src = [];\n\n // チェックがついているチェックボックスのdata-id値を配列に追加\n $('.sns_post_delete_checkbox:checked').each(function () {\n let sns_post_id = $(this).data('id');\n let post_card = $(this).siblings('.post_tag_card');\n\n // post_tag_card内のimgまたはvideoタグのsrcを取得\n let imgSrc = post_card.find('a img').attr('src');\n let videoSrc = post_card.find('a video').attr('src');\n\n // srcが存在する方を使用\n let media_src = imgSrc || videoSrc;\n\n // オブジェクトとしてidとsrcを配列に追加\n checked_sns_posts_id_and_src.push({\n id: sns_post_id,\n src: media_src,\n });\n });\n\n // 結果をコンソールに出力(必要に応じて他の処理に変更できます)\n console.log(checked_sns_posts_id_and_src);\n\n $.ajax({\n url: '/delete_sns_posts',\n type: 'POST',\n data: {\n checked_sns_posts_id_and_src: checked_sns_posts_id_and_src,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n } else if (data.ret == 1) {\n alert('何らかの影響により削除できませんでした。');\n } else if (data.ret == 2) {\n alert('選択したUGCの中に連携されているものがある可能性があります。削除できませんでした。');\n }\n });\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // 商品詳細表示設定\n //-----------------------------------------------------------------------------------------------------------------\n // デバイス選択\n $('.ugc_detail_page_setting_device_pc, .ugc_detail_page_setting_device_phone').on('click', function () {\n let is_device = $(this).data('device');\n location.href = `/ugc_detail_page_setting?is_device=${is_device}`;\n });\n\n // 一番最初に行う商品詳細設定\n $('#ugc_detail_page_first_setting').on('click', function () {\n $.ajax({\n url: '/create_detail_page_setting',\n type: 'POST',\n data: {},\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('商品詳細設定を完了しました。');\n location.reload();\n }\n });\n });\n\n $('.ugc_detail_page_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.ugc_detail_page_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.ugc_detail_page_slidedown_btn').fadeIn(0));\n });\n\n $('.ugc_detail_page_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.ugc_detail_page_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.ugc_detail_page_slideup_btn').fadeIn(0));\n });\n\n // UGCグループ公開設定\n $('.ugc_detail_page_open_select').on('change', function () {\n let ugc_show_valid_val = $('.ugc_detail_page_open_select option:selected').val();\n let is_device = $('#ugc_detail_page_setting_device_val').val();\n $.ajax({\n url: '/update_detail_page_show_valid',\n type: 'POST',\n data: {\n show_valid: ugc_show_valid_val,\n is_device: is_device,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n if (data.show_valid == 1) {\n alert('商品詳細を公開しました。');\n } else if (data.show_valid == 2) {\n alert('商品詳細をプレビューで公開しました。');\n } else {\n alert('商品詳細を非公開にしました。');\n }\n location.href = `/ugc_detail_page_setting?mode=${data.show_valid}`;\n }\n });\n });\n\n $('#ugc_detail_page_create_preview_btn')\n .off()\n .on('click', function () {\n $('.loadding').css('display', 'block');\n let tag_check = $('#ugc_detail_page_create_preview_tag').prop('checked');\n let preview_url = $('#ugc_detail_page_create_preview_url').val();\n let html_name = $('#ugc_detail_page_create_preview_html_name').val();\n let product_name = $('#ugc_detail_page_create_preview_product_name').val();\n let product_img_name = $('#ugc_detail_page_create_preview_product_img_name').val();\n let product_price = $('#ugc_detail_page_create_preview_product_price').val();\n\n if (preview_url == '' || html_name == '' || product_name == '' || product_img_name == '') {\n $('.loadding').css('display', 'none');\n alert('必須項目を入力してください。');\n return;\n }\n\n $.ajax({\n url: '/save_detail_page_preview',\n type: 'POST',\n data: {\n url: preview_url,\n file_name: html_name,\n tag_check: tag_check,\n product_name: product_name,\n product_img_name: product_img_name,\n product_price: product_price,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('プレビューを作成しました。');\n location.reload();\n }\n });\n });\n\n // UGC表示数設定\n $('#ugc_detail_page_display_count_submit').on('click', function () {\n let ugc_detail_page_display_count_select_val = $('#ugc_detail_page_display_count_select_val').val();\n let is_device = $('#ugc_detail_page_setting_device_val').val();\n $.ajax({\n url: '/update_detail_page_display_count',\n type: 'POST',\n data: {\n display_count: ugc_detail_page_display_count_select_val,\n is_device: is_device,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('UGC表示数を設定しました。');\n location.reload();\n }\n });\n });\n // UGC表示パターン設定\n $('.ugc_detail_page_display_type_select').on('change', function () {\n let ugc_display_type_val = $('.ugc_detail_page_display_type_select option:selected').val();\n let is_device = $('#ugc_detail_page_setting_device_val').val();\n $.ajax({\n url: '/update_detail_page_display_type',\n type: 'POST',\n data: {\n display_type: ugc_display_type_val,\n is_device: is_device,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('表示パターンを設定しました。');\n location.reload();\n }\n });\n });\n // UGC表示順設定\n $('.ugc_detail_display_order_select').on('change', function () {\n let ugc_display_order_val = $('.ugc_detail_display_order_select option:selected').val();\n let is_device = $('#ugc_detail_page_setting_device_val').val();\n $.ajax({\n url: '/update_detail_page_display_order',\n type: 'POST',\n data: {\n display_order: ugc_display_order_val,\n is_device: is_device,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('表示パターンを設定しました。');\n location.reload();\n }\n });\n });\n // UGC差し込み先要素設定\n $('#ugc_detail_page_element_set').on('click', function () {\n let is_device = $('#ugc_detail_page_setting_device_val').val();\n let element_id_val = $('#detail_element_id_input').val();\n let element_class_val = $('#detail_element_class_input').val();\n let element_index_val = $('#detail_element_index_input').val();\n let parent_id_val = $('#detail_parent_id_input').val();\n let parent_class_val = $('#detail_parent_class_input').val();\n let parent_index_val = $('#detail_parent_index_input').val();\n let grand_id_val = $('#detail_grand_id_input').val();\n let grand_class_val = $('#detail_grand_class_input').val();\n let grand_index_val = $('#detail_grand_index_input').val();\n let great_grand_id_val = $('#detail_great_grand_id_input').val();\n let great_grand_class_val = $('#detail_great_grand_class_input').val();\n let ugc_element_placement = $('.ugc_detail_page_element_list .detail_element_placement option:selected').val();\n\n $.ajax({\n url: '/create_detail_page_ugc_element',\n type: 'POST',\n data: {\n is_device: is_device,\n element_id: element_id_val,\n element_class: element_class_val,\n element_index: element_index_val,\n parent_id: parent_id_val,\n parent_class: parent_class_val,\n parent_index: parent_index_val,\n grand_id: grand_id_val,\n grand_class: grand_class_val,\n grand_index: grand_index_val,\n great_grand_id: great_grand_id_val,\n great_grand_class: great_grand_class_val,\n element_placement: ugc_element_placement,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('要素の挿入先を登録しました。');\n location.reload();\n }\n });\n });\n\n /// デザインカスタマイズ-共通部品\n $('#ugc_detail_page_common_custom_set').on('click', function () {\n let is_device = $('#ugc_detail_page_setting_device_val').val();\n let is_category_title = $('#is_category_title').val();\n let is_category_title_icon = $('#is_category_title_icon').val();\n let category_title_margin = $('#category_title_margin').val();\n let category_title_height = $('#category_title_height').val();\n let category_title_justify_content = $('#category_title_justify_content').val();\n let category_title_icon_size = $('#category_title_icon_size').val();\n let category_title_original_icon_width = $('#category_title_original_icon_width').val();\n let category_title_original_icon_height = $('#category_title_original_icon_height').val();\n let category_title_original_icon_img_url = $('#category_title_original_icon_img_url').val();\n let category_title_icon_margin = $('#category_title_icon_margin').val();\n let category_title_text = $('#category_title_text').val();\n let category_title_font_family = $('#category_title_font_family').val();\n let category_title_font_size = $('#category_title_font_size').val();\n let category_title_font_weight = $('#category_title_font_weight').val();\n let category_title_font_color = $('#category_title_font_color').val();\n\n let category_subtitle_margin = $('#category_subtitle_margin').val();\n let category_subtitle_height = $('#category_subtitle_height').val();\n let category_subtitle_text = $('#category_subtitle_text').val();\n let category_subtitle_font_family = $('#category_subtitle_font_family').val();\n let category_subtitle_font_size = $('#category_subtitle_font_size').val();\n let category_subtitle_font_weight = $('#category_subtitle_font_weight').val();\n let category_subtitle_font_color = $('#category_subtitle_font_color').val();\n\n let container_justify_content = $('#container_justify_content').val();\n let container_width = $('#container_width').val();\n let container_margin = $('#container_margin').val();\n let container_margin_x = $('#container_margin_x').val();\n let container_left = $('#container_left').val();\n let container_transform = $('#container_transform').val();\n let img_column_count = $('#img_column_count').val();\n let img_box_width = $('#img_box_width').val();\n let img_box_height = $('#img_box_height').val();\n let img_box_border_radius = $('#img_box_border_radius').val();\n let img_box_object_fit = $('#img_box_object_fit').val();\n let img_box_margin = $('#img_box_margin').val();\n let img_box_background_color = $('#img_box_background_color').val();\n let is_caption = $('#is_caption').val();\n let is_hover = $('#is_hover').val();\n\n let caption_font_size = $('#caption_font_size').val();\n let caption_font_family = $('#caption_font_family').val();\n let caption_font_weight = $('#caption_font_weight').val();\n let caption_font_color = $('#caption_font_color').val();\n let caption_height = $('#caption_height').val();\n let caption_max_height = $('#caption_max_height').val();\n let caption_line_height = $('#caption_line_height').val();\n let caption_margin = $('#caption_margin').val();\n let caption_blur_height = $('#caption_blur_height').val();\n let caption_blur_width = $('#caption_blur_width').val();\n let caption_blur_top = $('#caption_blur_top').val();\n let caption_blur_left = $('#caption_blur_left').val();\n let caption_blur_background_color = $('#caption_blur_background_color').val();\n\n let is_username = $('#is_username').val();\n let username_justify_content = $('#username_justify_content').val();\n let username_margin = $('#username_margin').val();\n let is_username_icon = $('#is_username_icon').val();\n let username_icon_width = $('#username_icon_width').val();\n let username_icon_height = $('#username_icon_height').val();\n let username_icon_margin = $('#username_icon_margin').val();\n let username_font_size = $('#username_font_size').val();\n let username_font_family = $('#username_font_family').val();\n let username_font_weight = $('#username_font_weight').val();\n let username_font_color = $('#username_font_color').val();\n\n $.ajax({\n url: '/update_detail_page_ugc_common_styles',\n type: 'POST',\n data: {\n is_device: is_device,\n is_category_title: is_category_title,\n is_category_title_icon: is_category_title_icon,\n category_title_margin: category_title_margin,\n category_title_height: category_title_height,\n category_title_justify_content: category_title_justify_content,\n category_title_icon_size: category_title_icon_size,\n category_title_original_icon_width: category_title_original_icon_width,\n category_title_original_icon_height: category_title_original_icon_height,\n category_title_original_icon_img_url: category_title_original_icon_img_url,\n category_title_icon_margin: category_title_icon_margin,\n category_title_text: category_title_text,\n category_title_font_family: category_title_font_family,\n category_title_font_size: category_title_font_size,\n category_title_font_weight: category_title_font_weight,\n category_title_font_color: category_title_font_color,\n category_subtitle_margin: category_subtitle_margin,\n category_subtitle_height: category_subtitle_height,\n category_subtitle_text: category_subtitle_text,\n category_subtitle_font_family: category_subtitle_font_family,\n category_subtitle_font_size: category_subtitle_font_size,\n category_subtitle_font_weight: category_subtitle_font_weight,\n category_subtitle_font_color: category_subtitle_font_color,\n container_justify_content: container_justify_content,\n container_width: container_width,\n container_margin: container_margin,\n container_margin_x: container_margin_x,\n container_left: container_left,\n container_transform: container_transform,\n img_column_count: img_column_count,\n img_box_width: img_box_width,\n img_box_height: img_box_height,\n img_box_border_radius: img_box_border_radius,\n img_box_object_fit: img_box_object_fit,\n img_box_margin: img_box_margin,\n img_box_background_color: img_box_background_color,\n is_caption: is_caption,\n is_hover: is_hover,\n caption_font_size: caption_font_size,\n caption_font_family: caption_font_family,\n caption_font_weight: caption_font_weight,\n caption_font_color: caption_font_color,\n caption_height: caption_height,\n caption_max_height: caption_max_height,\n caption_line_height: caption_line_height,\n caption_margin: caption_margin,\n caption_blur_height: caption_blur_height,\n caption_blur_width: caption_blur_width,\n caption_blur_top: caption_blur_top,\n caption_blur_left: caption_blur_left,\n caption_blur_background_color: caption_blur_background_color,\n is_username: is_username,\n username_justify_content: username_justify_content,\n username_margin: username_margin,\n is_username_icon: is_username_icon,\n username_icon_width: username_icon_width,\n username_icon_height: username_icon_height,\n username_icon_margin: username_icon_margin,\n username_font_size: username_font_size,\n username_font_family: username_font_family,\n username_font_weight: username_font_weight,\n username_font_color: username_font_color,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('共通デザインを登録しました。');\n location.reload();\n }\n });\n });\n\n // デザインカスタマイズ-スライダー\n $('#ugc_detail_page_slider_custom_set').on('click', function () {\n let is_device = $('#ugc_detail_page_setting_device_val').val();\n\n let is_slider_prev_btn = $('#is_slider_prev_btn').val();\n let slider_prev_btn_top = $('#slider_prev_btn_top').val();\n let slider_prev_btn_left = $('#slider_prev_btn_left').val();\n let slider_prev_btn_width = $('#slider_prev_btn_width').val();\n let slider_prev_btn_height = $('#slider_prev_btn_height').val();\n let slider_prev_btn_border_radius = $('#slider_prev_btn_border_radius').val();\n let slider_prev_btn_text_color = $('#slider_prev_btn_text_color').val();\n let slider_prev_btn_backgroud_color = $('#slider_prev_btn_backgroud_color').val();\n let slider_prev_btn_backgroud_opacity = $('#slider_prev_btn_backgroud_opacity').val();\n let slider_prev_btn_text_line_width = $('#slider_prev_btn_text_line_width').val();\n let slider_prev_btn_text_line_height = $('#slider_prev_btn_text_line_height').val();\n let slider_prev_btn_text_line_weight = $('#slider_prev_btn_text_line_weight').val();\n let slider_prev_btn_text_position_right = $('#slider_prev_btn_text_position_right').val();\n let slider_prev_btn_text_position_top = $('#slider_prev_btn_text_position_top').val();\n let slider_prev_btn_text_line_rotate = $('#slider_prev_btn_text_line_rotate').val();\n let slider_prev_btn_text_line_translatey = $('#slider_prev_btn_text_line_translatey').val();\n let slider_prev_btn_text_line_skew = $('#slider_prev_btn_text_line_skew').val();\n let is_slider_next_btn = $('#is_slider_next_btn').val();\n let slider_next_btn_top = $('#slider_next_btn_top').val();\n let slider_next_btn_left = $('#slider_next_btn_left').val();\n let slider_next_btn_width = $('#slider_next_btn_width').val();\n let slider_next_btn_height = $('#slider_next_btn_height').val();\n let slider_next_btn_border_radius = $('#slider_next_btn_border_radius').val();\n let slider_next_btn_text_color = $('#slider_next_btn_text_color').val();\n let slider_next_btn_backgroud_color = $('#slider_next_btn_backgroud_color').val();\n let slider_next_btn_backgroud_opacity = $('#slider_next_btn_backgroud_opacity').val();\n let slider_next_btn_text_line_width = $('#slider_next_btn_text_line_width').val();\n let slider_next_btn_text_line_height = $('#slider_next_btn_text_line_height').val();\n let slider_next_btn_text_line_weight = $('#slider_next_btn_text_line_weight').val();\n let slider_next_btn_text_position_right = $('#slider_next_btn_text_position_right').val();\n let slider_next_btn_text_position_top = $('#slider_next_btn_text_position_top').val();\n let slider_next_btn_text_line_rotate = $('#slider_next_btn_text_line_rotate').val();\n let slider_next_btn_text_line_translatey = $('#slider_next_btn_text_line_translatey').val();\n let slider_next_btn_text_line_skew = $('#slider_next_btn_text_line_skew').val();\n\n $.ajax({\n url: '/update_detail_page_ugc_slider_styles',\n type: 'POST',\n data: {\n is_device: is_device,\n is_slider_prev_btn: is_slider_prev_btn,\n slider_prev_btn_top: slider_prev_btn_top,\n slider_prev_btn_left: slider_prev_btn_left,\n slider_prev_btn_width: slider_prev_btn_width,\n slider_prev_btn_height: slider_prev_btn_height,\n slider_prev_btn_border_radius: slider_prev_btn_border_radius,\n slider_prev_btn_text_color: slider_prev_btn_text_color,\n slider_prev_btn_backgroud_color: slider_prev_btn_backgroud_color,\n slider_prev_btn_backgroud_opacity: slider_prev_btn_backgroud_opacity,\n slider_prev_btn_text_line_width: slider_prev_btn_text_line_width,\n slider_prev_btn_text_line_height: slider_prev_btn_text_line_height,\n slider_prev_btn_text_line_weight: slider_prev_btn_text_line_weight,\n slider_prev_btn_text_position_right: slider_prev_btn_text_position_right,\n slider_prev_btn_text_position_top: slider_prev_btn_text_position_top,\n slider_prev_btn_text_line_rotate: slider_prev_btn_text_line_rotate,\n slider_prev_btn_text_line_translatey: slider_prev_btn_text_line_translatey,\n slider_prev_btn_text_line_skew: slider_prev_btn_text_line_skew,\n is_slider_next_btn: is_slider_next_btn,\n slider_next_btn_top: slider_next_btn_top,\n slider_next_btn_left: slider_next_btn_left,\n slider_next_btn_width: slider_next_btn_width,\n slider_next_btn_height: slider_next_btn_height,\n slider_next_btn_border_radius: slider_next_btn_border_radius,\n slider_next_btn_text_color: slider_next_btn_text_color,\n slider_next_btn_backgroud_color: slider_next_btn_backgroud_color,\n slider_next_btn_backgroud_opacity: slider_next_btn_backgroud_opacity,\n slider_next_btn_text_line_width: slider_next_btn_text_line_width,\n slider_next_btn_text_line_height: slider_next_btn_text_line_height,\n slider_next_btn_text_line_weight: slider_next_btn_text_line_weight,\n slider_next_btn_text_position_right: slider_next_btn_text_position_right,\n slider_next_btn_text_position_top: slider_next_btn_text_position_top,\n slider_next_btn_text_line_rotate: slider_next_btn_text_line_rotate,\n slider_next_btn_text_line_translatey: slider_next_btn_text_line_translatey,\n slider_next_btn_text_line_skew: slider_next_btn_text_line_skew,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('スライダーのデザインを登録しました。');\n location.reload();\n }\n });\n });\n\n // デザインカスタマイズ-モーダル\n $('#ugc_detail_page_modal_custom_set').on('click', function () {\n let is_device = $('#ugc_detail_page_setting_device_val').val();\n\n let modal_max_width = $('#modal_max_width').val();\n let modal_max_height = $('#modal_max_height').val();\n let modal_left_width = $('#modal_left_width').val();\n let modal_right_width = $('#modal_right_width').val();\n let modal_right_height = $('#modal_right_height').val();\n let is_modal_related_items = $('#is_modal_related_items').val();\n let is_modal_related_items_title = $('#is_modal_related_items_title').val();\n let modal_related_items_title_text = $('#modal_related_items_title_text').val();\n let modal_related_items_title_font_family = $('#modal_related_items_title_font_family').val();\n let modal_related_items_title_font_size = $('#modal_related_items_title_font_size').val();\n let modal_related_items_title_font_weight = $('#modal_related_items_title_font_weight').val();\n let modal_related_items_title_font_color = $('#modal_related_items_title_font_color').val();\n let is_modal_related_items_link = $('#is_modal_related_items_link').val();\n let modal_related_items_img_column_height = $('#modal_related_items_img_column_height').val();\n let modal_related_items_img_column_width = $('#modal_related_items_img_column_width').val();\n let modal_related_items_initial_img_count = $('#modal_related_items_initial_img_count').val();\n let modal_related_items_img_height = $('#modal_related_items_img_height').val();\n let modal_related_items_img_width = $('#modal_related_items_img_width').val();\n let modal_related_items_img_margin = $('#modal_related_items_img_margin').val();\n let modal_related_items_name_font_size = $('#modal_related_items_name_font_size').val();\n let modal_related_items_name_font_family = $('#modal_related_items_name_font_family').val();\n let modal_related_items_name_font_weight = $('#modal_related_items_name_font_weight').val();\n let modal_related_items_name_text_align = $('#modal_related_items_name_text_align').val();\n let modal_related_items_name_font_color = $('#modal_related_items_name_font_color').val();\n let modal_related_items_price_font_size = $('#modal_related_items_price_font_size').val();\n let modal_related_items_price_font_family = $('#modal_related_items_price_font_family').val();\n let modal_related_items_price_font_weight = $('#modal_related_items_price_font_weight').val();\n let modal_related_items_price_text_align = $('#modal_related_items_price_text_align').val();\n let modal_related_items_price_font_color = $('#modal_related_items_price_font_color').val();\n let modal_related_items_price_unit_text = $('#modal_related_items_price_unit_text').val();\n let is_modal_photo_by_link = $('#is_modal_photo_by_link').val();\n let modal_photo_by_icon_size = $('#modal_photo_by_icon_size').val();\n let modal_photo_by_margin = $('#modal_photo_by_margin').val();\n let modal_photo_by_text = $('#modal_photo_by_text').val();\n let modal_photo_by_font_size = $('#modal_photo_by_font_size').val();\n let modal_photo_by_font_family = $('#modal_photo_by_font_family').val();\n let modal_photo_by_font_weight = $('#modal_photo_by_font_weight').val();\n let modal_photo_by_font_color = $('#modal_photo_by_font_color').val();\n let is_modal_related_items_product_comment = $('#is_modal_related_items_product_comment').val();\n let modal_related_items_product_comment_height = $('#modal_related_items_product_comment_height').val();\n let modal_related_items_product_comment_position = $('#modal_related_items_product_comment_position').val();\n let modal_related_items_product_comment_font_size = $('#modal_related_items_product_comment_font_size').val();\n let modal_related_items_product_comment_font_family = $('#modal_related_items_product_comment_font_family').val();\n let modal_related_items_product_comment_font_weight = $('#modal_related_items_product_comment_font_weight').val();\n let modal_related_items_product_comment_font_color = $('#modal_related_items_product_comment_font_color').val();\n let modal_del_btn_size = $('#modal_del_btn_size').val();\n let modal_sns_post_img_object_fit = $('#modal_sns_post_img_object_fit').val();\n\n let modal_prev_post_btn_bg_color = $('#modal_prev_post_btn_bg_color').val();\n let modal_prev_post_btn_opacity = $('#modal_prev_post_btn_opacity').val();\n let modal_prev_post_btn_top = $('#modal_prev_post_btn_top').val();\n let modal_prev_post_btn_left = $('#modal_prev_post_btn_left').val();\n let modal_prev_post_btn_width = $('#modal_prev_post_btn_width').val();\n let modal_prev_post_btn_height = $('#modal_prev_post_btn_height').val();\n let modal_prev_post_btn_line_color = $('#modal_prev_post_btn_line_color').val();\n let modal_prev_post_btn_line_width = $('#modal_prev_post_btn_line_width').val();\n let modal_prev_post_btn_line_height = $('#modal_prev_post_btn_line_height').val();\n let modal_prev_post_btn_line_right = $('#modal_prev_post_btn_line_right').val();\n let modal_prev_post_btn_line_top = $('#modal_prev_post_btn_line_top').val();\n let modal_prev_post_btn_line_weight = $('#modal_prev_post_btn_line_weight').val();\n let modal_prev_post_btn_line_rotate = $('#modal_prev_post_btn_line_rotate').val();\n let modal_prev_post_btn_line_translatey = $('#modal_prev_post_btn_line_translatey').val();\n\n let modal_next_post_btn_bg_color = $('#modal_next_post_btn_bg_color').val();\n let modal_next_post_btn_opacity = $('#modal_next_post_btn_opacity').val();\n let modal_next_post_btn_top = $('#modal_next_post_btn_top').val();\n let modal_next_post_btn_left = $('#modal_next_post_btn_left').val();\n let modal_next_post_btn_width = $('#modal_next_post_btn_width').val();\n let modal_next_post_btn_height = $('#modal_next_post_btn_height').val();\n let modal_next_post_btn_line_color = $('#modal_next_post_btn_line_color').val();\n let modal_next_post_btn_line_width = $('#modal_next_post_btn_line_width').val();\n let modal_next_post_btn_line_height = $('#modal_next_post_btn_line_height').val();\n let modal_next_post_btn_line_right = $('#modal_next_post_btn_line_right').val();\n let modal_next_post_btn_line_top = $('#modal_next_post_btn_line_top').val();\n let modal_next_post_btn_line_weight = $('#modal_next_post_btn_line_weight').val();\n let modal_next_post_btn_line_rotate = $('#modal_next_post_btn_line_rotate').val();\n let modal_next_post_btn_line_translatey = $('#modal_next_post_btn_line_translatey').val();\n\n let modal_dot_left_display = $('#modal_dot_left_display').val();\n let modal_dot_left_bg_color = $('#modal_dot_left_bg_color').val();\n let modal_dot_left_height = $('#modal_dot_left_height').val();\n let modal_dot_left_width = $('#modal_dot_left_width').val();\n let modal_dot_left_opacity = $('#modal_dot_left_opacity').val();\n let modal_dot_left_border = $('#modal_dot_left_border').val();\n let modal_dot_left_border_radius = $('#modal_dot_left_border_radius').val();\n let modal_dot_left_margin = $('#modal_dot_left_margin').val();\n let modal_dot_left_line_height = $('#modal_dot_left_line_height').val();\n let modal_dot_left_line_width = $('#modal_dot_left_line_width').val();\n let modal_dot_left_line_top = $('#modal_dot_left_line_top').val();\n let modal_dot_left_line_right = $('#modal_dot_left_line_right').val();\n let modal_dot_left_line_border_top = $('#modal_dot_left_line_border_top').val();\n let modal_dot_left_line_border_right = $('#modal_dot_left_line_border_right').val();\n let modal_dot_left_line_transform = $('#modal_dot_left_line_transform').val();\n\n let modal_dot_right_display = $('#modal_dot_right_display').val();\n let modal_dot_right_bg_color = $('#modal_dot_right_bg_color').val();\n let modal_dot_right_height = $('#modal_dot_right_height').val();\n let modal_dot_right_width = $('#modal_dot_right_width').val();\n let modal_dot_right_opacity = $('#modal_dot_right_opacity').val();\n let modal_dot_right_border = $('#modal_dot_right_border').val();\n let modal_dot_right_border_radius = $('#modal_dot_right_border_radius').val();\n let modal_dot_right_margin = $('#modal_dot_right_margin').val();\n let modal_dot_right_line_height = $('#modal_dot_right_line_height').val();\n let modal_dot_right_line_width = $('#modal_dot_right_line_width').val();\n let modal_dot_right_line_top = $('#modal_dot_right_line_top').val();\n let modal_dot_right_line_right = $('#modal_dot_right_line_right').val();\n let modal_dot_right_line_border_top = $('#modal_dot_right_line_border_top').val();\n let modal_dot_right_line_border_right = $('#modal_dot_right_line_border_right').val();\n let modal_dot_right_line_transform = $('#modal_dot_right_line_transform').val();\n\n let modal_dot_display = $('#modal_dot_display').val();\n let modal_dot_height = $('#modal_dot_height').val();\n let modal_dot_width = $('#modal_dot_width').val();\n let modal_dot_opacity = $('#modal_dot_opacity').val();\n let modal_dot_border = $('#modal_dot_border').val();\n let modal_dot_border_radius = $('#modal_dot_border_radius').val();\n let modal_dot_margin = $('#modal_dot_margin').val();\n\n $.ajax({\n url: '/update_detail_page_ugc_modal_styles',\n type: 'POST',\n data: {\n is_device: is_device,\n modal_max_width: modal_max_width,\n modal_max_height: modal_max_height,\n modal_left_width: modal_left_width,\n modal_right_width: modal_right_width,\n modal_right_height: modal_right_height,\n is_modal_related_items: is_modal_related_items,\n is_modal_related_items_title: is_modal_related_items_title,\n modal_related_items_title_text: modal_related_items_title_text,\n modal_related_items_title_font_family: modal_related_items_title_font_family,\n modal_related_items_title_font_weight: modal_related_items_title_font_weight,\n modal_related_items_title_font_size: modal_related_items_title_font_size,\n modal_related_items_title_font_color: modal_related_items_title_font_color,\n is_modal_related_items_link: is_modal_related_items_link,\n modal_related_items_img_column_height: modal_related_items_img_column_height,\n modal_related_items_img_column_width: modal_related_items_img_column_width,\n modal_related_items_initial_img_count: modal_related_items_initial_img_count,\n modal_related_items_img_height: modal_related_items_img_height,\n modal_related_items_img_width: modal_related_items_img_width,\n modal_related_items_img_margin: modal_related_items_img_margin,\n modal_related_items_name_font_size: modal_related_items_name_font_size,\n modal_related_items_name_font_family: modal_related_items_name_font_family,\n modal_related_items_name_font_weight: modal_related_items_name_font_weight,\n modal_related_items_name_font_color: modal_related_items_name_font_color,\n modal_related_items_name_text_align: modal_related_items_name_text_align,\n modal_related_items_price_font_size: modal_related_items_price_font_size,\n modal_related_items_price_font_family: modal_related_items_price_font_family,\n modal_related_items_price_font_weight: modal_related_items_price_font_weight,\n modal_related_items_price_font_color: modal_related_items_price_font_color,\n modal_related_items_price_text_align: modal_related_items_price_text_align,\n modal_related_items_price_unit_text: modal_related_items_price_unit_text,\n is_modal_photo_by_link: is_modal_photo_by_link,\n modal_photo_by_icon_size: modal_photo_by_icon_size,\n modal_photo_by_margin: modal_photo_by_margin,\n modal_photo_by_text: modal_photo_by_text,\n modal_photo_by_font_size: modal_photo_by_font_size,\n modal_photo_by_font_family: modal_photo_by_font_family,\n modal_photo_by_font_weight: modal_photo_by_font_weight,\n modal_photo_by_font_color: modal_photo_by_font_color,\n is_modal_related_items_product_comment: is_modal_related_items_product_comment,\n modal_related_items_product_comment_height: modal_related_items_product_comment_height,\n modal_related_items_product_comment_position: modal_related_items_product_comment_position,\n modal_related_items_product_comment_font_size: modal_related_items_product_comment_font_size,\n modal_related_items_product_comment_font_family: modal_related_items_product_comment_font_family,\n modal_related_items_product_comment_font_weight: modal_related_items_product_comment_font_weight,\n modal_related_items_product_comment_font_color: modal_related_items_product_comment_font_color,\n modal_del_btn_size: modal_del_btn_size,\n modal_sns_post_img_object_fit: modal_sns_post_img_object_fit,\n modal_prev_post_btn_bg_color: modal_prev_post_btn_bg_color,\n modal_prev_post_btn_opacity: modal_prev_post_btn_opacity,\n modal_prev_post_btn_top: modal_prev_post_btn_top,\n modal_prev_post_btn_left: modal_prev_post_btn_left,\n modal_prev_post_btn_width: modal_prev_post_btn_width,\n modal_prev_post_btn_height: modal_prev_post_btn_height,\n modal_prev_post_btn_line_color: modal_prev_post_btn_line_color,\n modal_prev_post_btn_line_width: modal_prev_post_btn_line_width,\n modal_prev_post_btn_line_height: modal_prev_post_btn_line_height,\n modal_prev_post_btn_line_right: modal_prev_post_btn_line_right,\n modal_prev_post_btn_line_top: modal_prev_post_btn_line_top,\n modal_prev_post_btn_line_weight: modal_prev_post_btn_line_weight,\n modal_prev_post_btn_line_rotate: modal_prev_post_btn_line_rotate,\n modal_prev_post_btn_line_translatey: modal_prev_post_btn_line_translatey,\n modal_next_post_btn_bg_color: modal_next_post_btn_bg_color,\n modal_next_post_btn_opacity: modal_next_post_btn_opacity,\n modal_next_post_btn_top: modal_next_post_btn_top,\n modal_next_post_btn_left: modal_next_post_btn_left,\n modal_next_post_btn_width: modal_next_post_btn_width,\n modal_next_post_btn_height: modal_next_post_btn_height,\n modal_next_post_btn_line_color: modal_next_post_btn_line_color,\n modal_next_post_btn_line_width: modal_next_post_btn_line_width,\n modal_next_post_btn_line_height: modal_next_post_btn_line_height,\n modal_next_post_btn_line_right: modal_next_post_btn_line_right,\n modal_next_post_btn_line_top: modal_next_post_btn_line_top,\n modal_next_post_btn_line_weight: modal_next_post_btn_line_weight,\n modal_next_post_btn_line_rotate: modal_next_post_btn_line_rotate,\n modal_next_post_btn_line_translatey: modal_next_post_btn_line_translatey,\n modal_dot_left_display: modal_dot_left_display,\n modal_dot_left_bg_color: modal_dot_left_bg_color,\n modal_dot_left_height: modal_dot_left_height,\n modal_dot_left_width: modal_dot_left_width,\n modal_dot_left_opacity: modal_dot_left_opacity,\n modal_dot_left_border: modal_dot_left_border,\n modal_dot_left_border_radius: modal_dot_left_border_radius,\n modal_dot_left_margin: modal_dot_left_margin,\n modal_dot_left_line_height: modal_dot_left_line_height,\n modal_dot_left_line_width: modal_dot_left_line_width,\n modal_dot_left_line_top: modal_dot_left_line_top,\n modal_dot_left_line_right: modal_dot_left_line_right,\n modal_dot_left_line_border_top: modal_dot_left_line_border_top,\n modal_dot_left_line_border_right: modal_dot_left_line_border_right,\n modal_dot_left_line_transform: modal_dot_left_line_transform,\n modal_dot_right_display: modal_dot_right_display,\n modal_dot_right_bg_color: modal_dot_right_bg_color,\n modal_dot_right_height: modal_dot_right_height,\n modal_dot_right_width: modal_dot_right_width,\n modal_dot_right_opacity: modal_dot_right_opacity,\n modal_dot_right_border: modal_dot_right_border,\n modal_dot_right_border_radius: modal_dot_right_border_radius,\n modal_dot_right_margin: modal_dot_right_margin,\n modal_dot_right_line_height: modal_dot_right_line_height,\n modal_dot_right_line_width: modal_dot_right_line_width,\n modal_dot_right_line_top: modal_dot_right_line_top,\n modal_dot_right_line_right: modal_dot_right_line_right,\n modal_dot_right_line_border_top: modal_dot_right_line_border_top,\n modal_dot_right_line_border_right: modal_dot_right_line_border_right,\n modal_dot_right_line_transform: modal_dot_right_line_transform,\n modal_dot_display: modal_dot_display,\n modal_dot_height: modal_dot_height,\n modal_dot_width: modal_dot_width,\n modal_dot_opacity: modal_dot_opacity,\n modal_dot_border: modal_dot_border,\n modal_dot_border_radius: modal_dot_border_radius,\n modal_dot_margin: modal_dot_margin,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('モーダルのデザインを登録しました。');\n location.reload();\n }\n });\n });\n\n $('#ugc_detail_page_part_custom_set').on('click', function () {\n let is_device = $('#ugc_detail_page_setting_device_val').val();\n\n let is_top_dividing_line = $('#is_top_dividing_line').val();\n let top_dividing_line_width = $('#top_dividing_line_width').val();\n let top_dividing_line_height = $('#top_dividing_line_height').val();\n let top_dividing_line_color = $('#top_dividing_line_color').val();\n let top_dividing_line_margin = $('#top_dividing_line_margin').val();\n let is_jump_other_page_btn = $('#is_jump_other_page_btn').val();\n let jump_other_page_btn_text = $('#jump_other_page_btn_text').val();\n let jump_other_page_url = $('#jump_other_page_url').val();\n let jump_other_page_btn_text_font_color = $('#jump_other_page_btn_text_font_color').val();\n let jump_other_page_btn_text_font_size = $('#jump_other_page_btn_text_font_size').val();\n let jump_other_page_btn_text_font_family = $('#jump_other_page_btn_text_font_family').val();\n let jump_other_page_btn_text_font_weight = $('#jump_other_page_btn_text_font_weight').val();\n let jump_other_page_btn_border_color = $('#jump_other_page_btn_border_color').val();\n let jump_other_page_btn_border_radius = $('#jump_other_page_btn_border_radius').val();\n let jump_other_page_btn_text_align = $('#jump_other_page_btn_text_align').val();\n let jump_other_page_btn_margin = $('#jump_other_page_btn_margin').val();\n let jump_other_page_btn_width = $('#jump_other_page_btn_width').val();\n let jump_other_page_btn_height = $('#jump_other_page_btn_height').val();\n\n $.ajax({\n url: '/update_detail_page_ugc_part_styles',\n type: 'POST',\n data: {\n is_device: is_device,\n is_top_dividing_line: is_top_dividing_line,\n top_dividing_line_width: top_dividing_line_width,\n top_dividing_line_height: top_dividing_line_height,\n top_dividing_line_color: top_dividing_line_color,\n top_dividing_line_margin: top_dividing_line_margin,\n is_jump_other_page_btn: is_jump_other_page_btn,\n jump_other_page_btn_text: jump_other_page_btn_text,\n jump_other_page_url: jump_other_page_url,\n jump_other_page_btn_text_font_color: jump_other_page_btn_text_font_color,\n jump_other_page_btn_text_font_size: jump_other_page_btn_text_font_size,\n jump_other_page_btn_text_font_family: jump_other_page_btn_text_font_family,\n jump_other_page_btn_text_font_weight: jump_other_page_btn_text_font_weight,\n jump_other_page_btn_border_color: jump_other_page_btn_border_color,\n jump_other_page_btn_border_radius: jump_other_page_btn_border_radius,\n jump_other_page_btn_text_align: jump_other_page_btn_text_align,\n jump_other_page_btn_margin: jump_other_page_btn_margin,\n jump_other_page_btn_width: jump_other_page_btn_width,\n jump_other_page_btn_height: jump_other_page_btn_height,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('部品のデザインを登録しました。');\n location.reload();\n }\n });\n });\n\n // カスタムCSS登録/更新\n $('#update_ugc_detail_page_setting_custom_css').on('click', function () {\n let is_device = $('#ugc_detail_page_setting_device_val').val();\n let custom_css = $('#ugc_detail_page_setting_custom_css').val();\n\n $.ajax({\n url: '/update_detail_page_custom_css',\n type: 'POST',\n data: {\n is_device: is_device,\n custom_css: custom_css,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('カスタムCSSを更新しました');\n location.reload();\n }\n });\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // UGCレポート\n //-----------------------------------------------------------------------------------------------------------------\n function updateUrlAndRedirect(params, baseUrl = window.location.href) {\n let url = new URL(baseUrl);\n for (const [key, value] of Object.entries(params)) {\n url.searchParams.set(key, value);\n }\n // start_dayおよびend_dayのパラメータがparamsに存在しない場合、これらのパラメータをURLから削除\n if (!params.start_day) {\n url.searchParams.delete('start_day');\n }\n if (!params.end_day) {\n url.searchParams.delete('end_day');\n }\n // 現在の履歴エントリに新しいURLを追加する\n history.pushState({}, '', url.toString());\n // ページをリロードする\n location.reload();\n }\n\n // パラメータを取得する関数\n function getParameters() {\n let params = {\n ugc_group_id: $('#ugc_selects option:selected').val(),\n id: $('#ugc_sns_post_selects option:selected').val(),\n device: $('.ugc_device_select').data('device'),\n gf: $('#ugc_graph_pattern_select_input').val(),\n ab: $('#ugc_report_ab_selects option:selected').val(),\n };\n\n if (params.gf === '30') {\n params.start_day = $('#report_start_day').val();\n params.end_day = $('#report_end_day').val();\n } else if (params.gf === '12') {\n delete params.start_day;\n delete params.end_day;\n }\n\n return params;\n }\n\n $('#ugc_sns_post_selects, #ugc_report_ab_selects').on('change', function () {\n updateUrlAndRedirect(getParameters());\n });\n\n $('#report_start_day, #report_end_day').on('change', function () {\n updateUrlAndRedirect(getParameters());\n });\n\n $('#ugc_selects').on('change', function () {\n const ugc_group_id = $('#ugc_selects option:selected').val();\n const sns_post_id = $('#ugc_sns_post_selects option:selected').val();\n const ugc_group_ab = $('#ugc_report_ab_selects option:selected').val();\n const device = $('.ugc_device_select').data('device');\n const start_day = $('#report_start_day').val();\n const end_day = $('#report_end_day').val();\n const selected_month = $('#ua_ugc_group_month_selects option:selected').val() || '';\n\n add_params = '';\n\n if (start_day && end_day) {\n add_params += '&start_day=' + start_day;\n add_params += '&end_day=' + end_day;\n }\n\n location.href = `/ugc_report?ugc_group_id=${ugc_group_id}&id=${sns_post_id}&device=${device}${add_params}&m=${selected_month}`;\n });\n\n $('.ugc_graph_pattern_select_day, .ugc_graph_pattern_select_month').on('click', function () {\n let params;\n if ($(this).hasClass('ugc_graph_pattern_select_day')) {\n params = getParameters();\n params.gf = '30';\n params.start_day = $('#report_start_day').val();\n params.end_day = $('#report_end_day').val();\n } else if ($(this).hasClass('ugc_graph_pattern_select_month')) {\n params = getParameters();\n params.gf = '12';\n delete params.start_day;\n delete params.end_day;\n }\n updateUrlAndRedirect(params);\n });\n\n $('.ugc_report_btn').on('click', function () {\n let params = getParameters();\n params.ugc_group_id = $(this).data('ugc_group_id');\n params.id = $(this).data('id');\n params.device = 2;\n params.gf = 30;\n updateUrlAndRedirect(params, `${DOMAIN}/ugc_report`);\n });\n\n $('.ugc_device_select_all, .ugc_device_select_pc, .ugc_device_select_phone').on('click', function () {\n let params = getParameters();\n if ($(this).hasClass('ugc_device_select_all')) {\n params.device = '2';\n } else if ($(this).hasClass('ugc_device_select_pc')) {\n params.device = '0';\n } else if ($(this).hasClass('ugc_device_select_phone')) {\n params.device = '1';\n }\n updateUrlAndRedirect(params);\n });\n\n $('#download_ugc_csv').on('click', function () {\n let href = '/download_ugc_csv';\n href += `?ugc_group_id=${$('#ugc_selects option:selected').val()}`;\n href += `&m=${$('#ua_ugc_group_month_selects option:selected').val()}`;\n href += `&device=${$('.ugc_device_select').data('device')}`;\n location.href = href;\n });\n\n $('.delete_log_data').on('click', function () {\n if (!confirm('本当に削除を実行しますか?')) {\n return;\n }\n let ugc_group_id = $('#ugc_selects option:selected').val();\n\n $.ajax({\n url: '/delete_ugc_group_log',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('削除が完了しました。');\n location.reload();\n }\n });\n });\n\n $('.delete_log_data_and_related_data').on('click', function () {\n if (!confirm('本当に完全削除を実行しますか?')) {\n return;\n }\n let ugc_group_id = $('#ugc_selects option:selected').val();\n\n $.ajax({\n url: '/delete_ugc_group_log_and_related_data',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('削除が完了しました。');\n location.href = '/ugc_report';\n }\n });\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // UGC分析\n //-----------------------------------------------------------------------------------------------------------------\n $('#ua_ugc_selects').on('change', function () {\n let ugc_group_id = $('#ua_ugc_selects option:selected').val();\n let ugc_group_ab = $('#ua_ugc_ab_selects option:selected').val();\n let device = $('.ua_ugc_device_select').data('device');\n let start_day = $('#analysis_start_day').val();\n let end_day = $('#analysis_end_day').val();\n\n if (ugc_group_id == 'none') {\n location.href = `/ugc_analysis`;\n } else {\n if (ugc_group_ab == 'none' || ugc_group_ab == null) {\n if (!start_day || !end_day) {\n location.href = `/ugc_analysis?ugc_group_id=${ugc_group_id}&device=${device}`;\n } else {\n location.href = `/ugc_analysis?ugc_group_id=${ugc_group_id}&device=${device}&start_day=${start_day}&end_day=${end_day}`;\n }\n } else {\n location.href = `/ugc_analysis?ugc_group_id=${ugc_group_id}&ab=n&device=${device}&start_day=${start_day}&end_day=${end_day}`;\n if (!start_day || !end_day) {\n location.href = `/ugc_analysis?ugc_group_id=${ugc_group_id}&ab=n&device=${device}`;\n } else {\n location.href = `/ugc_analysis?ugc_group_id=${ugc_group_id}&ab=n&device=${device}&start_day=${start_day}&end_day=${end_day}`;\n }\n }\n }\n });\n\n // URLを構築し、ページをリダイレクトする関数\n function redirectToAnalysis() {\n const ugc_group_id = $('#ua_ugc_selects option:selected').val();\n const ugc_group_ab = $('#ua_ugc_ab_selects option:selected').val();\n const device = $('.ua_ugc_device_select').data('device');\n const start_day = $('#analysis_start_day').val();\n const end_day = $('#analysis_end_day').val();\n\n let params = new URLSearchParams();\n\n // ugc_group_idが'none'の場合のみugc_group_idをパラメータに追加\n if (ugc_group_id !== 'none') {\n params.append('ugc_group_id', ugc_group_id);\n\n // ugc_group_abが有効な値の場合のみ追加\n if (ugc_group_ab !== 'none' && ugc_group_ab !== null && ugc_group_ab !== 'undefined') {\n params.append('ab', ugc_group_ab);\n }\n\n params.append('device', device);\n params.append('start_day', start_day);\n params.append('end_day', end_day);\n }\n\n // ページのリダイレクト\n location.href = `/ugc_analysis?${params.toString()}`;\n }\n\n // 各要素の変更イベントに関数をバインド\n $('#ua_ugc_ab_selects, #analysis_start_day, #analysis_end_day').on('change', redirectToAnalysis);\n\n $('#ua_ugc_group_month_selects').on('change', function () {\n let ugc_group_id = $('#ua_ugc_selects option:selected').val();\n let month = $('#ua_ugc_group_month_selects option:selected').val();\n let url = new URL(window.location.href);\n\n if (month != '') {\n if (url.searchParams.has('m')) {\n // 値が \"0\"か\"1\" なら \"2\" に更新する\n let new_value = month;\n // パラメーターの値を更新する\n url.searchParams.set('m', new_value);\n } else {\n // パラメーターにdeviceがない場合\n // 新しいパラメーターを追加する\n url.searchParams.append('m', month);\n }\n\n // 更新されたURLにリダイレクトする\n location.href = url.toString();\n } else {\n // monthが空文字の時は指定したURLにリダイレクトする\n location.href = 'ugc_analysis';\n }\n });\n\n $('.ua_ugc_device_select_all').on('click', function () {\n let url = new URL(window.location.href);\n\n // パラメーターにdeviceがある場合\n if (url.searchParams.has('device')) {\n // 既に設定されている値を取得\n let current_value = url.searchParams.get('device');\n\n // 値が \"0\"か\"1\" なら \"2\" に更新する\n let new_value = current_value === '0' || current_value === '1' ? '2' : current_value;\n\n // パラメーターの値を更新する\n url.searchParams.set('device', new_value);\n } else {\n // パラメーターにdeviceがない場合\n // 新しいパラメーターを追加する\n url.searchParams.append('device', '2');\n }\n\n // 更新されたURLにリダイレクトする\n location.href = url.toString();\n });\n $('.ua_ugc_device_select_pc').on('click', function () {\n let url = new URL(window.location.href);\n\n // パラメーターにdeviceがある場合\n if (url.searchParams.has('device')) {\n // 既に設定されている値を取得\n let current_value = url.searchParams.get('device');\n\n // 値が \"1\",\"2\" なら \"0\" に更新する\n let new_value = current_value === '1' || current_value === '2' ? '0' : current_value;\n\n // パラメーターの値を更新する\n url.searchParams.set('device', new_value);\n } else {\n // パラメーターにdeviceがない場合\n // 新しいパラメーターを追加する\n url.searchParams.append('device', '0');\n }\n\n // 更新されたURLにリダイレクトする\n location.href = url.toString();\n });\n $('.ua_ugc_device_select_phone').on('click', function () {\n let url = new URL(window.location.href);\n\n // パラメーターにdeviceがある場合\n if (url.searchParams.has('device')) {\n // 既に設定されている値を取得\n let current_value = url.searchParams.get('device');\n\n // 値が \"0\",\"2\" なら \"1\" に更新する\n let new_value = current_value === '0' || current_value === '2' ? '1' : current_value;\n\n // パラメーターの値を更新する\n url.searchParams.set('device', new_value);\n } else {\n // パラメーターにdeviceがない場合\n // 新しいパラメーターを追加する\n url.searchParams.append('device', '1');\n }\n\n // 更新されたURLにリダイレクトする\n location.href = url.toString();\n });\n\n $('.table_header').on('click', function () {\n let url = new URL(window.location.href);\n let p_vap = $(this).data('flag');\n\n // パラメーターにpがある場合\n if (url.searchParams.has('p')) {\n // 既に設定されている値を取得\n let current_value = url.searchParams.get('p');\n\n if (p_vap == current_value) {\n url.searchParams.delete('p');\n } else {\n // パラメーターの値を更新する\n url.searchParams.set('p', p_vap);\n }\n } else {\n // パラメーターにdeviceがない場合\n // 新しいパラメーターを追加する\n url.searchParams.append('p', p_vap);\n }\n\n // 更新されたURLにリダイレクトする\n location.href = url.toString();\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // 商品マスタ\n //-----------------------------------------------------------------------------------------------------------------\n $('#new_product_set_btn').on('click', function () {\n $('.platta_ig_modal_container').fadeIn(100);\n });\n\n $('#product_search').on('keypress', function (e) {\n if (e.which === 13) {\n e.preventDefault(); // デフォルトのエンターキーの挙動を無効にする\n let search_word = $(this).val();\n location.href = `/products_setting?p=${search_word}`;\n }\n });\n\n $('.all_product_list').on('click', function () {\n location.reload();\n });\n\n $('.product_edit').on('click', function () {\n let product_id = $(this).data('id');\n let product_code = $(this).data('code');\n let product_name = $(this).data('name');\n let product_image_url = $(this).data('image_url');\n let product_url = $(this).data('url');\n let product_price = $(this).data('price');\n let is_product_price_visible = $(this).data('is_product_price_visible');\n let is_post_visible = $(this).data('is_post_visible');\n let product_comment = $(this).data('comment');\n\n $('#product_edit_id').val(product_id);\n $('#product_edit_code').val(product_code);\n $('#product_edit_name').val(product_name);\n $('#product_edit_image_url').val(product_image_url);\n $('#product_edit_page_url').val(product_url);\n $('#product_edit_price').val(product_price);\n is_product_price_visible == 1 ? $('#edit_is_product_price_visible').prop(\"checked\", true) : $('#edit_is_product_price_visible').prop(\"checked\", false);\n is_post_visible == 1 ? $('#edit_is_post_visible').prop(\"checked\", true) : $('#edit_is_post_visible').prop(\"checked\", false);\n $('#product_edit_comment').val(product_comment);\n $('.platta_ig_edit_modal_container').fadeIn(100);\n });\n\n $('.platta_ig_modal_del').on('click', function () {\n $('.platta_ig_modal_container').fadeOut(0);\n });\n $('.platta_ig_edit_modal_del').on('click', function () {\n $('.platta_ig_edit_modal_container').fadeOut(0);\n });\n $('.platta_ig_modal_bg, .platta_ig_edit_modal_bg').on('click', function () {\n $('.platta_ig_modal_container').fadeOut(0);\n $('.platta_ig_edit_modal_container').fadeOut(0);\n });\n\n $('.product_submit_btn').on('click', function () {\n $('.product_submit_btn').css('pointer-events', 'none');\n\n let product_code = $('#product_code').val();\n let product_name = $('#product_name').val();\n let product_image_url = $('#product_image_url').val();\n let product_page_url = $('#product_page_url').val();\n let product_price = $('#product_price').val();\n let is_product_price_visible = $('#is_product_price_visible').prop(\"checked\") ? 1 : 0;\n let is_post_visible = $('#is_post_visible').prop(\"checked\") ? 1 : 0;\n let product_sale_price = $('#product_sale_price').val();\n let product_comment = $('#product_comment').val();\n let product_stock_status = $('#product_stock_status').val();\n\n // if (product_name == '' || product_image_url == '' || product_page_url == '') {\n // alert('入力必須項目は必ず入力してください。');\n // $('.product_submit_btn').css('pointer-events', 'auto');\n // return;\n // }\n\n $.ajax({\n url: '/product_submit',\n type: 'POST',\n data: {\n product_code: product_code,\n product_name: product_name,\n product_image_url: product_image_url,\n product_page_url: product_page_url,\n product_price: product_price,\n is_product_price_visible: is_product_price_visible,\n is_post_visible: is_post_visible,\n product_sale_price: product_sale_price,\n product_comment: product_comment,\n product_stock_status: product_stock_status,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('商品情報を登録しました。');\n location.reload();\n }\n });\n });\n\n $('.product_delete').on('click', function () {\n let product_id = $(this).data('id');\n let product_code = $(this).data('code');\n $.ajax({\n url: '/delete_product',\n type: 'POST',\n data: {\n product_id: product_id,\n product_code: product_code,\n delete_flag: 0,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('商品を削除しました。');\n location.reload();\n } else if (data.ret == '1') {\n if (!confirm('UGC投稿と連携されています。削除する場合は、連携も解除されます。本当に削除しますか?')) {\n return;\n } else {\n $.ajax({\n url: '/delete_product',\n type: 'POST',\n data: {\n product_id: product_id,\n product_code: product_code,\n delete_flag: 1,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('商品を削除しました。投稿との連携も解除しました。');\n location.reload();\n }\n });\n }\n }\n });\n });\n $('.product_edit_submit_btn').on('click', function () {\n let product_id = $('#product_edit_id').val();\n let product_code = $('#product_edit_code').val();\n let product_page_url = $('#product_edit_page_url').val();\n let product_name = $('#product_edit_name').val();\n let product_image_url = $('#product_edit_image_url').val();\n let product_url = $('#product_edit_page_url').val();\n let product_price = $('#product_edit_price').val();\n let is_product_price_visible = $('#edit_is_product_price_visible').prop(\"checked\") ? 1 : 0;\n let is_post_visible = $('#edit_is_post_visible').prop(\"checked\") ? 1 : 0;\n let product_comment = $('#product_edit_comment').val();\n\n if (product_name == '' || product_image_url == '' || product_page_url == '') {\n alert('入力必須項目は必ず入力してください。');\n return;\n }\n\n $.ajax({\n url: '/edit_product',\n type: 'POST',\n data: {\n product_id: product_id,\n product_code: product_code,\n product_name: product_name,\n product_image_url: product_image_url,\n product_url: product_url,\n product_price: product_price,\n is_product_price_visible: is_product_price_visible,\n is_post_visible: is_post_visible,\n product_comment: product_comment,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('商品を情報を編集しました。');\n location.reload();\n }\n });\n });\n\n \n //-----------------------------------------------------------------------------------------------------------------\n // Hashframe\n //-----------------------------------------------------------------------------------------------------------------\n if (window.location.pathname.includes(\"/campaign_show\") || window.location.pathname.includes(\"/campaign_new\")) {\n const imageInput = document.getElementById(\"campaign-image-input\");\n const previewContainer = document.getElementById(\"campaign-image-preview-container\");\n\n let selectedFiles = [];\n\n // 画像プレビュー処理\n imageInput.addEventListener(\"change\", function () {\n const files = Array.from(imageInput.files);\n\n if (selectedFiles.length + files.length > 5) {\n alert(\"画像は最大5つまでアップロードできます。\");\n return;\n }\n\n files.forEach((file) => {\n const reader = new FileReader();\n reader.onload = function (e) {\n const imageId = selectedFiles.length;\n selectedFiles.push(file);\n\n const imageWrapper = document.createElement(\"div\");\n imageWrapper.classList.add(\"campaign-image-preview-item\");\n imageWrapper.setAttribute(\"data-id\", imageId);\n\n const img = document.createElement(\"img\");\n img.src = e.target.result;\n\n const removeButton = document.createElement(\"button\");\n removeButton.textContent = \"削除\";\n removeButton.classList.add(\"remove-button\");\n removeButton.setAttribute(\"data-id\", imageId);\n removeButton.addEventListener(\"click\", function () {\n removeImage(imageId);\n });\n\n imageWrapper.appendChild(img);\n imageWrapper.appendChild(removeButton);\n previewContainer.appendChild(imageWrapper);\n };\n reader.readAsDataURL(file);\n });\n });\n\n // 画像削除処理\n function removeImage(imageId) {\n selectedFiles = selectedFiles.filter((_, index) => index !== imageId);\n previewContainer.querySelector(`[data-id='${imageId}']`).remove();\n }\n\n $('#title').on('blur', function () {\n if($(this).val().length > 50){\n alert(\"「PR案件のタイトル」の文字数制限を超えています。\");\n }\n });\n $('#service_url').on('blur', function () {\n if($(this).val().length > 200){\n alert(\"「サービスのURL」の文字数制限を超えています。\");\n }\n });\n $('#service_name').on('blur', function () {\n if($(this).val().length > 80){\n alert(\"「提供するサービス」の文字数制限を超えています。\");\n }\n });\n $('#description').on('blur', function () {\n if($(this).val().length > 1200){\n alert(\"「サービスの概要」の文字数制限を超えています。\");\n }\n });\n $('#task').on('blur', function () {\n if($(this).val().length > 500){\n alert(\"「やってほしいこと」の文字数制限を超えています。\");\n }\n });\n $('#persona').on('blur', function () {\n if($(this).val().length > 200){\n alert(\"「こんな人にお仕事をお願いしたい」の文字数制限を超えています。\");\n }\n });\n $('#precaution').on('blur', function () {\n if($(this).val().length > 200){\n alert(\"「投稿に関する注意事項」の文字数制限を超えています。\");\n }\n });\n $('#postscript').on('blur', function () {\n if($(this).val().length > 200){\n alert(\"「投稿に記載するメンション・ハッシュタグ」の文字数制限を超えています。\");\n }\n });\n\n $('.edit-campaign-images').on('click', function () {\n $('.image-preview-area').fadeOut(0);\n $('.edit-campaign-images').fadeOut(0);\n $('.image-input-area').fadeIn(500);\n $('.cancel-campaign-images').fadeIn(500);\n $('#campaign_image_edit').val(\"1\");\n \n });\n \n $('.cancel-campaign-images').on('click', function () {\n $('.image-input-area').fadeOut(0);\n $('.cancel-campaign-images').fadeOut(0);\n $('.image-preview-area').fadeIn(500);\n $('.edit-campaign-images').fadeIn(500);\n $('#campaign_image_edit').val(0);\n });\n }\n \n let message_contents = $(\"#message_contents\"); // スクロール対象の要素\n if (message_contents.length) { // 存在する場合のみ実行\n message_contents.animate({ scrollTop: message_contents[0].scrollHeight }, 800); // 800ms でアニメーション\n }\n\n $('#update_campaign, #create_campaign').on('click', function () {\n let campaign_id = $(\"#campaign_id\").val().trim();\n let title = $(\"#title\").val().trim();\n let category = $(\"#category\").val().trim();\n let service_url = $(\"#service_url\").val().trim();\n let service_name = $(\"#service_name\").val().trim();\n let description = $(\"#description\").val().trim();\n let task = $(\"#task\").val().trim();\n let persona = $(\"#persona\").val().trim();\n let precaution = $(\"#precaution\").val().trim();\n let postscript = $(\"#postscript\").val().trim();\n let recruitment_numbers = $(\"#recruitment_numbers\").val().trim();\n let is_open = $('input[name=\"is_open\"]:checked').val();\n let campaign_image_edit = $('#campaign_image_edit').val();\n\n if(title==\"\"){\n alert(\"「PR案件のタイトル」を入力してください\");\n return;\n }\n if(category==\"\"){\n alert(\"「カテゴリー」を入力してください\");\n return;\n }\n if(service_url==\"\"){\n alert(\"「サービスのURL」を入力してください\");\n return;\n }\n if(service_name==\"\"){\n alert(\"「提供するサービス」を入力してください\");\n return;\n }\n if(description==\"\"){\n alert(\"「サービスの概要」を入力してください\");\n return;\n }\n if(task==\"\"){\n alert(\"「やってほしいこと」を入力してください\");\n return;\n }\n if(persona==\"\"){\n alert(\"「こんな人にお仕事をお願いしたい」を入力してください\");\n return;\n }\n if(precaution==\"\"){\n alert(\"「投稿に関する注意事項」を入力してください\");\n return;\n }\n if(postscript==\"\"){\n alert(\"「投稿に記載するメンション・ハッシュタグ」を入力してください\");\n return;\n }\n if(recruitment_numbers==\"\"){\n alert(\"「募集人数」を入力してください\");\n return;\n }\n if(title.length > 50){\n alert(\"「PR案件のタイトル」の文字数制限を超えています。\");\n return;\n }\n if(service_url.length > 200){\n alert(\"「提供するサービス」の文字数制限を超えています。\");\n return;\n }\n if(service_name.length > 80){\n alert(\"「提供するサービス」の文字数制限を超えています。\");\n return;\n }\n if(description.length > 1200){\n alert(\"「サービスの概要」の文字数制限を超えています。\");\n return;\n }\n if(task.length > 500){\n alert(\"「やってほしいこと」の文字数制限を超えています。\");\n return;\n }\n if(persona.length > 200){\n alert(\"「こんな人にお仕事をお願いしたい」の文字数制限を超えています。\");\n return;\n }\n if(precaution.length > 200){\n alert(\"「投稿に関する注意事項」の文字数制限を超えています。\");\n return;\n }\n if(postscript.length > 200){\n alert(\"「投稿に記載するメンション・ハッシュタグ」の文字数制限を超えています。\");\n return;\n }\n let campaign_url = \"\";\n if(campaign_id==\"\"){\n campaign_url = '/create_campaign';\n }else{\n campaign_url = '/update_campaign';\n }\n if (!confirm('この内容で送信しますか?')) {\n return;\n }\n\n let formData = new FormData();\n\n // テキストデータを追加\n formData.append(\"id\", campaign_id);\n formData.append(\"is_open\", is_open);\n formData.append(\"title\", title);\n formData.append(\"category\", category);\n formData.append(\"service_url\", service_url);\n formData.append(\"service_name\", service_name);\n formData.append(\"description\", description);\n formData.append(\"task\", task);\n formData.append(\"persona\", persona);\n formData.append(\"precaution\", precaution);\n formData.append(\"postscript\", postscript);\n formData.append(\"recruitment_numbers\", recruitment_numbers);\n formData.append(\"campaign_image_edit\", campaign_image_edit);\n\n // 画像を取得して追加\n if((campaign_url == '/create_campaign') || (campaign_image_edit==\"1\")){\n let imageInput = document.getElementById(\"campaign-image-input\");\n if (imageInput.files.length > 5) {\n alert(\"画像は最大5つまでアップロードできます。\");\n return;\n }\n for (let i = 0; i < imageInput.files.length; i++) {\n formData.append(\"images[]\", imageInput.files[i]);\n }\n }\n \n $.ajax({\n url: DOMAIN + campaign_url,\n type: 'POST',\n data: formData,\n processData: false,\n contentType: false,\n dataType: 'json',\n }).done(function (data) {\n location.href=\"/campaign_index\";\n });\n });\n\n // インフルエンサーをお気に入りに入れるボタン\n $('.favorite-btn').on('click', function () {\n $.ajax({\n url: DOMAIN + '/bookmark_user',\n type: 'POST',\n data: {\n user_id: $(this).data(\"user-id\")\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // インフルエンサーを非表示にするボタン\n $('.hide-btn').on('click', function () {\n $.ajax({\n url: DOMAIN + '/hidden_user',\n type: 'POST',\n data: {\n user_id: $(this).data(\"user-id\")\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // 依頼リクエストボタン\n $('.request2-btn').on('click', function () {\n if($(\"#campaign\").val().trim()==\"\"){\n alert(\"依頼するキャンペーンを選択してください\");\n return;\n }\n if($(\"#message\").val().trim()==\"\"){\n alert(\"メッセージを入力してください\");\n return;\n }\n if (!confirm('この内容で送信しますか?')) {\n return;\n }\n $.ajax({\n url: DOMAIN + '/campaign_request',\n type: 'POST',\n data: {\n user_id: $(this).data(\"user-id\"),\n campaign_id: $(\"#campaign\").val(),\n message: $(\"#message\").val()\n },\n dataType: 'json',\n }).done(function (data) {\n if(data.message==\"OK\"){\n location.href=\"/user_index\";\n }else{\n alert(ERROR_MSG);\n }\n });\n });\n\n $('#campaign_status').on('change', function () {\n location.href=\"/campaign_index?is_open=\" + $(this).val();\n });\n\n $('#entry_status').on('change', function () {\n location.href=\"/entry_index?status=\" + $(this).val();\n });\n \n $('#request_status').on('change', function () {\n location.href=\"/request_index?status=\" + $(this).val();\n });\n\n $('#maching_status').on('change', function () {\n location.href=\"/matching_index?status=\" + $(this).val();\n });\n\n // 応募を採用ボタン\n $('.approval-btn').on('click', function () {\n if (!confirm('この応募を採用しますか?')) {\n return;\n }\n $.ajax({\n url: DOMAIN + '/approval_entry',\n type: 'POST',\n data: {\n id: $(this).data(\"id\")\n },\n dataType: 'json',\n }).done(function (data) {\n if(data.message==\"OK\"){\n location.href=\"/entry_index\";\n }else{\n alert(ERROR_MSG);\n }\n });\n });\n\n // 応募をお見送りボタン\n $('.disapproval-btn').on('click', function () {\n if (!confirm('この応募をお見送りにしますか?')) {\n return;\n }\n $.ajax({\n url: DOMAIN + '/disapproval_entry',\n type: 'POST',\n data: {\n id: $(this).data(\"id\")\n },\n dataType: 'json',\n }).done(function (data) {\n location.href=\"/entry_index\";\n });\n });\n\n // 依頼フォーム開くボタン\n $('.request-btn').on('click', function () {\n $(\".input-area\").slideDown(240);\n $(\".request-btn\").fadeOut(0);\n $(\".request2-btn\").fadeIn(0);\n $(\".cancel-btn\").fadeIn(0);\n });\n\n // 依頼のキャンセルボタン\n $('.cancel-btn').on('click', function () {\n $(\".input-area\").slideUp(120);\n $(\".request-btn\").fadeIn(0);\n $(\".request2-btn\").fadeOut(0);\n $(\".cancel-btn\").fadeOut(0);\n });\n\n // インフルエンサー一覧のユーザ検索\n $('.user-search').on('click', function () {\n \n let nick_name = $(\"#nick_name\").val().trim();\n $(\"#nick_name\").val(nick_name);\n\n let from_age = parseInt($(\"#from_age\").val(), 10);\n if (from_age < 20) {\n $(\"#from_age\").val(20);\n }\n let to_age = parseInt($(\"#to_age\").val(), 10);\n if (to_age > 99) {\n $(\"#to_age\").val(99);\n }\n\n let href = \"/user_index?s=1\";\n if(nick_name!=\"\"){\n href += \"&nick_name=\" + nick_name;\n }\n if($(\"#from_age\").val()!=\"\"){\n href += \"&from_age=\" + $(\"#from_age\").val();\n }\n if($(\"#to_age\").val()!=\"\"){\n href += \"&to_age=\" + $(\"#to_age\").val();\n }\n if($(\"#gender\").val()!=\"\"){\n href += \"&gender=\" + $(\"#gender\").val();\n }\n if($(\"#prefecture\").val()!=\"\"){\n href += \"&prefecture=\" + $(\"#prefecture\").val();\n }\n if($(\"#category\").val()!=\"\"){\n href += \"&category=\" + $(\"#category\").val();\n }\n if ($(\"#bookmark\").is(\":checked\")) {\n href += \"&bookmark=1\";\n }\n if($(\"#from_follower\").val()!=\"\"){\n href += \"&from_follower=\" + $(\"#from_follower\").val();\n }\n if($(\"#to_follower\").val()!=\"\"){\n href += \"&to_follower=\" + $(\"#to_follower\").val();\n }\n if ($(\"#hidden\").is(\":checked\")) {\n href += \"&hidden=1\";\n }\n location.href = href;\n });\n\n // メッセージ送信\n $('.send-message').on('click', function () {\n if($(\"#message_text\").val()==\"\"){\n alert(\"メッセージを入力してください\");\n return;\n }\n $.ajax({\n url: DOMAIN + '/send_message',\n type: 'POST',\n data: {\n message: $(\"#message_text\").val(),\n room_id: $(\"#room_id\").val(),\n user_id: $(\"#user_id\").val()\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // 絵文字送信\n $('.send-emoji').on('click', function () {\n $(this).closest(\".message-row\").find(\".emoji-area\").html($(this).data(\"val\"));\n $(this).closest(\".message-row\").find(\".emoji-area\").fadeIn(200);\n $.ajax({\n url: DOMAIN + '/send_emoji',\n type: 'POST',\n data: {\n emoji: $(this).data(\"val\"),\n message_id: $(this).data(\"message-id\"),\n room_id: $(\"#room_id\").val(),\n user_id: $(\"#user_id\").val()\n },\n dataType: 'json',\n }).done(function (data) {\n });\n });\n\n $(\".message-row\").on(\"mouseenter\", function() {\n $(this).find(\".emoji-form\").show();\n });\n\n $(\".message-row\").on(\"mouseleave\", function() {\n $(this).find(\".emoji-form\").hide();\n });\n\n $(\".hide-room\").on(\"click\", function() {\n if (!confirm(`このチャットを非表示にしますか?`)) {\n return;\n }\n $.ajax({\n url: DOMAIN + '/hide_room',\n type: 'POST',\n data: {\n val: 1,\n room_id: $(\"#room_id\").val()\n },\n dataType: 'json',\n }).done(function (data) {\n location.href = \"/message_index\";\n });\n });\n\n $(\".show-room\").on(\"click\", function() {\n if (!confirm(`このチャットの非表示を解除しますか?`)) {\n return;\n }\n $.ajax({\n url: DOMAIN + '/hide_room',\n type: 'POST',\n data: {\n val: 0,\n room_id: $(\"#room_id\").val()\n },\n dataType: 'json',\n }).done(function (data) {\n location.href = \"/message_index?hidden=1\";\n });\n });\n\n $(\".check-post\").on(\"click\", function() {\n if (!confirm(`この依頼を完了させますか?`)) {\n return;\n }\n $.ajax({\n url: DOMAIN + '/check_post',\n type: 'POST',\n data: {\n room_id: $(\"#room_id\").val()\n },\n dataType: 'json',\n }).done(function (data) {\n alert(\"依頼案件のチェックが完了しました、このスレッドは「完了」のタブに移動されます。\");\n location.href = \"/message_index\";\n });\n });\n\n $(\"#copy-btn\").on(\"click\", function() {\n let copyText = $(\"#address_str\").text();\n\n if (navigator.clipboard && navigator.clipboard.writeText) {\n // ✅ 最新ブラウザ向け\n navigator.clipboard.writeText(copyText).then(() => {\n let message = document.getElementById(\"copy-message\");\n message.style.display = \"block\"; \n setTimeout(() => message.style.display = \"none\", 2000);\n }).catch(err => {\n console.error(\"コピーに失敗しました:\", err);\n });\n } else {\n // ✅ 旧ブラウザ向け(`execCommand`)\n let textarea = document.createElement(\"textarea\");\n textarea.value = copyText;\n document.body.appendChild(textarea);\n textarea.select();\n document.execCommand(\"copy\");\n document.body.removeChild(textarea);\n let message = document.getElementById(\"copy-message\");\n message.style.display = \"block\"; \n setTimeout(() => message.style.display = \"none\", 2000);\n }\n});\n\n $(\".show-address\").on(\"click\", function() {\n $(\".modal-address\").fadeIn();\n $(\".modal-bk\").fadeIn();\n });\n\n // クリップアイコンをクリック → モーダルを開く\n $(\"#message-file-input\").on(\"click\", function() {\n $(\".modal-bk\").fadeIn();\n $(\".modal-content\").fadeIn();\n });\n \n $(\".modal-close, .modal-bk\").on(\"click\", function() {\n $(\".modal-content\").fadeOut(50);\n $(\".modal-address\").fadeOut(50);\n $(\".modal-bk\").fadeOut(50);\n });\n\n let dropArea = $(\"#drop-area\");\n \n // クリックでファイル選択\n dropArea.on(\"click\", function() {\n document.getElementById(\"file-input\").click();\n });\n\n // ドラッグオーバー時のスタイル変更\n dropArea.on(\"dragover\", function(event) {\n event.preventDefault();\n dropArea.css(\"background\", \"#ddd\");\n });\n\n // ドラッグ離した時のスタイルリセット\n dropArea.on(\"dragleave\", function(event) {\n event.preventDefault();\n dropArea.css(\"background\", \"#f9f9f9\");\n });\n\n // ドロップ時の処理\n dropArea.on(\"drop\", function(event) {\n event.preventDefault();\n dropArea.css(\"background\", \"#f9f9f9\");\n\n let files = event.originalEvent.dataTransfer.files;\n console.log(\"ドロップされたファイル:\", files);\n handleFiles(files);\n });\n \n // ファイルが選択されたら処理\n $(\"#file-input\").on(\"change\", function(event) {\n let files = event.target.files;\n handleFiles(files);\n });\n \n // 画像をプレビュー表示\n function handleFiles(files) {\n if (files.length > 0) {\n let file = files[0];\n let reader = new FileReader();\n\n reader.onload = function(e) {\n $(\"#preview\").attr(\"src\", e.target.result).show();\n $(\"#image-upload-btn\").data(\"file\", file); // ボタンにファイルをセット\n };\n\n reader.readAsDataURL(file);\n }\n }\n\n // 画像をアップロード(S3に送信)\n $(\"#image-upload-btn\").on(\"click\", function() {\n let file = $(this).data(\"file\");\n if (!file) {\n alert(\"ファイルを選択してください\");\n return;\n }\n \n // ✅ 許可する画像の MIME タイプ(拡張子チェック)\n const allowedTypes = [\"image/jpeg\", \"image/jpg\", \"image/png\"];\n \n if (!allowedTypes.includes(file.type)) {\n alert(\"画像ファイル(JPEG, PNG)のみアップロードできます\");\n return;\n }\n \n let formData = new FormData();\n formData.append(\"image\", file);\n formData.append(\"room_id\", $(this).data(\"room\"));\n formData.append(\"user_id\", $(this).data(\"user\"));\n \n $.ajax({\n url: \"/upload_message_file\",\n type: \"POST\",\n data: formData,\n contentType: false,\n processData: false,\n success: function(response) {\n location.reload();\n },\n error: function(xhr, status, error) {\n alert(\"アップロードに失敗しました\");\n }\n });\n });\n \n //-----------------------------------------------------------------------------------------------------------------\n // プレビュー作成\n //-----------------------------------------------------------------------------------------------------------------\n $('#create_preview_btn')\n .off()\n .on('click', function () {\n $('.loadding').css('display', 'block');\n let ugc_group_id = $('#create_preview_select option:selected').val();\n let preview_url = $('#create_preview_url').val();\n let preview_html_name = $('#create_preview_html_name').val();\n let tag_check = $('#create_preview_tag').prop('checked');\n if (ugc_group_id == '' || ugc_group_id == null || preview_url == '' || preview_html_name == '') {\n $('.loadding').css('display', 'none');\n alert('必須項目を入力してください。');\n return;\n }\n\n $.ajax({\n url: '/save_preview',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n url: preview_url,\n file_name: preview_html_name,\n tag_check: tag_check,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('プレビューを作成しました。');\n location.reload();\n }\n });\n });\n\n $('.create_preview_html_edit').on('click', function () {\n let preview_id = $(this).data('id');\n let preview_url = $(this).data('url');\n $.ajax({\n url: '/edit_preview_html',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n // モーダルを作成し、HTMLコンテンツとボタンを表示\n let modalHtml = `
\n
\n
\n \n
\n
\n
閉じる
\n
保存
\n
\n
`;\n\n // モーダルをbody要素に追加\n $('body').append(modalHtml);\n $('#html_modal_text_area').text(data.html_content);\n\n $('#html_save_btn').on('click', function () {\n let html = $('#html_modal_text_area').val();\n $.ajax({\n url: '/update_preview_html',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n html: html,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('htmlを編集しました。');\n location.reload();\n }\n });\n });\n\n $('#html_modal_wrapper, #html_remove_btn').on('click', function (e) {\n $('#html_modal_wrapper, #html_modal_container, #html_modal_text_area, #html_save_btn').remove();\n });\n }\n });\n });\n\n $('.create_preview_url_delete').on('click', function () {\n let preview_id = $(this).data('id');\n let preview_url = $(this).data('url');\n $.ajax({\n url: '/preview_delete',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('プレビューurlを削除しました。');\n location.reload();\n }\n });\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // コメント レビュー用\n //-----------------------------------------------------------------------------------------------------------------\n $('.to_t_comment').on('click', function () {\n let href = '/t_comment';\n location.href = href;\n });\n\n //-----------------------------------------------------------------------------------------------------------------\n // コメント レビュー用\n //-----------------------------------------------------------------------------------------------------------------\n $('.to_post_picture').on('click', function () {\n let href = '/post_picture';\n location.href = href;\n });\n\n $('.to_t_dm').on('click', function () {\n let href = '/t_dm';\n location.href = href;\n });\n\n // oembed レビュー用\n $('.to_oembed').on('click', function () {\n let href = '/oembed';\n location.href = href;\n });\n\n // ハッシュタグ、自社投稿関連\n let current_display_type = '';\n let reverse_current_display_type = '';\n\n // 投稿の表示タイプによってlocalStorageに保存するキー名を変える\n if (current_url.includes('hashtag_list?display_type=1')) {\n current_display_type = 'recent';\n // 投稿の表示タイプが切り替わったあとでは表示させるべきlocalStorageのアイテムが逆になる\n reverse_current_display_type = 'popular';\n } else if (current_url.includes('hashtag_list?display_type=0')) {\n current_display_type = 'popular';\n // 投稿の表示タイプが切り替わったあとでは表示させるべきlocalStorageのアイテムが逆になる\n reverse_current_display_type = 'recent';\n } else if (current_url.includes('/my_post_list')) {\n // 自社投稿の場合\n current_display_type = 'my';\n } else {\n // https://dev-manage-ssl.platta.jp/hashtag_list 等のクエリがない初期の場合\n current_display_type = 'recent';\n reverse_current_display_type = 'recent';\n }\n\n // 投稿収集一覧画面用\n // const not_condition_placeholder = `検索結果から除外したいハッシュタグ名を下記のように改行で区切って続けて入力してください。\n // 注) ハッシュタグマーク # は含めないでください\n\n // 例:\n // ドナルド\n // ミッキー\n // ミニー\n // `;\n\n const not_condition_placeholder = `検索結果から除外したいハッシュタグ名を改行を入れて続けて入力してください。\n注) ハッシュタグマーク # は含めないでください\n `;\n\n if ($('#excluded_words').length > 0) {\n $('#excluded_words')[0].placeholder = not_condition_placeholder;\n }\n\n // ハッシュタグ収集一覧画面のカレンダーにて今日の日付しか入力できないようにする\n if ($('#hashtag_initial_date')) {\n let today = new Date().toISOString().split('T')[0];\n // $('input[type=\"date\"]').attr('max', today);\n }\n\n let selected_tag_ids = [];\n let selected_tag_names = [];\n\n // 表示する期間\n let initial_date = $('#hashtag_initial_date').val();\n let end_date = $('#hashtag_end_date').val();\n\n // タググループのidを取得する\n let tgg_id = $('#selected_hashtag_group option:selected').val();\n\n //############################################################\n // ハッシュタグ一覧画面のURLパラメータ生成\n //############################################################\n const generate_hashtag_list_url_params = function () {\n // 投稿の表示タイプ\n let display_type = localStorage.getItem('hashtag_list_display_type') || $('.display_type:checked').val() || \"1\";\n\n // 投稿された期間\n const { hashtagInitialDate, hashtagEndDate } = getDefaultHashtagDates();\n let initial_date = localStorage.getItem('hashtag_initial_date') || $('#hashtag_initial_date').val() || hashtagInitialDate;\n let end_date = localStorage.getItem('hashtag_end_date') || $('#hashtag_end_date').val() || hashtagEndDate;\n\n // タググループ\n let tgg_id = localStorage.getItem('hashtag_group') || $('#selected_hashtag_group option:selected').val() || \"\";\n\n // ハッシュタグリスト\n let lstorage_hashtag_list = JSON.parse(localStorage.getItem('hashtag_list')) || [];\n let all_tag_check_box = $('input.tag_info');\n\n if (lstorage_hashtag_list.length > 0) {\n selected_tag_ids = lstorage_hashtag_list\n $.each(all_tag_check_box, function (index, el) {\n if (lstorage_hashtag_list.includes($(el).val())) {\n el.checked = true;\n }\n });\n } else {\n $.each(all_tag_check_box, function (index, el) {\n el.checked = true;\n });\n\n $('.tag_info:checked').each(function () {\n selected_tag_ids.push($(this).val());\n });\n }\n\n // タグ名検索(AND/OR)\n let search_condition = localStorage.getItem('search_condition') || $('#search_condition option:selected').val() || \"1\";\n\n // ページ内表示件数\n let per_page_num = localStorage.getItem('per_page_num') || $('#per_page_num option:selected').val() || \"50\";\n\n let url_query_path = \n `/hashtag_list?display_type=${display_type}` +\n `&initial_date=${initial_date}` +\n `&end_date=${end_date}` +\n `&tgg_id=${tgg_id}` +\n `&search_condition=${search_condition}` +\n `&per_page_num=${per_page_num}`;\n\n selected_tag_ids.forEach(function (tag_id, index) {\n url_query_path = url_query_path + `&tag_id_${index}=${tag_id}`;\n });\n\n return url_query_path;\n };\n\n // 検索条件の表示非表示 slideToggle -\n $('.accordion_filter, .cmm_accordion_filter').click(function () {\n $(this)\n .next()\n .slideToggle(300, function () {\n $(this).toggleClass('close');\n });\n if ($(this).next().hasClass('close')) {\n $(this).text('絞り込み条件を非表示にする');\n } else {\n $(this).text('絞り込み条件を表示する');\n }\n });\n\n // 投稿収集一覧 / My投稿一覧画面の開発、本番別 url\n let url_hashtag_list_dev, url_hashtag_list_pro, url_my_posts_dev, url_my_posts_pro;\n\n // 本番環境と開発環境に応じてurlを動的に切り替える\n if (window.location.href.indexOf('18.177.103.115') > -1) {\n // Development environment\n if (window.location.href.includes('http://18.177.103.115:3004/')) {\n url_hashtag_list_dev = 'http://18.177.103.115:3004/hashtag_list';\n url_my_posts_dev = 'http://18.177.103.115:3004/my_post_list';\n } else {\n url_hashtag_list_dev = 'http://18.177.103.115:3002/hashtag_list';\n url_my_posts_dev = 'http://18.177.103.115:3002/my_post_list';\n }\n } else if (window.location.href.indexOf('dev-manage-ssl') > -1) {\n // Development environment(https化)\n url_hashtag_list_dev = 'https://dev-manage-ssl.platta.jp/hashtag_list';\n url_my_posts_dev = 'https://dev-manage-ssl.platta.jp/my_post_list';\n } else {\n // Production environment\n url_hashtag_list_pro = 'https://manage.platta.jp/hashtag_list';\n url_my_posts_pro = 'https://manage.platta.jp/my_post_list';\n }\n\n if (\n // タググループが登録されていない、またはタグ名が登録されていない、またその両方の場合(初めてのお客様を想定)\n current_url === (url_hashtag_list_dev || url_hashtag_list_pro) &&\n ($('#selected_hashtag_group').children().length == 0 || $('#is_any_data').children().length == 0)\n ) {\n location.href = generate_hashtag_list_url_params();\n } else if (current_url === (url_hashtag_list_dev || url_hashtag_list_pro)) {\n location.href = generate_hashtag_list_url_params();\n }\n\n if (current_url.includes('/my_post_list?')) {\n $('.to_my_post_list').css('pointer-events', 'none');\n }\n\n // サイドバーからのルーティングだとループが起こるため下記のようにした\n $('.to_my_post_list').on('click', function (event) {\n $('.to_my_post_list').css('pointer-events', 'none');\n event.preventDefault();\n\n // 表示する期間\n let initial_date = $('#hashtag_initial_date').val();\n let end_date = $('#hashtag_end_date').val();\n\n // 投稿の種類(最近の投稿 or 人気の投稿)を取得する\n let display_type = $('.display_type:checked').val();\n\n // AND / OR 検索のidを取得する\n let search_condition = $('#search_condition option:selected').val();\n\n // ハッシュタグ収集一覧ページ内に表示する投稿の数を取得する\n let per_page_num = $('#per_page_num option:selected').val();\n\n let url_query_path = `/my_post_list?display_type=${display_type}&initial_date=${initial_date}&end_date=${end_date}&search_condition=${search_condition}&per_page_num=${per_page_num}`;\n\n // undefinedが入ってしまった場合の対処法\n if (url_query_path.includes('undefined')) {\n let today = new Date().toISOString().split('T')[0];\n let display_type = 1;\n let initial_date = '2022-01-01';\n let search_condition = 1;\n let per_page_num = 50;\n\n revised_my_post_url_query_path = `/my_post_list?display_type=${display_type}&initial_date=${initial_date}&end_date=${today}&search_condition=${search_condition}&per_page_num=${per_page_num}`;\n\n location.href = revised_my_post_url_query_path;\n return revised_my_post_url_query_path;\n }\n\n location.href = url_query_path;\n });\n\n // hashtag_list localStorage一覧\n let lstorage_hashtag_list_display_type;\n let lstorage_per_page_num;\n let lstorage_hashtag_initial_date;\n let lstorage_hashtag_end_date;\n let lstorage_hashtag_group;\n let lstorage_search_condition;\n let lstorage_hashtag_list;\n let lstorage_excluded_words_list;\n let lstorage_ugc_urls_list;\n\n // localStorageの中身を取り出す\n if (current_url.includes('/hashtag_list') || current_url.includes('/my_post')) {\n if (window.localStorage) {\n if (localStorage.getItem('hashtag_list_display_type')) {\n lstorage_hashtag_list_display_type = localStorage.getItem('hashtag_list_display_type');\n $(`input.display_type[type=\"radio\"][value=\"${lstorage_hashtag_list_display_type}\"]`).prop('checked', true);\n }\n\n lstorage_per_page_num = localStorage.getItem('per_page_num');\n\n lstorage_hashtag_initial_date = localStorage.getItem('hashtag_initial_date');\n\n if (localStorage.getItem('hashtag_end_date')) {\n lstorage_hashtag_end_date = localStorage.getItem('hashtag_end_date');\n }\n\n lstorage_hashtag_group = localStorage.getItem('hashtag_group');\n\n lstorage_search_condition = localStorage.getItem('search_condition');\n\n lstorage_excluded_words_list = localStorage.getItem('excluded_words_list');\n\n if (lstorage_excluded_words_list) {\n lstorage_excluded_words_list = JSON.parse(lstorage_excluded_words_list);\n lstorage_excluded_words_list = lstorage_excluded_words_list.join('\\n');\n }\n\n // ugc urls をローカルストレージから取得する\n lstorage_ugc_urls_list = localStorage.getItem(`ugc_urls_list`);\n\n if (lstorage_ugc_urls_list) {\n lstorage_ugc_urls_list = JSON.parse(lstorage_ugc_urls_list);\n lstorage_ugc_urls_list = lstorage_ugc_urls_list.join('\\n');\n }\n\n // ハッシュタグリストをローカルストレージから取得する\n lstorage_hashtag_list = localStorage.getItem('hashtag_list');\n\n if (lstorage_hashtag_list) {\n lstorage_hashtag_list = JSON.parse(lstorage_hashtag_list);\n }\n let all_tag_check_box = $('input.tag_info:checkbox');\n\n if (lstorage_hashtag_list && lstorage_hashtag_list.length > 0) {\n $.each(all_tag_check_box, function (index, el) {\n if (lstorage_hashtag_list.includes($(el).val())) {\n el.checked = true;\n }\n });\n } else if (!lstorage_hashtag_list) {\n let tag_info_list = [];\n\n $.each(all_tag_check_box, function (index, el) {\n tag_info_list.push(el.value);\n el.checked = true;\n });\n\n tag_info_list = JSON.stringify(tag_info_list);\n localStorage.setItem('hashtag_list', tag_info_list);\n }\n\n let allChecked = true;\n\n $.each(all_tag_check_box, function (index, el) {\n if (!el.checked) {\n allChecked = false;\n }\n });\n\n $('.toggle_all_tags').prop('checked', allChecked);\n\n // 以前使っていたlocalstorageのデータ項目。本番反映してしばらくは残しておく20240831\n localStorage.removeItem('popular_hashtag_group');\n localStorage.removeItem('recent_hashtag_group');\n localStorage.removeItem('popular_hashtag_initial_date');\n localStorage.removeItem('recent_hashtag_initial_date');\n localStorage.removeItem('popular_hashtag_end_date');\n localStorage.removeItem('recent_hashtag_end_date');\n localStorage.removeItem('popular_hashtag_list');\n localStorage.removeItem('recent_hashtag_list');\n localStorage.removeItem('popular_search_condition');\n localStorage.removeItem('recent_search_condition');\n localStorage.removeItem('popular_per_page_num');\n localStorage.removeItem('recent_per_page_num');\n localStorage.removeItem('popular_excluded_words_list');\n localStorage.removeItem('recent_excluded_words_list');\n localStorage.removeItem('popular_ugc_urls_list');\n localStorage.removeItem('recent_ugc_urls_list');\n }\n }\n\n // localStorageで取り出したものを画面に表示する\n // 投稿収集一覧で最近の投稿の場合 https://dev-manage-ssl.platta.jp/hashtag_list でクエリが何もないものも最近の投稿に含まれる\n if (current_url === url_hashtag_list_pro || current_url === url_hashtag_list_dev || current_url.includes('/hashtag_list?display_type=1')) {\n // 除外するハッシュタグ名をテキストエリアに自動入力する\n $('#excluded_words').text(lstorage_excluded_words_list);\n\n // ugc urlsテキストエリアを自動入力する\n $('#ugc_urls').text(lstorage_ugc_urls_list);\n }\n\n // localStorageで取り出したものを画面に表示する\n // 投稿収集一覧で人気の投稿の場合\n if (current_url.includes('/hashtag_list?display_type=0')) {\n // 除外するハッシュタグ名をテキストエリアに自動入力する\n $('#excluded_words').text(lstorage_excluded_words_list);\n\n // ugc urlsテキストエリアを自動入力する\n $('#ugc_urls').text(lstorage_ugc_urls_list);\n }\n\n // 投稿された期間の始まりをlocalStorageに保存\n $('#hashtag_initial_date').on('change', function () {\n localStorage.setItem('hashtag_initial_date', $('#hashtag_initial_date').val());\n });\n\n // 投稿された期間の終わりをlocalStorageに保存\n $('#hashtag_end_date').on('change', function () {\n localStorage.setItem('hashtag_end_date', $('#hashtag_end_date').val());\n });\n\n // ハッシュタググループをlocalStorageに保存\n $('#selected_hashtag_group').on('change', function () {\n localStorage.setItem('hashtag_group', $('#selected_hashtag_group option:selected').val());\n });\n\n // チェックのついたハッシュタグの一覧をlocalStorageに保存\n $('.tag_info').on('change', function () {\n let tag_info_list = [];\n let allChecked = true;\n \n $.each($('.tag_info:checkbox'), function (idk, tag) {\n if ($(tag).is(':checked')) {\n tag_info_list.push($(tag).val());\n } else {\n allChecked = false;\n }\n });\n\n $('.toggle_all_tags').prop('checked', allChecked);\n\n // 複数のデータ(配列)を保存したいためJSON形式のデータとして保存します。\n tag_info_list = JSON.stringify(tag_info_list);\n localStorage.setItem('hashtag_list', tag_info_list);\n });\n\n // 検索タイプをlocalStorageに保存\n $('#search_condition').on('change', function () {\n localStorage.setItem('search_condition', $('#search_condition option:selected').val());\n });\n\n // ページ内表示件数 localStorageに保存\n $('#per_page_num').on('change', function () {\n localStorage.setItem('per_page_num', $('#per_page_num option:selected').val());\n });\n\n // 除外するハッシュタグ名一覧をlocalStorageに保存\n $('#excluded_words').on('change', function () {\n let excluded_words_list = [];\n let excluded_list = $('#excluded_words').val().split('\\n');\n\n $.each(excluded_list, function (idk, excluded_word) {\n //! NG if (tag.is(\":checked\")) {\n // 下記のように jquery オブジェクトにする必要あり\n if ($('#excluded_words').val() && $('#excluded_words').val()) {\n excluded_words_list.push(excluded_word);\n }\n });\n excluded_words_list = JSON.stringify(excluded_words_list);\n localStorage.setItem('excluded_words_list', excluded_words_list);\n });\n\n // UGCURLをlocalStorageに保存\n $('#ugc_urls').on('change', function () {\n let ugc_urls = $('#ugc_urls').val();\n // 余分な空白等含む可能性あり\n ugc_urls_list = ugc_urls.split('\\n');\n\n // 要素についているかもしれない前後の空白除去及び 'https://~ ' や \"https://~ \"などの ' や \"を削除\"\n ugc_urls_list = $.map(ugc_urls_list, function (url, idx) {\n return url.replace(/'/g, '').replace(/\"/g, '').replace(/,/g, '').trim();\n });\n\n let ugc_urls_list_str = JSON.stringify(ugc_urls_list);\n localStorage.setItem('ugc_urls_list', ugc_urls_list_str);\n });\n\n // 人気の投稿 - クリックしたらページ遷移させる\n // 投稿の表示タイプを変更した場合、すでに切り替わったあとなので 最新の投稿 と 人気の投稿が逆になるので、画面に表示するlocalStorageは最近と人気を逆にしなければならない\n $('.radio-003').on('change', function () {\n // location.hrefが発動するまで切り替えをできないようにする - アプリケーションの負荷を下げるため\n $('.radio-003').css('pointer-events', 'none');\n // 投稿の種類(最近の投稿 or 人気の投稿)を取得する\n let display_type = $('.display_type:checked').val();\n\n // localStorage 投稿の表示タイプを保存\n $('.display_type').each(function () {\n localStorage.setItem('hashtag_list_display_type', display_type);\n });\n\n // 投稿された期間\n lstorage_hashtag_initial_date = localStorage.getItem('hashtag_initial_date');\n\n lstorage_hashtag_end_date = localStorage.getItem('hashtag_end_date');\n\n // ハッシュタググループ\n lstorage_hashtag_group = localStorage.getItem('hashtag_group');\n\n // 検索タイプ\n lstorage_search_condition = localStorage.getItem('search_condition');\n\n // 1ページの表示数\n lstorage_per_page_num = localStorage.getItem('per_page_num');\n\n // 表示する期間\n let initial_date = '';\n let end_date = '';\n let search_condition = '';\n\n if (lstorage_hashtag_group) {\n hashtag_group = lstorage_hashtag_group;\n } else {\n hashtag_group = $('#selected_hashtag_group option:selected').val();\n }\n\n if (lstorage_search_condition) {\n search_condition = lstorage_search_condition;\n } else {\n search_condition = $('#search_condition option:selected').val();\n }\n\n if (lstorage_hashtag_end_date) {\n end_date = lstorage_hashtag_end_date;\n } else {\n end_date = $('#hashtag_end_date').val();\n }\n\n if (lstorage_hashtag_initial_date) {\n initial_date = lstorage_hashtag_initial_date;\n } else {\n initial_date = $('#hashtag_initial_date').val();\n }\n\n if (lstorage_hashtag_end_date) {\n end_date = lstorage_hashtag_end_date;\n } else {\n end_date = $('#hashtag_end_date').val();\n }\n\n if (lstorage_per_page_num) {\n per_page_num = lstorage_per_page_num;\n } else {\n per_page_num = $('#per_page_num option:selected').val();\n }\n\n // タググループのidを取得\n let tgg_id = $('#selected_hashtag_group option:selected').val();\n\n let url_query_path =\n `/hashtag_list?display_type=${display_type}` +\n `&initial_date=${initial_date}` +\n `&end_date=${end_date}` +\n `&tgg_id=${tgg_id}` +\n `&search_condition=${search_condition}` +\n `&per_page_num=${per_page_num}`;\n\n // チェックされたタグを取得\n let selected_tag_ids = [];\n $('.tag_info:checked').each(function () {\n selected_tag_ids.push($(this).val());\n });\n\n selected_tag_ids.forEach(function (tag_id, index) {\n url_query_path = url_query_path + `&tag_id_${index}=${tag_id}`;\n });\n\n location.href = url_query_path;\n });\n\n // タググループに紐付いた全てのタグをチェックする\n $('.toggle_all_tags').on('change', function () {\n // タググループに紐付いた全てのチェックボックスを全て取得\n let all_tag_check_box = $('.tag_info:checkbox');\n let tag_info_list = [];\n\n $.each(all_tag_check_box, function (index, el) {\n if ($('.toggle_all_tags').is(':checked')) {\n tag_info_list.push(el.value);\n el.checked = true;\n } else {\n el.checked = false;\n }\n });\n\n tag_info_list = JSON.stringify(tag_info_list);\n localStorage.setItem('hashtag_list', tag_info_list);\n });\n\n // タググループ選択 ハッシュタググループの情報を取得\n $('#selected_hashtag_group').on('change', function () {\n // 投稿の種類(最近の投稿 or 人気の投稿)を取得する\n let display_type = $('.display_type:checked').val();\n\n // 表示する期間\n let initial_date = $('#hashtag_initial_date').val();\n let end_date = $('#hashtag_end_date').val();\n\n // タググループのidを取得する\n let tgg_id = $('#selected_hashtag_group option:selected').val();\n\n // ハッシュタグリストをリセットする\n localStorage.removeItem('hashtag_list');\n\n // AND / OR 検索のidを取得する\n let search_condition = $('#search_condition option:selected').val();\n\n // ハッシュタグ収集一覧ページ内に表示する投稿の数を取得する\n let per_page_num = $('#per_page_num option:selected').val();\n\n // タググループ切り替え時は全てのタグで検索する(all_tag_check)\n let url_query_path =\n `/hashtag_list?display_type=${display_type}` +\n `&initial_date=${initial_date}` +\n `&end_date=${end_date}` +\n `&tgg_id=${tgg_id}` +\n `&search_condition=${search_condition}` +\n `&per_page_num=${per_page_num}` +\n `&all_tag_check=1`;\n\n location.href = url_query_path;\n });\n\n // 現在選ばれている絞り込みの状態を取得\n const get_all_filter_condition = function () {\n // 投稿の種類(最近の投稿 or 人気の投稿)を取得する\n let display_type = $('.display_type:checked').val();\n\n // 表示する期間\n let initial_date = $('#hashtag_initial_date').val();\n let end_date = $('#hashtag_end_date').val();\n\n // タググループのidとnameを取得する\n let tgg_id = $('#selected_hashtag_group option:selected').val();\n\n let selected_tag_ids = [];\n let selected_tag_names = [];\n\n // ハッシュタグのidを取得する\n $('.tag_info:checked').each(function () {\n selected_tag_ids.push($(this).val());\n });\n\n let tag_names = '';\n let tag_ids = '';\n let excluded_words_str = '';\n\n\n $.each(selected_tag_ids, function (index, tag_id) {\n tag_ids += `tag_id_${index}=${tag_id}&`;\n });\n tag_ids = tag_ids.slice(0, -1);\n\n // Not条件で検索結果家から除外するハッシュタグや言葉を取得\n excluded_words = $('#excluded_words').val().trim();\n\n // * 改行コードを含んだ文字列を配列にする\n let excluded_word_list = excluded_words.split(/\\r\\n|\\r|\\n/);\n\n // 配列の中の空要素を削除し、空要素のない配列を作る\n excluded_word_list = $.grep(excluded_word_list, function (value) {\n return value != '';\n });\n\n $.each(excluded_word_list, function (index, excluded_word) {\n excluded_words_str += `excluded_word_${index}=${excluded_word}&`;\n });\n excluded_words_str = excluded_words_str.slice(0, -1);\n\n // AND / OR 検索のidを取得する\n let search_condition = $('#search_condition option:selected').val();\n\n // ハッシュタグ収集一覧ページ内に表示する投稿の数を取得する\n let per_page_num = $('#per_page_num option:selected').val();\n\n result = {\n display_type: display_type,\n initial_date: initial_date,\n end_date: end_date,\n tgg_id: tgg_id,\n tag_ids: tag_ids,\n excluded_words: excluded_words_str,\n search_condition: search_condition,\n per_page_num: per_page_num,\n };\n\n return result;\n };\n\n // ボタンを押下したタイミングで複数の選択されたタグ名及び検索タイプを配列で取得する\n $('#submit, #own_submit').on('click', function (e) {\n $(this).addClass('pointer-events-none');\n let ugc_urls = $('#ugc_urls').val();\n // 余分な空白等含む可能性あり\n ugc_urls_list = ugc_urls.split('\\n');\n\n // 要素についているかもしれない前後の空白除去及び 'https://~ ' や \"https://~ \"などの ' や \"を削除\"\n ugc_urls_list = $.map(ugc_urls_list, function (url, idx) {\n return url.replace(/'/g, '').replace(/\"/g, '').replace(/,/g, '').trim();\n });\n\n ugc_urls_list_str = JSON.stringify(ugc_urls_list);\n localStorage.setItem('ugc_urls_list', ugc_urls_list_str);\n\n $.ajax({\n url: DOMAIN + '/filter_hashtag_ugc',\n type: 'GET',\n dataType: 'json',\n data: {\n ugc_urls_list: localStorage.getItem('ugc_urls_list'),\n },\n })\n .done(function (data_fr_ruby) {\n const filter_condition = get_all_filter_condition();\n\n let switch_url;\n if (current_url.includes('/hashtag_list')) {\n switch_url = '/hashtag_list';\n } else if (current_url.includes('/my_post_list')) {\n switch_url = '/my_post_list';\n } else if (current_url.includes('/all_post_type_display')) {\n switch_url = '/all_post_type_display';\n }\n\n url_query_path =\n `${switch_url}?display_type=${filter_condition['display_type']}` +\n `&initial_date=${filter_condition['initial_date']}` +\n `&end_date=${filter_condition['end_date']}` +\n `&tgg_id=${filter_condition['tgg_id']}` +\n `&${filter_condition['tag_names']}` +\n `&${filter_condition['tag_ids']}` +\n `&caption=${$(\"#search_caption\").val()}` +\n `&product_name=${$(\"#search_product\").val()}` +\n `&ugc_group=${$(\"#search_ugc_group\").val()}` +\n `&search_condition=${filter_condition['search_condition']}` +\n `&${filter_condition['excluded_words']}` +\n `&per_page_num=${filter_condition['per_page_num']}` +\n `&ugc_check=1`;\n\n lstorage_ugc_urls_list = localStorage.getItem('ugc_urls_list');\n\n if (lstorage_ugc_urls_list) {\n lstorage_ugc_urls_list = JSON.parse(lstorage_ugc_urls_list);\n lstorage_ugc_urls_list = lstorage_ugc_urls_list.join('\\n');\n }\n\n location.href = url_query_path;\n })\n .fail(function (jqXHR, textStatus, errorThrown) {});\n\n // ugc検索をする場合はreturnし、あとの処理を走らせない\n if (ugc_urls_list.length > 0) {\n return;\n }\n\n // 投稿の種類(最近の投稿 or 人気の投稿)を取得する\n let display_type = $('.display_type:checked').val();\n\n // 表示する期間\n let initial_date = $('#hashtag_initial_date').val();\n let end_date = $('#hashtag_end_date').val();\n\n // タググループのidを取得する\n let tgg_id = $('#selected_hashtag_group option:selected').val();\n\n // AND / OR 検索のidを取得する\n let search_condition = $('#search_condition option:selected').val();\n\n // ハッシュタグ収集一覧ページ内に表示する投稿の数を取得する\n let per_page_num = $('#per_page_num option:selected').val();\n\n // ハッシュタグのidと名前を取得する\n $('.tag_info:checked').each(function () {\n selected_tag_ids.push($(this).val());\n selected_tag_names.push($(this).data('name'));\n });\n\n // Not条件で検索結果家から除外するハッシュタグや言葉を取得\n let excluded_words = $('#excluded_words').val().trim();\n\n // * 改行コードを含んだ文字列を配列にする\n let excluded_word_list = excluded_words.split(/\\r\\n|\\r|\\n/);\n\n // 配列の中の空要素を削除し、空要素のない配列を作る\n excluded_word_list = $.grep(excluded_word_list, function (value) {\n return value != '';\n });\n if (current_url.includes('/my_post_list?')) {\n let url_query_path = `/my_post_list?display_type=${display_type}&initial_date=${initial_date}&end_date=${end_date}&search_condition=${search_condition}&per_page_num=${per_page_num}`;\n if (excluded_word_list) {\n excluded_word_list.forEach(function (excluded_word, index) {\n url_query_path = url_query_path + `&excluded_word_${index}=${excluded_word}`;\n });\n }\n\n location.href = url_query_path;\n } else if (current_url.includes('/hashtag_list')) {\n // 投稿収集一覧用\n let url_query_path = \n `/hashtag_list?display_type=${display_type}` +\n `&initial_date=${initial_date}` +\n `&end_date=${end_date}` +\n `&tgg_id=${tgg_id}` +\n `&search_condition=${search_condition}` +\n `&caption=${$(\"#search_caption\").val()}` +\n `&product_name=${$(\"#search_product\").val()}` +\n `&ugc_group=${$(\"#search_ugc_group\").val()}` +\n `&per_page_num=${per_page_num}`;\n\n selected_tag_ids.forEach(function (tag_id, index) {\n url_query_path = url_query_path + `&tag_id_${index}=${tag_id}`;\n });\n\n if (excluded_word_list) {\n excluded_word_list.forEach(function (excluded_word, index) {\n url_query_path = url_query_path + `&excluded_word_${index}=${excluded_word}`;\n });\n }\n location.href = url_query_path;\n }\n });\n\n //############################################################\n // MY投稿一覧 - 自社の投稿一覧を取得する\n //############################################################\n $('#get_my_sns_posts, #get_my_sns_posts_50').on('click', function () {\n let loader = $('.get_posts_loader-wrap');\n let current_url = window.location.href;\n let my_post_ger_restriction_hour = 4;\n\n // Get the ID of the clicked element\n let clickedElementId = $(this).attr('id');\n\n const confirm_yes = window.confirm(`実行すると本機能は${my_post_ger_restriction_hour}時間使用できなくなります。実行しますか ? \\n\\nTip: 毎日深夜に直近の貴社の投稿が50件取り込まれ、自動で本画面に反映されます。 `);\n\n if (confirm_yes) {\n loader.css('display', 'block');\n $('#get_my_sns_posts').css('pointer-events', 'none');\n\n alert('自社の投稿データの取得を開始します。\\n自社の投稿が取り切れていなかった場合はお手数ですが、再度時間を置いてから「自社投稿データを取得」ボタンをクリックするようお願いいたします。');\n\n $.ajax({\n url: DOMAIN + '/get_my_posts',\n type: 'POST',\n data: {\n current_date_time: 'current_date_time',\n clickedElementId: clickedElementId,\n },\n dataType: 'json',\n })\n .done(function (data) {\n alert('取り込みが完了しました!!');\n loader.fadeOut();\n location.href = current_url;\n })\n // ! 自社投稿を取得するために必要な許可がない場合に起こるエラーをrails側からキャッチし\n // ! alertとして可視化している\n .fail(function (jqXHR, textStatus, errorThrown) {\n let errorResponse = JSON.parse(jqXHR.responseText);\n\n // 青木 ★要更新 - 20240404\n if (errorResponse.error.includes('Unsupported get request.')) {\n alert(errorResponse.error);\n }\n // ! # * エラーメッセージ全文: \"message\": \"Unsupported get request. Object with ID 'media' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api\"\n\n // 自社の投稿一覧で自社メディアをDBに保存処理中にalert(ERROR_MSG);が出ることがあるため alert()は出さないようにし、「自社投稿データを取得」ボタンクリック時にalert()を出すようにしている\n $('#get_my_sns_posts').css('pointer-events', 'auto');\n // alert('取り込みが中断されました(中断されるまでのデータは反映されております)。恐れ入りますが、再度時間を置いてからお試しください。');\n\n // console.log('jqXHR: ', jqXHR);\n // console.log('textStatus: ', textStatus);\n // console.log('errorThrown: ', errorThrown);\n\n location.reload();\n });\n }\n });\n\n //############################################################\n // ハッシュタグの収集 platta社員のみ - ハッシュタグの投稿を取得する\n //############################################################\n\n let currentTime = new Date().getTime();\n let recentButtonClickedTime = localStorage.getItem('recentButtonClickedTime');\n\n if (recentButtonClickedTime === null || currentTime - recentButtonClickedTime >= 3600000) {\n $('#platta_get_hashtag_posts_recent').css('pointer-events', 'auto');\n } else {\n $('#platta_get_hashtag_posts_recent').css('background', 'gray');\n $('#platta_get_hashtag_posts_recent').css('pointer-events', 'none');\n }\n\n let popularButtonClickedTime = localStorage.getItem('popularButtonClickedTime');\n\n if (popularButtonClickedTime === null || currentTime - popularButtonClickedTime >= 3600000) {\n $('#platta_get_hashtag_posts_top').css('pointer-events', 'auto');\n } else {\n $('#platta_get_hashtag_posts_top').css('background', 'gray');\n $('#platta_get_hashtag_posts_top').css('pointer-events', 'none');\n }\n\n const get_hashtag_related_posts = function (ajax_url_path, media_type) {\n let loader = $('.get_posts_loader-wrap');\n let current_url = window.location.href;\n\n const confirm_yes = window.confirm(`ハッシュタグの登録件数及び1週間の利用制限があるため、不要なタグは削除してから実行をお願い致します。 \\n\\n本プログラムは現在登録されているハッシュタグの最近の投稿及び人気の投稿を取得します。5~20分後、ハッシュタグが収集されているかご確認お願い致します。\\n\\n本ダイアログを閉じた後、取得は継続されるので別のページに移動しても問題ございません。`);\n\n if (confirm_yes) {\n let currentTime = new Date().getTime();\n\n if (media_type == '最近の投稿') {\n localStorage.setItem('recentButtonClickedTime', currentTime);\n\n $('#platta_get_hashtag_posts_recent').css('pointer-events', 'none');\n $('#platta_get_hashtag_posts_recent').css('background', 'gray');\n $('#platta_get_hashtag_posts_recent').text('最近の投稿: 1時間後に制限が解除されます。その後に再度お試しください。');\n }\n\n if (media_type == '人気の投稿') {\n localStorage.setItem('popularButtonClickedTime', currentTime);\n\n $('#platta_get_hashtag_posts_top').css('pointer-events', 'none');\n $('#platta_get_hashtag_posts_top').css('background', 'gray');\n $('#platta_get_hashtag_posts_top').text('人気の投稿: 1時間後に制限が解除されます。その後に再度お試しください。');\n }\n\n $.ajax({\n url: DOMAIN + ajax_url_path,\n type: 'POST',\n data: {\n yes: 'yes',\n },\n dataType: 'json',\n })\n .done(function (data) {\n alert(`${media_type}の取り込みが完了しました!!`);\n loader.fadeOut();\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n $('#get_my_sns_posts').css('pointer-events', 'auto');\n });\n }\n };\n\n // 最近の投稿を手動で取得する\n $('#platta_get_hashtag_posts_recent').on('click', function () {\n get_hashtag_related_posts('/get_hashtag_posts_recent', '最近の投稿');\n });\n\n // 人気の投稿を手動で取得する\n $('#platta_get_hashtag_posts_top').on('click', function () {\n get_hashtag_related_posts('/get_hashtag_posts_top', '人気の投稿');\n });\n\n // app review用 レビューの必要がなくなり次第削除\n $('#app_review_test_login').on('click', function () {\n $('a[href=\"/app_review_test_login\"]').css('pointer-events', 'none');\n });\n\n //############################################################\n // AppReview用 - コメント機能 -\n //############################################################\n $('.t-send_comment').on('click', function () {\n $('.t-send_comment').css('pointer-events', 'none');\n\n $.ajax({\n url: DOMAIN + '/send_comment',\n type: 'POST',\n data: {\n comment: $('.post_card_content__comment').val(),\n },\n dataType: 'json',\n })\n .done(function (data) {\n alert('コメントを送信しました。');\n $('.post_card_content__comment').val('');\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n alert(`コメントの送信が失敗しました。再度お試しください。${errorThrown}`);\n $('#get_my_sns_posts').css('pointer-events', 'auto');\n });\n });\n\n // ###################################################\n // google review クチコミ\n // ###################################################\n $('#ggl_review__issue_token').on('click', function () {\n $.ajax({\n type: 'POST',\n url: DOMAIN + '/get_google_review_access_token',\n data: 'data',\n dataType: 'json',\n success: function (data) {\n alert('Success');\n },\n error: function (jqXHR, textStatus, errorThrown) {},\n });\n });\n\n // ###################################################\n // MY投稿一覧に移動したときにローカルストレージの保存内容を画面上に反映させる\n // ###################################################\n\n // MY投稿一覧に移動したときに自動でローカルストレージの内容を反映する\n if (current_url.includes('/my_post_list')) {\n lstorage_ugc_urls_list = localStorage.getItem('ugc_urls_list');\n\n if (lstorage_ugc_urls_list) {\n lstorage_ugc_urls_list = JSON.parse(lstorage_ugc_urls_list);\n lstorage_ugc_urls_list = lstorage_ugc_urls_list.join('\\n');\n\n // 除外するハッシュタグ名をテキストエリアに自動入力する\n $('#excluded_words').text(lstorage_excluded_words_list);\n\n // ugc urlsテキストエリアを自動入力する\n $('#ugc_urls').text(lstorage_ugc_urls_list);\n }\n }\n if (current_url.includes('/to_communication_management?')) {\n $('.to_my_post_list').css('pointer-events', 'none');\n }\n\n // ハッシュタグ収集一覧画面のカレンダーにて今日の日付しか入力できないようにする\n if ($('#cmm_main_initial_date')) {\n let today = new Date().toISOString().split('T')[0];\n // $('input[type=\"date\"]').attr('max', today);\n }\n\n let lstorage_cmm_sub_ugc_urls_list;\n\n // localStorageにアイテムが存在した場合、デフォルトのテキストを書き換える処理\n const get_local_storage_item_overwrite_value = function (id_name) {\n if (localStorage.getItem(id_name)) {\n $(`#${id_name}`).val(localStorage.getItem(id_name));\n return localStorage.getItem(id_name);\n } else {\n return undefined;\n }\n };\n\n // localStorageにアイテムが存在した場合、チェックをつける処理\n const get_local_storage_item_checked = function (id_name) {\n if (localStorage.getItem(id_name)) {\n $(`#${id_name}`).prop('checked', true);\n return localStorage.getItem(id_name);\n } else {\n return undefined;\n }\n };\n\n // localStorageにアイテムが存在した場合、optonタグにselected をつける処理\n const get_local_storage_item_selected = function (id_name) {\n const selectedValue = localStorage.getItem(id_name);\n if (selectedValue) {\n $(`#${id_name} option[value=\"${selectedValue}\"]`).prop('selected', true);\n return selectedValue;\n } else {\n return undefined;\n }\n };\n\n $(function () {\n $('.to_communication_management').on('click', function (event) {\n $('.to_communication_management').css('pointer-events', 'none');\n event.preventDefault();\n\n // localStorageでメディアタイプの初期チェック状態を管理する\n let cmm_main_media_type_pic = get_local_storage_item_checked('cmm_main_media_type_pic');\n let cmm_main_media_type_carousel = get_local_storage_item_checked('cmm_main_media_type_carousel');\n let cmm_main_media_type_video = get_local_storage_item_checked('cmm_main_media_type_video');\n\n // localStorageでステータスの初期チェック状態を管理する\n let cmm_main_status_need_confirm = get_local_storage_item_checked('cmm_main_status_need_confirm');\n let cmm_main_status_ok_ugc = get_local_storage_item_checked('cmm_main_status_ok_ugc');\n let cmm_main_status_ng_ugc = get_local_storage_item_checked('cmm_main_status_ng_ugc');\n let cmm_main_status_done_ugc = get_local_storage_item_checked('cmm_main_status_done_ugc');\n // ugc連携を解除した状態\n let cmm_main_status_cancel_ugc = get_local_storage_item_checked('cmm_main_status_cancel_ugc');\n\n // 御礼送信済みの状態\n let cmm_main_status_thanked_ugc = get_local_storage_item_checked('cmm_main_status_thanked_ugc');\n\n // localStorageでinput要素のテキスト状態を管理する\n let cmm_main_username = get_local_storage_item_overwrite_value('cmm_main_username');\n let cmm_main_comment_keyword = get_local_storage_item_overwrite_value('cmm_main_comment_keyword');\n let cmm_main_initial_date = get_local_storage_item_overwrite_value('cmm_main_initial_date');\n let cmm_main_end_date = get_local_storage_item_overwrite_value('cmm_main_end_date');\n let cmm_main_per_page_num = get_local_storage_item_overwrite_value('cmm_main_per_page_num');\n\n // 初期値を設定 = 最新の返信順\n let cmm_main_display_order = get_local_storage_item_selected('cmm_main_display_order') || 'latest_replied_order';\n\n let cmm_main_ugc_urls_list = [];\n let cmm_sub_ugc_urls_list = [];\n\n // ugc_urlsをUGC検索欄にローカルストレージから自動で反映させる処理\n if (localStorage.getItem('cmm_main_ugc_urls_list')) {\n lstorage_cmm_main_ugc_urls_list = localStorage.getItem('cmm_main_ugc_urls_list');\n lstorage_cmm_main_ugc_urls_list = JSON.parse(lstorage_cmm_main_ugc_urls_list);\n cmm_main_ugc_urls_list = lstorage_cmm_main_ugc_urls_list;\n lstorage_cmm_main_ugc_urls_list_str = lstorage_cmm_main_ugc_urls_list.join('\\n');\n $('#cmm_main_ugc_urls').text(lstorage_cmm_main_ugc_urls_list_str);\n }\n\n // localStorageでメディアタイプの初期チェック状態を管理する\n let cmm_sub_media_type_pic = get_local_storage_item_checked('cmm_sub_media_type_pic');\n let cmm_sub_media_type_carousel = get_local_storage_item_checked('cmm_sub_media_type_carousel');\n let cmm_sub_media_type_video = get_local_storage_item_checked('cmm_sub_media_type_video');\n\n // localStorageでステータスの初期チェック状態を管理する\n let cmm_sub_status_waiting_reply = get_local_storage_item_checked('cmm_sub_status_waiting_reply');\n let cmm_sub_status_waiting_seven_days = get_local_storage_item_checked('cmm_sub_status_waiting_seven_days');\n\n // localStorageでinput要素のテキスト状態を管理する\n // get_local_storage_item_overwrite_value('cmm_sub_username'); なし\n let cmm_sub_comment_keyword = get_local_storage_item_overwrite_value('cmm_sub_comment_keyword');\n let cmm_sub_initial_date = get_local_storage_item_overwrite_value('cmm_sub_initial_date');\n let cmm_sub_end_date = get_local_storage_item_overwrite_value('cmm_sub_end_date');\n let cmm_sub_per_page_num = get_local_storage_item_overwrite_value('cmm_sub_per_page_num');\n\n // 初期値を設定 = 最新の返信順\n let cmm_sub_display_order = get_local_storage_item_selected('cmm_sub_display_order') || 'latest_replied_order';\n\n // ugc_urlsをUGC検索欄にローカルストレージから自動で反映させる処理\n if (localStorage.getItem('cmm_sub_ugc_urls_list')) {\n lstorage_cmm_sub_ugc_urls_list = localStorage.getItem('cmm_sub_ugc_urls_list');\n lstorage_cmm_sub_ugc_urls_list = JSON.parse(lstorage_cmm_sub_ugc_urls_list);\n cmm_sub_ugc_urls_list = lstorage_cmm_sub_ugc_urls_list;\n lstorage_cmm_sub_ugc_urls_list_str = lstorage_cmm_sub_ugc_urls_list.join('\\n');\n $('#cmm_sub_ugc_urls').text(lstorage_cmm_sub_ugc_urls_list_str);\n }\n\n let variable_list = [cmm_main_initial_date, cmm_main_end_date, cmm_main_media_type_pic, cmm_main_media_type_carousel, cmm_main_media_type_video, cmm_main_status_need_confirm, cmm_main_status_ok_ugc, cmm_main_status_ng_ugc, cmm_main_status_done_ugc, cmm_main_status_cancel_ugc, cmm_main_username, cmm_main_comment_keyword, cmm_main_per_page_num, cmm_sub_initial_date, cmm_sub_end_date, cmm_sub_status_waiting_reply, cmm_sub_status_waiting_seven_days, cmm_sub_media_type_pic, cmm_sub_media_type_carousel, cmm_sub_media_type_video, cmm_sub_comment_keyword, cmm_sub_per_page_num];\n\n // 一つでも undefinedがあればtrueを返す\n let isAnyUndefined = variable_list.some((v) => typeof v === 'undefined');\n\n let cmm_url_path;\n\n // #############################################################\n // 絞り込み条件を一つも入れていない状態(localStorageに何も保存されていなかった場合)、全てのチェックがついた状態で検索結果を表示させる\n // #############################################################\n\n // 全てが undefinedがあればtrueを返す\n // let isAllUndefined = variable_list.every((v) => typeof v === 'undefined');\n\n if (isAnyUndefined == true) {\n let today = new Date().toISOString().split('T')[0];\n let cmm_main_initial_date = cmm_main_initial_date ? cmm_main_initial_date : '2021-01-01';\n let cmm_sub_initial_date = cmm_sub_initial_date ? cmm_sub_initial_date : '2021-01-01';\n let cmm_main_end_date = cmm_main_end_date ? cmm_main_end_date : today;\n let cmm_sub_end_date = cmm_sub_end_date ? cmm_sub_end_date : today;\n let cmm_main_per_page_num = cmm_main_per_page_num ? cmm_main_per_page_num : '2021-01-01';\n let cmm_sub_per_page_num = cmm_sub_per_page_num ? cmm_sub_per_page_num : '2021-01-01';\n let media_type = 'exist';\n let status_type = 'exist';\n let input_value_empty = '';\n\n // alert('true...1');\n\n // -main-sub\n cmm_url_path = `/communication_management?&cmm_main_initial_date=${cmm_main_initial_date}&cmm_main_end_date=${cmm_main_end_date}&cmm_main_media_type_pic=${media_type}&cmm_main_media_type_carousel=${media_type}&cmm_main_media_type_video=${media_type}&cmm_main_status_need_confirm=${status_type}&cmm_main_status_ok_ugc=${status_type}&cmm_main_status_ng_ugc=${status_type}&cmm_main_status_done_ugc=${status_type}&cmm_main_status_cancel_ugc=${cmm_main_status_cancel_ugc}&cmm_main_status_thanked_ugc=${cmm_main_status_thanked_ugc}&cmm_main_username=${input_value_empty}&cmm_main_comment_keyword=${input_value_empty}&cmm_main_per_page_num=${cmm_main_per_page_num}&cmm_main_display_order=${cmm_main_display_order}&cmm_sub_initial_date=${cmm_sub_initial_date}&cmm_sub_end_date=${cmm_sub_end_date}&cmm_sub_status_waiting_reply=${status_type}&cmm_sub_status_waiting_seven_days=${status_type}&cmm_sub_media_type_pic=${media_type}&cmm_sub_media_type_carousel=${media_type}&cmm_sub_media_type_video=${media_type}&cmm_sub_comment_keyword=${input_value_empty}&cmm_sub_per_page_num=${cmm_sub_per_page_num}&cmm_sub_display_order=${cmm_sub_display_order}&initial_state=1`;\n // } else if (isAnyUndefined != true) {\n } else if (isAnyUndefined == false) {\n // alert('true...2');\n\n cmm_url_path = `/communication_management?&cmm_main_initial_date=${cmm_main_initial_date}&cmm_main_end_date=${cmm_main_end_date}&cmm_main_media_type_pic=${cmm_main_media_type_pic}&cmm_main_media_type_carousel=${cmm_main_media_type_carousel}&cmm_main_media_type_video=${cmm_main_media_type_video}&cmm_main_status_need_confirm=${cmm_main_status_need_confirm}&cmm_main_status_ok_ugc=${cmm_main_status_ok_ugc}&cmm_main_status_ng_ugc=${cmm_main_status_ng_ugc}&cmm_main_status_done_ugc=${cmm_main_status_done_ugc}&cmm_main_status_cancel_ugc=${cmm_main_status_cancel_ugc}&cmm_main_status_thanked_ugc=${cmm_main_status_thanked_ugc}&cmm_main_username=${cmm_main_username}&cmm_main_comment_keyword=${cmm_main_comment_keyword}&cmm_main_per_page_num=${cmm_main_per_page_num}&cmm_main_display_order=${cmm_main_display_order}&cmm_sub_initial_date=${cmm_sub_initial_date}&cmm_sub_end_date=${cmm_sub_end_date}&cmm_sub_status_waiting_reply=${cmm_sub_status_waiting_reply}&cmm_sub_status_waiting_seven_days=${cmm_sub_status_waiting_seven_days}&cmm_sub_media_type_pic=${cmm_sub_media_type_pic}&cmm_sub_media_type_carousel=${cmm_sub_media_type_carousel}&cmm_sub_media_type_video=${cmm_sub_media_type_video}&cmm_sub_comment_keyword=${cmm_sub_comment_keyword}&cmm_sub_per_page_num=${cmm_sub_per_page_num}&cmm_sub_display_order=${cmm_sub_display_order}&stop=1`;\n } else {\n // alert('true...3');\n\n let today = new Date().toISOString().split('T')[0];\n let cmm_main_initial_date = cmm_main_initial_date ? cmm_main_initial_date : '2022-01-01';\n let cmm_sub_initial_date = cmm_sub_initial_date ? cmm_sub_initial_date : '2022-01-01';\n let cmm_main_end_date = cmm_main_end_date ? cmm_main_end_date : today;\n let cmm_sub_end_date = cmm_sub_end_date ? cmm_sub_end_date : today;\n let cmm_main_per_page_num = cmm_main_per_page_num ? cmm_main_per_page_num : '2022-01-01';\n let cmm_sub_per_page_num = cmm_sub_per_page_num ? cmm_sub_per_page_num : '2022-01-01';\n let media_type = 'exist';\n let status_type = 'exist';\n let input_value_empty = '';\n\n cmm_url_path = `/communication_management?&cmm_main_initial_date=${cmm_main_initial_date}&cmm_main_end_date=${cmm_main_end_date}&cmm_main_media_type_pic=${media_type}&cmm_main_media_type_carousel=${media_type}&cmm_main_media_type_video=${media_type}&cmm_main_status_need_confirm=${status_type}&cmm_main_status_ok_ugc=${status_type}&cmm_main_status_ng_ugc=${status_type}&cmm_main_status_done_ugc=${status_type}&cmm_main_status_cancel_ugc=${cmm_main_status_cancel_ugc}&cmm_main_username=${input_value_empty}&cmm_main_comment_keyword=${input_value_empty}&cmm_main_per_page_num=${cmm_main_per_page_num}&cmm_sub_initial_date=${cmm_sub_initial_date}&cmm_sub_end_date=${cmm_sub_end_date}&cmm_sub_status_waiting_reply=${status_type}&cmm_sub_status_waiting_seven_days=${status_type}&cmm_sub_media_type_pic=${media_type}&cmm_sub_media_type_carousel=${media_type}&cmm_sub_media_type_video=${media_type}&cmm_sub_comment_keyword=${input_value_empty}&cmm_sub_per_page_num=${cmm_sub_per_page_num}&cmm_main_display_order=${cmm_main_display_order}&stop=1`;\n }\n\n location.href = cmm_url_path;\n });\n });\n\n // コミュニケーション管理でローカルストレージに何も情報がなかった場合、はじめから絞り込みのチェックを全て入れておく処理\n if (current_url.includes('initial_state=1')) {\n $('.cmm_main__filter input').prop('checked', true);\n $('.cmm_sub__filter input').prop('checked', true);\n }\n});\n\n// ハッシュタグ一覧 投稿された期間のデフォルト値設定\nfunction getDefaultHashtagDates() {\n const hashtagInitialDate = \"2021-01-01\" // 昔のデータも参照したい場合が多いため\n\n const todayEndOfDay = new Date();\n todayEndOfDay.setHours(23, 59, 59, 999); // 23:59:59.999に設定\n\n // 日付をYYYY-MM-DD形式の文字列にフォーマット\n const hashtagEndDate = todayEndOfDay.toISOString().split('T')[0];\n\n return { hashtagInitialDate, hashtagEndDate };\n}\n","document.addEventListener('turbolinks:load', function () {\n // 開発環境での開発スピードを上げるため青木の開発環境でのみ\n // manage/app/javascript/packs内の本jsファイルを走らせない\n if ((location.href.includes('dev-manage-ssl.platta.jp') || location.href.includes('http://18.177.103.115:3004')) && !location.href.includes('?dev27aoki')) {\n console.log('dev環境 public.jsを使用');\n return;\n }\n\n const ERROR_MSG = 'エラー! 処理を完了できませんでした\\n時間おいて再度実行しても、このエラーが修正されない場合は\\nお手数ですがサポートチームにお問い合わせください';\n const MAIL_PATTERN = /^[a-zA-Z0-9_+-]+(.[a-zA-Z0-9_+-]+)*@([a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]*\\.)+[a-zA-Z]{2,}$/;\n const PASSWORD_PATTERN = /([0-9].*[a-zA-Z]|[a-zA-Z].*[0-9])/;\n\n const DOMAIN = $('#pl_domain').val();\n\n let current_url = location.href;\n\n //############################################################\n // タブの切替\n //############################################################\n $(function () {\n $('.hash_tag_communication__tab').on('click', function () {\n $('.hash_tag_communication__tab, .hash_tag_communication__panel').removeClass('active');\n\n $(this).addClass('active');\n\n let index = $('.hash_tag_communication__tab').index(this);\n $('.hash_tag_communication__panel').eq(index).addClass('active');\n });\n });\n\n //############################################################\n // テキストをクリップボードにコピーする\n //############################################################\n $(function () {\n $('.hashtag_list_permission__copy').on('click', function () {\n $(this).find('.span_copy').text('Copied');\n // const copied_text = $(this).next().text();\n // text()ではなく、val()で現在のテキストを取得できる\n const copied_text = $(this).next().val();\n setTimeout(() => {\n $(this).find('.span_copy').text('Copy');\n }, 2000);\n\n // クリップボードにコピー\n navigator.clipboard.writeText(copied_text);\n });\n });\n\n //############################################################\n // localStorage - フリーコメントを保存する\n //############################################################\n $(function () {\n // フリーコメント一覧\n let lstorage_free_comment_one;\n let lstorage_free_comment_two;\n\n if (localStorage) {\n if (localStorage.getItem('free_comment_one')) {\n lstorage_free_comment_one = localStorage.getItem('free_comment_one');\n $(`#free_comment_1`).text(lstorage_free_comment_one);\n }\n\n if (localStorage.getItem('free_comment_two')) {\n lstorage_free_comment_two = localStorage.getItem('free_comment_two');\n $(`#free_comment_2`).text(lstorage_free_comment_two);\n }\n\n // 配列をローカルストレージから取得する\n // lstorage_hashtag_list = localStorage.getItem(\n // `${current_display_type}_hashtag_list`\n // );\n } // end of if (localStorage) {\n\n $('.hashtag_list_permission__save').on('click', function () {\n const this_el = $(this);\n this_el.find('.span_free_comment_save').text('保存しました。');\n // const saved_text = this_el.next().text();\n // text()ではなく、val()で現在のテキストを取得できる\n const saved_text = this_el.parent().find('textarea').val();\n if (this_el.attr('id') == 'save_free_comment_one') {\n localStorage.setItem('free_comment_one', saved_text);\n } else if (this_el.attr('id') == 'save_free_comment_two') {\n localStorage.setItem('free_comment_two', saved_text);\n }\n\n setTimeout(() => {\n this_el.find('.span_free_comment_save').text('コメントを保存');\n }, 2000);\n });\n });\n\n //############################################################\n // ファイルをダウンロードしたときのファイル名に現在時刻を拡張子の前につける\n //############################################################\n const time_now_as_YYYYMMDDHHMMSS = function () {\n let date = new Date();\n let year = date.getFullYear();\n let month = ('0' + (date.getMonth() + 1)).slice(-2); // Months are 0-based in JavaScript\n let day = ('0' + date.getDate()).slice(-2);\n let hours = ('0' + date.getHours()).slice(-2);\n let minutes = ('0' + date.getMinutes()).slice(-2);\n let seconds = ('0' + date.getSeconds()).slice(-2);\n\n let time_now = year + month + day + hours + minutes + seconds;\n\n return time_now;\n };\n\n // # 特定の要素のテキストを一括で変更する カルーセル用\n const change_btn_text = function (btn_element, text) {\n $.each(btn_element, function (indexInArray, button) {\n $(button).text(text);\n });\n };\n\n // 御礼を送信しましたボタンクリック時にラベルの状態を変更 + dbの許可申請状況を更新する処理\n const done_thanks_message = function (permission_state_id, sns_post_id, parent_media_id = '') {\n // すでに御礼を送信済だった場合はあとの処理を走らせない\n if (permission_state_id == 8) {\n $('.hashtag_list_thanks__done_button').css({ 'pointer-events': 'none', background: 'gray' });\n $('.hashtag_list_thanks__done_button').css('pointer-events', 'none');\n $('.hashtag_list_thanks__done_button').text('御礼送信済み');\n return;\n } else {\n permission_state_id = 8;\n $('.hashtag_list_thanks__done_button').css({ 'pointer-events': 'none', background: 'orange' });\n $('.hashtag_list_thanks__done_button').css('pointer-events', 'auto');\n $('.hashtag_list_thanks__done_button').text('御礼を送信しました');\n }\n\n // return;\n // 別のタブ内の同じボタンにも同じイベントを設定し、全てのボタンの状態を同じにする\n $('.hashtag_list_thanks__done_button').each(function (hp_index, element) {\n $(element).off('click');\n $(element).on('click', function (event) {\n event.stopPropagation();\n\n $.ajax({\n type: 'POST',\n url: DOMAIN + '/change_permission_state',\n data: {\n permission_state_id: permission_state_id,\n sns_post_id: sns_post_id,\n sns_post_parent_media_id: parent_media_id,\n },\n dataType: 'json',\n success: function (ugc_permission) {\n $(element).text('ラベルを御礼済みに変更しました');\n $(element).css({ background: 'darkblue' });\n }, // Added comma here\n error: function (jqXHR, textStatus, errorThrown) {\n alert('予期しないエラーが発生いたしました。再度ページを読み込んでください。');\n },\n complete: function () {\n setTimeout(() => {\n location.reload();\n }, 1000);\n },\n }); // end of ajax\n }); // end of element.addEventListener(\"click\", function (event) {\n }); // end of $(\".hashtag_list_permission__done_button\").each(function (\n };\n\n // ¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ モーダル ¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥\n $(function () {\n $('.ugc_permission_btn')\n .off()\n .on('click', function (e) {\n $('body').css({ overflow: 'hidden' });\n let permission_state_btn = $(this);\n let sns_post_id = permission_state_btn.attr('data-id');\n let sns_post_state = permission_state_btn.attr('data-permission_state');\n let parent_media_id = permission_state_btn.attr('data-parent_media_id');\n\n let post_tag_card = permission_state_btn.next();\n // .post_tag_card の permalinkを取得\n let ugc_communication_permalink = post_tag_card.find('a').attr('href');\n\n let ugc_communication_media_src = post_tag_card.find('img');\n\n let media_container = $('.hashtag_list_permission__media_container');\n\n // 御礼を送信しましたボタンクリック時にラベルの状態を変更 + dbの許可申請状況を更新する処理\n done_thanks_message(sns_post_state, sns_post_id, parent_media_id);\n\n // メッセージを投稿するボタンにインスタグラムのurlを設定する - 直接UGC利用許可のコメントをできるようにするため\n $('.hashtag_list_permission__done_button_href').attr('href', ugc_communication_permalink);\n\n // モーダル内のボタンの状態変化を管理\n let permission_done_btn = $('.hashtag_list_permission__done_button');\n\n let permission_done_buttons = $('.hashtag_list_permission__done_button');\n\n // 初期化\n permission_done_btn.css('pointer-events', 'auto');\n\n if (sns_post_state == 0 || sns_post_state == -1) {\n permission_done_btn.removeClass('btn_gray_active');\n permission_done_btn.text('許可申請を送信しました');\n change_btn_text(permission_done_btn, '許可申請を送信しました');\n } else if (sns_post_state == 1) {\n permission_done_btn.addClass('btn_gray_active');\n permission_done_btn.text('許可申請済');\n permission_done_btn.css('pointer-events', 'none');\n change_btn_text(permission_done_btn, '許可申請済');\n } else if (sns_post_state != 0 && sns_post_state > 1) {\n permission_done_btn.addClass('btn_gray_active');\n permission_done_btn.text('許可申請済');\n change_btn_text(permission_done_btn, '許可申請済');\n permission_done_btn.css('pointer-events', 'none');\n }\n\n const prependMedia = function (tagName, src, permalink) {\n let media;\n\n let cmm_status_string_for_pic;\n\n if (sns_post_state == 0) {\n cmm_status_string_for_pic = '許可申請前';\n } else if (sns_post_state == 1) {\n cmm_status_string_for_pic = '回答待ち';\n } else if (sns_post_state == 2) {\n cmm_status_string_for_pic = '回答待ち(1週間以上)';\n } else if (sns_post_state == 3) {\n cmm_status_string_for_pic = '返信要確認';\n } else if (sns_post_state == 4) {\n cmm_status_string_for_pic = '掲載可能';\n } else if (sns_post_state == 5) {\n cmm_status_string_for_pic = '掲載不可';\n } else if (sns_post_state == 6) {\n cmm_status_string_for_pic = '連携済み';\n } else if (sns_post_state == 7) {\n cmm_status_string_for_pic = '連携解除済み';\n } else if (sns_post_state == -1) {\n cmm_status_string_for_pic = 'コミュニケーション管理から削除済み';\n } else {\n cmm_status_string_for_pic = '';\n }\n\n let closeTag = tagName == 'video' ? `` : '';\n media = `
\n \n <${tagName} class=\"hashtag_list_permission__media\" data-id=${common_media_count_up} src=\"${src}\" />${closeTag}\n \n\n

${cmm_status_string_for_pic}

\n
`;\n\n media_container.prepend(media);\n };\n\n let media_type;\n\n // モーダル内で表示する画像 or video のsrcを取得する\n if (ugc_communication_media_src.length > 0) {\n ugc_communication_media_src = post_tag_card.find('img').attr('src');\n media_type = 'img';\n } else if (ugc_communication_media_src.length == 0) {\n ugc_communication_media_src = post_tag_card.find('video').attr('src');\n media_type = 'video';\n }\n\n // 毎回appendした要素を削除する\n $('.hashtag_list_permission__media_block').remove();\n\n // モーダル内にメディアを表示させる\n prependMedia(media_type, ugc_communication_media_src, ugc_communication_permalink);\n\n // // $(\".hashtag_list_permission__caption\")[video_order].text(\"New caption text\");\n // $(\".hashtag_list_permission__caption\").text(selected_description);\n\n $('.hashtag_list_permission__overlay').addClass('active');\n $('.hashtag_list_permission').addClass('active');\n\n // 閉じる所作\n $('.hashtag_list_permission__fa-x, .hashtag_list_permission__close, .hashtag_list_permission__overlay, #hashtag_list_permission__close_button')\n .off()\n .on('click', function () {\n $('.hashtag_list_permission__overlay').removeClass('active');\n $('.hashtag_list_permission').removeClass('active');\n $('body').css({ overflow: 'auto' });\n });\n\n // ###################################################\n // ハッシュタグ収集一覧 UGC許可申請ボタン コミュニケーション管理へ特定の投稿を反映させる\n // ###################################################\n // $(\".hashtag_list_permission__done_button\").on(\"click\", function (event) {\n\n // 別のタブ内の同じボタンにも同じイベントを設定し、全てのボタンの状態を同じにする\n $('.hashtag_list_permission__done_button').each(function (hp_index, element) {\n $(element).off('click');\n $(element).on('click', function (event) {\n event.stopPropagation();\n\n // クリックした時刻(コメント送信時刻)を日本時間でmysqlでそのまま使える形で取得する ※ # ¥ DB側で勝手に日本時間をUTC時間に変更して保存する\n let currentTime = new Date();\n let options = { timeZone: 'Asia/Tokyo', year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' };\n\n let sentJapanFormattedTime = currentTime.toLocaleString('en-US', options).replace(/, /g, ' ').replace(/\\//g, '-');\n\n // Split date and time\n let dateAndTime = sentJapanFormattedTime.split(' ');\n\n // Split the date parts\n let dateParts = dateAndTime[0].split('-');\n\n // Reorder the date parts and reassemble the date and time\n sentJapanFormattedTime = `${dateParts[2]}-${dateParts[0]}-${dateParts[1]} ${dateAndTime[1]} ${dateAndTime[2]}`;\n\n permission_state_btn.css('pointer-events', 'none');\n permission_done_btn.css('pointer-events', 'none');\n\n $.ajax({\n type: 'POST',\n url: DOMAIN + '/move_ugc_to_communication',\n data: {\n sns_post_id: sns_post_id,\n sentJapanFormattedTime: sentJapanFormattedTime,\n sns_post_parent_media_id: parent_media_id,\n },\n dataType: 'json',\n success: function (ugc_permission) {\n // カルーセルの場合、まとめて複数の許可申請のボタンをグレイにする\n if (ugc_permission.carousel_parent_media_id) {\n $(`[data-parent_media_id='${ugc_permission.carousel_parent_media_id}']`).css({ 'pointer-events': 'none', background: 'gray' });\n $(`[data-parent_media_id='${ugc_permission.carousel_parent_media_id}']`).text('移動済み');\n }\n if (permission_state_btn.hasClass('btn_gray_active')) {\n permission_state_btn.removeClass('btn_gray_active');\n permission_done_btn.removeClass('btn_gray_active');\n } else {\n permission_state_btn.addClass('btn_gray_active');\n permission_done_btn.addClass('btn_gray_active');\n }\n\n if (ugc_permission.state == 0) {\n permission_state_btn.text('許可申請');\n permission_done_btn.text('許可申請を送信しました');\n permission_done_btn.css('pointer-events', 'none');\n } else if (ugc_permission.state == 1) {\n permission_state_btn.text('移動済み');\n permission_done_btn.text('許可申請済');\n permission_done_btn.css('pointer-events', 'none');\n } else if (ugc_permission.state != 0 && ugc_permission.state != 1) {\n permission_state_btn.text(' -------- ');\n permission_done_btn.text('許可申請済');\n permission_done_btn.css('pointer-events', 'none');\n }\n setTimeout(() => {\n permission_state_btn.css('pointer-events', 'auto');\n // permission_done_btn.css('pointer-events', 'auto');\n }, 3000);\n }, // Added comma here\n error: function (jqXHR, textStatus, errorThrown) {\n alert('予期しないエラーが発生いたしました。再度ページを読み込んでください。');\n permission_state_btn.css('pointer-events', 'auto');\n permission_done_btn.css('pointer-events', 'auto');\n },\n complete: function () {\n // This code will run regardless of success or error\n // permission_state_btn.off();\n // $(\".hashtag_list_permission__done_button\").off();\n },\n }); // end of ajax\n }); // end of element.addEventListener(\"click\", function (event) {\n }); // end of $(\".hashtag_list_permission__done_button\").each(function (\n }); // end of $(\".ugc_permission_btn\").on(\"click\", function (e) {\n });\n\n // 閉じる所作\n $('.hashtag_list_permission__fa-x, .hashtag_list_permission__close, .hashtag_list_permission__overlay, #hashtag_list_permission__close_button').on('click', function () {\n $('.hashtag_list_permission__overlay').removeClass('active');\n $('.hashtag_list_permission').removeClass('active');\n $('#hashtag_list_permission__close_button').removeClass('active');\n });\n\n // ¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ モーダル END ¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥\n // ラベルの状態を変更時のY軸の位置を記録する(その位置を現在のurlに含める)\n function updateURLWithScrollPosition() {\n let scrollPosition = $(window).scrollTop();\n\n // Create a new URL with the scroll position as a parameter\n let currentUrl = window.location.href;\n let newUrl = new URL(currentUrl);\n newUrl.searchParams.set('scroll_position', scrollPosition);\n\n // Change the current URL without reloading the page\n window.history.pushState({}, '', newUrl);\n }\n\n // ¥¥¥¥¥¥¥¥ main ステータスラベル変更 ¥¥¥¥¥¥¥¥¥¥¥¥\n\n // コミュニケーション管理でugcの利用許可の状態を色で表示する際の付け替え可能なクラス名一覧\n // selecter.removeClass()の複数の引数は , ではなく、半角空白で区切る\n const all_selected_ugc_state_color_css = 'selected_color_delete selected_color_waiting selected_color_waiting_seven_days selected_color_ok selected_color_ng selected_color_done selected_color_thanked';\n\n $('.cmm_select').on('change', function (event) {\n // let permission_state_id = $(\".cmm_select option:selected\").attr(\n // \"data-permission_state_id\"\n // );\n // let sns_post_id = $(\".cmm_select option:selected\").attr(\"data-sns_post_id\");\n\n let this_permission_state_label = $(this);\n let selectedOption = this_permission_state_label.find('option:selected');\n let permission_state_id = selectedOption.attr('data-permission_state_id');\n let sns_post_id = selectedOption.attr('data-sns_post_id');\n\n let sns_post_parent_media_id = selectedOption.attr('data-parent_media_id');\n // alert(sns_post_parent_media_id);\n\n this_permission_state_label.css('pointer-events', 'none');\n\n $.ajax({\n type: 'POST',\n url: DOMAIN + '/change_permission_state',\n data: {\n permission_state_id: permission_state_id,\n sns_post_id: sns_post_id,\n sns_post_parent_media_id: sns_post_parent_media_id,\n },\n dataType: 'json',\n success: function (response) {\n if (permission_state_id == 0) {\n this_permission_state_label.removeClass(all_selected_ugc_state_color_css);\n this_permission_state_label.addClass('selected_color_delete');\n } else if (permission_state_id == 1) {\n this_permission_state_label.removeClass(all_selected_ugc_state_color_css);\n this_permission_state_label.addClass('selected_color_waiting');\n } else if (permission_state_id == 2) {\n this_permission_state_label.removeClass(all_selected_ugc_state_color_css);\n this_permission_state_label.addClass('selected_color_waiting_seven_days');\n } else if (permission_state_id == 3) {\n this_permission_state_label.removeClass(all_selected_ugc_state_color_css);\n this_permission_state_label.addClass('selected_color_waiting');\n } else if (permission_state_id == 4) {\n this_permission_state_label.removeClass(all_selected_ugc_state_color_css);\n this_permission_state_label.addClass('selected_color_ok');\n } else if (permission_state_id == 5) {\n this_permission_state_label.removeClass(all_selected_ugc_state_color_css);\n this_permission_state_label.addClass('selected_color_ng');\n } else if (permission_state_id == 6) {\n this_permission_state_label.removeClass(all_selected_ugc_state_color_css);\n this_permission_state_label.addClass('selected_color_done');\n // * 7: 連携していたUGCをお客さんがUGCグループ設定画面で連携解除したもの ここでは管理しない\n } else if (permission_state_id == 8) {\n this_permission_state_label.removeClass(all_selected_ugc_state_color_css);\n this_permission_state_label.addClass('selected_color_thanked');\n }\n },\n fail: function (jqXHR, textStatus, errorThrown) {\n alert('予期しないエラーが発生いたしました。再度ページを読み込んでください。');\n },\n complete: function (jqXHR, textStatus, errorThrown) {\n this_permission_state_label.css('pointer-events', 'auto');\n // alert(\n // `返信待ちUGC一覧のラベルの状態を要確認、掲載可能、掲載不可、連携済み\n // 本投稿のラベルの状態を自動的に\"連携済み\"に変更します。`.replace(/[ \\t]/g, '')\n // );\n\n // ラベルの状態を変更時のY軸の位置を記録する(その位置を現在のurlに含める)\n // updateURLWithScrollPosition();\n\n //\n location.reload();\n },\n });\n });\n // ¥¥¥¥¥¥¥¥ main ステータスラベル変更 END ¥¥¥¥¥¥¥¥¥¥¥¥\n\n // // updateURLWithScrollPositionで取得した位置まで移動する (redirect時の初期位置を決定し、移動する)\n // function scroll_to_location() {\n // let params = new URLSearchParams(window.location.search);\n // let scrollPosition = params.get('scroll_position');\n // if (scrollPosition) {\n // alert(scrollPosition);\n // $(window).scrollTop(parseInt(scrollPosition, 100));\n // }\n // }\n\n // scroll_to_location();\n\n // ¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥\n // フィルター機能 返信取得済みUGC一覧\n // ¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥\n\n // ハッシュタグ検索一覧画面のカレンダーにて今日の日付しか入力できないようにする\n if ($('#cmm_main_initial_date')) {\n let today = new Date().toISOString().split('T')[0];\n // $('input[type=\"date\"]').attr('max', today);\n }\n\n let lstorage_cmm_sub_ugc_urls_list;\n\n // localStorageにアイテムが存在した場合、デフォルトのテキストを書き換える処理\n const get_local_storage_item_overwrite_value = function (id_name) {\n if (localStorage.getItem(id_name)) {\n $(`#${id_name}`).val(localStorage.getItem(id_name));\n return localStorage.getItem(id_name);\n } else {\n return undefined;\n }\n };\n\n // localStorageにアイテムが存在した場合、チェックをつける処理\n const get_local_storage_item_checked = function (id_name) {\n if (localStorage.getItem(id_name)) {\n $(`#${id_name}`).prop('checked', true);\n return localStorage.getItem(id_name);\n } else {\n return undefined;\n }\n };\n\n // ¥ localStorageでメディアタイプの初期チェック状態を管理する\n get_local_storage_item_checked('cmm_main_media_type_pic');\n get_local_storage_item_checked('cmm_main_media_type_carousel');\n get_local_storage_item_checked('cmm_main_media_type_video');\n\n // ¥ localStorageでステータスの初期チェック状態を管理する\n get_local_storage_item_checked('cmm_main_status_need_confirm');\n get_local_storage_item_checked('cmm_main_status_ok_ugc');\n get_local_storage_item_checked('cmm_main_status_ng_ugc');\n get_local_storage_item_checked('cmm_main_status_done_ugc');\n get_local_storage_item_checked('cmm_main_status_cancel_ugc');\n get_local_storage_item_checked('cmm_main_status_thanked_ugc');\n\n // ¥ localStorageでinput要素のテキスト状態を管理する\n get_local_storage_item_overwrite_value('cmm_main_username');\n get_local_storage_item_overwrite_value('cmm_main_comment_keyword');\n get_local_storage_item_overwrite_value('cmm_main_initial_date');\n get_local_storage_item_overwrite_value('cmm_main_end_date');\n get_local_storage_item_overwrite_value('cmm_main_per_page_num');\n\n // ugc_urlsをUGC検索欄にローカルストレージから自動で反映させる処理\n if (localStorage.getItem('cmm_main_ugc_urls_list')) {\n lstorage_cmm_main_ugc_urls_list = localStorage.getItem('cmm_main_ugc_urls_list');\n lstorage_cmm_main_ugc_urls_list = JSON.parse(lstorage_cmm_main_ugc_urls_list);\n lstorage_cmm_main_ugc_urls_list_str = lstorage_cmm_main_ugc_urls_list.join('\\n');\n $('#cmm_main_ugc_urls').text(lstorage_cmm_main_ugc_urls_list_str);\n }\n\n // ¥ localStorageでメディアタイプの初期チェック状態を管理する\n get_local_storage_item_checked('cmm_sub_media_type_pic');\n get_local_storage_item_checked('cmm_sub_media_type_carousel');\n get_local_storage_item_checked('cmm_sub_media_type_video');\n\n // ¥ localStorageでステータスの初期チェック状態を管理する\n get_local_storage_item_checked('cmm_sub_status_waiting_reply');\n get_local_storage_item_checked('cmm_sub_status_waiting_seven_days');\n\n // ¥ localStorageでinput要素のテキスト状態を管理する\n // get_local_storage_item_overwrite_value('cmm_sub_username'); なし\n get_local_storage_item_overwrite_value('cmm_sub_comment_keyword');\n get_local_storage_item_overwrite_value('cmm_sub_initial_date');\n get_local_storage_item_overwrite_value('cmm_sub_end_date');\n get_local_storage_item_overwrite_value('cmm_sub_per_page_num');\n\n // ugc_urlsをUGC検索欄にローカルストレージから自動で反映させる処理\n if (localStorage.getItem('cmm_sub_ugc_urls_list')) {\n lstorage_cmm_sub_ugc_urls_list = localStorage.getItem('cmm_sub_ugc_urls_list');\n lstorage_cmm_sub_ugc_urls_list = JSON.parse(lstorage_cmm_sub_ugc_urls_list);\n lstorage_cmm_sub_ugc_urls_list_str = lstorage_cmm_sub_ugc_urls_list.join('\\n');\n $('#cmm_sub_ugc_urls').text(lstorage_cmm_sub_ugc_urls_list_str);\n }\n\n // フィルターの条件を抽出し、queryで飛ばす\n const set_all_filter_condition = function () {\n //////////////////////// main 返信取得済みUGC一覧 ////////////////////////////\n // 表示する期間\n let cmm_main_initial_date = $('#cmm_main_initial_date').val();\n let cmm_main_end_date = $('#cmm_main_end_date').val();\n\n // localStorage\n localStorage.setItem('cmm_main_initial_date', cmm_main_initial_date);\n localStorage.setItem('cmm_main_end_date', cmm_main_end_date);\n\n // フィルター: メディアタイプ\n let cmm_main_media_type_pic = $('#cmm_main_media_type_pic:checked').attr('id') || ''; // ない場合は undefined\n let cmm_main_media_type_carousel = $('#cmm_main_media_type_carousel:checked').attr('id') || ''; // ない場合は undefined\n let cmm_main_media_type_video = $('#cmm_main_media_type_video:checked').attr('id') || ''; // ない場合は undefined\n\n localStorage.setItem('cmm_main_media_type_pic', cmm_main_media_type_pic);\n localStorage.setItem('cmm_main_media_type_carousel', cmm_main_media_type_carousel);\n localStorage.setItem('cmm_main_media_type_video', cmm_main_media_type_video);\n\n // フィルター: ステータス\n let cmm_main_status_need_confirm = $('#cmm_main_status_need_confirm:checked').attr('id') || ''; // ない場合は undefined\n let cmm_main_status_ok_ugc = $('#cmm_main_status_ok_ugc:checked').attr('id') || ''; // ない場合は undefined\n let cmm_main_status_ng_ugc = $('#cmm_main_status_ng_ugc:checked').attr('id') || ''; // ない場合は undefined\n let cmm_main_status_done_ugc = $('#cmm_main_status_done_ugc:checked').attr('id') || ''; // ない場合は undefined\n let cmm_main_status_cancel_ugc = $('#cmm_main_status_cancel_ugc:checked').attr('id') || ''; // ない場合は undefined\n let cmm_main_status_thanked_ugc = $('#cmm_main_status_thanked_ugc:checked').attr('id') || ''; // ない場合は undefined\n\n localStorage.setItem('cmm_main_status_need_confirm', cmm_main_status_need_confirm);\n localStorage.setItem('cmm_main_status_ok_ugc', cmm_main_status_ok_ugc);\n localStorage.setItem('cmm_main_status_ng_ugc', cmm_main_status_ng_ugc);\n localStorage.setItem('cmm_main_status_done_ugc', cmm_main_status_done_ugc);\n localStorage.setItem('cmm_main_status_cancel_ugc', cmm_main_status_cancel_ugc);\n localStorage.setItem('cmm_main_status_thanked_ugc', cmm_main_status_thanked_ugc);\n\n // フィルター: ユーザーネーム検索\n let cmm_main_username = $('#cmm_main_username').val() || ''; // ない場合は undefined\n // フィルター: キャプション検索\n let cmm_main_comment_keyword = $('#cmm_main_comment_keyword').val() || ''; // ない場合は undefined\n\n localStorage.setItem('cmm_main_username', cmm_main_username);\n localStorage.setItem('cmm_main_comment_keyword', cmm_main_comment_keyword);\n\n // ハッシュタグ検索一覧ページ内に表示する投稿の数を取得する\n let cmm_main_per_page_num = $('#cmm_main_per_page_num option:selected').val();\n localStorage.setItem('cmm_main_per_page_num', cmm_main_per_page_num);\n\n // 投稿表示順切り替え\n let cmm_main_display_order = $('#cmm_main_display_order option:selected').val();\n localStorage.setItem('cmm_main_display_order', cmm_main_display_order);\n\n // cmm_main側のUGC検索URL一覧を取得する\n let cmm_main_ugc_urls = $('#cmm_main_ugc_urls').val();\n // 余分な空白等含む可能性あり\n\n cmm_main_ugc_urls_list = cmm_main_ugc_urls.split('\\n'); // 空白だった場合の結果: ['']\n\n // 要素についているかもしれない前後の空白除去及び 'https://~ ' や \"https://~ \"などの ' や \"を削除\"\n cmm_main_ugc_urls_list = $.map(cmm_main_ugc_urls_list, function (url, idx) {\n return url.replace(/'/g, '').replace(/\"/g, '').replace(/,/g, '').trim();\n });\n\n // 複数のデータ(配列)を保存したいためJSON形式のデータとして保存します\n ugc_urls_list_str = JSON.stringify(cmm_main_ugc_urls_list);\n localStorage.setItem(`cmm_main_ugc_urls_list`, ugc_urls_list_str);\n\n //////////////////// main 返信取得済みUGC一覧 END /////////////////////////////////////\n\n //////////////////////// sub 返信待ちUGC一覧 ////////////////////////////\n // 表示する期間\n let cmm_sub_initial_date = $('#cmm_sub_initial_date').val();\n let cmm_sub_end_date = $('#cmm_sub_end_date').val();\n\n // localStorage\n localStorage.setItem('cmm_sub_initial_date', cmm_sub_initial_date);\n localStorage.setItem('cmm_sub_end_date', cmm_sub_end_date);\n\n // フィルター: メディアタイプ\n let cmm_sub_media_type_pic = $('#cmm_sub_media_type_pic:checked').attr('id') || ''; // ない場合は undefined\n let cmm_sub_media_type_carousel = $('#cmm_sub_media_type_carousel:checked').attr('id') || ''; // ない場合は undefined\n let cmm_sub_media_type_video = $('#cmm_sub_media_type_video:checked').attr('id') || ''; // ない場合は undefined\n\n localStorage.setItem('cmm_sub_media_type_pic', cmm_sub_media_type_pic);\n localStorage.setItem('cmm_sub_media_type_carousel', cmm_sub_media_type_carousel);\n localStorage.setItem('cmm_sub_media_type_video', cmm_sub_media_type_video);\n\n // フィルター: ステータス\n let cmm_sub_status_waiting_reply = $('#cmm_sub_status_waiting_reply:checked').attr('id') || ''; // ない場合は undefined\n let cmm_sub_status_waiting_seven_days = $('#cmm_sub_status_waiting_seven_days:checked').attr('id') || ''; // ない場合は undefined\n\n localStorage.setItem('cmm_sub_status_waiting_reply', cmm_sub_status_waiting_reply);\n localStorage.setItem('cmm_sub_status_waiting_seven_days', cmm_sub_status_waiting_seven_days);\n\n // フィルター: ユーザーネーム検索 なし apiで返信待ちの状態のものは取得できないため\n // let cmm_sub_username = $('#cmm_sub_username').val() || '';\n\n // フィルター: キャプション検索\n let cmm_sub_comment_keyword = $('#cmm_sub_comment_keyword').val() || '';\n\n localStorage.setItem('cmm_sub_comment_keyword', cmm_sub_comment_keyword);\n\n // ハッシュタグ検索一覧ページ内に表示する投稿の数を取得する\n let cmm_sub_per_page_num = $('#cmm_sub_per_page_num option:selected').val();\n localStorage.setItem('cmm_sub_per_page_num', cmm_sub_per_page_num);\n\n // 投稿表示順切り替え\n let cmm_sub_display_order = $('#cmm_sub_display_order option:selected').val();\n localStorage.setItem('cmm_sub_display_order', cmm_sub_display_order);\n\n // cmm_sub側のUGC検索URL一覧を取得する\n let cmm_sub_ugc_urls = $('#cmm_sub_ugc_urls').val();\n // 余分な空白等含む可能性あり\n cmm_sub_ugc_urls_list = cmm_sub_ugc_urls.split('\\n');\n\n // 要素についているかもしれない前後の空白除去及び 'https://~ ' や \"https://~ \"などの ' や \"を削除\"\n cmm_sub_ugc_urls_list = $.map(cmm_sub_ugc_urls_list, function (url, idx) {\n return url.replace(/'/g, '').replace(/\"/g, '').replace(/,/g, '').trim();\n });\n\n // 複数のデータ(配列)を保存したいためJSON形式のデータとして保存します。\n ugc_urls_list_str = JSON.stringify(cmm_sub_ugc_urls_list);\n localStorage.setItem(`cmm_sub_ugc_urls_list`, ugc_urls_list_str);\n\n $.ajax({\n type: 'POST',\n url: DOMAIN + '/cmm_filter_hashtag_ugc',\n data: {\n cmm_main_ugc_urls_list: cmm_main_ugc_urls_list,\n cmm_sub_ugc_urls_list: cmm_sub_ugc_urls_list,\n },\n dataType: 'json',\n success: function (data) {\n // alert('success!');\n let url_query_path = `/communication_management?&cmm_main_initial_date=${cmm_main_initial_date}&cmm_main_end_date=${cmm_main_end_date}&cmm_main_media_type_pic=${cmm_main_media_type_pic}&cmm_main_media_type_carousel=${cmm_main_media_type_carousel}&cmm_main_media_type_video=${cmm_main_media_type_video}&cmm_main_status_need_confirm=${cmm_main_status_need_confirm}&cmm_main_status_ok_ugc=${cmm_main_status_ok_ugc}&cmm_main_status_ng_ugc=${cmm_main_status_ng_ugc}&cmm_main_status_done_ugc=${cmm_main_status_done_ugc}&cmm_main_status_cancel_ugc=${cmm_main_status_cancel_ugc}&cmm_main_status_thanked_ugc=${cmm_main_status_thanked_ugc}&cmm_main_username=${cmm_main_username}&cmm_main_comment_keyword=${cmm_main_comment_keyword}&cmm_main_per_page_num=${cmm_main_per_page_num}&cmm_main_display_order=${cmm_main_display_order}&cmm_main_ugc_urls_list=${cmm_main_ugc_urls_list}&cmm_sub_initial_date=${cmm_sub_initial_date}&cmm_sub_end_date=${cmm_sub_end_date}&cmm_sub_status_waiting_reply=${cmm_sub_status_waiting_reply}&cmm_sub_status_waiting_seven_days=${cmm_sub_status_waiting_seven_days}&cmm_sub_media_type_pic=${cmm_sub_media_type_pic}&cmm_sub_media_type_carousel=${cmm_sub_media_type_carousel}&cmm_sub_media_type_video=${cmm_sub_media_type_video}&cmm_sub_comment_keyword=${cmm_sub_comment_keyword}&cmm_sub_per_page_num=${cmm_sub_per_page_num}&cmm_sub_display_order=${cmm_sub_display_order}&stop=1&cmm_sub_ugc_urls_list=${cmm_sub_ugc_urls_list}`;\n\n location.href = url_query_path;\n },\n error: function (jqXHR, textStatus, errorThrown) {},\n });\n\n ///////////////////////////// sub 返信取得済みUGC一覧 END /////////////////////////////////////\n\n // get_hashtag_ids_names()が loopしないように &stop=1 を追加\n // let url_query_path = `/communication_management?&cmm_main_initial_date=${cmm_main_initial_date}&cmm_main_end_date=${cmm_main_end_date}&cmm_main_per_page_num=${cmm_main_per_page_num}&stop=1`;\n\n // return url_query_path;\n };\n\n $('.cmm_main__filter_btn').on('click', function () {\n set_all_filter_condition();\n });\n\n $('.cmm_sub__filter_btn').on('click', function () {\n set_all_filter_condition();\n });\n\n // ユーザーネーム / コメントキーワードのアイコンクリック時\n $('.cmm_input_search__click').on('click', function () {\n set_all_filter_condition();\n });\n\n // ユーザーネーム / コメントキーワードのEnter押下時\n $('.cmm_input_search__enter').keypress(function (e) {\n if (e.keyCode == 13) {\n set_all_filter_condition();\n }\n });\n\n // フィルター機能一括トグル toggle機能\n // タググループに紐付いた全てのタグをチェックする\n const cmm_sub__toggle_all = $('#cmm_sub__toggle_all');\n const cmm_sub__toggle_media_type = $('#cmm_sub__toggle_media_type');\n const cmm_sub__toggle_status = $('#cmm_sub__toggle_status');\n\n let all_sub_media_check_boxes = $('.cmm_sub__media_section input');\n let all_sub_status_check_boxes = $('.cmm_sub__status_section input');\n\n const cmm_main__toggle_all = $('#cmm_main__toggle_all');\n const cmm_main__toggle_media_type = $('#cmm_main__toggle_media_type');\n const cmm_main__toggle_status = $('#cmm_main__toggle_status');\n\n let all_main_media_check_boxes = $('.cmm_main__media_section input');\n let all_main_status_check_boxes = $('.cmm_main__status_section input');\n\n // 絞り込み条件をトグルする関数\n const toggle_filters = function (check_boxes, area_toggle) {\n $.each(check_boxes, function (index, el) {\n if (area_toggle.is(':checked')) {\n el.checked = true;\n } else {\n el.checked = false;\n }\n });\n };\n\n // 返信取得済みUGC一覧エリア\n cmm_main__toggle_all.on('change', function () {\n toggle_filters(all_main_media_check_boxes, cmm_main__toggle_all);\n toggle_filters(all_main_status_check_boxes, cmm_main__toggle_all);\n });\n cmm_main__toggle_media_type.on('change', function () {\n toggle_filters(all_main_media_check_boxes, cmm_main__toggle_media_type);\n });\n cmm_main__toggle_status.on('change', function () {\n toggle_filters(all_main_status_check_boxes, cmm_main__toggle_status);\n });\n\n // 返信待ちUGC一覧エリア\n cmm_sub__toggle_all.on('change', function () {\n toggle_filters(all_sub_media_check_boxes, cmm_sub__toggle_all);\n toggle_filters(all_sub_status_check_boxes, cmm_sub__toggle_all);\n });\n cmm_sub__toggle_media_type.on('change', function () {\n toggle_filters(all_sub_media_check_boxes, cmm_sub__toggle_media_type);\n });\n cmm_sub__toggle_status.on('change', function () {\n toggle_filters(all_sub_status_check_boxes, cmm_sub__toggle_status);\n });\n\n // コミュニケーション管理の説明\n // 検索条件の表示非表示 slideToggle -\n $('.cmm_how_to_use__accordion_filter').click(function () {\n $('.cmm_how_to_use__filter_container').slideToggle(300, function () {\n $(this).toggleClass('open');\n\n // The text change needs to happen here, after the 'open' class is toggled\n if ($(this).hasClass('open')) {\n $('.cmm_how_to_use__accordion_filter').text('本ページの説明を非表示にする');\n } else {\n $('.cmm_how_to_use__accordion_filter').text('本ページの説明を表示する');\n }\n });\n });\n\n // UGC連携 / ユーザーネーム登録のoverlay用\n $('.cmm_username_input__modal_bg').on('click', function () {\n $('.cmm_username_input__modal_bg').css('display', 'none');\n $('.cmm_username_input__modal_container').css('display', 'none');\n $('body').css('overflow', 'auto');\n });\n\n // .cmm_ugc_set_btnを押したときの処理 username矯正入力及び連携モーダルを出現させる\n $('.cmm_ugc_set_btn')\n .off()\n .on('click', function () {\n $('body').css('overflow', 'hidden'); // Disable scrolling\n $('.cmm_username_input__modal_bg').css('display', 'block');\n\n // username取得のためリンクを貼る\n let permalink = $(this).attr('data-permalink');\n $('.cmm_username_input__redirect_url').attr('href', permalink);\n\n let username = $(this).attr('data-username');\n username = username ? username : '';\n $('.cmm_username_input__input').val(username);\n\n let official_comment = $(this).attr('data-comment');\n official_comment = official_comment ? official_comment : '';\n $('.cmm_official_comment_input').val(official_comment);\n\n // 初期化処理\n $('.cmm_username_input__notice_message').remove();\n $('.cmm_username_input__warning_message').remove();\n $('.cmm_username_input__modal_submit').css({ 'pointer-events': 'auto', background: 'blue' });\n\n if (username) {\n // $('.cmm_username_input__modal_submit').css({ 'pointer-events': 'none', background: 'gray' });\n $('.cmm_username_input__input').before(\"
※ユーザーネームはすでに登録されています。
ユーザーネームに誤りがある場合のみ
再登録してください。
\");\n } else if (!username) {\n $('.cmm_username_input__modal_submit').css({ 'pointer-events': 'none', background: 'gray' });\n $('.cmm_username_input__input').before(\"
※ユーザーネームが登録されていません。
登録完了後、連携ボタンを利用できます。
\");\n }\n\n $('.cmm_username_input__modal_container').css('display', 'block');\n\n let sns_post_id = $(this).data('id');\n $('.cmm_username_input__modal_submit').attr('data-sns_post_id', sns_post_id);\n\n let parent_media_id = $(this).data('parent_media_id');\n $('.cmm_username_input__modal_submit').attr('data-parent_media_id', parent_media_id);\n\n let $this = $(this);\n\n // UGC group linking modal display\n $('.cmm_username_input__modal_del').on('click', function () {\n $('body').css('overflow', 'auto');\n $('.cmm_username_input__modal_container').css('display', 'none');\n });\n\n // ユーザーネームを手動登録\n $('.cmm_username_input__username_submit')\n .off()\n .on('click', function () {\n let input_username = $('.cmm_username_input__input').val();\n if (!input_username) {\n alert(`ユーザーネームが入力されていません。`);\n return;\n }\n $.ajax({\n url: '/cmm_save_manual_ugc_username',\n type: 'POST',\n data: {\n sns_post_id: sns_post_id,\n parent_media_id: parent_media_id,\n input_username: input_username,\n },\n dataType: 'json',\n })\n .done(function (data) {\n alert('ユーザーネームが登録されました。');\n // location.reload();\n // 連携するボタンを押せるようにする\n $('.cmm_username_input__modal_submit').css({ 'pointer-events': 'auto', background: 'blue' });\n $('body').css('overflow', 'auto');\n $this.closest('.cmm_tag_container').find('.cmm_ugc_username > p').text(input_username);\n // カルーセルに属する全ての投稿のユーザー名を一度に変更する\n if (parent_media_id) {\n $(`div[data-parent_media_id=\"${parent_media_id}\"]`).each((index, el) => {\n $(el).closest('.cmm_tag_container').find('.cmm_ugc_username > p').text(input_username);\n });\n }\n location.reload();\n })\n .fail(function () {\n alert('ユーザーネームの登録に失敗しました。再度お試しください。');\n $('body').css('overflow', 'auto');\n });\n });\n\n // 企業からのコメント登録\n $('.official_comment_submit')\n .off()\n .on('click', function () {\n let input_comment = $('.cmm_official_comment_input').val();\n if (!input_comment) {\n alert(`企業からのコメントが入力されていません。`);\n return;\n }\n $.ajax({\n url: '/cmm_save_ugc_official_comment',\n type: 'POST',\n data: {\n sns_post_id: sns_post_id,\n input_comment: input_comment,\n },\n dataType: 'json',\n })\n .done(function (data) {\n alert('企業からのコメントを登録しました。');\n $('body').css('overflow', 'auto');\n location.reload();\n })\n .fail(function () {\n alert('処理に失敗しました。再度お試しください。');\n $('body').css('overflow', 'auto');\n });\n });\n\n // UGC連携\n $('.cmm_username_input__modal_submit')\n .off()\n .on('click', function () {\n let ugc_group_ids = [];\n $('input[name=ugc_groups]:checked').each(function () {\n ugc_group_ids.push($(this).val());\n });\n if (ugc_group_ids.length == 0) {\n alert('Please select a UGC group.');\n return;\n }\n $.ajax({\n url: '/ugc_group_id_set',\n type: 'POST',\n data: {\n sns_post_id: sns_post_id,\n ugc_group_ids: ugc_group_ids,\n // コミュニケーション管理画面でUGC登録したときに、ugc_permissionの状態を変更することを知らせるflag\n cmm_change_ugc_permission_state_flag: 1,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n // alert('Linked to UGC group.');\n $.ajax({\n url: '/cmm_update_ugc_permission',\n type: 'POST',\n data: {\n sns_post_id: sns_post_id,\n // コミュニケーション管理画面でUGC登録したときに、ugc_permissionの状態を変更することを知らせるflag\n // cmm_change_ugc_permission_state_flag: 1,\n },\n dataType: 'json',\n })\n .done(function (data) {\n // alert('Linked to UGC group.');\n // alert(\n // `指定されたUGCグループに本投稿を連携しました。\n // 本投稿のラベルの状態を自動的に\"連携済み\"に変更します。`.trim()\n // );\n // 改行を残してそれ以外の不要な空白を削除する\n alert(\n `指定されたUGCグループに本投稿を連携しました。\n 本投稿のラベルの状態を自動的に\"連携済み\"に変更します。`.replace(/[ \\t]/g, '')\n );\n })\n .fail(function () {\n alert(\n `指定されたUGCグループに本投稿を連携しました。\n\n Notice:\n 予期しないエラーにより、本投稿のラベルの状態を自動的に\"連携済み\"に変更できませんでした。\n\n お手数ですが、手動で本投稿のラベルの状態を\"連携済み\"にしていただくようお願い致します。`.replace(/[ \\t]/g, '')\n );\n })\n .always(function () {\n location.reload();\n });\n }\n });\n });\n\n $('.cmm_username_input__modal_cancel_submit').on('click', function () {\n let ugc_group_id = $('.cmm_username_input__ugc_modal_select option:selected').val();\n\n $.ajax({\n url: '/ugc_group_id_delete',\n type: 'POST',\n data: {\n sns_post_id: sns_post_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('UGC group link has been removed.');\n location.reload();\n }\n });\n });\n }); // end $('.cmm_ugc_set_btn') click\n\n // .cmm_ugc_set_btnを押したときの処理 username矯正入力及び連携モーダルを出現させる\n $('.cmm_csv_download_btn')\n .off('click')\n .on('click', function () {\n $('.cmm_csv_download_btn').css({ 'pointer-events': 'none', 'background-color': 'gray' });\n $.ajax({\n url: '/cmm_download_csv_file',\n type: 'GET',\n data: {\n no_data: 'no_data',\n },\n // dataType: 'json',\n dataType: 'text', // <-- change this from 'json' to 'text'\n })\n .done(function (data) {\n // 改行を残してそれ以外の不要な空白を削除する\n alert(`CSVファイルのダウンロードを開始します。`.replace(/[ \\t]/g, ''));\n // ajaxを通じてcsvダウンロードはできないため下記のようにしてcsvファイルをブラウザでダウンロードさせる\n let blob = new Blob([data], { type: 'text/csv' });\n let url = window.URL.createObjectURL(blob);\n let a = document.createElement('a');\n a.href = url;\n // ファイル名\n a.download = `ugc_list_${time_now_as_YYYYMMDDHHMMSS()}.csv`;\n a.click();\n })\n .fail(function (jqXHR, textStatus, errorThrown) {})\n .always(function () {\n // location.reload();\n $('.cmm_csv_download_btn').css({ 'pointer-events': 'auto', 'background-color': 'orange' });\n });\n });\n\n // webhook連携ができていない場合の処理 コミュニケーション管理を使用できないようにしている\n if ($('.cmm_no_insta_page_id_overlay').length > 0) {\n $('body').css({ overflow: 'hidden' });\n $('.cmm_csv_download_btn').off('click');\n // $('.cmm_csv_download_btn').css({ 'pointer-events': 'none' });\n $('.cmm_csv_download_btn').html(`本ページを利用するためにはアカウント設定より連携を完了させてください。

`);\n $('.cmm_csv_download_btn').css({\n position: 'fixed',\n left: '50%',\n top: '40%',\n transform: 'translate(-50%, -50%)',\n 'font-size': '20px',\n padding: '5px',\n background: '#ff851f',\n cursor: 'default',\n 'z-index': '20000',\n width: '900px',\n height: '200px',\n 'text-align': 'center',\n margin: 'auto',\n opacity: '0.9',\n display: 'flex',\n 'justify-content': 'center',\n 'align-items': 'center',\n });\n $('.cmm_to_account_edit').css({\n margin: '0',\n padding: '0',\n 'font-size': '25px',\n 'vertical-align': 'baseline',\n background: 'transparent',\n 'font-weight': 'bold',\n color: '#3030ea',\n 'border-bottom': 'solid 2px #3030ea',\n });\n // $('.cmm_csv_download_btn').css({ background: 'black' });\n }\n\n // 現在の表示数を表示する\n main_object = $('.cmm_tag_container .post_tag_card').length || 0;\n $('#cmm_main__answered_ugc_count').text(main_object);\n\n sub_object = $('.cmm_sub__waiting_ugc_list_container .post_tag_card').length || 0;\n}); // end of document.addEventListener(\"turbolinks:load\", function () {\n","document.addEventListener('turbolinks:load', function () {\n // ¥ 開発環境での開発スピードを上げるため青木の開発環境でのみ\n // ¥ manage/app/javascript/packs内の本jsファイルを走らせない\n if ((location.href.includes('dev-manage-ssl.platta.jp') || location.href.includes('http://18.177.103.115:3004')) && !location.href.includes('?dev27aoki')) {\n console.log('dev環境 public.jsを使用');\n return;\n }\n\n const ERROR_MSG = 'エラー! 処理を完了できませんでした\\n時間おいて再度実行しても、このエラーが修正されない場合は\\nお手数ですがサポートチームにお問い合わせください';\n const MAIL_PATTERN = /^[a-zA-Z0-9_+-]+(.[a-zA-Z0-9_+-]+)*@([a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]*\\.)+[a-zA-Z]{2,}$/;\n const PASSWORD_PATTERN = /([0-9].*[a-zA-Z]|[a-zA-Z].*[0-9])/;\n\n const DOMAIN = $('#pl_domain').val();\n\n let current_url = location.href;\n // uploadするファイルを保存する\n let file_for_update;\n let file_for_delete;\n\n //############################################################\n // ファイルを選択した時にファイル名を表示させる\n //############################################################\n $('.pdtupdate__upload_input').on('change', function () {\n file_for_update = $(this).prop('files')[0];\n $('.pdtupdate__upload_state_text').text(file_for_update.name);\n });\n\n $('.pdtupdate__delete_input').on('change', function () {\n file_for_delete = $(this).prop('files')[0];\n $('.pdtupdate__delete_state_text').text(file_for_delete.name);\n });\n\n //############################################################\n // csvファイルをrubyに送る処理\n //###########################################################\n const send_product_csv_data = function (form_id, uploaded_file_id) {\n let file_id = uploaded_file_id;\n let fileInput = $(file_id)[0];\n let file = fileInput.files[0];\n let filename = file.name;\n\n let account_id = Number($('#hidden_account_id').val());\n\n // Nokogiriを使って画像urlを取得するアカウント一覧\n const NOKOGIRI_ACCOUNT_IDS = [20, 21, 22, 10016, 10018, 10025];\n\n // Seleniumを使わないと画像urlを取得できないアカウント一覧\n const SELENIUM_ACCOUNT_IDS = [10, 10020];\n\n const MERGED_ACCOUNT_IDS = [...NOKOGIRI_ACCOUNT_IDS, ...SELENIUM_ACCOUNT_IDS];\n\n // スクレイピングで1行ごとに画像urlを取得にかかる秒数\n // (実際にかかる時間よりも少し多めに設定している)\n let seconds_per_line = NOKOGIRI_ACCOUNT_IDS.includes(account_id) ? 1.5 : 2.5;\n\n if (MERGED_ACCOUNT_IDS.includes(account_id)) {\n alert(\n `\n 貴社webサイトから画像データを取得した後にデータが\n 登録されるためしばらく時間がかかる場合がございます。\n\n 登録されるまでにかかる時間(参考): 登録データ数(行) x ${seconds_per_line}秒\n\n 本ページから離れてもデータの登録は継続されるので\n 別ページに移動しても問題ございません。\n `\n );\n }\n\n let extension = filename.split('.').pop().toLowerCase();\n let allowedExtensions = ['csv'];\n\n if (!allowedExtensions.includes(extension)) {\n alert('Only CSV is allowed.');\n return;\n }\n\n let formData = new FormData();\n formData.append('file', file);\n\n // plattaMallにアカウントIDを共有する\n formData.append('account_id', account_id); // Append the account_id to the form data\n\n let target_url = '';\n\n if (location.href.includes('https://manage.platta.jp/product_update')) {\n // platta mallのurlにajaxを飛ばし、platta mallでスクレイピング及び本番のDBで登録処理を行う\n target_url = $(form_id).attr('action');\n } else if (location.href.includes('https://dev-manage-ssl.platta.jp/product_update') || location.href.includes('http://18.177.103.115:3002/product_update')) {\n // platta mallのurlにajaxを飛ばし、開発manageにてスクレイピング及び開発のDBで登録処理を行う\n target_url = $(form_id).data('action');\n } else {\n alert('本操作が許可されていないurlです。処理を停止します。');\n return;\n }\n\n $.ajax({\n // * 本番Manageではなく、plattaMallでスクレイピングの処理を行う manageの処理を軽くし、サーバーが止まらないようにするため\n // url: $(form_id).attr('action'), // /product_update_database\n url: target_url, // /product_update_database\n // url: 'https://test-platta-site.com/nokogiri_scraping',\n type: 'POST',\n data: formData,\n processData: false,\n contentType: false,\n timeout: 1200000, // Timeout set to 20 minutes\n success: function (data) {\n if (data.is_db_changed_successfully === 'true') {\n alert('商品マスタの更新が完了しました。');\n } else if (data.is_db_changed_successfully == 'false') {\n alert(\n `商品マスタの読み込みに失敗しました。\n お客様の商品マスタの構成(列名)が変更された可能性がございます。\n 修正の上、再度お試しください。`.replace(/[ \\t]/g, '')\n );\n } else if (data.is_db_changed_successfully == 'productsNotFound') alert(`削除する対象の商品がありません。`.replace(/[ \\t]/g, ''));\n },\n // ¥ 基本、画像urlをスクレイピングするコードでエラーが発生した場合のエラー表示\n error: function (jqXHR, textStatus, errorThrown) {\n console.error(jqXHR);\n // ¥ スクレイピングに時間がかかると自動でエラーが無くてもjsがエラーを返すため\n // ¥ その場合は alert()を出さないようにする\n if (jqXHR.status != 504 && jqXHR.status != 0) {\n alert(\n `予期せぬエラーが発生しました。お手数ですが、再度お試しください。\n エラーが継続する場合は、お手数ですが、弊社カスタマーサクセスまでお問い合わせください。`.replace(/[ \\t]/g, '')\n );\n } else if (jqXHR.status == 0) {\n alert(\n `商品マスタを更新しています。\n 本ページを離れても処理は継続し続けますのでご安心ください。\n ※更新するデータの数に応じて結果の反映に時間がかかる場合がございます。\n '`.replace(/[ \\t]/g, '')\n );\n }\n console.log('jqXHR.textStatus', typeof jqXHR.status);\n },\n complete: function () {\n if (uploaded_file_id === '#file_update') {\n $('#pdtupdate__upload_btn').css({ 'pointer-events': 'auto' }, { 'background-color': '#4169e1' });\n } else if (uploaded_file_id === '#file_delete') {\n $('#pdtupdate__delete_btn').css({ 'pointer-events': 'auto' }, { 'background-color': 'red' });\n }\n return 'done';\n },\n });\n };\n\n //############################################################\n // csv or excelファイルのデータをrubyにわたす処理 DBの新規登録 + 更新\n //############################################################\n $('#pdtupdate__upload_btn')\n .off('click')\n .on('click', function (e) {\n e.preventDefault();\n if (!file_for_update) {\n alert('ファイルが選択されていません。');\n return;\n }\n confirm_yes_or_no = confirm(\n `この操作には時間がかかる場合がございます。本ページから離れても処理は継続されるので問題ございません。\n\n 本操作は実行後、取り消せません。実行しますか?\n 注) 商品マスタの構成(列名)が変更されているとデータを正しく取り込めないことがございます。`.replace(/[ \\t]/g, '')\n );\n if (confirm_yes_or_no) {\n $('#pdtupdate__update_btn').css({ 'pointer-events': 'none', 'background-color': 'gray' });\n send_product_csv_data('#product-update-form', '#file_update');\n // 選択済みのファイルを削除する\n $('#file_update').val('');\n file_for_update = null;\n setTimeout(() => {\n $('.pdtupdate__upload_state_text').text('選択されていません');\n }, 1000);\n } else {\n }\n });\n\n //############################################################\n // csv or excelファイルのデータをrubyにわたす処理 DB 一括削除\n //############################################################\n $('#pdtupdate__delete_btn')\n .off('click')\n .on('click', function (e) {\n e.preventDefault();\n if (!file_for_delete) {\n alert('ファイルが選択されていません。');\n return;\n }\n confirm_yes_or_no = confirm(\n `この操作には時間がかかる場合がございます。本ページから離れても処理は継続されるので問題ございません。\n\n 本操作は実行後、取り消せません。実行しますか?`.replace(/[ \\t]/g, '')\n );\n if (confirm_yes_or_no) {\n $('#pdtupdate__delete_btn').css({ 'pointer-events': 'none', 'background-color': 'gray' });\n send_product_csv_data('#product-delete-form', '#file_delete');\n // 選択済みのファイルを削除する\n $('#file_delete').val('');\n file_for_delete = null;\n setTimeout(() => {\n $('.pdtupdate__delete_state_text').text('選択されていません');\n }, 1000);\n } else {\n // console.log('キャンセルしました。');\n }\n });\n\n //############################################################\n // ファイルをダウンロードしたときのファイル名に現在時刻を拡張子の前につける\n //############################################################\n const time_now_as_YYYYMMDDHHMMSS = function () {\n let date = new Date();\n let year = date.getFullYear();\n let month = ('0' + (date.getMonth() + 1)).slice(-2); // Months are 0-based in JavaScript\n let day = ('0' + date.getDate()).slice(-2);\n let hours = ('0' + date.getHours()).slice(-2);\n let minutes = ('0' + date.getMinutes()).slice(-2);\n let seconds = ('0' + date.getSeconds()).slice(-2);\n\n let time_now = year + month + day + hours + minutes + seconds;\n\n // console.log('time_now: ', time_now); // Prints the current time formatted as 'YYYYMMDDHHMMSS'\n\n return time_now;\n };\n\n //############################################################\n // csv ファイルをダウンロードする処理 (/i/products_setting.html.erb)の要素をクリック\n //############################################################\n $('.pu_csv_download_btn')\n .off('click')\n .on('click', function () {\n $('.pu_csv_download_btn').css({ 'pointer-events': 'none', 'background-color': 'gray' });\n $.ajax({\n url: '/pu_download_csv_file',\n type: 'GET',\n data: {\n no_data: 'no_data',\n },\n // dataType: 'json',\n dataType: 'text', // <-- change this from 'json' to 'text'\n })\n .done(function (data) {\n // ¥ 改行を残してそれ以外の不要な空白を削除する\n alert(`CSVファイルのダウンロードを開始します。`.replace(/[ \\t]/g, ''));\n // ajaxを通じてcsvダウンロードはできないため下記のようにしてcsvファイルをブラウザでダウンロードさせる\n let blob = new Blob([data], { type: 'text/csv' });\n let url = window.URL.createObjectURL(blob);\n let a = document.createElement('a');\n a.href = url;\n // ファイル名\n a.download = `商品マスタ登録アイテム一覧_${time_now_as_YYYYMMDDHHMMSS()}.csv`;\n a.click();\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n console.log('errorThrown');\n console.log('jqXHR, textStatus, errorThrow', jqXHR, textStatus, errorThrown);\n alert('csvのダウンロードに失敗しました。お手数ですが、弊社カスタマーサクセスまでお問い合わせください。');\n })\n .always(function () {\n // location.reload();\n $('.pu_csv_download_btn').css({ 'pointer-events': 'auto', 'background-color': 'orange' });\n });\n });\n});\n","document.addEventListener('turbolinks:load', function () {\n //- ハッシュタグ検索の初期の画面でフィルターをかける処理\n let current_url = window.location.href;\n\n common_media_count_up = -1;\n let fileObject = {}; // [{0: File}, {1: File}] のような形で初期の順番を保持する\n let mpm_files = []; // 追加された画像のデータを保存する\n const MPM_MAX_SIZE_MB = 25; // 手動自社投稿で追加できるファイルのサイズ(サーバーに保存するもののみ)\n\n const conduct_sortable = function (new_or_edit, sns_post_id_for_update = null) {\n // ¥ edit時に毎回新しく追加される要素の数を追跡するために作成\n let duplicate_mpm_files = [];\n let fileIndex = 0; // New variable for tracking the file index.\n\n let inputFile;\n let my_post_media_drop_input;\n let mpm_preview_own_media_area;\n let previewArea;\n let mpm_delete_preview_icon;\n let sortable_id;\n let delete_existing_media_orders_flag;\n let mpm_instagram_url_obj;\n let all_db_permalink_list; // ¥ 新規作成のみ使用\n\n // ¥ 新規登録ボタンを押した時の変数\n if (new_or_edit === 'new') {\n // ¥ 文字列から配列に変更している\n all_db_permalink_list = JSON.parse($('#all_db_permalink_list').attr('data-permalink_list'));\n open_modal_container_btn = $('#new_product_set_btn');\n platta_ig_modal_container = $('.platta_ig_modal_container');\n inputFile = $('#my_post_media_reinput');\n my_post_media_drop_input = $('.my_post_media_drop_input');\n mpm_preview_own_media_area = $('.mpm_preview_own_media_area');\n previewArea = $('.preview_shown_media_area').first(); // 複数あるうちの一番始めの DOM elementを取得する\n submit_btn = $('#my_post_manual_post_submit_btn');\n sortable_id = -1;\n delete_existing_media_orders_flag = 0; // 0の場合、rails側で既存のデータを削除しない\n mpm_instagram_url_obj = $('#mpm_instagram_url');\n mpm_username_obj = $('#mpm_username');\n // ¥ 編集ボタンを押した時の変数\n } else if (new_or_edit === 'edit') {\n all_db_permalink_list = JSON.parse($('#all_db_permalink_list').attr('data-permalink_list'));\n open_modal_container_btn = $('.mpm_item_list__edit');\n platta_ig_modal_container = $('.mpm_platta_ig_edit_modal_container');\n inputFile = $('#my_post_media_edit_reinput');\n my_post_media_drop_input = $('.my_post_media_edit_drop_input');\n mpm_preview_own_media_area = $('.mpm_preview_own_edit_media_area');\n previewArea = $('.preview_shown_media_area_for_edit').first(); // 複数あるうちの一番始めの DOM elementを取得する\n submit_btn = $('#my_post_manual_update_post_submit_btn');\n sortable_id = -1;\n delete_existing_media_orders_flag = 0; // 0の場合、rails側で既存のデータを削除しない\n mpm_instagram_url_obj = $('#mpm_edit_instagram_url');\n mpm_username_obj = $('#mpm_edit_username');\n }\n\n // ¥ previewAreaに入っているメディアを削除し初期化する\n previewArea.empty();\n\n const validVideoTypes = ['video/mp4', 'video/webm', 'video/ogg'];\n\n // ¥ mousedownイベントを使うことで、ファイルダイアログを重複して発生させないようにしている\n my_post_media_drop_input.on('mousedown', function (event) {\n event.preventDefault();\n inputFile.off('click').click();\n });\n\n inputFile.off('click').on('click', function (event) {\n event.stopPropagation();\n });\n\n // ¥ 画像。動画アップロードでクリックしてファイルを選択するときの処理\n inputFile.on('change', function () {\n let clicked_inserted_files = $(this).prop('files');\n\n for (let index = 0; index < clicked_inserted_files.length; index++) {\n const file = clicked_inserted_files[index];\n if (file.size > MPM_MAX_SIZE_MB * 1024 * 1024) {\n alert(`◆ファイル名: ${file.name} が許容ファイルサイズの${MPM_MAX_SIZE_MB}MBを超えています。それ以下のサイズのファイルを選択してください。`);\n return;\n }\n }\n\n let dup_common_media_count_up = common_media_count_up;\n\n if (new_or_edit === 'edit') {\n for (let i = 0; i < clicked_inserted_files.length; i++) {\n dup_common_media_count_up++;\n fileObject = {};\n fileObject[dup_common_media_count_up] = clicked_inserted_files[i];\n mpm_files.push(fileObject);\n }\n } else if (new_or_edit === 'new') {\n for (let i = 0; i < clicked_inserted_files.length; i++) {\n dup_common_media_count_up++;\n fileObject = {};\n fileObject[dup_common_media_count_up] = clicked_inserted_files[i];\n mpm_files.push(fileObject);\n }\n }\n\n processFiles(Array.from(clicked_inserted_files));\n });\n\n mpm_preview_own_media_area.on('dragover', function (e) {\n e.preventDefault();\n e.stopPropagation();\n e.originalEvent.dataTransfer.dropEffect = 'copy';\n\n mpm_preview_own_media_area.addClass('back_ground_color_antiquewhite');\n });\n\n mpm_preview_own_media_area.on('dragleave', function (e) {\n e.preventDefault();\n e.stopPropagation();\n e.originalEvent.dataTransfer.dropEffect = 'copy';\n\n mpm_preview_own_media_area.removeClass('back_ground_color_antiquewhite');\n });\n\n mpm_preview_own_media_area.on('drop', function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n let dup_common_media_count_up = common_media_count_up;\n\n let files = Array.from(e.originalEvent.dataTransfer.files);\n\n for (let i = 0; i < files.length; i++) {\n let file = files[i];\n\n console.log('file.size---', file.size);\n\n // file.size > 20 * 1024 * 1024) 20の部分が20MBとなる\n if (file.size > MPM_MAX_SIZE_MB * 1024 * 1024) {\n alert(`ファイル名: ${file.name} が許容ファイルサイズの${MPM_MAX_SIZE_MB}MBを超えています。それ以下のサイズのファイルを選択してください。`);\n return;\n } else {\n dup_common_media_count_up++;\n fileObject = {};\n fileObject[dup_common_media_count_up] = file;\n mpm_files.push(fileObject);\n }\n }\n\n processFiles(Array.from(e.originalEvent.dataTransfer.files));\n mpm_preview_own_media_area.removeClass('back_ground_color_antiquewhite');\n });\n\n // let previewArea = document.querySelector(\".preview_shown_media_area\");\n // ! new Sortable(previewArea[0] の第一引数は HTML elementである必要がある(そうでないとエラーが起きる)ため、\n //! jqueryオブジェクトであるpreviewAreaを previewArea[0]とすることで、HTML elementに直している。\n let sortableInstance = new Sortable(previewArea[0], {\n animation: 150,\n handle: '.mpm_media_wrapper',\n });\n\n // ¥ event delegation\n // new用と edit用の二種類が必要! 要修正\n previewArea.on(\n 'click',\n '.mpm_delete_preview_icon',\n\n // ¥ dom上から削除した要素に対応する要素を配列から削除する\n function (e) {\n let parentElement = $(this).parent();\n let parentIndex = parentElement.index(); // get the index of the parent element in the DOM\n\n let existing_media_html_elements = $('.preview_shown_media_area_for_edit').children();\n\n let parentElementDataId = $(parentElement).data('id');\n parentElement.remove(); // remove the element from the DOM\n\n mpm_files = mpm_files.filter(function (item) {\n return Object.keys(item)[0] !== String(parentElementDataId);\n });\n // ¥ 20230818 プレビュー画面の画像が削除されたことを記録するflag\n }\n );\n\n function processFiles(files) {\n if (fileIndex < files.length) {\n // ¥ .then()はresolveしてから次の処理にう移るという意味 このようにすることでファイルが選択された順番を担保している\n processFile(files[fileIndex]).then(() => {\n fileIndex++;\n processFiles(files);\n });\n } else {\n fileIndex = 0;\n }\n }\n\n // ! 非同期 reader.readAsDataURL(file); のため、ファイルを追加した順で取得することができない\n // ! それを回避するためfunction processFiles(files) や resolveを使い、\n // ! ファイルを追加した順で表示させられるようにした 20230611\n function processFile(file) {\n return new Promise((resolve, reject) => {\n if (!file.type.match(/image.*|video.*/)) {\n // ¥ ファイルタイプが合わなければそこで処理を終了している\n resolve();\n }\n\n let reader = new FileReader();\n reader.onload = function (e) {\n let dataUrlScheme = reader.result;\n let fileName = encodeURIComponent(file.name);\n let src = e.target.result;\n\n if (file.type.match(/image.*/)) {\n appendMediaWithCheck('img', src, fileName, dataUrlScheme);\n } else if (validVideoTypes.includes(file.type)) {\n appendMediaWithCheck('video', src, fileName, dataUrlScheme);\n } else {\n return;\n }\n resolve();\n };\n reader.readAsDataURL(file);\n });\n }\n\n let hasAlerted = false;\n let hasAlertedCount = 0;\n\n // alertが複数回発生しないようにするために作成\n function appendMediaWithCheck(tagName, src, fileName, dataUrlScheme) {\n if ($('.mpm_media_wrapper').length < 10) {\n hasAlerted = false;\n hasAlertedCount = 0;\n } else if ($('.mpm_media_wrapper').length >= 10) {\n hasAlerted = true;\n }\n\n if (hasAlerted) {\n if (hasAlertedCount < 1) {\n alert('--紐付けることのできるファイルの上限10個を超えています。10個以内でファイルを選択してください--');\n }\n hasAlertedCount++;\n return;\n }\n\n appendMedia(tagName, src, fileName, dataUrlScheme);\n }\n\n function appendMedia(tagName, src, fileName, dataUrlScheme) {\n common_media_count_up++;\n let media;\n\n let closeTag = tagName == 'video' ? `` : '';\n media = `
\n <${tagName} class=\"mpm_preview_own_media pointer-events-none w-100px h-100px mr-1\" data-id=${common_media_count_up} controls src=\"${src}\">${closeTag}\n
\n \n \n \n
\n
`;\n\n previewArea.append(media);\n }\n\n submit_btn.off('click').on('click', function () {\n let mpm_instagram_url = mpm_instagram_url_obj.val().trim();\n if (mpm_instagram_url.endsWith('/')) {\n mpm_instagram_url = mpm_instagram_url.slice(0, -1);\n }\n\n let mpm_username = mpm_username_obj.val().trim();\n\n let mpm_caption;\n if (new_or_edit == 'new') {\n mpm_caption = $('#mpm_caption').val();\n } else if (new_or_edit == 'edit') {\n mpm_caption = $('#mpm_edit_caption').val();\n }\n\n // ¥ インスタurlが重複している時のalert\n if (mpm_instagram_url_obj.val()) {\n // ! && new_or_edit == 'new') を削除した 20230817\n if (all_db_permalink_list && all_db_permalink_list.includes(mpm_instagram_url_obj.val()) && new_or_edit == 'new') {\n // if (all_db_permalink_list && all_db_permalink_list.includes(mpm_instagram_url_obj.val())) {\n let yes_or_no = confirm('すでにこのインスタグラムのurlに紐づく投稿は登録されています。\\n既存の情報を全て削除し、今回の内容を新しく登録してもよろしいですか?');\n if (yes_or_no == false) {\n submit_btn.css('pointer-events', 'auto');\n return;\n } else {\n delete_existing_media_orders_flag = 1;\n }\n }\n }\n\n if (mpm_files.length === 0 && $('.preview_shown_media_area_for_edit').length === 0 && $('.mpm_media_wrapper').length === 0) {\n alert('画像か動画を少なくとも1つアップロードしてください。');\n submit_btn.css('pointer-events', 'auto');\n return;\n } else {\n // Add the code you want to execute when neither of the above conditions is met.\n }\n\n let formData = new FormData();\n formData.append('mpm_instagram_url', mpm_instagram_url);\n formData.append('mpm_caption', mpm_caption);\n formData.append('mpm_username', mpm_username);\n\n let newOrder = sortableInstance.toArray();\n\n let reorderedFiles;\n\n // Reorder the original list\n let new_reordered_list = newOrder.map((o) =>\n mpm_files.find((item) => {\n return String(Object.keys(item)[0]) === o;\n })\n );\n\n // ¥ Update the keys to be ascending from 1 inside each object\n let modified_reordered_list = new_reordered_list.map((obj, index) => {\n let key = Object.keys(obj)[0];\n let newObj = {};\n newObj[index + 1] = obj[key];\n return newObj;\n });\n\n //////////////// 保存 or 更新するメディアの追加方法別に配列を用意する ///////////////////////\n let reorderedFileArray = []; // FormData object (画像・動画アップロード)\n let reorderedMediaUrlArray = []; // Media url (メディアURL)\n let reorderedExistingDataArray = []; // DBに保存されているデータの更新 (DBのデータ)\n\n let FormDataOrderList = [];\n let MediaUrlOrderList = [];\n let DbExistingDataList = [];\n\n for (let i = 0; i < modified_reordered_list.length; i++) {\n let element = modified_reordered_list[i];\n\n for (let key in element) {\n let value = element[key];\n\n if (value instanceof File) {\n reorderedFileArray.push(value);\n FormDataOrderList.push(Number(key));\n } else if (typeof value === 'string' && (value.includes('https://') || value.includes('http://'))) {\n reorderedMediaUrlArray.push(value);\n MediaUrlOrderList.push(Number(key));\n } else if (typeof value === 'number') {\n reorderedExistingDataArray.push(value);\n DbExistingDataList.push(Number(key));\n }\n }\n }\n //////////////// 保存 or 更新するメディアの追加方法別に配列を用意する END ///////////////////////\n\n // ¥ 並び替えが終わった後のファイル順で ループする 20230614\n ///////////////////// FormDataOrderList ///////////////////////////\n reorderedFileArray.forEach(function (file, file_index) {\n // console.log(\"original-file:\", file.name);\n formData.append('mpm_file_type_list[]', file.type);\n formData.append('mpm_file_last_modified_list[]', file.lastModified); // Add this line\n // formData.append(\"mpm_file_order_list[]\", newOrder[file_index]); // 画像の元々の並び順\n formData.append('mpm_media_list[]', file);\n formData.set('mpm_delete_existing_media_orders_flag', delete_existing_media_orders_flag);\n // ¥ この順番がDBに保存される画像の順番となる\n formData.append('mpm_form_data_order_list[]', FormDataOrderList[file_index]);\n });\n\n ///////////////////// MediaUrlOrderList ///////////////////////////\n\n // ¥ 並び替えが終わった後のファイル順で ループする jsonで対応する\n let mpm_reordered_media_url_list = [];\n let mpm_file_type_list = [];\n let mpm_media_url_order_list = [];\n\n // MediaUrlOrderList!!!!!!! (4) [1, 4, 7, 8]\n if (reorderedMediaUrlArray.length > 0) {\n // ¥ 並び替えが終わった後のファイル順で ループする jsonで対応する\n reorderedMediaUrlArray.forEach(function (file, file_index) {\n let mpm_reordered_media_url = reorderedMediaUrlArray[file_index];\n mpm_reordered_media_url_list.push(mpm_reordered_media_url);\n\n let fileExtension = file.split('.').pop().toLowerCase();\n\n if (['mp4', 'webm', 'ogg'].includes(fileExtension)) {\n // aaa\n mpm_file_type_list.push('VIDEO');\n } else if (['jpg', 'jpeg', 'png', 'gif'].includes(fileExtension)) {\n // bbb\n mpm_file_type_list.push('IMAGE');\n }\n\n mpm_media_url_order_list.push(MediaUrlOrderList[file_index]);\n });\n }\n\n ///////////////////// DbExistingDataList ///////////////////////////\n // ¥ 並び替えが終わった後のファイル順で ループする jsonで対応する\n let mpm_reordered_existing_data_list = [];\n let mpm_existing_data_order_list = [];\n\n // DbExistingDataList!!!!!!! (4) [1, 4, 7, 8]\n if (reorderedExistingDataArray.length > 0) {\n // ¥ 並び替えが終わった後のファイル順で ループする jsonで対応する\n reorderedExistingDataArray.forEach(function (file, file_index) {\n let mpm_db_id = reorderedExistingDataArray[file_index];\n mpm_reordered_existing_data_list.push(mpm_db_id);\n mpm_existing_data_order_list.push(DbExistingDataList[file_index]);\n });\n }\n\n // ¥ 20230616 ajaxを関数にし、return $.ajax()とすることで Promiseを返し、そこから .then()でつなげることで ajaxの走る順番をコントロールできるようにしている\n // ! Make the ajax function return the Promise from $.ajax\n // ¥ 20230817\n // const ajax_save_manual_my_post = function (alarm_flag = true, sns_post_id_for_update = '') {\n const ajax_save_manual_my_post = function (alarm_flag = true, sns_post_id_for_update = '', delete_existing_media_orders_flag = 0) {\n if (sns_post_id_for_update === null) {\n sns_post_id_for_update = '';\n }\n formData.append('sns_post_id_for_update', sns_post_id_for_update);\n // ! 20230818 editの処理で全ての画像を削除してから画像を追加したときの動作時に既存のデータを削除し、新しいデータのみを追加するために下記を追加\n formData.set('mpm_delete_existing_media_orders_flag', delete_existing_media_orders_flag);\n\n return $.ajax({\n url: '/save_manual_my_post',\n type: 'POST',\n data: formData,\n contentType: false,\n processData: false,\n })\n .done(function (data) {\n if ((new_or_edit = 'new')) {\n if (alarm_flag) {\n alert(`投稿情報を登録しました。`);\n location.reload();\n }\n }\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n console.log(`errorThrown... ${errorThrown}`);\n console.log(`jqXHR... ${jqXHR}`);\n // Check if the server sent a custom error message\n let customMessage = jqXHR.responseJSON && jqXHR.responseJSON.message;\n console.log('customMessage:::', customMessage);\n let err_msg = '予期せぬエラーが発生しました。ファイル名に特殊文字(絵文字や【】等)が含まれている場合は削除し、ファイル名が長い場合は、短くしてから再度お試しください。';\n alert(err_msg);\n location.reload();\n });\n };\n\n const ajax_save_manual_my_post_media_url = function (\n // ¥ 20230817\n sns_post_id_for_update = '',\n mpm_file_type_list,\n mpm_reordered_media_url_list,\n mpm_media_url_order_list,\n // ¥ 上書き用\n delete_existing_media_orders_flag,\n alarm_flag = true,\n // ¥ .then() で取得する 前の処理で新たに作成されたレコードをハッシュ形式で保持 {1078=>1}\n // ¥ editの際に直前の関数で新たに作成されたレコードを引き継ぐために使用する\n created_records_hash = ''\n ) {\n return $.ajax({\n url: '/save_manual_my_post_media_url',\n type: 'POST',\n data: {\n // ¥ 20230817\n sns_post_id_for_update: sns_post_id_for_update,\n mpm_instagram_url: mpm_instagram_url,\n mpm_caption: mpm_caption,\n mpm_delete_existing_media_orders_flag: delete_existing_media_orders_flag,\n mpm_file_type_list: mpm_file_type_list,\n // urlを保持\n mpm_reordered_media_url_list: mpm_reordered_media_url_list,\n // メディアの並び順を保持\n mpm_media_url_order_list: mpm_media_url_order_list,\n created_records_hash: created_records_hash,\n },\n dataType: 'json',\n })\n .done(function (data) {\n if (alarm_flag) {\n alert(`投稿情報を登録しました。`);\n location.reload();\n }\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n console.log(`errorThrown... ${errorThrown}`);\n console.log(`jqXHR... ${jqXHR}`);\n // Check if the server sent a custom error message\n let customMessage = jqXHR.responseJSON && jqXHR.responseJSON.message;\n console.log('customMessage:::', customMessage);\n let err_msg = '予期せぬエラーが発生しました。ファイル名に特殊文字(絵文字や【】等)が含まれている場合は削除し、ファイル名が長い場合は、短くしてから再度お試しください。';\n alert(err_msg);\n location.reload();\n });\n };\n\n // ¥ 更新用\n const ajax_update_manual_my_post = function (\n sns_post_id_for_update,\n mpm_instagram_url,\n mpm_caption,\n mpm_existing_data_order_list,\n mpm_reordered_existing_data_list,\n // ¥ 上書き用\n delete_existing_media_orders_flag,\n alarm_flag = true,\n // 20230818\n // sns_post_id_and_created_records_hash_list\n created_records_hash\n ) {\n if (!sns_post_id_for_update) {\n sns_post_id_for_update = sns_post_id_and_created_records_hash_list['sns_post_id'];\n }\n return $.ajax({\n url: '/update_manual_my_post',\n type: 'POST',\n data: {\n mpm_sns_post_id: sns_post_id_for_update,\n mpm_instagram_url: mpm_instagram_url,\n mpm_username: mpm_username,\n mpm_caption: mpm_caption,\n mpm_delete_existing_media_orders_flag: delete_existing_media_orders_flag,\n // my_post_media_orders の各レコードのid を配列で保持\n mpm_reordered_existing_data_list: mpm_reordered_existing_data_list,\n // メディアの並び順を保持\n mpm_existing_data_order_list: mpm_existing_data_order_list,\n created_records_hash,\n },\n dataType: 'json',\n })\n .done(function (data) {\n if (alarm_flag) {\n alert(`投稿情報を登録しました。`);\n location.reload();\n }\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n console.log(`errorThrown... ${errorThrown}`);\n console.log(`jqXHR... ${jqXHR}`);\n // Check if the server sent a custom error message\n let customMessage = jqXHR.responseJSON && jqXHR.responseJSON.message;\n console.log('customMessage:::', customMessage);\n let err_msg = '予期せぬエラーが発生しました。ファイル名に特殊文字(絵文字や【】等)が含まれている場合は削除し、ファイル名が長い場合は、短くしてから再度お試しください。';\n alert(err_msg);\n location.reload();\n });\n };\n\n // ¥ 1 下記のように .then で繋げて、前の非同期処理が完全に終了してから次の非同期処理に進ませる 20230616\n if (new_or_edit === 'new') {\n if (reorderedFileArray.length == 0 && reorderedMediaUrlArray.length == 0) {\n alert('画像、動画を1枚以上選択してください。');\n submit_btn.css('pointer-events', 'auto'); // 20230817\n }\n // ¥ 新規登録の場合の処理\n if (reorderedFileArray.length > 0 && reorderedMediaUrlArray.length > 0) {\n // console.log('ajax 1 ajax_save_manual_my_post().then(ajax_save_manual_my_post_media_url);');\n ajax_save_manual_my_post((alarm_flag = false), sns_post_id_for_update).then(function (sns_post_id_and_created_records_hash_list = {}) {\n if (!sns_post_id_for_update) {\n sns_post_id_for_update = sns_post_id_and_created_records_hash_list['sns_post_id'];\n }\n ajax_save_manual_my_post_media_url(\n sns_post_id_for_update,\n mpm_file_type_list,\n mpm_reordered_media_url_list,\n mpm_media_url_order_list,\n // ¥ DBの初期化はajax_save_manual_my_post()で行われるため2回目ではしない設定に上書きする\n (delete_existing_media_orders_flag = 0),\n (alarm_flag = true),\n (created_records_hash = sns_post_id_and_created_records_hash_list['created_records'])\n );\n });\n } else if (reorderedFileArray.length > 0 && reorderedMediaUrlArray.length == 0) {\n // console.log('ajax 2 ajax_save_manual_my_post();');\n ajax_save_manual_my_post((alarm_flag = true), sns_post_id_for_update);\n }\n // ¥ 3\n else if (reorderedFileArray.length == 0 && reorderedMediaUrlArray.length > 0) {\n // console.log('ajax 3 ajax_save_manual_my_post_media_url();');\n ajax_save_manual_my_post_media_url(\n sns_post_id_for_update,\n mpm_file_type_list,\n mpm_reordered_media_url_list,\n mpm_media_url_order_list,\n // ¥ DBの初期化はajax_save_manual_my_post()で行われるため2回目ではしない設定に上書きする\n delete_existing_media_orders_flag,\n (alarm_flag = true),\n // ¥ .then() で取得する 前の処理で新たに作成されたレコードをハッシュ形式で保持 {1078=>1}\n // ¥ editの際に直前の関数で新たに作成されたレコードを引き継ぐために使用する\n (created_records_hash = '')\n );\n }\n\n //^ /////////////////////// 画像の並び順や差し替え等の変更を行う場合 //////////////////////\n } else if (new_or_edit === 'edit') {\n // ¥検証 20230617\n if (reorderedFileArray.length === 0 && reorderedMediaUrlArray.length === 0 && reorderedExistingDataArray.length === 0) {\n alert('メディアを1枚以上選択してください。');\n return;\n } else if (reorderedFileArray.length > 0 && (reorderedMediaUrlArray.length > 0) & (reorderedExistingDataArray.length > 0)) {\n // console.log('edit 01 ajax 1 ajax_save_manual_my_post().then(ajax_save_manual_my_post_media_url);');\n // ¥ sns_post_id_and_created_records_hash_list は コントローラーの def save_manual_my_post の return\n ajax_save_manual_my_post((alarm_flag = false), sns_post_id_for_update).then(function (sns_post_id_and_created_records_hash_list = {}) {\n ajax_save_manual_my_post_media_url(\n // ¥ 20230817\n (sns_post_id_for_update = sns_post_id_and_created_records_hash_list['sns_post_id']),\n mpm_file_type_list,\n mpm_reordered_media_url_list,\n mpm_media_url_order_list,\n // ¥ DBの更新及び削除はajax_update_manual_my_postでするため 0\n (delete_existing_media_orders_flag = 0),\n (alarm_flag = false),\n // (alarm_flag = true),\n // created_records_hash\n (created_records_hash = sns_post_id_and_created_records_hash_list['created_records'])\n // ).then(function (created_records_hash = '', sns_post_id_for_update = '') {\n ).then(function (sns_post_id_and_created_records_hash_list = {}) {\n ajax_update_manual_my_post(\n (sns_post_id_for_update = sns_post_id_and_created_records_hash_list['sns_post_id']),\n mpm_instagram_url,\n mpm_caption,\n mpm_existing_data_order_list,\n mpm_reordered_existing_data_list,\n // ¥ DBの初期化はajax_save_manual_my_post()で行われるため2回目ではしない設定に上書きする\n (delete_existing_media_orders_flag = 1),\n (alarm_flag = true),\n (created_records_hash = sns_post_id_and_created_records_hash_list['created_records'])\n );\n });\n });\n } else if (reorderedFileArray.length == 0 && (reorderedMediaUrlArray.length > 0) & (reorderedExistingDataArray.length > 0)) {\n // console.log('edit ajax 2 ajax_save_manual_my_post().then(ajax_save_manual_my_post_media_url);');\n ajax_save_manual_my_post_media_url(\n // 20230817\n sns_post_id_for_update,\n mpm_file_type_list,\n mpm_reordered_media_url_list,\n mpm_media_url_order_list,\n // ¥ DBの更新及び削除はajax_update_manual_my_postでするため 0\n (delete_existing_media_orders_flag = 0),\n // (alarm_flag = false)\n (alarm_flag = false)\n //¥ def save_manual_my_post_media_url の結果(render json: sns_post_id_and_created_records_hash_list)を取得する 20230817\n ).then(function (sns_post_id_and_created_records_hash_list) {\n if (!sns_post_id_for_update) {\n sns_post_id_for_update = sns_post_id_and_created_records_hash_list['sns_post_id'];\n }\n ajax_update_manual_my_post(\n sns_post_id_for_update,\n mpm_instagram_url,\n mpm_caption,\n mpm_existing_data_order_list,\n mpm_reordered_existing_data_list,\n // ¥ DBの初期化はajax_save_manual_my_post()で行われるため2回目ではしない設定に上書きする\n (delete_existing_media_orders_flag = 1),\n (alarm_flag = true),\n (created_records_hash = sns_post_id_and_created_records_hash_list['created_records'])\n );\n });\n } else if (reorderedFileArray.length > 0 && (reorderedMediaUrlArray.length === 0) & (reorderedExistingDataArray.length > 0)) {\n // console.log('ajax 3 ajax_save_manual_my_post().then(ajax_save_manual_my_post_media_url);');\n\n // - 20230817 引数に sns_post_id_for_update を追加\n ajax_save_manual_my_post((alarm_flag = false), (sns_post_id_for_update = sns_post_id_for_update)).then(function (sns_post_id_and_created_records_hash_list = {}) {\n ajax_update_manual_my_post(\n (sns_post_id_for_update = sns_post_id_and_created_records_hash_list['sns_post_id']),\n mpm_instagram_url,\n mpm_caption,\n mpm_existing_data_order_list,\n mpm_reordered_existing_data_list,\n // ¥ DBの初期化はajax_save_manual_my_post()で行われるため2回目ではしない設定に上書きする\n (delete_existing_media_orders_flag = 1),\n (alarm_flag = true),\n (created_records_hash = sns_post_id_and_created_records_hash_list['created_records'])\n );\n });\n } else if (reorderedFileArray.length === 0 && (reorderedMediaUrlArray.length === 0) & (reorderedExistingDataArray.length > 0)) {\n // console.log('ajax 4 ajax_save_manual_my_post().then(ajax_save_manual_my_post_media_url);');\n ajax_update_manual_my_post(\n sns_post_id_for_update,\n mpm_instagram_url,\n mpm_caption,\n mpm_existing_data_order_list,\n mpm_reordered_existing_data_list,\n // ¥ DBの初期化はajax_save_manual_my_post()で行われるため2回目ではしない設定に上書きする\n (delete_existing_media_orders_flag = 1),\n (alarm_flag = true),\n (created_records_hash = '')\n );\n }\n // ¥ 20230818 編集画面でプレビューの画像を全て削除してから画像を追加している処理の場合の場合分け\n else if (reorderedFileArray.length > 0 && reorderedMediaUrlArray.length > 0) {\n // console.log('ajax 6 ajax_save_manual_my_post().then(ajax_save_manual_my_post_media_url);');\n // ! 20230818 delete_existing_media_orders_flag = 1を 追加 プレビュー画像を全て消してから追加の処理をしているため一度、既存のデータを削除し、その上に新しいデータを追加するため\n ajax_save_manual_my_post((alarm_flag = false), sns_post_id_for_update, (delete_existing_media_orders_flag = 1)).then(function (sns_post_id_and_created_records_hash_list = {}) {\n ajax_save_manual_my_post_media_url(\n sns_post_id_for_update,\n mpm_file_type_list,\n mpm_reordered_media_url_list,\n mpm_media_url_order_list,\n // ¥ DBの初期化はajax_save_manual_my_post()で行われるため2回目ではしない設定に上書きする\n (delete_existing_media_orders_flag = 0),\n (alarm_flag = true),\n // created_records_hash\n (created_records_hash = sns_post_id_and_created_records_hash_list['created_records'])\n );\n });\n } else if (reorderedFileArray.length > 0 && reorderedMediaUrlArray.length == 0) {\n // console.log('ajax 7 ajax_save_manual_my_post();');\n ajax_save_manual_my_post((alarm_flag = true), sns_post_id_for_update, (delete_existing_media_orders_flag = 1));\n }\n // ¥ 3\n else if (reorderedFileArray.length == 0 && reorderedMediaUrlArray.length > 0) {\n // console.log('ajax 8 ajax_save_manual_my_post_media_url();');\n ajax_save_manual_my_post_media_url(\n sns_post_id_for_update,\n mpm_file_type_list,\n mpm_reordered_media_url_list,\n mpm_media_url_order_list,\n // ¥ DBの初期化はajax_save_manual_my_post()で行われるため2回目ではしない設定に上書きする\n (delete_existing_media_orders_flag = 1),\n (alarm_flag = true),\n // ¥ .then() で取得する 前の処理で新たに作成されたレコードをハッシュ形式で保持 {1078=>1}\n // ¥ editの際に直前の関数で新たに作成されたレコードを引き継ぐために使用する\n (created_records_hash = '')\n );\n }\n }\n });\n return previewArea;\n };\n\n let mpm_url_list = [];\n\n // プレビューエリアにメディアを表示させる処理\n const insert_media_to_preview_area = function (preview_area, mpm_media_url_list, media_url_count_up) {\n for (let mmu_idx = 0; mmu_idx < mpm_media_url_list.length; mmu_idx++) {\n let media_url = mpm_media_url_list[mmu_idx];\n\n dup_common_media_count_up = common_media_count_up;\n\n dup_common_media_count_up++;\n // ¥ 並び替えされる前の挿入された順を保持するために作成\n fileObject = {};\n fileObject[dup_common_media_count_up] = media_url;\n mpm_files.push(fileObject);\n\n media_url_count_up++;\n\n if ($('.mpm_media_wrapper') && $('.mpm_media_wrapper').length >= 10) {\n alert('▼紐付けることのできるファイルの上限10個を超えています。10個以内でファイルを追加してください');\n // ¥ すでに配列に含まれてしまった超過分の要素を削除する\n mpm_files.pop();\n break;\n }\n\n // Obtain the file extension\n let fileExtension = media_url.split('.').pop().toLowerCase();\n\n common_media_count_up++;\n\n // Define media tags based on file type\n let media;\n if (['mp4', 'webm', 'ogg'].includes(fileExtension)) {\n // add more video extensions if needed\n media = `
\n \n
\n \n \n \n
\n
`;\n } else if (['jpg', 'jpeg', 'png', 'gif'].includes(fileExtension)) {\n // add more image extensions if needed\n media = `
\n \n
\n \n \n \n
\n
`;\n }\n preview_area.first().append(media);\n } // for文 end\n };\n\n // ¥ モーダル処理\n\n $('#new_mpm_post_set_btn')\n .off('click')\n .on('click', function () {\n conduct_sortable('new'); //¥ 新規登録時の処理\n // $('.mpm_platta_ig_modal_container').fadeIn(100);\n\n let media_url_count_up = -1;\n\n // ¥ 画像urlをプレビューエリアに表示させる処理\n $('.mpm_media_url__add_btn')\n .first()\n .off('click')\n .on('click', function () {\n let mpm_media_url_list = get_url_list('#mpm_media_url');\n\n if (mpm_media_url_list === null) return;\n\n $('#mpm_media_url').val('');\n\n const $preview_shown_media_area = $('.preview_shown_media_area');\n insert_media_to_preview_area($preview_shown_media_area, mpm_media_url_list, media_url_count_up);\n });\n });\n\n // ^ 新規登録 及び 編集モーダルを閉じる\n $('.mpm_platta_ig_modal_del')\n .off('click')\n .on('click', function () {\n $('.mpm_platta_ig_modal_container, .mpm_platta_ig_edit_modal_container').fadeOut(0);\n location.reload();\n });\n $('.mpm_platta_ig_edit_modal_del')\n .off('click')\n .on('click', function () {\n $('.mpm_platta_ig_edit_modal_container').fadeOut(0);\n location.reload();\n });\n $('.mpm_platta_ig_modal_bg')\n .off('click')\n .on('click', function () {\n $('.mpm_platta_ig_modal_container').fadeOut(0);\n $('.mpm_platta_ig_edit_modal_container').fadeOut(0);\n location.reload();\n });\n\n // !!!!!!!!!!!!!!!!!!!!!! サーチ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n $('#mpm_search__search').on('keypress', function (e) {\n if (e.which === 13) {\n e.preventDefault(); // デフォルトのエンターキーの挙動を無効にする\n let search_word = $(this).val();\n if (search_word.endsWith('/')) {\n search_word = search_word.slice(0, -1);\n }\n location.href = `/manual_add_sns_post?mpm_item=${search_word}`;\n }\n });\n\n // !!!!!!!!!!!!!!!!!!!!!! サーチ リセット !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n $('.all_mpm_item_list')\n .off('click')\n .on('click', function () {\n location.href = `/manual_add_sns_post`;\n });\n\n // ¥ sns_postsを更新する際に使用する 20230617\n // !!!!!!!!!!!!!!!!!!!!!! 編集モーダル!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n $('.mpm_item_list__edit')\n .off('click')\n .on('click', function () {\n let mpm_item_instagram_url = $(this).data('instagram_url');\n let mpm_username = $(this).data('username');\n // let mpm_item_price = $(this).data(\"price\");\n let mpm_item_caption = $(this).data('caption');\n let mpm_sns_post_id = String($(this).data('id'));\n\n let mpm_item_list = $('.mpm_item_list__product_media')\n .map(function () {\n let src = $(this).attr('src');\n let dataSnsPostId = $(this).attr('data-sns_post_id');\n let data_mpm = $(this).attr('data-mpm_id');\n if (dataSnsPostId === mpm_sns_post_id) {\n return { mpm_id: data_mpm, src: src };\n }\n })\n .get();\n\n // !!!!!!!!!!! sortable の処理 !!!!!!!!!!!!!!!!!!!!!!!!!!!\n let previewArea = conduct_sortable('edit', mpm_sns_post_id); // ¥ 編集ボタンが押された時\n // !!!!!!!!!!! 編集画面上のsortable の処理 END !!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n // !!!!!!! data-idで一意の値を持たせる\n\n mpm_item_list.forEach((mpm_item, mpm_idx) => {\n common_media_count_up++;\n let src = mpm_item['src'];\n let data_mpm_id = Number(mpm_item['mpm_id']);\n\n let fileExtension = src.split('.').pop().toLowerCase();\n\n // ¥ 画像か動画かによって保存先を変更する\n if (['mp4', 'webm', 'ogg'].includes(fileExtension)) {\n previewArea.append(`\n
\n \n
\n \n \n \n
\n
`);\n } else if (['jpg', 'jpeg', 'png', 'gif'].includes(fileExtension)) {\n previewArea.append(`\n
\n \n
\n \n \n \n
\n
`);\n }\n\n // ¥ 編集時\n let tmp_obj = {};\n tmp_obj[common_media_count_up] = data_mpm_id;\n mpm_files.push(tmp_obj);\n });\n\n existing_media_html_elements = $('.preview_shown_media_area_for_edit').children();\n\n $('#mpm_edit_instagram_url').val(mpm_item_instagram_url);\n $('#mpm_edit_caption').val(mpm_item_caption);\n $('#mpm_edit_username').val(mpm_username);\n $('.mpm_platta_ig_edit_modal_container').fadeIn(100);\n\n let media_url_count_up = -1;\n\n // ¥ 画像urlをプレビューエリアに表示させる処理 20230615\n $('.mpm_edit_media_url__add_btn')\n .off('click')\n .on('click', function () {\n let mpm_media_url_list = get_url_list('#mpm_edit_media_url');\n\n // ¥ 20230817\n if (mpm_media_url_list === null) return;\n\n $('#mpm_edit_media_url').val('');\n\n const $preview_shown_media_area_for_edit = $('.preview_shown_media_area_for_edit');\n insert_media_to_preview_area($preview_shown_media_area_for_edit, mpm_media_url_list, media_url_count_up);\n });\n });\n\n // ¥ textareaに入力された画像urlを配列で取得する\n const get_url_list = function (element) {\n // 画像url一覧取得\n let mpm_media_url_jq_list = $(element).val();\n\n let mpm_media_url_list;\n if (mpm_media_url_jq_list) {\n let mpm_media_url_str = $(element).val();\n // ¥ 余分な空白等含む可能性あり\n mpm_media_url_list = mpm_media_url_str.split('\\n');\n\n // ¥ 要素についているかもしれない前後の空白除去及び 'https://~ ' や \"https://~ \"などの ' や \"を削除\n mpm_media_url_list = $.map(mpm_media_url_list, function (url, idx) {\n return url.replace(/'/g, '').replace(/\"/g, '').replace(/,/g, '').trim();\n });\n return mpm_media_url_list;\n } else {\n alert('追加したい投稿のURLを少なくとも1つ入力してください。');\n return null;\n }\n };\n\n // my_post_media_ordersテーブルのレコードのidをarrayで取得する\n function get_delete_subject_my_post_media_order_ids(clickedElement) {\n // Find the closest parent tr element\n let closestTr = clickedElement.closest('tr');\n\n // Find all img elements within this tr and extract their data-mpm_id values\n let my_post_media_order_ids = closestTr\n .find('img, video')\n .map(function () {\n return $(this).data('mpm_id'); // Corrected this line\n })\n .get();\n\n // Now my_post_media_order_ids contains all the data-mpm_id values\n // 例: (4) [1994, 1995, 1996, 1997]\n return my_post_media_order_ids; // Ensure to return the values\n }\n\n $(function () {\n // $('.mpm_item_list_table').on('click', '#mpm_item_delete', function () {\n $('.mpm_item_list_table')\n .off('click')\n .on('click', '.mpm_item_delete', function () {\n let mpm_sns_post_id = $(this).data('id');\n let mpm_post_type = $(this).data('post_type');\n let clickedElement = $(this);\n console.log('clickedElement :>> ', clickedElement);\n let my_post_media_order_ids = get_delete_subject_my_post_media_order_ids(clickedElement);\n console.log('my_post_media_order_ids :>> ', my_post_media_order_ids);\n\n if (confirm('この投稿を削除しますか?')) {\n $.ajax({\n url: '/delete_manual_my_post',\n type: 'POST',\n data: {\n mpm_sns_post_id: mpm_sns_post_id,\n mpm_post_type: mpm_post_type,\n delete_flag: 0,\n my_post_media_order_ids: my_post_media_order_ids,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('投稿を削除しました。');\n clickedElement.closest('tr').remove();\n location.reload();\n // 連携の確認をするかもしれないため一応残しておく\n } else if (data.ret == '1') {\n if (!confirm('UGC投稿と連携されています。削除する場合は、連携も解除されます。本当に削除しますか?')) {\n return;\n } else {\n $.ajax({\n url: '/delete_manual_my_post',\n type: 'POST',\n data: {\n product_id: product_id,\n product_code: product_code,\n delete_flag: 1,\n },\n dataType: 'json',\n })\n .done(function (data) {\n if (data.ret == '0') {\n alert('商品を削除しました。投稿との連携も解除しました。');\n location.reload();\n }\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n alert('削除に失敗しました。時間を空けてから再度お試しください');\n console.log(`errorThrown... ${errorThrown}`);\n console.log(`jqXHR... ${jqXHR}`);\n });\n }\n }\n });\n }\n });\n }); // end $('.mpm_ugc_set_btn') click\n});\n","document.addEventListener('turbolinks:load', function () {\n // ¥ 開発環境での開発スピードを上げるため青木の開発環境でのみ\n // ¥ manage/app/javascript/packs内の本jsファイルを走らせない\n if ((location.href.includes('dev-manage-ssl.platta.jp') || location.href.includes('http://18.177.103.115:3004')) && !location.href.includes('?dev27aoki')) {\n console.log('dev環境 public.jsを使用');\n return;\n }\n\n const ERROR_MSG = 'エラー! 処理を完了できませんでした\\n時間おいて再度実行しても、このエラーが修正されない場合は\\nお手数ですがサポートチームにお問い合わせください';\n const MAIL_PATTERN = /^[a-zA-Z0-9_+-]+(.[a-zA-Z0-9_+-]+)*@([a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]*\\.)+[a-zA-Z]{2,}$/;\n const PASSWORD_PATTERN = /([0-9].*[a-zA-Z]|[a-zA-Z].*[0-9])/;\n\n const DOMAIN = $('#pl_domain').val();\n\n //- ハッシュタグ検索の初期の画面でフィルターをかける処理\n let current_url = window.location.href;\n\n // console.log(\"manual_my_post_display.js --- 20230622\");\n\n // !!!!!!!!!!!!!!!!! ここから !!!!!!!!!!!!!!!!!!!!!!!!!\n\n //¥ ボタンを押下したタイミングで複数の選択されたタグ名及び検索タイプを配列で取得する\n $('#mas_submit, #mas_submit_2').on('click', function (e) {\n let mas_ugc_urls = $('#mas_ugc_urls').val();\n // ¥ 余分な空白等含む可能性あり\n let mas_ugc_urls_list = mas_ugc_urls.split('\\n');\n // console.log(\"mas_ugc_urls_list:\", mas_ugc_urls_list);\n\n // ¥ 要素についているかもしれない前後の空白除去及び 'https://~ ' や \"https://~ \"などの ' や \"を削除\"\n mas_ugc_urls_list = $.map(mas_ugc_urls_list, function (url, idx) {\n return url.replace(/'/g, '').replace(/\"/g, '').replace(/,/g, '').trim();\n });\n\n // ¥ 20230423 ローカルストレージに保存する\n let mas_ugc_urls_list_str = JSON.stringify(mas_ugc_urls_list);\n localStorage.setItem(`mas_ugc_urls_list`, mas_ugc_urls_list_str);\n\n $.ajax({\n url: DOMAIN + '/mas_filter_own_post_ugc',\n type: 'GET',\n dataType: 'json',\n data: {\n // mas_ugc_urls_list: mas_ugc_urls_list,\n mas_ugc_urls_list: localStorage.getItem(`mas_ugc_urls_list`),\n },\n })\n .done(function (data_fr_ruby) {\n const filter_condition = mas_get_all_filter_condition();\n // ¥ &ugc_check=1 を url_query_path に加え、ボタンを押下したタイミングでのみのpath\n\n // let mas_url;\n // if (current_url.includes(\"/hashtag_list\")) {\n // mas_url = \"/hashtag_list\";\n // } else if (current_url.includes(\"/my_post_list\")) {\n // mas_url = \"/my_post_list\";\n // }\n\n let mas_url = '/manual_add_sns_post_display';\n\n url_query_path = `${mas_url}?initial_date=${filter_condition['initial_date']}&end_date=${filter_condition['end_date']}&search_condition=${filter_condition['search_condition']}&${filter_condition['excluded_words']}&per_page_num=${filter_condition['per_page_num']}&ugc_check=1`;\n\n let storage_mas_ugc_urls_list = localStorage.getItem(`mas_ugc_urls_list`);\n\n if (storage_mas_ugc_urls_list) {\n storage_mas_ugc_urls_list = JSON.parse(storage_mas_ugc_urls_list);\n storage_mas_ugc_urls_list = storage_mas_ugc_urls_list.join('\\n');\n // console.log(\"storage_mas_ugc_urls_list\", storage_mas_ugc_urls_list);\n }\n\n location.href = url_query_path;\n })\n .fail(function (jqXHR, textStatus, errorThrown) {});\n\n // ¥ ugc検索をする場合はreturnし、あとの処理を走らせない 20230422\n if (mas_ugc_urls_list.length > 0) {\n return;\n }\n\n // - 投稿の種類(最近の投稿 or 人気の投稿)を取得する\n let display_type = $('.display_type:checked').val();\n\n // - 表示する期間\n let initial_date = $('#mas_hashtag_initial_date').val();\n let end_date = $('#mas_hashtag_end_date').val();\n\n //- タググループのidとnameを取得する\n let tgg_id = $('#mas_selected_hashtag_group option:selected').val();\n let tgg_name = $('#mas_selected_hashtag_group option:selected').data('name');\n\n //- ハッシュタグ検索一覧ページ内に表示する投稿の数を取得する\n let per_page_num = $('#mas_per_page_num option:selected').val();\n\n //¥ Not条件で検索結果家から除外するハッシュタグや言葉を取得\n let excluded_words = $('#mas_excluded_words').val().trim();\n\n // * 改行コードを含んだ文字列を配列にする\n let excluded_word_list = excluded_words.split(/\\r\\n|\\r|\\n/);\n\n // 配列の中の空要素を削除し、空要素のない配列を作る\n excluded_word_list = $.grep(excluded_word_list, function (value) {\n return value != '';\n });\n if (current_url.includes('/my_post_list?')) {\n let url_query_path = `/my_post_list?display_type=${display_type}&initial_date=${initial_date}&end_date=${end_date}&per_page_num=${per_page_num}`;\n if (excluded_word_list) {\n excluded_word_list.forEach(function (excluded_word, index) {\n url_query_path = url_query_path + `&excluded_word_${index}=${excluded_word}`;\n });\n }\n\n // ¥ 20230424\n\n location.href = url_query_path;\n } else if (current_url.includes('/hashtag_list')) {\n // ¥ 投稿収集一覧用 20230320\n let url_query_path = `/hashtag_list?display_type=${display_type}&initial_date=${initial_date}&end_date=${end_date}&tgg_id=${tgg_id}&tgg_name=${tgg_name}&per_page_num=${per_page_num}`;\n\n selected_tag_names.forEach(function (tag_name, index) {\n url_query_path = url_query_path + `&tag_name_${index}=${tag_name}`;\n });\n\n selected_tag_ids.forEach(function (tag_id, index) {\n url_query_path = url_query_path + `&tag_id_${index}=${tag_id}`;\n });\n\n if (excluded_word_list) {\n excluded_word_list.forEach(function (excluded_word, index) {\n url_query_path = url_query_path + `&excluded_word_${index}=${excluded_word}`;\n });\n }\n location.href = url_query_path;\n }\n });\n\n $('.post_regist_publish_btn').on('click', function () {\n let show_hashtag = $(this).data('show_hashtag');\n let id = $(this).data('id');\n if (show_hashtag == '0') {\n $.ajax({\n url: '/show_hashtag_ok',\n type: 'POST',\n data: {\n id: id,\n show_hashtag: show_hashtag,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n } else if (show_hashtag == '1') {\n $.ajax({\n url: '/show_hashtag_no',\n type: 'POST',\n data: {\n id: id,\n show_hashtag: show_hashtag,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n }\n });\n\n // ¥ 現在選ばれている絞り込みの状態を取得 20230423\n const mas_get_all_filter_condition = function () {\n // - 投稿の種類(最近の投稿 or 人気の投稿)を取得する\n\n // - 表示する期間\n let initial_date = $('#mas_hashtag_initial_date').val();\n let end_date = $('#mas_hashtag_end_date').val();\n\n //- AND / OR 検索のidを取得する\n let search_condition = $('#mas_search_condition option:selected').val();\n\n //- ハッシュタグ検索一覧ページ内に表示する投稿の数を取得する\n let per_page_num = $('#mas_per_page_num option:selected').val();\n $('#mas_tag_list').remove();\n\n result = {\n initial_date: initial_date,\n end_date: end_date,\n search_condition: search_condition,\n per_page_num: per_page_num,\n };\n\n // console.log(\"result---- : \", result);\n\n return result;\n };\n\n //- 青木 ★要更新 - 20231227\n ////// 新規お客さんがSMMに乗り換えるときに手動で過去のUGCを登録できるようにするためにユーザー名を入力できるようにする //////\n // ¥ UGC連携 / ユーザーネーム登録のoverlay用\n $('.mas_username_input__modal_bg').on('click', function () {\n $('.mas_username_input__modal_bg').css('display', 'none');\n $('.mas_username_input__modal_container').css('display', 'none');\n $('body').css('overflow', 'auto');\n });\n\n // ¥ .mas_ugc_set_btnを押したときの処理 username矯正入力及び連携モーダルを出現させる\n $('.mas_ugc_set_btn')\n .off()\n .on('click', function () {\n $('body').css('overflow', 'hidden'); // Disable scrolling\n $('.mas_username_input__modal_bg').css('display', 'block');\n\n // ¥ username取得のためリンクを貼る\n let permalink = $(this).attr('data-permalink');\n $('.mas_username_input__redirect_url').attr('href', permalink);\n\n let username = $(this).attr('data-username');\n username = username ? username : '';\n\n $('.mas_username_input__input').val(username);\n\n // ¥ 初期化処理\n $('.mas_username_input__notice_message').remove();\n $('.mas_username_input__warning_message').remove();\n $('.mas_username_input__modal_submit').css({ 'pointer-events': 'auto', background: 'blue' });\n\n // if (username) {\n // // $('.mas_username_input__modal_submit').css({ 'pointer-events': 'none', background: 'gray' });\n // $('.mas_username_input__input').before(\"
※ユーザーネームはすでに登録されています。
ユーザーネームに誤りがある場合のみ
再登録してください。
\");\n // } else if (!username) {\n // $('.mas_username_input__modal_submit').css({ 'pointer-events': 'none', background: 'gray' });\n // $('.mas_username_input__input').before(\"
※ユーザーネームが登録されていません。
登録完了後、連携ボタンを利用できます。
\");\n // }\n\n $('.mas_username_input__modal_container').css('display', 'block');\n\n // let sns_post_id = $(this).data('id');\n let sns_post_id = $(this).data('sns_post_id');\n $('.mas_username_input__modal_submit').attr('data-sns_post_id', sns_post_id);\n\n // let parent_media_id = $(this).data('parent_media_id');\n // $('.mas_username_input__modal_submit').attr('data-parent_media_id', parent_media_id);\n\n let $this = $(this);\n\n // UGC group linking modal display\n $('.mas_username_input__modal_del').on('click', function () {\n $('body').css('overflow', 'auto');\n $('.mas_username_input__modal_container').css('display', 'none');\n });\n\n // ¥ ユーザーネームを手動登録\n $('.mas_username_input__username_submit')\n .off()\n .on('click', function () {\n let input_username = $('.mas_username_input__input').val();\n // if (!input_username) {\n // alert(`ユーザーネームが入力されていません。`);\n // return;\n // }\n console.log('input_username :>> ', input_username);\n $.ajax({\n url: '/mas_save_manual_ugc_username',\n type: 'POST',\n data: {\n sns_post_id: sns_post_id,\n input_username: input_username,\n },\n dataType: 'json',\n })\n .done(function (data) {\n alert('ユーザーネームを登録されました。画面を再読込みすると、画面に変更が反映されます。');\n // alert(data.success_message);\n // location.reload();\n // ¥ 連携するボタンを押せるようにする\n $('.mas_username_input__modal_submit').css({ 'pointer-events': 'auto', background: 'blue' });\n $('body').css('overflow', 'auto');\n $this.closest('.mas_tag_container').find('.mas_ugc_username > p').text(input_username);\n // ¥ カルーセルに属する全ての投稿のユーザー名を一度に変更する\n if (parent_media_id) {\n $(`div[data-parent_media_id=\"${parent_media_id}\"]`).each((index, el) => {\n $(el).closest('.mas_tag_container').find('.mas_ugc_username > p').text(input_username);\n });\n }\n location.reload();\n })\n .fail(function () {\n alert('ユーザーネームの登録に失敗しました。再度お試しください。');\n $('body').css('overflow', 'auto');\n });\n });\n\n // ¥ UGC連携(mpm用)\n $('.mas_username_input__modal_submit')\n .off()\n .on('click', function () {\n let ugc_group_ids = [];\n $('input[name=ugc_groups]:checked').each(function () {\n ugc_group_ids.push($(this).val());\n });\n\n if (ugc_group_ids.length == 0) {\n alert('Please select a UGC group.');\n return;\n }\n $.ajax({\n url: '/ugc_group_id_set',\n type: 'POST',\n data: {\n sns_post_id: sns_post_id,\n ugc_group_ids: ugc_group_ids,\n },\n dataType: 'json',\n })\n .done(function (data) {\n alert(`指定されたUGCグループに本投稿を連携しました。`);\n })\n .fail(function () {\n alert(\n `予期しないエラーにより、連携が失敗しました。\n お手数ですが再度お試しください。`.replace(/[ \\t]/g, '')\n );\n })\n .always(function () {\n location.reload();\n });\n });\n\n $('.mas_username_input__modal_cancel_submit').on('click', function () {\n let ugc_group_id = $('.mas_username_input__ugc_modal_select option:selected').val();\n\n $.ajax({\n url: '/ugc_group_id_delete',\n type: 'POST',\n data: {\n sns_post_id: sns_post_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('UGC group link has been removed.');\n location.reload();\n }\n });\n });\n });\n}); // end of document.addEventListener(\"turbolinks:load\", function () {\n","document.addEventListener('turbolinks:load', function () {\n // ¥ 開発環境での開発スピードを上げるため青木の開発環境でのみ\n // ¥ manage/app/javascript/packs内の本jsファイルを走らせない\n if ((location.href.includes('dev-manage-ssl.platta.jp') || location.href.includes('http://18.177.103.115:3004')) && !location.href.includes('?dev27aoki')) {\n console.log('dev環境 public.jsを使用');\n return;\n }\n\n const ERROR_MSG = 'エラー! 処理を完了できませんでした\\n時間おいて再度実行しても、このエラーが修正されない場合は\\nお手数ですがサポートチームにお問い合わせください';\n const MAIL_PATTERN = /^[a-zA-Z0-9_+-]+(.[a-zA-Z0-9_+-]+)*@([a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]*\\.)+[a-zA-Z]{2,}$/;\n const PASSWORD_PATTERN = /([0-9].*[a-zA-Z]|[a-zA-Z].*[0-9])/;\n\n const DOMAIN = $('#pl_domain').val();\n\n let current_url = location.href;\n\n // ###################################################\n // ¥ UGC最適化設定\n // ###################################################\n\n // ¥ 初期化 UGC表示最適化設定の更新ボタンを押せるようにする\n const initialize_ugc_optimization_button = function (param) {\n // 初期化 UGC表示最適化設定の更新ボタンを押せるようにする\n $(`.ugc_optimization_submit`).removeClass('pointer-events-none bg-gray-500');\n };\n\n let selected_group_el = $('#ugc_optimization_group_select option:selected');\n const ugc_group_list = ['s', 'a', 'b', 'c'];\n let group_ugc_display_num_list = [];\n let group_ugc_item_actual_total_count = Number(selected_group_el.data('ugc_item_total_count'));\n\n // ¥ UGCグループの選択で、初期のグループ名でない選択肢の場合は PC / PHONEの切替を表示させない\n if (location.href.includes('/ugc_optimization') && $('#ugc_optimization_group_select option:selected').data('ugc_item_total_count') === -99) {\n $('.ugc_optimization_device_wrapper').css('display', 'none');\n }\n\n // ¥ グループが選択されるまで全ての要素を隠す\n const ugc_opt_hide_options = function () {\n $('.ugc_optimization__container--with_rank').css('display', 'none');\n $('.ugc_optimization__container--no_rank').css('display', 'none');\n // ¥ url入力フォームとsubmitボタンを隠す\n $('.ugc_optimization__url_container').css('display', 'none');\n $('.ugc_optimization_submit').css('display', 'none');\n };\n\n // ¥ UGC最適化設定ページのみで発動するコード\n if (current_url.includes('/ugc_optimization')) {\n group_ugc_item_actual_total_count = Number(selected_group_el.data('ugc_item_total_count'));\n\n // ¥ グループが選択されるまで全ての要素を隠す\n if (group_ugc_item_actual_total_count === -99) {\n ugc_opt_hide_options();\n }\n\n // ¥ UGCグループを変更時\n // ¥ UGCグループの選択で、存在するグループ名の選択肢の場合は PC / PHONEの切替を表示させる\n $('#ugc_optimization_group_select').on('change', function () {\n if ($('#ugc_optimization_group_select option:selected').data('ugc_item_total_count') !== -99) {\n $('.ugc_optimization_device_wrapper').css('display', 'block');\n } else {\n $('.ugc_optimization_device_wrapper').css('display', 'none');\n }\n\n // 初期化 UGC表示最適化設定の更新ボタンを押せるようにする\n initialize_ugc_optimization_button();\n\n selected_group_el = $('#ugc_optimization_group_select option:selected');\n group_ugc_item_actual_total_count = Number(selected_group_el.data('ugc_item_total_count'));\n\n // ¥ 選択されている device_typeを動的に取得する\n let selected_device_type_el = $('.ugc_optimization__device_type.opacity-50');\n\n // - ugcグループの切り替えのタイミングでは毎回 pc に戻す\n let device_type = 0;\n\n location.href = `/ugc_optimization?device_type=${device_type}&ugc_group=${selected_group_el.data('group_id')}`;\n });\n\n // ¥ グループごとに属しているugc一覧を表示\n // Single function to handle the toggling of visibility\n function toggleVisibility(data_target) {\n let rank_container = $(data_target.data('target')); // Use data attribute to get target\n\n if (rank_container.hasClass('hidden')) {\n rank_container.hide().removeClass('hidden').css('display', 'flex').hide().fadeIn();\n } else {\n rank_container.fadeOut(function () {\n $(this).addClass('hidden');\n });\n }\n }\n\n // Event binding data-targetの値に表示、非表示させたい要素を入れる\n $('div[data-target]')\n .off('click')\n .on('click', function () {\n toggleVisibility($(this));\n });\n\n //¥ UGC表示最適化設定 - PC / PHONE デバイス切替時の動作 共通関数\n const device_change_get_display_count = function (selected_device) {\n let ugc_group = $('#ugc_optimization_group_select option:selected').data('group_id');\n selected_group_el = $('#ugc_optimization_group_select option:selected');\n group_ugc_item_actual_total_count = Number(selected_group_el.data('ugc_item_total_count'));\n let device_type = $(`.ugc_optimization_device_${selected_device}`).data('device');\n\n $.ajax({\n type: 'GET',\n url: DOMAIN + '/get_ugc_display_number',\n data: {\n selected_group_id: selected_group_el.data('group_id'),\n selected_group_name: selected_group_el.data('group_name'),\n selected_device_type: device_type,\n },\n dataType: 'json',\n success: function (response) {\n // ¥ 最新の各ランクが所有しているUGCの数を表示\n ranks = ['s', 'a', 'b', 'c'];\n\n // 最適化表示かつgrid表示選択時に表示させるugc数をランクごとに表示させる\n $.each(response.display_num_list, function (idx, val) {\n $(`#${ranks[idx]}_ugc_num_${idx}`).val(val);\n $(`.ugc_optimization__input--display_${idx}`).attr('display::', val);\n });\n\n // 保有している総保有UGC数をランクごとに表示させる\n $.each(response.max_num_list, function (idx, val) {\n $(`.ugc_optimization__input--display_${idx}`).attr('max::', val);\n });\n },\n error: function (jqXHR, textStatus, errorThrown) {\n // error code here\n },\n });\n };\n\n //¥ UGC表示最適化設定 - PC / PHONE デバイス切替時の動作 選択されたデバイスボタンを青くする\n function toggleDeviceButtons(activeElement, inactiveElement, device, val) {\n device_change_get_display_count(device);\n\n activeElement.removeClass('opacity-100');\n activeElement.addClass('pointer-events-none');\n activeElement.addClass('opacity-50');\n\n inactiveElement.removeClass('opacity-50');\n inactiveElement.removeClass('pointer-events-none');\n inactiveElement.addClass('opacity-100');\n\n $('#ugc_optimization_device_val').val(val);\n initialize_ugc_optimization_button();\n }\n\n $('.ugc_optimization_device_pc')\n .off('click')\n .on('click', function () {\n toggleDeviceButtons($(this), $('.ugc_optimization_device_phone'), 'pc', 0);\n });\n\n $('.ugc_optimization_device_phone')\n .off('click')\n .on('click', function () {\n toggleDeviceButtons($(this), $('.ugc_optimization_device_pc'), 'phone', 1);\n });\n\n // ¥ input要素が変更されたらugc表示する数が表示できる実際の数を超過しないか評価する\n $('.ugc_optimization__input--display').on('change', function () {\n selected_group_el = $('#ugc_optimization_group_select option:selected');\n group_ugc_item_actual_total_count = Number(selected_group_el.data('ugc_item_total_count'));\n\n // 初期化 UGC表示最適化設定の更新ボタンを押せるようにする\n $('.show_exceed_num_alert').remove();\n $(`.ugc_optimization_submit`).removeClass('bg-base-500 dark:bg-dark_base');\n\n // ¥ DBではなくユーザーが入力した現在のwebページに表示させるUGCの数を取得する\n let current_display_num_list = $.map($('.ugc_optimization__input--display'), function (display_num, m_idx) {\n if (!$(display_num).val()) {\n return 'no_value';\n } else {\n $(`.ugc_optimization_submit`).removeClass('pointer-events-none bg-gray-500');\n $(`.ugc_optimization_submit`).addClass('bg-base-500 dark:bg-dark_base');\n return Number($(display_num).val());\n }\n });\n\n let each_rank_max_ugc_count_list = [$('#s_ugc_num_0').attr('max'), $('#a_ugc_num_1').attr('max'), $('#b_ugc_num_2').attr('max'), $('#c_ugc_num_3').attr('max')];\n\n for (let idx = 0; idx < current_display_num_list.length; idx++) {\n const current_display_num = current_display_num_list[idx];\n if (typeof current_display_num !== 'number') {\n $(`.ugc_optimization__input--display_${idx}`).val('');\n $(`.ugc_optimization__input--display_${idx}`).before(\"

保有UGC数以下の数字を設定してください。

\");\n $(`.ugc_optimization_submit`).addClass('pointer-events-none bg-gray-500 ');\n $(`.ugc_optimization_submit`).addClass('pointer-events-none bg-gray-500 ');\n } else if (current_display_num > Number(each_rank_max_ugc_count_list[idx])) {\n // alert(\"NG!!\");\n $(`.ugc_optimization__input--display_${idx}`).val('');\n $(`.ugc_optimization__input--display_${idx}`).before(\"

保有UGC数以下の数字を設定してください。

\");\n $(`.ugc_optimization_submit`).addClass('pointer-events-none bg-gray-500 ');\n } else {\n $(`.ugc_optimization__input--display_${idx}`).removeClass('pointer-events-none, bg-gray-500');\n }\n }\n });\n\n $('#display_prioritized_ugc_flag').change(function () {\n let prioritized_ugc_flag = 0;\n let ugc_group_id = $('#ugc_optimization_group_select option:selected').attr('data-group_id');\n let device_type = $('.ugc_optimization__device_type.opacity-50').data('device'); // 0:pc 1: phone\n\n $('.ugc_optimization__device_type').hasClass('opacity-50');\n\n if ($('#display_prioritized_ugc_flag').prop('checked')) {\n prioritized_ugc_flag = 1;\n } else {\n prioritized_ugc_flag = 0;\n }\n $.ajax({\n url: '/update_is_displayed_prioritized_ugc',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n prioritized_ugc_flag: prioritized_ugc_flag,\n device_type: device_type,\n },\n dataType: 'json',\n })\n .done(function (data) {\n // ¥ 改行を残してそれ以外の不要な空白を削除する\n alert(`設定を変更しました。`.replace(/[ \\t]/g, ''));\n })\n .fail(function (jqXHR, textStatus, errorThrown) {})\n .always(function () {\n location.reload();\n });\n });\n\n // 関連商品の連携をしてから表示させる日数を変更する処理(DB更新)\n $('#ugc_optimization_prioritized_position').change(function () {\n let ugc_prioritized_position = $('#ugc_optimization_prioritized_position option:selected').val();\n let ugc_group_id = $('#ugc_optimization_group_select option:selected').attr('data-group_id');\n if (ajax_save_ugc_display_num((alarm_flag = false)) == false) {\n location.reload();\n return;\n }\n\n $.ajax({\n url: '/update_ugc_prioritized_position',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n ugc_prioritized_position: ugc_prioritized_position,\n },\n dataType: 'json',\n })\n .done(function (data) {\n // ¥ 改行を残してそれ以外の不要な空白を削除する\n alert('設定を変更しました。');\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n alert(\n `設定の変更に失敗しました。\n 再度お試しください。問題が継続する場合、弊社カスタマーサクセスまでご連絡ください。\n `.replace(/[ \\t]/g, '')\n );\n })\n .always(function () {\n location.reload();\n });\n });\n\n // 関連商品の連携をしてから表示させる日数を変更する(dbに保存する前)前の日数を取得\n let ugc_previous_prioritized_period = $('#ugc_optimization_prioritized_ugc_select option:selected').val() || '';\n\n // 関連商品の連携をしてから表示させる日数を変更する処理(DB更新)\n $('#ugc_optimization_prioritized_ugc_select').change(function () {\n let ugc_prioritized_period = $('#ugc_optimization_prioritized_ugc_select option:selected').val();\n let ugc_group_id = $('#ugc_optimization_group_select option:selected').attr('data-group_id');\n\n // - SABCの順に選択されたグループのugc設定表示数を保存する\n let ugc_display_num_list = [];\n\n for (let idx = 0; idx < $('.ugc_optimization__input--display').length; idx++) {\n const element = $('.ugc_optimization__input--display')[idx];\n\n if (Number($(element).val()) > Number($(`.opt_ugc_count_${idx}`).text())) {\n alert('保有UGC数を超えた数を入力しています。修正をお願いします。');\n return false;\n }\n\n ugc_display_num_list.push($(element).val());\n }\n\n let selected_group_el = $('#ugc_optimization_group_select option:selected');\n\n // ¥ 各ランクごとの保有UGC数を取得する\n let ugc_display_max_num_list = [];\n $.each($('.ugc_optimization__input--display'), function (idx, el) {\n ugc_display_max_num_list.push($(el).attr('max'));\n });\n\n $.ajax({\n url: '/update_ugc_prioritized_period',\n type: 'POST',\n data: {\n ugc_group_id: ugc_group_id,\n ugc_prioritized_period: ugc_prioritized_period,\n ugc_previous_prioritized_period: ugc_previous_prioritized_period,\n },\n dataType: 'json',\n })\n .done(function (data) {\n alert('関連商品の連携をしてから表示させる日数を変更しました。');\n location.reload();\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n alert(\n `関連商品の連携をしてから表示させる日数の変更に失敗しました。\n 再度お試しください。問題が継続する場合、弊社カスタマーサクセスまでご連絡ください。\n `.replace(/[ \\t]/g, '')\n );\n });\n });\n\n const ajax_save_ugc_display_num = function (alert_flag = true) {\n // - SABCの順に選択されたグループのugc設定表示数を保存する\n let ugc_display_num_list = [];\n\n for (let idx = 0; idx < $('.ugc_optimization__input--display').length; idx++) {\n const element = $('.ugc_optimization__input--display')[idx];\n\n if (Number($(element).val()) > Number($(`.opt_ugc_count_${idx}`).text())) {\n alert('保有UGC数を超えた数を入力しています。修正をお願いします。');\n return false;\n }\n\n ugc_display_num_list.push($(element).val());\n }\n\n let selected_group_el = $('#ugc_optimization_group_select option:selected');\n\n // ¥ 各ランクごとの保有UGC数を取得する\n let ugc_display_max_num_list = [];\n $.each($('.ugc_optimization__input--display'), function (idx, el) {\n ugc_display_max_num_list.push($(el).attr('max'));\n });\n\n $.ajax({\n type: 'POST',\n url: DOMAIN + '/save_ugc_display_num',\n data: {\n selected_group_id: selected_group_el.data('group_id'),\n selected_group_name: selected_group_el.data('group_name'),\n ugc_display_num_list: ugc_display_num_list,\n ugc_display_max_num_list: ugc_display_max_num_list,\n selected_device_type: $('#ugc_optimization_device_val').val(),\n\n // ugc_fixed_display_num_list: ugc_fixed_display_num_list,\n },\n dataType: 'json',\n success: function (response) {\n alert_flag ? alert('設定を更新しました。') : '';\n location.reload();\n },\n error: function (jqXHR, textStatus, errorThrown) {\n // error code here\n },\n });\n };\n\n // * 最適化設定を更新ボタンをクリック - SABCの順に選択されたグループのugc設定表示数や固定表示数をDBに保存する\n $('#ugc_optimization__submit')\n .off('click')\n .on('click', function () {\n if (group_ugc_item_actual_total_count === -99) {\n alert('UGCグループを選択してください。');\n } else {\n ajax_save_ugc_display_num();\n }\n }); // $('#ugc_optimization__submit')\n }\n}); // end of document.addEventListener(\"turbolinks:load\", function () {\n","document.addEventListener(\"turbolinks:load\", function () {\n const DOMAIN = $('#pl_domain').val();\n const isSpecialURL = window.location.href.includes(`${DOMAIN}/ugc_report`) || \n window.location.href == `${DOMAIN}` || \n window.location.href == `${DOMAIN}/`;\n\n // トグルボタンのクリックイベント\n $('#darkmode_toggle').on(\"change\", function() {\n if (isSpecialURL) {\n if ($('html').hasClass('dark')) {\n document.cookie = \"dark_mode=disabled\"; // Set cookie\n } else {\n document.cookie = \"dark_mode=enabled\"; // Set cookie\n }\n location.reload();\n } else {\n $('html').toggleClass('dark');\n\n if ($('html').hasClass('dark')) {\n $('html').attr('data-theme', 'dark');\n document.cookie = \"dark_mode=enabled\"; // Set cookie\n } else {\n $('html').attr('data-theme', 'light');\n document.cookie = \"dark_mode=disabled\"; // Set cookie\n }\n }\n });\n});","document.addEventListener('turbolinks:load', function () {\n\n const DOMAIN = $('#pl_domain').val();\n\n $('.chat_bot_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.chat_bot_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.chat_bot_slidedown_btn').fadeIn(0));\n });\n\n $('.chat_bot_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.chat_bot_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.chat_bot_slideup_btn').fadeIn(0));\n });\n\n // ------------------------------------------------------------------------------------------------\n // チャットボットレポート\n // ------------------------------------------------------------------------------------------------\n function chat_bot_update_url() {\n const chat_id = $('#chat_selects option:selected').val();\n const chat_option_id = $('#chat_option_selects option:selected').val();\n const gf = $('#chat_graph_pattern_select_input').val();\n const device = $('.chat_device_select').data('device');\n const start_day = $('#chat_report_start_day').val();\n const end_day = $('#chat_report_end_day').val();\n\n let url = new URL(window.location.href);\n let params = url.searchParams;\n\n if (chat_id !== 'none' && chat_id !== null && chat_id !== undefined) {\n params.set('chat_id', chat_id);\n } else {\n params.delete('chat_id');\n }\n\n if (chat_option_id !== 'none' && chat_option_id !== null && chat_option_id !== undefined) {\n params.set('chat_option_id', chat_option_id);\n } else {\n params.delete('chat_option_id');\n }\n\n if (gf) {\n params.set('gf', gf);\n } else {\n params.delete('gf');\n }\n\n if (device == \"0\" || device == \"1\" || device == \"2\") {\n params.set('device', device);\n } else {\n params.delete('device');\n }\n\n if (gf === '12') {\n params.delete('start_day');\n params.delete('end_day');\n } else { // このelseブロックを追加\n if (start_day) {\n params.set('start_day', start_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n\n if (end_day) {\n params.set('end_day', end_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n }\n\n url.search = params.toString();\n location.href = url.toString();\n }\n\n // #################################################################\n // チャットボット,チャットボットメニューの選択\n // #################################################################\n $('#chat_selects, #chat_option_selects').on('change', function () {\n chat_bot_update_url();\n });\n\n // #################################################################\n // 日毎、月毎のグラフ切り替え\n // #################################################################\n $('.chat_graph_pattern_select_day, .chat_graph_pattern_select_month').on('click', function () {\n const gf_value = $(this).data('gf');\n $('#chat_graph_pattern_select_input').val(gf_value);\n chat_bot_update_url();\n });\n\n // #################################################################\n // デバイスごとのグラフ切り替え\n // #################################################################\n $('.chat_device_select_all, .chat_device_select_pc, .chat_device_select_phone').on('click', function () {\n const device = $(this).data('device');\n $('.chat_device_select').data(\"device\", device);\n chat_bot_update_url();\n });\n\n // #################################################################\n // 範囲選択によるグラフ切り替え\n // #################################################################\n $('#chat_report_start_day, #chat_report_end_day').on('change', function () {\n chat_bot_update_url();\n });\n\n // #################################################################\n // 表の年月切り替え\n // #################################################################\n $('#ua_chat_month_selects').on('change', function () {\n let chat_id = $('#chat_selects option:selected').val();\n let month = $('#ua_chat_month_selects option:selected').val();\n let url = new URL(window.location.href);\n\n if (month != '') {\n if (url.searchParams.has('m')) {\n // 値が \"0\"か\"1\" なら \"2\" に更新する\n let new_value = month;\n // パラメーターの値を更新する\n url.searchParams.set('m', new_value);\n } else {\n // パラメーターにdeviceがない場合\n // 新しいパラメーターを追加する\n url.searchParams.append('m', month);\n }\n\n // 更新されたURLにリダイレクトする\n location.href = url.toString();\n } else {\n // monthが空文字の時は指定したURLにリダイレクトする\n // location.href = 'ugc_analysis';\n }\n });\n\n // #################################################################\n // チャットボットのログデータのみの削除\n // #################################################################\n $('.delete_chat_bot_log_data').on('click', function () {\n if (!confirm('本当に削除を実行しますか?')) {\n return;\n }\n const chat_id = $('#chat_selects option:selected').val();\n\n $.ajax({\n url: '/c/delete_chat_log',\n type: 'POST',\n data: {\n chat_id: chat_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // チャットボットのログデータと関連するデータ全ての削除\n // #################################################################\n $('.delete_chat_bot_log_data_and_related_data').on('click', function () {\n if (!confirm('本当に完全削除を実行しますか?')) {\n return;\n }\n const chat_id = $('#chat_selects option:selected').val();\n\n $.ajax({\n url: '/c/delete_chat_log_and_related_data',\n type: 'POST',\n data: {\n chat_id: chat_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.href = '/c/index';\n }\n });\n });\n\n // #################################################################\n // チャットボットのレポートのcsv出力\n // #################################################################\n $('#download_chat_csv').on('click', function () {\n const chat_id = $('#chat_selects option:selected').val();\n const month = $('#ua_chat_month_selects option:selected').val();\n const device = $('.chat_device_select').data('device');\n\n let href = '/download_chat_csv';\n\n href += `?chat_id=${chat_id}`;\n href += `&m=${month}`;\n href += `&device=${device}`;\n location.href = href;\n });\n\n // ------------------------------------------------------------------------------------------------\n // チャットボット設定\n // ------------------------------------------------------------------------------------------------\n // #################################################################\n // チャットボットの選択と新規登録\n // #################################################################\n $('#chat_bot_select_box').on('change', function () {\n let chat_id = $('#chat_bot_select_box option:selected').val();\n\n if (chat_id == 'new') {\n $('.chat_bot_set_wrapper').css('display', 'block');\n $('.chat_bot_edit_name_setting_wrapper').css('display', 'none');\n $('.chat_bot_url_setting_wrapper').css('display', 'none');\n $('.chat_bot_excluded_url_setting_wrapper').css('display', 'none');\n $('.chat_bot_delete_setting_wrapper').css('display', 'none');\n $('.chat_bot_detail_custom_setting_wrapper').css('display', 'none');\n $('.chat_bot_pc_design_custom_setting_wrapper').css('display', 'none');\n $('.chat_bot_sp_design_custom_setting_wrapper').css('display', 'none');\n $('.chat_bot_report_jump_btn').css('display', 'none');\n $('.chat_bot_show_valid_setting_wrapper').css('display', 'none');\n $('.chat_bot_preview_setting_wrapper').css('display', 'none');\n $('.chat_bot_preview_url_list_wrapper').css('display', 'none');\n $('.chat_bot_img_upload_wrapper').css('display', 'none');\n $('.chat_bot_icon_upload_wrapper').css('display', 'none');\n $('.chat_bot_img_url_setting_wrapper').css('display', 'none');\n $('.chat_bot_sp_show_valid_setting_wrapper').css('display', 'none');\n $('.chat_bot_title_img_upload_wrapper').css('display', 'none');\n } else {\n location.href = `/chat_bot_setting/index?chat_id=${chat_id}`;\n }\n });\n\n\n // #################################################################\n // チャットボットの新規登録\n // #################################################################\n $('#chat_bot_set').on('click', function () {\n let chat_bot_input_val = $('#chat_bot_input').val();\n if (!chat_bot_input_val) {\n alert('チャットボット名を入力してください。');\n return;\n }\n $('#chat_bot_set').css('pointer-events', 'none');\n $.ajax({\n url: DOMAIN + '/create_chat_bot',\n type: 'POST',\n data: {\n name: chat_bot_input_val,\n },\n dataType: 'json',\n }).done(function (data) {\n location.href = `/chat_bot_setting/index?chat_id=${data.chat.id}`;\n });\n });\n\n // #################################################################\n // チャットボットの名前変更\n // #################################################################\n $('#chat_bot_edit_name_submit').on('click', function () {\n let chat_id = $('#chat_bot_select_box option:selected').val();\n let new_chat_bot_name = $('.chat_bot_edit_name_input').val();\n if (!new_chat_bot_name) {\n alert('チャットボット名を入力してください。');\n return;\n }\n $.ajax({\n url: '/update_chat_bot_name',\n type: 'POST',\n data: {\n chat_id: chat_id,\n name: new_chat_bot_name,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // チャットボットのPC公開設定\n // #################################################################\n $('.chat_bot_show_valid_select_box').on('change', function (event) {\n let chat_id = $('#chat_bot_select_box option:selected').val();\n let show_valid = $('.chat_bot_show_valid_select_box:checked').val();\n\n $.ajax({\n url: '/save_chat_bot_show_valid',\n type: 'POST',\n data: {\n chat_id: chat_id,\n show_valid: show_valid\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // チャットボットのSP公開設定\n // #################################################################\n $('.chat_bot_sp_show_valid_select_box').on('change', function (event) {\n let chat_id = $('#chat_bot_select_box option:selected').val();\n let show_valid = $('.chat_bot_sp_show_valid_select_box:checked').val();\n\n $.ajax({\n url: '/save_chat_bot_show_valid_sp',\n type: 'POST',\n data: {\n chat_id: chat_id,\n show_valid: show_valid\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // チャットボットの表示URL登録\n // #################################################################\n $('#chat_bot_url_add_input').on('click', function () {\n $(this)\n .parents('table')\n .append(\n `\n \n \n \n \n \n
\n \n \n \n
\n \n `\n );\n $('.chat_bot_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n\n $('.chat_bot_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n\n $('#chat_bot_url_set').on('click', function () {\n let chat_id = $('#chat_bot_select_box option:selected').val();\n let urls = [];\n $('.chat_bot_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/set_chat_bot_url',\n type: 'POST',\n data: {\n chat_id: chat_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // チャットボットの除外URL登録\n // #################################################################\n $('#chat_bot_excluded_url_add_input').on('click', function () {\n $(this)\n .parents('table')\n .append(\n `\n \n \n \n \n \n
\n \n \n \n
\n \n `\n );\n $('.chat_bot_excluded_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n\n $('.chat_bot_excluded_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n\n $('#chat_bot_excluded_url_set').on('click', function () {\n let chat_id = $('#chat_bot_select_box option:selected').val();\n let urls = [];\n $('.chat_bot_excluded_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/set_chat_bot_excluded_url',\n type: 'POST',\n data: {\n chat_id: chat_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // チャットボットのPCデザイン登録\n // #################################################################\n $('#chat_bot_img_url_set').on('click', function () {\n let chat_id = $('#chat_bot_select_box option:selected').val();\n\n let chat_bot_img_url = $('#chat_bot_img_url').val();\n let chat_bot_title_img_url = $('#chat_bot_title_img_url').val();\n let chat_bot_icon_url = $('#chat_bot_icon_url').val();\n\n $.ajax({\n url: '/save_chat_bot_img_url',\n type: 'POST',\n data: {\n chat_id: chat_id,\n img_url: chat_bot_img_url,\n title_img_url: chat_bot_title_img_url,\n icon_url: chat_bot_icon_url\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n\n });\n\n // #################################################################\n // チャットボットのPCデザイン登録\n // #################################################################\n $('#chat_bot_pc_style_set').on('click', function () {\n\n let chat_id = $('#chat_bot_select_box option:selected').val();\n\n let is_content_side_position = $('#is_content_side_position').val();\n let content_side_position = $('#content_side_position').val();\n let content_bottom_position = $('#content_bottom_position').val();\n\n let is_default_display = $('#is_default_display').val();\n let is_default_icon_side_position = $('#is_default_icon_side_position').val();\n let default_icon_side_position = $('#default_icon_side_position').val();\n let default_icon_bottom_position = $('#default_icon_bottom_position').val();\n let default_icon_img_height = $('#default_icon_img_height').val();\n let default_icon_img_width = $('#default_icon_img_width').val();\n let default_icon_img_border_radius = $('#default_icon_img_border_radius').val();\n let is_default_text_side_position = $('#is_default_text_side_position').val();\n let default_text_side_position = $('#default_text_side_position').val();\n let default_text_bottom_position = $('#default_text_bottom_position').val();\n let default_text_width = $('#default_text_width').val();\n let default_text_border_radius = $('#default_text_border_radius').val();\n let default_text_word = $('#default_text_word').val();\n let default_text_padding = $('#default_text_padding').val();\n let default_text_bg_color = $('#default_text_bg_color').val();\n let default_text_font_color = $('#default_text_font_color').val();\n let default_text_font_size = $('#default_text_font_size').val();\n let default_text_font_weight = $('#default_text_font_weight').val();\n\n let main_container_bg_color = $('#main_container_bg_color').val();\n let main_container_border_radius = $('#main_container_border_radius').val();\n let main_container_width = $('#main_container_width').val();\n let main_container_height = $('#main_container_height').val();\n let main_container_border = $('#main_container_border').val();\n let main_container_opacity = $('#main_container_opacity').val();\n let main_container_box_shadow = $('#main_container_box_shadow').val();\n let title_area_title_justify_content = $('#title_area_title_justify_content').val();\n let title_area_title_margin = $('#title_area_title_margin').val();\n let title_area_bg = $('#title_area_bg').val();\n let title_area_border_radius = $('#title_area_border_radius').val();\n let title_area_height = $('#title_area_height').val();\n let title_area_img_width = $('#title_area_img_width').val();\n let title_area_img_height = $('#title_area_img_height').val();\n let title_area_img_margin = $('#title_area_img_margin').val();\n let title_area_font_color = $('#title_area_font_color').val();\n let close_btn_width = $('#close_btn_width').val();\n let close_btn_height = $('#close_btn_height').val();\n let close_btn_bg_color = $('#close_btn_bg_color').val();\n let is_header_area = $('#is_header_area').val();\n let header_area_height = $('#header_area_height').val();\n let header_area_padding = $('#header_area_padding').val();\n let header_area_text_one = $('#header_area_text_one').val();\n let header_area_text_two = $('#header_area_text_two').val();\n let header_area_text_padding = $('#header_area_text_padding').val();\n let header_area_text_font_size = $('#header_area_text_font_size').val();\n let comment_area_padding = $('#comment_area_padding').val();\n let comment_area_icon_width = $('#comment_area_icon_width').val();\n let comment_area_icon_height = $('#comment_area_icon_height').val();\n let comment_area_icon_margin = $('#comment_area_icon_margin').val();\n let comment_area_icon_border_radius = $('#comment_area_icon_border_radius').val();\n let comment_box_margin = $('#comment_box_margin').val();\n let comment_box_padding = $('#comment_box_padding').val();\n let comment_box_width = $('#comment_box_width').val();\n let comment_box_border_radius = $('#comment_box_border_radius').val();\n let comment_box_bg_color = $('#comment_box_bg_color').val();\n let comment_text_padding = $('#comment_text_padding').val();\n let comment_text_font_size = $('#comment_text_font_size').val();\n let comment_text_font_weight = $('#comment_text_font_weight').val();\n let comment_text_font_color = $('#comment_text_font_color').val();\n let comment_btn_margin = $('#comment_btn_margin').val();\n let comment_btn_padding = $('#comment_btn_padding').val();\n let comment_btn_border = $('#comment_btn_border').val();\n let comment_btn_border_radius = $('#comment_btn_border_radius').val();\n let comment_btn_white_space = $('#comment_btn_white_space').val();\n let comment_btn_bg_color = $('#comment_btn_bg_color').val();\n let comment_btn_font_color = $('#comment_btn_font_color').val();\n let comment_btn_font_size = $('#comment_btn_font_size').val();\n let comment_btn_box_shadow = $('#comment_btn_box_shadow').val();\n let comment_btn_font_weight = $('#comment_btn_font_weight').val();\n let is_footer_area = $('#is_footer_area').val();\n let loading_container_margin = $('#loading_container_margin').val();\n let loading_container_padding = $('#loading_container_padding').val();\n let loading_box_border_radius = $('#loading_box_border_radius').val();\n let loading_box_bg_color = $('#loading_box_bg_color').val();\n let loading_box_font_color = $('#loading_box_font_color').val();\n let loading_box_font_weight = $('#loading_box_font_weight').val();\n let delete_icon_top = $('#delete_icon_top').val();\n let delete_icon_right = $('#delete_icon_right').val();\n let delete_icon_width = $('#delete_icon_width').val();\n let delete_icon_height = $('#delete_icon_height').val();\n\n $.ajax({\n url: '/update_chat_bot_pc_styles',\n type: 'POST',\n data: {\n chat_id: chat_id,\n is_content_side_position: is_content_side_position,\n content_side_position: content_side_position,\n content_bottom_position: content_bottom_position,\n\n is_default_display: is_default_display,\n is_default_icon_side_position: is_default_icon_side_position,\n default_icon_side_position: default_icon_side_position,\n default_icon_bottom_position: default_icon_bottom_position,\n default_icon_img_height: default_icon_img_height,\n default_icon_img_width: default_icon_img_width,\n default_icon_img_border_radius: default_icon_img_border_radius,\n is_default_text_side_position: is_default_text_side_position,\n default_text_side_position: default_text_side_position,\n default_text_bottom_position: default_text_bottom_position,\n default_text_width: default_text_width,\n default_text_border_radius: default_text_border_radius,\n default_text_word: default_text_word,\n default_text_padding: default_text_padding,\n default_text_bg_color: default_text_bg_color,\n default_text_font_color: default_text_font_color,\n default_text_font_size: default_text_font_size,\n default_text_font_weight: default_text_font_weight,\n\n main_container_bg_color: main_container_bg_color,\n main_container_border_radius: main_container_border_radius,\n main_container_width: main_container_width,\n main_container_height: main_container_height,\n main_container_border: main_container_border,\n main_container_opacity: main_container_opacity,\n main_container_box_shadow: main_container_box_shadow,\n title_area_title_justify_content: title_area_title_justify_content,\n title_area_title_margin: title_area_title_margin,\n title_area_bg: title_area_bg,\n title_area_border_radius: title_area_border_radius,\n title_area_height: title_area_height,\n title_area_img_width: title_area_img_width,\n title_area_img_height: title_area_img_height,\n title_area_img_margin: title_area_img_margin,\n title_area_font_color: title_area_font_color,\n close_btn_width: close_btn_width,\n close_btn_height: close_btn_height,\n close_btn_bg_color: close_btn_bg_color,\n is_header_area: is_header_area,\n header_area_height: header_area_height,\n header_area_padding: header_area_padding,\n header_area_text_one: header_area_text_one,\n header_area_text_two: header_area_text_two,\n header_area_text_padding: header_area_text_padding,\n header_area_text_font_size: header_area_text_font_size,\n comment_area_padding: comment_area_padding,\n comment_area_icon_width: comment_area_icon_width,\n comment_area_icon_height: comment_area_icon_height,\n comment_area_icon_margin: comment_area_icon_margin,\n comment_area_icon_border_radius: comment_area_icon_border_radius,\n comment_box_margin: comment_box_margin,\n comment_box_padding: comment_box_padding,\n comment_box_width: comment_box_width,\n comment_box_border_radius: comment_box_border_radius,\n comment_box_bg_color: comment_box_bg_color,\n comment_text_padding: comment_text_padding,\n comment_text_font_size: comment_text_font_size,\n comment_text_font_weight: comment_text_font_weight,\n comment_text_font_color: comment_text_font_color,\n comment_btn_margin: comment_btn_margin,\n comment_btn_padding: comment_btn_padding,\n comment_btn_border: comment_btn_border,\n comment_btn_border_radius: comment_btn_border_radius,\n comment_btn_white_space: comment_btn_white_space,\n comment_btn_bg_color: comment_btn_bg_color,\n comment_btn_font_color: comment_btn_font_color,\n comment_btn_font_size: comment_btn_font_size,\n comment_btn_box_shadow: comment_btn_box_shadow,\n comment_btn_font_weight: comment_btn_font_weight,\n is_footer_area: is_footer_area,\n loading_container_margin: loading_container_margin,\n loading_container_padding: loading_container_padding,\n loading_box_border_radius: loading_box_border_radius,\n loading_box_bg_color: loading_box_bg_color,\n loading_box_font_color: loading_box_font_color,\n loading_box_font_weight: loading_box_font_weight,\n delete_icon_top: delete_icon_top,\n delete_icon_right: delete_icon_right,\n delete_icon_width: delete_icon_width,\n delete_icon_height: delete_icon_height\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // チャットボットのSPデザイン登録\n // #################################################################\n $('#chat_bot_sp_style_set').on('click', function () {\n\n let chat_id = $('#chat_bot_select_box option:selected').val();\n\n let is_content_side_position_sp = $('#is_content_side_position_sp').val();\n let content_side_position_sp = $('#content_side_position_sp').val();\n let content_bottom_position_sp = $('#content_bottom_position_sp').val();\n \n let is_default_display_sp = $('#is_default_display_sp').val();\n let is_default_icon_side_position_sp = $('#is_default_icon_side_position_sp').val();\n let default_icon_side_position_sp = $('#default_icon_side_position_sp').val();\n let default_icon_bottom_position_sp = $('#default_icon_bottom_position_sp').val();\n let default_icon_img_height_sp = $('#default_icon_img_height_sp').val();\n let default_icon_img_width_sp = $('#default_icon_img_width_sp').val();\n let default_icon_img_border_radius_sp = $('#default_icon_img_border_radius_sp').val();\n let is_default_text_side_position_sp = $('#is_default_text_side_position_sp').val();\n let default_text_side_position_sp = $('#default_text_side_position_sp').val();\n let default_text_bottom_position_sp = $('#default_text_bottom_position_sp').val();\n let default_text_width_sp = $('#default_text_width_sp').val();\n let default_text_border_radius_sp = $('#default_text_border_radius_sp').val();\n let default_text_word_sp = $('#default_text_word_sp').val();\n let default_text_padding_sp = $('#default_text_padding_sp').val();\n let default_text_bg_color_sp = $('#default_text_bg_color_sp').val();\n let default_text_font_color_sp = $('#default_text_font_color_sp').val();\n let default_text_font_size_sp = $('#default_text_font_size_sp').val();\n let default_text_font_weight_sp = $('#default_text_font_weight_sp').val();\n\n let main_container_bg_color_sp = $('#main_container_bg_color_sp').val();\n let main_container_border_radius_sp = $('#main_container_border_radius_sp').val();\n let main_container_width_sp = $('#main_container_width_sp').val();\n let main_container_height_sp = $('#main_container_height_sp').val();\n let main_container_border_sp = $('#main_container_border_sp').val();\n let main_container_opacity_sp = $('#main_container_opacity_sp').val();\n let main_container_box_shadow_sp = $('#main_container_box_shadow_sp').val();\n let title_area_title_justify_content_sp = $('#title_area_title_justify_content_sp').val();\n let title_area_title_margin_sp = $('#title_area_title_margin_sp').val();\n let title_area_bg_sp = $('#title_area_bg_sp').val();\n let title_area_border_radius_sp = $('#title_area_border_radius_sp').val();\n let title_area_height_sp = $('#title_area_height_sp').val();\n let title_area_img_width_sp = $('#title_area_img_width_sp').val();\n let title_area_img_height_sp = $('#title_area_img_height_sp').val();\n let title_area_img_margin_sp = $('#title_area_img_margin_sp').val();\n let title_area_font_color_sp = $('#title_area_font_color_sp').val();\n let close_btn_width_sp = $('#close_btn_width_sp').val();\n let close_btn_height_sp = $('#close_btn_height_sp').val();\n let close_btn_bg_color_sp = $('#close_btn_bg_color_sp').val();\n let is_header_area_sp = $('#is_header_area_sp').val();\n let header_area_height_sp = $('#header_area_height_sp').val();\n let header_area_padding_sp = $('#header_area_padding_sp').val();\n let header_area_text_one_sp = $('#header_area_text_one_sp').val();\n let header_area_text_two_sp = $('#header_area_text_two_sp').val();\n let header_area_text_padding_sp = $('#header_area_text_padding_sp').val();\n let header_area_text_font_size_sp = $('#header_area_text_font_size_sp').val();\n let comment_area_padding_sp = $('#comment_area_padding_sp').val();\n let comment_area_icon_width_sp = $('#comment_area_icon_width_sp').val();\n let comment_area_icon_height_sp = $('#comment_area_icon_height_sp').val();\n let comment_area_icon_margin_sp = $('#comment_area_icon_margin_sp').val();\n let comment_area_icon_border_radius_sp = $('#comment_area_icon_border_radius_sp').val();\n let comment_box_margin_sp = $('#comment_box_margin_sp').val();\n let comment_box_padding_sp = $('#comment_box_padding_sp').val();\n let comment_box_width_sp = $('#comment_box_width_sp').val();\n let comment_box_border_radius_sp = $('#comment_box_border_radius_sp').val();\n let comment_box_bg_color_sp = $('#comment_box_bg_color_sp').val();\n let comment_text_padding_sp = $('#comment_text_padding_sp').val();\n let comment_text_font_size_sp = $('#comment_text_font_size_sp').val();\n let comment_text_font_weight_sp = $('#comment_text_font_weight_sp').val();\n let comment_text_font_color_sp = $('#comment_text_font_color_sp').val();\n let comment_btn_margin_sp = $('#comment_btn_margin_sp').val();\n let comment_btn_padding_sp = $('#comment_btn_padding_sp').val();\n let comment_btn_border_sp = $('#comment_btn_border_sp').val();\n let comment_btn_border_radius_sp = $('#comment_btn_border_radius_sp').val();\n let comment_btn_white_space_sp = $('#comment_btn_white_space_sp').val();\n let comment_btn_bg_color_sp = $('#comment_btn_bg_color_sp').val();\n let comment_btn_font_color_sp = $('#comment_btn_font_color_sp').val();\n let comment_btn_font_size_sp = $('#comment_btn_font_size_sp').val();\n let comment_btn_box_shadow_sp = $('#comment_btn_box_shadow_sp').val();\n let comment_btn_font_weight_sp = $('#comment_btn_font_weight_sp').val();\n let is_footer_area_sp = $('#is_footer_area_sp').val();\n let loading_container_margin_sp = $('#loading_container_margin_sp').val();\n let loading_container_padding_sp = $('#loading_container_padding_sp').val();\n let loading_box_border_radius_sp = $('#loading_box_border_radius_sp').val();\n let loading_box_bg_color_sp = $('#loading_box_bg_color_sp').val();\n let loading_box_font_color_sp = $('#loading_box_font_color_sp').val();\n let loading_box_font_weight_sp = $('#loading_box_font_weight_sp').val();\n let delete_icon_top_sp = $('#delete_icon_top_sp').val();\n let delete_icon_right_sp = $('#delete_icon_right_sp').val();\n let delete_icon_width_sp = $('#delete_icon_width_sp').val();\n let delete_icon_height_sp = $('#delete_icon_height_sp').val();\n\n $.ajax({\n url: '/update_chat_bot_sp_styles',\n type: 'POST',\n data: {\n chat_id: chat_id,\n is_content_side_position_sp: is_content_side_position_sp,\n content_side_position_sp: content_side_position_sp,\n content_bottom_position_sp: content_bottom_position_sp,\n default_icon_img_width_sp: default_icon_img_width_sp,\n default_icon_img_height_sp: default_icon_img_height_sp,\n default_icon_img_border_radius_sp: default_icon_img_border_radius_sp,\n\n is_default_display_sp: is_default_display_sp,\n is_default_icon_side_position_sp: is_default_icon_side_position_sp,\n default_icon_side_position_sp: default_icon_side_position_sp,\n default_icon_bottom_position_sp: default_icon_bottom_position_sp,\n default_icon_img_height_sp: default_icon_img_height_sp,\n default_icon_img_width_sp: default_icon_img_width_sp,\n default_icon_img_border_radius_sp: default_icon_img_border_radius_sp,\n is_default_text_side_position_sp: is_default_text_side_position_sp,\n default_text_side_position_sp: default_text_side_position_sp,\n default_text_bottom_position_sp: default_text_bottom_position_sp,\n default_text_width_sp: default_text_width_sp,\n default_text_border_radius_sp: default_text_border_radius_sp,\n default_text_word_sp: default_text_word_sp,\n default_text_padding_sp: default_text_padding_sp,\n default_text_bg_color_sp: default_text_bg_color_sp,\n default_text_font_color_sp: default_text_font_color_sp,\n default_text_font_size_sp: default_text_font_size_sp,\n default_text_font_weight_sp: default_text_font_weight_sp,\n\n main_container_bg_color_sp: main_container_bg_color_sp,\n main_container_border_radius_sp: main_container_border_radius_sp,\n main_container_width_sp: main_container_width_sp,\n main_container_height_sp: main_container_height_sp,\n main_container_border_sp: main_container_border_sp,\n main_container_opacity_sp: main_container_opacity_sp,\n main_container_box_shadow_sp: main_container_box_shadow_sp,\n title_area_title_justify_content_sp: title_area_title_justify_content_sp,\n title_area_title_margin_sp: title_area_title_margin_sp,\n title_area_bg_sp: title_area_bg_sp,\n title_area_border_radius_sp: title_area_border_radius_sp,\n title_area_height_sp: title_area_height_sp,\n title_area_img_width_sp: title_area_img_width_sp,\n title_area_img_height_sp: title_area_img_height_sp,\n title_area_img_margin_sp: title_area_img_margin_sp,\n title_area_font_color_sp: title_area_font_color_sp,\n close_btn_width_sp: close_btn_width_sp,\n close_btn_height_sp: close_btn_height_sp,\n close_btn_bg_color_sp: close_btn_bg_color_sp,\n is_header_area_sp: is_header_area_sp,\n header_area_height_sp: header_area_height_sp,\n header_area_padding_sp: header_area_padding_sp,\n header_area_text_one_sp: header_area_text_one_sp,\n header_area_text_two_sp: header_area_text_two_sp,\n header_area_text_padding_sp: header_area_text_padding_sp,\n header_area_text_font_size_sp: header_area_text_font_size_sp,\n comment_area_padding_sp: comment_area_padding_sp,\n comment_area_icon_width_sp: comment_area_icon_width_sp,\n comment_area_icon_height_sp: comment_area_icon_height_sp,\n comment_area_icon_margin_sp: comment_area_icon_margin_sp,\n comment_area_icon_border_radius_sp: comment_area_icon_border_radius_sp,\n comment_box_margin_sp: comment_box_margin_sp,\n comment_box_padding_sp: comment_box_padding_sp,\n comment_box_width_sp: comment_box_width_sp,\n comment_box_border_radius_sp: comment_box_border_radius_sp,\n comment_box_bg_color_sp: comment_box_bg_color_sp,\n comment_text_padding_sp: comment_text_padding_sp,\n comment_text_font_size_sp: comment_text_font_size_sp,\n comment_text_font_weight_sp: comment_text_font_weight_sp,\n comment_text_font_color_sp: comment_text_font_color_sp,\n comment_btn_margin_sp: comment_btn_margin_sp,\n comment_btn_padding_sp: comment_btn_padding_sp,\n comment_btn_border_sp: comment_btn_border_sp,\n comment_btn_border_radius_sp: comment_btn_border_radius_sp,\n comment_btn_white_space_sp: comment_btn_white_space_sp,\n comment_btn_bg_color_sp: comment_btn_bg_color_sp,\n comment_btn_font_color_sp: comment_btn_font_color_sp,\n comment_btn_font_size_sp: comment_btn_font_size_sp,\n comment_btn_box_shadow_sp: comment_btn_box_shadow_sp,\n comment_btn_font_weight_sp: comment_btn_font_weight_sp,\n is_footer_area_sp: is_footer_area_sp,\n loading_container_margin_sp: loading_container_margin_sp,\n loading_container_padding_sp: loading_container_padding_sp,\n loading_box_border_radius_sp: loading_box_border_radius_sp,\n loading_box_bg_color_sp: loading_box_bg_color_sp,\n loading_box_font_color_sp: loading_box_font_color_sp,\n loading_box_font_weight_sp: loading_box_font_weight_sp,\n delete_icon_top_sp: delete_icon_top_sp,\n delete_icon_right_sp: delete_icon_right_sp,\n delete_icon_width_sp: delete_icon_width_sp,\n delete_icon_height_sp: delete_icon_height_sp\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // チャットボットのプレビュー作成\n // #################################################################\n $('#chat_bot_create_preview_btn')\n .off()\n .on('click', function () {\n $('.loadding').css('display', 'block');\n let chat_bot_id = $('#chat_bot_select_box option:selected').val();\n let preview_url = $('#chat_bot_create_preview_url').val();\n if (chat_bot_id == '' || chat_bot_id == null || preview_url == '') {\n $('.loadding').css('display', 'none');\n alert('必須項目を入力してください。');\n return;\n }\n\n $.ajax({\n url: '/chat_bot_setting/save_chat_bot_preview',\n type: 'POST',\n data: {\n chat_bot_id: chat_bot_id,\n url: preview_url\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // チャットボットのプレビュー編集\n // #################################################################\n $('.create_chat_bot_preview_html_edit').on('click', function () {\n let preview_id = $(this).data('id');\n let preview_url = $(this).data('url');\n $.ajax({\n url: '/edit_chat_bot_preview_html',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n // モーダルを作成し、HTMLコンテンツとボタンを表示\n let modalHtml = `
\n
\n
\n \n
\n
\n
閉じる
\n
保存
\n
\n
`;\n\n // モーダルをbody要素に追加\n $('body').append(modalHtml);\n $('#html_modal_text_area').text(data.html_content);\n\n $('#html_save_btn').on('click', function () {\n let html = $('#html_modal_text_area').val();\n $.ajax({\n url: '/update_chat_bot_preview_html',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n html: html,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n $('#html_modal_wrapper, #html_remove_btn').on('click', function (e) {\n $('#html_modal_wrapper, #html_modal_container, #html_modal_text_area, #html_save_btn').remove();\n });\n }\n });\n });\n\n // #################################################################\n // チャットボットのプレビュー削除\n // #################################################################\n $('.create_chat_bot_preview_url_delete').on('click', function () {\n let preview_id = $(this).data('id');\n let preview_url = $(this).data('url');\n $.ajax({\n url: '/delete_chat_bot_preview',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // バナー登録\n // #################################################################\n $('#chat_bot_img_upload_btn').on('click', function() {\n let chat_id = $(this).data(\"chat_id\");\n let file_data = $('.chat_bot_img_upload').prop('files')[0];\n if (!file_data) {\n alert('画像を選択してください。');\n return;\n }\n var form_data = new FormData();\n form_data.append('chat_bot_img_upload', file_data);\n form_data.append('chat_id', chat_id); // chat_idをFormDataに追加\n\n $.ajax({\n url: '/upload_chat_bot_img',\n type: 'POST',\n data: form_data,\n processData: false,\n contentType: false,\n success: function(response) {\n location.reload();\n },\n error: function(response) {\n alert('画像のアップロードに失敗しました。');\n location.reload();\n }\n });\n });\n\n // #################################################################\n // バナー画像削除\n // #################################################################\n $('#chat_bot_img_delete_btn').on('click', function() {\n let chat_id = $(this).data(\"chat_id\");\n\n $.ajax({\n url: '/delete_chat_bot_img',\n type: 'POST',\n data: {\n chat_id: chat_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // チャットボットのヘッダーアイコン登録\n // #################################################################\n $('#chat_bot_title_img_upload_btn').on('click', function() {\n let chat_id = $(this).data(\"chat_id\");\n let file_data = $('.chat_bot_title_img_upload').prop('files')[0];\n if (!file_data) {\n alert('画像を選択してください。');\n return;\n }\n var form_data = new FormData();\n form_data.append('chat_bot_title_img_upload', file_data);\n form_data.append('chat_id', chat_id); // chat_idをFormDataに追加\n\n $.ajax({\n url: '/upload_chat_bot_title_img',\n type: 'POST',\n data: form_data,\n processData: false,\n contentType: false,\n success: function(response) {\n location.reload();\n },\n error: function(response) {\n alert('画像のアップロードに失敗しました。');\n location.reload();\n }\n });\n });\n\n // #################################################################\n // アイコン登録\n // #################################################################\n $('#chat_bot_icon_upload_btn').on('click', function() {\n let chat_id = $(this).data(\"chat_id\");\n let file_data = $('.chat_bot_icon_upload').prop('files')[0];\n if (!file_data) {\n alert('画像を選択してください。');\n return;\n }\n var form_data = new FormData();\n form_data.append('chat_bot_icon_upload', file_data);\n form_data.append('chat_id', chat_id); // chat_idをFormDataに追加\n\n $.ajax({\n url: '/upload_chat_bot_icon',\n type: 'POST',\n data: form_data,\n processData: false,\n contentType: false,\n success: function(response) {\n location.reload();\n },\n error: function(response) {\n alert('画像のアップロードに失敗しました。');\n location.reload();\n }\n });\n });\n\n // #################################################################\n // アイコン画像削除\n // #################################################################\n $('#chat_bot_icon_delete_btn').on('click', function() {\n let chat_id = $(this).data(\"chat_id\");\n\n $.ajax({\n url: '/delete_chat_bot_icon',\n type: 'POST',\n data: {\n chat_id: chat_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // チャットボット削除\n // #################################################################\n $('#chat_bot_delete_btn').on('click', function () {\n let chat_id = $('#chat_bot_select_box option:selected').val();\n\n if (!confirm('完全に削除され復元することはできません。本当に削除しますか?')) {\n return;\n }\n\n $.ajax({\n url: '/chat_bot_setting/delete_chat_bot_setting',\n type: 'POST',\n data: {\n chat_id: chat_id,\n },\n dataType: 'json',\n }).done(function (data) {\n alert('チャットボットを削除しました。');\n location.href = `/chat_bot_setting/index`;\n });\n });\n});\n","// ##############################\nlet _treeData = {};\nlet _treeHistory = { index: -1, history: [] };\nlet _addNodeModal = null;\nlet _saveTreeTimer = null;\nlet _savingFlg = false;\nlet _treeElement = null;\nlet _nodeListObservers = [];\nconst _maxHistory = 10;\n\n/**\n * ツリーを生成する関数\n *\n * 下記の順で処理を行う\n * 1. 最初の質問になるセクションを取得し作成\n * 2. セクションを親に持つノードを取得し、localIndex順にソートして作成\n * 3. ノードがnextSectionIdを持つなら、セクションを子要素として作成\n * 4. 以降、リレーションされているノードとセクションが再帰的に生成される\n * 5. 全て生成し終わったら、イベントを設定して完了\n *\n * @param {JSON} treeData ツリー情報\n * @param {Boolean} whenHistory 履歴からの更新呼び出しかどうか\n * @return {void}\n */\nfunction createTree(treeData, whenHistory = false) {\n\t_treeData = treeData;\n\tlet firstSection = treeData.firstSection;\n\tlet nodes = treeData.nodes;\n\tlet sections = treeData.sections;\n\n\t// DOMリセット\n\t$('#' + treeData.canvasElementId).empty();\n\n\tcreateSection(firstSection, treeData.canvasElementId, true);\n\n\t// Event Set\n\tsetAddNodeButtonEvent();\n\tsetNodeEvent();\n\tsetSectionEvent();\n\tcheckLinkButtonEvent();\n\tsetSortable($('.sortable'));\n\tupdateCanvasHeight();\n\n\tif ( $('#tree-undo') && $('#tree-redo') ) {\n\t\t$('#tree-undo').off().on('click', function () {\n\t\t\tundoTree();\n\t\t});\n\t\t$('#tree-redo').off().on('click', function () {\n\t\t\tredoTree();\n\t\t});\n\t}\n\n\tcreateAddNodeModal();\n\t// 初回生成時に、読み込み内容をヒストリーに追加しておく\n\tif (whenHistory == false) {\n\t\taddHistory();\n\t}\n\n\t_treeElement = $('#' + _treeData.canvasElementId);\n}\n\n/**\n * 質問項目として、セクションを生成する関数\n * @param {JSON} nodeData ノード情報\n * @param {String} parentElementId 親要素のID\n * @param {Boolean} isFirst 最初の質問かどうか\n */\nfunction createSection(nodeData, parentElementId, isFirst = false) {\n\tlet contentType = nodeData.contentType;\n\tlet content = \"\";\n\tlet classList = \"\";\n\tlet sectionLabel = \"回答\";\n\n\t// ツリーの開始地点なら、firstクラスを付与する\n\tif (isFirst) {\n\t\tclassList = \"section first\";\n\t\tsectionLabel = \"質問\";\n\t} else {\n\t\tclassList = \"section\";\n\t}\n\n\t// contentTypeが未定義なら、textを設定する\n\tif (contentType === undefined || contentType === null) {\n\t\tcontentType = \"text\";\n\t}\n\n\t// contentTypeに応じて、contentの内容を変更する\n\tif (contentType === \"text\") {\n\t\tcontent = `
${sectionLabel}
` +\n\t\t\t\t\t\t\t`
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
+選択肢を追加
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
`;\n\n\t} else if (contentType === \"link\") {\n\t\t\tcontent = `
リンク
` +\n\t\t\t\t\t\t\t\t`
` +\n\t\t\t\t\t\t\t\t`
確認
`;\n\t}\n\n\t// DOMを生成\n\tlet section = $(\n\t\t\t`
` +\n\t\t\t\tcontent +\n\t\t\t`
`\n\t);\n\n\tif (parentElementId != _treeData.canvasElementId) {\n\t\tparentElementId = `node-${parentElementId}`;\n\t}\n\n\t$(`#${parentElementId}`).append(section);\n\t// 生成されたSectionを親(parentId)として設定しているNodeが存在するなら、\n\t// localIndex順にソートして、子ノードとして生成する\n\tlet childNodes = _treeData.nodes.filter(node => node.parentId == nodeData.id);\n\tif (childNodes.length > 0) {\n\t\tchildNodes.sort((a, b) => a.localIndex - b.localIndex);\n\t\tchildNodes.forEach(function (node, i) {\n\t\t\tcreateNode(node, nodeData.id);\n\t\t\tif (i == childNodes.length - 1) {\n\t\t\t\tupdateNodeListHeight(section.children('.node-list'));\n\t\t\t}\n\t\t});\n\t}\n}\n\n\n\n/**\n * 子ノードを生成する関数\n *\n * 生成したnodeにnextSectionIdが存在する場合、追加で子要素としてセクションを生成する\n *\n * @param {JSON} nodeData ノード情報\n * @param {String} parentElementId ノードを格納する親要素のID\n */\nfunction createNode(nodeData, parentElementId) {\n\tlet parentElement = $(`#section-${parentElementId}`);\n\n\t// 子を生成するタイミングで、親セクションにstickyクラスを付与する\n\tparentElement.addClass('sticky');\n\n\tlet node = $(\n\t\t\t`
` +\n\t\t\t\t`
` +\n\t\t\t\t\t`` +\n\t\t\t\t`
` +\n\t\t\t`
`\n\t);\n\t// section内nodesの最後に追加する\n\tparentElement.find('.nodes').first().append(node);\n\n\t// 目次の作成\n\tif (parentElement.children('>.content+.node-list').length == 0) {\n\t\t\tparentElement.children('>.content').after(\n\t\t\t\t\t`
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
+選択肢を追加
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t
`\n\t\t\t);\n\t}\n\t// 目次にノードのアンカーを追加\n\tlet nodeAnchor = $(`
\n\t\t\t\t\t\t\t\t\t\t\t\t::\n\t\t\t\t\t\t\t\t\t\t\t\t${nodeData.content}\n\t\t\t\t\t\t\t\t\t\t\t
`);\n\t//.command-buttonの前に追加\n\tparentElement.find('>.node-list>.command-button').before(nodeAnchor);\n\tnodeAnchor.children('a').off().on('click', function (event) {\n\t\t// ターゲット位置までスクロール\n\t\tevent.preventDefault();\n\t\tlet targetNode = $(this).attr('href');\n\t\tscrollToTarget($(targetNode));\n\t});\n\n\n\t// nextSectionIdが存在するなら、ノードの子要素としてセクションを生成する\n\t// セクションのcontentはNodeのanswer\n\tif (nodeData.nextSectionId) {\n\t\tlet sectionNodeData = _treeData.sections.find(section => section.id == nodeData.nextSectionId);\n\t\t// TODO: 子セクションのタイプを事前に取得. beforeの色設定などに利用したい。\n\t\tnode.attr('data-next-section-type', sectionNodeData.contentType);\n\t\t// セクション生成に再帰\n\t\tcreateSection(sectionNodeData, nodeData.id);\n\t}\n}\n\n/**\n * ノード追加用のモーダル要素を作成し、bodyに追加する関数\n *\n * 下記メソッドにてモーダル操作を行う\n * - modalShow() ... モーダルを表示する\n * - modalHide() ... モーダルを非表示にする\n */\nfunction createAddNodeModal() {\n\t// 作成済みなら何もしない\n\tif (_addNodeModal !== null) {return;}\n\n\tlet modal = $(\n\t\t\t`
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
選択肢の追加
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
`\n\t\t\t);\n\t$(document.body).append(modal);\n\t_addNodeModal = modal;\n\t$('.modal-close').on('click', function (ev) {\n\t\tif (ev.eventPhase == 2) {\n\t\t\tmodalHide();\n\t\t}\n\t});\n}\n\n/**\n * モーダルを表示する関数\n */\nfunction modalShow() {\n\t_addNodeModal.addClass('show');\n}\n/**\n * モーダルを非表示にする関数\n */\nfunction modalHide() {\n\t_addNodeModal.removeClass('show');\n}\n\n\n/**\n * ツリー情報の更新と保存\n *\n * ツリー情報を更新し、3秒後に自動保存する。\n * 保存までの3秒間に再度更新された場合は、保存までの待機時間をリセットする。\n *\n * @param {Boolean} whenHistory 履歴からの更新呼び出しかどうか\n * @return {JSON} ツリー情報JSON\n */\nfunction updateTreeData(whenHistory = false) {\n\tconsole.log('updateTreeData');\n\n\t// 最初の質問セクションを取得\n\tlet firstSection = getSectionData($(\"#section-0\").first());\n\n\t// 一般Nodesの更新\n\tlet newNodes = [];\n\t$('.node').each(function (i, element) {\n\t\tnewNodes.push(getNodeData($(element)));\n\t});\n\n\tlet newSections = [];\n\t$('.section').each(function (i, element) {\n\t\tnewSections.push(getSectionData($(element)));\n\t});\n\n\t// ツリー情報の更新\n\t_treeData.firstSection = firstSection;\n\t_treeData.nodes = newNodes;\n\t_treeData.sections = newSections;\n\n\t// 更新が行われた際に自動保存。保存処理中かどうかを判定するために、タイマーで非同期処理を行う。\n\tclearTimeout(_saveTreeTimer);\n\tsavingFlg(true);\n\t_saveTreeTimer = setTimeout(function () {\n\t\tconsole.log('save');\n\t\t_saveTreeTimer = null;\n\t\tsaveTreeData(whenHistory);\n\t\t_treeElement.trigger('onSaveCompleted');\n\t}, 50);\n\n\treturn _treeData;\n}\n\n\n/**\n * ノード要素からJSONを作成して返す。呼び出し元でpush必要。\n * @param {jQueryObject} nodeElement 対象ノードのjQueryオブジェクト\n * @return {JSON} ノード情報\n */\nfunction getNodeData(nodeElement) {\n\n\tlet nodeElementId = nodeElement.attr('id').replace('node-', '');\n\n\t// NodeのみlocalIndexの取得\n\tlet localIndex = 0;\n\tif (nodeElement.hasClass('node')) {\n\t\tlet parentSection = nodeElement.closest('.section');\n\t\tparentSection.find('>.nodes>.node').each(function (i, element) {\n\t\t\tif ($(element).attr('id') == nodeElement.attr('id')) {\n\t\t\t\tlocalIndex = i;\n\t\t\t}\n\t\t});\n\t}\n\n\t// contentTypeの取得。存在しない場合はtextとする\n\tlet contentType = nodeElement.attr('data-content-type');\n\tif (contentType === undefined || contentType === null) {\n\t\tcontentType = \"text\";\n\t}\n\t// 子が存在しないtextは、menu_flg=0扱い\n\tif (contentType == \"text\" && nodeElement.find('>.section>.nodes>.node').length == 0) {\n\t\tcontentType = \"answer\";\n\t}\n\n\t// contentの取得。sectionの場合はtextarea, nodeの場合はinputから取得する\n\tlet content = \"\";\n\tif ($(nodeElement).hasClass('section')) {\n\t\tcontent = $(nodeElement).find('>.content textarea').val();\n\t} else {\n\t\tcontent = $(nodeElement).find('>.node-label>input').val();\n\t}\n\n\t// parentIdの設定\n\tlet parentId = 0;\n\tif (nodeElement.hasClass('first')) {\n\t\t// 最初のセクションの場合は親が存在しないので0を設定する\n\t\tparentId = 0;\n\t} else {\n\t\t// 自身がノードで、セクションに属している場合はセクションのIDを設定する\n\t\tparentId = nodeElement.closest('.section').first().attr('id').replace('section-', '');\n\t}\n\n\n\t// JSON整形。値ない場合はnullになる\n\tlet nodeData = {\n\t\tid: nodeElementId,\n\t\tcontentType: contentType,\n\t\tcontent: content,\n\t\tparentId: parentId,\n\t\tlocalIndex: localIndex,\n\t}\n\treturn nodeData;\n}\n\n/**\n * セクション要素からJSONを作成して返す。呼び出し元でpush必要。\n *\n * @param {jQueryObject} sectionElement\n * @return {JSON} セクション情報\n */\nfunction getSectionData(sectionElement){\n\tlet sectionElementId = sectionElement.attr('id').replace('section-', '');\n\tlet content = \"\";\n\tlet contentType = sectionElement.attr('data-content-type');\n\t// 子が存在しないtextは、menu_flg=0扱い\n\tif (contentType == \"text\" && sectionElement.find('>.nodes>.node').length == 0) {\n\t\tcontentType = \"answer\";\n\t}\n\tcontent = $('#section-' + sectionElementId).find('>.content>textarea').val();\n\n\tlet sectionData = {\n\t\tid: sectionElementId,\n\t\tcontentType: contentType,\n\t\tcontent: content,\n\t\tlocalIndex: null,\n\t\tnextSectionId: null,\n\t}\n\treturn sectionData;\n}\n\n\n/**\n * ツリー情報を更新、取得する関数\n *\n * @returns {JSON} ツリー情報JSON\n */\nfunction getTreeData() {\n\tupdateTreeData();\n\t// JSONを整形して表示\n\t// $('#result').text(JSON.stringify(_treeData, null, ' '));\n\t// JSONを返す\n\treturn JSON.stringify(_treeData);\n}\n\n// # ノード追加ボタンのクリックイベント\nfunction setAddNodeButtonEvent() {\n\t$('.add-node').off().on('click', function () {\n\t\tlet callerSectionId = $(this).closest('.section').first().attr('id');\n\t\t$(_addNodeModal).find('#addNodeContent').val('');\n\t\t$(_addNodeModal).find('#addSectionContent').val('');\n\t\t$(_addNodeModal).find('#selectSectionQuestion').prop('checked', true);\n\t\tmodalShow();\n\t\t$('#addNodeFromModal').off().on('click', function () {\n\t\t\taddNode(callerSectionId);\n\t\t});\n\t});\n}\n\n// # リンク確認ボタンのクリックイベント\nfunction checkLinkButtonEvent() {\n\t$('.check-link').off().on('click', function () {\n\t\tlet link = $(this).parent().find('textarea').first().val();\n\t\twindow.open(link, '_blank');\n\t});\n}\n\n// # sortableの設定\nfunction setSortable(jQueryObject) {\n\t// jQueryObjectからJSのElementに変換が必要なのでeach\n\tjQueryObject.each(function (i, element) {\n\t\ttry {\n\t\t\tSortable.destroy(element);\n\t\t} catch (e) { }\n\n\t\tSortable.create(element, {\n\t\t\tanimation: 150,\n\t\t\thandle: '.sortable-handle',\n\t\t\tfilter: '.add-node',\n\t\t\tdraggable: '>.sortable-element',\n\t\t\tghostClass: 'ui-state-highlight',\n\t\t\tonStart: onStartEvent, // 2-1, ドラッグ開始時\n\t\t\tonEnd: onEndEvent, // 2-2, ドラッグ終了時\n\t\t\tonChange: onChangeEvent, // 2-3, ドラッグ変化時\n\t\t\tonSort: onSortEvent // 2-4, 並び替え終了時\n\t\t});\n\t});\n}\nfunction onStartEvent(e){}\nfunction onEndEvent(e){}\nfunction onChangeEvent(e){}\nfunction onSortEvent(e){\n\t// ソート後の並び順に応じてノードを並び替える\n\tlet nodeList = $(e.target);\n\tlet sortableIds = nodeList.find('a').map(function () { return $(this).attr('href').replace('#node-', ''); });\n\tlet nodeWrapper = nodeList.siblings('.nodes');\n\tlet nodes = nodeWrapper.children('.node');\n\tnodes.detach();\n\tsortableIds.each(function (i, id) {\n\t\tlet node = nodes.filter('#node-' + id);\n\t\tnodeWrapper.append(node);\n\t});\n\tupdateNodeListHeight(nodeList);\n\tgetTreeData();\n}\n\n// ノードの追加\nfunction addNode(callerSectionId) {\n\t// モーダルの内容を取得\n\tlet addNodeContent = $('#addNodeContent').val();\n\tlet contentType = $('input[name=\"selectSectionType\"]:checked').val();\n\tlet addSectionContent = $('#addSectionContent').val();\n\tlet localIndex = $('#' + callerSectionId).find('.node-list').children().length;\n\tlet callerElement = $('#addNodeFromModal');\n\tcallerElement.css('pointer-events', 'none');\n\n\t// 空でも追加できるようにバリデーションは一旦コメントアウト\n\t// if (addNodeContent.trim() == \"\") {\n\t// alert('選択肢のテキストを入力してください。');\n\t// callerElement.css('pointer-events', 'auto');\n\t// return;\n\t// }\n\t// if (addSectionContent.trim() == \"\") {\n\t// alert('セクションのテキストを入力してください。');\n\t// callerElement.css('pointer-events', 'auto');\n\t// return;\n\t// }\n\tif (contentType == undefined || contentType == null) {\n\t\talert('セクションのタイプを選択してください。');\n\t\tcallerElement.css('pointer-events', 'auto');\n\t\treturn;\n\t}\n\n\t// 新規chat_optionを作成してIDを取得する\n\t$.ajax({\n\t\turl: '/create_chat_option',\n\t\ttype: 'POST',\n\t\tdata: {\n\t\t\tchatId: $('#chat-id').val(),\n\t\t\tnodeContentType: \"text\",\n\t\t\tnodeContent: addNodeContent,\n\t\t\tsectionContentType: contentType,\n\t\t\tsectionContent: addSectionContent,\n\t\t\tparentId: callerSectionId.replace('section-', ''),\n\t\t\tlocalIndex: localIndex,\n\t\t}\n\t})\n\t\t.done(function (data) {\n\t\t\tif (data['result'] != \"success\") { alert('追加に失敗しました。'); callerElement.css('pointer-events', 'auto'); return; }\n\n\t\t\t// 追加処理続行\n\t\t\t// createNodeに渡すためのノード情報を作成\n\t\t\tlet newNodeData = {\n\t\t\t\tid: data['nodeId'],\n\t\t\t\tcontentType: contentType,\n\t\t\t\tcontent: addNodeContent,\n\t\t\t\tparentId: callerSectionId,\n\t\t\t\tlocalIndex: localIndex,\n\t\t\t\tnextSectionId: data['nodeId'],\n\t\t\t}\n\n\t\t\tlet newSectionData = {\n\t\t\t\tid: data['nodeId'],\n\t\t\t\tcontentType: contentType,\n\t\t\t\tcontent: addSectionContent,\n\t\t\t\tparentId: data['nodeId'],\n\t\t\t\tlocalIndex: null,\n\t\t\t\tnextSectionId: null,\n\t\t\t}\n\n\t\t\t// ノードを生成\n\t\t\t_treeData.nodes.push(newNodeData);\n\t\t\t_treeData.sections.push(newSectionData);\n\t\t\tcreateNode(newNodeData, callerSectionId.replace('section-', ''));\n\n\t\t\t// イベントの再設定\n\t\t\tsetAddNodeButtonEvent();\n\t\t\tsetNodeEvent();\n\t\t\tsetSectionEvent();\n\t\t\tcheckLinkButtonEvent();\n\t\t\tsetSortable($('.sortable'));\n\n\t\t\t// 目次高さの調整\n\t\t\tupdateNodeListHeight($(`#${callerSectionId}`).children('.node-list'));\n\n\t\t\t// 追加したノードまでスクロール\n\t\t\tscrollToTarget($('#node-' + data['nodeId']));\n\n\n\t\t\t// モーダルを閉じる\n\t\t\tmodalHide();\n\t\t})\n\t\t.fail(function () {\n\t\t\t// 追加処理中断\n\t\t\talert('500ERROR');\n\t\t\t$('#saving-flg').text('エラー');\n\t\t});\n\tcallerElement.css('pointer-events', 'auto');\n}\n\n\n// ノードのイベント設定\n// フォーカス時に削除ボタンを表示、ブラー時に削除ボタンを削除する\nfunction setNodeEvent() {\n\t$('.node-label>input[type=\"text\"]').off().on('focus', function () {\n\t\tlet targetElement = $(this).closest('.node-label');\n\t\t// 削除ボタンの追加\n\t\tlet deleteButton = $('
');\n\t\ttargetElement.append(deleteButton);\n\t\t// inputのblurより先に発火させるため、mousedownでイベントを設定する\n\t\tdeleteButton.off().on('mousedown', function () {\n\t\t\tremoveNode(targetElement.closest('.node').first().attr('id'));\n\t\t});\n\t});\n\n\t$('.node-label>input[type=\"text\"]').on('blur', function () {\n\t\t$('#remove-node').remove();\n\t});\n\n\t$('.node-label>input[type=\"text\"]').on('change', function () {\n\t\t// 対応するnode-list内のアンカーのテキストを変更する\n\t\tlet parentSection = $(this).closest('.section').first();\n\t\tlet targetNodeId = $(this).closest('.node').first().attr('id');\n\t\tlet targetNodeAnchor = parentSection.find('.node-list a[href=\"#' + targetNodeId + '\"]').first();\n\t\ttargetNodeAnchor.text($(this).val());\n\t\t// 保存\n\t\tupdateTreeData();\n\t});\n}\n\n// ノードの削除\nfunction removeNode(targetNodeId) {\n\tlet targetNode = $('#' + targetNodeId);\n\t// 目次から削除\n\ttargetNode.parent().parent().find('.node-list a[href=\"#' + targetNodeId + '\"]').parent().remove();\n\t// ノードを削除\n\ttargetNode.remove();\n\t// セクションが空になったら、stickyクラスを削除\n\tif (targetNode.parent().children().length == 0) {\n\t\ttargetNode.parent().removeClass('sticky');\n\t}\n\tupdateNodeListHeight(targetNode.parent().parent().find('.node-list').first());\n\tupdateTreeData();\n}\n\n// セクションのイベント設定\nfunction setSectionEvent(sectionElement = null) {\n\tif (sectionElement === null) {\n\t\tsectionElement = $('.section');\n\t}\n\tsectionElement.find('textarea').off().on('change', function () {\n\t\tupdateTreeData();\n\t});\n}\n\n//ブラウザバック時、セーブ前なら警告を出す\n$(window).on('beforeunload', function (e) {\n\tif (_saveTreeTimer !== null || _savingFlg) {\n\t\treturn 'このページを離れると、編集内容が失われます。';\n\t}\n});\n\n/**\n * 目次の高さを更新し、ノードの高さを調整する\n *\n * @param {jQueryObject} nodeListElement 目次のjQueryオブジェクト\n */\nfunction updateNodeListHeight(nodeListElement) {\n\tlet nodeHeight = nodeListElement.outerHeight(true);\n\tlet nodes = nodeListElement.siblings('.nodes');\n\tnodes.find('> .node').each(function (i, element) {\n\t\t\t$(element).css('margin-bottom', nodeHeight);\n\t});\n\n\t// 高さが変動するので、canvasの高さを再計算する\n\tupdateCanvasHeight();\n}\n\n\n/**\n * canvasの高さを再計算する関数\n *\n * overflow-x:scroll と sticky を共存させるために、縦軸でスクロールできる高さのheightを設定する必要あり.\n *\n * ※ 現在は、高さを固定値にしているが、不具合が出たら、コメントアウトを外して動的に高さを設定する。\n */\nfunction updateCanvasHeight() {\n\tlet canvasElement = $('#' + _treeData.canvasElementId);\n\tlet targetElement = canvasElement.find('.first').first();\n\tcanvasElement.css('height', 500);\n\t// canvasElement.css('height', targetElement.outerHeight(true));\n}\n\n\n/**\n * ツリー情報を保存する関数\n *\n * 下記情報をupdate_chat_optionsへPOSTする\n * - chat_id\n * - nodes_hash (JSON) { firstSection: {最初の質問用データ}, nodes: [ {chat_option用データ}, {chat_option用データ}, ... ] }\n *\n * 保存完了後、最新の履歴として保持する。履歴から更新された場合は、履歴に追加しない\n *\n * @param {Boolean} whenHistory 履歴からの更新呼び出しかどうか\n*/\nfunction saveTreeData(whenHistory = false){\n\tsavingFlg(true);\n\tlet uploadData = {\n\t\tnodes: [],\n\t};\n\n\t// 最初の質問セクションを取得して格納\n\tlet firstSection = $('#section-0').first();\n\tlet firstSectionData = {\n\t\tid: 0,\n\t\tparent_id: null,\n\t\tcontent: firstSection.find('>.content>textarea').val(),\n\t}\n\tuploadData.firstSection = firstSectionData;\n\n\t_treeData.nodes.forEach(function (node, i) {\n\t\t// 対応するsectionが存在する場合は、contentを取得する\n\t\tlet content = \"\";\n\t\tlet contentType = \"text\";\n\t\tlet section = _treeData.sections.find(section => section.id == node.id);\n\t\tif (section) {\n\t\t\tcontent = section.content;\n\t\t\tcontentType = section.contentType;\n\t\t}\n\n\t\tlet uploadNode = {\n\t\t\tid: node.id,\n\t\t\tparent_id: node.parentId,\n\t\t\tcaption: node.content,\n\t\t\tcontent_type : contentType,\n\t\t\tcontent: content,\n\t\t\tlocalIndex: node.localIndex,\n\t\t}\n\t\tuploadData.nodes.push(uploadNode);\n\t});\n\n\t$.ajax({\n\t\turl: '/update_chat_options',\n\t\ttype: 'POST',\n\t\tdata: {\n\t\t\t\"chat_id\": $('#chat-id').val(),\n\t\t\t\"nodes_hash\": uploadData,\n\t\t}\n\t})\n\t\t.done(function (data) {\n\t\t\t// 失敗\n\t\t\tif (data['result'] != \"success\") { alert('保存に失敗しました。'); return; }\n\n\t\t\t// 成功\n\t\t\t// console.log('save success');\n\t\t\t// 通常更新なら、履歴に追加。履歴からの更新なら、履歴に追加しない\n\t\t\tif (whenHistory == false) {\n\t\t\t\t\taddHistory();\n\t\t\t}\n\t\t})\n\t\t.fail(function () {\n\t\t\talert('500ERROR');\n\t\t});\n\tsavingFlg(false);\n}\n\n// 保存中フラグの切り替え\nfunction savingFlg(boolean) {\n\t_savingFlg = boolean;\n\tif ('#saving-flg') {\n\t\tif (_savingFlg) {\n\t\t\t$('#saving-flg').text('保存中...');\n\t\t}else{\n\t\t\t$('#saving-flg').text('保存済');\n\t\t}\n\t}\n}\n\n\n/**\n * アンカースクロール補助関数\n *\n * Stickyを用いている関係上、直接的なターゲット指定のスクロールをするとずれてしまうため、この関数を使用推奨します。\n * キャンバスのスクロール量とターゲットの相対位置を計算し、スクロールを実行します。\n *\n * @param {jQueryObject} targetjQueryElement スクロール位置の要素\n */\nfunction scrollToTarget(targetjQueryElement) {\n\tlet canvasElement = $('#' + _treeData.canvasElementId);\n\tlet targetOffsetTop = targetjQueryElement.offset().top - canvasElement.offset().top;\n\tlet canvasScrolledAmount = canvasElement.scrollTop();\n\tlet newScrollTop = canvasScrolledAmount + targetOffsetTop;\n\tcanvasElement.animate({ scrollTop: newScrollTop }, 'fast');\n}\n\n// ##############################\n// ヒストリー系\n// マックスは10\n// _treeHistory = {index: 0, history: [ {_treeData}, {_treeData}, ... ]};\n// undo, redoにあわせて indexをずらしていく\n// saveが呼び出されたら、index!=maxなら、index以降のhistoryを削除して、新しいデータを追加する。indexは最後に。\n// ##############################\n\n// treeDataの更新時に、ヒストリーに追加する\n// 最大保持数は10. 超過分は先頭から削除する\n// indexの途中に追加された場合は、index以降のhistoryを削除して、新しいデータを追加する\nfunction addHistory() {\n\t// 途中追加なら、index以降のhistoryを削除\n\tif (_treeHistory.index !== _treeHistory.history.length - 1) {\n\t\t_treeHistory.history = _treeHistory.history.slice(0, _treeHistory.index);\n\t}\n\t// ヒストリーに追加し、indexを更新。 _treeDataをそのまま追加するとオブジェクト参照されてしまうので、ディープコピーで複製する。\n\t_treeHistory.history.push(JSON.parse(JSON.stringify(_treeData)));\n\t_treeHistory.index = _treeHistory.history.length-1;\n\t// 最大保持数を超えたら、先頭から削除\n\tif (_treeHistory.history.length > _maxHistory) {\n\t\t_treeHistory.history.shift();\n\t}\n\t// undoボタンの無効化\n\tif ($('#tree-undo') && $('#tree-redo') && _treeHistory.history.length > 1) {\n\t\t$('#tree-undo').removeClass('disabled');\n\t\t$('#tree-redo').addClass('disabled');\n\t}\n\t// console.log(_treeHistory);\n}\n\n// 1つ前に戻す\nfunction undoTree() {\n\tconsole.log('undo');\n\tif (_treeHistory.index > 0) {\n\t\t_treeHistory.index -= 1;\n\t\t_treeData = _treeHistory.history[_treeHistory.index];\n\t\tcreateTree(_treeData, true);\n\t\tupdateTreeData(true);\n\n\t\t// undoボタンの無効化\n\t\tif ($('#tree-undo') && $('#tree-redo')) {\n\t\t\tif (_treeHistory.index == 0) {\n\t\t\t\t$('#tree-undo').addClass('disabled');\n\t\t\t}\n\t\t\t$('#tree-redo').removeClass('disabled');\n\t\t}\n\t\t// console.log(_treeHistory);\n\t}else{\n\t\talert('これ以上戻れません。');\n\t}\n}\n\n// 1つ後に進める\nfunction redoTree() {\n\tconsole.log('redo');\n\tif (_treeHistory.index < _treeHistory.history.length-1) {\n\t\t_treeHistory.index += 1;\n\t\t_treeData = _treeHistory.history[_treeHistory.index];\n\t\tcreateTree(_treeData, true);\n\t\tupdateTreeData(true);\n\n\t\t// redoボタンの無効化\n\t\tif ( $('#tree-undo') && $('#tree-redo') ) {\n\t\t\t\tif (_treeHistory.index == _treeHistory.history.length-1) {\n\t\t\t\t\t\t$('#tree-redo').addClass('disabled');\n\t\t\t\t}\n\t\t\t\t$('#tree-undo').removeClass('disabled');\n\t\t}\n\t\t// console.log(_treeHistory);\n\t}else{\n\t\talert('これ以上進めません。');\n\t}\n}\n\n// グローバルスコープに登録\nwindow.createTree = createTree;\nwindow.updateTreeData = updateTreeData;\n","document.addEventListener('turbolinks:load', function () {\n const ERROR_MSG = 'エラー! 処理を完了できませんでした\\n時間おいて再度実行しても、このエラーが修正されない場合は\\nお手数ですがサポートチームにお問い合わせください';\n const MAIL_PATTERN = /^[a-zA-Z0-9_+-]+(.[a-zA-Z0-9_+-]+)*@([a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]*\\.)+[a-zA-Z]{2,}$/;\n const PASSWORD_PATTERN = /([0-9].*[a-zA-Z]|[a-zA-Z].*[0-9])/;\n //*********************************************************************\n // 初期処理系\n //*********************************************************************\n //############################################################\n // フォーカス\n //############################################################\n if (location.pathname == '/new' || location.pathname == '/login' || location.pathname == '/') {\n $(\"input[type='text']:visible\").eq(0).focus();\n }\n\n //############################################################\n // エンター押下\n //############################################################\n $(document).keypress(function (e) {\n if (e.keyCode == 13 && e.target.nodeName !== 'TEXTAREA') {\n $('.enter').click();\n return false;\n }\n });\n\n //############################################################\n // スペーストリム\n //############################################################\n $('input,textarea').on('blur', function () {\n $('input,textarea').each(function (i, e) {\n $(e).val($.trim($(e).val()));\n });\n $(\"input[type='text']\").trigger('keyup');\n $(\"input[type='email']\").trigger('keyup');\n $('textarea').trigger('keyup');\n });\n\n //############################################################\n // ログイン\n //############################################################\n $('#crm_login').on('click', function () {\n if ($('#id').val() == '' || $('#password').val() == '') {\n return;\n }\n\n $.ajax({\n url: './login_req',\n type: 'POST',\n data: {\n id: $('#id').val(),\n password: $('#password').val(),\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 1) {\n location.href = './index';\n } else {\n alert('NG');\n }\n });\n });\n\n //############################################################\n // CUSTOMER\n //############################################################\n $('#customer_index tr').on('click', function () {\n location.href = './edit?id=' + $(this).data('val');\n });\n\n //############################################################\n // CUSTOMER登録\n //############################################################\n $('#update_customer').on('click', function () {\n // バリデーション\n if ($('#name').val() == '') {\n alert('社名を入力してください');\n return;\n }\n\n let req_name;\n if ($(this).data('val')) {\n req_name = 'update_customer';\n } else {\n req_name = 'create_customer';\n }\n $.ajax({\n url: './' + req_name,\n type: 'POST',\n data: {\n id: $(this).data('val'),\n name: $('#name').val(),\n person: $('#person').val(),\n mail: $('#mail').val(),\n tel: $('#tel').val(),\n preferred_date: $('#preferred_date').val(),\n domain: $('#domain').val(),\n account_name: $('#account_name').val(),\n password: $('#password').val(),\n tag: $('#tag').val(),\n cv_tag: $('#cv_tag').val(),\n text: $('#text').val(),\n stat: $('#stat').val(),\n tag_stat: $('#tag_stat').val(),\n tag_check: $('#tag_check').val(),\n tag_fire: $('#tag_fire').val(),\n access_token: $('#access_token').val(),\n customer_posts: $('#customer_posts').val(),\n customer_preview: $('#customer_preview').val(),\n customer_release: $('#customer_release').val(),\n cv_tag_check: $('#cv_tag_check').val(),\n log_check: $('#log_check').val(),\n top_page: $('#top_page').val(),\n detail_page: $('#detail_page').val(),\n cart_page: $('#cart_page').val(),\n thanks_page: $('#thanks_page').val(),\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.href = './index';\n }\n });\n });\n\n //############################################################\n // progress\n //############################################################\n // $('.row').on('click', function () {\n // location.href = './progress_edit?id=' + $(this).data('customer') + '&p=' + $(this).data('progress');\n // });\n\n //############################################################\n // 商談(progress)登録\n //############################################################\n $('#update_progress').on('click', function () {\n // バリデーション\n if ($('#create_date').val() == '') {\n alert('日時を入力してください');\n return;\n }\n if ($('#text').val() == '') {\n alert('商談内容を入力してください');\n return;\n }\n\n let req_name;\n if ($(this).data('progress')) {\n req_name = 'update_progress';\n } else {\n req_name = 'create_progress';\n }\n $.ajax({\n url: './' + req_name,\n type: 'POST',\n data: {\n cid: $(this).data('customer'),\n pid: $(this).data('progress'),\n create_date: $('#create_date').val(),\n text: $('#text').val(),\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.href = './edit?id=' + data.cid;\n }\n });\n });\n});\n","document.addEventListener('turbolinks:load', function () {\n $('.content_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.content_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.content_slidedown_btn').fadeIn(0));\n });\n\n $('.content_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.content_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.content_slideup_btn').fadeIn(0));\n });\n\n // ------------------------------------------------------------------------------------------------\n // コンテンツ分析\n // ------------------------------------------------------------------------------------------------\n function contents_update_url() {\n const content_id = $('#content_selects option:selected').val();\n const gf = $('#content_graph_pattern_select_input').val();\n // const device = $('.content_device_select').data('device');\n const start_day = $('#content_report_start_day').val();\n const end_day = $('#content_report_end_day').val();\n\n let url = new URL(window.location.href);\n let params = url.searchParams;\n\n if (content_id !== 'none' && content_id !== null && content_id !== undefined) {\n params.set('content_id', content_id);\n } else {\n params.delete('content_id');\n }\n\n if (gf) {\n params.set('gf', gf);\n } else {\n params.delete('gf');\n }\n\n // if (device == \"0\" || device == \"1\" || device == \"2\") {\n // params.set('device', device);\n // } else {\n // params.delete('device');\n // }\n\n if (gf === '12') {\n params.delete('start_day');\n params.delete('end_day');\n } else { // このelseブロックを追加\n if (start_day) {\n params.set('start_day', start_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n\n if (end_day) {\n params.set('end_day', end_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n }\n\n url.search = params.toString();\n location.href = url.toString();\n }\n\n // #################################################################\n // コンテンツ,コンテンツメニューの選択\n // #################################################################\n $('#content_selects').on('change', function () {\n contents_update_url();\n });\n\n // #################################################################\n // 日毎、月毎のグラフ切り替え\n // #################################################################\n $('.content_graph_pattern_select_day, .content_graph_pattern_select_month').on('click', function () {\n const gf_value = $(this).data('gf');\n $('#content_graph_pattern_select_input').val(gf_value);\n contents_update_url();\n });\n\n // #################################################################\n // 範囲選択によるグラフ切り替え\n // #################################################################\n $('#content_report_start_day, #content_report_end_day').on('change', function () {\n contents_update_url();\n });\n\n // #################################################################\n // コンテンツのログデータのみの削除\n // #################################################################\n $('.delete_content_log_data').on('click', function () {\n if (!confirm('本当に削除を実行しますか?')) {\n return;\n }\n const content_id = $('#content_selects option:selected').val();\n\n $.ajax({\n url: '/content_report/delete_content_log',\n type: 'POST',\n data: {\n content_id: content_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('削除が完了しました。');\n location.reload();\n }\n });\n });\n\n // #################################################################\n // コンテンツのログデータと関連するデータ全ての削除\n // #################################################################\n $('.delete_content_log_data_and_related_data').on('click', function () {\n if (!confirm('本当に完全削除を実行しますか?')) {\n return;\n }\n const content_id = $('#content_selects option:selected').val();\n\n $.ajax({\n url: '/content_report/delete_content_log_and_related_data',\n type: 'POST',\n data: {\n content_id: content_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('削除が完了しました。');\n location.href = '/content_report/index';\n }\n });\n });\n\n // #################################################################\n // コンテンツのレポートのcsv出力\n // #################################################################\n $('#download_content_csv').on('click', function () {\n const content_id = $('#content_selects option:selected').val();\n const month = $('#ua_content_month_selects option:selected').val();\n\n let href = '/download_content_csv';\n\n href += `?content_id=${content_id}`;\n href += `&m=${month}`;\n location.href = href;\n });\n\n // ------------------------------------------------------------------------------------------------\n // コンテンツ管理\n // ------------------------------------------------------------------------------------------------\n // #################################################################\n // コンテンツ管理の新規作成\n // #################################################################\n $('#contents_create').on('click', function () {\n const name = $('.contents_input').val();\n\n if (!name) {\n alert('コンテンツ名を入力して下さい。');\n return;\n }\n\n $.ajax({\n url: '/create',\n type: 'POST',\n data: {\n name: name,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.href = `/content/index?contents_id=${data.content.id}`;\n }\n });\n });\n\n // #################################################################\n // コンテンツ管理の切り替え\n // #################################################################\n $('.contents_select_box').on('change', function () {\n let contents_id = $('.contents_select_box option:selected').val();\n if (contents_id == 'new') {\n $('.contents_set_wrapper_display').css('display', 'block');\n $('.contents_img_upload_wrapper').css('display', 'none');\n $('.contents_mode_setting_wrapper').css('display', 'none');\n $('.contents_display_type_setting_wrapper').css('display', 'none');\n $('.contents_display_time_ms_setting_wrapper').css('display', 'none');\n $('.contents_html_set_wrapper').css('display', 'none');\n $('.content_html_preview_wrapper').css('display', 'none');\n $('.contents_delete_btn_setting_wrapper').css('display', 'none');\n $('.contents_delete_btn_color_setting_wrapper').css('display', 'none');\n $('.contents_next_display_setting_wrapper').css('display', 'none');\n $('.contents_jump_url_setting_wrapper').css('display', 'none');\n $('.contents_popup_size_setting_wrapper').css('display', 'none');\n $('.popup_preview_position_setting_wrapper').css('display', 'none');\n $('.content_report_jump_btn').css('display', 'none');\n $('.content_delete_setting_wrapper').css('display', 'none');\n\n } else {\n location.href = `/content/index?contents_id=${contents_id}`;\n }\n });\n\n // #################################################################\n // コンテンツモードの切り替え\n // #################################################################\n $('.contents_mode_select_box').on('change', function () {\n let contents_id = $('.contents_select_box option:selected').val();\n // let is_mode = $('.contents_mode_select_box option:selected').val();\n let is_mode = $('.contents_mode_select_box:checked').val();\n\n $.ajax({\n url: '/change_content_mode',\n type: 'POST',\n data: {\n contents_id: contents_id,\n is_mode: is_mode\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // コンテンツ表示方法の切り替え\n // #################################################################\n $('.contents_display_type_select_box').on('change', function () {\n let contents_id = $('.contents_select_box option:selected').val();\n // let display_type = $('.contents_display_type_select_box option:selected').val();\n let display_type = $('.contents_display_type_select_box:checked').val();\n $.ajax({\n url: '/change_content_display_type',\n type: 'POST',\n data: {\n contents_id: contents_id,\n display_type: display_type\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // コンテンツ名の編集\n // #################################################################\n $('#contents_name_edit_btn').on('click', function () {\n let contents_id = $('.contents_select_box option:selected').val();\n let name = $('.contents_name_val').val();\n\n if (!name) {\n alert('名称を記入して下さい。');\n return;\n }\n\n $.ajax({\n url: '/save_content_name',\n type: 'POST',\n data: {\n contents_id: contents_id,\n name: name\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 画像登録\n // #################################################################\n $('#contents_img_upload_btn').on('click', function() {\n let contents_id = $('.contents_select_box option:selected').val();\n let file_data = $('.content_img_upload').prop('files')[0];\n if (!file_data) {\n alert('画像を選択してください。');\n return;\n }\n let form_data = new FormData();\n form_data.append('content_img_upload', file_data);\n form_data.append('contents_id', contents_id); // contents_idをFormDataに追加\n\n $.ajax({\n url: '/upload_content_img',\n type: 'POST',\n data: form_data,\n processData: false,\n contentType: false,\n success: function(response) {\n location.reload();\n },\n error: function(response) {\n alert('画像のアップロードに失敗しました。');\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 画像削除\n // #################################################################\n $('#contents_img_delete_btn').on('click', function() {\n let contents_id = $('.contents_select_box option:selected').val();\n\n $.ajax({\n url: '/delete_content_img',\n type: 'POST',\n data: {\n contents_id: contents_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // htmlのコンテンツの登録\n // #################################################################\n $('#contents_html_submit_btn').on('click', function () {\n let contents_id = $('.contents_select_box option:selected').val();\n let html = $('#contents_html').val();\n $.ajax({\n url: '/save_content_html',\n type: 'POST',\n data: {\n contents_id: contents_id,\n html: html\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // htmlのコンテンツサイズの登録\n // #################################################################\n $('#popup_html_size_btn').on('click', function () {\n let contents_id = $('.contents_select_box option:selected').val();\n let width = $('.popup_html_width_val').val();\n let height = $('.popup_html_height_val').val();\n\n $.ajax({\n url: '/save_content_html_size',\n type: 'POST',\n data: {\n contents_id: contents_id,\n width: width,\n height: height\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // htmlのコンテンツの表示/非表示\n // #################################################################\n $(\".content_html_delete_btn\").on(\"click\", function(){\n $(\".content_html_delete_btn\").css(\"display\",\"none\");\n $(\".content_html_display_btn\").css(\"display\",\"flex\");\n $(\".content_html_preview\").css(\"display\",\"none\");\n });\n $(\".content_html_display_btn\").on(\"click\", function(){\n $(\".content_html_delete_btn\").css(\"display\",\"flex\");\n $(\".content_html_display_btn\").css(\"display\",\"none\");\n $(\".content_html_preview\").css(\"display\",\"block\");\n });\n\n // #################################################################\n // HTMLの削除ボタンの位置の切り替え\n // #################################################################\n $('.contents_delete_btn_select_box').on('change', function () {\n let contents_id = $('.contents_select_box option:selected').val();\n let delete_btn_position = $('.contents_delete_btn_select_box option:selected').val();\n $.ajax({\n url: '/change_delete_btn_position',\n type: 'POST',\n data: {\n contents_id: contents_id,\n delete_btn_position: delete_btn_position\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ポップアップ画像のサイズ登録\n // #################################################################\n $('#contents_popup_size_btn').on('click', function () {\n let contents_id = $('.contents_select_box option:selected').val();\n let contents_popup_width_val = $('.contents_popup_width_val').val();\n let contents_popup_height_val = $('.contents_popup_height_val').val();\n let contents_img_border_color_val = $('.contents_img_border_color_val').val();\n\n if (!$('.contents_popup_border_flag').is(':checked')) {\n contents_img_border_color_val = \"\";\n }\n\n if (!contents_popup_width_val || !contents_popup_height_val) {\n alert('画像サイズを設定してください。');\n return;\n }\n\n $.ajax({\n url: '/save_popup_size',\n type: 'POST',\n data: {\n contents_id: contents_id,\n img_width: contents_popup_width_val,\n img_height: contents_popup_height_val,\n img_border_color: contents_img_border_color_val\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ポップアップ画像のサイズ自動調整\n // #################################################################\n // 幅の変更を監視\n $('.contents_popup_width_val').on('input', function() {\n let widthStr = $(this).val(); // 現在の幅の値(文字列)\n let width = parseInt(widthStr.replace('px', ''), 10); // 'px'を削除して数値に変換\n let aspectWidth = $(this).data('img_width'); // アスペクト比の幅\n let aspectHeight = $('.contents_popup_height_val').data('img_height'); // アスペクト比の高さ\n let newHeight = (width * aspectHeight) / aspectWidth; // 新しい高さを計算\n $('.contents_popup_height_val').val(`${newHeight.toFixed()}px`); // 小数点以下を切り捨てて設定\n });\n\n // 高さの変更を監視\n $('.contents_popup_height_val').on('input', function() {\n let heightStr = $(this).val(); // 現在の高さの値(文字列)\n let height = parseInt(heightStr.replace('px', ''), 10); // 'px'を削除して数値に変換\n let aspectWidth = $('.contents_popup_width_val').data('img_width'); // アスペクト比の幅\n let aspectHeight = $(this).data('img_height'); // アスペクト比の高さ\n let newWidth = (height * aspectWidth) / aspectHeight; // 新しい幅を計算\n $('.contents_popup_width_val').val(`${newWidth.toFixed()}px`); // 小数点以下を切り捨てて設定\n });\n\n // #################################################################\n // 削除ボタンの色の有無\n // #################################################################\n $('.contents_popup_is_bg_color_val').on('change', function () {\n let contents_id = $('.contents_select_box option:selected').val();\n let is_delete_btn_bg_color = $('.contents_popup_is_bg_color_val').val();\n\n if (is_delete_btn_bg_color == \"0\" || !is_delete_btn_bg_color) {\n is_delete_btn_bg_color = 1;\n } else {\n is_delete_btn_bg_color = 0;\n }\n\n $.ajax({\n url: '/save_is_delete_btn_color',\n type: 'POST',\n data: {\n contents_id: contents_id,\n is_delete_btn_bg_color: is_delete_btn_bg_color,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 削除ボタンの色\n // #################################################################\n $('.contents_popup_bg_color_val, .contents_popup_text_color_val').on('change', function () {\n let contents_id = $('.contents_select_box option:selected').val();\n let contents_popup_bg_color_val = $('.contents_popup_bg_color_val').val();\n let contents_popup_text_color_val = $('.contents_popup_text_color_val').val();\n\n if (!contents_popup_bg_color_val || !contents_popup_text_color_val) {\n alert('色を選択して下さい。');\n return;\n }\n\n $.ajax({\n url: '/save_delete_btn_color',\n type: 'POST',\n data: {\n contents_id: contents_id,\n bg_color: contents_popup_bg_color_val,\n text_color: contents_popup_text_color_val,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 再表示までの期間\n // #################################################################\n $('.contents_next_display_select_box').on('change', function () {\n let contents_id = $('.contents_select_box option:selected').val();\n let redisplay = $('.contents_next_display_select_box option:selected').val();\n $.ajax({\n url: '/change_redisplay',\n type: 'POST',\n data: {\n contents_id: contents_id,\n redisplay: redisplay\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 遷移先URLの登録\n // #################################################################\n $('#contents_popup_url_btn').on('click', function () {\n let contents_id = $('.contents_select_box option:selected').val();\n let url = $('.contents_popup_url_val').val();\n\n if (!url) {\n alert('URLを記入して下さい。');\n return;\n }\n\n $.ajax({\n url: '/save_jump_to_url',\n type: 'POST',\n data: {\n contents_id: contents_id,\n url: url\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ポップアップの表示位置設定\n // #################################################################\n $('.contents_display_position_btn').on('click', function () {\n let contents_id = $('.contents_select_box option:selected').val();\n let contents_display_position = $(this).data(\"cdp\");\n \n $.ajax({\n url: '/content/save_popup_display_position',\n type: 'POST',\n data: {\n contents_id: contents_id,\n contents_display_position: contents_display_position\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ポップアップの表示位置調整設定\n // #################################################################\n $('#contents_top_offset, #contents_bottom_offset, #contents_left_offset, #contents_right_offset').on('keypress blur', function (event) {\n // エンターキーが押されたかどうかをチェックし、エンターキーが押された場合にのみ処理を進めます\n if (event.type === 'keypress' && event.which !== 13) {\n return;\n }\n let contents_id = $('.contents_select_box option:selected').val();\n let contents_position = $(this).data(\"position\");\n let contents_offset = $(this).val();\n\n if (!contents_offset) {\n alert(\"入力して下さい。\");\n return;\n }\n $.ajax({\n url: '/content/save_popup_contents_offset',\n type: 'POST',\n data: {\n contents_id: contents_id,\n contents_position: contents_position,\n contents_offset: contents_offset\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ポップアップの背景の有無\n // #################################################################\n $('.popup_background_select_box').on('change', function () {\n let contents_id = $('.contents_select_box option:selected').val();\n let is_background = $('.popup_background_select_box option:selected').val();\n $.ajax({\n url: '/content/save_popup_is_background',\n type: 'POST',\n data: {\n contents_id: contents_id,\n is_background: is_background\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ポップアップの背景色設定\n // #################################################################\n $('#popup_background_color').on('change', function (event) {\n let contents_id = $('.contents_select_box option:selected').val();\n let background_color = $('#popup_background_color').val();\n $.ajax({\n url: '/content/save_popup_background_color',\n type: 'POST',\n data: {\n contents_id: contents_id,\n background_color: background_color\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ポップアップの背景の透過設定\n // #################################################################\n $('.popup_background_opacity_select_box').on('change', function (event) {\n let contents_id = $('.contents_select_box option:selected').val();\n let background_opacity = $('.popup_background_opacity_select_box option:selected').val();\n $.ajax({\n url: '/content/save_popup_background_opacity',\n type: 'POST',\n data: {\n contents_id: contents_id,\n background_opacity: background_opacity\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // コンテンツ管理削除\n // #################################################################\n $('#content_delete_btn').on('click', function () {\n let contents_id = $('.contents_select_box option:selected').val();\n\n if (!confirm('完全に削除され復元することはできません。本当に削除しますか?')) {\n return;\n }\n\n $.ajax({\n url: '/content/delete_contents',\n type: 'POST',\n data: {\n contents_id: contents_id,\n },\n dataType: 'json',\n }).done(function (data) {\n alert('コンテンツを削除しました。');\n location.href = `/contents_list/index`;\n });\n });\n});\n","document.addEventListener('turbolinks:load', function () {\n $('.contents_list_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.contents_list_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.contents_list_slidedown_btn').fadeIn(0));\n });\n\n $('.contents_list_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.contents_list_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.contents_list_slideup_btn').fadeIn(0));\n });\n\n \n // -----------------------------------------------------------------------------\n // コンテンツ一覧\n // -----------------------------------------------------------------------------\n // #################################################################\n // コンテンツの新規作成\n // #################################################################\n $('#contents_list_create').on('click', function () {\n const name = $('.contents_list_input').val();\n\n if (!name) {\n alert('コンテンツ名を入力して下さい。');\n return;\n }\n\n $.ajax({\n url: '/contents_list/create',\n type: 'POST',\n data: {\n name: name,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.href = `/content/index?contents_id=${data.content.id}`;\n }\n });\n });\n\n // #################################################################\n // コンテンツ検索\n // #################################################################\n $('#contents_list_search').on('keypress', function (e) {\n let p = $(this).val();\n if (!p) {\n return;\n }\n\n if (e.which == 13) {\n e.preventDefault();\n \n $('.contents_record').remove();\n let p = $(this).val();\n\n $.ajax({\n url: 'get_contents_list',\n type: 'POST',\n data: {\n p: p,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n $.each(data.contents, function (index, content) {\n let mode = '';\n if (content.is_mode == 0) {\n mode = 'ポップアップ';\n } else if (content.is_mode == 1) {\n mode = '差し込み配信';\n } else if (content.is_mode == 2) {\n mode = '離脱防止';\n }\n\n let display_type = '';\n if (content.display_type == 0) {\n display_type = '画像';\n } else if (content.display_type == 1) {\n display_type = 'HTML';\n }\n\n let preview_btn = '';\n if ((content.display_type == 0 && content.img_url) || (content.display_type == 1 && content.html)) {\n preview_btn = `\n
\n \n \n \n \n プレビュー\n
`;\n }\n\n $('.contents_list_table').append(\n `\n ${index + 1}:\n \n \n
${content.name}
\n
\n \n ${mode}\n ${display_type}\n ${preview_btn}\n \n
\n \n \n \n コピー作成\n
\n \n \n \">\n
\n \n \n \n レポートへ\n
\n
\n \n `\n );\n });\n }\n });\n }\n });\n\n // #################################################################\n // プレビュー表示\n // #################################################################\n $(\".contents_preview_btn\").on(\"click\", function () {\n let is_mode = $(this).data(\"is_mode\");\n let display_type = $(this).data(\"display_type\");\n let img_url = $(this).data(\"img_url\");\n let html = $(this).data(\"html\");\n let delete_btn_position = $(this).data(\"delete_btn_position\");\n let img_width = $(this).data(\"img_width\");\n let img_height = $(this).data(\"img_height\");\n\n // $('.contents_preview_btn').css('pointer-events', 'none');\n $(\".contents_list_html_preview_wrapper\").remove();\n\n let common_styles = \"position:absolute; display:flex; justify-content: center;align-items: center;background-color:#ededed;padding:0;border-radius:9999px;cursor:pointer;user-select:none;height:30px;width:30px;\";\n\n let unique_styles;\n let delete_btn_style;\n\n switch(delete_btn_position) {\n case 0:\n unique_styles = \"right:2px; top:-32px; \";\n break;\n case 1:\n unique_styles = \"right:-30px; top:-30px; \";\n break;\n case 2:\n unique_styles = \"right:-32px; top:0px; \";\n break;\n case 3:\n unique_styles = \"right:2px; top:2px; \";\n break;\n case 4:\n unique_styles = \"left:2px; top:-32px; \";\n break;\n case 5:\n unique_styles = \"left:-30px; top:-30px; \";\n break;\n case 6:\n unique_styles = \"left:-32px; top:0px; \";\n break;\n case 7:\n unique_styles = \"left:2px; top:2px; \";\n break;\n default:\n unique_styles = \"right:2px; top:-32px; \";\n }\n\n delete_btn_style = common_styles + unique_styles;\n\n let el;\n\n if (display_type == \"0\") {\n el = ``;\n } else if (display_type == \"1\"){\n el = html;\n }\n\n let append_html = `
\n \n
\n ${el}\n
\n
`;\n\n $(\"body\").append(append_html);\n\n $(\".contents_list_html_delete_btn\").on(\"click\", function() {\n $(this).parent().remove();\n // $('.contents_preview_btn').css('pointer-events', 'auto');\n });\n });\n\n // #################################################################\n // コンテンツのコピーの作成\n // #################################################################\n $(document).on('click', '.content_copy_btn', function () {\n const cantent_id = $(this).data(\"cantent_id\");\n\n console.log(2222);\n\n $.ajax({\n url: '/contents_list/create_copy',\n type: 'POST',\n data: {\n cantent_id: cantent_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n});","document.addEventListener('turbolinks:load', function () {\n $('.popup_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.popup_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.popup_slidedown_btn').fadeIn(0));\n });\n\n $('.popup_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.popup_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.popup_slideup_btn').fadeIn(0));\n });\n // ------------------------------------------------------------------------------------------------\n // ポップアップ分析\n // ------------------------------------------------------------------------------------------------\n function popup_update_url() {\n const popup_id = $('#popup_select_box option:selected').val();\n const gf = $('#popup_graph_pattern_select_input').val();\n const ab = $('#popup_ab_test_select_box option:selected').val();\n const device = $('.popup_device_select').data(\"device\");\n const start_day = $('#popup_report_start_day').val();\n const end_day = $('#popup_report_end_day').val();\n\n let url = new URL(window.location.href);\n let params = url.searchParams;\n\n if (popup_id !== 'none' && popup_id !== null && popup_id !== undefined) {\n params.set('popup_id', popup_id);\n } else {\n params.delete('popup_id');\n }\n\n if (ab !== 'none' && ab !== null && ab !== undefined) {\n params.set('ab', ab);\n } else {\n params.delete('ab');\n }\n\n if (gf) {\n params.set('gf', gf);\n } else {\n params.delete('gf');\n }\n\n if (device == \"0\" || device == \"1\") {\n params.set('device', device);\n } else {\n params.delete('device');\n }\n\n if (gf === '12') {\n params.delete('start_day');\n params.delete('end_day');\n } else { // このelseブロックを追加\n if (start_day) {\n params.set('start_day', start_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n\n if (end_day) {\n params.set('end_day', end_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n }\n\n url.search = params.toString();\n location.href = url.toString();\n }\n\n // #################################################################\n // ポップアップの選択\n // #################################################################\n $('#popup_select_box').on('change', function () {\n popup_update_url();\n });\n\n // #################################################################\n // ABテストの選択\n // #################################################################\n $('#popup_ab_test_select_box').on('change', function () {\n popup_update_url();\n });\n\n // #################################################################\n // 日毎、月毎のグラフ切り替え\n // #################################################################\n $('.popup_graph_pattern_select_day, .popup_graph_pattern_select_month').on('click', function () {\n const gf_value = $(this).data('gf');\n $('#popup_graph_pattern_select_input').val(gf_value);\n popup_update_url();\n });\n\n // #################################################################\n // デバイスごとのグラフ切り替え\n // #################################################################\n $('.popup_device_select_all, .popup_device_select_pc, .popup_device_select_phone').on('click', function () {\n const device = $(this).data('device');\n $('.popup_device_select').data(\"device\", device);\n popup_update_url();\n });\n\n // #################################################################\n // 範囲選択によるグラフ切り替え\n // #################################################################\n $('#popup_report_start_day, #popup_report_end_day').on('change', function () {\n popup_update_url();\n });\n\n // #################################################################\n // 表の年月切り替え\n // #################################################################\n $('#ua_popup_month_selects').on('change', function () {\n let popup_id = $('#popup_select_box option:selected').val();\n let month = $('#ua_popup_month_selects option:selected').val();\n let url = new URL(window.location.href);\n\n if (month != '') {\n if (url.searchParams.has('m')) {\n // 値が \"0\"か\"1\" なら \"2\" に更新する\n let new_value = month;\n // パラメーターの値を更新する\n url.searchParams.set('m', new_value);\n } else {\n // パラメーターにdeviceがない場合\n // 新しいパラメーターを追加する\n url.searchParams.append('m', month);\n }\n\n // 更新されたURLにリダイレクトする\n location.href = url.toString();\n } else {\n // monthが空文字の時は指定したURLにリダイレクトする\n // location.href = 'ugc_analysis';\n }\n });\n\n // #################################################################\n // ポップアップのログデータのみの削除\n // #################################################################\n $('.delete_popup_log_data').on('click', function () {\n if (!confirm('本当に削除を実行しますか?')) {\n return;\n }\n const popup_id = $('#popup_select_box option:selected').val();\n\n $.ajax({\n url: '/popup_report/delete_popup_log',\n type: 'POST',\n data: {\n popup_id: popup_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ポップアップのログデータと関連するデータ全ての削除\n // #################################################################\n $('.delete_popup_log_data_and_related_data').on('click', function () {\n if (!confirm('本当に完全削除を実行しますか?')) {\n return;\n }\n const popup_id = $('#popup_select_box option:selected').val();\n\n $.ajax({\n url: '/popup_report/delete_popup_log_and_related_data',\n type: 'POST',\n data: {\n popup_id: popup_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.href = '/popup_report/index';\n }\n });\n });\n\n // #################################################################\n // ポップアップのレポートのcsv出力\n // #################################################################\n $('#download_popup_csv').on('click', function () {\n const popup_id = $('#popup_select_box option:selected').val();\n const month = $('#ua_popup_month_selects option:selected').val();\n const device = $('.popup_device_select').data('device');\n\n let href = '/download_popup_csv';\n\n href += `?popup_id=${popup_id}`;\n href += `&m=${month}`;\n href += `&device=${device}`;\n location.href = href;\n });\n\n // ------------------------------------------------------------------------------------------------\n // ポップアップ管理\n // ------------------------------------------------------------------------------------------------\n // #################################################################\n // ポップアップ管理の新規作成\n // #################################################################\n $('#popup_create').on('click', function () {\n const name = $('.popup_input').val();\n\n if (!name) {\n alert('ポップアップ名を入力して下さい。');\n return;\n }\n\n $.ajax({\n url: '/create_popup',\n type: 'POST',\n data: {\n name: name,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('新規登録されました。');\n location.href = `/popup/index?popup_id=${data.popup_id}&popup_setting_id=${data.popup_setting_id}&popup_ab_test_id=${data.popup_ab_test_id}&device=${data.is_device}`;\n }\n });\n });\n\n // #################################################################\n // ポップアップ名の編集\n // #################################################################\n $('#popup_name_edit_btn').on('click', function () {\n let popup_id = $('.popup_selects option:selected').val();\n let name = $('.popup_name_val').val();\n\n if (!name) {\n alert('名称を記入して下さい。');\n return;\n }\n\n $.ajax({\n url: '/save_popup_name',\n type: 'POST',\n data: {\n popup_id: popup_id,\n name: name\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ポップアップ管理の切り替え\n // #################################################################\n $('.popup_selects').on('change', function () {\n let popup_id = $('.popup_selects option:selected').val();\n if (popup_id == 'new') {\n $('.popup_set_wrapper_display').css('display', 'block');\n $('.popup_device_setting_wrapper').css('display', 'none');\n $('.popup_ab_test_setting_wrapper').css('display', 'none');\n $('.popup_show_valid_setting_wrapper').css('display', 'none');\n $('.popup_url_setting_wrapper').css('display', 'none');\n $('.popup_excluded_url_setting_wrapper').css('display', 'none');\n $('.popup_preview_setting_wrapper').css('display', 'none');\n $('.popup_preview_url_list_wrapper').css('display', 'none');\n $('.popup_preview_position_setting_wrapper').css('display', 'none');\n $('.popup_contents_setting_wrapper').css('display', 'none');\n $('.popup_name_setting_wrapper').css('display', 'none');\n $('.contents_display_time_ms_setting_wrapper').css('display', 'none');\n $('.contents_scroll_percent_setting_wrapper').css('display', 'none');\n $('.popup_display_condition_setting_wrapper').css('display', 'none');\n $('.popup_report_jump_btn').css('display', 'none');\n $('.popup_delete_setting_wrapper').css('display', 'none');\n $('.popup_personalize_setting_wrapper').css('display', 'none');\n $('.popup_priority_setting_wrapper').css('display', 'none');\n } else {\n location.href = `/popup/index?popup_id=${popup_id}`;\n }\n });\n\n // #################################################################\n // ポップアップのデバイスの切り替え\n // #################################################################\n $('.popup_device_selects').on('change', function () {\n let popup_id = $('.popup_selects option:selected').val();\n // let popup_setting_id = $('.popup_device_selects:checked').data(\"popup_setting_id\");\n let popup_setting_id = $('.popup_device_selects:checked').data(\"popup_setting_id\");\n\n location.href = `/popup/index?popup_id=${popup_id}&popup_setting_id=${popup_setting_id}`;\n });\n\n // #################################################################\n // ポップアップの表示URL設定\n // #################################################################\n $('#popup_url_add_input').on('click', function () {\n $(this)\n .parents('table')\n .append(\n `\n \n \n \n \n \n
\n \n \n \n
\n \n `\n );\n $('.popup_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n $('.popup_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n\n $('#popup_url_set').on('click', function () {\n let popup_id = $('.popup_selects option:selected').val();\n let urls = [];\n $('.popup_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/set_popup_url',\n type: 'POST',\n data: {\n popup_id: popup_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // ポップアップの除外URL設定\n // #################################################################\n $('#popup_excluded_url_add_input').on('click', function () {\n $(this)\n .parents('table')\n .append(\n `\n \n \n \n \n \n
\n \n \n \n
\n \n `\n );\n $('.popup_excluded_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n $('.popup_excluded_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n\n $('#popup_excluded_url_set').on('click', function () {\n let popup_id = $('.popup_selects option:selected').val();\n let urls = [];\n $('.popup_excluded_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/set_popup_excluded_url',\n type: 'POST',\n data: {\n popup_id: popup_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // ポップアップとコンテンツの連携\n // #################################################################\n $('.popup_contents_select_box').on('change', function () {\n let popup_id = $('.popup_selects option:selected').val();\n let popup_ab_test_id = $('.popup_ab_test_selects option:selected').val();\n let content_id = $(this).val();\n $.ajax({\n url: '/save_popup_content_id',\n type: 'POST',\n data: {\n popup_id: popup_id,\n popup_ab_test_id: popup_ab_test_id,\n content_id: content_id\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // ポップアップとパーソナライズの連携\n // #################################################################\n $('.popup_personalize_select_box').on('change', function () {\n let popup_id = $('.popup_selects option:selected').val();\n let popup_ab_test_id = $('.popup_ab_test_selects option:selected').val();\n let personalize_id = $(this).val();\n $.ajax({\n url: '/save_popup_personalize_id',\n type: 'POST',\n data: {\n popup_id: popup_id,\n popup_ab_test_id: popup_ab_test_id,\n personalize_id: personalize_id\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // ポップアップのプレビュー作成\n // #################################################################\n $('#popup_create_preview_btn')\n .off()\n .on('click', function () {\n $('.loadding').css('display', 'block');\n let popup_id = $('.popup_selects option:selected').val();\n let is_device = $('.popup_device_selects:checked').val();\n let popup_setting_id = $('.popup_device_selects:checked').data(\"popup_setting_id\");\n let popup_ab_test_id = $('.popup_ab_test_selects option:selected').val();\n let preview_url = $('#popup_create_preview_url').val();\n \n if (popup_id == '' || popup_id == null || preview_url == '') {\n $('.loadding').css('display', 'none');\n alert('必須項目を入力してください。');\n return;\n }\n\n $.ajax({\n url: '/popup/save_popup_preview',\n type: 'POST',\n data: {\n popup_id: popup_id,\n is_device: is_device,\n popup_setting_id: popup_setting_id,\n popup_ab_test_id: popup_ab_test_id,\n url: preview_url\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ポップアップのプレビュー編集\n // #################################################################\n $('.create_popup_preview_html_edit').on('click', function () {\n let preview_id = $(this).data('id');\n let preview_url = $(this).data('url');\n $.ajax({\n url: '/edit_popup_preview_html',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n // モーダルを作成し、HTMLコンテンツとボタンを表示\n let modalHtml = `
\n
\n
\n \n
\n
\n
閉じる
\n
保存
\n
\n
`;\n\n // モーダルをbody要素に追加\n $('body').append(modalHtml);\n $('#html_modal_text_area').text(data.html_content);\n\n $('#html_save_btn').on('click', function () {\n let html = $('#html_modal_text_area').val();\n $.ajax({\n url: '/update_popup_preview_html',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n html: html,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n $('#html_modal_wrapper, #html_remove_btn').on('click', function (e) {\n $('#html_modal_wrapper, #html_modal_container, #html_modal_text_area, #html_save_btn').remove();\n });\n }\n });\n });\n\n // #################################################################\n // ポップアップのプレビュー削除\n // #################################################################\n $('.create_popup_preview_url_delete').on('click', function () {\n let preview_id = $(this).data('id');\n let preview_url = $(this).data('url');\n $.ajax({\n url: '/delete_popup_preview',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ポップアップの公開設定\n // #################################################################\n $('.popup_show_valid_select_box').on('change', function (event) {\n let popup_id = $('.popup_selects option:selected').val();\n let popup_ab_test_id = $('.popup_ab_test_selects option:selected').val();\n // let show_valid = $('.popup_show_valid_select_box option:selected').val();\n let show_valid = $('.popup_show_valid_select_box:checked').val();\n\n $.ajax({\n url: '/save_popup_show_valid',\n type: 'POST',\n data: {\n popup_id: popup_id,\n popup_ab_test_id: popup_ab_test_id,\n show_valid: show_valid\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ポップアップの公開期間設定\n // #################################################################\n $('.popup_start_datetime, .popup_end_datetime').on('change', function (event) {\n let popup_id = $('.popup_selects option:selected').val();\n let popup_ab_test_id = $('.popup_ab_test_selects option:selected').val();\n let publication_start = $('.popup_start_datetime').val();\n let publication_end = $('.popup_end_datetime').val();\n\n // 開始日時があり、終了日時がない場合\n if (publication_start && !publication_end) {\n let startDate = new Date(publication_start);\n startDate.setMonth(startDate.getMonth() + 1); // 1ヶ月後に設定\n\n let year = startDate.getFullYear();\n let month = ('0' + (startDate.getMonth() + 1)).slice(-2); // 月は0始まりなので1を加える\n let day = ('0' + startDate.getDate()).slice(-2);\n let hours = ('0' + startDate.getHours()).slice(-2);\n let minutes = ('0' + startDate.getMinutes()).slice(-2);\n\n publication_end = year + '-' + month + '-' + day + 'T' + hours + ':' + minutes;\n\n $('.popup_end_datetime').val(publication_end);\n }\n\n // 終了日時があり、開始日時がない場合\n if (!publication_start && publication_end) {\n alert('開始日から入力して下さい。');\n $('.popup_end_datetime').val(\"\");\n }\n\n $.ajax({\n url: '/save_popup_publication_date',\n type: 'POST',\n data: {\n popup_id: popup_id,\n popup_ab_test_id: popup_ab_test_id,\n publication_start: publication_start,\n publication_end: publication_end\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ポップアップのABテストの新規作成\n // #################################################################\n $('#create_popup_ab_test_btn').on('click', function () {\n $('.loadding').css('display', 'block');\n let popup_id = $('.popup_selects option:selected').val();\n let popup_setting_id = $('.popup_device_selects:checked').data(\"popup_setting_id\");\n let popup_ab_test_id = $('.popup_ab_test_selects option:selected').val();\n\n $.ajax({\n url: '/create_popup_ab_test',\n type: 'POST',\n data: {\n popup_id: popup_id,\n popup_setting_id: popup_setting_id,\n popup_ab_test_id: popup_ab_test_id\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n } else {\n $('.loadding').css('display', 'none');\n return;\n }\n });\n });\n\n // #################################################################\n // デフォルトのABテストの設定\n // #################################################################\n $('#update_popup_default_ab_test_btn').on('click', function () {\n let popup_setting_id = $('.popup_device_selects:checked').data(\"popup_setting_id\");\n let popup_ab_test_id = $(\"input[name='popup_ab_test_radio']:checked\").val();\n\n $.ajax({\n url: '/update_popup_default_ab_test',\n type: 'POST',\n data: {\n popup_setting_id: popup_setting_id,\n popup_ab_test_id: popup_ab_test_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n \n // #################################################################\n // ポップアップのABテスト選択\n // #################################################################\n $('.popup_ab_test_selects').on('change', function () {\n let popup_id = $('.popup_selects option:selected').val();\n let popup_setting_id = $('.popup_device_selects:checked').data(\"popup_setting_id\");\n let popup_ab_test_id = $('.popup_ab_test_selects option:selected').val();\n\n location.href = `/popup/index?popup_id=${popup_id}&popup_setting_id=${popup_setting_id}&popup_ab_test_id=${popup_ab_test_id}`;\n });\n\n // #################################################################\n // ABテストの選択切り替え\n // #################################################################\n $('#start_popup_ab_test_btn, #stop_popup_ab_test_btn').on('click', function () {\n let popup_id = $('.popup_selects option:selected').val();\n let popup_setting_id = $('.popup_device_selects:checked').data(\"popup_setting_id\");\n\n $.ajax({\n url: '/update_popup_ab_test_mode',\n type: 'POST',\n data: {\n popup_id: popup_id,\n popup_setting_id: popup_setting_id\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ポップアップの表示条件設定\n // #################################################################\n $('.popup_display_condition_select_box').on('change', function (event) {\n let popup_id = $('.popup_selects option:selected').val();\n let popup_ab_test_id = $('.popup_ab_test_selects option:selected').val();\n let is_display_condition = $('.popup_display_condition_select_box option:selected').val();\n $.ajax({\n url: '/save_popup_display_condition',\n type: 'POST',\n data: {\n popup_id: popup_id,\n popup_ab_test_id: popup_ab_test_id,\n is_display_condition: is_display_condition\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 表示するまでの時間の登録\n // #################################################################\n $('#contents_display_time_ms_edit_btn').on('click', function () {\n let popup_setting_id = $('.popup_device_selects:checked').data(\"popup_setting_id\");\n let popup_ab_test_id = $(\"input[name='popup_ab_test_radio']:checked\").val();\n\n let contents_id = $(this).data(\"content_id\");\n let display_time_ms = $('.contents_display_time_ms_val').val();\n\n if (!display_time_ms) {\n alert('秒数を記入して下さい。');\n return;\n }\n\n $.ajax({\n url: '/save_display_time_ms',\n type: 'POST',\n data: {\n popup_setting_id: popup_setting_id,\n popup_ab_test_id: popup_ab_test_id,\n contents_id: contents_id,\n display_time_ms: display_time_ms\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // スクロール割合の登録\n // #################################################################\n $('#contents_scroll_percent_edit_btn').on('click', function () {\n let popup_setting_id = $('.popup_device_selects:checked').data(\"popup_setting_id\");\n let popup_ab_test_id = $(\"input[name='popup_ab_test_radio']:checked\").val();\n\n let contents_id = $(this).data(\"content_id\");\n let scroll_percent = $('.contents_scroll_percent_val').val();\n\n if (!scroll_percent) {\n alert('秒数を記入して下さい。');\n return;\n }\n\n $.ajax({\n url: '/save_scroll_percent',\n type: 'POST',\n data: {\n popup_setting_id: popup_setting_id,\n popup_ab_test_id: popup_ab_test_id,\n contents_id: contents_id,\n scroll_percent: scroll_percent\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ポップアップ施策削除\n // #################################################################\n $('#popup_delete_btn').on('click', function () {\n let popup_id = $('.popup_selects option:selected').val();\n\n if (!confirm('完全に削除され復元することはできません。本当に削除しますか?')) {\n return;\n }\n\n $.ajax({\n url: '/popup/delete_popup',\n type: 'POST',\n data: {\n popup_id: popup_id,\n },\n dataType: 'json',\n }).done(function (data) {\n alert('ポップアップ施策を削除しました。');\n location.href = `/popup/index`;\n });\n });\n\n // #################################################################\n // ポップアップ施策表示優先度設定\n // #################################################################\n $('.popup_priority_select_box').on('click', function () {\n let popup_ab_test_id = $('.popup_ab_test_selects option:selected').val();\n let priority = Math.abs($(this).val());\n\n if (priority === null) {\n $('.popup_priority_select_box_plus_val').val(0);\n return;\n }\n \n $.ajax({\n url: '/popup/save_popup_priority',\n type: 'POST',\n data: {\n popup_ab_test_id: popup_ab_test_id,\n priority: priority\n },\n dataType: 'json',\n }).done(function (data) {\n // $('.popup_priority_select_box').val(`-${priority}`);\n $('.popup_priority_select_box').val(priority);\n });\n });\n});\n","document.addEventListener('turbolinks:load', function () {\n $('.site_insert_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.site_insert_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.site_insert_slidedown_btn').fadeIn(0));\n });\n\n $('.site_insert_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.site_insert_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.site_insert_slideup_btn').fadeIn(0));\n });\n // ------------------------------------------------------------------------------------------------\n // 差し込み配信分析\n // ------------------------------------------------------------------------------------------------\n function site_insert_update_url() {\n const site_insert_id = $('#site_insert_select_box option:selected').val();\n const gf = $('#site_insert_graph_pattern_select_input').val();\n const ab = $('#site_insert_ab_test_select_box option:selected').val();\n const device = $('.site_insert_device_select').data(\"device\");\n const start_day = $('#site_insert_report_start_day').val();\n const end_day = $('#site_insert_report_end_day').val();\n\n let url = new URL(window.location.href);\n let params = url.searchParams;\n\n if (site_insert_id !== 'none' && site_insert_id !== null && site_insert_id !== undefined) {\n params.set('site_insert_id', site_insert_id);\n } else {\n params.delete('site_insert_id');\n }\n\n if (ab !== 'none' && ab !== null && ab !== undefined) {\n params.set('ab', ab);\n } else {\n params.delete('ab');\n }\n\n if (gf) {\n params.set('gf', gf);\n } else {\n params.delete('gf');\n }\n\n if (device == \"0\" || device == \"1\") {\n params.set('device', device);\n } else {\n params.delete('device');\n }\n\n if (gf === '12') {\n params.delete('start_day');\n params.delete('end_day');\n } else { // このelseブロックを追加\n if (start_day) {\n params.set('start_day', start_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n\n if (end_day) {\n params.set('end_day', end_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n }\n\n url.search = params.toString();\n location.href = url.toString();\n }\n\n // #################################################################\n // 差し込み配信の選択\n // #################################################################\n $('#site_insert_select_box').on('change', function () {\n site_insert_update_url();\n });\n\n // #################################################################\n // ABテストの選択\n // #################################################################\n $('#site_insert_ab_test_select_box').on('change', function () {\n site_insert_update_url();\n });\n\n // #################################################################\n // 日毎、月毎のグラフ切り替え\n // #################################################################\n $('.site_insert_graph_pattern_select_day, .site_insert_graph_pattern_select_month').on('click', function () {\n const gf_value = $(this).data('gf');\n $('#site_insert_graph_pattern_select_input').val(gf_value);\n site_insert_update_url();\n });\n\n // #################################################################\n // デバイスごとのグラフ切り替え\n // #################################################################\n $('.site_insert_device_select_all, .site_insert_device_select_pc, .site_insert_device_select_phone').on('click', function () {\n const device = $(this).data('device');\n $('.site_insert_device_select').data(\"device\", device);\n site_insert_update_url();\n });\n\n // #################################################################\n // 範囲選択によるグラフ切り替え\n // #################################################################\n $('#site_insert_report_start_day, #site_insert_report_end_day').on('change', function () {\n site_insert_update_url();\n });\n\n // #################################################################\n // 表の年月切り替え\n // #################################################################\n $('#ua_site_insert_month_selects').on('change', function () {\n let site_insert_id = $('#site_insert_select_box option:selected').val();\n let month = $('#ua_site_insert_month_selects option:selected').val();\n let url = new URL(window.location.href);\n\n if (month != '') {\n if (url.searchParams.has('m')) {\n // 値が \"0\"か\"1\" なら \"2\" に更新する\n let new_value = month;\n // パラメーターの値を更新する\n url.searchParams.set('m', new_value);\n } else {\n // パラメーターにdeviceがない場合\n // 新しいパラメーターを追加する\n url.searchParams.append('m', month);\n }\n\n // 更新されたURLにリダイレクトする\n location.href = url.toString();\n } else {\n // monthが空文字の時は指定したURLにリダイレクトする\n // location.href = 'ugc_analysis';\n }\n });\n\n // #################################################################\n // 差し込み表示のログデータのみの削除\n // #################################################################\n $('.delete_site_insert_log_data').on('click', function () {\n if (!confirm('本当に削除を実行しますか?')) {\n return;\n }\n const site_insert_id = $('#site_insert_select_box option:selected').val();\n\n $.ajax({\n url: '/site_insert_report/delete_site_insert_log',\n type: 'POST',\n data: {\n site_insert_id: site_insert_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 差し込み表示のログデータと関連するデータ全ての削除\n // #################################################################\n $('.delete_site_insert_log_data_and_related_data').on('click', function () {\n if (!confirm('本当に完全削除を実行しますか?')) {\n return;\n }\n const site_insert_id = $('#site_insert_select_box option:selected').val();\n\n $.ajax({\n url: '/site_insert_report/delete_site_insert_log_and_related_data',\n type: 'POST',\n data: {\n site_insert_id: site_insert_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.href = '/site_insert_report/index';\n }\n });\n });\n\n // #################################################################\n // 差し込み表示のレポートのcsv出力\n // #################################################################\n $('#download_site_insert_csv').on('click', function () {\n const site_insert_id = $('#site_insert_select_box option:selected').val();\n const month = $('#ua_site_insert_month_selects option:selected').val();\n const device = $('.site_insert_device_select').data('device');\n\n let href = '/download_site_insert_csv';\n\n href += `?site_insert_id=${site_insert_id}`;\n href += `&m=${month}`;\n href += `&device=${device}`;\n location.href = href;\n });\n\n // ------------------------------------------------------------------------------------------------\n // 差し込み配信管理\n // ------------------------------------------------------------------------------------------------\n // #################################################################\n // 差し込み配信管理の新規作成\n // #################################################################\n $('#site_insert_create').on('click', function () {\n const name = $('.site_insert_input').val();\n\n if (!name) {\n alert('差し込み配信名を入力して下さい。');\n return;\n }\n\n $.ajax({\n url: '/create_site_insert',\n type: 'POST',\n data: {\n name: name,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('新規登録されました。');\n location.href = `/site_insert/index?site_insert_id=${data.site_insert_id}&site_insert_setting_id=${data.site_insert_setting_id}&site_insert_ab_test_id=${data.site_insert_ab_test_id}&device=${data.is_device}`;\n }\n });\n });\n\n // #################################################################\n // 差し込み配信名の編集\n // #################################################################\n $('#site_insert_name_edit_btn').on('click', function () {\n let site_insert_id = $('.site_insert_selects option:selected').val();\n let name = $('.site_insert_name_val').val();\n\n if (!name) {\n alert('名称を記入して下さい。');\n return;\n }\n\n $.ajax({\n url: '/save_site_insert_name',\n type: 'POST',\n data: {\n site_insert_id: site_insert_id,\n name: name\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 差し込み配信管理の切り替え\n // #################################################################\n $('.site_insert_selects').on('change', function () {\n let site_insert_id = $('.site_insert_selects option:selected').val();\n if (site_insert_id == 'new') {\n $('.site_insert_set_wrapper_display').css('display', 'block');\n $('.site_insert_device_setting_wrapper').css('display', 'none');\n $('.site_insert_ab_test_setting_wrapper').css('display', 'none');\n $('.site_insert_show_valid_setting_wrapper').css('display', 'none');\n $('.site_insert_url_setting_wrapper').css('display', 'none');\n $('.site_insert_excluded_url_setting_wrapper').css('display', 'none');\n $('.site_insert_preview_setting_wrapper').css('display', 'none');\n $('.site_insert_preview_url_list_wrapper').css('display', 'none');\n $('.site_insert_preview_position_setting_wrapper').css('display', 'none');\n $('.site_insert_contents_setting_wrapper').css('display', 'none');\n $('.site_insert_element_setting_wrapper').css('display', 'none');\n $('.site_insert_name_setting_wrapper').css('display', 'none');\n $('.site_insert_report_jump_btn').css('display', 'none');\n $('.site_insert_personalize_setting_wrapper').css('display', 'none');\n $('.site_insert_delete_setting_wrapper').css('display', 'none');\n } else {\n location.href = `/site_insert/index?site_insert_id=${site_insert_id}`;\n }\n });\n\n // #################################################################\n // 差し込み配信のデバイスの切り替え\n // #################################################################\n $('.site_insert_device_selects').on('change', function () {\n let site_insert_id = $('.site_insert_selects option:selected').val();\n let site_insert_setting_id = $('.site_insert_device_selects:checked').data(\"site_insert_setting_id\");\n\n location.href = `/site_insert/index?site_insert_id=${site_insert_id}&site_insert_setting_id=${site_insert_setting_id}`;\n });\n\n // #################################################################\n // 差し込み配信の表示URL設定\n // #################################################################\n $('#site_insert_url_add_input').on('click', function () {\n $(this)\n .parents('table')\n .append(\n `\n \n \n \n \n \n
\n \n \n \n
\n \n `\n );\n $('.site_insert_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n $('.site_insert_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n\n $('#site_insert_url_set').on('click', function () {\n let site_insert_id = $('.site_insert_selects option:selected').val();\n let urls = [];\n $('.site_insert_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/set_site_insert_url',\n type: 'POST',\n data: {\n site_insert_id: site_insert_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // 差し込み配信の除外URL設定\n // #################################################################\n $('#site_insert_excluded_url_add_input').on('click', function () {\n $(this)\n .parents('table')\n .append(\n `\n \n \n \n \n \n
\n \n \n \n
\n \n `\n );\n $('.site_insert_excluded_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n $('.site_insert_excluded_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n\n $('#site_insert_excluded_url_set').on('click', function () {\n let site_insert_id = $('.site_insert_selects option:selected').val();\n let urls = [];\n $('.site_insert_excluded_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/set_site_insert_excluded_url',\n type: 'POST',\n data: {\n site_insert_id: site_insert_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // 差し込み配信とコンテンツの連携\n // #################################################################\n $('.site_insert_contents_select_box').on('change', function () {\n let site_insert_id = $('.site_insert_selects option:selected').val();\n let site_insert_ab_test_id = $('.site_insert_ab_test_selects option:selected').val();\n let content_id = $(this).val();\n $.ajax({\n url: '/save_site_insert_content_id',\n type: 'POST',\n data: {\n site_insert_id: site_insert_id,\n site_insert_ab_test_id: site_insert_ab_test_id,\n content_id: content_id\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // 差し込み配信とパーソナライズの連携\n // #################################################################\n $('.site_insert_personalize_select_box').on('change', function () {\n let site_insert_id = $('.site_insert_selects option:selected').val();\n let site_insert_ab_test_id = $('.site_insert_ab_test_selects option:selected').val();\n let personalize_id = $(this).val();\n $.ajax({\n url: '/save_site_insert_personalize_id',\n type: 'POST',\n data: {\n site_insert_id: site_insert_id,\n site_insert_ab_test_id: site_insert_ab_test_id,\n personalize_id: personalize_id\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // 差し込み配信のプレビュー作成\n // #################################################################\n $('#site_insert_create_preview_btn')\n .off()\n .on('click', function () {\n $('.loadding').css('display', 'block');\n let site_insert_id = $('.site_insert_selects option:selected').val();\n let is_device = $('.site_insert_device_selects:checked').val();\n let site_insert_setting_id = $('.site_insert_device_selects:checked').data(\"site_insert_setting_id\");\n let site_insert_ab_test_id = $('.site_insert_ab_test_selects option:selected').val();\n let preview_url = $('#site_insert_create_preview_url').val();\n if (site_insert_id == '' || site_insert_id == null || preview_url == '') {\n $('.loadding').css('display', 'none');\n alert('必須項目を入力してください。');\n return;\n }\n\n $.ajax({\n url: '/site_insert/save_site_insert_preview',\n type: 'POST',\n data: {\n site_insert_id: site_insert_id,\n is_device: is_device,\n site_insert_setting_id: site_insert_setting_id,\n site_insert_ab_test_id: site_insert_ab_test_id,\n url: preview_url\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 差し込み配信のプレビュー編集\n // #################################################################\n $('.create_site_insert_preview_html_edit').on('click', function () {\n let preview_id = $(this).data('id');\n let preview_url = $(this).data('url');\n $.ajax({\n url: '/edit_site_insert_preview_html',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n // モーダルを作成し、HTMLコンテンツとボタンを表示\n let modalHtml = `
\n
\n
\n \n
\n
\n
閉じる
\n
保存
\n
\n
`;\n\n // モーダルをbody要素に追加\n $('body').append(modalHtml);\n $('#html_modal_text_area').text(data.html_content);\n\n $('#html_save_btn').on('click', function () {\n let html = $('#html_modal_text_area').val();\n $.ajax({\n url: '/update_site_insert_preview_html',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n html: html,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n $('#html_modal_wrapper, #html_remove_btn').on('click', function (e) {\n $('#html_modal_wrapper, #html_modal_container, #html_modal_text_area, #html_save_btn').remove();\n });\n }\n });\n });\n\n // #################################################################\n // 差し込み配信のプレビュー削除\n // #################################################################\n $('.create_site_insert_preview_url_delete').on('click', function () {\n let preview_id = $(this).data('id');\n let preview_url = $(this).data('url');\n $.ajax({\n url: '/delete_site_insert_preview',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 差し込み配信の公開設定\n // #################################################################\n $('.site_insert_show_valid_select_box').on('change', function (event) {\n let site_insert_id = $('.site_insert_selects option:selected').val();\n let site_insert_ab_test_id = $('.site_insert_ab_test_selects option:selected').val();\n let show_valid = $('.site_insert_show_valid_select_box:checked').val();\n\n $.ajax({\n url: '/save_site_insert_show_valid',\n type: 'POST',\n data: {\n site_insert_id: site_insert_id,\n site_insert_ab_test_id: site_insert_ab_test_id,\n show_valid: show_valid\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ポップアップの公開期間設定\n // #################################################################\n $('.site_insert_start_datetime, .site_insert_end_datetime').on('change', function (event) {\n let site_insert_id = $('.site_insert_selects option:selected').val();\n let site_insert_ab_test_id = $('.site_insert_ab_test_selects option:selected').val();\n let publication_start = $('.site_insert_start_datetime').val();\n let publication_end = $('.site_insert_end_datetime').val();\n\n // 開始日時があり、終了日時がない場合\n if (publication_start && !publication_end) {\n let startDate = new Date(publication_start);\n startDate.setMonth(startDate.getMonth() + 1); // 1ヶ月後に設定\n\n let year = startDate.getFullYear();\n let month = ('0' + (startDate.getMonth() + 1)).slice(-2); // 月は0始まりなので1を加える\n let day = ('0' + startDate.getDate()).slice(-2);\n let hours = ('0' + startDate.getHours()).slice(-2);\n let minutes = ('0' + startDate.getMinutes()).slice(-2);\n\n publication_end = year + '-' + month + '-' + day + 'T' + hours + ':' + minutes;\n\n $('.site_insert_end_datetime').val(publication_end);\n }\n\n // 終了日時があり、開始日時がない場合\n if (!publication_start && publication_end) {\n alert('開始日から入力して下さい。');\n $('.site_insert_end_datetime').val(\"\");\n }\n\n $.ajax({\n url: '/save_site_insert_publication_date',\n type: 'POST',\n data: {\n site_insert_id: site_insert_id,\n site_insert_ab_test_id: site_insert_ab_test_id,\n publication_start: publication_start,\n publication_end: publication_end\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 差し込み配信のABテストの新規作成\n // #################################################################\n $('#create_site_insert_ab_test_btn').on('click', function () {\n $('.loadding').css('display', 'block');\n let site_insert_id = $('.site_insert_selects option:selected').val();\n let site_insert_setting_id = $('.site_insert_device_selects:checked').data(\"site_insert_setting_id\");\n let site_insert_ab_test_id = $('.site_insert_ab_test_selects option:selected').val();\n\n $.ajax({\n url: '/create_site_insert_ab_test',\n type: 'POST',\n data: {\n site_insert_id: site_insert_id,\n site_insert_setting_id: site_insert_setting_id,\n site_insert_ab_test_id: site_insert_ab_test_id\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n } else {\n $('.loadding').css('display', 'none');\n return;\n }\n });\n });\n\n // #################################################################\n // デフォルトのABテストの設定\n // #################################################################\n $('#update_site_insert_default_ab_test_btn').on('click', function () {\n let site_insert_setting_id = $('.site_insert_device_selects:checked').data(\"site_insert_setting_id\");\n let site_insert_ab_test_id = $(\"input[name='site_insert_ab_test_radio']:checked\").val();\n\n $.ajax({\n url: '/update_site_insert_default_ab_test',\n type: 'POST',\n data: {\n site_insert_setting_id: site_insert_setting_id,\n site_insert_ab_test_id: site_insert_ab_test_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n \n // #################################################################\n // 差し込み配信のABテスト選択\n // #################################################################\n $('.site_insert_ab_test_selects').on('change', function () {\n let site_insert_id = $('.site_insert_selects option:selected').val();\n let site_insert_setting_id = $('.site_insert_device_selects:checked').data(\"site_insert_setting_id\");\n let site_insert_ab_test_id = $('.site_insert_ab_test_selects option:selected').val();\n\n location.href = `/site_insert/index?site_insert_id=${site_insert_id}&site_insert_setting_id=${site_insert_setting_id}&site_insert_ab_test_id=${site_insert_ab_test_id}`;\n });\n\n // #################################################################\n // ABテストの選択切り替え\n // #################################################################\n $('#start_site_insert_ab_test_btn, #stop_site_insert_ab_test_btn').on('click', function () {\n let site_insert_id = $('.site_insert_selects option:selected').val();\n let site_insert_setting_id = $('.site_insert_device_selects:checked').data(\"site_insert_setting_id\");\n\n $.ajax({\n url: '/update_site_insert_ab_test_mode',\n type: 'POST',\n data: {\n site_insert_id: site_insert_id,\n site_insert_setting_id: site_insert_setting_id\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 要素の挿入先の設定\n // #################################################################\n $('#site_insert_element_set').on('click', function () {\n let site_insert_id = $('.site_insert_selects option:selected').val();\n let site_insert_setting_id = $('.site_insert_device_selects:checked').data(\"site_insert_setting_id\");\n let site_insert_ab_test_id = $('.site_insert_ab_test_selects option:selected').val();\n\n let element_id_val = $('#element_id_input').val();\n let element_class_val = $('#element_class_input').val();\n let element_index_val = $('#element_index_input').val();\n let parent_id_val = $('#parent_id_input').val();\n let parent_class_val = $('#parent_class_input').val();\n let parent_index_val = $('#parent_index_input').val();\n let grand_id_val = $('#grand_id_input').val();\n let grand_class_val = $('#grand_class_input').val();\n let grand_index_val = $('#grand_index_input').val();\n let great_grand_id_val = $('#great_grand_id_input').val();\n let great_grand_class_val = $('#great_grand_class_input').val();\n let site_insert_element_placement = $('.site_insert_list .site_insert_placement option:selected').val();\n\n $.ajax({\n url: '/create_site_insert_element',\n type: 'POST',\n data: {\n site_insert_id: site_insert_id,\n site_insert_setting_id: site_insert_setting_id,\n site_insert_ab_test_id: site_insert_ab_test_id,\n element_id: element_id_val,\n element_class: element_class_val,\n element_index: element_index_val,\n parent_id: parent_id_val,\n parent_class: parent_class_val,\n parent_index: parent_index_val,\n grand_id: grand_id_val,\n grand_class: grand_class_val,\n grand_index: grand_index_val,\n great_grand_id: great_grand_id_val,\n great_grand_class: great_grand_class_val,\n element_placement: site_insert_element_placement,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 差し込み配信施策削除\n // #################################################################\n $('#site_insert_delete_btn').on('click', function () {\n let site_insert_id = $('.site_insert_selects option:selected').val();\n\n if (!confirm('完全に削除され復元することはできません。本当に削除しますか?')) {\n return;\n }\n\n $.ajax({\n url: '/site_insert/delete_site_insert',\n type: 'POST',\n data: {\n site_insert_id: site_insert_id,\n },\n dataType: 'json',\n }).done(function (data) {\n alert('差し込み配信施策を削除しました。');\n location.href = `/site_insert/index`;\n });\n });\n});\n","document.addEventListener('turbolinks:load', function () {\n $('.block_exit_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.block_exit_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.block_exit_slidedown_btn').fadeIn(0));\n });\n\n $('.block_exit_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.block_exit_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.block_exit_slideup_btn').fadeIn(0));\n });\n // ------------------------------------------------------------------------------------------------\n // 離脱防止分析\n // ------------------------------------------------------------------------------------------------\n function block_exit_update_url() {\n const block_exit_id = $('#block_exit_select_box option:selected').val();\n const gf = $('#block_exit_graph_pattern_select_input').val();\n // const ab = $('#block_exit_ab_test_select_box option:selected').val();\n const device = $('.block_exit_device_select').data(\"device\");\n const start_day = $('#block_exit_report_start_day').val();\n const end_day = $('#block_exit_report_end_day').val();\n\n let url = new URL(window.location.href);\n let params = url.searchParams;\n\n if (block_exit_id !== 'none' && block_exit_id !== null && block_exit_id !== undefined) {\n params.set('block_exit_id', block_exit_id);\n } else {\n params.delete('block_exit_id');\n }\n\n // if (ab !== 'none' && ab !== null && ab !== undefined) {\n // params.set('ab', ab);\n // } else {\n // params.delete('ab');\n // }\n\n if (gf) {\n params.set('gf', gf);\n } else {\n params.delete('gf');\n }\n\n if (device == \"0\" || device == \"1\") {\n params.set('device', device);\n } else {\n params.delete('device');\n }\n\n if (gf === '12') {\n params.delete('start_day');\n params.delete('end_day');\n } else { // このelseブロックを追加\n if (start_day) {\n params.set('start_day', start_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n\n if (end_day) {\n params.set('end_day', end_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n }\n\n url.search = params.toString();\n location.href = url.toString();\n }\n\n // #################################################################\n // 離脱防止の選択\n // #################################################################\n $('#block_exit_select_box').on('change', function () {\n block_exit_update_url();\n });\n\n // #################################################################\n // ABテストの選択\n // #################################################################\n // $('#block_exit_ab_test_select_box').on('change', function () {\n // block_exit_update_url();\n // });\n\n // #################################################################\n // 日毎、月毎のグラフ切り替え\n // #################################################################\n $('.block_exit_graph_pattern_select_day, .block_exit_graph_pattern_select_month').on('click', function () {\n const gf_value = $(this).data('gf');\n $('#block_exit_graph_pattern_select_input').val(gf_value);\n block_exit_update_url();\n });\n\n // #################################################################\n // デバイスごとのグラフ切り替え\n // #################################################################\n $('.block_exit_device_select_all, .block_exit_device_select_pc, .block_exit_device_select_phone').on('click', function () {\n const device = $(this).data('device');\n $('.block_exit_device_select').data(\"device\", device);\n block_exit_update_url();\n });\n\n // #################################################################\n // 範囲選択によるグラフ切り替え\n // #################################################################\n $('#block_exit_report_start_day, #block_exit_report_end_day').on('change', function () {\n block_exit_update_url();\n });\n\n // #################################################################\n // 表の年月切り替え\n // #################################################################\n $('#ua_block_exit_month_selects').on('change', function () {\n let block_exit_id = $('#block_exit_select_box option:selected').val();\n let month = $('#ua_block_exit_month_selects option:selected').val();\n let url = new URL(window.location.href);\n\n if (month != '') {\n if (url.searchParams.has('m')) {\n // 値が \"0\"か\"1\" なら \"2\" に更新する\n let new_value = month;\n // パラメーターの値を更新する\n url.searchParams.set('m', new_value);\n } else {\n // パラメーターにdeviceがない場合\n // 新しいパラメーターを追加する\n url.searchParams.append('m', month);\n }\n\n // 更新されたURLにリダイレクトする\n location.href = url.toString();\n } else {\n // monthが空文字の時は指定したURLにリダイレクトする\n // location.href = 'ugc_analysis';\n }\n });\n\n // #################################################################\n // 離脱防止のログデータのみの削除\n // #################################################################\n $('.delete_block_exit_log_data').on('click', function () {\n if (!confirm('本当に削除を実行しますか?')) {\n return;\n }\n const block_exit_id = $('#block_exit_select_box option:selected').val();\n\n $.ajax({\n url: '/block_exit_report/delete_block_exit_log',\n type: 'POST',\n data: {\n block_exit_id: block_exit_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 離脱防止のログデータと関連するデータ全ての削除\n // #################################################################\n $('.delete_block_exit_log_data_and_related_data').on('click', function () {\n if (!confirm('本当に完全削除を実行しますか?')) {\n return;\n }\n const block_exit_id = $('#block_exit_select_box option:selected').val();\n\n $.ajax({\n url: '/block_exit_report/delete_block_exit_log_and_related_data',\n type: 'POST',\n data: {\n block_exit_id: block_exit_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('削除が完了しました。');\n location.href = '/index';\n }\n });\n });\n\n // #################################################################\n // 離脱防止のレポートのcsv出力\n // #################################################################\n $('#download_block_exit_csv').on('click', function () {\n const block_exit_id = $('#block_exit_select_box option:selected').val();\n const month = $('#ua_block_exit_month_selects option:selected').val();\n const device = $('.block_exit_device_select').data('device');\n\n let href = '/download_block_exit_csv';\n\n href += `?block_exit_id=${block_exit_id}`;\n href += `&m=${month}`;\n href += `&device=${device}`;\n location.href = href;\n });\n\n // ------------------------------------------------------------------------------------------------\n // 離脱防止管理\n // ------------------------------------------------------------------------------------------------\n // #################################################################\n // 離脱防止管理の新規作成\n // #################################################################\n $('#block_exit_create').on('click', function () {\n const name = $('.block_exit_input').val();\n\n if (!name) {\n alert('名称を入力して下さい。');\n return;\n }\n\n $.ajax({\n url: '/create_block_exit',\n type: 'POST',\n data: {\n name: name,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.href = `/block_exit/index?block_exit_id=${data.block_exit_id}&block_exit_setting_id=${data.block_exit_setting_id}&device=${data.is_device}`;\n }\n });\n });\n\n // #################################################################\n // 離脱防止名の編集\n // #################################################################\n $('#block_exit_name_edit_btn').on('click', function () {\n let block_exit_id = $('.block_exit_selects option:selected').val();\n let name = $('.block_exit_name_val').val();\n\n if (!name) {\n alert('名称を記入して下さい。');\n return;\n }\n\n $.ajax({\n url: '/save_block_exit_name',\n type: 'POST',\n data: {\n block_exit_id: block_exit_id,\n name: name\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 離脱防止管理の切り替え\n // #################################################################\n $('.block_exit_selects').on('change', function () {\n let block_exit_id = $('.block_exit_selects option:selected').val();\n if (block_exit_id == 'new') {\n $('.block_exit_set_wrapper_display').css('display', 'block');\n $('.block_exit_device_setting_wrapper').css('display', 'none');\n $('.block_exit_show_valid_setting_wrapper').css('display', 'none');\n $('.block_exit_url_setting_wrapper').css('display', 'none');\n $('.block_exit_preview_setting_wrapper').css('display', 'none');\n $('.block_exit_preview_url_list_wrapper').css('display', 'none');\n $('.block_exit_preview_position_setting_wrapper').css('display', 'none');\n $('.block_exit_contents_setting_wrapper').css('display', 'none');\n $('.block_exit_name_setting_wrapper').css('display', 'none');\n $('.block_exit_excluded_url_setting_wrapper').css('display', 'none');\n $('.block_exit_delete_setting_wrapper').css('display', 'none');\n $('.block_exit_out_domain_setting_wrapper').css('display', 'none');\n } else {\n location.href = `/block_exit/index?block_exit_id=${block_exit_id}`;\n }\n });\n\n // #################################################################\n // ポップアップのデバイスの切り替え\n // #################################################################\n $('.block_exit_device_selects').on('change', function () {\n let block_exit_id = $('.block_exit_selects option:selected').val();\n let block_exit_setting_id = $('.block_exit_device_selects:checked').data(\"block_exit_setting_id\");\n\n location.href = `/block_exit/index?block_exit_id=${block_exit_id}&block_exit_setting_id=${block_exit_setting_id}`;\n });\n\n // #################################################################\n // 離脱防止の表示URL設定\n // #################################################################\n $('#block_exit_url_add_input').on('click', function () {\n $(this)\n .parents('table')\n .append(\n `\n \n \n \n \n \n
\n \n \n \n
\n \n `\n );\n $('.block_exit_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n $('.block_exit_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n\n $('#block_exit_url_set').on('click', function () {\n let block_exit_id = $('.block_exit_selects option:selected').val();\n let urls = [];\n $('.block_exit_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/set_block_exit_url',\n type: 'POST',\n data: {\n block_exit_id: block_exit_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // 離脱防止の除外URL設定\n // #################################################################\n $('#block_exit_excluded_url_add_input').on('click', function () {\n $(this)\n .parents('table')\n .append(\n `\n \n \n \n \n \n
\n \n \n \n
\n \n `\n );\n $('.block_exit_excluded_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n $('.block_exit_excluded_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n\n $('#block_exit_excluded_url_set').on('click', function () {\n let block_exit_id = $('.block_exit_selects option:selected').val();\n let urls = [];\n $('.block_exit_excluded_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/set_block_exit_excluded_url',\n type: 'POST',\n data: {\n block_exit_id: block_exit_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // 離脱防止とコンテンツの連携\n // #################################################################\n $('.block_exit_contents_select_box').on('change', function () {\n let block_exit_id = $('.block_exit_selects option:selected').val();\n let block_exit_setting_id = $('.block_exit_device_selects:checked').data(\"block_exit_setting_id\");\n let content_id = $(this).val();\n $.ajax({\n url: '/save_block_exit_content_id',\n type: 'POST',\n data: {\n block_exit_id: block_exit_id,\n block_exit_setting_id: block_exit_setting_id,\n content_id: content_id\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // 離脱防止のプレビュー作成\n // #################################################################\n $('#block_exit_create_preview_btn')\n .off()\n .on('click', function () {\n $('.loadding').css('display', 'block');\n let block_exit_id = $('.block_exit_selects option:selected').val();\n let is_device = $('.block_exit_device_selects:checked').val();\n let block_exit_setting_id = $('.block_exit_device_selects:checked').data(\"block_exit_setting_id\");\n let preview_url = $('#block_exit_create_preview_url').val();\n if (block_exit_id == '' || block_exit_id == null || preview_url == '') {\n $('.loadding').css('display', 'none');\n alert('必須項目を入力してください。');\n return;\n }\n\n $.ajax({\n url: '/block_exit/save_block_exit_preview',\n type: 'POST',\n data: {\n block_exit_id: block_exit_id,\n is_device: is_device,\n block_exit_setting_id: block_exit_setting_id,\n url: preview_url\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 離脱防止のプレビュー編集\n // #################################################################\n $('.create_block_exit_preview_html_edit').on('click', function () {\n let preview_id = $(this).data('id');\n let preview_url = $(this).data('url');\n $.ajax({\n url: '/edit_block_exit_preview_html',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n // モーダルを作成し、HTMLコンテンツとボタンを表示\n let modalHtml = `
\n
\n
\n \n
\n
\n
閉じる
\n
保存
\n
\n
`;\n\n // モーダルをbody要素に追加\n $('body').append(modalHtml);\n $('#html_modal_text_area').text(data.html_content);\n\n $('#html_save_btn').on('click', function () {\n let html = $('#html_modal_text_area').val();\n $.ajax({\n url: '/update_block_exit_preview_html',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n html: html,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n $('#html_modal_wrapper, #html_remove_btn').on('click', function (e) {\n $('#html_modal_wrapper, #html_modal_container, #html_modal_text_area, #html_save_btn').remove();\n });\n }\n });\n });\n\n // #################################################################\n // 離脱防止のプレビュー削除\n // #################################################################\n $('.create_block_exit_preview_url_delete').on('click', function () {\n let preview_id = $(this).data('id');\n let preview_url = $(this).data('url');\n $.ajax({\n url: '/delete_block_exit_preview',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 離脱防止の公開設定\n // #################################################################\n $('.block_exit_show_valid_select_box').on('change', function (event) {\n let block_exit_id = $('.block_exit_selects option:selected').val();\n let block_exit_setting_id = $('.block_exit_device_selects:checked').data(\"block_exit_setting_id\");\n let show_valid = $('.block_exit_show_valid_select_box:checked').val();\n $.ajax({\n url: '/save_block_exit_show_valid',\n type: 'POST',\n data: {\n block_exit_id: block_exit_id,\n block_exit_setting_id: block_exit_setting_id,\n show_valid: show_valid\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 離脱防止のサイト外に飛ぶ時の設定\n // #################################################################\n $('.block_exit_out_domain_flag').on('change', function () {\n let block_exit_id = $('.block_exit_selects option:selected').val();\n let block_exit_setting_id = $('.block_exit_device_selects:checked').data(\"block_exit_setting_id\");\n let out_domain_flag = 0;\n if ($('.block_exit_out_domain_flag').is(':checked')) {\n out_domain_flag = 1;\n }\n\n $.ajax({\n url: '/save_block_exit_out_domain_flag',\n type: 'POST',\n data: {\n block_exit_id: block_exit_id,\n block_exit_setting_id: block_exit_setting_id,\n out_domain_flag: out_domain_flag\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 離脱防止施策削除\n // #################################################################\n $('#block_exit_delete_btn').on('click', function () {\n let block_exit_id = $('.block_exit_selects option:selected').val();\n\n if (!confirm('完全に削除され復元することはできません。本当に削除しますか?')) {\n return;\n }\n\n $.ajax({\n url: '/block_exit/delete_block_exit',\n type: 'POST',\n data: {\n block_exit_id: block_exit_id,\n },\n dataType: 'json',\n }).done(function (data) {\n alert('離脱防止施策を削除しました。');\n location.href = `/block_exit/index`;\n });\n });\n});\n","document.addEventListener('turbolinks:load', function () {\n // ¥ 開発環境での開発スピードを上げるため青木の開発環境でのみ\n // ¥ manage/app/javascript/packs内の本jsファイルを走らせない\n if ((location.href.includes('dev-manage-ssl.platta.jp') || location.href.includes('http://18.177.103.115:3004')) && !location.href.includes('?dev27aoki')) {\n console.log('dev環境 public.jsを使用');\n return;\n }\n\n const ERROR_MSG = 'エラー! 処理を完了できませんでした\\n時間おいて再度実行しても、このエラーが修正されない場合は\\nお手数ですがサポートチームにお問い合わせください';\n const MAIL_PATTERN = /^[a-zA-Z0-9_+-]+(.[a-zA-Z0-9_+-]+)*@([a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]*\\.)+[a-zA-Z]{2,}$/;\n const PASSWORD_PATTERN = /([0-9].*[a-zA-Z]|[a-zA-Z].*[0-9])/;\n\n const DOMAIN = $('#pl_domain').val();\n\n let current_url = location.href;\n\n //############################################################\n // 入力情報欄のtoggle\n //############################################################\n $('.push_slideup_btn, .parent_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.push_slide_flag, .parent_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.push_slidedown_btn, .parent_slidedown_btn').fadeIn(0));\n });\n\n $('.push_slidedown_btn, .parent_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.push_slide_flag, .parent_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.push_slideup_btn, .parent_slideup_btn').fadeIn(0));\n });\n\n // プッシュ通知分析\n function push_notification_update_url() {\n const push_topic_id = $('#push_topic_select_box option:selected').val();\n const gf = $('#push_topic_graph_pattern_select_input').val();\n // const ab = $('#block_exit_ab_test_select_box option:selected').val();\n const device = $('.push_notification_device_select').data('device');\n const start_day = $('#push_topic_report_start_day').val();\n const end_day = $('#push_topic_report_end_day').val();\n\n let url = new URL(window.location.href);\n let params = url.searchParams;\n\n if (push_topic_id !== 'none' && push_topic_id !== null && push_topic_id !== undefined) {\n params.set('push_topic_id', push_topic_id);\n } else {\n params.delete('push_topic_id');\n }\n\n if (gf) {\n params.set('gf', gf);\n } else {\n params.delete('gf');\n }\n\n if (device == '0' || device == '1') {\n params.set('device', device);\n } else {\n params.delete('device');\n }\n\n if (gf === '12') {\n params.delete('start_day');\n params.delete('end_day');\n } else {\n // このelseブロックを追加\n if (start_day) {\n params.set('start_day', start_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n\n if (end_day) {\n params.set('end_day', end_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n }\n\n url.search = params.toString();\n location.href = url.toString();\n }\n\n // #################################################################\n // プッシュ通知の選択\n // #################################################################\n $('#push_topic_select_box').on('change', function () {\n push_notification_update_url();\n });\n\n // #################################################################\n // 日毎、月毎のグラフ切り替え\n // #################################################################\n $('.push_topic_graph_pattern_select_day, .push_topic_graph_pattern_select_month').on('click', function () {\n const gf_value = $(this).data('gf');\n $('#push_topic_graph_pattern_select_input').val(gf_value);\n push_notification_update_url();\n });\n\n // #################################################################\n // デバイスごとのグラフ切り替え\n // #################################################################\n $('.push_notification_device_select_all, .push_notification_device_select_pc, .push_notification_device_select_phone').on('click', function () {\n const device = $(this).data('device');\n $('.push_notification_device_select').data('device', device);\n push_notification_update_url();\n });\n\n // #################################################################\n // 範囲選択によるグラフ切り替え\n // #################################################################\n $('#push_topic_report_start_day, #push_topic_report_end_day').on('change', function () {\n push_notification_update_url();\n });\n\n // #################################################################\n // 表の年月切り替え\n // #################################################################\n $('#ua_push_topic_month_selects').on('change', function () {\n let push_topic_id = $('#push_topic_select_box option:selected').val();\n let month = $('#ua_push_topic_month_selects option:selected').val();\n let url = new URL(window.location.href);\n\n if (month != '') {\n if (url.searchParams.has('m')) {\n // 値が \"0\"か\"1\" なら \"2\" に更新する\n let new_value = month;\n // パラメーターの値を更新する\n url.searchParams.set('m', new_value);\n } else {\n // パラメーターにdeviceがない場合\n // 新しいパラメーターを追加する\n url.searchParams.append('m', month);\n }\n\n // 更新されたURLにリダイレクトする\n location.href = url.toString();\n } else {\n // monthが空文字の時は指定したURLにリダイレクトする\n // location.href = 'ugc_analysis';\n }\n });\n\n // #################################################################\n // プッシュ通知のログデータのみの削除\n // #################################################################\n $('.delete_push_notification_log_data').on('click', function () {\n if (!confirm('本当に削除を実行しますか?')) {\n return;\n }\n const push_topic_id = $('#push_topic_select_box option:selected').val();\n\n $.ajax({\n url: '/push_notification_report/delete_push_notification_log',\n type: 'POST',\n data: {\n push_topic_id: push_topic_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 離脱防止のログデータと関連するデータ全ての削除\n // #################################################################\n $('.delete_push_notification_log_data_and_related_data').on('click', function () {\n if (!confirm('本当に完全削除を実行しますか?')) {\n return;\n }\n const push_topic_id = $('#push_topic_select_box option:selected').val();\n\n $.ajax({\n url: '/push_notification_report/delete_push_notification_log_data_and_related_data',\n type: 'POST',\n data: {\n push_topic_id: push_topic_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('削除が完了しました。');\n location.href = '/push_notification_report/index';\n }\n });\n });\n\n // #################################################################\n // プッシュ通知のレポートのcsv出力\n // #################################################################\n $('#download_push_notification_csv').on('click', function () {\n const push_topic_id = $('#push_topic_select_box option:selected').val();\n const month = $('#ua_push_topic_month_selects option:selected').val();\n const device = $('.push_notification_device_select').data('device');\n\n let href = '/push_notification_report/download_push_notification_csv';\n\n href += `?push_topic_id=${push_topic_id}`;\n href += `&m=${month}`;\n href += `&device=${device}`;\n\n location.href = href;\n });\n\n // ###############################################################\n // 現在時刻を取得 - フォーマット: 20231107_11_02_04_40_07\n // プッシュ通知で複数に同時送信可能にするためのtopic名を一意にするためのtopic名の一部にするために使用する\n // ###############################################################\n function getCurrentFormattedTime() {\n const now = new Date();\n\n const year = now.getFullYear();\n const month = String(now.getMonth() + 1).padStart(2, '0'); // getMonth() is zero-indexed\n const day = String(now.getDate()).padStart(2, '0');\n const hours = String(now.getHours()).padStart(2, '0');\n const minutes = String(now.getMinutes()).padStart(2, '0');\n const seconds = String(now.getSeconds()).padStart(2, '0');\n\n // Concatenate the date and time in the desired format\n return `${year}${month}${day}_${hours}_${minutes}_${seconds}`;\n }\n\n // #################################################################\n // プッシュ通知の切り替え\n // #################################################################\n $('.push_selects').on('change', function () {\n let push_topic_id = $('.push_selects option:selected').val();\n if (push_topic_id == 'new') {\n $('.push_set_wrapper_display').css('display', 'block');\n $('.push_name_setting_wrapper').css('display', 'none');\n $('.push_device_setting_wrapper').css('display', 'none');\n $('.push_show_valid_setting_wrapper').css('display', 'none');\n $('.push_url_setting_wrapper').css('display', 'none');\n $('.push_preview_setting_wrapper').css('display', 'none');\n $('.push_preview_url_list_wrapper').css('display', 'none');\n $('.push_preview_position_setting_wrapper').css('display', 'none');\n $('.push_modal_setting_wrapper').css('display', 'none');\n $('.push_jump_url_setting_wrapper').css('display', 'none');\n $('.push_img_url_setting_wrapper').css('display', 'none');\n $('.push_modal_img_url_setting_wrapper').css('display', 'none');\n $('.push_icon_upload_wrapper').css('display', 'none');\n $('.push_modal_icon_upload_wrapper').css('display', 'none');\n $('.push_notification_title_setting_wrapper').css('display', 'none');\n $('.push_notification_message_setting_wrapper').css('display', 'none');\n $('.push_notification_send_wrapper_display').css('display', 'none');\n $('.edit-only').css('display', 'none');\n } else {\n location.href = `/push_notification/index?push_topic_id=${push_topic_id}`;\n }\n });\n\n // #################################################################\n // プッシュ通知のデバイスの切り替え\n // #################################################################\n $('.push_device_selects').on('change', function () {\n let push_topic_id = $('.push_device_selects:checked').data('push_topic_id');\n let is_device = $('.push_device_selects:checked').data('device');\n location.href = `/push_notification/index?push_topic_id=${push_topic_id}&is_device=${is_device}`;\n });\n\n // #################################################################\n // プッシュ通知管理の新規作成\n // #################################################################\n $('#push_create').on('click', function () {\n const push_name = $('.push_input').val();\n const ac_id = $('#push_ac_id').val();\n\n let current_time = getCurrentFormattedTime();\n\n let complete_topic = `${ac_id}_${current_time}`;\n\n if (!push_name) {\n alert('プッシュ通知名を入力して下さい。');\n return;\n }\n\n $.ajax({\n url: '/push_notification/create_push_notification',\n type: 'POST',\n data: {\n push_name: push_name,\n topic: complete_topic,\n },\n dataType: 'json',\n })\n .done(function (data) {\n if (data.ret == '0') {\n alert('新規登録されました。');\n location.href = `/push_notification/index?push_topic_id=${data.push_topic_id}&device=${data.is_device}`;\n }\n })\n .fail(function (jqXHR, textStatus, errorThrown) {\n console.log('jqXHR: ', jqXHR);\n alert('予期せぬ理由で登録に失敗しました。再度お試しください。');\n location.reload();\n });\n });\n\n // #################################################################\n // プッシュ通知名の編集\n // #################################################################\n $('#push_name_edit_btn').on('click', function () {\n let push_topic_id = $('.push_selects option:selected').val();\n let push_name = $('.push_name_val').val();\n\n if (!push_name) {\n alert('名称を記入して下さい。');\n return;\n }\n\n $.ajax({\n url: '/push_notification/save_push_name',\n type: 'POST',\n data: {\n push_topic_id: push_topic_id,\n push_name: push_name,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // プッシュ通知の表示URL設定\n // #################################################################\n $('#push_url_add_input').on('click', function () {\n $(this)\n .parents('table')\n .append(\n `\n \n \n \n \n \n
\n \n \n \n
\n \n `\n );\n $('.push_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n $('.push_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n\n $('#push_url_set').on('click', function () {\n let push_topic_id = $('.push_selects option:selected').val();\n let urls = [];\n $('.push_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/push_notification/set_push_url',\n type: 'POST',\n data: {\n push_topic_id: push_topic_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // プッシュ通知のプレビュー作成\n // #################################################################\n $('#push_create_preview_btn')\n .off()\n .on('click', function () {\n $('.loadding').css('display', 'block');\n let push_topic_id = $('.push_selects option:selected').val();\n let is_device = $('.push_device_selects:checked').data('device');\n let topic_name = $('#push_topic_name').val();\n let preview_url = $('#push_create_preview_url').val();\n let preview_html_name = $('#push_create_preview_html_name').val();\n if (push_topic_id == '' || push_topic_id == null || preview_url == '' || preview_html_name == '') {\n $('.loadding').css('display', 'none');\n alert('必須項目を入力してください。');\n return;\n }\n\n $.ajax({\n url: '/push_notification/save_push_preview',\n type: 'POST',\n data: {\n push_topic_id: push_topic_id,\n is_device: is_device,\n topic_name: topic_name,\n url: preview_url,\n file_name: preview_html_name,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // プッシュ通知のプレビュー編集\n // #################################################################\n $('.create_push_preview_html_edit').on('click', function () {\n let preview_id = $(this).data('id');\n let preview_url = $(this).data('url');\n $.ajax({\n url: '/push_notification/edit_push_preview_html',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n // モーダルを作成し、HTMLコンテンツとボタンを表示\n let modalHtml = `
\n
\n
\n \n
\n
\n
閉じる
\n
保存
\n
\n
`;\n\n // モーダルをbody要素に追加\n $('body').append(modalHtml);\n $('#html_modal_text_area').text(data.html_content);\n\n $('#html_save_btn').on('click', function () {\n let html = $('#html_modal_text_area').val();\n $.ajax({\n url: '/push_notification/update_push_preview_html',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n html: html,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n $('#html_modal_wrapper, #html_remove_btn').on('click', function (e) {\n $('#html_modal_wrapper, #html_modal_container, #html_modal_text_area, #html_save_btn').remove();\n });\n }\n });\n });\n\n // #################################################################\n // プッシュ通知のプレビュー削除\n // #################################################################\n $('.create_push_preview_url_delete').on('click', function () {\n let preview_id = $(this).data('id');\n let preview_url = $(this).data('url');\n $.ajax({\n url: '/push_notification/delete_push_preview',\n type: 'POST',\n data: {\n id: preview_id,\n url: preview_url,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n //############################################################\n // 通知許可モーダルのデザイン更新 js利用\n //############################################################\n $('#push_modal_custom_set').on('click', function () {\n let is_device = $('#is_device').val();\n let modal_transition_second = $('#modal_transition_second').val();\n let modal_whole_margin = $('#modal_whole_margin').val();\n let modal_whole_padding = $('#modal_whole_padding').val();\n let modal_whole_width = $('#modal_whole_width').val();\n let modal_whole_height = $('#modal_whole_height').val();\n let modal_whole_border = $('#modal_whole_border').val();\n let modal_whole_radius = $('#modal_whole_radius').val();\n let paragraph_text = $('#paragraph_text').val();\n let paragraph_text_color = $('#paragraph_text_color').val();\n let modal_whole_background_color = $('#modal_whole_background_color').val();\n\n let modal_container_margin = $('#modal_container_margin').val();\n let modal_container_padding = $('#modal_container_padding').val();\n\n let is_reverse_icon_position = $('#is_reverse_icon_position').val();\n\n let modal_icon_object_fit = $('#modal_icon_object_fit').val();\n let modal_icon_width = $('#modal_icon_width').val();\n let modal_icon_height = $('#modal_icon_height').val();\n let modal_icon_margin = $('#modal_icon_margin').val();\n let modal_icon_padding = $('#modal_icon_padding').val();\n\n let paragraph_text_size = $('#paragraph_text_size').val();\n let paragraph_font_family = $('#paragraph_font_family').val();\n let paragraph_font_weight = $('#paragraph_font_weight').val();\n let paragraph_margin = $('#paragraph_margin').val();\n let paragraph_padding = $('#paragraph_padding').val();\n let paragraph_line_height = $('#paragraph_line_height').val();\n let is_reverse_buttons_position = $('#is_reverse_buttons_position').val();\n let buttons_justify_content = $('#buttons_justify_content').val();\n let is_permission_button = $('#is_permission_button').val();\n let permission_button_text = $('#permission_button_text').val();\n let permission_button_margin = $('#permission_button_margin').val();\n let permission_button_padding = $('#permission_button_padding').val();\n let permission_button_background_color = $('#permission_button_background_color').val();\n let permission_button_text_size = $('#permission_button_text_size').val();\n let permission_button_text_color = $('#permission_button_text_color').val();\n let permission_button_font_family = $('#permission_button_font_family').val();\n let permission_button_font_weight = $('#permission_button_font_weight').val();\n let permission_button_text_style = $('#permission_button_text_style').val();\n let permission_button_border = $('#permission_button_border').val();\n let permission_button_border_radius = $('#permission_button_border_radius').val();\n let is_cancel_button = $('#is_cancel_button').val();\n let cancel_button_text = $('#cancel_button_text').val();\n let cancel_button_margin = $('#cancel_button_margin').val();\n let cancel_button_padding = $('#cancel_button_padding').val();\n let cancel_button_background_color = $('#cancel_button_background_color').val();\n let cancel_button_text_size = $('#cancel_button_text_size').val();\n let cancel_button_text_color = $('#cancel_button_text_color').val();\n let cancel_button_font_family = $('#cancel_button_font_family').val();\n let cancel_button_font_weight = $('#cancel_button_font_weight').val();\n let cancel_button_font_text_style = $('#cancel_button_font_text_style').val();\n let cancel_button_border = $('#cancel_button_border').val();\n let cancel_button_border_radius = $('#cancel_button_border_radius').val();\n let is_modal_close_mark = $('#is_modal_close_mark').val();\n let modal_close_mark_top = $('#modal_close_mark_top').val();\n let modal_close_mark_right = $('#modal_close_mark_right').val();\n let modal_close_mark_margin = $('#modal_close_mark_margin').val();\n let modal_close_mark_padding = $('#modal_close_mark_padding').val();\n let modal_close_mark_background_color = $('#modal_close_mark_background_color').val();\n let modal_close_mark_text_size = $('#modal_close_mark_text_size').val();\n let modal_close_mark_text_color = $('#modal_close_mark_text_color').val();\n let modal_close_mark_font_family = $('#modal_close_mark_font_family').val();\n let modal_close_mark_font_weight = $('#modal_close_mark_font_weight').val();\n\n let modal_display_position = $('#modal_display_position').val();\n let modal_top_offset = $('#modal_top_offset').val();\n let modal_bottom_offset = $('#modal_bottom_offset').val();\n let modal_left_offset = $('#modal_left_offset').val();\n let modal_right_offset = $('#modal_right_offset').val();\n let is_background = $('#is_background').val();\n let background_color = $('#background_color').val();\n let background_opacity = $('#background_opacity').val();\n\n $.ajax({\n url: '/push_notification/update_modal_style',\n type: 'POST',\n data: {\n push_topic_id: $('#push_topic_id').val(),\n is_device: is_device,\n modal_transition_second: modal_transition_second,\n modal_whole_margin: modal_whole_margin,\n modal_whole_padding: modal_whole_padding,\n modal_whole_width: modal_whole_width,\n modal_whole_height: modal_whole_height,\n modal_whole_border: modal_whole_border,\n modal_whole_radius: modal_whole_radius,\n paragraph_text: paragraph_text,\n paragraph_text_color: paragraph_text_color,\n modal_whole_background_color: modal_whole_background_color,\n\n modal_container_margin: modal_container_margin,\n modal_container_padding: modal_container_padding,\n\n is_reverse_icon_position: is_reverse_icon_position,\n modal_icon_object_fit: modal_icon_object_fit,\n modal_icon_width: modal_icon_width,\n modal_icon_height: modal_icon_height,\n modal_icon_margin: modal_icon_margin,\n modal_icon_padding: modal_icon_padding,\n\n paragraph_text_size: paragraph_text_size,\n paragraph_font_family: paragraph_font_family,\n paragraph_font_weight: paragraph_font_weight,\n paragraph_margin: paragraph_margin,\n paragraph_padding: paragraph_padding,\n paragraph_line_height: paragraph_line_height,\n is_reverse_buttons_position: is_reverse_buttons_position,\n buttons_justify_content: buttons_justify_content,\n is_permission_button: is_permission_button,\n permission_button_text: permission_button_text,\n permission_button_margin: permission_button_margin,\n permission_button_padding: permission_button_padding,\n permission_button_background_color: permission_button_background_color,\n permission_button_text_size: permission_button_text_size,\n permission_button_text_color: permission_button_text_color,\n permission_button_font_family: permission_button_font_family,\n permission_button_font_weight: permission_button_font_weight,\n permission_button_text_style: permission_button_text_style,\n permission_button_border: permission_button_border,\n permission_button_border_radius: permission_button_border_radius,\n cancel_button_text: cancel_button_text,\n is_cancel_button: is_cancel_button,\n cancel_button_margin: cancel_button_margin,\n cancel_button_padding: cancel_button_padding,\n cancel_button_background_color: cancel_button_background_color,\n cancel_button_text_size: cancel_button_text_size,\n cancel_button_text_color: cancel_button_text_color,\n cancel_button_font_family: cancel_button_font_family,\n cancel_button_font_weight: cancel_button_font_weight,\n cancel_button_font_text_style: cancel_button_font_text_style,\n cancel_button_border: cancel_button_border,\n cancel_button_border_radius: cancel_button_border_radius,\n is_modal_close_mark: is_modal_close_mark,\n modal_close_mark_top: modal_close_mark_top,\n modal_close_mark_right: modal_close_mark_right,\n modal_close_mark_margin: modal_close_mark_margin,\n modal_close_mark_padding: modal_close_mark_padding,\n modal_close_mark_background_color: modal_close_mark_background_color,\n modal_close_mark_text_size: modal_close_mark_text_size,\n modal_close_mark_text_color: modal_close_mark_text_color,\n modal_close_mark_font_family: modal_close_mark_font_family,\n modal_close_mark_font_weight: modal_close_mark_font_weight,\n\n modal_display_position: modal_display_position,\n modal_top_offset: modal_top_offset,\n modal_bottom_offset: modal_bottom_offset,\n modal_left_offset: modal_left_offset,\n modal_right_offset: modal_right_offset,\n is_background: is_background,\n background_color: background_color,\n background_opacity: background_opacity,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('モーダルデザインを登録しました。');\n location.reload();\n }\n });\n });\n\n // #################################################################\n // プッシュ通知の公開設定\n // #################################################################\n $('.push_show_valid_select_box').on('change', function (event) {\n let push_topic_id = $('.push_show_valid_select_box:checked').data('push_topic_id');\n let is_device = $('.push_show_valid_select_box:checked').data('device');\n let show_valid = $('.push_show_valid_select_box:checked').val();\n\n $.ajax({\n url: '/push_notification/save_push_show_valid',\n type: 'POST',\n data: {\n // push_topic_id: push_topic_id,\n // push_ab_test_id: push_ab_test_id,\n push_topic_id: push_topic_id,\n is_device: is_device,\n show_valid: show_valid,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n\n // #################################################################\n // プッシュ通知モーダルの表示位置設定\n // #################################################################\n $('.push_modal_display_position_btn').on('click', function () {\n let push_topic_id = $('#push_topic_id').val();\n let modal_display_position = $(this).data('cdp');\n let is_device = $('.push_device_selects:checked').data('device');\n\n $.ajax({\n url: '/push_notification/save_push_modal_display_position',\n type: 'POST',\n data: {\n push_topic_id: push_topic_id,\n modal_display_position: modal_display_position,\n is_device: is_device,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // プッシュ通知モーダルの表示位置調整設定\n // #################################################################\n $('#modal_top_offset, #modal_bottom_offset, #modal_left_offset, #modal_right_offset').on('keypress blur', function (event) {\n // エンターキーが押されたかどうかをチェックし、エンターキーが押された場合にのみ処理を進めます\n if (event.type === 'keypress' && event.which !== 13) {\n return;\n }\n let push_topic_id = $('#push_topic_id').val();\n let push_position = $(this).data('position');\n let push_offset = $(this).val();\n let is_device = $('.push_device_selects:checked').data('device');\n\n if (!push_offset) {\n alert('入力して下さい。');\n return;\n }\n $.ajax({\n url: '/push_notification/save_push_modal_offset',\n type: 'POST',\n data: {\n push_topic_id: push_topic_id,\n push_position: push_position,\n push_offset: push_offset,\n is_device: is_device\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // プッシュ通知モーダルの背景の有無\n // #################################################################\n $('.push_background_select_box').on('change', function () {\n let push_topic_id = $('#push_topic_id').val();\n let is_background = $('.push_background_select_box option:selected').val();\n let is_device = $('.push_device_selects:checked').data('device');\n $.ajax({\n url: '/push_notification/save_push_is_background',\n type: 'POST',\n data: {\n push_topic_id: push_topic_id,\n is_background: is_background,\n is_device : is_device\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // プッシュ通知モーダルの背景色設定\n // #################################################################\n $('#push_background_color').on('change', function (event) {\n let push_topic_id = $('#push_topic_id').val();\n let background_color = $('#push_background_color').val();\n $.ajax({\n url: '/push_notification/save_push_background_color',\n type: 'POST',\n data: {\n push_topic_id: push_topic_id,\n background_color: background_color,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // プッシュ通知モーダルの背景の透過設定\n // #################################################################\n $('.push_background_opacity_select_box').on('change', function (event) {\n let push_topic_id = $('#push_topic_id').val();\n let background_opacity = $('.push_background_opacity_select_box option:selected').val();\n let is_device = $('.push_device_selects:checked').data('device');\n $.ajax({\n url: '/push_notification/save_push_background_opacity',\n type: 'POST',\n data: {\n push_topic_id: push_topic_id,\n background_opacity: background_opacity,\n is_device: is_device\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // アイコン登録 プッシュモーダル or プッシュ通知本体\n // #################################################################\n $('#push_icon_upload_btn').on('click', function () {\n let element_id_name = $(this).attr('id');\n let push_topic_id = $(this).data('push_topic_id');\n let file_data = $('#push-icon').prop('files')[0];\n if (!file_data) {\n alert('画像を選択してください。');\n return;\n }\n let form_data = new FormData();\n form_data.append('icon_file', file_data);\n form_data.append('push_topic_id', push_topic_id);\n\n $.ajax({\n url: '/push_notification/upload_push_icon',\n type: 'POST',\n data: form_data,\n processData: false,\n contentType: false,\n })\n .done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }else{\n alert(data.message);\n }\n })\n .fail(function () {\n alert('アイコンの登録に失敗しました。');\n });\n });\n\n\n // #################################################################\n /**\n * プッシュ通知のページを別ページで開くかどうかの設定トグルイベント\n * /push_notification/toggle_auth_type にPOST\n */\n $('#toggle-push-auth-type').change(function () {\n $.ajax({\n url: '/push_notification/toggle_auth_type',\n type: 'POST',\n data: {\n push_topic_id: $(this).data('push-topic-id'),\n is_other_page: $(this).prop('checked') ? 1 : 0,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }else{\n alert('更新に失敗しました。');\n }\n });\n });\n\n\n\n /**\n * 許可ページの設定保存\n * /push_notification/save_auth_settings にPOST\n * shop_nameは100文字まで。optional.\n */\n $('#save-auth-settings').click(function () {\n let shop_name = $('#auth-shop-name').val();\n let push_topic_id = $(this).data('push-topic-id');\n\n if (shop_name.length > 100) {\n alert('ショップ名は100文字以内で入力してください。');\n return;\n }\n let formData = new FormData();\n formData.append('push_topic_id', push_topic_id);\n formData.append('shop_name', shop_name);\n\n $.ajax({\n url: '/push_notification/save_auth_settings',\n type: 'POST',\n data: formData,\n contentType: false, // コンテントタイプの設定をfalseに\n processData: false, // データをクエリ文字列に変換する処理を無効化\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n } else {\n alert(data.message);\n }\n }).fail(function () {\n alert('設定の保存に失敗しました。');\n });\n });\n\n\n /**\n * 画像アップロードイベント\n * プレビューをクリックすると、子要素のinput[type=\"file\"]をクリックする\n * stopPropagationでバブリング防止。\n */\n $('.image-preview-wrapper').on('click', function (e) {\n if ($(e.target).is('input[type=\"file\"]')) {\n e.stopPropagation();\n } else {\n $(this).children('input[type=\"file\"]').click();\n }\n });\n\n /**\n * 画像アップロード検知イベント\n */\n $('.image-preview-wrapper input[type=\"file\"]').off().on('change', function () {\n let wrapper = $(this).parent();\n let preview = $(this).parent().children('img');\n compressAndResizeImage(this.files[0], 128, 1024 * 1024, function(compressedBlob, error) {\n if (error) {\n alert('画像の容量が大きすぎます。');\n return;\n }\n const reader = new FileReader();\n reader.onload = function(e) {\n preview.attr('src', e.target.result);\n };\n reader.readAsDataURL(compressedBlob);\n wrapper.addClass('has-data');\n wrapper.removeClass('no-data');\n });\n });\n\n\n\n\n\n /**\n * #################################################################\n * アイコン画像のアップロード処理\n * 指定した\n * @param {File} file\n * @param {number} targetSize 画像の正方形のpxサイズ\n * @param {number} targetFileSize 画像のファイルサイズの上限\n * @param {function} callback\n * @return {void}\n */\n function compressAndResizeImage(file, targetSize, targetFileSize, callback) {\n const reader = new FileReader();\n reader.onload = function(e) {\n const img = new Image();\n img.onload = function() {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n\n // 画像を128px四方の正方形にリサイズ\n const size = targetSize; // 正方形のサイズ\n canvas.width = size;\n canvas.height = size;\n\n // アスペクト比を保持しつつ中央でクロップするための計算\n let sourceX = 0;\n let sourceY = 0;\n let sourceWidth = img.width;\n let sourceHeight = img.height;\n const sourceAspect = img.width / img.height;\n const targetAspect = size / size;\n\n if (sourceAspect > targetAspect) {\n // 横長の画像の場合、横をトリミング\n sourceWidth = sourceHeight * targetAspect;\n sourceX = (img.width - sourceWidth) / 2;\n } else if (sourceAspect < targetAspect) {\n // 縦長の画像の場合、縦をトリミング\n sourceHeight = sourceWidth / targetAspect;\n sourceY = (img.height - sourceHeight) / 2;\n }\n\n ctx.drawImage(img, sourceX, sourceY, sourceWidth, sourceHeight, 0, 0, size, size);\n\n // 初期品質を設定(圧縮しない)\n let quality = 1.0;\n\n const compress = function(quality) {\n canvas.toBlob(function(blob) {\n if (blob.size <= targetFileSize || quality <= 0.1) {\n if (blob.size > targetFileSize) {\n callback(null, 'サイズオーバー');\n } else {\n callback(blob);\n }\n } else {\n // 目標のファイルサイズに達していない場合は、品質を下げて再帰的に圧縮を試みる\n compress(quality - 0.1);\n }\n }, 'image/png', quality);\n };\n\n compress(quality);\n };\n img.src = e.target.result;\n };\n reader.readAsDataURL(file);\n }\n\n\n\n\n /**\n * #################################################################\n * プッシュ通知投稿の作成画面\n * #################################################################\n */\n if ( $('#new-push-post-wrapper').length > 0 ) {\n // modal\n const loadingModal = document.querySelector(\"#loading-modal\");\n\n $('#select-push-topic').on('change', function () {\n const topicId = $(this).val();\n if (topicId === \"all\") {\n location.href = '/push_notification/post';\n }else{\n location.href = `/push_notification/post?push_topic_id=${topicId}`;\n }\n });\n\n /**\n * #################################################################\n * 文字列制限の自動チェック\n * data-limit属性を持つinput要素が更新された時、対象要素のdata-nameと同じ値のdata-limit-nameを持つ要素の、テキストに文字数を表示する\n * また、文字数が制限を超えた時は、文字数を赤色にする( text-red-500クラスを付与 )\n * @param {HTMLElement} callerElement\n * @return {void}\n */\n function checkLimit(callerElement){\n let limit = $(callerElement).data('limit');\n let name = $(callerElement).data('name');\n let countUpElement = $(`[data-limit-name=\"${name}\"]`);\n let length = $(callerElement).val().length;\n countUpElement.text(`${length}`);\n // limitを超えた場合は赤色にする\n if (length > limit) {\n countUpElement.addClass('text-red-500');\n } else {\n countUpElement.removeClass('text-red-500');\n }\n }\n // 初期化とイベント設定\n $('[data-limit]').each(function () {\n checkLimit(this);\n })\n .on('input', function () {\n checkLimit(this);\n });\n\n /**\n * #################################################################\n * 投稿タイミングの切り替え時に、inputのdisabledを切り替える\n * @param {HTMLElement} caller\n * @return {void}\n */\n function changeScheduleDateEditable( caller ) {\n let isSchedule = $(caller).val() === 'schedule';\n $('#push-post-schedule-date').prop('disabled', !isSchedule);\n $('#push-post-schedule-time').prop('disabled', !isSchedule);\n }\n $('#push-post-timing').each(function () {\n changeScheduleDateEditable( this );\n })\n .on('change', function () {\n changeScheduleDateEditable( this );\n });\n\n /**\n * 時間の入力規制。分は30分単位で入力できるようにする。\n * 他の分を入力すると、自動で30分単位に変換する\n */\n $('#push-post-schedule-time').on('input', function () {\n let time = $(this).val();\n let hour = time.split(':')[0];\n let minute = time.split(':')[1];\n if (minute >= 30) {\n minute = '30';\n } else {\n minute = '00';\n }\n $(this).val(`${hour}:${minute}`);\n });\n\n\n\n /**\n * #################################################################\n * プッシュ通知投稿の作成\n * 必須項目\n * - タイトル ( title ) 文字数制限あり\n * - 本文 ( message ) 文字数制限あり\n * - 投稿タイミング ( isSchedule )\n * - trueの場合は、投稿日時 ( schedule_date )\n * - リンク先URL ( jump_to_url )\n */\n $('#create-push-post').on('click', function () {\n const title = $('#push-post-title').val();\n const message = $('#push-post-message').val();\n const isSchedule = $(\"#push-post-timing\").val() === 'schedule';\n const scheduleDate = $('#push-post-schedule-date').val();\n const scheduleTime = $('#push-post-schedule-time').val();\n const scheduleDateTime = `${scheduleDate}T${scheduleTime}`;\n const jumpToUrl = $('#push-post-link').val();\n\n // 必須項目のチェック\n if ( title.trim() === \"\" ) {\n alert('タイトルは必須です。');\n return;\n }\n if ( message.trim() === \"\" ) {\n alert('本文は必須です。');\n return;\n }\n if ( jumpToUrl.trim() === \"\" ) {\n alert('リンク先URLは必須です。');\n return;\n }\n if ( isSchedule && ( scheduleDate.trim() === \"\" || scheduleTime.trim() === \"\" )){\n alert('予約投稿の場合は、投稿日時の指定が必須です。');\n return;\n }\n\n // 文字数チェック\n if ( title.length > 40 ) {\n alert('タイトルは40文字以内で入力してください。');\n return;\n }\n if ( message.length > 200 ) {\n alert('本文は200文字以内で入力してください。');\n return;\n }\n if ( jumpToUrl.length > 255 ) {\n alert('リンク先URLは255文字以内で入力してください。');\n return;\n }\n\n // 予約投稿が現在時刻から1時間以内の場合は拒否\n if ( isSchedule ) {\n const now = new Date();\n const schedule = new Date(scheduleDateTime);\n if ( schedule < now ) {\n alert('過去の日時は指定できません。');\n return;\n }\n if ( schedule - now < 1000 * 60 * 60 ) {\n alert('1時間以内の日時は指定できません。');\n return;\n }\n }\n setTimeout(function() { loadingModal.showModal(); }, 0);\n\n $.ajax({\n url: '/push_notification/create_push_post',\n type: 'POST',\n data: {\n push_post_id: $('#push-post-id').val(),\n push_topic_id: $('#push-topic-id').val(),\n title: title,\n message: message,\n is_schedule: isSchedule,\n schedule_datetime: scheduleDateTime,\n jump_to_url: jumpToUrl,\n },\n dataType: 'json',\n })\n .done(function (data) {\n if (data.ret === 0) {\n // 予約か即時投稿かでメッセージを変える\n if ( isSchedule ) {\n alert('プッシュ通知を予約しました。');\n } else {\n alert('プッシュ通知を送信しました。');\n }\n location.href = '/push_notification/post_history';\n }\n })\n .fail(function () {\n alert('プッシュ通知投稿の作成に失敗しました。');\n })\n .always(function() {\n loadingModal.close();\n });\n });\n\n /**\n * #################################################################\n * プッシュ通知投稿の削除、キャンセル\n */\n $('#delete-push-post').on('click', function () {\n if ( !confirm('この投稿をキャンセルしますか?\\n※キャンセル後は元に戻せません') ) {\n return;\n }\n\n setTimeout(function() { loadingModal.showModal(); }, 0);\n $.ajax({\n url: '/push_notification/delete_push_post',\n type: 'POST',\n data: {\n push_post_id: $('#push-post-id').val(),\n },\n dataType: 'json',\n })\n .done(function (data) {\n if (data.ret === 0) {\n alert('この投稿をキャンセルしました');\n location.href = '/push_notification/post_history';\n }\n })\n .fail(function () {\n alert('キャンセルに失敗しました。');\n })\n .always(function() {\n loadingModal.close();\n });\n\n });\n\n } // end if ( $('#new-push-post-wrapper').length > 0 )\n\n\n // #################################################################\n // 投稿履歴ページの処理\n if ( $('#push-post-history-wrapper').length ) {\n /**\n * #################################################################\n * 履歴を表示するトピックの変更\n * すべてなら指定なし、それ以外ならtopic_idを指定してリダイレクト\n */\n $('#select-push-topic').on('change', function () {\n const topicId = $(this).val();\n if (topicId === \"all\") {\n location.href = '/push_notification/post_history';\n }else{\n location.href = `/push_notification/post_history?push_topic_id=${topicId}`;\n }\n });\n\n } // end if ( $('#push-post-history-wrapper').length )\n\n\n});\n","document.addEventListener('turbolinks:load', function () {\n $('.personalize_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.personalize_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.personalize_slidedown_btn').fadeIn(0));\n });\n\n $('.personalize_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.personalize_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.personalize_slideup_btn').fadeIn(0));\n });\n\n // ------------------------------------------------------------------------------------------------\n // パーソナライズ設定管理\n // ------------------------------------------------------------------------------------------------\n \n // #################################################################\n // パーソナライズ設定名の編集\n // #################################################################\n $('#personalize_name_edit_btn').on('click', function () {\n let personalize_id = $('.personalize_select_box option:selected').val();\n let name = $('.personalize_name_val').val();\n\n if (!name) {\n alert('名称を記入して下さい。');\n return;\n }\n\n $.ajax({\n url: '/save_personalize_name',\n type: 'POST',\n data: {\n personalize_id: personalize_id,\n name: name\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // パーソナライズ設定名の編集\n // #################################################################\n $('#personalize_description_edit_btn').on('click', function () {\n let personalize_id = $('.personalize_select_box option:selected').val();\n let description = $('.personalize_description_val').val();\n\n $.ajax({\n url: '/save_personalize_description',\n type: 'POST',\n data: {\n personalize_id: personalize_id,\n description: description\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // クッキー名の編集\n // #################################################################\n $('#personalize_cookie_name_edit_btn').on('click', function () {\n let personalize_id = $('.personalize_select_box option:selected').val();\n let cookie_name = $('.personalize_cookie_name_val').val();\n\n $.ajax({\n url: '/save_personalize_cookie_name',\n type: 'POST',\n data: {\n personalize_id: personalize_id,\n cookie_name: cookie_name\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ローカルストレージのkeyの編集\n // #################################################################\n $('#personalize_local_storage_key_edit_btn').on('click', function () {\n let personalize_id = $('.personalize_select_box option:selected').val();\n let local_storage_key = $('.personalize_local_storage_key_val').val();\n\n $.ajax({\n url: '/save_personalize_local_storage_key',\n type: 'POST',\n data: {\n personalize_id: personalize_id,\n local_storage_key: local_storage_key\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // URL設定\n // #################################################################\n $('#personalize_url_add_input').on('click', function () {\n if ($('.personalize_url_input').length >= 20) {\n return;\n }\n $(this)\n .parents('table')\n .append(\n `\n \n \n \n \n \n
\n \n \n \n
\n \n `\n );\n $('.personalize_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n $('.personalize_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n\n $('#personalize_url_set').on('click', function () {\n let personalize_id = $('.personalize_select_box option:selected').val();\n let urls = [];\n $('.personalize_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/set_personalize_url',\n type: 'POST',\n data: {\n personalize_id: personalize_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // URL判定条件\n // #################################################################\n $('.personalize_url_condition_flag_select').on('change', function () {\n let personalize_id = $('.personalize_select_box option:selected').val();\n let url_condition_flag = $('.personalize_url_condition_flag_select').val();\n\n $.ajax({\n url: '/save_personalize_url_condition_flag',\n type: 'POST',\n data: {\n personalize_id: personalize_id,\n url_condition_flag: url_condition_flag\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n});\n","document.addEventListener('turbolinks:load', function () {\n $('.personalize_list_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.personalize_list_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.personalize_list_slidedown_btn').fadeIn(0));\n });\n\n $('.personalize_list_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.personalize_list_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.personalize_list_slideup_btn').fadeIn(0));\n });\n\n \n // -----------------------------------------------------------------------------\n // パーソナライズ設定一覧\n // -----------------------------------------------------------------------------\n // #################################################################\n // パーソナライズ設定の新規作成\n // #################################################################\n $('#personalize_list_create').on('click', function () {\n const name = $('.personalize_list_input').val();\n\n if (!name) {\n alert('パーソナライズ設定名を入力して下さい。');\n return;\n }\n\n $.ajax({\n url: '/personalize_list/create',\n type: 'POST',\n data: {\n name: name,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.href = `/personalize_list/index?personalize_id=${data.personalize.id}`;\n }\n });\n });\n\n // #################################################################\n // パーソナライズ設定検索\n // #################################################################\n $('#personalize_list_search').on('keypress', function (e) {\n let p = $(this).val();\n if (!p) {\n return;\n }\n\n if (e.which == 13) {\n e.preventDefault();\n \n $('.personalize_record').remove();\n let p = $(this).val();\n\n $.ajax({\n url: 'get_personalize_list',\n type: 'POST',\n data: {\n p: p,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n $.each(data.personalize, function (index, content) {\n let mode = '';\n if (content.is_mode == 0) {\n mode = 'ポップアップ';\n } else if (content.is_mode == 1) {\n mode = '差し込み配信';\n } else if (content.is_mode == 2) {\n mode = '離脱防止';\n }\n\n let display_type = '';\n if (content.display_type == 0) {\n display_type = '画像';\n } else if (content.display_type == 1) {\n display_type = 'HTML';\n }\n\n let preview_btn = '';\n if ((content.display_type == 0 && content.img_url) || (content.display_type == 1 && content.html)) {\n preview_btn = `\n
\n \n \n \n \n プレビュー\n
`;\n }\n\n $('.personalize_list_table').append(\n `\n ${index + 1}:\n \n \n
${content.name}
\n
\n \n ${mode}\n ${display_type}\n ${preview_btn}\n \n \">\n
\n \n \n \n レポートへ\n
\n
\n \n `\n );\n });\n }\n });\n }\n });\n\n // #################################################################\n // プレビュー表示\n // #################################################################\n $(\".personalize_preview_btn\").on(\"click\", function () {\n let is_mode = $(this).data(\"is_mode\");\n let display_type = $(this).data(\"display_type\");\n let img_url = $(this).data(\"img_url\");\n let html = $(this).data(\"html\");\n let delete_btn_position = $(this).data(\"delete_btn_position\");\n let img_width = $(this).data(\"img_width\");\n let img_height = $(this).data(\"img_height\");\n\n // $('.personalize_preview_btn').css('pointer-events', 'none');\n $(\".personalize_list_html_preview_wrapper\").remove();\n\n let common_styles = \"position:absolute; display:flex; justify-content: center;align-items: center;background-color:#ededed;padding:0;border-radius:9999px;cursor:pointer;user-select:none;height:30px;width:30px;\";\n\n let unique_styles;\n let delete_btn_style;\n\n switch(delete_btn_position) {\n case 0:\n unique_styles = \"right:2px; top:-32px; \";\n break;\n case 1:\n unique_styles = \"right:-30px; top:-30px; \";\n break;\n case 2:\n unique_styles = \"right:-32px; top:0px; \";\n break;\n case 3:\n unique_styles = \"right:2px; top:2px; \";\n break;\n case 4:\n unique_styles = \"left:2px; top:-32px; \";\n break;\n case 5:\n unique_styles = \"left:-30px; top:-30px; \";\n break;\n case 6:\n unique_styles = \"left:-32px; top:0px; \";\n break;\n case 7:\n unique_styles = \"left:2px; top:2px; \";\n break;\n default:\n unique_styles = \"right:2px; top:-32px; \";\n }\n\n delete_btn_style = common_styles + unique_styles;\n\n let el;\n\n if (display_type == \"0\") {\n el = ``;\n } else if (display_type == \"1\"){\n el = html;\n }\n\n let append_html = `
\n \n
\n ${el}\n
\n
`;\n\n $(\"body\").append(append_html);\n\n $(\".personalize_list_html_delete_btn\").on(\"click\", function() {\n $(this).parent().remove();\n // $('.personalize_preview_btn').css('pointer-events', 'auto');\n });\n });\n\n});","document.addEventListener('turbolinks:load', function () {\n $('.heatmap_preset_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.heatmap_preset_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.heatmap_preset_slidedown_btn').fadeIn(0));\n });\n\n $('.heatmap_preset_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.heatmap_preset_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.heatmap_preset_slideup_btn').fadeIn(0));\n });\n\n // #################################################################\n // ヒートマップ管理の切り替え\n // #################################################################\n $('.heatmap_preset_select_box').on('change', function () {\n let heatmap_preset_id = $('.heatmap_preset_select_box option:selected').val();\n if (heatmap_preset_id == 'new') {\n $('.heatmap_preset_set_wrapper_display').css('display', 'block');\n $('.heatmap_preset_name_setting_wrapper').css('display', 'none');\n $('.heatmap_preset_description_setting_wrapper').css('display', 'none');\n $('.heatmap_preset_url_setting_wrapper').css('display', 'none');\n\n } else {\n location.href = `/heatmap_preset/index?heatmap_preset_id=${heatmap_preset_id}`;\n }\n });\n\n // #################################################################\n // ヒートマップ管理の新規作成\n // #################################################################\n $('#heatmap_preset_create').on('click', function () {\n const url = $('.heatmap_preset_url_input').val();\n const name = $('.heatmap_preset_name_input').val();\n const description = $('.heatmap_preset_description_input').val();\n\n if (!name) {\n alert('ヒートマップ名を入力して下さい。');\n return;\n }\n\n if (!url) {\n alert('URLを入力して下さい。');\n return;\n }\n\n $.ajax({\n url: '/create_heatmap_preset',\n type: 'POST',\n data: {\n name: name,\n url: url,\n description: description,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('新規登録されました。');\n location.href = `/heatmap_preset/index?heatmap_preset_id=${data.heatmap_preset_id}`;\n }else{\n alert('登録に失敗しました。\\n' + data.message);\n }\n })\n .fail(function (data) {\n alert('登録に失敗しました。');\n })\n });\n\n // #################################################################\n // ヒートマップ管理名の編集\n // #################################################################\n $('#heatmap_preset_name_edit_btn').on('click', function () {\n let heatmap_preset_id = $('.heatmap_preset_select_box option:selected').val();\n let name = $('.heatmap_preset_name_val').val();\n\n if (!name) {\n alert('名称を記入して下さい。');\n return;\n }\n\n $.ajax({\n url: '/save_heatmap_preset_name',\n type: 'POST',\n data: {\n heatmap_preset_id: heatmap_preset_id,\n name: name\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('保存されました。')\n location.reload();\n }else{\n alert('保存に失敗しました。\\n'+data.message);\n }\n })\n .fail(function (data) {\n alert('登録に失敗しました。');\n })\n });\n\n // #################################################################\n // ヒートマップ管理説明の編集\n // #################################################################\n $('#heatmap_preset_description_edit_btn').on('click', function () {\n let heatmap_preset_id = $('.heatmap_preset_select_box option:selected').val();\n let description = $('.heatmap_preset_description_val').val();\n\n if (!description) {\n alert('説明を記入して下さい。');\n return;\n }\n\n $.ajax({\n url: '/save_heatmap_preset_description',\n type: 'POST',\n data: {\n heatmap_preset_id: heatmap_preset_id,\n description: description\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('保存されました。')\n location.reload();\n }else {\n alert('保存に失敗しました。\\n'+data.message);\n }\n })\n .fail(function (data) {\n alert('登録に失敗しました。');\n })\n });\n\n // #################################################################\n // ヒートマップ管理URLの編集\n // #################################################################\n $('#heatmap_preset_url_edit_btn').on('click', function () {\n let heatmap_preset_id = $('.heatmap_preset_select_box option:selected').val();\n let url = $('.heatmap_preset_url_val').val();\n\n if (!url) {\n alert('URLを記入して下さい。');\n return;\n }\n\n $.ajax({\n url: '/save_heatmap_preset_url',\n type: 'POST',\n data: {\n heatmap_preset_id: heatmap_preset_id,\n url: url\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert('保存されました。')\n location.reload();\n }else{\n alert('保存に失敗しました。\\n'+data.message);\n }\n })\n .fail(function (data) {\n alert('登録に失敗しました。');\n })\n });\n\n // #################################################################\n // ヒートマッププリセットの削除\n // #################################################################\n $('#delete-heatmap-preset').on('click', function () {\n let heatmap_preset_id = $('.heatmap_preset_select_box option:selected').val();\n let heatmapTitle = $('.heatmap_preset_select_box option:selected').text();\n if (!confirm('このヒートマッププリセットを削除しますか?')) {\n return;\n }\n $.ajax({\n url: '/delete_heatmap_preset',\n type: 'POST',\n data: {\n heatmap_preset_id: heatmap_preset_id\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n alert(`${heatmapTitle} を削除しました。`)\n location.href = '/heatmap_preset/index';\n }\n })\n .fail(function (data) {\n alert('削除に失敗しました。');\n })\n });\n\n\n /**\n * ヒートマップレポート\n */\n if ($('#heatmap-preset-report-wrapper').length) {\n let _heatmapPresetId = $('#heatmap-preset-id').val();\n let _heatmapDevice = $('#heatmap-device').val();\n let _heatmapReportType = $('#heatmap-report-type').val();\n /**\n * 項目の更新時イベント定義\n */\n // プリセットの選択\n $('#heatmap-preset-select').on('change', function () {\n _heatmapPresetId = $(this).val();\n update_heatmap_report();\n });\n // 日付の範囲選択\n $('#heatmap-start-date, #heatmap-end-date').on('change', function () {\n update_heatmap_report();\n });\n // デバイスの切り替え\n $('.heatmap-device-btn').on('click', function () {\n _heatmapDevice = $(this).attr('data-device');\n update_heatmap_report();\n });\n // レポート種別の切り替え\n $('.heatmap-report-type-btn').on('click', function () {\n _heatmapReportType = $(this).attr('data-report-type');\n update_heatmap_report();\n });\n\n function update_heatmap_report() {\n let startDate = $('#heatmap-start-date').val();\n let endDate = $('#heatmap-end-date').val();\n // startDateよりもendDateが前の場合は、入れ替える\n if (startDate > endDate) {\n let tmp = startDate;\n startDate = endDate;\n endDate = tmp;\n }\n location.href = `/heatmap_preset/report?id=${_heatmapPresetId}&device=${_heatmapDevice}&type=${_heatmapReportType}&start_date=${startDate}&end_date=${endDate}`;\n }\n }\n\n\n\n // #################################################################\n /**\n * クリックヒートマップ\n *\n * ライブラリのheatmap.jsを利用。\n * #heatmapContainerに対して、renderClickHeatmapイベントを設定。triggerで呼び出す。\n * _heatmap_data_jsonはviewでグローバル変数として埋め込んでいる。\n */\n $('#heatmapContainer').on('renderClickReport', function() {\n let heatmapContainer = document.getElementById('heatmapContainer');\n let config = {\n container: heatmapContainer,\n radius: 25,\n maxOpacity: .5,\n minOpacity: .1,\n blur: .75\n };\n let heatmapInstance = h337.create(config);\n\n // x, y座標はパーセントで記録されているので、heatmapContainerの横幅から実数を算出する\n // XPathから要素を検索し、存在するなら座標を登録していく\n let dataPoint = _heatmap_data_json;\n let calcDataPoint = [];\n let iframe = document.getElementsByTagName('iframe')[0];\n let iframeDoc = iframe.contentWindow.document;\n for (let i = 0; i < dataPoint.length; i++) {\n let point = dataPoint[i];\n // XPathから要素を検索\n let element = iframeDoc.evaluate(point.xpath, iframeDoc, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\n // display:noneの要素は無視する\n if (element && getComputedStyle(element).display === 'none') {\n continue;\n }\n // 要素が存在する場合は、座標を計算する\n if (element) {\n // 要素の座標を一括取得\n let rect = element.getBoundingClientRect();\n let x = Math.round(rect.left + rect.width * point.localX / 100);\n let y = Math.round(rect.top + rect.height * point.localY / 100);\n calcDataPoint.push({\n x: x,\n y: y,\n value: 1\n });\n }else{\n console.log(\"要素が存在しませんでした: \" + point.xpath);\n }\n }\n heatmapInstance.addData(calcDataPoint);\n });\n\n\n /**\n * アテンションヒートマップ\n * #heatmapContainerに対して、renderAttentionReportイベントを設定。triggerで呼び出す。\n * _heatmap_data_jsonはviewでグローバル変数として埋め込んでいる。\n */\n $('#heatmapContainer').on('renderAttentionReport', function () {\n initializeScrollHeatmapElements(_heatmap_data_json);\n });\n\n /**\n * スクロールヒートマップ\n * #heatmapContainerに対して、renderScrollReportイベントを設定。triggerで呼び出す。\n * _heatmap_data_jsonはviewでグローバル変数として埋め込んでいる。\n */\n $('#heatmapContainer').on('renderScrollReport', function () {\n initializeScrollHeatmapElements(_heatmap_data_json);\n });\n\n\n function initializeScrollHeatmapElements(scroll_heatmap) {\n const css = platta_scroll_heatmap_css(scroll_heatmap);\n // スタイルタグを作成する\n create_scroll_heatmap_css_style_element(css);\n create_scroll_heatmap_overlay(scroll_heatmap);\n }\n\n function create_scroll_heatmap_css_style_element(css) {\n $('body').append(``);\n }\n\n function create_scroll_heatmap_overlay() {\n $('#heatmapContainer').append(`\n
\n
\n
\n
\n

0%

\n

25%

\n

50%

\n

75%

\n

100%

\n
\n
\n
`);\n }\n\n /**\n * アテンション、スクロールヒートマップのCSSを作成する\n */\n function platta_scroll_heatmap_css(top_to_end_user_ratio) {\n // ヒートマップデータは、下記をHTMLに埋め込む。100分割して数値を割り振る。グローバルに埋め込む。\n // let top_to_end_user_ratio = {\n // 0: 100, 2: 98.5, 4: 96.5, 6: 96, 8: 96, 10: 92, 12: 91.5, 14: 89.5, 16: 87.5, 18: 85.5,\n // 20: 83.5, 22: 81.5, 24: 79.5, 26: 77.5, 28: 75.5, 30: 73.5, 32: 71.5, 34: 69.5, 36: 59,\n // 38: 55, 40: 51, 42: 47, 44: 43, 46: 39, 48: 33, 50: 29, 52: 29, 54: 29, 56: 29, 58: 29,\n // 60: 29, 62: 28.5, 64: 26.5, 66: 24.5, 68: 22.5, 70: 20.5, 72: 18.5, 74: 15.5, 76: 11,\n // 78: 7.5, 80: 5, 82: 5, 84: 5, 86: 5, 88: 5, 90: 5, 92: 3.5, 94: 1.5, 96: 0, 98: 0\n // };\n\n let options = [100, 98, 96, 94, 92, 90, 88, 86, 84, 82, 80, 78, 76, 74, 72, 70, 68, 66, 64, 62, 60,\n 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32, 30, 28, 26, 24, 22, 20, 18,\n 16, 14, 12, 10, 8, 6, 4, 2, 0];\n\n // top_to_end_user_ratio を gradation定数に当てはまるように、それぞれのvalueを\n // 2%ごとの各近似値に置き換え、objectで返す\n function convertShmStyle(top_to_end_user_ratio) {\n // PC用のデータのみを利用\n top_to_end_user_ratio = top_to_end_user_ratio['percentage_pc'];\n\n let result = {};\n for (let k in top_to_end_user_ratio) {\n let v = top_to_end_user_ratio[k];\n let closest = options.reduce((prev, curr) => {\n // console.log('prev :>> ', prev);\n // console.log('curr :>> ', curr);\n return (Math.abs(curr - v) < Math.abs(prev - v) ? curr : prev);\n });\n result[k] = closest;\n }\n return result;\n }\n\n let updated_top_to_end_user_ratio = convertShmStyle(top_to_end_user_ratio);\n\n // エンドユーザーの割合によって表示するグラデーション郡\n const gradation = {\n // エンドユーザーの割合 : 色 : 画面一番上からの%\n 100: 'rgba(255, 0, 0, 1)',\n 98: 'rgba(255, 18, 0, 1)',\n 96: 'rgba(255, 27, 0, 1)',\n 94: 'rgba(255, 37, 0, 1)',\n 92: 'rgba(255, 64, 0, 1)',\n 90: 'rgba(255, 90, 0, 1)',\n 88: 'rgba(255, 100, 0, 1)',\n 86: 'rgba(255, 105, 0, 1)',\n 84: 'rgba(255, 110, 0, 1)',\n 82: 'rgba(255, 119, 0, 1)',\n 80: 'rgba(255, 122, 0, 1)',\n 78: 'rgba(255, 125, 0, 1)',\n 76: 'rgba(255, 138, 0, 1)',\n 74: 'rgba(254, 152, 0, 1)',\n 72: 'rgba(253, 170, 0, 1)',\n 70: 'rgba(252, 188, 0, 1)',\n 68: 'rgba(251, 206, 0, 1)',\n 66: 'rgba(250, 224, 0, 1)',\n 64: 'rgba(248, 230, 0, 1)',\n 62: 'rgba(244, 234, 0, 1)',\n 60: 'rgba(240, 240, 0, 1)',\n 58: 'rgba(236, 245, 0, 1)',\n 56: 'rgba(231, 255, 0, 1)',\n 54: 'rgba(214, 255, 0, 1)',\n 52: 'rgba(196, 255, 0, 1)',\n 50: 'rgba(175, 255, 8, 1)',\n 48: 'rgba(153, 255, 24, 1)',\n 46: 'rgba(132, 255, 39, 1)',\n 44: 'rgba(114, 255, 53, 1)',\n 42: 'rgba(96, 255, 67, 1)',\n 40: 'rgba(77, 255, 81, 1)',\n 38: 'rgba(69, 248, 80, 1)',\n 36: 'rgba(61, 241, 80, 1)',\n 34: 'rgba(52, 234, 79, 1)',\n 32: 'rgba(44, 228, 79, 1)',\n 30: 'rgba(35, 221, 78, 1)',\n 28: 'rgba(29, 215, 97, 1)',\n 26: 'rgba(23, 209, 116, 1)',\n 24: 'rgba(17, 203, 134, 1)',\n 22: 'rgba(11, 198, 153, 1)',\n 20: 'rgba(4, 192, 172, 1)',\n 18: 'rgba(14, 185, 189, 1)',\n 16: 'rgba(25, 178, 206, 1)',\n 14: 'rgba(35, 171, 222, 1)',\n 12: 'rgba(40, 167, 230, 1)',\n 10: 'rgba(56, 156, 255, 1)',\n 8: 'rgba(45, 135, 255, 1)',\n 6: 'rgba(34, 113, 255, 1)',\n 4: 'rgba(23, 91, 255, 1)',\n 2: 'rgba(6, 58, 255, 1)',\n 0: 'rgba(0, 47, 255, 1)'\n }\n\n // -- style の background-image: linear-gradient();の中身を作成する\n const key_array = [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98];\n\n function create_linear_gradient_style(gradation, updated_top_to_end_user_ratio) {\n let result = $.map(key_array, function (val_key, _index) {\n return `${gradation[updated_top_to_end_user_ratio[val_key]]} ${val_key}%,`\n });\n // 最後の要素のコンマ()を取り除く\n result = result.join('').trim().replace(/,$/, \"\");\n return result;\n }\n\n let linear_gradient_style_content = create_linear_gradient_style(gradation, updated_top_to_end_user_ratio)\n const scroll_heatmap_height = \"200px\";\n\n let heatmap__content_width;\n let heatmap__content_height;\n let heatmap__content_top;\n let heatmap__content_right ;\n\n let heatmap__container_width;\n let heatmap__container_height;\n let heatmap__container_top;\n let heatmap__container_right;\n\n let heatmap__label_0_top;\n let heatmap__label_25_top;\n let heatmap__label_50_top;\n let heatmap__label_75_top;\n let heatmap__label_100_top;\n\n heatmap__content_width = \"100px\"\n heatmap__content_height = \"200px\"\n heatmap__content_top = \"50px\"\n heatmap__content_right = \"70px\"\n\n heatmap__container_width = \"200px\"\n heatmap__container_height = \"240px\"\n heatmap__container_top = \"30px\"\n heatmap__container_right = \"20px\"\n\n heatmap__label_0_top = \"0px\"\n heatmap__label_25_top = \"30px\"\n heatmap__label_50_top = \"60px\"\n heatmap__label_75_top = \"90px\"\n heatmap__label_100_top = \"120px\"\n\n let scroll_heatmap_style = `\n .platta_heatmap__content {\n font-family: poppins, Helvetica, Arial, sans-serif;\n font-size: 12px;\n color: white !important;\n box-shadow: 0px 10px 50px gray;\n border-radius:5px;\n position: fixed;\n z-index: 9999999999;\n top: ${heatmap__content_top};\n right: ${heatmap__content_right};\n width: ${heatmap__content_width};\n height: ${heatmap__content_height};\n background-image: linear-gradient(\n ${linear_gradient_style_content}\n );\n }\n `;\n\n // ヒートマップを見やすくするためのバックグラウンドカラーを設定\n scroll_heatmap_style += `\n .platta_heatmap__container {\n display: none; // 管理画面レポートではミニマップは非表示\n width: ${heatmap__container_width};\n height: ${heatmap__container_height};\n margin: 0;\n padding: 0;\n position: fixed;\n z-index: 999999999;\n top: ${heatmap__container_top};\n right: ${heatmap__container_right};\n background-color: black !important;\n padding: 2px;\n border-radius: 10px;\n box-shadow: 0px 10px 50px gray;\n }\n `;\n\n let label_common_style = `\n line-height: 21px;\n font-family: inherit;\n position: relative;\n font-size: inherit;\n color: inherit;\n transform: translateY(-50%);\n text-align: right;\n right: -40px;\n margin: 0;\n padding: 0;\n `;\n\n scroll_heatmap_style += `\n .platta_scroll_heatmap__label_0 {\n ${label_common_style}\n top: ${heatmap__label_0_top};\n }\n\n .platta_scroll_heatmap__label_25 {\n ${label_common_style}\n top: ${heatmap__label_25_top};\n }\n\n .platta_scroll_heatmap__label_50 {\n ${label_common_style}\n top: ${heatmap__label_50_top};\n }\n\n .platta_scroll_heatmap__label_75 {\n ${label_common_style}\n top: ${heatmap__label_75_top};\n }\n\n .platta_scroll_heatmap__label_100 {\n ${label_common_style}\n top: ${heatmap__label_100_top};\n }\n `;\n\n // webページ全体をヒートマップの対象にするため、高さを取得する\n let docHeight = $('#heatmapContainer').height();\n $('.platta_scroll_heatmap__hp').height(docHeight);\n // webページ全体\n scroll_heatmap_style += `\n .platta_scroll_heatmap__hp {\n position: absolute;\n top:0;\n left:0;\n min-with: 100%;\n min-height: 100%;\n width: 100%;\n height: ${docHeight}px;\n z-index: 99999999;\n opacity: 0.7;\n background-image: linear-gradient(\n ${linear_gradient_style_content}\n );\n }\n `;\n return scroll_heatmap_style;\n }\n\n\n});\n","document.addEventListener(\"turbolinks:load\", function() {\n\tif ($('#recommend-settings-wrapper').length) {\n\n\t\t/**\n\t\t * カートシステムプルダウン変更時イベント\n\t\t * カートシステムに応じてプレフィックス項目の有効・無効を切り替える\n\t\t * 各カートの必要プレフィックスは下記の通り\n\t\t * - shopify ... item\n\t\t * - ec-cube ... item & image\n\t\t * - ochanoko-net ... item & image\n\t\t * - feature-shop ... item\n\t\t * - order-made ... item & image\n\t\t * - other ... none\n\t\t */\n\t\tfunction changeCartSystem(){\n\t\t\tlet cartSystem = $('#recommend-cart-system-name').val();\n\t\t\tlet pcPrefixItem = $('#recommend-item-url-prefix');\n\t\t\tlet pcPrefixImage = $('#recommend-image-url-prefix');\n\t\t\tlet spPrefixItem = $('#recommend-sp-item-url-prefix');\n\t\t\tlet spPrefixImage = $('#recommend-sp-image-url-prefix');\n\t\t\tswitch (cartSystem) {\n\t\t\t\tcase 'shopify':\n\t\t\t\t\tpcPrefixItem.prop('disabled', false);\n\t\t\t\t\tpcPrefixImage.prop('disabled', true);\n\t\t\t\t\tspPrefixItem.prop('disabled', false);\n\t\t\t\t\tspPrefixImage.prop('disabled', true);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ec-cube':\n\t\t\t\t\tpcPrefixItem.prop('disabled', false);\n\t\t\t\t\tpcPrefixImage.prop('disabled', false);\n\t\t\t\t\tspPrefixItem.prop('disabled', false);\n\t\t\t\t\tspPrefixImage.prop('disabled', false);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ochanoko-net':\n\t\t\t\t\tpcPrefixItem.prop('disabled', false);\n\t\t\t\t\tpcPrefixImage.prop('disabled', false);\n\t\t\t\t\tspPrefixItem.prop('disabled', false);\n\t\t\t\t\tspPrefixImage.prop('disabled', false);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'feature-shop':\n\t\t\t\t\tpcPrefixItem.prop('disabled', false);\n\t\t\t\t\tpcPrefixImage.prop('disabled', true);\n\t\t\t\t\tspPrefixItem.prop('disabled', false);\n\t\t\t\t\tspPrefixImage.prop('disabled', true);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'order-made':\n\t\t\t\t\tpcPrefixItem.prop('disabled', false);\n\t\t\t\t\tpcPrefixImage.prop('disabled', false);\n\t\t\t\t\tspPrefixItem.prop('disabled', false);\n\t\t\t\t\tspPrefixImage.prop('disabled', false);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tpcPrefixItem.prop('disabled', true);\n\t\t\t\t\tpcPrefixImage.prop('disabled', true);\n\t\t\t\t\tspPrefixItem.prop('disabled', true);\n\t\t\t\t\tspPrefixImage.prop('disabled', true);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$('#recommend-cart-system-name').on('change', function(){\n\t\t\tconsole.log('change');\n\t\t\tchangeCartSystem();\n\t\t});\n\t\tchangeCartSystem();\n\n\n\t\t// csvファイル設置URLの登録イベント\n\t\t$('#update-recommend-csv-url').on('click', function(){\n\t\t\tlet itemUrl = $('#recommend-item-csv-url').val();\n\t\t\tlet activityUrl = $('#recommend-activity-csv-url').val();\n\t\t\tlet cartSystemName = $('#recommend-cart-system-name').val();\n\t\t\tlet ftpHost = $('#recommend-ftp-host').val();\n\t\t\tlet ftpUser = $('#recommend-ftp-user').val();\n\t\t\tlet ftpPassword = $('#recommend-ftp-password').val();\n\t\t\tlet ftpFilePath = $('#recommend-ftp-file-path').val();\n\t\t\tlet itemUrlPrefix = $('#recommend-item-url-prefix').val();\n\t\t\tlet imageUrlPrefix = $('#recommend-image-url-prefix').val();\n\t\t\tlet spItemUrlPrefix = $('#recommend-sp-item-url-prefix').val();\n\t\t\tlet spImageUrlPrefix = $('#recommend-sp-image-url-prefix').val();\n\t\t\t// if (itemUrl === \"\" || itemUrl.trim() === \"\") {\n\t\t\t// \talert('URLが入力されていません');\n\t\t\t// \treturn;\n\t\t\t// }\n\t\t\t// if (activityUrl === \"\" || activityUrl.trim() === \"\") {\n\t\t\t// \talert('URLが入力されていません');\n\t\t\t// \treturn;\n\t\t\t// }\n\t\t\t$.ajax({\n\t\t\t\turl: \"/recommend_settings/update_csv_url\",\n\t\t\t\ttype: 'post',\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: {\n\t\t\t\t\titem_csv_url: itemUrl,\n\t\t\t\t\tactivity_csv_url: activityUrl,\n\t\t\t\t\tcart_system_name: cartSystemName,\n\t\t\t\t\tftp_host: ftpHost,\n\t\t\t\t\tftp_user: ftpUser,\n\t\t\t\t\tftp_password: ftpPassword,\n\t\t\t\t\tftp_file_path: ftpFilePath,\n\t\t\t\t\titem_url_prefix: itemUrlPrefix,\n\t\t\t\t\timage_url_prefix: imageUrlPrefix,\n\t\t\t\t\tsp_item_url_prefix: spItemUrlPrefix,\n\t\t\t\t\tsp_image_url_prefix: spImageUrlPrefix,\n\t\t\t\t},\n\t\t\t})\n\t\t\t.done(function(data){\n\t\t\t\tif (data['result'] === 'success'){\n\t\t\t\t\talert('登録しました');\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}else{\n\t\t\t\t\talert(data['message']);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.fail(function(data){\n\t\t\t\talert('登録に失敗しました');\n\t\t\t});\n\t\t});\n\n\t\t// URL行の追加ボタンイベント設定\n\t\t$('.url-add').on('click', function(){\n\t\t\tlet table = $(this).parent('div').first().find('table')\n\t\t\tlet tr = table.find('tr:last').clone();\n\t\t\ttr.find('input').val('');\n\t\t\tif (tr.find('.url-del').length) {\n\t\t\t\ttr.find('.url-del').removeClass('hidden');\n\t\t\t}else{\n\t\t\t\tlet td = $(`
削除
`);\n\t\t\t\ttr.append(td);\n\t\t\t}\n\t\t\ttable.append(tr);\n\t\t\tresetInputRemove();\n\t\t});\n\n\t\t// URL行の削除ボタンイベント再設定\n\t\tfunction resetInputRemove(){\n\t\t\t$('.url-del').off().on('click', function(){\n\t\t\t\t$(this).closest('tr').remove();\n\t\t\t});\n\t\t}\n\t\tresetInputRemove();\n\n\t\t/**\n\t\t * URLの登録ボタンイベント\n\t\t * クリックされたボタンのid名に応じて登録するURLの種類を判定し、対象のtableからURLを取得してPOSTする\n\t\t */\n\t\t$('#update-item-page-url, #update-thanks-page-url, #update-excluded-item-page-url, #update-purchase-page-url').on('click', function(){\n\t\t\tlet device = $('#device').val();\n\t\t\tlet urlType = \"\";\n\t\t\tlet isExcluded = 0;\n\t\t\tswitch ($(this).attr('id')) {\n\t\t\t\tcase 'update-item-page-url':\n\t\t\t\t\turlType = \"item\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase\t'update-excluded-item-page-url':\n\t\t\t\t\turlType = \"item\";\n\t\t\t\t\tisExcluded = 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'update-thanks-page-url':\n\t\t\t\t\turlType = \"thanks\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'update-purchase-page-url':\n\t\t\t\t\turlType = \"purchase\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlet targetTable = $(this).parent('div').first().find('table');\n\t\t\tlet urls = [];\n\t\t\ttargetTable.find('input').each(function(){\n\t\t\t\tif (this.value === \"\" || this.value.trim() === \"\") {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\turls.push({['url']: this.value});\n\t\t\t});\n\t\t\t// if (urls.length === 0) {\n\t\t\t// \talert('URLが入力されていません');\n\t\t\t// \treturn;\n\t\t\t// }\n\t\t\t$.ajax({\n\t\t\t\turl: \"/recommend_settings/update_urls\",\n\t\t\t\ttype: 'post',\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: {\n\t\t\t\t\tdevice: device,\n\t\t\t\t\turls: urls,\n\t\t\t\t\turl_type: urlType,\n\t\t\t\t\tis_excluded: isExcluded,\n\t\t\t\t},\n\t\t\t})\n\t\t\t.done(function(data){\n\t\t\t\tif (data['result'] === 'success'){\n\t\t\t\t\talert('登録しました');\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}else{\n\t\t\t\t\talert(data['message']);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.fail(function(data){\n\t\t\t\talert('登録に失敗しました');\n\t\t\t});\n\t\t});\n\n\n\t\t// セレクタの設定イベント\n\t\t$('#update-cart-in-selector, #update-purchase-confirmed-selector, #update-product-count-selector, #update-item-list-selector').on('click', function(){\n\t\t\tlet device = $('#device').val();\n\t\t\tlet selectorType = \"\";\n\t\t\tswitch ($(this).attr('id')) {\n\t\t\t\tcase 'update-cart-in-selector':\n\t\t\t\t\tselectorType = \"add_to_cart\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'update-purchase-confirmed-selector':\n\t\t\t\t\tselectorType = \"purchase_confirmed\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'update-item-list-selector':\n\t\t\t\t\tselectorType = \"item_list\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'update-product-count-selector':\n\t\t\t\t\tselectorType = \"product_count\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlet targetTable = $(this).parent('div').first().find('table');\n\t\t\tlet selectors = [];\n\t\t\ttargetTable.find('input').each(function(){\n\t\t\t\tif (this.value === \"\" || this.value.trim() === \"\") {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tselectors.push({['selector']: this.value});\n\t\t\t});\n\t\t\t\n\t\t\t$.ajax({\n\t\t\t\turl: \"/recommend_settings/update_selectors\",\n\t\t\t\ttype: 'post',\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: {\n\t\t\t\t\tdevice: device,\n\t\t\t\t\tselectors: selectors,\n\t\t\t\t\tselector_type: selectorType,\n\t\t\t\t},\n\t\t\t})\n\t\t\t.done(function(data){\n\t\t\t\tif (data['result'] === 'success'){\n\t\t\t\t\talert('登録しました');\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}else{\n\t\t\t\t\talert(data['message']);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.fail(function(data){\n\t\t\t\talert('登録に失敗しました');\n\t\t\t});\n\t\t});\n\t}\n});\n","document.addEventListener(\"turbolinks:load\", function() {\n editor = \"\";\n editor2 = \"\";\n\n if ($(\"#recommend_group_setting_element_css\").length > 0) {\n editor = ace.edit(\"recommend_group_setting_element_css\");\n editor.session.setMode(\"ace/mode/css\");\n editor.setTheme(\"ace/theme/twilight\");\n \n // タブのスペース数を設定\n editor.getSession().setTabSize(2);\n \n // セッションの変更時のイベントを監視\n editor.session.on('changeAnnotation', function() {\n let annotations = editor.session.getAnnotations() || [], i = len = annotations.length;\n while (i--) {\n if(/important/.test(annotations[i].text)) { // !importantに関する警告をチェック\n annotations.splice(i, 1);\n }\n }\n if (len > annotations.length) {\n editor.session.setAnnotations(annotations);\n }\n });\n }\n\n if ($(\"#recommend_group_setting_element_cart_opt_css\").length > 0) {\n editor2 = ace.edit(\"recommend_group_setting_element_cart_opt_css\");\n editor2.session.setMode(\"ace/mode/css\");\n editor2.setTheme(\"ace/theme/twilight\");\n \n // タブのスペース数を設定\n editor2.getSession().setTabSize(2);\n \n // セッションの変更時のイベントを監視\n editor2.session.on('changeAnnotation', function() {\n let annotations = editor2.session.getAnnotations() || [], i = len = annotations.length;\n while (i--) {\n if(/important/.test(annotations[i].text)) { // !importantに関する警告をチェック\n annotations.splice(i, 1);\n }\n }\n if (len > annotations.length) {\n editor2.session.setAnnotations(annotations);\n }\n });\n }\n \n\n $('.recommend_group_setting_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.recommend_group_setting_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.recommend_group_setting_slidedown_btn').fadeIn(0));\n });\n\n $('.recommend_group_setting_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.recommend_group_setting_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.recommend_group_setting_slideup_btn').fadeIn(0));\n });\n\n // ------------------------------------------------------------------------------------------------\n // レコメンド設定\n // ------------------------------------------------------------------------------------------------\n // #################################################################\n // レコメンド設定の切り替え\n // #################################################################\n $('.recommend_group_setting_selects').on('change', function () {\n const recommend_group_setting_type_data = $(\".recommend_group_setting_type_data\").data(\"setting_type\");\n let recommend_group_setting_id = $('.recommend_group_setting_selects option:selected').val();\n if (recommend_group_setting_id == 'new') {\n $('.recommend_group_setting_set_wrapper_display').css('display', 'block');\n $('.recommend_group_setting_name_setting_wrapper').css('display', 'none');\n $('.recommend_group_setting_device_setting_wrapper').css('display', 'none');\n $('.recommend_group_setting_show_valid_setting_wrapper').css('display', 'none');\n $('.recommend_group_setting_display_count_setting_wrapper').css('display', 'none');\n $('.recommend_group_setting_url_setting_wrapper').css('display', 'none');\n $('.recommend_group_setting_excluded_url_setting_wrapper').css('display', 'none');\n $('.recommend_group_setting_element_setting_wrapper').css('display', 'none');\n $('.recommend_group_setting_design_css_setting_wrapper').css('display', 'none');\n $('.recommend_group_setting_design_custom_setting_wrapper').css('display', 'none');\n $('.recommend_group_setting_slider_detail_wrapper').css('display', 'none');\n } else {\n if (recommend_group_setting_type_data == \"ITEM\"){\n location.href = `/recommend_group_setting/detail_index?recommend_group_setting_id=${recommend_group_setting_id}&setting_type=${recommend_group_setting_type_data}`;\n } else {\n location.href = `/recommend_group_setting?recommend_group_setting_id=${recommend_group_setting_id}&setting_type=${recommend_group_setting_type_data}`;\n }\n }\n });\n // #################################################################\n // レコメンド設定の新規作成\n // #################################################################\n $('#recommend_group_setting_create').on('click', function () {\n const recommend_group_setting_type_data = $(\".recommend_group_setting_type_data\").data(\"setting_type\");\n const name = $('.recommend_group_setting_input').val();\n\n if (!name) {\n alert('設定名を入力して下さい。');\n return;\n }\n\n $.ajax({\n url: '/recommend_group_setting/create_recommend_group_setting',\n type: 'POST',\n data: {\n name: name,\n setting_type: recommend_group_setting_type_data\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('新規登録されました。');\n\n if (recommend_group_setting_type_data == \"ITEM\"){\n location.href = `/recommend_group_setting/detail_index?recommend_group_setting_id=${data.recommend_group_id}&device=${data.is_device}&setting_type=${recommend_group_setting_type_data}`;\n } else {\n location.href = `/recommend_group_setting?recommend_group_setting_id=${data.recommend_group_id}&device=${data.is_device}&setting_type=${recommend_group_setting_type_data}`;\n }\n }\n });\n });\n\n // #################################################################\n // レコメンド設定名の編集\n // #################################################################\n $('#recommend_group_setting_name_edit_btn').on('click', function () {\n let recommend_group_setting_id = $('.recommend_group_setting_selects option:selected').val();\n let recommend_group_device_setting_id = $('.recommend_group_setting_device_selects:checked').data(\"recommend_group_setting_id\");\n let name = $('.recommend_group_setting_name_val').val();\n\n const recommend_group_setting_type_data = $(\".recommend_group_setting_type_data\").data(\"setting_type\");\n\n if (!name) {\n alert('名称を記入して下さい。');\n return;\n }\n\n $.ajax({\n url: '/recommend_group_setting/save_recommend_group_setting_name',\n type: 'POST',\n data: {\n recommend_group_device_setting_id: recommend_group_device_setting_id,\n recommend_group_setting_id: recommend_group_setting_id,\n name: name,\n setting_type: recommend_group_setting_type_data\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // レコメンド設定のデバイスの切り替え\n // #################################################################\n $('.recommend_group_setting_device_selects').on('change', function () {\n const recommend_group_setting_type_data = $(\".recommend_group_setting_type_data\").data(\"setting_type\");\n let recommend_group_setting_id = $('.recommend_group_setting_selects option:selected').val();\n let recommend_group_device_setting_id = $('.recommend_group_setting_device_selects:checked').data(\"recommend_group_setting_id\");\n\n if (recommend_group_setting_type_data == \"ITEM\"){\n location.href = `/recommend_group_setting/detail_index?recommend_group_setting_id=${recommend_group_setting_id}&recommend_group_device_setting_id=${recommend_group_device_setting_id}&setting_type=${recommend_group_setting_type_data}`;\n } else if (recommend_group_setting_type_data == \"USER\") {\n location.href = `/recommend_group_setting?recommend_group_setting_id=${recommend_group_setting_id}&recommend_group_device_setting_id=${recommend_group_device_setting_id}&setting_type=${recommend_group_setting_type_data}`;\n } else if (recommend_group_setting_type_data == \"CART\"){\n location.href = `/recommend_group_setting/cart_index?recommend_group_setting_id=${recommend_group_setting_id}&recommend_group_device_setting_id=${recommend_group_device_setting_id}&setting_type=${recommend_group_setting_type_data}`;\n }\n });\n\n // #################################################################\n // レコメンド設定の公開設定\n // #################################################################\n $('.recommend_group_setting_show_valid_select_box').on('change', function (event) {\n let recommend_group_setting_id = $('.recommend_group_setting_selects option:selected').val();\n let recommend_group_device_setting_id = $('.recommend_group_setting_device_selects:checked').data(\"recommend_group_setting_id\");\n let show_valid = $('.recommend_group_setting_show_valid_select_box:checked').val();\n\n const recommend_group_setting_type_data = $(\".recommend_group_setting_type_data\").data(\"setting_type\");\n\n $.ajax({\n url: '/recommend_group_setting/save_recommend_group_setting_show_valid',\n type: 'POST',\n data: {\n recommend_group_setting_id: recommend_group_setting_id,\n recommend_group_device_setting_id: recommend_group_device_setting_id,\n show_valid: show_valid,\n setting_type: recommend_group_setting_type_data\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // レコメンド設定名の編集\n // #################################################################\n $('#recommend_group_setting_display_count_edit_btn').on('click', function () {\n let recommend_group_setting_id = $('.recommend_group_setting_selects option:selected').val();\n let recommend_group_device_setting_id = $('.recommend_group_setting_device_selects:checked').data(\"recommend_group_setting_id\");\n let display_count = $('.recommend_group_setting_display_count_val').val();\n\n const recommend_group_setting_type_data = $(\".recommend_group_setting_type_data\").data(\"setting_type\");\n\n if (!display_count) {\n alert('名称を記入して下さい。');\n return;\n }\n\n $.ajax({\n url: '/recommend_group_setting/save_recommend_group_setting_display_count',\n type: 'POST',\n data: {\n recommend_group_device_setting_id: recommend_group_device_setting_id,\n display_count: display_count,\n setting_type: recommend_group_setting_type_data\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 要素の挿入先の設定\n // #################################################################\n $('#recommend_group_setting_element_set').on('click', function () {\n let recommend_group_setting_id = $('.recommend_group_setting_selects option:selected').val();\n let recommend_group_device_setting_id = $('.recommend_group_setting_device_selects:checked').data(\"recommend_group_setting_id\");\n\n const recommend_group_setting_type_data = $(\".recommend_group_setting_type_data\").data(\"setting_type\");\n\n let element_id_val = $('#element_id_input').val();\n let element_class_val = $('#element_class_input').val();\n let element_index_val = $('#element_index_input').val();\n let parent_id_val = $('#parent_id_input').val();\n let parent_class_val = $('#parent_class_input').val();\n let parent_index_val = $('#parent_index_input').val();\n let grand_id_val = $('#grand_id_input').val();\n let grand_class_val = $('#grand_class_input').val();\n let grand_index_val = $('#grand_index_input').val();\n let great_grand_id_val = $('#great_grand_id_input').val();\n let great_grand_class_val = $('#great_grand_class_input').val();\n let recommend_group_setting_element_placement = $('.recommend_group_setting_list .recommend_group_setting_placement option:selected').val();\n\n $.ajax({\n url: '/recommend_group_setting/create_recommend_group_setting_element',\n type: 'POST',\n data: {\n recommend_group_setting_id: recommend_group_setting_id,\n recommend_group_device_setting_id: recommend_group_device_setting_id,\n element_id: element_id_val,\n element_class: element_class_val,\n element_index: element_index_val,\n parent_id: parent_id_val,\n parent_class: parent_class_val,\n parent_index: parent_index_val,\n grand_id: grand_id_val,\n grand_class: grand_class_val,\n grand_index: grand_index_val,\n great_grand_id: great_grand_id_val,\n great_grand_class: great_grand_class_val,\n element_placement: recommend_group_setting_element_placement,\n setting_type: recommend_group_setting_type_data\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // スライダー詳細設定\n // #################################################################\n $('#recommend_group_setting_slider_detail_set').on('click', function () {\n let recommend_group_setting_id = $('.recommend_group_setting_selects option:selected').val();\n let recommend_group_device_setting_id = $('.recommend_group_setting_device_selects:checked').data(\"recommend_group_setting_id\");\n\n const recommend_group_setting_type_data = $(\".recommend_group_setting_type_data\").data(\"setting_type\");\n\n let sw_navigation_flag_val = $('.recommend_group_setting_slider_detail_list .sw_navigation_flag_select option:selected').val();\n let sw_pagination_flag_val = $('.recommend_group_setting_slider_detail_list .sw_pagination_flag_select option:selected').val();\n let sw_slides_per_view_val = $('#sw_slides_per_view_input').val();\n let sw_slides_per_group_val = $('#sw_slides_per_group_input').val();\n let sw_grid_rows_val = $('#sw_grid_rows_input').val();\n let sw_space_between_val = $('#sw_space_between_input').val();\n let sw_loop_flag_val = $('.recommend_group_setting_slider_detail_list .sw_loop_flag_select option:selected').val();\n\n $.ajax({\n url: '/recommend_group_setting/create_recommend_group_setting_slider_detail',\n type: 'POST',\n data: {\n recommend_group_setting_id: recommend_group_setting_id,\n recommend_group_device_setting_id: recommend_group_device_setting_id,\n sw_navigation_flag: sw_navigation_flag_val,\n sw_pagination_flag: sw_pagination_flag_val,\n sw_slides_per_group: sw_slides_per_group_val,\n sw_slides_per_view: sw_slides_per_view_val,\n sw_grid_rows: sw_grid_rows_val,\n sw_space_between: sw_space_between_val,\n sw_loop_flag: sw_loop_flag_val,\n setting_type: recommend_group_setting_type_data\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // slider css設定\n // #################################################################\n $('#recommend_group_setting_element_css_set').on('click', function () {\n let recommend_group_setting_id = $('.recommend_group_setting_selects option:selected').val();\n let recommend_group_device_setting_id = $('.recommend_group_setting_device_selects:checked').data(\"recommend_group_setting_id\");\n\n const recommend_group_setting_type_data = $(\".recommend_group_setting_type_data\").data(\"setting_type\");\n\n let css_val = editor.getValue();\n console.log(css_val);\n\n // let css_val = $('#recommend_group_setting_element_css').val();\n\n // 禁止された単語のリスト\n const forbiddenWords = ['', '', 'javascript'];\n\n // CSSの値に禁止された単語が含まれているかチェック\n let containsForbiddenWord = forbiddenWords.some(word => css_val.includes(word));\n\n if (containsForbiddenWord) {\n alert('不正なコードが混ざっています。');\n return;\n }\n\n $.ajax({\n url: '/recommend_group_setting/create_recommend_group_setting_css',\n type: 'POST',\n data: {\n recommend_group_setting_id: recommend_group_setting_id,\n recommend_group_device_setting_id: recommend_group_device_setting_id,\n css_val: css_val,\n setting_type: recommend_group_setting_type_data\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // slider css設定\n // #################################################################\n $('#recommend_group_setting_element_cart_opt_css_set').on('click', function () {\n let recommend_group_setting_id = $('.recommend_group_setting_selects option:selected').val();\n let recommend_group_device_setting_id = $('.recommend_group_setting_device_selects:checked').data(\"recommend_group_setting_id\");\n\n const recommend_group_setting_type_data = $(\".recommend_group_setting_type_data\").data(\"setting_type\");\n\n let css_val = editor2.getValue();\n console.log(css_val);\n\n // let css_val = $('#recommend_group_setting_element_css').val();\n\n // 禁止された単語のリスト\n const forbiddenWords = ['', '', 'javascript'];\n\n // CSSの値に禁止された単語が含まれているかチェック\n let containsForbiddenWord = forbiddenWords.some(word => css_val.includes(word));\n\n if (containsForbiddenWord) {\n alert('不正なコードが混ざっています。');\n return;\n }\n\n $.ajax({\n url: '/recommend_group_setting/create_recommend_group_setting_cart_opt_css',\n type: 'POST',\n data: {\n recommend_group_setting_id: recommend_group_setting_id,\n recommend_group_device_setting_id: recommend_group_device_setting_id,\n css_val: css_val,\n setting_type: recommend_group_setting_type_data\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // デザイン設定(共通部分)の設定\n // #################################################################\n $('#current_recommend_group_common_style_set').on('click', function () {\n let recommend_group_setting_id = $('.recommend_group_setting_selects option:selected').val();\n let recommend_group_device_setting_id = $('.recommend_group_setting_device_selects:checked').data(\"recommend_group_setting_id\");\n\n const recommend_group_setting_type_data = $(\".recommend_group_setting_type_data\").data(\"setting_type\");\n\n let values = {\n 'recommend_group_setting_id': Number(recommend_group_setting_id),\n 'recommend_group_device_setting_id': recommend_group_device_setting_id,\n 'setting_type': recommend_group_setting_type_data\n };\n\n $('.recommend_group_common_val').each(function() {\n let id = $(this).attr('id');\n let value = $(this).val();\n values[id] = value;\n });\n\n $.ajax({\n url: '/recommend_group_setting/update_recommend_group_common_style',\n type: 'POST',\n data: values,\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // デザイン設定(共通部分)の設定\n // #################################################################\n $('#current_recommend_group_slider_style_set').on('click', function () {\n let recommend_group_setting_id = $('.recommend_group_setting_selects option:selected').val();\n let recommend_group_device_setting_id = $('.recommend_group_setting_device_selects:checked').data(\"recommend_group_setting_id\");\n\n const recommend_group_setting_type_data = $(\".recommend_group_setting_type_data\").data(\"setting_type\");\n\n let values = {\n 'recommend_group_setting_id': Number(recommend_group_setting_id),\n 'recommend_group_device_setting_id': recommend_group_device_setting_id,\n 'setting_type': recommend_group_setting_type_data\n };\n\n $('.recommend_group_slider_val').each(function() {\n let id = $(this).attr('id');\n let value = $(this).val();\n values[id] = value;\n });\n\n $.ajax({\n url: '/recommend_group_setting/update_recommend_group_slider_style',\n type: 'POST',\n data: values,\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // デザイン設定(共通部分)の設定\n // #################################################################\n $('#current_recommend_group_part_style_set').on('click', function () {\n let recommend_group_setting_id = $('.recommend_group_setting_selects option:selected').val();\n let recommend_group_device_setting_id = $('.recommend_group_setting_device_selects:checked').data(\"recommend_group_setting_id\");\n\n const recommend_group_setting_type_data = $(\".recommend_group_setting_type_data\").data(\"setting_type\");\n\n let values = {\n 'recommend_group_setting_id': Number(recommend_group_setting_id),\n 'recommend_group_device_setting_id': recommend_group_device_setting_id,\n 'setting_type': recommend_group_setting_type_data\n };\n\n $('.recommend_group_part_val').each(function() {\n let id = $(this).attr('id');\n let value = $(this).val();\n values[id] = value;\n });\n\n $.ajax({\n url: '/recommend_group_setting/update_recommend_group_part_style',\n type: 'POST',\n data: values,\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // レコメンド設定の表示URL設定\n // #################################################################\n $('#recommend_group_setting_url_add_input').on('click', function () {\n $(this)\n .parents('table')\n .append(\n `\n \n \n \n \n \n
\n \n \n \n
\n \n `\n );\n $('.recommend_group_setting_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n $('.recommend_group_setting_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n\n $('#recommend_group_setting_url_set').on('click', function () {\n const recommend_group_setting_type_data = $(\".recommend_group_setting_type_data\").data(\"setting_type\");\n let recommend_group_setting_id = $('.recommend_group_setting_selects option:selected').val();\n let urls = [];\n $('.recommend_group_setting_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/recommend_group_setting/set_recommend_group_setting_url',\n type: 'POST',\n data: {\n setting_type: recommend_group_setting_type_data,\n recommend_group_setting_id: recommend_group_setting_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // レコメンド設定の除外URL設定\n // #################################################################\n $('#recommend_group_setting_excluded_url_add_input').on('click', function () {\n $(this)\n .parents('table')\n .append(\n `\n \n \n \n \n \n
\n \n \n \n
\n \n `\n );\n $('.recommend_group_setting_excluded_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n $('.recommend_group_setting_excluded_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n\n $('#recommend_group_setting_excluded_url_set').on('click', function () {\n const recommend_group_setting_type_data = $(\".recommend_group_setting_type_data\").data(\"setting_type\");\n let recommend_group_setting_id = $('.recommend_group_setting_selects option:selected').val();\n let urls = [];\n $('.recommend_group_setting_excluded_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/recommend_group_setting/set_recommend_group_setting_excluded_url',\n type: 'POST',\n data: {\n setting_type: recommend_group_setting_type_data,\n recommend_group_setting_id: recommend_group_setting_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n\n // ------------------------------------------------------------------------------------------------\n // レコメンド\n // ------------------------------------------------------------------------------------------------\n $('.recommend_metric_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.recommend_metric_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.recommend_metric_slidedown_btn').fadeIn(0));\n });\n\n $('.recommend_metric_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.recommend_metric_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.recommend_metric_slideup_btn').fadeIn(0));\n });\n\n // ------------------------------------------------------------------------------------------------\n // レコメンド\n // ------------------------------------------------------------------------------------------------\n function recommend_group_update_url() {\n const recommend_group_setting_id = $('#recommend_metric_selects option:selected').val();\n const gf = $('#recommend_metric_graph_pattern_select_input').val();\n const start_day = $('#recommend_metric_report_start_day').val();\n const end_day = $('#recommend_metric_report_end_day').val();\n const device = $('.recommend_metric_device_select').data(\"device\");\n\n let url = new URL(window.location.href);\n let params = url.searchParams;\n\n if (recommend_group_setting_id !== 'none' && recommend_group_setting_id !== null && recommend_group_setting_id !== undefined) {\n params.set('recommend_group_setting_id', recommend_group_setting_id);\n } else {\n params.delete('recommend_group_setting_id');\n }\n\n if (gf) {\n params.set('gf', gf);\n } else {\n params.delete('gf');\n }\n\n if (device == \"0\" || device == \"1\" || device == \"2\") {\n params.set('device', device);\n } else {\n params.delete('device');\n }\n\n if (gf === '12') {\n params.delete('start_day');\n params.delete('end_day');\n } else { // このelseブロックを追加\n if (start_day) {\n params.set('start_day', start_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n\n if (end_day) {\n params.set('end_day', end_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n }\n\n url.search = params.toString();\n location.href = url.toString();\n }\n\n // #################################################################\n // レコメンドコメンドューの選択\n // #################################################################\n $('#recommend_metric_selects').on('change', function () {\n recommend_group_update_url();\n });\n\n // #################################################################\n // 日毎、月毎のグラフ切り替え\n // #################################################################\n $('.recommend_metric_graph_pattern_select_day, .recommend_metric_graph_pattern_select_month').on('click', function () {\n const gf_value = $(this).data('gf');\n $('#recommend_metric_graph_pattern_select_input').val(gf_value);\n recommend_group_update_url();\n });\n\n // #################################################################\n // デバイスごとのグラフ切り替え\n // #################################################################\n $('.recommend_metric_device_select_all, .recommend_metric_device_select_pc, .recommend_metric_device_select_phone').on('click', function () {\n const device = $(this).data('device');\n $('.recommend_metric_device_select').data(\"device\", device);\n recommend_group_update_url();\n });\n\n // #################################################################\n // 範囲選択によるグラフ切り替え\n // #################################################################\n $('#recommend_metric_report_start_day, #recommend_metric_report_end_day').on('change', function () {\n recommend_group_update_url();\n });\n\n // #################################################################\n // レコメンドグデータのみの削除\n // #################################################################\n $('.delete_recommend_metric_log_data').on('click', function () {\n if (!confirm('本当に削除を実行しますか?')) {\n return;\n }\n const recommend_group_setting_id = $('#recommend_metric_selects option:selected').val();\n\n $.ajax({\n url: '/recommend_group_report/delete_recommend_group_log',\n type: 'POST',\n data: {\n recommend_group_setting_id: recommend_group_setting_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('削除が完了しました。');\n location.reload();\n }\n });\n });\n\n // #################################################################\n // レコメンドグデータと関連するデータ全ての削除\n // #################################################################\n $('.delete_recommend_metric_log_data_and_related_data').on('click', function () {\n if (!confirm('本当に完全削除を実行しますか?')) {\n return;\n }\n const recommend_group_setting_id = $('#recommend_metric_selects option:selected').val();\n\n $.ajax({\n url: '/recommend_group_report/delete_recommend_group_log_and_related_data',\n type: 'POST',\n data: {\n recommend_group_setting_id: recommend_group_setting_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('削除が完了しました。');\n location.href = '/recommend_group_report/index';\n }\n });\n });\n\n // #################################################################\n // レコメンドポートのcsv出力\n // #################################################################\n $('#download_recommend_metric_csv').on('click', function () {\n const recommend_group_setting_id = $('#recommend_metric_selects option:selected').val();\n const month = $('#ua_recommend_metric_month_selects option:selected').val();\n\n let href = '/download_recommend_metric_csv';\n\n href += `?recommend_group_setting_id=${recommend_group_setting_id}`;\n href += `&m=${month}`;\n location.href = href;\n });\n\n $('#ua_recommend_metric_month_selects').on('change', function () {\n let month = $('#ua_recommend_metric_month_selects option:selected').val();\n let url = new URL(window.location.href);\n\n if (month != '') {\n if (url.searchParams.has('m')) {\n // 値が \"0\"か\"1\" なら \"2\" に更新する\n let new_value = month;\n // パラメーターの値を更新する\n url.searchParams.set('m', new_value);\n } else {\n // パラメーターにdeviceがない場合\n // 新しいパラメーターを追加する\n url.searchParams.append('m', month);\n }\n\n // 更新されたURLにリダイレクトする\n location.href = url.toString();\n } else {\n // monthが空文字の時は指定したURLにリダイレクトする\n location.reload();\n }\n });\n});","document.addEventListener(\"turbolinks:load\", function() {\n let editor = null;\n\n if ( $('#recommend-search-setting-wrapper').length ) {\n\n /**\n * 公開・非公開切り替え\n */\n $('#update-recommend-search-toggle').on('click', function(){\n let caller = $(this);\n caller.css('pointer-events', 'none');\n $.ajax({\n url: '/recommend_search_setting/update_recommend_search_setting_show_valid',\n type: 'post',\n dataType: 'json',\n data: {\n id: $('#recommend-search-setting-id').val(),\n show_valid: $('#recommend-search-toggle-public').prop('checked') ? 1 : 0,\n },\n })\n .done(function(data){\n if (data.ret == 0){\n alert('登録しました');\n location.reload();\n }else{\n alert(data['message']);\n }\n })\n .fail(function(){\n alert('登録に失敗しました');\n });\n caller.css('pointer-events', 'auto');\n });\n\n /**\n * URL行の追加ボタンイベント\n * クリックされたボタンの親要素のtableの最後のtrを複製する\n */\n $('.url-add').on('click', function(){\n let table = $(this).parent('div').first().find('table')\n let tr = table.find('tr:last').clone();\n let input = tr.find('input');\n input.val('');\n input.attr('data-id', '');\n if (tr.find('.url-del').length) {\n tr.find('.url-del').removeClass('hidden');\n }else{\n let td = $(`
削除
`);\n tr.append(td);\n }\n table.append(tr);\n resetInputRemove();\n });\n\n // URL行の削除ボタンイベント再設定\n function resetInputRemove(){\n $('.url-del').off().on('click', function(){\n $(this).closest('tr').remove();\n });\n }\n resetInputRemove();\n\n\n /**\n * 表示URLの保存イベント\n */\n $('#update-recommend-search-setting-url').on('click', function(){\n let caller = $(this);\n caller.css('pointer-events', 'none');\n // #urls 内のデータをオブジェクトに変換\n // - idはdata-id属性に格納\n // - valueはinput要素の値\n let urls = [];\n let urlInputs = $('#urls').find('input');\n urlInputs.each(function(index, input) {\n // urlが空 or trimで空文字になる場合はスキップ\n if ($(input).val() === '' || $(input).val().trim() === '') {\n return true;\n }\n let id = $(input).attr('data-id');\n urls.push({\n id: id,\n url: $(input).val()\n });\n });\n // POST\n $.ajax({\n url: '/recommend_search_setting/update_recommend_search_setting_url',\n type: 'post',\n dataType: 'json',\n data: {\n recommend_search_setting_id: $('#recommend-search-setting-id').val(),\n urls: urls,\n },\n })\n .done(function(data){\n if (data['result'] === 'success'){\n alert('登録しました');\n location.reload();\n }else{\n alert(data['message']);\n }\n })\n .fail(function(){\n alert('登録に失敗しました');\n });\n caller.css('pointer-events', 'auto');\n });\n\n /**\n * 除外URLの保存イベント\n */\n $('#update-recommend-search-setting-excluded-url').on('click', function(){\n let caller = $(this);\n caller.css('pointer-events', 'none');\n // #excluded-urls 内のデータをオブジェクトに変換\n // - idはdata-id属性に格納\n // - valueはinput要素の値\n let excludedUrls = [];\n let excludedUrlInputs = $('#excluded-urls').find('input');\n excludedUrlInputs.each(function(index, input) {\n // urlが空 or trimで空文字になる場合はスキップ\n if ($(input).val() === '' || $(input).val().trim() === '') {\n return true;\n }\n let id = $(input).attr('data-id');\n excludedUrls.push({\n id: id,\n url: $(input).val()\n });\n });\n // POST\n $.ajax({\n url: '/recommend_search_setting/update_recommend_search_setting_excluded_url',\n type: 'post',\n dataType: 'json',\n data: {\n recommend_search_setting_id: $('#recommend-search-setting-id').val(),\n urls: excludedUrls,\n },\n })\n .done(function(data){\n if (data['result'] === 'success'){\n alert('登録しました');\n location.reload();\n }else{\n alert(data['message']);\n }\n })\n .fail(function(){\n alert('登録に失敗しました');\n });\n caller.css('pointer-events', 'auto');\n });\n\n /**\n * 要素セレクタの保存イベント\n */\n $('#update-recommend-search-setting-selector').on('click', function(){\n let caller = $(this);\n caller.css('pointer-events', 'none');\n // POST\n $.ajax({\n url: '/recommend_search_setting/update_recommend_search_setting_selector',\n type: 'post',\n dataType: 'json',\n data: {\n recommend_search_setting_id: $('#recommend-search-setting-id').val(),\n search_element_selector: $('#search-element-selector').val(),\n append_element_selector: $('#append-element-selector').val(),\n },\n })\n .done(function(data){\n if (data['result'] === 'success'){\n alert('登録しました');\n location.reload();\n }else{\n alert(data['message']);\n }\n })\n .fail(function(){\n alert('登録に失敗しました');\n });\n caller.css('pointer-events', 'auto');\n });\n\n\n /**\n * 表示数の設定\n */\n $('#update-recommend-search-setting-count').on('click', function(){\n let caller = $(this);\n caller.css('pointer-events', 'none');\n let matchItemCount = $('#match-item-count').val();\n let recommendItemCount = $('#recommend-item-count').val();\n if (matchItemCount < 0 || matchItemCount.trim() === '') {\n alert('キーワードマッチした商品の表示数を入力してください');\n caller.css('pointer-events', 'auto');\n return false;\n }\n if (recommendItemCount < 0 || recommendItemCount.trim() === '') {\n alert('レコメンドされた商品の表示数を入力してください');\n caller.css('pointer-events', 'auto');\n return false;\n }\n // POST\n $.ajax({\n url: '/recommend_search_setting/update_recommend_search_setting_item_count',\n type: 'post',\n dataType: 'json',\n data: {\n id: $('#recommend-search-setting-id').val(),\n match_item_count: matchItemCount,\n recommend_item_count: recommendItemCount,\n },\n })\n .done(function(data){\n if (data['ret'] === 0){\n alert('登録しました');\n location.reload();\n }else{\n alert(data['message']);\n }\n })\n .fail(function(){\n alert('登録に失敗しました');\n });\n caller.css('pointer-events', 'auto');\n });\n\n\n /**\n * CSS設定画面の設定\n * aceを使用してエディタを表示\n */\n editor = ace.edit(\"recommend-search-css\");\n editor.session.setMode(\"ace/mode/css\");\n editor.setTheme(\"ace/theme/twilight\");\n\n // タブのスペース数を設定\n editor.getSession().setTabSize(2);\n\n // セッションの変更時のイベントを監視\n editor.session.on('changeAnnotation', function() {\n let annotations = editor.session.getAnnotations() || [], i = len = annotations.length;\n while (i--) {\n if(/important/.test(annotations[i].text)) { // !importantに関する警告をチェック\n annotations.splice(i, 1);\n }\n }\n if (len > annotations.length) {\n editor.session.setAnnotations(annotations);\n }\n });\n\n $('#update-recommend-search-css').on('click', function () {\n let caller = $(this);\n caller.css('pointer-events', 'none');\n let cssVal = editor.getValue();\n\n $.ajax({\n url: 'recommend_search_setting/update_css_property',\n type: 'POST',\n data: {\n id: $('#recommend-search-setting-id').val(),\n css_val: cssVal,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n if (data.message!='') {\n alert(data.message);\n } else {\n alert('登録しました');\n }\n location.reload();\n } else {\n alert(data.message);\n }\n })\n .fail(function(){\n alert('登録に失敗しました');\n });\n caller.css('pointer-events', 'auto');\n });\n\n\n /**\n * 汎用的な保存イベントのテスト\n * 要素のdata-*属性にルールを適応\n * - data-type: \"form\" ... データ収集の起点となる親要素とする\n * - data-type: \"submit\" ... クリックイベントを設定する対象\n * - data-type: \"column\" ... 保存対象の要素に設定。data-column属性に保存するカラム名を格納\n * - data-column: \"column_name\" ... 保存するカラム名\n * - data-validation: \"hoge fuga\" ... バリデーションルールを指定。半角スペースで区切ることで複数指定可能\n * ユースケース\n * 1. data-type=\"submit\"の要素をクリック\n * 2. 1の一番近い親要素(data-type=\"form\")を取得\n * 3. 2の子要素のうちdata-type=\"column\"の要素を取得\n * 4. 3の要素のdata-column属性の値をカラム名として、dataをPOSTする\n */\n function updateAttribute() {\n let caller = $(this);\n caller.css('pointer-events', 'none');\n let parentElement = caller.closest('[data-type=\"form\"]');\n let data = {};\n let inputs = parentElement.find('[data-type=\"column\"]');\n inputs.each(function(index, input) {\n let column = $(input).data('column');\n let value = $(input).val();\n data[column] = value;\n });\n $.ajax({\n url: caller.attr('data-url'),\n type: 'post',\n dataType: 'json',\n data: {\n id: $('#recommend-search-setting-id').val(),\n data: data\n },\n })\n .done(function(data){\n if (data['result'] === 'success'){\n alert('登録しました');\n location.reload();\n }else{\n alert(data['message']);\n }\n })\n .fail(function(){\n alert('登録に失敗しました');\n });\n caller.css('pointer-events', 'auto');\n }\n // 登録ボタンのイベント設定\n $('[data-type=\"submit\"]').on('click', updateAttribute);\n\n\n /**\n * バリデーションルール定義\n * @param targetElement {HTMLElement} - バリデーションを設定する要素\n * @param rule {string} - バリデーションの種類\n */\n function validation(targetElement, rule) {\n // スペースでsplitして複数指定にも対応させる\n let rules = rule.split(' ');\n rules.each(function(index, rule) {\n switch (rule) {\n case 'required':\n if (targetElement.val() === '' || targetElement.val().trim() === '' || targetElement.val() === null || targetElement.val() === undefined) {\n alert('必須項目です');\n return false;\n }\n break;\n\n default:\n break;\n }\n });\n }\n\n\n } // page check end\n});\n","document.addEventListener(\"turbolinks:load\", function() {\n\n $('.recommend_tuning_setting_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.recommend_tuning_setting_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.recommend_tuning_setting_slidedown_btn').fadeIn(0));\n });\n\n $('.recommend_tuning_setting_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.recommend_tuning_setting_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.recommend_tuning_setting_slideup_btn').fadeIn(0));\n });\n\n // #################################################################\n // チューニングの設定\n // #################################################################\n function setupChangeHandler(selectors, setting_name) {\n $(selectors).on('change', function () {\n let val = Math.abs($(this).val());\n\n $.ajax({\n url: '/recommend_tuning_setting/save_range',\n type: 'POST',\n data: { \n setting_name: setting_name,\n value: val\n },\n dataType: 'json',\n }).done(function (data) {\n $(selectors).val(val);\n });\n });\n }\n\n setupChangeHandler('#weight_high_popularity_range, #weight_high_popularity', 'weight_high_popularity');\n setupChangeHandler('#weight_low_popularity_range, #weight_low_popularity', 'weight_low_popularity');\n setupChangeHandler('#weight_new_and_restocked_range, #weight_new_and_restocked', 'weight_new_and_restocked');\n setupChangeHandler('#weight_high_stock_range, #weight_high_stock', 'weight_high_stock');\n setupChangeHandler('#weight_low_stock_range, #weight_low_stock', 'weight_low_stock');\n setupChangeHandler('#weight_discounted_range, #weight_discounted', 'weight_discounted');\n setupChangeHandler('#weight_recommended_range, #weight_recommended', 'weight_recommended');\n});","document.addEventListener(\"turbolinks:load\", function() {\n\n editor = \"\";\n\n if ($(\"#recommend-retargeting-html\").length > 0) {\n editor = ace.edit(\"recommend-retargeting-html\");\n editor.session.setMode(\"ace/mode/html\");\n editor.setTheme(\"ace/theme/twilight\");\n \n // タブのスペース数を設定\n editor.getSession().setTabSize(2);\n \n // セッションの変更時のイベントを監視\n editor.session.on('changeAnnotation', function() {\n let annotations = editor.session.getAnnotations() || [], i = len = annotations.length;\n while (i--) {\n if(/important/.test(annotations[i].text)) { // !importantに関する警告をチェック\n annotations.splice(i, 1);\n }\n }\n if (len > annotations.length) {\n editor.session.setAnnotations(annotations);\n }\n });\n }\n\n // #################################################################\n // リターゲティング設定の公開/非公開設定\n // #################################################################\n $('.recommend_retargeting_setting_show_valid_selects').on('change', function (event) {\n let recommend_retargeting_setting_id = $('#recommend-retargeting-setting-id').val();\n let show_valid = $('.recommend_retargeting_setting_show_valid_selects:checked').val();\n\n $.ajax({\n url: '/recommend_retargeting_setting/update_recommend_retargeting_setting_show_valid',\n type: 'POST',\n data: {\n id: recommend_retargeting_setting_id,\n show_valid: show_valid\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // リターゲティング設定のフリークエンシー設定\n // #################################################################\n $('#recommend-retargeting-days-after-purchase').on('change', function (event) {\n let recommend_retargeting_setting_id = $('#recommend-retargeting-setting-id').val();\n let days_after_purchase = $('#recommend-retargeting-days-after-purchase').val();\n\n $.ajax({\n url: '/recommend_retargeting_setting/update_recommend_retargeting_setting_days_after_purchase',\n type: 'POST',\n data: {\n id: recommend_retargeting_setting_id,\n days_after_purchase: days_after_purchase\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n \n // #################################################################\n // リターゲティング設定の表示URL設定\n // #################################################################\n $('#recommend_retargeting_setting_url_add_input').on('click', function () {\n $(this)\n .parents('table')\n .append(\n `\n \n \n \n \n \n
\n \n \n \n
\n \n `\n );\n $('.recommend_retargeting_setting_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n $('.recommend_retargeting_setting_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n\n $('#recommend_retargeting_setting_url_set').on('click', function () {\n let recommend_retargeting_setting_id = $('#recommend-retargeting-setting-id').val();\n let urls = [];\n $('.recommend_retargeting_setting_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/recommend_retargeting_setting/set_recommend_retargeting_setting_url',\n type: 'POST',\n data: {\n recommend_retargeting_setting_id: recommend_retargeting_setting_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n\n // #################################################################\n // リターゲティング設定の表示URL設定\n // #################################################################\n $('#recommend_retargeting_setting_excluded_url_input').on('click', function () {\n $(this)\n .parents('table')\n .append(\n `\n \n \n \n \n \n
\n \n \n \n
\n \n `\n );\n $('.recommend_retargeting_setting_excluded_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n $('.recommend_retargeting_setting_excluded_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n\n $('#recommend_retargeting_setting_excluded_url_set').on('click', function () {\n let recommend_retargeting_setting_id = $('#recommend-retargeting-setting-id').val();\n let urls = [];\n $('.recommend_retargeting_setting_excluded_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/recommend_retargeting_setting/set_recommend_retargeting_setting_excluded_url',\n type: 'POST',\n data: {\n recommend_retargeting_setting_id: recommend_retargeting_setting_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // リターゲティング設定のHTML設定\n // #################################################################\n $('#update-recommend-retargeting-html').on('click', function () {\n let caller = $(this);\n caller.css('pointer-events', 'none');\n let htmlVal = editor.getValue();\n\n $.ajax({\n url: '/recommend_retargeting_setting/update_retargeting_html_property',\n type: 'POST',\n data: {\n id: $('#recommend-retargeting-setting-id').val(),\n html_val: htmlVal,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n if (data.message!='') {\n alert(data.message);\n } else {\n alert('登録しました');\n }\n location.reload();\n } else {\n alert(data.message);\n }\n })\n .fail(function(){\n alert('登録に失敗しました');\n });\n caller.css('pointer-events', 'auto');\n });\n\n // ------------------------------------------------------------------------------------------------\n // 分析\n // ------------------------------------------------------------------------------------------------\n function recommend_retargeting_update_url() {\n const recommend_retargeting_setting_id = $('#recommend_retargeting_metric_selects option:selected').val();\n const gf = $('#recommend_retargeting_metric_graph_pattern_select_input').val();\n const start_day = $('#recommend_retargeting_metric_report_start_day').val();\n const end_day = $('#recommend_retargeting_metric_report_end_day').val();\n const device = $('.recommend_retargeting_metric_device_select').data(\"device\");\n\n let url = new URL(window.location.href);\n let params = url.searchParams;\n\n if (recommend_retargeting_setting_id !== 'none' && recommend_retargeting_setting_id !== null && recommend_retargeting_setting_id !== undefined) {\n params.set('recommend_retargeting_setting_id', recommend_retargeting_setting_id);\n } else {\n params.delete('recommend_retargeting_setting_id');\n }\n\n if (gf) {\n params.set('gf', gf);\n } else {\n params.delete('gf');\n }\n\n if (device == \"0\" || device == \"1\" || device == \"2\") {\n params.set('device', device);\n } else {\n params.delete('device');\n }\n\n if (gf === '12') {\n params.delete('start_day');\n params.delete('end_day');\n } else { // このelseブロックを追加\n if (start_day) {\n params.set('start_day', start_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n\n if (end_day) {\n params.set('end_day', end_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n }\n\n url.search = params.toString();\n location.href = url.toString();\n }\n\n // #################################################################\n // レコメンドコメンドューの選択\n // #################################################################\n $('#recommend_retargeting_metric_selects').on('change', function () {\n recommend_retargeting_update_url();\n });\n\n // #################################################################\n // 日毎、月毎のグラフ切り替え\n // #################################################################\n $('.recommend_retargeting_metric_graph_pattern_select_day, .recommend_retargeting_metric_graph_pattern_select_month').on('click', function () {\n const gf_value = $(this).data('gf');\n $('#recommend_retargeting_metric_graph_pattern_select_input').val(gf_value);\n recommend_retargeting_update_url();\n });\n\n // #################################################################\n // デバイスごとのグラフ切り替え\n // #################################################################\n $('.recommend_retargeting_metric_device_select_all, .recommend_retargeting_metric_device_select_pc, .recommend_retargeting_metric_device_select_phone').on('click', function () {\n const device = $(this).data('device');\n $('.recommend_retargeting_metric_device_select').data(\"device\", device);\n recommend_retargeting_update_url();\n });\n\n // #################################################################\n // 範囲選択によるグラフ切り替え\n // #################################################################\n $('#recommend_retargeting_metric_report_start_day, #recommend_retargeting_metric_report_end_day').on('change', function () {\n recommend_retargeting_update_url();\n });\n\n // #################################################################\n // レコメンドグデータのみの削除\n // #################################################################\n $('.delete_recommend_retargeting_metric_log_data').on('click', function () {\n if (!confirm('本当に削除を実行しますか?')) {\n return;\n }\n const recommend_retargeting_setting_id = $('#recommend_retargeting_metric_selects option:selected').val();\n\n $.ajax({\n url: '/recommend_retargeting_report/delete_recommend_retargeting_log',\n type: 'POST',\n data: {\n recommend_retargeting_setting_id: recommend_retargeting_setting_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('削除が完了しました。');\n location.reload();\n }\n });\n });\n\n // #################################################################\n // レコメンドグデータと関連するデータ全ての削除\n // #################################################################\n $('.delete_recommend_retargeting_metric_log_data_and_related_data').on('click', function () {\n if (!confirm('本当に完全削除を実行しますか?')) {\n return;\n }\n const recommend_retargeting_setting_id = $('#recommend_retargeting_metric_selects option:selected').val();\n\n $.ajax({\n url: '/recommend_retargeting_report/delete_recommend_retargeting_log_and_related_data',\n type: 'POST',\n data: {\n recommend_retargeting_setting_id: recommend_retargeting_setting_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('削除が完了しました。');\n location.href = '/recommend_retargeting_report/index';\n }\n });\n });\n\n // #################################################################\n // レコメンドポートのcsv出力\n // #################################################################\n $('#download_recommend_retargeting_metric_csv').on('click', function () {\n const recommend_retargeting_setting_id = $('#recommend_retargeting_metric_selects option:selected').val();\n const month = $('#ua_recommend_retargeting_metric_month_selects option:selected').val();\n\n let href = '/download_recommend_retargeting_metric_csv';\n\n href += `?recommend_retargeting_setting_id=${recommend_retargeting_setting_id}`;\n href += `&m=${month}`;\n location.href = href;\n });\n\n $('#ua_recommend_retargeting_metric_month_selects').on('change', function () {\n let month = $('#ua_recommend_retargeting_metric_month_selects option:selected').val();\n let url = new URL(window.location.href);\n\n if (month != '') {\n if (url.searchParams.has('m')) {\n // 値が \"0\"か\"1\" なら \"2\" に更新する\n let new_value = month;\n // パラメーターの値を更新する\n url.searchParams.set('m', new_value);\n } else {\n // パラメーターにdeviceがない場合\n // 新しいパラメーターを追加する\n url.searchParams.append('m', month);\n }\n\n // 更新されたURLにリダイレクトする\n location.href = url.toString();\n } else {\n // monthが空文字の時は指定したURLにリダイレクトする\n location.reload();\n }\n });\n});\n","document.addEventListener(\"turbolinks:load\", function() {\n if ( $('#recommend-preview-wrapper').length ) {\n\n // モーダル類の定義\n const editModal = document.querySelector(\"#recommend-preview-edit-modal\");\n const loadingModal = document.querySelector(\"#loading-modal\");\n let loadingText = $(\"#loading-text\");\n const qrCodeModal = document.querySelector(\"#qr-modal\");\n\n // HTMLエディタの初期化\n let editor = ace.edit('recommend-preview-editor');\n editor.setTheme('ace/theme/monokai');\n editor.session.setMode('ace/mode/html');\n editor.setOptions({\n maxLines: 30,\n minLines: 30\n });\n\n\n /**\n * プレビュー作成\n */\n function createPreview(caller) {\n caller.css('pointer-events', 'none');\n let baseUrl = $('#base-url').val();\n if (baseUrl.trim() === '') {\n alert('URLを入力してください');\n caller.css('pointer-events', 'auto');\n return;\n }\n\n setTimeout(function() { loadingModal.showModal(); }, 1);\n\n $.ajax({\n url: '/recommend_preview/create_preview',\n type: 'POST',\n data: {\n url: baseUrl\n }\n })\n .done(function(data) {\n if (data['ret'] === 0) {\n alert('プレビューを作成しました!');\n location.reload();\n } else if (data['message']) {\n alert(data['message']);\n\n } else {\n alert('プレビューの作成に失敗しました');\n\n }\n caller.css('pointer-events', 'auto');\n })\n .fail(function() {\n alert('プレビューの作成に失敗しました');\n caller.css('pointer-events', 'auto');\n })\n .always(function() {\n loadingModal.close();\n })\n }\n $('#create-recommend-preview').on('click', function() {\n createPreview($(this))\n });\n\n\n /**\n * プレビュー編集\n * @param caller\n */\n function editPreview(caller) {\n setTimeout(function() { loadingModal.showModal(); }, 1);\n\n let previewId = caller.data('preview-id');\n $.ajax({\n url: '/recommend_preview/edit_preview',\n type: 'POST',\n data: {\n id: previewId\n }\n })\n .then(function(data) {\n if (data['ret'] === 0) {\n $('#update-preview').data('preview-id', previewId);\n editor.setValue(data['html_content']);\n editModal.showModal();\n } else {\n alert(data['message']);\n }\n })\n .fail(function() {\n alert('プレビューHTMLの取得に失敗しました');\n })\n .always(function() {\n loadingModal.close();\n })\n }\n $('.edit-preview').on('click', function() {\n $(this).css('pointer-events', 'none');\n editPreview( $(this) );\n $(this).css('pointer-events', 'auto');\n });\n\n // 編集キャンセル\n $('#edit-cancel').on('click', function() {\n editor.setValue('');\n editModal.close();\n loadingModal.close();\n });\n\n\n\n /**\n * プレビューHTML更新\n */\n function updatePreview(caller) {\n let previewId = caller.data('preview-id');\n let htmlContent = editor.getValue();\n\n setTimeout(function() { loadingModal.showModal(); }, 1);\n\n $.ajax({\n url: '/recommend_preview/update_preview',\n type: 'POST',\n data: {\n id: previewId,\n html_content: htmlContent\n }\n })\n .then(function(data) {\n if (data['ret'] === 0) {\n alert('プレビューを更新しました');\n location.reload();\n } else {\n alert(data['message']);\n }\n })\n .fail(function() {\n alert('プレビューの更新に失敗しました');\n })\n .always(function() {\n loadingModal.close();\n })\n }\n $('#update-preview').on('click', function() {\n $(this).css('pointer-events', 'none');\n updatePreview( $(this) );\n $(this).css('pointer-events', 'auto');\n });\n\n\n /**\n * プレビュー削除\n */\n function deletePreview(caller) {\n let previewId = caller.data('preview-id');\n if (confirm('プレビューを削除しますか?')) {\n setTimeout(function() { loadingModal.showModal(); }, 1);\n $.ajax({\n url: '/recommend_preview/delete_preview',\n type: 'POST',\n data: {\n id: previewId\n }\n })\n .then(function(data) {\n if (data['ret'] === 0) {\n alert('プレビューを削除しました');\n location.reload();\n } else {\n alert(data['message']);\n }\n })\n .fail(function() {\n alert('プレビューの削除に失敗しました');\n })\n .always(function() {\n loadingModal.close();\n })\n }\n }\n $('.delete-preview').on('click', function() {\n $(this).css('pointer-events', 'none');\n deletePreview( $(this) );\n $(this).css('pointer-events', 'auto');\n });\n\n\n /**\n * QRコード表示\n */\n function showQrCode(caller) {\n let previewId = caller.data('preview-id');\n setTimeout(function() { loadingModal.showModal(); }, 1);\n\n $.ajax({\n url: '/recommend_preview/get_qr_code',\n type: 'POST',\n data: {\n id: previewId\n }\n })\n .then(function(data) {\n if (data['ret'] == 0) {\n $('#qr-code').html(data['svg']);\n qrCodeModal.showModal();\n } else {\n alert(data['message']);\n }\n })\n .fail(function() {\n alert('QRコードの表示に失敗しました');\n })\n .always(function() {\n loadingModal.close();\n })\n }\n $('.show-qr-code').on('click', function() {\n $(this).css('pointer-events', 'none');\n showQrCode( $(this) );\n $(this).css('pointer-events', 'auto');\n });\n\n $('#qr-cancel').on('click', function() {\n $('#qr-code').html('');\n qrCodeModal.close();\n });\n\n\n\n // エスケープキーでモーダルを閉じないようにする\n document.addEventListener('keydown', function(e) {\n if (e.key === 'Escape') {\n e.preventDefault();\n }\n });\n\n\n\n }\n});\n","document.addEventListener('turbolinks:load', function() {\n if ( $('#sales-index-wrapper').length > 0 ) {\n\n let inputTimer;\n\n /**\n * モーダル定義\n * self.showModal() で表示\n * self.close() で閉じる\n */\n const detailModal = document.getElementById('detail-modal');\n const loadingModal = document.getElementById('loading-modal');\n const importModal = document.getElementById('import-modal');\n const mailHelperModal = document.getElementById('mail-helper-modal');\n\n // 編集可能な要素にdata-idを自動セット\n $('.sales-info [data-name]').attr('data-id', function() {\n return $(this).closest('.sales-info').attr('data-id');\n });\n\n // モーダルの表示イベント設定\n $('.sales-info').on('click', function() {\n // .open-modalクラスを持つ要素のクリックのみを対象とする\n if ( ! $(event.target).is('.open-modal') ) {\n return;\n }\n $('.sales-info.selected').removeClass('selected');\n $(this).addClass('selected');\n getDetail( $(this) );\n getContactHistories( $(this).attr('data-id') );\n // detailModalをeditモードにする\n detailModal.setAttribute('data-mode', 'edit');\n if (detailModal.showModal) {\n detailModal.showModal();\n $(\"#contact-history-memo\").focus();\n }\n });\n\n // エスケープキーでモーダルを閉じないようにする\n document.addEventListener('keydown', function(e) {\n if (e.key === 'Escape') {\n e.preventDefault();\n }\n });\n\n\n /**\n * 詳細モーダルのデータ読み込み\n */\n function getDetail( caller ) {\n setTimeout(function() { loadingModal.showModal(); }, 0);\n $.ajax({\n url: '/sales/get_detail',\n type: 'POST',\n data: {\n id: caller.attr('data-id')\n }\n })\n .then(function(data) {\n if (data['ret'] === 0) {\n // data['object']内のキーと一致するdata-nameを持つ要素に値をセット. 更新用にdata-idを自動セット\n for (let key in data['object']) {\n let elm = $(`#detail-modal [data-name=\"${key}\"]`);\n // 対象要素がない場合はスキップ\n if (elm.length === 0) {\n continue;\n }\n elm.attr('data-id', data['object']['id']);\n attachValue(elm, key, data['object'][key]);\n $('#create-tel-history').data('id', data['object']['id']); // テレアポ記録ボタンにidをセット\n }\n } else {\n alert(data['message']);\n }\n })\n .fail(function() {\n alert('詳細の取得に失敗しました');\n })\n .always(function() {\n loadingModal.close();\n })\n }\n\n\n /**\n * セレクト、チェックボックスの値を変更したら自動保存\n * @param {jQuery Object} caller イベント発火元の要素\n * @return {void}\n */\n function updateData(caller) {\n let url = '/sales/update_data';\n // id取得\n let id = caller.attr('data-id');\n if (id === undefined) {\n return;\n }\n let data = {\n id: id,\n key: caller.data('name'),\n value: \"\"\n };\n // 対象要素がチェックボックスの場合は値の取得方法を変更\n if (caller.is('input[type=\"checkbox\"]') && caller.prop('checked')) {\n // チェックが入った場合は1をセット\n data['value'] = 1;\n } else if (caller.is('input[type=\"checkbox\"]') && !caller.prop('checked')) {\n // チェックが外れた場合は0をセット\n data['value'] = 0;\n\n } else {\n // それ以外はval()で取得\n try {\n data['value'] = caller.val();\n } catch (e) {\n return;\n }\n }\n // POST\n $.ajax({\n url: url,\n type: 'POST',\n data: data\n })\n .then(function(result) {\n if (result['ret'] === 0) {\n // 成功時は表示を更新\n let target = $(`[data-name=\"${data['key']}\"][data-id=\"${data['id']}\"]`);\n if (target.length > 0) {\n // 要素一覧をチェックし、フォーカスされてる場合はtargetから除外\n target.each(function( i, e) {\n if ( $(e).is(':focus') ) {\n target.splice(i, 1);\n }\n });\n attachValue(target, data['key'], data['value']);\n }\n }\n if (result['ret'] !== 0) {\n // 失敗時はアラートを表示\n alert(result['message']);\n }\n })\n .fail(function() {\n alert('更新に失敗しました');\n })\n }\n\n /**\n * 更新イベントの対象は、editableクラスを持つ要素\n */\n // セレクトボックスの変更イベント\n $('select.editable').on('change', function() {\n updateData( $(this) );\n });\n // チェックボックスの変更イベント\n $('input[type=\"checkbox\"].editable').on('change', function() {\n updateData( $(this) );\n });\n // 日付系の変更イベント\n $('input[type=\"date\"].editable').on('change', function() {\n updateData( $(this) );\n });\n // テキストボックスの変更イベント. キーアップの0.5秒後に自動保存. 連続で入力された場合は最後の入力が保存される\n $('input[type=\"text\"].editable, textarea.editable').on('input', function() {\n let caller = $(this);\n clearTimeout(inputTimer);\n inputTimer = setTimeout(function() {\n updateData( caller );\n }, 500);\n });\n\n /**\n * 手紙管理の変更イベント\n * - 手紙対象がONになった場合は、手紙関連のフラグと投函日のdisabledを解除\n * - 手紙対象がOFFになった場合は、手紙関連のフラグと投函日をdisabledにする\n */\n $('[data-name=\"is_letter_target\"]').on('change', function() {\n let id = $(this).attr('data-id');\n let bool = $(this).prop('checked');\n $('[data-name=\"is_letter_body_wrote\"][data-id=\"'+id+'\"]').prop('disabled', !bool);\n $('[data-name=\"is_letter_address_wrote\"][data-id=\"'+id+'\"]').prop('disabled', !bool);\n $('[data-name=\"is_letter_posted\"][data-id=\"'+id+'\"]').prop('disabled', !bool);\n $('[data-name=\"letter_posted_at\"][data-id=\"'+id+'\"]').prop('disabled', !bool);\n });\n\n /**\n * 投函ステータス変更時の補助イベント\n * 投函済みをチェックした場合は投函日を自動入力。本文、宛名を自動ONにする\n * 投函済みのチェックを外した場合は投函日を空にする\n */\n $('.editable[data-name=\"is_letter_posted\"]').on('change', function() {\n let id = $(this).attr('data-id');\n let isLetterBodyWrote = $('[data-name=\"is_letter_body_wrote\"][data-id=\"'+id+'\"]');\n let isLetterAddressWrote = $('[data-name=\"is_letter_address_wrote\"][data-id=\"'+id+'\"]');\n let letterPostedAt = $('[data-name=\"letter_posted_at\"][data-id=\"'+id+'\"]');\n if ( $(this).prop('checked') ) {\n isLetterBodyWrote.prop('checked', true);\n isLetterAddressWrote.prop('checked', true);\n letterPostedAt.val(new Date().toISOString().split('T')[0]);\n } else {\n let id = $(this).attr('data-id');\n let letterPostedAt = $('[data-name=\"letter_posted_at\"][data-id=\"'+id+'\"]');\n letterPostedAt.val('');\n }\n updateData( $(this) );\n updateData( isLetterBodyWrote );\n updateData( isLetterAddressWrote );\n updateData( letterPostedAt );\n });\n\n\n /**\n * 値を要素にセットする際のルール設定\n * - checkbox: 1ならチェック, 0なら非チェック\n * - select: valueにセット\n * - input: valueにセット\n * - a: hrefとtextにセット\n * - その他: textにセット\n * @param {jQuery Object} element 対象要素\n * @param {string} key キー\n * @param value 値\n */\n function attachValue( element, key, value ) {\n if ( element.is('input[type=\"checkbox\"]') ) {\n if (value === 1) {\n element.prop('checked', true);\n } else {\n element.prop('checked', false);\n }\n } else if ( element.is('input[type=\"date\"]') ) {\n // Tでsplitして最初のブロックを取得\n if (value === null) {\n element.val('');\n } else {\n element.val(value.split('T')[0]);\n }\n }else if ( element.is('select') ) {\n // selectの場合はvalueにセット\n element.val(value);\n // 業種カテゴリの場合は、カテゴリ名をセットしてバッジ表示\n if (key === 'sales_category_id') {\n let id = element.attr('data-id');\n let categoryName = $(`select[data-name=\"sales_category_id\"] option[value=\"${value}\"]`).first().text();\n $(`div[data-name=\"sales_category_id\"][data-id=\"${id}\"]`).text(categoryName);\n }\n\n } else if ( element.is('input') || element.is('textarea') ) {\n // inputかtextareaの場合はvalueにセット\n element.val(value);\n // URL系の場合は、data-hrefにもセット\n if (key === 'url' || key === 'instagram_url') {\n element.attr('data-href', value);\n return;\n }\n try {\n //detailModalではinputでも、テーブル上はテキストの場合があるので、エラーハンドルを設置してTEXT書き込みを試行。\n let prefix = '';\n let suffix = '';\n // 担当者名には「様」を付与\n if ( key === 'manager_name' ) {\n suffix = ' 様';\n }\n element.text(prefix + value + suffix);\n }catch (e) {\n //\n }\n\n } else if ( element.is('a') ) {\n // aタグの場合はhrefとtextにセット\n element.attr('href', value);\n element.text(value);\n\n } else {\n // それ以外はtextにセット.\n element.text(value);\n }\n }\n\n\n // ##### 連絡履歴 #####\n /**\n * 連絡履歴の作成\n */\n $('#create-history').on('click', function() {\n let id = $('.sales-info.selected').attr('data-id');\n let caller = $(this);\n let memo = $('#contact-history-memo').val();\n if (memo.trim() === '') {\n alert('内容は必須です');\n return;\n }\n $.ajax({\n url: '/sales/create_contact_history',\n type: 'POST',\n data: {\n id: id,\n contact_type: $('#contact-type').val(),\n memo: memo\n }\n })\n .then(function(data) {\n if (data['ret'] === 0) {\n alert('連絡履歴を作成しました');\n $('#contact-history-memo').val('');\n getContactHistories(id);\n } else {\n alert(data['message']);\n }\n })\n .fail(function() {\n alert('連絡履歴の作成に失敗しました');\n })\n });\n\n /**\n * 連絡履歴の取得\n */\n function getContactHistories(customer_id) {\n $.ajax({\n url: '/sales/get_contact_histories',\n type: 'POST',\n data: {\n id: customer_id\n }\n })\n .then(function (data) {\n if (data['ret'] === 0) {\n $('#contact-histories').empty();\n if (data['object'].length === 0) {\n $('#contact-histories').append('
連絡履歴がありません
');\n }else{\n data['object'].forEach(function (history) {\n let html = `\n
\n
${history['contacted_at']}
\n
${history['contact_type']} ( ${history['sales_user_name']} )
\n
---
\n
${history['memo']}
\n
\n `;\n $('#contact-histories').append(html);\n });\n }\n }\n })\n .fail(function() {\n alert('連絡履歴の取得に失敗しました');\n })\n }\n\n\n /**\n * CSVインポートイベント\n */\n // インポート用モーダル表示\n $('#import-csv').on('click', function() {\n importModal.showModal();\n });\n // インポート実行\n $('#start-import-csv').on('click', function() {\n let file = $('#csv-file').prop('files')[0];\n if (file === undefined) {\n alert('ファイルを選択してください');\n return;\n }\n setTimeout(function() { loadingModal.showModal(); }, 0);\n let formData = new FormData();\n formData.append('csv', file);\n $.ajax({\n url: '/sales/import_csv',\n type: 'POST',\n data: formData,\n processData: false,\n contentType: false\n })\n .then(function(data) {\n if (data['ret'] === 0 && data['existing_list']) {\n let message = '以下の顧客は既に登録されているため、インポートされませんでした。\\n';\n data['existing_list'].forEach(function(customer) {\n message += `${customer}\\n`;\n });\n alert(message);\n location.reload();\n } else if ( data['ret'] === 0 ) {\n alert('全てのインポートが完了しました');\n location.reload();\n } else {\n alert(data['message']);\n }\n })\n .fail(function() {\n alert('インポートに失敗しました');\n })\n .always(function() {\n loadingModal.close();\n })\n });\n\n\n /**\n * 検索\n */\n $('#start-search').on('click', function() {\n redirectWithQueries();\n });\n\n /**\n * 条件をクリアイベント\n */\n $('#clear-filter').on('click', function() {\n $('#filters [data-name]').each(function() {\n if ($(this).is('input[type=\"checkbox\"]')) {\n $(this).prop('checked', false);\n } else {\n $(this).val('');\n }\n });\n });\n\n /**\n * アクセス時に、クエリに対応する要素に値をセット\n */\n let searchQueries = new URLSearchParams(location.search);\n if (searchQueries.size > 0) {\n searchQueries.forEach(function(value, key) {\n // sales_contact_status_idはURL上では+で区切られているが、実際にはスペース区切りで取得されるため、スペースでsplitして値をセット\n if (key === 'sales_contact_status_id') {\n let statusIds = value.split(' ');\n statusIds.forEach(function(statusId) {\n $(`[data-name=\"sales_contact_status_id\"][data-status-id=\"${statusId}\"]`).prop('checked', true);\n });\n return;\n }\n // それ以外\n let target = $(`[data-name=\"${key}\"]`);\n if (target.is('input[type=\"checkbox\"]')) {\n if (value === '1') {\n target.prop('checked', true);\n }\n } else {\n target.val(value);\n }\n });\n // URLにクエリがある場合に、アコーディオンを開いておく場合はコメントアウトを外す\n // $('[name=\"filter-accordion\"]').prop('checked', true);\n }\n\n /**\n * 新規作成に関するイベント\n */\n // 新規モードでdetailModalを開く\n $('#new-customer').on('click', function() {\n // 初期値をクリア\n $('#detail-modal input, #detail-modal textarea').val('');\n $('#detail-modal input[type=\"checkbox\"]').prop('checked', false);\n $('#detail-modal select').val('');\n $('#detail-modal [data-id]').removeAttr('data-id');\n // 新規モードに設定\n detailModal.setAttribute('data-mode', 'new');\n detailModal.showModal();\n });\n\n // 新規作成ボタン\n $(\"#create-customer\").on(\"click\", function() {\n let name = $('#detail-modal [data-name=\"name\"]').val();\n if (name.trim() === '') {\n alert('会社名は必須です');\n return;\n }\n let data = {};\n $('#detail-modal input, #detail-modal textarea, #detail-modal select').each(function() {\n if ($(this).is('input[type=\"checkbox\"]')) {\n // チェックボックスがチェックされている場合は1とする\n if ($(this).prop('checked')) {\n data[$(this).data('name')] = 1;\n } else {\n data[$(this).data('name')] = 0;\n }\n }else{\n data[$(this).data('name')] = $(this).val();\n }\n });\n setTimeout(function() { loadingModal.showModal(); }, 0);\n $.ajax({\n url: '/sales/create_customer',\n type: 'POST',\n data: data\n })\n .then(function(data) {\n if (data['ret'] === 0) {\n alert('新規顧客を作成しました');\n location.reload();\n } else {\n alert(data['message']);\n }\n })\n .fail(function() {\n alert('新規顧客の作成に失敗しました');\n })\n .always(function() {\n loadingModal.close();\n })\n })\n\n\n /**\n * URLへのリンクイベント\n * .sales-info内のdata-name=\"url\", \"instagram_url\"を持つ要素をクリックしたときに、data-hrefにセットされたURLに遷移\n * data-hrefがない場合は何もしない\n * ページは新規タブで開く\n */\n $('.sales-info').on('click', '[data-name=\"url\"], [data-name=\"instagram_url\"]', function() {\n let url = $(this).attr('data-href');\n if (url === undefined || url.trim() === '') {\n return;\n }\n window.open(url, '_blank');\n });\n\n\n /**\n * ソートオプションの選択イベント\n * 選択したoptionの data-sort-name と data-sort-direction を取得して、ソートを実行\n */\n $('#apply-sort').on('click', function() {\n redirectWithQueries();\n });\n\n\n /**\n * クエリ結合を行い、リダイレクトするための関数\n * - 検索状件のチェック\n * - ソート条件のチェック\n */\n function redirectWithQueries() {\n let queries = [];\n let contactStatuses = \"\";\n // 検索状件のチェック\n // #filters内のdata-nameを持つ要素の値を取得してクエリに追加\n $('#filters [data-name]').each(function() {\n // ステータスはチェックボックスで複数をOR検索できるように、スペース区切りで格納\n if ($(this).is('[data-name=\"sales_contact_status_id\"]') && $(this).prop('checked') ) {\n contactStatuses += $(this).attr('data-status-id') + \" \";\n return;\n }\n // それ以外\n if ($(this).is('input[type=\"checkbox\"]')) {\n if ($(this).prop('checked')) {\n queries.push({ name: $(this).data('name'), value: 1 });\n }\n } else if ( $(this).val() !== \"\" ) {\n queries.push({ name: $(this).data('name'), value: $(this).val() });\n }\n });\n // 連絡ステータスのクエリを格納\n if (contactStatuses !== \"\") {\n queries.push({ name: 'sales_contact_status_id', value: contactStatuses.slice(0, -1) });\n }\n\n // ソート条件のチェック\n let selectOption = $('#sort-options option:selected');\n let sortName = selectOption.data('sort-name');\n let sortDirection = selectOption.data('sort-direction');\n // クエリにソート条件を追加\n queries.push({ name: 'sort_name', value: sortName });\n queries.push({ name: 'sort_direction', value: sortDirection });\n\n let url = new URL(location.href);\n // 既存のクエリは削除\n url.search = '';\n // クエリを結合してリダイレクト\n queries.forEach(function (query) {\n url.searchParams.set(query.name, query.value);\n });\n location.href = url.href;\n }\n\n\n\n\n } // end\n});\n","document.addEventListener(\"turbolinks:load\", function() {\n editor = \"\";\n editor2 = \"\";\n\n if ($(\"#recommend_campaign_setting_element_pc_html\").length > 0) {\n editor = ace.edit(\"recommend_campaign_setting_element_pc_html\");\n editor.session.setMode(\"ace/mode/html\");\n editor.setTheme(\"ace/theme/twilight\");\n \n // タブのスペース数を設定\n editor.getSession().setTabSize(2);\n \n // セッションの変更時のイベントを監視\n editor.session.on('changeAnnotation', function() {\n let annotations = editor.session.getAnnotations() || [], i = len = annotations.length;\n while (i--) {\n if(/important/.test(annotations[i].text)) { // !importantに関する警告をチェック\n annotations.splice(i, 1);\n }\n }\n if (len > annotations.length) {\n editor.session.setAnnotations(annotations);\n }\n });\n }\n\n if ($(\"#recommend_campaign_setting_element_sp_html\").length > 0) {\n editor2 = ace.edit(\"recommend_campaign_setting_element_sp_html\");\n editor2.session.setMode(\"ace/mode/html\");\n editor2.setTheme(\"ace/theme/twilight\");\n \n // タブのスペース数を設定\n editor2.getSession().setTabSize(2);\n \n // セッションの変更時のイベントを監視\n editor2.session.on('changeAnnotation', function() {\n let annotations = editor2.session.getAnnotations() || [], i = len = annotations.length;\n while (i--) {\n if(/important/.test(annotations[i].text)) { // !importantに関する警告をチェック\n annotations.splice(i, 1);\n }\n }\n if (len > annotations.length) {\n editor2.session.setAnnotations(annotations);\n }\n });\n }\n \n\n $('.recommend_campaign_setting_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.recommend_campaign_setting_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.recommend_campaign_setting_slidedown_btn').fadeIn(0));\n });\n\n $('.recommend_campaign_setting_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.recommend_campaign_setting_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.recommend_campaign_setting_slideup_btn').fadeIn(0));\n });\n\n // ------------------------------------------------------------------------------------------------\n // 個別キャンペーン設定\n // ------------------------------------------------------------------------------------------------\n // #################################################################\n // 個別キャンペーン設定の切り替え\n // #################################################################\n $('.recommend_campaign_setting_selects').on('change', function () {\n let recommend_campaign_setting_id = $('.recommend_campaign_setting_selects option:selected').val();\n if (recommend_campaign_setting_id == 'new') {\n $('.recommend_campaign_setting_set_wrapper_display').css('display', 'block');\n $('.recommend_campaign_setting_name_setting_wrapper').css('display', 'none');\n $('.recommend_campaign_setting_pc_show_valid_setting_wrapper').css('display', 'none');\n $('.recommend_campaign_setting_sp_show_valid_setting_wrapper').css('display', 'none');\n $('.recommend_campaign_setting_url_setting_wrapper').css('display', 'none');\n $('.recommend_campaign_setting_excluded_url_setting_wrapper').css('display', 'none');\n $('.recommend_campaign_setting_pc_html_setting_wrapper').css('display', 'none');\n $('.recommend_campaign_setting_sp_html_setting_wrapper').css('display', 'none');\n $('.recommend_campaign_setting_gender_segment_flag_wrapper').css('display', 'none');\n $('.recommend_campaign_setting_loyalty_segment_flag_wrapper').css('display', 'none');\n } else {\n location.href = `/recommend_campaign_setting/index?recommend_campaign_setting_id=${recommend_campaign_setting_id}`;\n }\n });\n // #################################################################\n // 個別キャンペーン設定の新規作成\n // #################################################################\n $('#recommend_campaign_setting_create').on('click', function () {\n const name = $('.recommend_campaign_setting_input').val();\n \n if (!name) {\n alert('設定名を入力して下さい。');\n return;\n }\n\n $.ajax({\n url: '/recommend_campaign_setting/create_recommend_campaign_setting',\n type: 'POST',\n data: {\n name: name,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('新規登録されました。');\n\n location.href = `/recommend_campaign_setting/index?recommend_campaign_setting_id=${data.recommend_campaign_setting_id}`;\n }\n });\n });\n\n // #################################################################\n // 個別キャンペーン設定名の編集\n // #################################################################\n $('#recommend_campaign_setting_name_edit_btn').on('click', function () {\n let recommend_campaign_setting_id = $('.recommend_campaign_setting_selects option:selected').val();\n let name = $('.recommend_campaign_setting_name_val').val();\n\n if (!name) {\n alert('名称を記入して下さい。');\n return;\n }\n\n $.ajax({\n url: '/recommend_campaign_setting/save_recommend_campaign_setting_name',\n type: 'POST',\n data: {\n recommend_campaign_setting_id: recommend_campaign_setting_id,\n name: name\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 個別キャンペーン設定の公開設定(PC)\n // #################################################################\n $('.recommend_campaign_setting_pc_show_valid_select_box').on('change', function (event) {\n let recommend_campaign_setting_id = $('.recommend_campaign_setting_selects option:selected').val();\n let pc_show_valid = $('.recommend_campaign_setting_pc_show_valid_select_box:checked').val();\n\n $.ajax({\n url: '/recommend_campaign_setting/save_recommend_campaign_setting_pc_show_valid',\n type: 'POST',\n data: {\n recommend_campaign_setting_id: recommend_campaign_setting_id,\n pc_show_valid: pc_show_valid\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 個別キャンペーン設定の公開設定(SP)\n // #################################################################\n $('.recommend_campaign_setting_sp_show_valid_select_box').on('change', function (event) {\n let recommend_campaign_setting_id = $('.recommend_campaign_setting_selects option:selected').val();\n let sp_show_valid = $('.recommend_campaign_setting_sp_show_valid_select_box:checked').val();\n\n $.ajax({\n url: '/recommend_campaign_setting/save_recommend_campaign_setting_sp_show_valid',\n type: 'POST',\n data: {\n recommend_campaign_setting_id: recommend_campaign_setting_id,\n sp_show_valid: sp_show_valid\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 個別キャンペーン設定の公開設定(SP)\n // #################################################################\n $('.recommend_campaign_setting_sp_show_valid_select_box').on('change', function (event) {\n let recommend_campaign_setting_id = $('.recommend_campaign_setting_selects option:selected').val();\n let show_valid = $('.recommend_campaign_setting_sp_show_valid_select_box:checked').val();\n\n $.ajax({\n url: '/recommend_campaign_setting/save_recommend_campaign_setting_sp_show_valid',\n type: 'POST',\n data: {\n recommend_campaign_setting_id: recommend_campaign_setting_id,\n show_valid: show_valid\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ユーザーセグメント設定\n // #################################################################\n $('.recommend_campaign_setting_gender_segment_flag_select_box').on('change', function () {\n let recommend_campaign_setting_id = $('.recommend_campaign_setting_selects option:selected').val();\n let gender_segment_flag = $('.recommend_campaign_setting_gender_segment_flag_select_box:checked').val();\n\n $.ajax({\n url: '/recommend_campaign_setting/save_recommend_campaign_setting_gender_segment_flag',\n type: 'POST',\n data: {\n recommend_campaign_setting_id: recommend_campaign_setting_id,\n gender_segment_flag: gender_segment_flag\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // ロイヤリティセグメント設定\n // #################################################################\n $('.recommend_campaign_setting_loyalty_segment_flag_select_box').on('change', function () {\n let recommend_campaign_setting_id = $('.recommend_campaign_setting_selects option:selected').val();\n let loyalty_segment_flag = $('.recommend_campaign_setting_loyalty_segment_flag_select_box:checked').val();\n\n $.ajax({\n url: '/recommend_campaign_setting/save_recommend_campaign_setting_loyalty_segment_flag',\n type: 'POST',\n data: {\n recommend_campaign_setting_id: recommend_campaign_setting_id,\n loyalty_segment_flag: loyalty_segment_flag\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n \n });\n });\n\n // #################################################################\n // フリーケンシー設定\n // #################################################################\n $('#recommend_campaign_days_after_display').on('change', function () {\n let recommend_campaign_setting_id = $('.recommend_campaign_setting_selects option:selected').val();\n let days_after_display = $('#recommend_campaign_days_after_display').val();\n\n if (!days_after_display || days_after_display < 0) {\n alert(\"0より大きい数値を設定して下さい。\");\n }\n\n $.ajax({\n url: '/recommend_campaign_setting/save_recommend_campaign_setting_days_after_display',\n type: 'POST',\n data: {\n recommend_campaign_setting_id: recommend_campaign_setting_id,\n days_after_display: days_after_display\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // html設定(pc)\n // #################################################################\n $('#recommend_campaign_setting_element_pc_html_set').on('click', function () {\n let recommend_campaign_setting_id = $('.recommend_campaign_setting_selects option:selected').val();\n\n let pc_html = editor.getValue();\n \n $.ajax({\n url: '/recommend_campaign_setting/create_recommend_campaign_setting_pc_html',\n type: 'POST',\n data: {\n recommend_campaign_setting_id: recommend_campaign_setting_id,\n pc_html: pc_html\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n // #################################################################\n // html設定(sp)\n // #################################################################\n $('#recommend_campaign_setting_element_sp_html_set').on('click', function () {\n let recommend_campaign_setting_id = $('.recommend_campaign_setting_selects option:selected').val();\n\n let sp_html = editor2.getValue();\n \n $.ajax({\n url: '/recommend_campaign_setting/create_recommend_campaign_setting_sp_html',\n type: 'POST',\n data: {\n recommend_campaign_setting_id: recommend_campaign_setting_id,\n sp_html: sp_html\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == 0) {\n location.reload();\n }\n });\n });\n\n // #################################################################\n // 個別キャンペーン設定の表示URL設定\n // #################################################################\n $('#recommend_campaign_setting_url_add_input').on('click', function () {\n $(this)\n .parents('table')\n .append(\n `\n \n \n \n \n \n
\n \n \n \n
\n \n `\n );\n $('.recommend_campaign_setting_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n $('.recommend_campaign_setting_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n\n $('#recommend_campaign_setting_url_set').on('click', function () {\n const recommend_campaign_setting_type_data = $(\".recommend_campaign_setting_type_data\").data(\"setting_type\");\n let recommend_campaign_setting_id = $('.recommend_campaign_setting_selects option:selected').val();\n let urls = [];\n $('.recommend_campaign_setting_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/recommend_campaign_setting/set_recommend_campaign_setting_url',\n type: 'POST',\n data: {\n recommend_campaign_setting_id: recommend_campaign_setting_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // #################################################################\n // 個別キャンペーン設定の除外URL設定\n // #################################################################\n $('#recommend_campaign_setting_excluded_url_add_input').on('click', function () {\n $(this)\n .parents('table')\n .append(\n `\n \n \n \n \n \n
\n \n \n \n
\n \n `\n );\n $('.recommend_campaign_setting_excluded_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n });\n $('.recommend_campaign_setting_excluded_url_del').on('click', function () {\n $(this).parent().parent('tr').remove();\n });\n\n $('#recommend_campaign_setting_excluded_url_set').on('click', function () {\n let recommend_campaign_setting_id = $('.recommend_campaign_setting_selects option:selected').val();\n let urls = [];\n $('.recommend_campaign_setting_excluded_url_input').each(function () {\n urls.push($(this).val().trim());\n });\n\n $.ajax({\n url: '/recommend_campaign_setting/set_recommend_campaign_setting_excluded_url',\n type: 'POST',\n data: {\n recommend_campaign_setting_id: recommend_campaign_setting_id,\n urls: urls,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n\n // ------------------------------------------------------------------------------------------------\n // 分析\n // ------------------------------------------------------------------------------------------------\n function recommend_campaign_update_url() {\n const recommend_campaign_setting_id = $('#recommend_campaign_metric_selects option:selected').val();\n const gf = $('#recommend_campaign_metric_graph_pattern_select_input').val();\n const start_day = $('#recommend_campaign_metric_report_start_day').val();\n const end_day = $('#recommend_campaign_metric_report_end_day').val();\n const device = $('.recommend_campaign_metric_device_select').data(\"device\");\n\n let url = new URL(window.location.href);\n let params = url.searchParams;\n\n if (recommend_campaign_setting_id !== 'none' && recommend_campaign_setting_id !== null && recommend_campaign_setting_id !== undefined) {\n params.set('recommend_campaign_setting_id', recommend_campaign_setting_id);\n } else {\n params.delete('recommend_campaign_setting_id');\n }\n\n if (gf) {\n params.set('gf', gf);\n } else {\n params.delete('gf');\n }\n\n if (device == \"0\" || device == \"1\" || device == \"2\") {\n params.set('device', device);\n } else {\n params.delete('device');\n }\n\n if (gf === '12') {\n params.delete('start_day');\n params.delete('end_day');\n } else { // このelseブロックを追加\n if (start_day) {\n params.set('start_day', start_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n\n if (end_day) {\n params.set('end_day', end_day);\n } else {\n params.delete('start_day');\n params.delete('end_day');\n }\n }\n\n url.search = params.toString();\n location.href = url.toString();\n }\n\n // #################################################################\n // レコメンドコメンドューの選択\n // #################################################################\n $('#recommend_campaign_metric_selects').on('change', function () {\n recommend_campaign_update_url();\n });\n\n // #################################################################\n // 日毎、月毎のグラフ切り替え\n // #################################################################\n $('.recommend_campaign_metric_graph_pattern_select_day, .recommend_campaign_metric_graph_pattern_select_month').on('click', function () {\n const gf_value = $(this).data('gf');\n $('#recommend_campaign_metric_graph_pattern_select_input').val(gf_value);\n recommend_campaign_update_url();\n });\n\n // #################################################################\n // デバイスごとのグラフ切り替え\n // #################################################################\n $('.recommend_campaign_metric_device_select_all, .recommend_campaign_metric_device_select_pc, .recommend_campaign_metric_device_select_phone').on('click', function () {\n const device = $(this).data('device');\n $('.recommend_campaign_metric_device_select').data(\"device\", device);\n recommend_campaign_update_url();\n });\n\n // #################################################################\n // 範囲選択によるグラフ切り替え\n // #################################################################\n $('#recommend_campaign_metric_report_start_day, #recommend_campaign_metric_report_end_day').on('change', function () {\n recommend_campaign_update_url();\n });\n\n // #################################################################\n // レコメンドグデータのみの削除\n // #################################################################\n $('.delete_recommend_campaign_metric_log_data').on('click', function () {\n if (!confirm('本当に削除を実行しますか?')) {\n return;\n }\n const recommend_campaign_setting_id = $('#recommend_campaign_metric_selects option:selected').val();\n\n $.ajax({\n url: '/recommend_campaign_report/delete_recommend_campaign_log',\n type: 'POST',\n data: {\n recommend_campaign_setting_id: recommend_campaign_setting_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('削除が完了しました。');\n location.reload();\n }\n });\n });\n\n // #################################################################\n // レコメンドグデータと関連するデータ全ての削除\n // #################################################################\n $('.delete_recommend_campaign_metric_log_data_and_related_data').on('click', function () {\n if (!confirm('本当に完全削除を実行しますか?')) {\n return;\n }\n const recommend_campaign_setting_id = $('#recommend_campaign_metric_selects option:selected').val();\n\n $.ajax({\n url: '/recommend_campaign_report/delete_recommend_campaign_log_and_related_data',\n type: 'POST',\n data: {\n recommend_campaign_setting_id: recommend_campaign_setting_id,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('削除が完了しました。');\n location.href = '/recommend_campaign_report/index';\n }\n });\n });\n\n // #################################################################\n // レコメンドポートのcsv出力\n // #################################################################\n $('#download_recommend_campaign_metric_csv').on('click', function () {\n const recommend_campaign_setting_id = $('#recommend_campaign_metric_selects option:selected').val();\n const month = $('#ua_recommend_campaign_metric_month_selects option:selected').val();\n\n let href = '/download_recommend_campaign_metric_csv';\n\n href += `?recommend_campaign_setting_id=${recommend_campaign_setting_id}`;\n href += `&m=${month}`;\n location.href = href;\n });\n\n $('#ua_recommend_campaign_metric_month_selects').on('change', function () {\n let month = $('#ua_recommend_campaign_metric_month_selects option:selected').val();\n let url = new URL(window.location.href);\n\n if (month != '') {\n if (url.searchParams.has('m')) {\n // 値が \"0\"か\"1\" なら \"2\" に更新する\n let new_value = month;\n // パラメーターの値を更新する\n url.searchParams.set('m', new_value);\n } else {\n // パラメーターにdeviceがない場合\n // 新しいパラメーターを追加する\n url.searchParams.append('m', month);\n }\n\n // 更新されたURLにリダイレクトする\n location.href = url.toString();\n } else {\n // monthが空文字の時は指定したURLにリダイレクトする\n location.reload();\n }\n });\n});","document.addEventListener('turbolinks:load', function () {\n $('.non_deletable_sns_post_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.non_deletable_sns_post_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.non_deletable_sns_post_slidedown_btn').fadeIn(0));\n });\n\n $('.non_deletable_sns_post_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.non_deletable_sns_post_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.non_deletable_sns_post_slideup_btn').fadeIn(0));\n });\n\n $(document)\n .off('click', '#search_non_deletable_sns_post_btn')\n .on('click', '#search_non_deletable_sns_post_btn', function () {\n $('.non_deletable_sns_post_list').children().remove();\n const post_val = $('.non_deletable_sns_post_caption').val();\n\n // テキストエリアから値を取得\n const post_url_val = encodeURIComponent($('.non_deletable_sns_post_caption').val());\n\n // ベースのURL(現在のページのURLも可能です)\n let baseUrl = $('#non_deletable_sns_post_base_url').val();\n baseUrl = baseUrl + '/non_deletable_sns_post/index';\n\n // パラメータを追加したURLを構築\n const newUrl = `${baseUrl}?caption=${post_url_val}`;\n\n // URLの変更(ページはリロードされず、履歴には新しいURLが追加される)\n history.pushState({}, '', newUrl);\n\n $.ajax({\n url: '/search_non_deletable_sns_post',\n type: 'POST',\n data: {\n caption: post_val,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '1') {\n alert('検索結果のデータ件数が多すぎるためもう少し絞り込んでください。');\n }\n\n if (data.ret == '2') {\n alert('検索結果が0件でした。条件を変えて再検索してください。');\n }\n\n if (data.ret == '0' && data.sns_posts.length > 0) {\n data.sns_posts.forEach((post) => {\n console.log(post);\n let postHtml = `\n
\n \n
\n \n ${generateMediaContent(post, data.s3_base_url)}\n \n
\n
\n ${post.caption.length > 40 ? `${post.caption.substring(0, 40)}...` : post.caption}\n
\n
\n
\n
\n `;\n $('.non_deletable_sns_post_list').append(postHtml);\n });\n\n $('.non_deletable_sns_post_check').on('change', function () {\n if ($(this).is(':checked')) {\n let sns_post_id = $(this).data('sns_post_id');\n $.ajax({\n url: '/relate_non_deletable_sns_post',\n type: 'POST',\n data: {\n sns_post_id: sns_post_id,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n }\n });\n }\n });\n });\n\n $('.non_deletable_sns_post_check').on('change', function () {\n if ($(this).is(':checked')) {\n let sns_post_id = $(this).data('sns_post_id');\n $.ajax({\n url: '/relate_non_deletable_sns_post',\n type: 'POST',\n data: {\n sns_post_id: sns_post_id,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n }\n });\n\n function generateMediaContent(post, s3_base_url) {\n const account_id = post.account_id.toString().padStart(5, '0');\n const created_at_date = new Date(post.created_at);\n created_at_date.setHours(created_at_date.getHours() + 9);\n const created_at = created_at_date.toISOString().split('T')[0];\n\n switch (post.post_type) {\n case 0:\n post_type_name = 'top';\n break;\n case 1:\n post_type_name = 'rec';\n break;\n default:\n post_type_name = 'myp';\n }\n\n let mediaContent = '';\n if (post.media_type === 'VIDEO' || (post.media_type === 'CAROUSEL_ALBUM' && post.media_url.includes('mp4'))) {\n mediaContent = ``;\n } else if (post.media_type === 'MANUAL_OWN_POST' && post.my_post_media_order_media_type === 'IMAGE') {\n mediaContent = `\"\"`;\n } else if (post.media_type === 'MANUAL_OWN_POST' && post.my_post_media_order_media_type === 'VIDEO') {\n mediaContent = ``;\n } else {\n mediaContent = `\"\"`;\n }\n return mediaContent;\n }\n\n $('.related_non_deletable_sns_post_delete_submit_btn')\n .off()\n .on('click', function (event) {\n let sns_post_id = $(this).data('sns_post_id');\n $.ajax({\n url: '/delete_non_deletable_sns_post',\n type: 'POST',\n data: {\n sns_post_id: sns_post_id,\n },\n dataType: 'json',\n }).done(function (data) {\n location.reload();\n });\n });\n});\n","document.addEventListener('turbolinks:load', function () {\n\n $('.staff_slideup_btn, .parent_slideup_btn').on('click', function () {\n $.when($(this).parent().parent().children('.staff_slide_flag, .parent_slide_flag').slideUp()).done($(this).fadeOut(0), $(this).parent().children('.staff_slidedown_btn, .parent_slidedown_btn').fadeIn(0));\n });\n\n $('.staff_slidedown_btn, .parent_slidedown_btn').on('click', function () {\n $.when($(this).parent().parent().children('.staff_slide_flag, .parent_slide_flag').slideDown()).done($(this).fadeOut(0), $(this).parent().children('.staff_slideup_btn, .parent_slideup_btn').fadeIn(0));\n });\n\n $('#create_staff_submit_btn').on('click', function () {\n let staff_name = $('#staff_name').val();\n let staff_ugc_name = $('#staff_ugc_name').val();\n let staff_login_id = $('#staff_login_id').val();\n let staff_login_password = $('#staff_login_password').val();\n let staff_group_name = $('#staff_group_name').val();\n let staff_remark = $('#staff_remark').val();\n\n if (!staff_name &&\n !staff_ugc_name &&\n !staff_login_id &&\n !staff_login_password) {\n alert(\"必須箇所を入力してください。\");\n return;\n }\n\n $.ajax({\n url: '/create_staff',\n type: 'POST',\n data: {\n staff_name: staff_name,\n staff_ugc_name: staff_ugc_name,\n staff_login_id: staff_login_id,\n staff_login_password: staff_login_password,\n staff_group_name: staff_group_name,\n staff_remark: staff_remark,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n $('.staff_edit').on('click', function () {\n let staff_id = $(this).data(\"id\");\n let staff_name = $(this).data(\"name\");\n let staff_ugc_name = $(this).data(\"ugc_name\");\n let staff_login_id = $(this).data(\"staff_login_id\");\n let staff_login_password = $(this).data(\"staff_login_password\");\n let staff_group_name = $(this).data(\"group_name\");\n let staff_remark = $(this).data(\"remarks\");\n\n $(\"#staff_edit_id\").val(staff_id);\n $(\"#staff_edit_name\").val(staff_name);\n $(\"#staff_edit_ugc_name\").val(staff_ugc_name);\n $(\"#staff_edit_login_id\").val(staff_login_id);\n $(\"#staff_edit_login_password\").val(staff_login_password);\n $(\"#staff_edit_group_name\").val(staff_group_name);\n $(\"#staff_edit_remark\").val(staff_remark);\n });\n\n $('#update_staff_submit_btn').on('click', function () {\n let staff_id = $('#staff_edit_id').val();\n let staff_name = $('#staff_edit_name').val();\n let staff_ugc_name = $('#staff_edit_ugc_name').val();\n let staff_login_id = $('#staff_edit_login_id').val();\n let staff_login_password = $('#staff_edit_login_password').val();\n let staff_group_name = $('#staff_edit_group_name').val();\n let staff_remark = $('#staff_edit_remark').val();\n\n if (!staff_name &&\n !staff_ugc_name &&\n !staff_login_id &&\n !staff_login_password) {\n alert(\"必須箇所を入力してください。\");\n return;\n }\n\n $.ajax({\n url: '/update_staff',\n type: 'POST',\n data: {\n staff_id: staff_id,\n staff_name: staff_name,\n staff_ugc_name: staff_ugc_name,\n staff_login_id: staff_login_id,\n staff_login_password: staff_login_password,\n staff_group_name: staff_group_name,\n staff_remark: staff_remark,\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n $('.staff_active, .staff_non_active').on('click', function () {\n let staff_id = $(this).data(\"id\");\n let staff_is_active = $(this).data(\"is_active\");\n\n $.ajax({\n url: '/update_staff_active',\n type: 'POST',\n data: {\n staff_id: staff_id,\n staff_is_active: staff_is_active\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n location.reload();\n }\n });\n });\n\n $('.staff_list_select_box').on('change', function () {\n let staff_id = $('.staff_list_select_box option:selected').val();\n\n window.location.href = window.location.pathname + '?staff_id=' + encodeURIComponent(staff_id);\n });\n\n let firstChecked = false;\n\n $('.staff_media_check').on('change', function() {\n if ($(this).is(':checked') && !firstChecked) {\n let caption = $(this).data('caption');\n $('#staff_post_submit').attr('data-caption', caption); // attrメソッドで属性を設定\n firstChecked = true;\n }\n\n // すべてのチェックボックスが未チェックの場合、フラグをリセット\n if (!$('.staff_media_check:checked').length) {\n firstChecked = false;\n $('#staff_post_submit').attr('data-caption', ''); // データキャプションをクリア\n }\n });\n\n $('.staff_post_submit').on('click', function () {\n let staff_id = $('.staff_list_select_box option:selected').val();\n let s3_staff_img_url = [];\n let caption = $(this).data('caption');\n\n $('.staff_media_check:checked').each(function () {\n s3_staff_img_url.push($(this).data(\"url\"));\n });\n if (s3_staff_img_url.length == 0) {\n alert('画像を選択してください。');\n return;\n }\n\n $.ajax({\n url: '/create_staff_posts',\n type: 'POST',\n data: {\n staff_id: staff_id,\n img_urls: s3_staff_img_url,\n caption: caption\n },\n dataType: 'json',\n }).done(function (data) {\n if (data.ret == '0') {\n alert('登録が完了しました。左メニューの手動投稿管理でご確認ください。');\n location.reload();\n }\n });\n });\n\n // #########################################################################\n // staffログイン画面\n $('#staff_login').on('click', function () {\n\n let company_login_id = $('#company_login_id').val();\n let staff_login_id = $('#staff_login_id').val();\n let staff_login_password = $('#staff_login_password').val();\n\n if (!staff_login_id || !staff_login_password) {\n return;\n }\n\n $.ajax({\n url: '/staff_manage/create_staff_session',\n type: 'GET',\n data: {\n company_login_id: company_login_id,\n staff_login_id: staff_login_id,\n staff_login_password: staff_login_password,\n },\n dataType: 'json',\n })\n .done(function (data) {\n if (data.ret == 2) {\n location.href = '/staff_manage/index';\n } else {\n alert('ログインIDまたはパスワードが違います');\n location.reload();\n }\n });\n });\n\n $('#file-upload').on('change', function() {\n let files = $(this)[0].files;\n if (files.length > 0) {\n \n $(\".staff_media_caption\").css(\"display\", \"block\");\n \n // 選択されたファイルの名前を表示する\n $.each(files, function(index, file) {\n console.log('選択されたファイル:', file.name);\n });\n }\n });\n\n $('#staff_media_upload_form').on('submit', function(e) {\n e.preventDefault(); // フォームのデフォルト送信処理を阻止\n\n let formData = new FormData(this); // フォームデータを取得\n let caption = $('.staff_media_caption').val(); // テキストエリアの値を取得\n formData.append('caption', caption); // テキストエリアの値をFormDataに追加\n\n let files = $('#file-upload')[0].files;\n let isValid = true;\n let errorMessage = '';\n\n for (let i = 0; i < files.length; i++) {\n let file = files[i];\n if (file.type.match('image.*') && file.size > 1 * 1024 * 1024) {\n isValid = false;\n errorMessage += '画像ファイルは1MB以下である必要があります。\\n';\n } else if (file.type.match('video.*') && file.size > 5 * 1024 * 1024) {\n isValid = false;\n errorMessage += '動画ファイルは5MB以下である必要があります。\\n';\n }\n }\n\n if (!isValid) {\n alert(errorMessage);\n return;\n }\n\n $.ajax({\n url: '/staff_manage/upload_staff_media',\n type: 'POST',\n data: formData,\n processData: false, // jQueryがデータを処理しないように指定\n contentType: false, // jQueryがcontentTypeを設定しないように指定\n success: function(data) {\n console.log('Upload successful!');\n location.reload();\n },\n error: function(xhr, status, error) {\n console.error('Upload failed:', error);\n // ここにエラー時の処理を記述\n }\n });\n });\n\n $('.staff_logout').on('click', function () {\n $.ajax({\n url: '/staff_manage/staff_logout',\n type: 'GET',\n data: {},\n dataType: 'json',\n })\n .done(function (data) {\n location.reload();\n });\n });\n\n $('.display_sns_post_caption').on('click', function () {\n\n let sns_post_caption = $(this).data(\"caption\");\n sns_post_caption = sns_post_caption.replace(/\\n/g, '
');\n\n if (!sns_post_caption) {\n sns_post_caption = \"\"\n }\n\n $(\".sns_post_caption_contents\").text(sns_post_caption);\n });\n\n\n // #########################################################################\n // report\n function updateStaffUrlAndRedirect(params, baseUrl = window.location.href) {\n let url = new URL(baseUrl);\n for (const [key, value] of Object.entries(params)) {\n url.searchParams.set(key, value);\n }\n // start_dayおよびend_dayのパラメータがparamsに存在しない場合、これらのパラメータをURLから削除\n if (!params.start_day) {\n url.searchParams.delete('start_day');\n }\n if (!params.end_day) {\n url.searchParams.delete('end_day');\n }\n // 現在の履歴エントリに新しいURLを追加する\n history.pushState({}, '', url.toString());\n // ページをリロードする\n location.reload();\n }\n\n // パラメータを取得する関数\n function getStaffParameters() {\n let params = {\n staff_id: $('.staff_list_select_box option:selected').val(),\n sns_post_id: $('#staff_sns_post_selects option:selected').val(),\n device: $('.staff_device_select').data('device'),\n gf: $('#staff_graph_pattern_select_input').val(),\n start_day: $('#staff_report_start_day').val(),\n end_day: $('#staff_report_end_day').val()\n };\n\n params.start_day = $('#staff_report_start_day').val();\n params.end_day = $('#staff_report_end_day').val();\n\n // if (params.gf === '30') {\n // params.start_day = $('#staff_report_start_day').val();\n // params.end_day = $('#staff_report_end_day').val();\n // } else if (params.gf === '12') {\n // delete params.start_day;\n // delete params.end_day;\n // }\n\n return params;\n }\n\n $('#staff_sns_post_selects').on('change', function () {\n updateStaffUrlAndRedirect(getStaffParameters());\n });\n\n $('#staff_report_start_day, #staff_report_end_day').on('change', function () {\n updateStaffUrlAndRedirect(getStaffParameters());\n });\n\n $('.staff_device_select_all, .staff_device_select_pc, .staff_device_select_phone').on('click', function () {\n let params = getStaffParameters();\n if ($(this).hasClass('staff_device_select_all')) {\n params.device = '2';\n } else if ($(this).hasClass('staff_device_select_pc')) {\n params.device = '0';\n } else if ($(this).hasClass('staff_device_select_phone')) {\n params.device = '1';\n }\n updateStaffUrlAndRedirect(params);\n });\n\n $('.staff_graph_pattern_select_day, .staff_graph_pattern_select_month').on('click', function () {\n let params;\n if ($(this).hasClass('staff_graph_pattern_select_day')) {\n params = getStaffParameters();\n params.gf = '30';\n params.start_day = $('#staff_report_start_day').val();\n params.end_day = $('#staff_report_end_day').val();\n } else if ($(this).hasClass('staff_graph_pattern_select_month')) {\n params = getStaffParameters();\n params.gf = '12';\n params.start_day = $('#staff_report_start_day').val();\n params.end_day = $('#staff_report_end_day').val();\n // delete params.start_day;\n // delete params.end_day;\n }\n updateStaffUrlAndRedirect(params);\n });\n\n $('#ua_staff_group_month_selects').on('change', function () {\n let month = $('#ua_staff_group_month_selects option:selected').val();\n let url = new URL(window.location.href);\n\n if (month != '') {\n if (url.searchParams.has('m')) {\n // 値が \"0\"か\"1\" なら \"2\" に更新する\n let new_value = month;\n // パラメーターの値を更新する\n url.searchParams.set('m', new_value);\n } else {\n // パラメーターにdeviceがない場合\n // 新しいパラメーターを追加する\n url.searchParams.append('m', month);\n }\n\n // 更新されたURLにリダイレクトする\n location.href = url.toString();\n } else {\n // monthが空文字の時は指定したURLにリダイレクトする\n location.href = 'staff_report';\n }\n });\n\n $('#download_staff_csv').on('click', function () {\n let href = '/download_staff_csv';\n href += `?staff_id=${$('.staff_list_select_box option:selected').val()}`;\n href += `&device=${$('.staff_device_select').data('device')}`;\n href += `&start_day=${$('#staff_report_start_day').val()}`;\n href += `&end_day=${$('#staff_report_end_day').val()}`;\n location.href = href;\n });\n\n});\n"],"sourceRoot":""}