text: $(function(){function u(e){if(this===window)return new u(e);this.obj=e||{},this.frameRate=this.obj.frameRate||24,"vobj"===e.type?this.video=e.vobj:this.video=document.getElementById(this.obj.id)||document.getElementsByTagName("video")[0]}(u.prototype={get:function(){return Math.floor(this.video.currentTime.toFixed(5)*this.frameRate)},listen:function(t,e){var a=this;t?this.interval=setInterval(function(){if(!a.video.paused&&!a.video.ended){var e="SMPTE"===t?a.toSMPTE():"time"===t?a.toTime():a.get();return a.obj.callback&&a.obj.callback(e,t),e}},e||1e3/a.frameRate/2):console.log("VideoFrame: Error - The listen method requires the format parameter.")},stopListen:function(){clearInterval(this.interval)},fps:Strack.G.FrameRates}).toTime=function(e){var t="number"!=typeof e?this.video.currentTime:e,a=this.frameRate,i=new Date,e="hh:mm:ss"+("number"==typeof e?":ff":"");function s(e){return e<10?"0"+e:e}return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(1e3*t),e.replace(/hh|mm|ss|ff/g,function(e){switch(e){case"hh":return s(i.getHours()<13?i.getHours():i.getHours()-12);case"mm":return s(i.getMinutes());case"ss":return s(i.getSeconds());case"ff":return s(Math.floor(t%1*a))}})},u.prototype.toSMPTE=function(e){if(!e)return this.toTime(this.video.currentTime);var t=Number(e),a=this.frameRate;function i(e){return e<10?"0"+e:e}var s=60*a,l=(t/(60*a*60)).toFixed(0),e=Number((t/s).toString().split(".")[0])%60,s=Number((t/a).toString().split(".")[0])%60;return i(l)+":"+i(e)+":"+i(s)+":"+i(t%a)},u.prototype.toSeconds=function(e){if(!e)return Math.floor(this.video.currentTime);e=e.split(":");return 60*Number(e[0])*60+60*Number(e[1])+Number(e[2])},u.prototype.toMilliseconds=function(e){var t=e?Number(e.split(":")[3]):Number(this.toSMPTE().split(":")[3]),t=1e3/this.frameRate*(isNaN(t)?0:t);return Math.floor(1e3*this.toSeconds(e)+t)},u.prototype.toFrames=function(e){var t=(e||this.toSMPTE()).split(":"),a=this.frameRate,i=60*Number(t[0])*60*a,e=60*Number(t[1])*a,a=Number(t[2])*a,t=Number(t[3]);return Math.floor(i+e+a+t)},u.prototype.__seek=function(e,t){this.video.paused||this.video.pause();var a=Number(this.get());this.video.currentTime=("backward"===e?a-t:a+t)/this.frameRate+1e-5},u.prototype.seekForward=function(e,t){return e=e||1,this.__seek("forward",Number(e)),!t||t()},u.prototype.seekBackward=function(e,t){return e=e||1,this.__seek("backward",Number(e)),!t||t()},u.prototype.seekTo=function(e){var t,a,i=e||{},s=Object.keys(i)[0];if("SMPTE"===s||"time"===s)return a=i[s],t=this.toMilliseconds(a)/1e3+.001,void(this.video.currentTime=t);switch(s){case"frame":a=this.toSMPTE(i[s]),t=this.toMilliseconds(a)/1e3+.001;break;case"seconds":t=Number(i[s]);break;case"milliseconds":t=Number(i[s])/1e3+.001}isNaN(t)||(this.video.currentTime=t)},obj={toggle_playlist_tab:function(e){if(N(!0)){var t=$(e).data("tab");switch(me(),t){case"task":ge(t,"my_review",!1);break;case"playlist":ge(t,"my_create",!1)}}},toggle_playlist_inside_tab:function(e){N(!0)&&(e=$(e).data("tab"),$("#playlist_inside_my_create,#playlist_inside_all_playlist,#playlist_inside_follow").empty(),me(),fe(e,!1))},toggle_info_tab:function(e){N(!0)&&ve($(e).data("tab"),$(e).html())},hidden_panel:function(e){if(Strack.G.mediaScreenshotStatus)layer.msg(StrackLang.On_Screenshot,{icon:2,time:1200,anim:6});else{var e=$(e).data("pos"),t=$("#st_media_left"),a=($("#st_media_mid"),$("#st_media_right"));switch(e){case"left":N(!0)&&(t.addClass("hidden").hide(),$("#show_bnt_left").addClass("bnt-active"),M());break;case"right":a.addClass("hidden").hide(),$("#show_bnt_right").addClass("bnt-active"),M()}O(e,"show")}},show_panel:function(e){var e=$(e).data("pos"),t=$("#st_media_left"),a=($("#st_media_mid"),$("#st_media_right"));switch(e){case"left":t.removeClass("hidden"),$("#show_bnt_left").removeClass("bnt-active"),M();break;case"right":a.removeClass("hidden"),$("#show_bnt_right").removeClass("bnt-active"),M()}O(e,"hidden")},show_file_grid_panel:function(e){D(e)},toggle_track:function(e){var t=$(e).data("pos"),a=$(".media-player"),i=$(".media-file-grid"),s=$(".file-toolbar"),l=$(".media-player-bottom"),n=$(e).find("i");switch(i.css("height","50px"),s.hide(),t){case"top":$(e).data("pos","bottom"),a.css("height","calc(100% - 59px)"),l.css("height","51px"),n.removeClass("icon-uniE76B").addClass("icon-uniE76C");break;case"bottom":$(e).data("pos","top"),a.css("height","calc(100% - 348px)"),l.css("height","340px"),n.removeClass("icon-uniE76C").addClass("icon-uniE76B")}},playlist_follow:function(e){var t=$(e).data("id"),a=$(e).attr("data-follow"),i="unfollow"===a?"no":"yes";$(e).closest(".play-list-items").hasClass("selected")&&V(i),U(t,a),ke(t,a)},timeline_playlist_follow:function(e){var t=$("#timeline_entity_id").val(),e=$(e).attr("data-follow");V("unfollow"===e?"no":"yes"),U(t,e),ke(t,e)},save_timeline_change:function(e){Strack.G.mediaScreenshotStatus?layer.msg(StrackLang.On_Screenshot,{icon:2,time:1200,anim:6}):pe({mode:"timeline",id:$("#timeline_entity_id").val()})},reload_timeline:function(e){Strack.G.mediaScreenshotStatus?layer.msg(StrackLang.On_Screenshot,{icon:2,time:1200,anim:6}):Q()},player_control:function(e){switch($(e).data("bnt")){case"play":ae();break;case"metadata":de();break;case"fullscreen":!function(){if(Strack.G.mediaScreenshotStatus)layer.msg(StrackLang.On_Screenshot,{icon:2,time:1200,anim:6});else{var e=$("#m_controller_fullscreen"),t=e.data("active");switch(window.fullScreenApi.supportsFullScreen&&(window.fullScreenApi.isFullScreen()?window.fullScreenApi.cancelFullScreen():window.fullScreenApi.requestFullScreen(document.getElementById("st_media_mid"))),t){case"on":e.data("active","off"),e.html('<i class="icon-uniE9B4"></i>');break;case"off":e.data("active","on"),e.html('<i class="icon-uniE9B5"></i>')}}}();break;case"painter":oe();break;case"loop":!function(){var e=$("#m_controller_loop");switch(e.data("loop")){case"all_loop":e.data("loop","once"),e.html('<i class="icon-uniF178"></i>'),E="once";break;case"once":e.data("loop","self_loop"),e.html('<i class="icon-uF0030"></i>'),E="self_loop";break;case"self_loop":e.data("loop","all_loop"),e.html('<i class="icon-uniEA56"></i>'),E="all_loop"}}();break;case"voice":!function(){var e=$("#m_controller_voice");switch(e.data("voice")){case"on":e.data("voice","off"),e.html('<i class="icon-uniEA53"></i>'),j.volume=0,T=0;break;case"off":e.data("voice","on"),e.html('<i class="icon-uniEA50"></i>'),j.volume=1,T=1}}()}},exit_media_painter:function(){oe()},add_playlist:function(e){F("add_playlist"),R("add")},playlist_edit:function(e){e=$(e).data("id");F("modify_playlist"),R("modify",e)},playlist_delete:function(e){!function t(a,i,e){$.ajax({type:"POST",url:MediaPHP.deleteReviewPlaylist,data:{entity_id:a,progress:e},dataType:"json",beforeSend:function(){$.messager.progress({title:StrackLang.Waiting,msg:StrackLang.loading})},success:function(e){$.messager.progress("close"),200===parseInt(e.status)?(Strack.top_message({bg:"g",msg:e.message}),i?fe(l.tab):we(l.dom_id,l,!1)):205003===parseInt(e.status)?$.messager.confirm(StrackLang.Confirmation_Box,StrackLang.Delete_Review_Playlist_Notice,function(e){e&&t(a,i,"continue")}):layer.msg(e.message,{icon:7,time:1200,anim:6})}})}($(e).data("id"),$(e).closest(".play-list-items").hasClass("selected"),"start")},add_file_to_timeline:function(e){!function(){var t=$("#main_datagrid_box"),e=t.datagrid("getSelections");{var a;0<e.length?(a=[],e.forEach(function(e){a.push(e.id)}),$.ajax({type:"POST",url:MediaPHP.getTimeLineFileCommitData,data:JSON.stringify({primary_ids:a.join(","),entity_param:m}),dataType:"json",contentType:"application/json",beforeSend:function(){$.messager.progress({title:StrackLang.Waiting,msg:StrackLang.loading})},success:function(e){J(e.rows),q(),t.datagrid("clearSelections"),$.messager.progress("close")}})):layer.msg(StrackLang.Please_Select_One,{icon:2,time:1200,anim:6})}}()},delete_track_item:function(e){Strack.G.mediaScreenshotStatus?layer.msg(StrackLang.On_Screenshot,{icon:2,time:1200,anim:6}):($(e).data("id"),e=$(e).data("uuid"),$("#track_item_"+e).remove(),function(e){var t,a={};for(t in o)t!==e&&(a[t]=o[t]);o=a}(e),_e())},select_playlist:function(e){var t=$(e).data("id"),a=$(e).data("urltag");$(".play-list-items").removeClass("selected"),$(e).closest(".play-list-items").addClass("selected"),Ce("playlist",a),F("playlist_selected"),I(t,"select")},save_playlist:function(e){pe({mode:$(e).data("mode"),id:$(e).data("id")})},select_track_item:function(e){if(Strack.G.mediaScreenshotStatus)layer.msg(StrackLang.On_Screenshot,{icon:2,time:1200,anim:6});else{e=$(e).closest(".track-item");if(e.hasClass("load-active")){var t,a=e.data("uuid"),i=0;for(t in S)S[t].uuid_md5===a&&(i=t);e=i,se(),Y(e)}else layer.msg(StrackLang.Media_Not_Loaded,{icon:2,time:1200,anim:6})}},search_left_panel:function(){if(Strack.G.mediaScreenshotStatus)layer.msg(StrackLang.On_Screenshot,{icon:2,time:1200,anim:6});else{var e=$(".playlist-tab.active").data("tab"),t=$("#left_search_val").val();0<t.length?l.filter={name:["-lk","%"+t+"%"]}:l.filter="",l.status="new";var a=$(".playlist-inside-tab.active").data("tab");switch(e){case"task":switch(F("review_task"),a){case"my_review":Ce(e,"scene=task-my_review"),we("#playlist_inside_my_review",l,!1);break;case"all_task":Ce(e,"scene=task-all_task"),we("#playlist_inside_all_task",l,!1)}break;case"playlist":switch(F("playlist"),a){case"my_create":Ce(e,"scene=playlist-my_create"),he("#playlist_inside_my_create",l,!1);break;case"all_playlist":Ce(e,"scene=playlist-all_playlist"),he("#playlist_inside_all_playlist",l,!1);break;case"follow":Ce(e,"scene=playlist-follow"),be("#playlist_inside_follow",l,!1)}}}},select_review_task:function(e){var t,a;Strack.G.mediaScreenshotStatus?layer.msg(StrackLang.On_Screenshot,{icon:2,time:1200,anim:6}):(t=$(e).data("id"),a=$(e).data("urltag"),$(".play-list-items").removeClass("selected"),$(e).closest(".play-list-items").addClass("selected"),Ce("review_task",a),F("review_task_selected"),B(t),_=t,ve("note",StrackLang.Feedback))},delete_review_task:function(e){var t,a;Strack.G.mediaScreenshotStatus?layer.msg(StrackLang.On_Screenshot,{icon:2,time:1200,anim:6}):(t=$(e).data("id"),e=$(e).closest(".play-list-items").hasClass("selected"),a=e,$.ajax({type:"POST",url:MediaPHP.deleteReviewTask,data:{base_id:t},dataType:"json",beforeSend:function(){$.messager.progress({title:StrackLang.Waiting,msg:StrackLang.loading})},success:function(e){$.messager.progress("close"),200===parseInt(e.status)?(Strack.top_message({bg:"g",msg:e.message}),a?fe(l.tab,!1):we(l.dom_id,l,!1)):layer.msg(e.message,{icon:7,time:1200,anim:6})}}))},media_edit:function(e){var t=$(e).data("lang");Strack.get_datagrid_select_data("#main_datagrid_box",function(e){Strack.item_operate_dialog(t,{mode:"modify",field_list_type:["edit"],module_id:m.file_commit_module_id,project_id:m.project_id,page:m.page,schema_page:"project_file_commit",type:"update_panel",primary_id:e.join(",")},function(){obj.reset_media_grid()})})},media_delete:function(e){m.module_id=m.file_commit_module_id,m.module_code="file_commit",Strack.ajax_grid_delete("main_datagrid_box","id",StrackLang.Delete_File_Commit_Notice,StrackPHP.deleteGridData,m)},reset_media_grid:function(){$("#main_datagrid_box").datagrid("reload")},close_review_task_details:function(e){var t,a,i,s=$("#review_entity_step_task"),l=s.find(".etask-l-active"),n=!0;0<l.length&&(t=l.attr("id"),a=l.attr("data-stepcode"),i=Strack.check_item_operate_fields("#m_review_task_fields","#m_review_task_item"),Strack.G.entityStepTaskAddData.data[a][t]=i.up_data,i.allow_up?l.addClass("form_ok"):n=!1),n&&($("#step_task_details").hide(),s.find(".stdg-etask-l-item").removeClass("etask-l-active"))},close_review_add_playlist:function(e){$.messager.confirm(StrackLang.Confirmation_Box,StrackLang.Close_Add_Playlist_Notice,function(e){e&&(Strack.G.entityStepTaskAddData.data={},$(".add-review-entity,#step_task_details").hide(),$(".st-media-search,.media-review-list").show(),F("playlist"))})},remove_screenshot:function(e){$(e).closest(".pyn-st-img").remove();e=$("#screenshot_list");0===e.find(".pyn-st-img").length&&e.html('<div class="pyn-st-null">'+StrackLang.Screenshot_Null+"</div>")}};var m=Strack.generate_hidden_param();m.grid_page_id=m.module_code+"_grid_"+m.project_id;var g,f,v,h,y,b,k,w,t,a,i,s,l=m,n=l.filter="",o={},S={},C={},d={},j=null,P=null,r=null,x=!0,c=0,_=0,T=1,E="all_loop",L=$("#media_view_slider"),p={};M(),$("#st_media_wrap").on("mresize",function(e){N(!1)&&M()}),$("#media_player_view").on("mresize",function(e){$e()}),function(){var a=$(".media-player-bottom");a.on("mouseenter",function(e){$(this).addClass("mouse-on")}).on("mouseleave",function(e){$(this).removeClass("mouse-on")});var i=$("#media_player_view");i.on("mouseenter",function(e){$(this).addClass("mouse-on")}).on("mouseleave",function(e){$(this).removeClass("mouse-on")}),Strack.listen_keyboard_event(function(e,t){switch(t.code){case"space":a.hasClass("mouse-on")&&(e.preventDefault(),ae());break;case"left":a.hasClass("mouse-on")&&!Strack.G.mediaScreenshotStatus&&(e.preventDefault(),ie("back"));break;case"right":a.hasClass("mouse-on")&&!Strack.G.mediaScreenshotStatus&&(e.preventDefault(),ie("forward"));break;case"f_key":i.hasClass("mouse-on")&&(e.preventDefault(),$e());break;case"i_key":"yes"===m.rule_web_player_metadata&&(a.hasClass("mouse-on")||i.hasClass("mouse-on"))&&(e.preventDefault(),de());break;case"v_key":"yes"===m.rule_review&&"yes"===m.rule_web_player_painter&&(a.hasClass("mouse-on")||i.hasClass("mouse-on"))&&(e.preventDefault(),oe());break;case"enter":$("#left_search_val").is(":focus")&&(e.preventDefault(),obj.search_left_panel(Strack.get_obj_by_id("left_search_bnt")))}})}(),i=$(".media-player"),s=$(".media-player-bottom"),$(".center-handle").on("mousedown",function(e){e.preventDefault(),t=document.body.clientHeight-110,$("#st_media_mid").on("mousemove",function(e){(a=document.body.clientHeight-e.pageY)<t&&51<=a&&(i.css("height","calc(100% - "+(8+a)+"px)"),s.css("height",a+"px"))}).on("mouseup",function(e){$(this).off("mousemove")})}),$("#video_paint").wPaint({menuDom:"#paint_menu",menuOrientation:"vertical",imageBg:StrackPHP.PUBLIC+"/images/screenshot.png"});var A={url_scene:m.url_scene,url_tab:m.url_tab,url_id:m.url_id,url_item_name:m.url_item_name};function F(e){var t=$("#timeline_playlist_follow"),a=$("#timeline_playlist_save"),i=$("#media_player_disabled"),s=$("#preview_painter_bnt"),l=$("#save_playlist_bnt span"),n=$("#add_playlist_title"),o=$("#st_media_left"),r=$("#st_media_right"),d=$("#st_media_mid"),c=$("#show_bnt_left"),_=$("#show_bnt_right");switch(e){case"playlist":W(),i.show(),t.show(),a.show(),s.hide(),obj.hidden_panel(Strack.get_obj_by_id("top_bnt_right")),D(Strack.get_obj_by_id("grid_button_center"),"bottom"),obj.show_panel(Strack.get_obj_by_id("grid_button_left")),O("right","hidden"),O("center","hidden");break;case"playlist_selected":W(),i.hide(),t.show(),a.show(),s.hide(),D(Strack.get_obj_by_id("grid_button_center"),"bottom"),O("right","hidden"),O("center","show");break;case"add_playlist":case"modify_playlist":W(),$(".st-media-search,.media-review-list").hide(),$(".add-review-entity").show(),"add_playlist"===e?(l.html(StrackLang.Submit_Add_Playlist),n.html(StrackLang.Add_Playlist)):(l.html(StrackLang.Submit_Modify_Playlist),n.html(StrackLang.Modify_Playlist)),i.hide(),t.hide(),a.hide(),D(Strack.get_obj_by_id("grid_button_center"),"top"),O("center","show");break;case"review_task":W(),i.show(),t.hide(),a.show(),s.show(),obj.hidden_panel(Strack.get_obj_by_id("top_bnt_right")),D(Strack.get_obj_by_id("grid_button_center"),"bottom"),obj.show_panel(Strack.get_obj_by_id("grid_button_left")),O("right","hidden"),O("center","hidden");break;case"review_task_selected":W(),$("#screenshot_list").html('<div class="pyn-st-null">'+StrackLang.Screenshot_Null+"</div>"),i.hide(),t.hide(),a.show(),s.show(),obj.show_panel(Strack.get_obj_by_id("grid_button_right")),D(Strack.get_obj_by_id("grid_button_center"),"bottom"),O("right","show"),O("center","show");break;case"review_task_no_left":i.hide(),o.addClass("hidden"),c.hide(),d.removeClass("nine").removeClass("gird-mid-56").removeClass("gird-mid-81").removeClass("gird-mid-full").addClass("gird-mid-75"),r.show();break;case"review_task_no_side":case"playlist_no_side":i.hide(),o.addClass("hidden"),r.addClass("hidden"),c.hide(),_.hide(),d.removeClass("nine").removeClass("gird-mid-56").removeClass("gird-mid-75").removeClass("gird-mid-81").addClass("gird-mid-full")}}function D(t,e){var a=$(t).data("pos"),i=$("#file_grid_panel"),s=$(".media-file-grid"),l=$(".file-toolbar"),n=$(t).closest(".media-file-grid-bnt"),o=$(".media-player-bottom");switch(e||a){case"top":se(),$(t).data("pos","bottom"),i.slideDown(100,"linear",function(){var i;$(t).find("i").removeClass("icon-uniF103").addClass("icon-uniF102"),n.removeClass("grid-bnt-top").addClass("grid-bnt-bottom"),l.show(),(i=$("#main_datagrid_box")).hasClass("datagrid-f")?i.datagrid("reload"):Strack.load_grid_columns("#grid_datagrid_main",{loading_id:"#file_grid_panel",loading_type:"black",page:m.page,schema_page:"project_file_commit",module_id:m.file_commit_module_id,project_id:m.project_id,grid_id:"main_datagrid_box",view_type:"grid",temp_fields:{add:{},cut:{}}},function(e){var t={filter:{temp_fields:{add:{},cut:{}},group:e.grid.group_name,sort:e.grid.sort_config.sort_query,request:[{field:"project_id",field_type:"built_in",editor:"combobox",value:m.project_id,condition:"EQ",module_code:"file_commit",table:"FileCommit"}],filter_input:e.grid.filter_config.filter_input,filter_panel:e.grid.filter_config.filter_panel,filter_advance:e.grid.filter_config.filter_advance},page:m.page,schema_page:"project_file_commit",module_id:m.file_commit_module_id,module_type:m.file_commit_module_type,module_code:m.file_commit_module_code,project_id:m.project_id},a=51<(a=$(".media-player-bottom").height()-53)?a:49,t={url:MediaPHP.getMediaGridData,height:Strack.panel_height("#file_grid_panel",0),view:scrollview,rowheight:50,differhigh:!1,singleSelect:!1,adaptive:{dom:".base-m-grid,.datagrid-filter",min_width:680,exth:a,domresize:1},ctrlSelect:!0,multiSort:!0,DragSelect:!0,moduleId:m.file_commit_module_id,projectId:m.project_id,queryParams:{filter_data:JSON.stringify(t)},panelConfig:{active_filter_id:e.grid.filter_config.filter_id},sortConfig:e.grid.sort_config,sortData:e.grid.sort_config.sort_data,toolbarConfig:{id:"grid_datagrid_main",page:m.page,sortAllow:!0,groupAllow:!0,fieldAllow:!0,viewAllow:!0,actionAllow:!0},searchConfig:{id:"main_grid_search",bar_show:e.grid.filter_bar_show,filterBar:{main_dom:"grid_datagrid_main",bar_dom:"grid_filter_main"}},filterConfig:{id:"grid_filter_main",schema_page:"project_file_commit",loading_type:null,barParam:{}},authorityRules:{filter:{show:m.rule_file_commit_panel_filter,edit:m.rule_file_commit_modify_filter},sort:m.rule_file_commit_sort,group:m.rule_file_commit_group},contextMenuData:{id:"st_menu_media",copy_id:"ac_copy_cell",edit_id:"#grid_datagrid_main .edit-menu",data:[]},columnsFieldConfig:e.grid.columnsFieldConfig,frozenColumns:e.grid.frozenColumns,columns:e.grid.columns,toolbar:"#tb_grid",pagination:!0,pageNumber:1,pageSize:200,pageList:[100,200,300,400,500],pagePosition:"bottom",remoteSort:!1,onDblClickRow:function(e,t){}};$.isEmptyObject(e.grid.group_name)||(t.groupActive=!0,t.groupField=Strack.get_grid_group_field(e.grid.group_name).field,t.groupFormatter=function(e,t){return'<span class="">'+e+"( "+t.length+" )</span>"}),i.datagrid(t).datagrid("enableCellEditing").datagrid("disableCellSelecting").datagrid("gotoCell",{index:0,field:"id"}).datagrid("columnMoving")}),obj.hidden_panel(Strack.get_obj_by_id("top_bnt_right"));var e=0<=(e=o.height()-102)?e:0;s.css("height","calc(100% - "+e+"px)")});break;case"bottom":$(t).data("pos","top"),l.hide(),s.css("height","50px"),n.removeClass("grid-bnt-bottom").addClass("grid-bnt-top"),i.slideUp(100,"linear",function(){$(t).find("i").removeClass("icon-uniF102").addClass("icon-uniF103")})}}function O(e,t){switch(e){case"center":var a=$("#grid_button_center");switch(t){case"show":a.show();break;case"hidden":a.hide()}break;case"left":var i=$("#show_bnt_left");switch(t){case"show":i.show();break;case"hidden":i.hide()}break;case"right":var s=$("#show_bnt_right");switch(t){case"show":"task"===n&&s.show();break;case"hidden":s.hide()}}}function M(){var e,t=$("#st_media_left"),a=$("#st_media_right"),i=$("#st_media_wrap"),s=$("#st_media_mid"),l=t.width(),n=i.width(),o=t.is(":hidden"),r=a.is(":hidden"),d=t.hasClass("hidden"),i=a.hasClass("hidden");d||i||(o||r||l<=330&&(t.hide(),s.removeClass("nine").removeClass("gird-mid-56").addClass("gird-mid-75")),e=a.width(),o=t.is(":hidden"),r=a.is(":hidden"),o&&!r&&(e<=420&&(a.hide(),s.removeClass("nine").removeClass("gird-mid-56").removeClass("gird-mid-75").removeClass("gird-mid-81").addClass("gird-mid-full")),330<.1875*n&&(s.removeClass("nine").addClass("gird-mid-full").removeClass("gird-mid-81").removeClass("gird-mid-75").addClass("gird-mid-56"),t.show(),a.show())),!o&&r&&330<.1875*n&&(s.removeClass("nine").addClass("gird-mid-full").removeClass("gird-mid-81").removeClass("gird-mid-75").addClass("gird-mid-56"),t.show(),a.show()),o&&r&&(420<.25*n&&(s.removeClass("nine").removeClass("gird-mid-56").removeClass("gird-mid-81").removeClass("gird-mid-full").addClass("gird-mid-75"),a.show()),330<.1875*n&&(s.removeClass("nine").removeClass("gird-mid-75").removeClass("gird-mid-81").removeClass("gird-mid-full").addClass("gird-mid-56"),t.show(),a.show()))),d&&i&&s.removeClass("nine").removeClass("gird-mid-56").removeClass("gird-mid-75").removeClass("gird-mid-81").addClass("gird-mid-full"),d&&!i&&(420<.25*n?(a.show(),s.removeClass("nine").removeClass("gird-mid-56").removeClass("gird-mid-81").removeClass("gird-mid-full").addClass("gird-mid-75")):(a.hide(),s.removeClass("nine").removeClass("gird-mid-56").removeClass("gird-mid-75").removeClass("gird-mid-81").addClass("gird-mid-full"))),!d&&i&&(330<.1875*n?(t.show(),s.removeClass("nine").removeClass("gird-mid-56").removeClass("gird-mid-81").removeClass("gird-mid-full").addClass("gird-mid-81")):(t.hide(),s.removeClass("nine").removeClass("gird-mid-56").removeClass("gird-mid-75").removeClass("gird-mid-81").addClass("gird-mid-full")))}function N(e){if(!$(".add-review-entity").is(":visible"))return 1;e&&layer.msg(StrackLang.Close_Add_Playlist_Panel_First,{icon:2,time:1200,anim:6})}function R(t,e){"add"===t?H(t):($.ajax({url:MediaPHP.getPlayEntityInfo,type:"POST",dataType:"json",data:{entity_id:e},beforeSend:function(){$("#st_media_left").append(Strack.loading_dom("black","","edit_playlist"))},success:function(e){z({entity_id:e.id,entity_name:e.name},"modify"),H(t,e),$("#st-load_edit_playlist").remove()}}),I(e,"edit_playlist"))}function H(e,t){$("#review_entity_step_task").empty().append('<div class="datagrid-empty-no">'+StrackLang.Please_Select_Step+"</div>"),"modify"===e?($("#review_entity_name").val(t.name),$("#review_entity_code").val(t.code)):$("#review_entity_name,#review_entity_code").val("");var a=$("#review_entity_status"),e=t?t.status_id:"";a.hasClass("combobox-f")?(a.combobox("clear"),e&&a.combobox("setValue",e)):Strack.combobox_widget("#review_entity_status",{url:StrackPHP.getReviewStatusCombobox,prompt:StrackLang.Select_One_Status,queryParams:m,valueField:"id",textField:"name",width:"100%",height:30,value:e});var i={step_id:"review_entity_step",list_id:"review_entity_step_task",combox_id:"m_review_task_fields",edit_id:"m_review_task_item"},e=$("#review_entity_step");e.hasClass("combobox-f")?(e.combobox("clear"),G(i,t)):Strack.combobox_widget("#review_entity_step",{url:StrackPHP.getReviewStepConfig,prompt:StrackLang.Select_Step,queryParams:m,multiple:!0,valueField:"id",textField:"name",width:"100%",height:30,onSelect:function(e){e&&Strack.add_entity_step_task_group(i,e,"new")},onUnselect:function(e){Strack.remove_entity_step_task_group(i,e)},onLoadSuccess:function(){G(i,t)}})}function G(e,t){var l,n,a=[],i=$("#review_entity_step");if(t){var s,o,r,d=[],c={};for(o in Strack.G.entityStepTaskAddData.data=t.step_data,t.step_data)for(var _ in d.push(t.step_config[o].id),c.id=t.step_config[o].id,c.step_code=t.step_config[o].code,c.step_name=t.step_config[o].name,t.step_data[o])c.code=_,s=s||t.step_data[o][_],Strack.add_entity_step_task_group(e,c,"old");for(r in a=[],s)s[r].forEach(function(e){$.inArray(e.field,["base-id","base-step_id"])<0&&a.push(e.field)});i.combobox("setValues",d)}l=a,n={mode:"create",field_list_type:["edit"],module_id:m.task_module_id,project_id:m.project_id,page:m.page,schema_page:m.page,type:"add_entity_task_panel",not_fields:["entity_id","thumb","step_id"]},Strack.get_item_fields(n,function(a){var t,i=[];for(t in a.field_list)for(var s in a.field_list[t])a.field_list[t][s].fields.forEach(function(e){e.field_group_name=a.field_list[t][s].title,e.project_id=m.project_id,e.module_id=m.module_id,e.frozen_module=e.frozen_module,e.flg_module=e.flg_module,e.fields=e.module+"-"+e.id,i.push(e)});$("#m_review_task_fields").combobox({data:i,width:350,valueField:"fields",textField:"lang",groupField:"field_group_name",multiple:!0,value:"",onSelect:function(e){var t;e&&0===$("#dgup_i_"+e.fields).length&&(t=Strack.field_item_dom(e,n,1),$("#m_review_task_item").append(t.item_dom),Strack.field_item_init(t.dom_id,m.project_id,e),"name"!==e.id&&"code"!==e.id||(e=$("#stdg_etask_list .etask-l-active").find(".etask-l-item-name").html(),$("#"+t.dom_id).val(e)))},onUnselect:function(e){$("#dgup_i_"+e.fields).remove()},onLoadSuccess:function(){var t=$(this);0<l.length?l.forEach(function(e){t.combobox("select",e)}):a.user_setting.forEach(function(e){t.combobox("select",e)})},onChange:function(e,t){$(".stdg-etask-l-item").removeClass("form_ok")}})})}function I(e,t){$.ajax({type:"POST",url:MediaPHP.getPlaylistTimeLineData,data:JSON.stringify({entity_id:e,entity_param:m}),dataType:"json",contentType:"application/json",beforeSend:function(){W(),$.messager.progress({title:StrackLang.Waiting,msg:StrackLang.loading})},success:function(e){"edit_playlist"!==t&&z(e,"timeline"),J(e.rows),q(),$.messager.progress("close"),"edit_playlist"!==t&&Q()}})}function B(e){$.ajax({type:"POST",url:MediaPHP.getReviewTaskTimeLineData,data:JSON.stringify({base_id:e,entity_param:m}),dataType:"json",contentType:"application/json",beforeSend:function(){W(),$.messager.progress({title:StrackLang.Waiting,msg:StrackLang.loading})},success:function(e){z(e,"timeline"),J(e.rows),q(),$.messager.progress("close"),Q()}})}function z(e,t){$(".timeline-playlist-name").html(e.entity_name),$("#timeline_entity_id").val(e.entity_id),$("#save_playlist_bnt").attr("data-mode",t).attr("data-id",e.entity_id),V(e.is_follow)}function V(e){var t=$("#timeline_playlist_follow");"yes"===e?(t.html(StrackLang.UnFollow),t.attr("data-follow","unfollow")):(t.html(StrackLang.Follow),t.attr("data-follow","follow"))}function U(e,t){var a=$("#playlist_item_"+e).find("a.second");switch(t){case"unfollow":a.attr("data-follow","follow"),a.html('<i class="icon-uniEA00"></i>');break;case"follow":a.attr("data-follow","unfollow"),a.html('<i class="icon-uniEA02"></i>')}}function J(e){var t=$("#timeline_track .datagrid-empty-no");0<t.length&&t.remove(),e.forEach(function(e){var t;t=e,$("#timeline_track").append(function(e){var t="";return t+='<li class="text-no-select"><div id="track_item_'+e.uuid_md5+'" class="track-item not-load aign-left" data-id="'+e.id+'" data-uuid="'+e.uuid_md5+'"><div class="item-header"><div class="triangle"></div><div class="version">'+e.version+'</div><a href="javascript:;" class="delete" onclick="obj.delete_track_item(this)" data-id="'+e.id+'" data-uuid="'+e.uuid_md5+'"><i class="icon-uniE6DF"></i></a></div><a href="javascript:;"  class="main" onclick="obj.select_track_item(this)" data-id="'+e.id+'" data-uuid="'+e.uuid_md5+'"><div class="item-thumb"><img src="'+e.thumb+'"></div><div class="item-bottom"><div class="parent text-ellipsis">'+e.task_name+'</div><div class="name text-ellipsis">'+e.name+"</div></div></a></div></li>"}(t)),o[e.uuid_md5]=e}),_e()}function q(){"yes"===m.rule_web_player_drag&&Sortable.create(Strack.get_obj_by_id("timeline_track"),{filter:".triangle,.delete"})}function W(){var e,t;se(),g&&($("#video_main").empty(),cancelAnimationFrame(k),e=$("#m_controller_painter"),t=$(".left-paint"),$("#vp_canvas_wrap").hide(),e.data("active","off"),e.removeClass("mc-active"),t.hide(),L.slider("enable")),$(".timeline-playlist-name").html(StrackLang.Playlist_Name),$("#timeline_entity_id").val(""),$("#save_playlist_bnt").attr("data-mode","add").attr("data-id","0").find("span").html(StrackLang.Save_Timeline),$("#timeline_track").empty(),o={},S={}}function Q(){var t,e=$("#timeline_track").find(".track-item");0<e.length?(se(),S={},e.each(function(e){t=$(this).data("uuid"),$(this).removeClass("not-load").addClass("load-active"),o[t]&&(S[e]=o[t])}),Y(0)):layer.msg(StrackLang.Timeline_Is_Empty,{icon:2,time:1200,anim:6})}function Y(e){var t,a,i=S[w=e];Strack.G.mediaViewPlayIndex=i.id,function(e){{var t,a;"yes"===m.rule_web_player_metadata&&(a=t="",e.forEach(function(e){t+='<li class="meta-title">'+e.lang+"</li>",a+='<li class="meta-show">'+e.value+"</li>"}),$("#metadata_name").empty().append(t),$("#metadata_show").empty().append(a))}}(i.task_info),t=S[w],(a=$("#screenshot_list")).empty(),p[t.id]?p[t.id].forEach(function(e){a.append(re(e))}):a.html('<div class="pyn-st-null">'+StrackLang.Screenshot_Null+"</div>"),$(".track-item").removeClass("item-active"),"yes"===i.media_data.has_media?($("#track_item_"+i.uuid_md5).addClass("item-active"),function(e,t){var a=$("#video_main"),i=Strack.G.mediaViewPlayIndex+"_"+e;g&&cancelAnimationFrame(k);var s=null,l=null;if(C.hasOwnProperty(i)){var n=C[i];j=n.media_obj,s=n.texture,l=n.material,j.setAttribute("isCache","yes"),"video"===t.type&&(P=u({vobj:j,type:"vobj",frameRate:t.rate}))}else{switch(t.type){case"image":(j=document.createElement("img")).src=t.base_url+t.md5_name+"_origin."+t.ext,j.crossOrigin="anonymous";var o=t.base_url+t.md5_name+"_origin."+t.ext,r=new THREE.TextureLoader;r.crossOrigin="anonymous",s=r.load(o);break;case"video":(j=document.createElement("video")).src=t.base_url+t.md5_name+"."+t.ext,j.crossOrigin="anonymous",P=u({vobj:j,type:"vobj",frameRate:t.rate}),j.width=t.width,j.height=t.height,(s=new THREE.Texture(j)).minFilter=THREE.LinearFilter,s.magFilter=THREE.LinearFilter,s.format=THREE.RGBFormat}l=new THREE.MeshLambertMaterial({map:s,side:THREE.FrontSide}),C[i]={media_obj:j,texture:s,material:l},j.setAttribute("isCache","no")}var d=a.width(),c=a.height(),_=d/c,n=t.width/t.height,i=0,a=0;a=_<n?(i=d)/n:(i=c*n,c);x?(f=new THREE.WebGLRenderer({antialias:!0}),v=new THREE.PerspectiveCamera(90,d/c,.1,1e4),(g=new THREE.Scene).add(v),v.position.z=c/2,f.setSize(d,c),document.getElementById("video_main").appendChild(f.domElement),h=new THREE.AmbientLight(16777215),g.add(h),y=new THREE.TrackballControls(v,f.domElement),(b=new THREE.Mesh(new THREE.PlaneGeometry(i,a),l)).name="main_version",g.add(b)):(f.setSize(d,c),$("#video_main canvas").length<=0&&document.getElementById("video_main").appendChild(f.domElement),v.aspect=d/c,v.position.z=c/2,v.updateProjectionMatrix(),b.geometry.vertices[0].x="-"+i/2,b.geometry.vertices[0].y=a/2,b.geometry.vertices[1].x=i/2,b.geometry.vertices[1].y=a/2,b.geometry.vertices[2].x="-"+i/2,b.geometry.vertices[2].y="-"+a/2,b.geometry.vertices[3].x=i/2,b.geometry.vertices[3].y="-"+a/2,b.geometry.verticesNeedUpdate=!0,b.material=l,b.material.needsUpdate=!0);switch(function(e){S[e].position&&(v.position.z=S[e].position.camera_zoom,v.position.x=S[e].position.camera_x,v.position.y=S[e].position.camera_y,y.target.x=S[e].position.camera_x,y.target.y=S[e].position.camera_y,v.updateProjectionMatrix(),b.position.set(S[e].position.plane_x,S[e].position.plane_y,0))}(e),function e(){y.update();p();k=requestAnimationFrame(e)}(),t.type){case"image":X(t,1);break;case"video":var m=j.getAttribute("iscache");"no"===m&&j.load(),j.oncanplay=function(t,e){j.volume=T,j.currentTime=0;var a=j.play();{var i;"no"===e&&(i=0,j.addEventListener("loadedmetadata",function(){i=Strack.time_to_frame(j.duration,t.rate),ne(t,i)}),j.addEventListener("timeupdate",function(){var e=Strack.time_to_frame(this.currentTime,t.rate);L.hasClass("load-ac")&&L.slider("setValue",e),ce(e,i)}),j.addEventListener("ended",function(){K(w),"self_loop"===E?Y(w):Z()}))}void 0!==a&&a.then(function(e){le("pause")}).catch(function(e){console.log("当前浏览器不允许视频自动播放")})}(t,m)}function p(){"video"===t.type&&s&&j.readyState===j.HAVE_ENOUGH_DATA&&(s.needsUpdate=!0),f.clear(),f.render(g,v),x=!1}}(e,i.media_data.param)):layer.msg(StrackLang.Media_Data_Not_Exist,{icon:2,time:1200,anim:6})}function K(e){S[e].position={camera_x:v.position.x,camera_y:v.position.y,plane_x:b.position.x,plane_y:b.position.y,camera_zoom:v.position.z}}function X(e,t){var a=1e3/Strack.G.FrameRates.film;le("pause"),ne(e,72),r=setInterval(function(){t++,L.slider("setValue",t),ce(t,72),72===t&&(K(w),"self_loop"===E?t=1:(te(),Z()))},a)}function Z(){var e=0,t=!1;parseInt(w)<Object.keys(S).length-1?e=parseInt(w)+1:t=!(e=0),"once"!==E||"once"===E&&!t?Y(e):(se(),le("play"))}function ee(){j&&(j.pause(),le("play"))}function te(){r&&(window.clearInterval(r),r=null,le("play"))}function ae(e){if(j){var t=e||$("#m_controller_player").data("status"),a=S[w].media_data.param;switch(a.type){case"image":"play"===t?te():X(a,L.slider("getValue"));break;case"video":"play"===t?ee():j&&(j.play(),le("pause"))}Strack.G.mediaScreenshotStatus&&oe()}}function ie(e){if(!$.isEmptyObject(S))switch(S[w].media_data.param.type){case"image":te();var t=parseInt(L.slider("getValue")),a=0,a="back"===e?1<t?t-1:1:t+1;L.slider("setValue",a),ce(a,72);break;case"video":ee(),"back"===e?P.seekBackward(1):P.seekForward(1)}}function se(){if(!$.isEmptyObject(S))switch(S[w].media_data.param.type){case"image":te();break;case"video":ee()}}function le(e){var t=$("#m_controller_player");switch(e||t.data("status")){case"pause":t.data("status","play"),t.html('<i class="icon-uniEA46"></i>');break;case"play":t.data("status","pause"),t.html('<i class="icon-uniEA45"></i>')}}function ne(t,a){L.hasClass("load-ac")?L.slider("setOptions",{max:a}):(L.find(".default-show").remove(),L.addClass("load-ac"),L.slider({mode:"h",min:1,max:a,height:14,step:1,progressbar:!0,onComplete:function(e){e<a&&(e=(e/t.rate).toFixed(2),"video"===t.type&&(j.currentTime=e))}}))}function oe(){if(g){var e=$("#m_controller_painter"),t=e.data("active"),a=$(".left-paint"),i=$(".media-file-grid");switch(t){case"on":Strack.G.mediaScreenshotStatus=!1,e.data("active","off"),e.removeClass("mc-active"),a.hide(),L.slider("enable"),L.slider("setValue",c),function(){var e=$("#video_paint");$("#vp_canvas_wrap").hide(),e.wPaint("clearUndo");var t=e.wPaint("image");$(".pyn-st-null").remove();e=S[w];p[e.id]&&p[e.id].length<20?p[e.id].push(t):p[e.id]=[t];$("#screenshot_list").append(re(t))}(),i.show();break;case"off":$("#screenshot_list .pyn-st-img").length+1<=20?(i.hide(),ae("play"),L.slider("disable"),c=L.slider("getValue"),e.data("active","on"),e.addClass("mc-active"),a.show(),s=$("#video_paint"),l=$("#video_main"),n=l.width(),l=l.height(),s.css({width:n,height:l}),$("#video_paint canvas").attr({width:n,height:l}),s.wPaint("imageBg",(f.render(g,v),f.domElement.toDataURL())),$("#vp_canvas_wrap").show(),Strack.G.mediaScreenshotStatus=!0):layer.msg(StrackLang.Only_Supports_Twenty_Screenshots,{icon:2,time:1200,anim:6})}}var s,l,n}function re(e){var t="";return t+='<div class="pyn-st-img aign-left"><img src="'+e+'"><div class="frame">'+c+'</div><a href="javascript:;" class="pyn-st-delete" onclick="obj.remove_screenshot(this)"><i class="icon-uniE6DB"></i></a></div>'}function de(){if(g){var e=$("#m_controller_metadata"),t=e.data("active");switch($("#media_metadata_wrap").toggle(),t){case"on":e.data("active","off"),e.removeClass("mc-active");break;case"off":e.data("active","on"),e.addClass("mc-active")}}}function ce(e,t){t="<span>"+Strack.prefix_integer(e,t.toString().length)+"</span> / <span>"+t+"</span>";$("#preview_frame").html(t)}function _e(){var e=$("#timeline_track"),t=200*e.find(".track-item").length;e.css("width",t)}function me(){$("#left_search_val").val(""),l.filter=""}function pe(t){var e,a,i,s,l=!0,n={},o={mode:t.mode,entity_param:m,entity_id:t.id,entity_data:{},step_ids:[],task_rows:{},file_commit_ids:[]};0<=$.inArray(t.mode,["add","modify"])?(s=Strack.validate_form("add_playlist_form"),404===parseInt(s.status)?l=!1:o.entity_data=s.data,l&&($.isEmptyObject(Strack.G.entityStepTaskAddData.data)?(l=!1,layer.msg(StrackLang.Please_Select_Step,{icon:2,time:1200,anim:6})):(0<(e=$("#review_entity_step_task").find(".etask-l-active")).length&&(a=e.attr("id"),i=e.attr("data-stepcode"),s=Strack.check_item_operate_fields("#m_review_task_fields","#m_review_task_item"),Strack.G.entityStepTaskAddData.data[i][a]=s.up_data,s.allow_up&&e.addClass("form_ok")),Strack.G.entityStepTaskAddData.status=!0,"modify"!==t.mode&&$(".stdg-etask-l-item").each(function(){$(this).hasClass("form_ok")||(Strack.G.entityStepTaskAddData.status=!1)}),Strack.G.entityStepTaskAddData.status?(o.task_rows=Strack.G.entityStepTaskAddData.data,o.step_ids=$("#review_entity_step").combobox("getRowValues","id")):(l=!1,layer.msg(StrackLang.Please_Fill_Step_Task_Data,{icon:2,time:1200,anim:6})))),l&&(n=ue(),o.file_commit_ids=n.file_commit_ids,l=n.allow_up)):(n=ue(),o.file_commit_ids=n.file_commit_ids,l=n.allow_up),l&&$.ajax({type:"POST",url:MediaPHP.savePlaylist,data:JSON.stringify(o),dataType:"json",contentType:"application/json",beforeSend:function(){$.messager.progress({title:StrackLang.Waiting,msg:StrackLang.loading})},success:function(e){$(".add-review-entity").is(":visible")&&"add"===t.mode&&(W(),Strack.G.entityStepTaskAddData.status=!1,Strack.G.entityStepTaskAddData.data={},$("#review_entity_name,#review_entity_code").val(""),$("#review_entity_status,#review_entity_step").combobox("clear"),$("#review_entity_step_task").empty().append('<div class="datagrid-empty-no">'+StrackLang.Please_Select_Step+"</div>")),$.messager.progress("close"),200===parseInt(e.status)?Strack.top_message({bg:"g",msg:e.message}):layer.msg(e.message,{icon:7,time:1200,anim:6})}})}function ue(){var t,e=$("#timeline_track").find(".track-item"),a=[],i=!0;return 0<e.length?(t=0,e.each(function(e){t=$(this).data("id"),a.push({id:t,index:e+1})})):(i=!1,layer.msg(StrackLang.Please_Add_FileCommit_To_Timeline,{icon:2,time:1200,anim:6})),{allow_up:i,file_commit_ids:a}}function ge(e,t,a){if(Strack.G.mediaScreenshotStatus)layer.msg(StrackLang.On_Screenshot,{icon:2,time:1200,anim:6});else{n=e,a||me(),$(".media-review-list .pitem-wrap").removeClass("active"),$(".playlist-tab").each(function(){$(this).data("tab")===e?$(this).addClass("active"):$(this).removeClass("active")}),$("#media_review_"+e).addClass("active");var i=$("#grid_button_left span");switch(e){case"task":i.html(StrackLang.Review_Task),fe(t,a);break;case"playlist":i.html(StrackLang.Playlist),fe(t,a)}}}function fe(e,t){if(Strack.G.mediaScreenshotStatus)layer.msg(StrackLang.On_Screenshot,{icon:2,time:1200,anim:6});else switch($(".inside-wrap-playlist").removeClass("active"),$(".playlist-inside-tab").each(function(){$(this).data("tab")===e?$(this).addClass("active"):$(this).removeClass("active")}),$("#playlist_inside_"+e).addClass("active"),l.status="new",l.page_number=1,l.page_size=100,l.tab=e){case"my_review":Ce(e,"scene=task-my_review"),F("review_task"),l.type="my",we(l.dom_id="#playlist_inside_my_review",l,t);break;case"all_task":Ce(e,"scene=task-all_task"),F("review_task"),l.type="all",we(l.dom_id="#playlist_inside_all_task",l,t);break;case"my_create":Ce(e,"scene=playlist-my_create"),F("playlist"),l.type="my",he(l.dom_id="#playlist_inside_my_create",l,t);break;case"all_playlist":Ce(e,"scene=playlist-all_playlist"),F("playlist"),l.type="all",he(l.dom_id="#playlist_inside_all_playlist",l,t);break;case"follow":Ce(e,"scene=playlist-follow"),F("playlist"),be("#playlist_inside_follow",l,t)}}function ve(e,t){switch($(".media-right-wrap .pitem-wrap").removeClass("active"),$(".media-info-tab").each(function(){$(this).data("tab")===e?$(this).addClass("active"):$(this).removeClass("active")}),$("#media_info_"+e).addClass("active"),$("#grid_button_right span").html(t),e){case"note":a={item_id:(a=d[_]).id,item_name:a.name,module_id:m.task_module_id,module_code:"base",module_type:"fixed",project_id:m.project_id,template_id:m.template_id,status:"new",page_number:1,page_size:20},Strack.load_notes({page_id:".st-media-wrap",content_id:"#media_info_note",avatar_id:"",editor_id:"comments_editor",list_id:"comments_list",tab_id:".info-tab",details_top_bar:!1,tab_bar_id:""},a);break;case"progress":$.ajax({type:"POST",url:MediaPHP.getReviewEntityProgress,data:{base_id:_},dataType:"json",beforeSend:function(){$("#st_media_right").prepend(Strack.loading_dom("black","","progress"))},success:function(e){$("#st-load_progress").remove(),function(e){var t,a,i="";for(a in e)t="",0<e[a].list.length&&(e[a].list.forEach(function(e){t+=function(e){var t="",a="done"===e.status?"completed":"",i="yes"===e.active?"active":"",s="",l="";e.note&&(s=e.note.created_by,l=e.note.text);return t+='<div class="'+a+" "+i+' active step"><i class="remove icon"></i><div class="content"><div class="title">'+s+'</div><div class="description">'+l+"</div></div></div>"}(e)}),i+=function(e,t){var a="";return a+='<div class="ui fluid vertical steps"><div class="step-title">'+e+"</div>"+t+"</div>"}(e[a].step_name,t));var s=$("#review_entity_progress");i?s.empty().append(i):s.html('<div class="etask-right-null"><div class="datagrid-empty-no">'+StrackLang.Datagird_No_Data+"</div></div>")}(e)}});break;case"details":a={category:"review_task",item_id:_,item_name:"",module_code:"base",module_id:m.task_module_id,schema_page:"project_base",module_type:"fixed",project_id:m.project_id,template_id:m.template_id},Strack.load_info_panel({id:"#media_base_info",mask:"media_base_info",pos:"review_task",url:MediaPHP.getReviewTaskInfoData,data:a,loading_type:"black"},function(e){e=e.media_data;e.link_id=m.project_id,e.module_id=m.task_module_id,e.param.icon="icon-uniE61A",Strack.thumb_media_widget("#media_base_thumb",e,{modify_thumb:m.rule_thumb_modify,clear_thumb:m.rule_thumb_clear})})}var a}function he(a,i,s){$.ajax({type:"POST",url:MediaPHP.getReviewPlaylist,data:JSON.stringify(i),dataType:"json",contentType:"application/json",beforeSend:function(){$("#st_media_left").prepend(Strack.loading_dom("black","","all"))},success:function(e){var t=i.status;"new"===i.status&&(0<e.total?$(a).empty():$(a).empty().append('<div class="datagrid-empty-no">'+StrackLang.Datagird_No_Data+"</div>"),i.status="more",i.total=e.total,Strack.fall_load_data(a,i,function(e){he(a,i,s)})),ye(a,i,e.rows),"new"===t&&s&&A.select_id&&obj.select_playlist(Strack.get_obj_by_id(A.select_id)),$("#st-load_all").remove()}})}function ye(t,a,e){var i,s="pl_group_"+a.tab+"_";e.forEach(function(e){i=s+e.group_md5,0===$("#"+i).length&&$(t).append(Se(i,e)),$("#"+i).find(".plist-left-bar").append(function(e,t){var a="",i="scene=playlist-"+e+"-"+t.id,s="",l="";l="yes"===t.is_follow?(s="unfollow",'<i class="icon-uniEA02"></i>'):(s="follow",'<i class="icon-uniEA00"></i>');a+='<li id="playlist_item_'+t.id+'" class="play-list-items"><a id="item_playlist_'+t.id+'" href="javascript:;" class="choice" onclick="obj.select_playlist(this)"  data-id="'+t.id+'" data-urltag="'+i+'">'+function(e){for(var t="",a=e.length;a<4;a++)e[a]=StrackPHP.IMG+"/thumb_media_min.jpg";return t+='<div class="playlist-thumb aign-left"><div class="p-thumb-top"><div class="p-thumb-img" style="margin-right:2px"><img src="'+e[0]+'"></div><div class="p-thumb-img"><img src="'+e[1]+'"></div></div><div class="p-thumb-bottom"><div class="p-thumb-img" style="margin-right:2px"><img src="'+e[2]+'"></div><div class="p-thumb-img"><img src="'+e[3]+'"></div></div></div>'}(t.thumb)+'<div class="playlist-name aign-left"><div class="list-name-top text-ellipsis"><span class="list_createby">'+t.created_by+'</span></div><div class="list-name-bottom text-ellipsis">'+t.name+"</div></div></a>","yes"===m.rule_playlist_delete&&(a+='<a href="javascript:;" class="playlist-button first" onclick="obj.playlist_delete(this)" data-id="'+t.id+'"><i class="icon-uniE6DB"></i></a>');"yes"===m.rule_playlist_follow&&(a+='<a href="javascript:;" class="playlist-button second" onclick="obj.playlist_follow(this)" data-id="'+t.id+'" data-tab="'+e+'" data-follow="'+s+'">'+l+"</a>");"yes"===m.rule_playlist_modify&&(a+='<a href="javascript:;" class="playlist-button third" onclick="obj.playlist_edit(this)" data-id="'+t.id+'"><i class="icon-uniE684"></i></a>');return a+="</li>"}(a.tab,e))})}function be(a,i,s){$.ajax({type:"POST",url:MediaPHP.getReviewFollowPlaylist,data:JSON.stringify(i),dataType:"json",contentType:"application/json",beforeSend:function(){$("#st_media_left").prepend(Strack.loading_dom("black","","follow"))},success:function(e){var t=i.status;"new"===i.status&&(0<e.total?$(a).empty():$(a).empty().append('<div class="datagrid-empty-no">'+StrackLang.Datagird_No_Data+"</div>"),i.status="more",i.total=e.total,Strack.fall_load_data(a,i,function(e){he(a,i,s)})),ye(a,i,e.rows),"new"===t&&s&&A.select_id&&obj.select_playlist(Strack.get_obj_by_id(A.select_id)),$("#st-load_follow").remove()}})}function ke(e,t){$.ajax({type:"POST",url:MediaPHP.followReviewPlaylist,data:JSON.stringify({entity_id:e,mode:t,entity_param:m}),dataType:"json",contentType:"application/json",beforeSend:function(){$.messager.progress({title:StrackLang.Waiting,msg:StrackLang.loading})},success:function(e){$.messager.progress("close")}})}function we(n,o,r){$.ajax({type:"POST",url:MediaPHP.getReviewTaskList,data:JSON.stringify(o),dataType:"json",contentType:"application/json",beforeSend:function(){$("#st_media_left").prepend(Strack.loading_dom("black","","all"))},success:function(e){var t,a,i,s,l=o.status;"new"===l&&(d={},$(n).empty(),0===parseInt(e.total)&&$(n).html('<div class="datagrid-empty-no">'+StrackLang.Datagird_No_Data+"</div>"),o.status="more",o.total=e.total,Strack.fall_load_data(n,o,function(e){we(n,o,r)})),t=n,a=o,e=e.rows,i="pl_group_"+a.tab+"_",s="",e.forEach(function(e){d[e.id]=e,s=i+e.group_md5,0===$("#"+s).length&&$(t).append(Se(s,e)),$("#"+s).find(".plist-left-bar").append(function(e,t){var a="",i="scene=task-"+e+"-"+t.id,e=t.thumb||StrackPHP.IMG+"/excel/excel_tasks.png";a+='<li id="review_task_item_'+t.id+'" class="play-list-items"><a id="item_task_'+t.id+'" href="javascript:;" class="choice" onclick="obj.select_review_task(this)"  data-id="'+t.id+'" data-urltag="'+i+'"><div class="task-thumb aign-left"><img src="'+e+'"></div><div class="playlist-name text-ellipsis aign-left"><div class="list-name-top"><span class="list_createby">'+t.created_by+'</span></div><div class="list-name-bottom">'+t.name+"</div></div></a>","yes"===m.rule_task_delete&&(a+='<a href="javascript:;" class="playlist-button first" onclick="obj.delete_review_task(this)" data-id="'+t.id+'"><i class="icon-uniE6DB"></i></a>');return a+="</li>"}(a.tab,e))}),"new"===l&&r&&A.select_id&&obj.select_review_task(Strack.get_obj_by_id(A.select_id)),$("#st-load_all").remove()}})}function Se(e,t){var a="";return a+='<div id="'+e+'" class="playlist-item-group"><div class="playlist-group-title"><div class="playlist-g-name aign-left"><i class=" icon-uniE717 icon-left"></i>'+t.group_name+'</div><a href="javascript:;" class="playlist-g-bnt aign-right" onclick="obj.toggle_playlist_group(this)" data-groupid="'+e+'"><i class="icon-uniF106 sidebar-icon"></i></a></div><div class="playlist-group-list" id="playlist-group-list1"><ul class="plist-left-bar"></ul></div></div>'}function $e(){var e,t,a,i;g&&!Strack.G.mediaScreenshotStatus&&(i=(t=(e=$("#video_main")).width())/(a=e.height()),e.find("canvas").css({width:t,height:a}),v.position.z=a/2,v.aspect=i,v.updateProjectionMatrix(),b.position.set(y.target.x,y.target.y,0),f.setSize(t,a))}function Ce(e,t){var a=m.project_id+".html";t&&(a+="?"+t),history.replaceState(null,e,a)}!function(){if(0<=$.inArray(A.url_scene,["task","playlist"])&&0<=$.inArray(A.url_tab,["my_review","all_task","my_create","all_playlist","follow"])&&A.url_id&&A.url_item_name)if("yes"===m.rule_palylist)$("#left_search_val").val(A.url_item_name),l.filter={name:["-lk","%"+A.url_item_name+"%"]},A.select_id="item_"+A.url_scene+"_"+A.url_id,ge(A.url_scene,A.url_tab,!0);else switch(A.url_scene){case"task":_=A.url_id,d[_]={id:_,name:A.url_item_name},"no"===m.rule_review?(F("review_task_no_left"),B(A.url_id),ve("note",StrackLang.Feedback)):(F("review_task_no_side"),B(A.url_id));break;case"playlist":F("playlist_no_side"),I(A.url_id,"select")}else{var e="task",t="my_review";switch(A.url_scene){case"task":e=A.url_scene,0<=$.inArray(A.url_tab,["my_review","all_task"])&&(t=A.url_tab);break;case"playlist":e=A.url_scene,0<=$.inArray(A.url_tab,["my_create","all_playlist","follow"])&&(t=A.url_tab)}ge(e,t,!1)}}()});