123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633 |
- /* var pageCount = 0 ; */
- var vu ;
- var pos = {afterX:-1,afterY:-1,nowX:0,nowY:0};
- var timer ;
- $(function(){
- vu = new VideoUtil();
-
- vu.set_inter(setInterval(function(){
- var timer = vu.get_timer() + 1 ;
- vu.set_timer(timer);
- }, 1000));
-
- $(document).mousemove(function(e){
- showcoords(event,this);
- });
-
- var bw = $(window).height() - 30;
- $("#main_tab").css({width:"100%",height:bw+"px"});
- $("#side_bar").css({width:"100%",height:bw+"px"});
-
- $(window).resize(function(){
- var bw = $(window).height() - 30;
- $("#main_tab").css({width:"100%",height:bw+"px"});
- $("#side_bar").css({width:"100%",height:bw+"px"});
-
- $(".video_count").each(function(i){
- var id = $(this).attr("id");
- var w = $(this).width();
- var h = $(this).height();
- CKobject.getObjectById("ck_" + id ).width = w ;
- CKobject.getObjectById("ck_" + id ).height = h ;
- });
- });
-
- vu.countList( vu.nextPage,"\".np\"");
- /*jQuery(function($) {
- $('div.mousewheel_example')
- .bind('mousewheel', function(event, delta) {
- var dir = delta > 0 ? 'Up' : 'Down',
- vel = Math.abs(delta);
- $(this).text(dir + ' at a velocity of ' + vel);
- return false;
- });
- }); */
- waterMark();
- });
- $(function(){
- $("body").mouseover(function(){
- $(".search_emer_video").show();
- });
-
- $("body").mouseout(function(){
- $(".search_emer_video").hide();
- });
-
- $(".search_emer_video").click(function(){
- if($(".rsc").is(":hidden")){
- $("td").eq(0).animate({width:"70%"},1000);
- $("td").eq(1).fadeIn(1000);
- }else{
-
- $("td").eq(0).animate({width:"100%"},1000);
- $("td").eq(1).fadeOut(1000);
- }
-
- });
- });
- /* 视频工具栏展示 */
- $(".bar").live("click",function(){
- if($(this).hasClass("bar_hide")){
- var id = $(this).attr("id");
-
- $(this).next().empty();
- $(this).removeClass("bar_hide");
- $(this).next().slideDown(600);
-
- var bw = $(this).next().next().width();
- var bl = $(this).width();
- var ost = $(this).offset().top;
- var osl = $(this).offset().left;
-
- $(this).next().width(bw-bl);
- $(this).next().css({top:ost,left:osl+bl});
- /*$(this).next().append("<button class=\"btn open\" id=\"btn_oc_des\">打开/关闭描述</button>" +
- "<button class=\"btn open\" id=\"btn_pg_des\">暂停/继续描述</button>" +
- "<button class=\"btn open\" id=\"btn_oc_adju\">打开/关闭调整</button>" +
- "<button class=\"btn open\" id=\"btn_oc_video\">添加/关闭视频</button>");*/
- /* $(this).next().append("<button class=\"btn open\" id=\"btn_oc_des\">打开/关闭描述</button>" +
- "<button class=\"btn open\" id=\"btn_oc_adju\">打开/关闭调整</button>" +
- "<button class=\"btn open\" id=\"btn_oc_video\">添加/关闭视频</button>");*/
- $(this).next().append("<button class=\"btn open\" id=\"btn_oc_des\">打开/关闭描述</button>" +
- "<button class=\"btn open\" id=\"btn_oc_adju\">打开/关闭调整</button>" );
-
- var interval = setInterval(function(){
- if(vu.get_timer() >= 10){
- $("#"+id).addClass("bar_hide") ;
- $("#"+id).next().slideUp(600) ;
- vu.set_timer(0) ;
- clearInterval(vu.get_interval());
- }
- },10000);
- vu.set_interval(interval);
-
- };
- // <div class=\"bar\"></div>
- // <div class=\"bar_count\"></div>
- // <div id=\"one_v\" class=\"four_coun coun_top coun_left fib ao_four await_orders video_count\"></div>" +
- });
- /* 监听鼠标是否移动 */
- function showcoords(e,obj){
- var event = window.event || e;
-
- if(pos.nowX==e.clientX && pos.nowY == e.clientY){
- // no move
- }else{
- // move
- pos.afterX = pos.nowX ;
- pos.afterY = pos.nowY ;
- pos.nowX = event.clientX;
- pos.nowY = event.clientY;
- vu.set_timer(0);
- }
- };
- /* 鼠标离开工具条事件绑定 */
- $(".bar_count").live("mouseleave",function(){
- var id = $(this).attr("id");
- clearInterval(vu.get_interval());
- var ml_timer = setTimeout(function(){
- $("#"+id).prev().addClass("bar_hide");
- $("#"+id).slideUp(600);
- },3000);
- vu.set_ml_timer(ml_timer);
- });
- /* 鼠标移入工具条事件绑定 */
- $(".bar_count").live("mouseover",function(){
- clearInterval(vu.get_ml_timer());
- });
- /* 点击搜索框清空水印 */
- $("#svp").mousedown(function(){
- if($("#svp").find("watermark")){
- $(this).removeClass("watermark");
- $(this).val("");
- }
- });
- /* 搜索框焦点失去 */
- $("#svp").focusout(function(){
- if($("#svp").val()==""){
- waterMark() ;
- }
- });
- /* 搜索框得到焦点 */
- $("#svp").keydown(function(event){
- if(event.keyCode==13){
- var params = $("#svp").val() == "输入部门、上传人进行查询" ? "" : $("#svp").val() ;
-
- if(!params == ""){
- $("#searbut").addClass("key_search");
- }
- vu.sbcList(vu.nextPage, "\".np\"", params);
- };
- });
- /* 搜索框显示水印 */
- function waterMark(){
- $("#svp").addClass("watermark");
- $("#svp").val("输入部门、上传人进行查询");
- }
- /* 点击搜索框清除水印 */
- function downClearWM(){
-
- }
- /* 侧边描述信息隐藏/显示条 */
- $(".rc").on({
- "mouseenter":function(){
- if($(".rsc").is(":hidden")){
- clearTimeout(timer);
- setTimeout(function(){
- $("td").eq(0).animate({width:"70%"},1000);
- $("td").eq(1).fadeIn(1000);
- },500);
- }
- },
- "mouseleave":function(){
- clearTimeout(timer);
- }
- });
-
- /* 下一页 */
- function nextPage(){
- vu.nextPage("\".np\"");
- };
- /*$(".np").on("click",function(){
- vu.nextPage("\".np\"");
- });*/
-
- /* 上一页 */
- function lastPage(){
- vu.lastPage("\".lp\"");
- };
- /*$(".lp").on({"click":function(){
- vu.lastPage("\".lp\"");
- }});*/
- /* 侧面关闭按钮 */
- $(".close").on({
- "click":function(){
- $("td").eq(0).animate({width:"100%"},1000);
- $("td").eq(1).fadeOut(1000);
- }
- });
- /* 打开关闭描述按钮绑定事件 */
- $("#btn_oc_des").live("click",function(){
- timer = 0 ;
- var id = $(this).parent().next().attr("id");
- if($(this).parent().prev().hasClass("one_open")){
-
- $(this).parent().prev().removeClass("one_open");
- $(this).parent().prev().addClass("one_close");
- CKobject.getObjectById("ck_" + id).marqueeClose();
-
- }else{
- $(this).parent().prev().removeClass("one_close");
- $(this).parent().prev().addClass("one_open");
- CKobject.getObjectById("ck_" + id).marqueeLoad(true);
- }
- });
- /* 暂停继续按钮绑定事件 */
- /*$("#btn_pg_des").live("click",function(){
- timer = 0 ;
- var id = $(this).parent().next().attr("id");
- if($(this).parent().prev().hasClass("two_open")){
-
- $(this).parent().prev().removeClass("two_open");
- $(this).parent().prev().addClass("two_close");
- CKobject.getObjectById("ck_" + id).frontAdPause();
-
- }else{
- $(this).parent().prev().removeClass("two_close");
- $(this).parent().prev().addClass("two_open");
- CKobject.getObjectById("ck_" + id).frontAdPause(false);
-
- }
- });*/
- /* 打开关闭调整按钮绑定事件 */
- $("#btn_oc_adju").live("click",function(){
- timer = 0 ;
- var id = $(this).parent().next().attr("id");
- if($(this).parent().prev().hasClass("three_open")){
-
- $(this).parent().prev().removeClass("three_open");
- $(this).parent().prev().addClass("three_close");
- CKobject.getObjectById('ck_'+id).plugin('adjustment.swf',true);
-
- }else{
- $(this).parent().prev().removeClass("three_close");
- $(this).parent().prev().addClass("three_open");
- CKobject.getObjectById('ck_'+id).plugin('adjustment.swf',false);
- }
- });
- /* 打开关闭视频按钮绑定事件 */
- $("#btn_oc_video").live("click",function(){
- timer = 0 ;
- if($(this).parent().prev().hasClass("four_open")){
- $(this).parent().prev().removeClass("four_open");
- $(this).parent().prev().addClass("four_close");
- }else{
- $(this).parent().prev().removeClass("four_close");
- $(this).parent().prev().addClass("four_open");
- }
- });
- VideoUtil = function(){
- var _this=this;
- var pageCount = 0 ;
- var pageNum = 0 ;
- var pageList = 0 ;
- var screen = 1 ;
- var screen_class = "ao_one" ; /* 当前布局样式 */
- var load_flag = true ;
- var replace_class = {"x":"await_orders","y":"other_await"}; /* 下一个替换样式组 */
-
- var interval = "" ;
- var inter = "" ;
- var timer = 0 ;
- var ml_timer = "" ;
-
- /* 重置 */
- this.resetPageNo = function(){
- pageCount = 0 ;
- pageNum = 0 ;
- pageList = 0 ;
- screen = 1 ;
- screen_class = "ao_one" ; /* 当前布局样式 */
- load_flag = true ;
- replace_class = {"x":"await_orders","y":"other_await"}; /* 下一个替换样式组 */
- /*$(".np").removeAttr("disabled");
- $(".lp").attr("disabled","false");*/
- };
-
- /* 跟据条件查询总页数 */
- this.sbcList = function(fn,fnp,param){
- var params = {listNum:5,condition:param};
- var url = "/nwyj/ws/cockpit/CockpitService/searchByCondition";
- $.post(url,params,function(data){
- _this.resetPageNo();
- pageCount = data["countPage"];
- pageList = data["countList"];
- /*$(".lp").attr("disabled","false");*/
- $(".lp").empty();
- $(".lp").append("<span class='locked_gray'>上一页</span>");
- if(pageCount==1) {
- /*$(".np").attr("disabled","false");*/
- $(".np").empty();
- $(".np").append("<span class='locked_gray'>下一页</span>");
- }
- _this.splitScreen();
- if(fn!=""||fn!=null) fn(fnp);
- },"json");
- };
-
- /* 跟据每页显示的条数查询出总页数有多少 */
- this.countList = function(fn,param){
- var params = {listNum:5};
- var url = "/nwyj/ws/cockpit/CockpitService/pageCountByVideo";
- $.post(url,params,function(data){
- pageCount = data["countPage"];
- pageList = data["countList"];
-
- /*$(".lp").attr("disabled","false");*/
- if(pageCount==1) {
- /* $(".np").attr("disabled","false"); */
- $(".np").empty();
- $(".np").append("<span class='locked_gray'>下一页</span>");
- }
- _this.splitScreen();
- if(fn!=""||fn!=null) fn(param);
- });
- };
-
- /* 得到屏幕数 */
- this.getScreen = function(){
- return screen;
- };
-
- /* 得到要替换样式 */
- this.get_replace_class = function(){
- return replace_class ;
- };
-
- /* 设置要替换样式 */
- this.set_replace_class = function(name){
- replace_class = name ;
- };
- this.get_interval = function(){
- return interval ;
- };
- this.set_interval = function(iv){
- interval = iv ;
- };
-
- this.get_inter = function(){
- return inter ;
- };
- this.set_inter = function(inte){
- inter = inte ;
- };
-
- this.get_timer = function(){
- return timer ;
- };
- this.set_timer = function(time){
- timer = time ;
- };
-
- this.get_ml_timer = function(){
- return ml_timer ;
- };
- this.set_ml_timer = function(mt){
- ml_timer = mt ;
- };
-
- /* 分屏 */
- this.splitScreen = function(){
- $("#video_box").empty();
- if(pageList<=1){ /* 1屏 */
- screen = 1 ;
- screen_class = "ao_one";
- $("#video_box").append("<div id=\"one_b\" class=\"bar bar_hide one_open two_open three_open four_open\"></div><div id=\"bc_one\" class=\"bar_count\"></div><div id=\"one_v\" class=\"ao_one fib await_orders video_count\"></div>");
-
- } else if(pageList==2){ /* 2屏 */
- screen = 2 ;
- screen_class = "ao_two";
- $("#video_box").append("<div id=\"one_b\" class=\"bar bar_hide one_open two_open three_open four_open\"></div><div id=\"bc_one\" class=\"bar_count\"></div><div id=\"one_v\" class=\"two_coun coun_left fib ao_two await_orders video_count\"></div>" +
- "<div id=\"two_b\" class=\"bar bar_hide one_open two_open three_open four_open\"></div><div id=\"bc_two\" class=\"bar_count\"></div><div id=\"two_v\" class=\"two_coun coun_right fib ao_two await_orders ao_two video_count\"></div>");
-
- } else if(pageList==3){ /* 3屏 */
- screen = 3 ;
- screen_class = "ao_three";
- $("#video_box").append("<div id=\"one_b\" class=\"bar bar_hide one_open two_open three_open four_open\"></div><div id=\"bc_one\" class=\"bar_count\"></div><div id=\"one_v\" class=\"three_coun_b coun_top ao_three await_orders video_count\"></div>" +
- "<div id=\"two_b\" class=\"bar bar_hide one_open two_open three_open four_open\"></div><div id=\"bc_two\" class=\"bar_count\"></div><div id=\"two_v\" class=\"three_coun_l coun_bottom coun_left fib ao_three await_orders video_count\"></div>" +
- "<div id=\"three_b\" class=\"bar bar_hide one_open two_open three_open four_open\"></div><div id=\"bc_three\" class=\"bar_count\"></div><div id=\"three_v\" class=\"three_coun_l coun_bottom coun_right fib ao_three await_orders video_count\"></div>") ;
-
- } else{ /* 4屏 */
- screen = 4 ;
- screen_class = "ao_four";
- $("#video_box").append("<div id=\"one_b\" class=\"bar bar_hide one_open two_open three_open four_open\"></div><div id=\"bc_one\" class=\"bar_count\"></div><div id=\"one_v\" class=\"four_coun coun_top coun_left fib ao_four await_orders video_count\"></div>" +
- "<div id=\"two_b\" class=\"bar bar_hide one_open two_open three_open four_open\"></div><div id=\"bc_two\" class=\"bar_count\"></div><div id=\"two_v\" class=\"four_coun coun_top fib ao_four await_orders video_count\"></div>" +
- "<div id=\"three_b\" class=\"bar bar_hide one_open two_open three_open four_open\"></div><div id=\"bc_three\" class=\"bar_count\"></div><div id=\"three_v\" class=\"four_coun coun_bottom coun_left fib ao_four await_orders video_count\"></div>" +
- "<div id=\"four_b\" class=\"bar bar_hide one_open two_open three_open four_open\"></div><div id=\"bc_four\" class=\"bar_count\"></div><div id=\"four_v\" class=\"four_coun coun_bottom fib ao_four await_orders video_count\"></div>");
- }
- };
-
- /* 得到屏幕布局样式名 */
- this.get_screen_class = function(){
- return screen_class;
- };
- /* 执行下一页操作 */
- this.nextPage = function(nc){
- pageNum++ ;
- if(pageNum == 2){
- $(".lp").empty();
- $(".lp").append("<a href=\"#\" onclick='lastPage()'>上一页</a>");
- }
- if(pageNum >= pageCount) {
- /* $(".np").attr("disabled","false"); */
- $(".np").empty();
- $(".np").append("<span class='locked_gray'>下一页</span>");
- pageNum = pageCount;
- }else{
- $(".np").empty();
- $(".np").append("<a href=\"#\" onclick='nextPage()'>下一页</a>");
- };
- if(pageNum > 1) $(".lp").removeAttr("disabled");
- _this.showList(nc);
- };
- /* 执行上一页操作 */
- this.lastPage = function(nc){
- pageNum-- ;
- if(pageNum==pageCount-1){
- $(".np").empty();
- $(".np").append("<a href=\"#\" onclick='nextPage()'>下一页</a>");
- }
- if(pageNum == 1) {
- /* $(".lp").attr("disabled","false"); */
- $(".lp").empty();
- $(".lp").append("<span class='locked_gray'>上一页</span>");
- pageNum = 1 ;
- /* return; */
- }
- /* if(pageNum < pageCount) {
- $(".np").removeAttr("disabled");
- } */
- _this.showList(nc);
- };
- /* 显示当前页面列表项 */
- this.showList = function(nc){
- var condition = $("#svp").val() == "输入部门、上传人进行查询" ? "" : $("#svp").val() ;
- var params = {begin:pageNum * 5 - 4, end:pageNum * 5,condition:condition};
- var url = "/nwyj/ws/cockpit/CockpitService/queryVideo" ;
- $.post(url,params,function(data){
- if(data){
- $("#tbv").empty();
- for(var key in data){
- /*$("#tbv").append("<tr><td class=\"fgx\"><table cellpadding=\"4\" class=\"mpy\"><tr>" +
- "<td><a href=\"#\" onclick=\"ckplay('" + data[key]["name"] + "." + data[key]["fileext"] + "','" + data[key]["description"] + "')\" class=\"mpy\" ><img src=\"/nwyj/images/cockpit/char/new_notice.png\" width=\"60\" /></a></td>" +
- "<td><span class=\"tit\">部门:</span><span>" + data[key]["dept_name"] + "</span><br><span class=\"tit\">上传人:</span><span>" + data[key]["oper_name"] +
- "</span><br><span class=\"tit\">上传时间:</span><span>" + data[key]["oper_time"] + "</span><br><span class=\"tit\">描述:</span><span>" + data[key]["description"] + "<span></td>" +
- "</tr></table></td></tr>") ;*/
- $("#tbv").append("<tr><td class=\"fgx\"><table cellpadding=\"4\" class=\"mpy\"><tr>" +
- "<td><a href=\"#\" onclick=\"ckplay('" + data[key]["name"] + "." + data[key]["fileext"] + "','" + data[key]["description"] + "')\" class=\"mpy\" ><img src=\"/nwyj/images/cockpit/char/new_notice.png\" width=\"60\" /></a></td>" +
- "<td><span class=\"tit\">部门:</span><span>" + data[key]["dept_name"] + "</span><br><span class=\"tit\">上传人:</span><span>" + data[key]["oper_name"] +
- "</span><br><span class=\"tit\">上传时间:</span><span>" + data[key]["oper_time"] + "</span></td>" +
- "</tr></table></td></tr>") ;
- }
- if(load_flag){
- _this.load_ckplay(data);
- load_flag = false;
- }
-
- _this.ck_play();
-
- // if($("#searbut").hasClass("key_search")){
-
- // $("#searbut").removeClass("key_search");
- $("#tbv").html(function(i,oldHTML){
- var key = $("#svp").val() == "输入部门、上传人进行查询" ? "" : $("#svp").val() ;
- var exp = "/" + key + "/g" ;
- exp = exp.replace(/\/\//g,"\/");
- var ke = eval(exp);
-
- var temp = "<span class = 'keyword'>" + key + "</span>" ;
-
- return oldHTML.replace(ke,temp);
- });
-
- // }
- }else{
- $("#tbv").empty().append("<div class=\"nores\">没有查到相关视频,请更换关键字重新查询。</div>");
- if(pageCount!=1){ pageCount = pageCount - 1; }
- }
- });
- };
-
- this.ck_play = function(){
- // CKobject.getObjectById('ckplayer_a1').videoPlay();
- };
-
- /* 视频初始化 */
- this.load_ckplay = function(data){
- var div_id = "";
- var name = "";
- for(var i = 0 ; i < screen ; i++){
- div_id = $("."+screen_class).eq(i).attr("id");
- name = data[i]["name"] + "." + data[i]["fileext"] ;
- _this.init_ckplay(name, div_id,data[i]["description"]);
- }
- };
-
- /* 初始化加载视频 */
- this.init_ckplay = function(name, div_id, description){
- var host = window.location.host;
- var flashvars={
- f:"http://" + host + "/nwyj/upload/"+name,
- c:0,
- p:'0',
- loaded:'loadedHandler'
- };
- // alert(flashvars.f)
- var hei = $("#"+div_id).height();
- CKobject.embed('/nwyj/page/cockpit/ckplayer/ckplayer.swf',div_id,"ck_" + div_id,'100%',hei,false,flashvars);
- setTimeout(function(){
- _this.add_description("ck_" + div_id, description);
- },5000);
- };
-
- /* 得到下一个等待id */
- this.next_await = function(){
- var await_id = $("."+replace_class["x"]).eq(0).attr("id");
- if(await_id==undefined){
- var temp = replace_class["x"];
- replace_class["x"] = replace_class["y"];
- replace_class["y"] = temp;
- await_id = $("."+replace_class["x"]).eq(0).attr("id");
- }
- $("#"+await_id).removeClass(replace_class["x"]);
- $("#"+await_id).addClass(replace_class["y"]);
- return await_id;
- };
-
- /* 添加描述信息 */
- this.add_description = function(ck_id, description){
- CKobject.getObjectById(ck_id).marqueeLoad(true);
- CKobject.getObjectById(ck_id).marqueeLoad(true,'{font color=\'#FFDD00\'}' + description + ',{/font}');
- };
-
- };
- //VideoUtil类结束
- /* 点击视频 */
- function ckplay(name,description){
- var await_id = vu.next_await();
- var host = window.location.host;
- var flashvars={
- f: "http://" + host + '/nwyj/upload/' + name,
- c:0,
- p:'1',
- e:'5',
- loaded:'loadedHandler'
- };
-
- var hei = $("#"+await_id).height();
- $(".video_count").height(hei);
- // alert(flashvars.f)
- CKobject.embed('/nwyj/page/cockpit/ckplayer/ckplayer.swf',await_id,"ck_" + await_id,'100%',hei,false,flashvars);
- setTimeout(function(){
- vu.add_description("ck_" + await_id, description);
- },5000);
- };
- $("#searbut").on("click",function(){
- // vu.resetPageNo();
- var params = $("#svp").val() == "输入部门、上传人进行查询" ? "" : $("#svp").val() ;
-
- if(!params == ""){
- $(this).addClass("key_search");
- }
- vu.sbcList(vu.nextPage, "\".np\"", params);
- });
|