define('helper',['jquery'], function (jquery) {
var huawei = huawei || {};
jquery.fn.imagesloaded = function (selector) {
selector = selector || "img";
var def = $.deferred();
var def_list = [];
this.find(selector).each(function (i, o) {
var _def = $.deferred();
(function (d) {
$(o).on("load", function (e) {
d.resolve(e.target);
});
}(_def));
if (o.complete && !$(o).attr("data-src")) settimeout(function () { _def.resolve(o); }, 0);
def_list.push(_def.promise());
});
$.when.apply(this, def_list).always(function (d) {
def.resolve.apply(this, arguments);
});
settimeout(function () { def.resolve(this); }, 1000 * 10);
return def.promise();
};
huawei.debounce = function debounce(func, wait) {
var timeout;
return function () {
var context = this;
var args = arguments;
if (timeout) cleartimeout(timeout);
timeout = settimeout(function () {
func.apply(context, args);
}, wait);
};
};
jquery.debounce = huawei.debounce;
jquery.fn.hoverintent = function (hoverin, hoverout, selector) {
var timer1 = 0;
var timer2 = 0;
var delay = 250;
this.on("mouseenter", selector, function (e) {
cleartimeout(timer1);
timer1 = 0;
var that = this;
(function (th, _e) {
timer1 = settimeout(function () {
hoverin.apply(th, [_e]);
}, delay);
}(that, e));
}).on("mouseleave", selector, function (e) {
cleartimeout(timer1);
timer1 = 0;
var that = this;
(function (th, _e) {
settimeout(function () {
hoverout.apply(th, [_e]);
}, delay);
}(that, e));
});
return this;
};
function calculatetruncation(el) {
var ellipsis = "...";
var $el = $(el);
var text;
var doted = false;
var $contents = $el.contents();
var lasttext;
var limit = 800;
while (el.clientheight + 2 < el.scrollheight) {
if (limit <= 0) break;
limit -= 1;
text = $el.text().trim();
if (!text) {
break;
}
var last = $contents.last();
text = last.text().trim();
lasttext = text;
if (!text || text == ellipsis) {
last.remove();
$contents = $el.contents();
continue;
}
// 替换英文单词
text = text.replace(/\s?\b([\w\.])*$/, ellipsis);
// 替换中文文字
if (text === lasttext) text = text.replace(/[\u2e80-\u9fff_\s](\.{3})?$/, ellipsis);
// 替换任意最后一个字符
if (text === lasttext) text = text.replace(/[\s\s](\.{3})?$/, ellipsis);
var n = last.get(0);
if (n.nodetype != 3) last.text(text);
else n.nodevalue = text;
doted = true;
}
return doted;
}
jquery.fn.dotdotdot = function () {
this.each(function () {
var $t = $(this);
if ($t.is(":hidden") || this.doted) return;
$t.css({
"word-break": "break-word",
"overflow": "hidden",
"overflow-wrap": "break-word"
}).data("children", $t.contents().clone(true));
$t.on("restore-content", function (e) {
$t.empty().append($t.data("children"));
$t.removeclass("doted is-truncated").removeattr("style");
});
var truncationel = this;
var r = calculatetruncation(truncationel);
if (r) {
this.doted = true;
$(this).addclass("doted is-truncated");
}
});
};
jquery.fn.tabresponsive = function (_options) {
var defaults = { offset: 0, collapseclass: "tab-content-collapse", animatecomplete: function () { } };
var options = jquery.extend({}, defaults, _options);
this.each(function () {
var $t = $(this);
$t.addclass("hidden-xs");
$t.find('[data-toggle="tab"]').each(function () {
var $clone = $(this).clone();
$clone.removeattr("id").addclass("hidden-lg hidden-md hidden-sm collapsed")
.attr("data-toggle", "collapse")
.insertbefore($($clone.attr("href")));
});
});
var $tabs = this;
$(window).off("resize.tabresponsive").on("resize.tabresponsive", function (e) {
$tabs.each(function () {
var $tabcontent = $($(this).find('[data-toggle="tab"]').eq(0).attr("href")).parent();
if ($(window).width() < 768) {
$tabcontent.removeclass("tab-content").addclass(options.collapseclass)
.children(".tab-pane").removeclass("active")
.addclass("collapse");
} else {
$tabcontent.removeclass(options.collapseclass).addclass("tab-content")
.children(".tab-pane").removeclass("collapse")
.eq(0)
.addclass("active");
}
});
});
settimeout(function () { $(window).trigger("resize.tabresponsive"); }, 100);
$(document).off("click", '.tab-content-collapse [data-toggle="collapse"]')
.on("click", '.tab-content-collapse [data-toggle="collapse"]', function (e) {
var $t = $(this);
if ($t.hasclass("collapsed")) return;
var $brothers = $t.siblings('.tab-pane').not($t.attr("href")).collapse('hide');
settimeout(function () {
var _offset = typeof options.offset == "function" ? options.offset() : options.offset;
$("html, body").animate({ scrolltop: $(e.currenttarget).offset().top - _offset }, function () {
settimeout(function () {
options.animatecomplete();
}, 100);
});
}, 500);
});
};
jquery.loading = function (showorclose, options) {
var msg = /(\/zh|cn\/)/.test(document.url) ? "加载中..." : "loading...";
if ($("#hidloadingmessage").length) msg = $("#hidloadingmessage").val();
options = options || {};
options.loadingid = options.loadingid || "js-loading";
showorclose ? openloading() : closeloading();
function openloading() {
var $loadingel = $("#" + options.loadingid);
if (!$loadingel.length) {
$loadingel = $('
\
'
+ msg + '
\
'
+ msg + '
').appendto("body");
}
$loadingel.addclass("show");
}
function closeloading() {
var $loadingel = $("#js-loading");
$loadingel.removeclass("show");
}
};
jquery.cache = {
get: function (key) {
var val;
try {
val = json.parse(decodeuricomponent(localstorage.getitem(key)));
} catch (_e) { }
return val;
},
set: function (key, _value, expiredays) {
var value = _value;
if (!value) return;
if (typeof value !== "object") {
value = { value: _value };
}
var d = new date();
d.settime(d.gettime() + 24 * 60 * 60 * 1000 * expiredays);
var expire = d;
value.expire = expire;
localstorage.setitem(key, encodeuricomponent(json.stringify(value)));
},
del: function (key) {
localstorage.removeitem(key);
},
};
jquery.dialog = function (id, content, showorclose, options) {
options = options || {};
options.loadingid = id || "js-dialog-box";
function show() {
var $loadingel = $("#" + options.loadingid);
if (!$loadingel.length) {
$loadingel = $('
\
\
\
').appendto("body");
$loadingel.on("click", ".js-close-dialog", function (_e) {
hide();
});
}
if (/^[#.]/.test(content)) content = $(content);
$loadingel.find(".modal-body").append(content);
$loadingel.addclass("show").fadein();
$("body").addclass("dialog-has-open");
}
function hide() {
var $loadingel = $("#" + options.loadingid);
$loadingel.removeclass("show").fadeout();
$("body").removeclass("dialog-has-open");
}
if (showorclose !== false) show();
else hide();
};
return huawei;
});
define('panelimg',['helper'], function () {
function panelimg(obj) {
this.obj = $(obj);
this.panelimg = this.obj.find('.panel-img-box');
this.init();
}
panelimg.prototype = {
init: function () {
var self = this;
this.resize();
var timer = 0;
$(window).resize(function () {
cleartimeout(timer);
timer = settimeout(function () {
self.resize();
}, 200)
});
settimeout(function () {
self.resize();
}, 1000);
/* var $imgs = $('.panel-img-box.mr .img-box img.hidden-xs');
var i = 1,
l = $imgs.length;
$imgs.on('load', function (e) {
i += 1;
if (i >= l)
self.resize();
}); */
$('.panel-img-box.mr .img-box').imagesloaded('img:visible').then(function(){
self.resize();
});
},
resize: function () {
var self = this;
if (window.innerwidth < 992) {
self.panelimg.removeattr('style');
return;
}
var tempwidth = 0;
self.panelimg.each(function (index) {
if ($(this).hasclass('big-w')) {
tempwidth = self.obj.width() - 30 - (self.obj.width() - 60) / 3;
} else {
tempwidth = (self.obj.width() - 60) / 3;
}
$(this).css({
width: tempwidth - 0.5,
height: $(this).prev().hasclass('mr') ? $(this).prev().height() : 'auto'
});
});
}
}
return panelimg;
});
/*! js-cookie v2.2.1 | mit */
!function(a){var b;if("function"==typeof define&&define.amd&&(define('vendor/js.cookie-2.2.1.min',a),b=!0),"object"==typeof exports&&(module.exports=a(),b=!0),!b){var c=window.cookies,d=window.cookies=a();d.noconflict=function(){return window.cookies=c,d}}}(function(){function a(){for(var a=0,b={};a");
s = s.replace(/ /g, " ");
s = s.replace(/'/g, "\'");
s = s.replace(/"/g, "\"");
s = s.replace(/ /g, "");
return s;
}
$(function ($) {
settimeout(function () {
huawei.text_dot();
huawei.text_dot_more_less();
huawei.tab_change_text_dot();
}, 500);
$(document).on("text-dotdotdot", function (e) {
settimeout(function () {
huawei.text_dot();
}, 200);
});
});
huawei.text_dot = function () {
$(".js-text-dot-en").filter(":visible").not(".is-truncated").removeattr("style").dotdotdot({
after: '.toggle',
callback: dotdotdotcallback
// wrap: 'letter'
});
$(".js-text-dot-cn").filter(":visible").not(".is-truncated").removeattr("style").dotdotdot({
wrap: 'letter', //注:中文必须改为letter
ellipsis: "...",
after: '.toggle',
callback: dotdotdotcallback
});
};
huawei.text_dot_more_less = function () {
$(document).on('click', '.js-text-dot-en .toggle, .js-text-dot-cn .toggle', function () {
var $t = $(this);
var $p = $t.closest('.js-text-dot-en, .js-text-dot-cn');
if ($p.hasclass("is-truncated")) {
$p.trigger('destroy').css('max-height', 'none').css("height", "auto");
$p.find(".toggle").html($t.attr("data-less-text") || "less");
return false;
}
var ops = {
ellipsis: "...",
after: ".toggle",
callback: dotdotdotcallback
};
if ($p.hasclass("js-text-dot-cn"))
ops["wrap"] = 'letter';
$p.css("max-height", "").height("");
settimeout(function () { $p.dotdotdot(ops); }, 100);
// $p.find(".toggle").html($t.attr("data-more-text")||"more");
return false;
});
};
function dotdotdotcallback(istruncated, originalcontent) {
var $tog = $(".toggle", this);
if (!istruncated) {
$tog.remove();
}
else {
$tog.html($tog.attr("data-more-text") || "more");
}
}
huawei.tab_change_text_dot = function () {
$(document).on("shown.bs.tab shown.bs.collapse", ".js-tab-dot a", function () {
$(document).trigger("text-dotdotdot");
});
};
return huawei;
});
/*!
* jquery mobile virtual mouse @version
* http://jquerymobile.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*/
//>>label: virtual mouse (vmouse) bindings
//>>group: core
//>>description: normalizes touch/mouse events.
//>>docs: http://api.jquerymobile.com/?s=vmouse
// this plugin is an experiment for abstracting away the touch and mouse
// events so that developers don't have to worry about which method of input
// the device their document is loaded on supports.
//
// the idea here is to allow the developer to register listeners for the
// basic mouse events, such as mousedown, mousemove, mouseup, and click,
// and the plugin will take care of registering the correct listeners
// behind the scenes to invoke the listener at the fastest possible time
// for that device, while still retaining the order of event firing in
// the traditional mouse environment, should multiple handlers be registered
// on the same element for different events.
//
// the current version exposes the following virtual events to jquery bind methods:
// "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel"
( function( factory ) {
if ( typeof define === "function" && define.amd ) {
// amd. register as an anonymous module.
define( 'jquery.mobile.vmouse',[ "jquery" ], factory );
} else {
// browser globals
factory( jquery );
}
} )( function( $ ) {
var datapropertyname = "virtualmousebindings",
touchtargetpropertyname = "virtualtouchid",
toucheventprops = "clientx clienty pagex pagey screenx screeny".split( " " ),
virtualeventnames = "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split( " " ),
generalprops = ( "altkey bubbles cancelable ctrlkey currenttarget detail eventphase " +
"metakey relatedtarget shiftkey target timestamp view which" ).split( " " ),
mousehookprops = $.event.mousehooks ? $.event.mousehooks.props : [],
mouseeventprops = generalprops.concat( mousehookprops ),
activedochandlers = {},
resettimerid = 0,
startx = 0,
starty = 0,
didscroll = false,
clickblocklist = [],
blockmousetriggers = false,
blocktouchtriggers = false,
eventcapturesupported = "addeventlistener" in document,
$document = $( document ),
nexttouchid = 1,
lasttouchid = 0, threshold,
i;
$.vmouse = {
movedistancethreshold: 10,
clickdistancethreshold: 10,
resettimerduration: 1500,
maximumtimebetweentouches: 100
};
function getnativeevent( event ) {
while ( event && typeof event.originalevent !== "undefined" ) {
event = event.originalevent;
}
return event;
}
function createvirtualevent( event, eventtype ) {
var t = event.type,
oe, props, ne, prop, ct, touch, i, j, len;
event = $.event( event );
event.type = eventtype;
oe = event.originalevent;
props = generalprops;
// addresses separation of $.event.props in to $.event.mousehook.props and issue 3280
// https://github.com/jquery/jquery-mobile/issues/3280
if ( t.search( /^(mouse|click)/ ) > -1 ) {
props = mouseeventprops;
}
// copy original event properties over to the new event
// this would happen if we could call $.event.fix instead of $.event
// but we don't have a way to force an event to be fixed multiple times
if ( oe ) {
for ( i = props.length; i; ) {
prop = props[ --i ];
event[ prop ] = oe[ prop ];
}
}
// make sure that if the mouse and click virtual events are generated
// without a .which one is defined
if ( t.search( /mouse(down|up)|click/ ) > -1 && !event.which ) {
event.which = 1;
}
if ( t.search( /^touch/ ) !== -1 ) {
ne = getnativeevent( oe );
t = ne.touches;
ct = ne.changedtouches;
touch = ( t && t.length ) ? t[ 0 ] : ( ( ct && ct.length ) ? ct[ 0 ] : undefined );
if ( touch ) {
for ( j = 0, len = toucheventprops.length; j < len; j++ ) {
prop = toucheventprops[ j ];
event[ prop ] = touch[ prop ];
}
}
}
return event;
}
function getvirtualbindingflags( element ) {
var flags = {},
b, k;
while ( element ) {
b = $.data( element, datapropertyname );
for ( k in b ) {
if ( b[ k ] ) {
flags[ k ] = flags.hasvirtualbinding = true;
}
}
element = element.parentnode;
}
return flags;
}
function getclosestelementwithvirtualbinding( element, eventtype ) {
var b;
while ( element ) {
b = $.data( element, datapropertyname );
if ( b && ( !eventtype || b[ eventtype ] ) ) {
return element;
}
element = element.parentnode;
}
return null;
}
function enabletouchbindings() {
blocktouchtriggers = false;
}
function disabletouchbindings() {
blocktouchtriggers = true;
}
function enablemousebindings() {
lasttouchid = 0;
clickblocklist.length = 0;
blockmousetriggers = false;
// when mouse bindings are enabled, our
// touch bindings are disabled.
disabletouchbindings();
}
function disablemousebindings() {
// when mouse bindings are disabled, our
// touch bindings are enabled.
enabletouchbindings();
}
function clearresettimer() {
if ( resettimerid ) {
cleartimeout( resettimerid );
resettimerid = 0;
}
}
function startresettimer() {
clearresettimer();
resettimerid = settimeout( function() {
resettimerid = 0;
enablemousebindings();
}, $.vmouse.resettimerduration );
}
function triggervirtualevent( eventtype, event, flags ) {
var ve;
if ( ( flags && flags[ eventtype ] ) ||
( !flags && getclosestelementwithvirtualbinding( event.target, eventtype ) ) ) {
ve = createvirtualevent( event, eventtype );
$( event.target ).trigger( ve );
}
return ve;
}
function mouseeventcallback( event ) {
var touchid = $.data( event.target, touchtargetpropertyname ),
ve;
// it is unexpected if a click event is received before a touchend
// or touchmove event, however this is a known behavior in mobile
// safari when mobile voiceover (as of ios 8) is enabled and the user
// double taps to activate a link element. in these cases if a touch
// event is not received within the maximum time between touches,
// re-enable mouse bindings and call the mouse event handler again.
if ( event.type === "click" && $.data( event.target, "lasttouchtype" ) === "touchstart" ) {
settimeout( function() {
if ( $.data( event.target, "lasttouchtype" ) === "touchstart" ) {
enablemousebindings();
delete $.data( event.target ).lasttouchtype;
mouseeventcallback( event );
}
}, $.vmouse.maximumtimebetweentouches );
}
if ( !blockmousetriggers && ( !lasttouchid || lasttouchid !== touchid ) ) {
ve = triggervirtualevent( "v" + event.type, event );
if ( ve ) {
if ( ve.isdefaultprevented() ) {
event.preventdefault();
}
if ( ve.ispropagationstopped() ) {
event.stoppropagation();
}
if ( ve.isimmediatepropagationstopped() ) {
event.stopimmediatepropagation();
}
}
}
}
function handletouchstart( event ) {
var touches = getnativeevent( event ).touches,
target, flags, t;
if ( touches && touches.length === 1 ) {
target = event.target;
flags = getvirtualbindingflags( target );
$.data( event.target, "lasttouchtype", event.type );
if ( flags.hasvirtualbinding ) {
lasttouchid = nexttouchid++;
$.data( target, touchtargetpropertyname, lasttouchid );
clearresettimer();
disablemousebindings();
didscroll = false;
t = getnativeevent( event ).touches[ 0 ];
startx = t.pagex;
starty = t.pagey;
triggervirtualevent( "vmouseover", event, flags );
triggervirtualevent( "vmousedown", event, flags );
}
}
}
function handlescroll( event ) {
if ( blocktouchtriggers ) {
return;
}
if ( !didscroll ) {
triggervirtualevent( "vmousecancel", event, getvirtualbindingflags( event.target ) );
}
$.data( event.target, "lasttouchtype", event.type );
didscroll = true;
startresettimer();
}
function handletouchmove( event ) {
if ( blocktouchtriggers ) {
return;
}
var t = getnativeevent( event ).touches[ 0 ],
didcancel = didscroll,
movethreshold = $.vmouse.movedistancethreshold,
flags = getvirtualbindingflags( event.target );
$.data( event.target, "lasttouchtype", event.type );
didscroll = didscroll ||
( math.abs( t.pagex - startx ) > movethreshold ||
math.abs( t.pagey - starty ) > movethreshold );
if ( didscroll && !didcancel ) {
triggervirtualevent( "vmousecancel", event, flags );
}
triggervirtualevent( "vmousemove", event, flags );
startresettimer();
}
function handletouchend( event ) {
if ( blocktouchtriggers || $.data( event.target, "lasttouchtype" ) === undefined ) {
return;
}
disabletouchbindings();
delete $.data( event.target ).lasttouchtype;
var flags = getvirtualbindingflags( event.target ),
ve, t;
triggervirtualevent( "vmouseup", event, flags );
if ( !didscroll ) {
ve = triggervirtualevent( "vclick", event, flags );
if ( ve && ve.isdefaultprevented() ) {
// the target of the mouse events that follow the touchend
// event don't necessarily match the target used during the
// touch. this means we need to rely on coordinates for blocking
// any click that is generated.
t = getnativeevent( event ).changedtouches[ 0 ];
clickblocklist.push( {
touchid: lasttouchid,
x: t.clientx,
y: t.clienty
} );
// prevent any mouse events that follow from triggering
// virtual event notifications.
blockmousetriggers = true;
}
}
triggervirtualevent( "vmouseout", event, flags );
didscroll = false;
startresettimer();
}
function hasvirtualbindings( ele ) {
var bindings = $.data( ele, datapropertyname ),
k;
if ( bindings ) {
for ( k in bindings ) {
if ( bindings[ k ] ) {
return true;
}
}
}
return false;
}
function dummymousehandler() {
}
function getspecialeventobject( eventtype ) {
var realtype = eventtype.substr( 1 );
return {
setup: function( /* data, namespace */ ) {
// if this is the first virtual mouse binding for this element,
// add a bindings object to its data.
if ( !hasvirtualbindings( this ) ) {
$.data( this, datapropertyname, {} );
}
// if setup is called, we know it is the first binding for this
// eventtype, so initialize the count for the eventtype to zero.
var bindings = $.data( this, datapropertyname );
bindings[ eventtype ] = true;
// if this is the first virtual mouse event for this type,
// register a global handler on the document.
activedochandlers[ eventtype ] = ( activedochandlers[ eventtype ] || 0 ) + 1;
if ( activedochandlers[ eventtype ] === 1 ) {
$document.bind( realtype, mouseeventcallback );
}
// some browsers, like opera mini, won't dispatch mouse/click events
// for elements unless they actually have handlers registered on them.
// to get around this, we register dummy handlers on the elements.
$( this ).bind( realtype, dummymousehandler );
// for now, if event capture is not supported, we rely on mouse handlers.
if ( eventcapturesupported ) {
// if this is the first virtual mouse binding for the document,
// register our touchstart handler on the document.
activedochandlers[ "touchstart" ] = ( activedochandlers[ "touchstart" ] || 0 ) + 1;
if ( activedochandlers[ "touchstart" ] === 1 ) {
$document.bind( "touchstart", handletouchstart )
.bind( "touchend", handletouchend )
// on touch platforms, touching the screen and then dragging your finger
// causes the window content to scroll after some distance threshold is
// exceeded. on these platforms, a scroll prevents a click event from being
// dispatched, and on some platforms, even the touchend is suppressed. to
// mimic the suppression of the click event, we need to watch for a scroll
// event. unfortunately, some platforms like ios don't dispatch scroll
// events until *after* the user lifts their finger (touchend). this means
// we need to watch both scroll and touchmove events to figure out whether
// or not a scroll happenens before the touchend event is fired.
.bind( "touchmove", handletouchmove )
.bind( "scroll", handlescroll );
}
}
},
teardown: function( /* data, namespace */ ) {
// if this is the last virtual binding for this eventtype,
// remove its global handler from the document.
--activedochandlers[eventtype];
if ( !activedochandlers[ eventtype ] ) {
$document.unbind( realtype, mouseeventcallback );
}
if ( eventcapturesupported ) {
// if this is the last virtual mouse binding in existence,
// remove our document touchstart listener.
--activedochandlers["touchstart"];
if ( !activedochandlers[ "touchstart" ] ) {
$document.unbind( "touchstart", handletouchstart )
.unbind( "touchmove", handletouchmove )
.unbind( "touchend", handletouchend )
.unbind( "scroll", handlescroll );
}
}
var $this = $( this ),
bindings = $.data( this, datapropertyname );
// teardown may be called when an element was
// removed from the dom. if this is the case,
// jquery core may have already stripped the element
// of any data bindings so we need to check it before
// using it.
if ( bindings ) {
bindings[ eventtype ] = false;
}
// unregister the dummy event handler.
$this.unbind( realtype, dummymousehandler );
// if this is the last virtual mouse binding on the
// element, remove the binding data from the element.
if ( !hasvirtualbindings( this ) ) {
$this.removedata( datapropertyname );
}
}
};
}
// expose our custom events to the jquery bind/unbind mechanism.
for ( i = 0; i < virtualeventnames.length; i++ ) {
$.event.special[ virtualeventnames[ i ] ] = getspecialeventobject( virtualeventnames[ i ] );
}
// add a capture click handler to block clicks.
// note that we require event capture support for this so if the device
// doesn't support it, we punt for now and rely solely on mouse events.
if ( eventcapturesupported ) {
document.addeventlistener( "click", function( e ) {
var cnt = clickblocklist.length,
target = e.target,
x, y, ele, i, o, touchid;
if ( cnt ) {
x = e.clientx;
y = e.clienty;
threshold = $.vmouse.clickdistancethreshold;
// the idea here is to run through the clickblocklist to see if
// the current click event is in the proximity of one of our
// vclick events that had preventdefault() called on it. if we find
// one, then we block the click.
//
// why do we have to rely on proximity?
//
// because the target of the touch event that triggered the vclick
// can be different from the target of the click event synthesized
// by the browser. the target of a mouse/click event that is synthesized
// from a touch event seems to be implementation specific. for example,
// some browsers will fire mouse/click events for a link that is near
// a touch event, even though the target of the touchstart/touchend event
// says the user touched outside the link. also, it seems that with most
// browsers, the target of the mouse/click event is not calculated until the
// time it is dispatched, so if you replace an element that you touched
// with another element, the target of the mouse/click will be the new
// element underneath that point.
//
// aside from proximity, we also check to see if the target and any
// of its ancestors were the ones that blocked a click. this is necessary
// because of the strange mouse/click target calculation done in the
// android 2.1 browser, where if you click on an element, and there is a
// mouse/click handler on one of its ancestors, the target will be the
// innermost child of the touched element, even if that child is no where
// near the point of touch.
ele = target;
while ( ele ) {
for ( i = 0; i < cnt; i++ ) {
o = clickblocklist[ i ];
touchid = 0;
if ( ( ele === target && math.abs( o.x - x ) < threshold && math.abs( o.y - y ) < threshold ) ||
$.data( ele, touchtargetpropertyname ) === o.touchid ) {
// xxx: we may want to consider removing matches from the block list
// instead of waiting for the reset timer to fire.
e.preventdefault();
e.stoppropagation();
return;
}
}
ele = ele.parentnode;
}
}
}, true );
}
} );
define('photo',[
'require',
'jquery.mobile.vmouse'
], function (require, mobile) {
'use strict';
var huawei = huawei || {};
$(function ($) {
if ($(window).width() > 768)
return;
if (!/msie [6-8]/i.test(navigator.useragent)) {
jquery.loadcss("https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css");
$.loadjs('https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js').then(function () {
huawei.image_pinchzoom();
});
}
});
huawei.image_pinchzoom = function () {
if ($(window).width() > 768)
return;
var closeable = true;
var close_timer = null;
var oldtime = 0;
// $.fancybox = undefined;
// $.fn.fancybox = undefined;
$.loadjs('https://cdn.jsdelivr.net/npm/hammerjs@2.0.8/hammer.min.js').then(function(d){
d && (hammer=d);
});
$(document).off('vclick.zoom', 'img')
.on('vclick.zoom', 'img', function (e) {
if ($(this).prop('naturalwidth') < 200) return;
if ($(this).hasclass('js-no-zoom')) return;
if ($(this).closest('.fancybox-container').length > 0 ||
$(this).closest('a').length > 0)
return;
closeable = false;
settimeout(function () {
closeable = true
}, 800);
$.fancybox.open([{
src: this.src,
opts: {
// caption: 'first caption',
// thumb: '1_s.jpg'
}
}], {
toolbar: false,
loop: false
});
$('.fancybox-container').addclass('mobile-big-img-container');
var myelement = $('.fancybox-container').get(0);
var mc = new hammer(myelement, {});
var singletap = new hammer.tap({
event: 'tap'
});
var doubletap = new hammer.tap({
event: 'doubletap',
taps: 2
});
var tripletap = new hammer.tap({
event: 'tripletap',
taps: 3
});
mc.add([tripletap, doubletap, singletap]);
tripletap.recognizewith([doubletap, singletap]);
doubletap.recognizewith(singletap);
doubletap.requirefailure(tripletap);
singletap.requirefailure([tripletap, doubletap]);
// listen to events...
mc.on('tap',
function (ev) {
// console.log(ev);
$('.fancybox-button--close').trigger('click');
}
);
return;
});
};
return huawei;
});
define('plugins/videojs-plugins',[
], function() {
'use strict';
$(document).on("videojs-loaded.videojs-resolution-switcher", function(){
$("")
.prependto("head");
/*! videojs-resolution-switcher - 2015-7-26
* copyright (c) 2016 kasper moskwiak
* modified by pierre kraft
* licensed under the apache-2.0 license. */
!function(){"use strict";var e=null;e=void 0===window.videojs&&"function"==typeof require?require("video.js"):window.videojs,function(e,t){var l,s={},r={},i={};function o(e,t,l,s){return r={label:l,sources:t},"function"==typeof s?s(e,t,l):(e.src(t.map(function(e){return{src:e.src,type:e.type,res:e.res}})),e)}var n=t.getcomponent("menuitem"),a=t.extend(n,{constructor:function(e,t,l,s){this.onclicklistener=l,this.label=s,n.call(this,e,t),this.src=t.src,this.on("click",this.onclick),this.on("touchstart",this.onclick),t.initialyselected&&(this.showaslabel(),this.selected(!0),this.addclass("vjs-selected"))},showaslabel:function(){this.label&&(this.label.innerhtml=this.options_.label)},onclick:function(e){this.onclicklistener(this);var t=this.player_.currenttime(),l=this.player_.paused(),s=this.player_.playbackrate(),r=this.player_.options_.poster;this.showaslabel(),this.addclass("vjs-selected");var i=this.player_;settimeout(function(){i.play()},500),l?this.player_.bigplaybutton.show():(this.player_.bigplaybutton.hide(),r&&this.player_.posterimage.setsrc("")),"function"!=typeof e&&"function"==typeof this.options_.customsourcepicker&&(e=this.options_.customsourcepicker);var n="loadeddata";"youtube"!==this.player_.techname_&&"none"===this.player_.preload()&&"flash"!==this.player_.techname_&&(n="timeupdate"),o(this.player_,this.src,this.options_.label,e).one(n,function(){this.player_.currenttime(t),l||(this.player_.playbackrate(s),this.player_.play(),this.player_.posterimage.setsrc(r)),this.player_.trigger("resolutionchange")})}}),c=t.getcomponent("menubutton"),u=t.extend(c,{constructor:function(e,l,s,r){if(this.sources=l.sources,this.label=r,this.label.innerhtml=l.initialyselectedlabel,c.call(this,e,l,s),this.controltext("quality"),s.dynamiclabel)this.el().appendchild(r);else{var i=document.createelement("span");t.dom.appendcontent(i,l.initialyselectedlabel),t.dom.addclass(i,"vjs-resolution-button-staticlabel"),this.el().appendchild(i)}},createitems:function(){var e=[],t=this.sources&&this.sources.label||{},l=function(t){e.map(function(e){e.selected(e===t),e.removeclass("vjs-selected")})};for(var s in t)t.hasownproperty(s)&&(e.push(new a(this.player_,{label:s,src:t[s],initialyselected:s===this.options_.initialyselectedlabel,customsourcepicker:this.options_.customsourcepicker},l,this.label)),i[s]=e[e.length-1]);return e}});l=function(e){var l=t.mergeoptions(s,e),n=this,a=document.createelement("span"),c={};function h(e,t){return e.res&&t.res?+t.res-+e.res:0}function d(e){var t={label:{},res:{},type:{}};return e.map(function(e){p(t,"label",e),p(t,"res",e),p(t,"type",e),y(t,"label",e),y(t,"res",e),y(t,"type",e)}),t}function p(e,t,l){null==e[t][l[t]]&&(e[t][l[t]]=[])}function y(e,t,l){e[t][l[t]].push(l)}t.dom.addclass(a,"vjs-resolution-button-label"),this.el().appendchild(a),n.updatesrc=function(e){if(!e)return n.src();n.controlbar.resolutionswitcher&&(n.controlbar.resolutionswitcher.dispose(),delete n.controlbar.resolutionswitcher),e=e.sort(h);var s=function(e,t){var s=l.default,r="";"high"===s?(s=t[0].res,r=t[0].label):"low"!==s&&null!=s&&e.res[s]?e.res[s]&&(r=e.res[s][0].label):(s=t[t.length-1].res,r=t[t.length-1].label);return{res:s,label:r,sources:e.res[s]}}(c=d(e),e),r=new u(n,{sources:c,initialyselectedlabel:s.label,initialyselectedres:s.res,customsourcepicker:l.customsourcepicker},l,a);return t.dom.addclass(r.el(),"vjs-resolution-button"),n.controlbar.resolutionswitcher=n.controlbar.el_.insertbefore(r.el_,n.controlbar.getchild("fullscreentoggle").el_),n.controlbar.resolutionswitcher.dispose=function(){this.parentnode.removechild(this)},o(n,s.sources,s.label)},n.currentresolution=function(e,t){return console.log("currentresolution: ",e),null==e?r:(console.log("currentresolution: ",i[e]),null!=i[e]&&i[e].onclick(t),n)},n.getgroupedsrc=function(){return c},n.ready(function(){n.options_.sources.length>1&&n.updatesrc(n.options_.sources),"youtube"===n.techname_&&function(e){e.tech_.ytplayer.setplaybackquality("default"),e.tech_.ytplayer.addeventlistener("onplaybackqualitychange",function(){e.trigger("resolutionchange")}),e.one("play",function(){var t=e.tech_.ytplayer.getavailablequalitylevels(),s={highres:{res:1080,label:"1080",yt:"highres"},hd1080:{res:1080,label:"1080",yt:"hd1080"},hd720:{res:720,label:"720",yt:"hd720"},large:{res:480,label:"480",yt:"large"},medium:{res:360,label:"360",yt:"medium"},small:{res:240,label:"240",yt:"small"},tiny:{res:144,label:"144",yt:"tiny"},auto:{res:0,label:"auto",yt:"default"}},r=[];t.map(function(t){r.push({src:e.src().src,type:e.src().type,label:s[t].label,res:s[t].res,_yt:s[t].yt})});var i="auto",o=0,n=((c=d(r)).label.auto,new u(e,{sources:c,initialyselectedlabel:i,initialyselectedres:o,customsourcepicker:function(t,l,s){return e.tech_.ytplayer.setplaybackquality(l[0]._yt),e}},l,a));n.el().classlist.add("vjs-resolution-button"),e.controlbar.resolutionswitcher=e.controlbar.addchild(n)})}(n)})},(t.registerplugin||t.plugin)("videojsresolutionswitcher",l)}(window,e)}();
});
$(document).on("videojs-loaded.videojs-ga", function(){
(function(){var e=[].indexof||function(e){for(var t=0,n=this.length;t=0&&t("loadedmetadata",!0)},w=function(){var t,n,a,i,r;for(t=math.round(this.currenttime()),n=math.round(this.duration()),i=math.round(t/n*100),a=r=0;r<=99;a=r+=f)i>=a&&e.call(v,a)<0&&(e.call(s,"start")>=0&&0===a&&i>0?t("start",!1):e.call(s,"percentsplayed")>=0&&0!==i&&t("percent played",!1,a),i>0&&v.push(a));e.call(s,"seek")>=0&&(m=y,y=t,math.abs(m-y)>1&&(m=!0,t("seek start",!1,m),t("seek end",!1,y)))},i=function(){t("end",!1)},g=function(){var e;e=math.round(this.currenttime()),t("play",!1,e),m=!1},h=function(){var e;(e=math.round(this.currenttime()))===math.round(this.duration())||m||t("pause",!1,e)},b=function(){var e;e=!0===this.muted()?0:this.volume(),t("volume change",!1,e)},p=function(){t("resize - "+this.width()+"*"+this.height(),!0)},r=function(){var e;e=math.round(this.currenttime()),t("error",!0,e)},u=function(){var e;e=math.round(this.currenttime()),("function"==typeof this.isfullscreen?this.isfullscreen():void 0)||("function"==typeof this.isfullscreen?this.isfullscreen():void 0)?t("enter fullscreen",!1,e):t("exit fullscreen",!1,e)};var q=function(){var e;e=math.round(this.currenttime()),t("downloadvideo",!1,e)},k=this;return t=function(e,n,a){l=k.currentsrc().split("/").slice(-1)[0]+"|"+location.pathname+location.search,window.ga?ga("send","event",{eventcategory:o,eventaction:e,eventlabel:l,eventvalue:a,noninteraction:n}):window._gaq?_gaq.push(["_trackevent",o,e,l,a,n]):t.debug&&console.log("google analytics not detected")},this.ready(function(){if(this.on("loadedmetadata",c),this.on("timeupdate",w),this.on("qualityrequested",function(){var e=math.round(this.currenttime());t("qualityrequested",!1,e)}),this.on("qualityselected",function(){var e=math.round(this.currenttime());t("qualityselected",!1,e)}),e.call(s,"downloadvideo")>=0&&this.on("downloadvideo",q),e.call(s,"end")>=0&&this.on("ended",i),e.call(s,"play")>=0&&this.on("play",g),e.call(s,"pause")>=0&&this.on("pause",h),e.call(s,"volumechange")>=0&&this.on("volumechange",b),e.call(s,"resize")>=0&&this.on("resize",p),e.call(s,"error")>=0&&this.on("error",r),e.call(s,"fullscreen")>=0)return this.on("fullscreenchange",u)}),{sendbeacon:t}})}).call(this);
});
$(document).on("videojs-loaded.videojs-language", function(){
videojs.addlanguage('zh-cn', {
"play": "播放",
"pause": "暂停",
"current time": "当前时间",
"duration": "时长",
"remaining time": "剩余时间",
"stream type": "媒体流类型",
"live": "直播",
"loaded": "加载完成",
"progress": "进度",
"fullscreen": "全屏",
"non-fullscreen": "退出全屏",
"picture-in-picture": "画中画",
"exit picture-in-picture": "退出画中画",
"mute": "静音",
"unmute": "取消静音",
"playback rate": "播放速度",
"subtitles": "字幕",
"subtitles off": "关闭字幕",
"captions": "内嵌字幕",
"captions off": "关闭内嵌字幕",
"chapters": "节目段落",
"close modal dialog": "关闭弹窗",
"descriptions": "描述",
"descriptions off": "关闭描述",
"audio track": "音轨",
"you aborted the media playback": "视频播放被终止",
"a network error caused the media download to fail part-way.": "网络错误导致视频下载中途失败。",
"the media could not be loaded, either because the server or network failed or because the format is not supported.": "视频因格式不支持或者服务器或网络的问题无法加载。",
"the media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "由于视频文件损坏或是该视频使用了你的浏览器不支持的功能,播放终止。",
"no compatible source was found for this media.": "无法找到此视频兼容的源。",
"the media is encrypted and we do not have the keys to decrypt it.": "视频已加密,无法解密。",
"play video": "播放视频",
"close": "关闭",
"modal window": "弹窗",
"this is a modal window": "这是一个弹窗",
"this modal can be closed by pressing the escape key or activating the close button.": "可以按esc按键或启用关闭按钮来关闭此弹窗。",
", opens captions settings dialog": ", 开启标题设置弹窗",
", opens subtitles settings dialog": ", 开启字幕设置弹窗",
", opens descriptions settings dialog": ", 开启描述设置弹窗",
", selected": ", 选择",
"captions settings": "字幕设定",
"audio player": "音频播放器",
"video player": "视频播放器",
"replay": "重新播放",
"progress bar": "进度条",
"volume level": "音量",
"subtitles settings": "字幕设定",
"descriptions settings": "描述设定",
"text": "文字",
"white": "白",
"black": "黑",
"red": "红",
"green": "绿",
"blue": "蓝",
"yellow": "黄",
"magenta": "紫红",
"cyan": "青",
"background": "背景",
"window": "窗口",
"transparent": "透明",
"semi-transparent": "半透明",
"opaque": "不透明",
"font size": "字体尺寸",
"text edge style": "字体边缘样式",
"none": "无",
"raised": "浮雕",
"depressed": "压低",
"uniform": "均匀",
"dropshadow": "下阴影",
"font family": "字体库",
"proportional sans-serif": "比例无细体",
"monospace sans-serif": "单间隔无细体",
"proportional serif": "比例细体",
"monospace serif": "单间隔细体",
"casual": "舒适",
"script": "手写体",
"small caps": "小型大写字体",
"reset": "重置",
"restore all settings to the default values": "恢复全部设定至预设值",
"done": "完成",
"caption settings dialog": "字幕设定窗口",
"beginning of dialog window. escape will cancel and close the window.": "打开对话窗口。escape键将取消并关闭对话窗口",
"end of dialog window.": "结束对话窗口",
"seek to live, currently behind live": "尝试直播,当前为延时播放",
"seek to live, currently playing live": "尝试直播,当前为实时播放",
"progress bar timing: currenttime={1} duration={2}": "{1}/{2}",
"{1} is loading.": "正在加载 {1}。"
});
});
});
define('plugins/old-player-compat',[
], function () {
"use strict";
// 旧版播放器结构兼容处理
(function __playersetup(videobox) {
function ismobile() {
var ismobile = {
android: function () {
return navigator.useragent.match(/android/i);
},
blackberry: function () {
return navigator.useragent.match(/blackberry/i);
},
ios: function () {
return navigator.useragent.match(/iphone|ipad|ipod/i);
},
opera: function () {
return navigator.useragent.match(/opera mini/i);
},
windows: function () {
return navigator.useragent.match(/iemobile/i);
},
any: function () {
return (ismobile.android() || ismobile.blackberry() || ismobile.ios() || ismobile.opera() || ismobile.windows());
}
};
return ismobile.any();
}
// bof jwplayer
(function ($) {
// $(function ($) {
// bof dom ready
// 旧版弹窗播放视频结构兼容性处理
$("a.js_video_player").not("[data-play-nopop]").each(function () {
var $t = $(this);
$t.removeclass("js_video_player").addclass("btn-play").append("");
var s = json.stringify(($t.data("options") || {})["sources"]);
$t.attr("default-src", $t.attr("data-video-path")).attr("video-src", s);
});
var playerinstance = null;
function pausevideo(e) {
try {
if (playerinstance)
playerinstance.remove();
} catch (_e) { }
}
$(document).off("vclick", ".js_video_player, .js-play-btn");
$(document).off("click", ".js_video_player, .js-play-btn").on("click", ".js_video_player, .js-play-btn", function (e) {
if (typeof videojs == "undefined") {
if (window.console) console.log("player 还未加载");
return false;
}
var playerid = $(this).attr("data-player-id") || "playercontainer";
var video_path = $(this).attr("data-video-path");
var video_name = $(this).attr("data-video-name"); // 增加视频名称
if (video_name == "" || video_name == undefined) {
video_name = video_path; //视频名称为空,去取path
}
var autostart = ($(this).attr("data-player-autostart") || "1") == "1";
var ismobile = ismobile();
if (ismobile)
video_path = $(this).attr("data-video-path-mobile") || video_path;
if (video_path && video_path.indexof("//") == 0)
video_path = location.protocol + video_path;
var player_options = $(this).data("option") || $(this).data("options") || {};
player_options["sources"] = player_options["sources"] || [];
player_options["gaevent"] = $(this).attr("data-onclick");
var video_sources = [];
var vlist = $(this).attr("data-video-sources");
if (vlist) {
vlist = vlist.split(",");
for (var i = 0; i < vlist.length; i++) {
var v_info = vlist[i].split("|");
var label = $.trim(v_info[1] || "default");
video_sources[i] = { file: $.trim(v_info[0]), label: label };
video_sources[i]["src"] = video_sources[i]["file"];
if (!ismobile && label.indexof("720") >= 0) video_sources[i]["default"] = true;
else if (ismobile && label.indexof("360") >= 0) video_sources[i]["default"] = true;
}
if (ismobile) {
var md = $.grep(video_sources, function (v) { return v["default"]; });
if (!md.length) video_sources[video_sources.length - 1]["default"] = true;
}
}
player_options["sources"] = video_sources.concat(player_options["sources"]);
if (player_options["sources"].length == 0 && video_sources.length > 0)
player_options["sources"] = video_sources;
else if (video_path && video_sources.length == 0 && player_options["sources"].length == 0)
player_options["sources"] = [{ "src": video_path, label: "default" }];
else if (!video_path && video_sources.length == 0 && player_options["sources"].length == 0 && $(this).attr("data-url"))
player_options["sources"] = [{ "src": $(this).attr("data-url"), label: "default" }];
if (player_options["sources"].length > 1) {
var sourceobj = {};
$.each(player_options["sources"], function (i, o) {
sourceobj[o.label.tolocalelowercase()] = o;
});
var defaultv = ismobile ? sourceobj["360p"] : sourceobj["720p"];
if (!defaultv) {
defaultv = player_options["sources"][0];
}
defaultv["selected"] = true;
defaultv["res"] = 720;
}
player_options["poster"] = player_options["poster"] || $(this).attr("data-img-path");
player_options["autoplay"] = typeof player_options["autoplay"] == "boolean" ? player_options["autoplay"] : autostart;
if ($(this).attr("data-play-nopop")) {
//$(this).next("img").fadeout();
playerinstance = initplayer(playerid, player_options);
$(this).addclass("invisible");
return false;
}
// 采用新版弹框播放
var play_html = $("
");
var $t = $(this);
bootstrapdialog.show({
message: play_html,
cssclass: "video-dialog",
onshown: function () {
playerinstance = initplayer(playerid, player_options);
playerinstance.onfullscreen = function (e) {
if (window.console) console.log(e);
};
settimeout(function () {
$(".bootstrap-dialog.video-dialog").off("keyup");
// if (!ismobile)
// playerinstance && playerinstance.play(true);
}, 2000);
},
onhide: function (dialogref) {
//playerinstance && playerinstance.play(false);// && playerinstance.remove();
//alert('dialog is popping down, its message is ' + dialogref.getmessage());
playerinstance && playerinstance.dispose();
}
});
return false;
});
// eof dom ready
// });
})(jquery);
// eof
})();
window.initplayer = function (playerid, options) {
options = options || {};
$("")
.replaceall($("#" + playerid));
var player_options = {
controls: true,
autoplay: true,
preload: "none",
"fluid": true,
sources: [],
aspectratio: "16:9",
muted: false,
plugins: {},
"language": window["videojslanguage"]
};
options["aspectratio"] = options["aspectratio"] || options["aspectratio"] || "16:9";
options["muted"] = options["muted"] || options["mute"] || false;
options["loop"] = options["loop"] || options["repeat"] || false;
if (videojs.getplugin && videojs.getplugin("vjsdownload")) {
player_options.plugins["vjsdownload"] =
{
beforeelement: "playbackratemenubutton",
textcontrol: window["playerlang"][window["lang"]]["download-video"],
name: "downloadbutton",
//downloadurl: 'https://insert_source_here.mp4' //optional if you need a different download url than the source
};
}
$.extend(player_options, options);
var player = videojs.getplayers()[playerid];
if (player) player.dispose();
var player = videojs(playerid, player_options);
if (player_options["autoplay"])
settimeout(function () { player.play(); }, 1000);
if (videojs.getcomponent("qualityselector")) {
player.controlbar.addchild("qualityselector", {
textcontrol: "quality",
}).controltext(window["playerlang"][window["lang"]]["switch-quality"]);
}
if (player.ga)
player.ga();
if (player_options.gaevent) {
var flag = false;
var evt = function (e) {
if (flag) return;
flag = true;
var gaevent = new function("e", player_options.gaevent);
gaevent.apply(e)
};
if (player.one)
player.one("play", evt);
else
player.on("play", evt);
}
var hassend = false;
player.on("play", function (e) {
if (hassend)
return;
hassend = true;
var url = player.currentsrc();
try {
utag.link({
"tealium_event": "video_clicked",
"video_id": url,
"video_name": ""
});
} catch (e) {
}
});
return player;
};
});
define("global/window", [], function () {
return window;
});
define("global/document", [], function () {
return document;
});
if (!window.location.origin) {
window.location.origin = window.location.protocol + "//"
+ window.location.hostname + (window.location.port ? ':' + window.location.port : '');
}
var origin = window.location.origin;
var langcn = $("html").is('[lang="zh"]') || document.url.indexof("/cn/") >= 0;
(function videojs5to7() {
if (langcn) {
$("video.video-js[data-setup]").each(function () {
$(this)
.data("setup", $(this).data("setup"))
.removeattr("data-setup")
.addclass("language-cn");
});
}
$("video[src]").each(function () {
var $t = $(this);
$t.append("");
});
}());
define('videobox',["plugins/videojs-plugins", "plugins/old-player-compat"], function () {
var videodef = $.deferred();
var videojs;
// 视频播放器组件
var videojspromise = function () {
var videojsie8 = $.when();
return videojsie8
.then(function () {
$("")
.prependto("head");
if (typeof window.videojs !== "undefined") return $.when();
// return $.loadjs(origin + "/assets/corp/2020/js/lib/vendor/video.js/video.min.js");
return $.loadjs("https://www.huawei.com/assets/corp/2020/js/lib/vendor/video.js/video.min.js");
})
.then(function (_videojs) {
if (typeof _videojs === "function") (window.videojs = _videojs);
videojs = _videojs || window.videojs;
$(document).trigger("videojs-loaded");
if (langcn) {
$("video.video-js.language-cn").each(function () {
var $v = $(this);
var ops = $v.data("setup") || {};
ops.language = "zh-cn";
window.videojs(this, ops);
});
}
if (window.videojs.getplugin("videojsresolutionswitcher")) return $.when();
return $.loadjs("https://cdn.jsdelivr.net/npm/"
+ "@xiaoyexiang/videojs-resolution-switcher-v7@1.1.9/lib/videojs-resolution-switcher-v7.min.js");
})
.then(function (d) {
videodef.resolve(videojs);
$(document).trigger("videojs-resolution-switcher-loaded");
});
};
$(document).on("videojs-loaded.videojs-ga", function (e) {
var gaplugin = $.when();
gaplugin
.then(function (d) {
$(document).trigger("videojs-ga-loaded");
})
.then(function () {
$(document).trigger("videojs-setup", videojs.getplayers());
});
});
$(document).on("videojs-setup", function (e, players) {
$.each(players, function (i, player) {
var gaoption = {
eventlabel:
player.currentsrc().split("/").slice(-1)[0] + "|" + document.url,
};
player.ga(gaoption);
});
});
// 视频默认分辨率
$(document).on("resolutionswitcher", function (e, _players) {
var players = _players || {};
var winw = $(window).width();
$.each(players, function (i, o) {
if (
!$.grep(o.controlbar.children(), function (element) {
return element.name === "button";
}).length
) {
var player = o;
try {
var mybutton = player.controlbar.addchild("button");
var mybuttondom = mybutton.el();
$(mybuttondom)
.addclass("vjs-download-control")
.on("click", function () {
if (/msie|trident/i.test(navigator.useragent)) {
var a = document.createelement("a");
a.href = $(this).find("a").attr("href");
a.target = "_blank";
a.rel = "noopener";
$(a).hide().appendto("body");
settimeout(function () {
a.click();
$(a).remove();
}, 200);
}
});
mybuttondom.innerhtml = '';
} catch (error) { }
}
//
var $rs_btn = $(o.controlbar.resolutionswitcher);
if (!$rs_btn.length) {
var vrs = {
default: 360,
dynamiclabel: true,
};
if (winw > 991) vrs.default = 720;
o.videojsresolutionswitcher(vrs);
}
if ($rs_btn.length && $rs_btn.find(".vjs-menu-content .vjs-menu-item").length <= 1) {
$rs_btn.addclass("hidden");
}
});
});
$(document).on("videojs-resolution-switcher-loaded", function (e) {
if (typeof videojs !== "undefined") {
settimeout(function () {
$(document).trigger("resolutionswitcher", videojs.getplayers());
}, 1000);
}
});
if ($("video.video-js, .btn-play, .js-play-btn, .js_video_player, .js-video-gallery-btn, .js-has-videojs").length) {
videojspromise();
}
$(document).on("click", ".btn-close, .js-close-btn", function (e) {
$("body").removeclass("video-popup");
}).on("click", ".btn-play, .js-play-btn", function (e) {
$("body").addclass("video-popup");
});
function videobox(dom, id) {
this.dom = dom;
if (this.dom[0].inited) return;
this.dom[0].inited = true;
this.defaultsrc = dom.attr("default-src");
this.src = dom.attr("video-src");
this.poster = dom.attr("poster");
this.id = id;
this.popup = dom.attr("data-popup") || 1;
var self = this;
videodef.then(function (d) {
self.init();
});
}
videobox.prototype = {
init: function () {
var self = this;
var div = document.createelement("div");
div.setattribute("class", "video-box");
var disabledl = self.dom.hasclass("no-download") ? ' oncontextmenu="return false;"' : "";
var disabledlclass = self.dom.hasclass("no-download") ? " no-download" : "";
var poster = this.poster ? ' poster="' + this.poster + '"' : "";
var sources = [];
try {
sources = (new function("return " + self.dom.attr("video-src")))();
} catch (_e) { }
if (!sources && self.defaultsrc) sources = [{ src: self.defaultsrc, label: "720p", res: 720 }];
var sourceshtml = sources.map(function (v) {
return '';
});
sourceshtml = sourceshtml.join("");
var vwidth = 960;
var vheight = 540;
if (window.innerwidth < 990) {
vwidth = window.innerwidth;
vheight = vwidth / (16 / 9);
}
$(div).html('
'
+ '
");
if (this.popup === "0") {
this.dom.after(div).end().hide();
} else $("body").append($(div));
self.setupplayer(div);
},
setupplayer: function (videocontainer) {
var self = this;
var div = videocontainer;
var options = {
controls: true,
};
if (langcn) options.language = "zh-cn";
var video = videojs("my-video-" + this.id, options, function () {
var player = this;
window.player = player;
var aaa = [];
try {
aaa = eval(self.src) || [];
} catch (_e) { }
// 切换清晰度
if (aaa.length > 0 && player.updatesrc) player.updatesrc(aaa);
if (aaa.length <= 1 && player.controlbar.resolutionswitcher) {
player.controlbar.resolutionswitcher.classlist.add("hidden");
}
player.on("resolutionchange", function () {
console.info("source changed to %s", player.src());
});
});
this.dom.on("click", function (e) {
e.preventdefault();
$(div).addclass("show");
settimeout(function () {
video.play();
}, 1000);
settimeout(function () {
video.play();
}, 100);
});
$(div).find("a.btn-close").on("click", function (e) {
e.preventdefault();
$(div).removeclass("show");
video.pause();
});
},
};
return videobox;
});
/**
* swiper 5.3.6
* most modern mobile touch slider and framework with hardware accelerated transitions
* http://swiperjs.com
*
* copyright 2014-2020 vladimir kharlampidi
*
* released under the mit license
*
* released on: february 29, 2020
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define('vendor/swiper/swiper.min',t):(e=e||self).swiper=t()}(this,(function(){"use strict";var e="undefined"==typeof document?{body:{},addeventlistener:function(){},removeeventlistener:function(){},activeelement:{blur:function(){},nodename:""},queryselector:function(){return null},queryselectorall:function(){return[]},getelementbyid:function(){return null},createevent:function(){return{initevent:function(){}}},createelement:function(){return{children:[],childnodes:[],style:{},setattribute:function(){},getelementsbytagname:function(){return[]}}},location:{hash:""}}:document,t="undefined"==typeof window?{document:e,navigator:{useragent:""},location:{},history:{},customevent:function(){return this},addeventlistener:function(){},removeeventlistener:function(){},getcomputedstyle:function(){return{getpropertyvalue:function(){return""}}},image:function(){},date:function(){},screen:{},settimeout:function(){},cleartimeout:function(){}}:window,i=function(e){for(var t=0;t=0&&d.indexof(">")>=0){var h="div";for(0===d.indexof("