Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var PopupFrame = function (opt) {
var me = this;
// 设置默认值
me.options = $.extend({
title: '', // 标题,支持html和Zepto对象
content: '', // 内容,支持html和Zepto对象
fullView: false, // 是否全屏
duration: 400, // 动画执行时间
customClassName: '', // 自定义样式名
onOpen: function () {},
onClose: function () {}
}, opt);
// 初始化
me._init();
};
$.fn.scrollTo = function (options) {
var defaults = {
toT: 0, // 滚动目标位置
durTime: 160, // 过渡动画时间
delay: 30, // 定时器时间
callback: null // 回调函数
};
var opts = $.extend(defaults, options);
var timer = null;
var thisThis = this;
var curTop = thisThis.scrollTop();
var subTop = opts.toT - curTop;
var index = 0;
var dur = Math.round(opts.durTime / opts.delay);
var smoothScroll = function (t) {
index++;
var per = Math.round(subTop / dur);
if (index >= dur) {
thisThis.scrollTop(t);
window.clearInterval(timer);
if (opts.callback && typeof opts.callback === 'function') {
opts.callback();
}
this.navs = [];
this.seps = [];
this.conts = [];
this.sum = 0; // tab切换次数
this.last = null; // 上次tab切换序号
// 函数
this.onChange = options.onChange || fn;
this.onResetChange = options.onResetChange || fn;
this.onTabScrollEnd = options.onTabScrollEnd;
// init
panel && _init.call(this, options);
};
$.extend(Tabs.prototype, {
showContent : function(i){
var cont=this.conts[i];
if(cont){
$(this.conts[i]).show();
}
},
hideContent : function(i){
var cont=this.conts[i];
if(cont){
$(cont).hide();
}
},
showTab : function(i){
var _this = this,
navs = _this.navs,
seps = _this.seps;
function Share (opt, container) {
opt = $.extend({}, defaultOpt, opt);
var share = new PMDShare(opt);
// render方法可以直接在页面中渲染分享ICON
// 由于为js渲染会出现抖动,请注意执行时机
share.render(
container,
{
onRender: function() {
// 初始化 分享
// initCopyLink(container, opt);
}
}
);
this.share = share;
function VideoPlayer(opt) {
this.params = $.extend(true, {
// 视频容器 必填
container: null,
height: null,
width: null,
src: null,
type: null,
poster: null,
autoplay: null,
controls: null,
loop: null,
muted: null,
ios: {
playMode: false
},
init: function(opts) {
this.opts = $.extend({}, defaultOpts, opts);
this.$box = this.opts.$box;
this.$wrapper = $('<div class="scrollBar-warpper"></div>');
this.$bar = $('<span class="bar"></span>').insertAfter(this.$box.addClass('scrollBar').wrap(this.$wrapper));
this.refresh();
this.bindEvents();
},
refresh: function() {
init: function(opts) { //幂等函数
if (!this.__init__) this.initDefaultOpt();
this.opts = $.extend({flag:share.FLAG_MQQ+share.FLAG_WEIXIN}, opts);
var i = this.FLAG_MQQ;
while(OP[i]) {
if (this.opts.flag & i) {
OP[i](this.opts);
}
i = i << 1;
}
this.__init__ = true;
},
MQQShareMessage: function(o, type, cb) {
init: function (option) {
var This = this;
This.option = {
main: '显示内容'
};
$.extend(true, this.option, option || {});
This.dom();
This.bindEvent();
},
dom: function () {
this._defineEvent("dirty");
this._defineEvent("addr");
this._defineEvent("packet");
this._defineEvent("keyReady");
}
Tlke.authBitLength = 16;
Tlke.offerBitLength = 128;
Tlke.dhPrivBitLength = 160;
var EventEmitter = require("modules/channels/EventEmitter");
var invariant = require("tools/invariant");
var isMultivalue = require("modules/data-types/isMultivalue");
Tlke.prototype = new EventEmitter();
$.extend(Tlke.prototype, {
generate: function () {
this.checkEventHandlers();
invariant(this.state === Tlke.STATE_NOT_STARTED,
"Can't generate offer being in a state %s", this.state);
this._generateOffer();
},
enterOffer: function (offer) {
this.checkEventHandlers();
invariant(isMultivalue(offer), "offer must be multivalue");
invariant(this.state === Tlke.STATE_NOT_STARTED,
"Can't accept offer being in a state %s", this.state);
invariant(offer, "Received an empty offer");
this._acceptOffer(offer);
},
enterAuth: function (auth) {
invariant(isMultivalue(auth), "offer must be multivalue");
WeiXinShareToFriend: function(opts) {
if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
var shareParams = this.getWeiXinParams($.extend({}, defaultOpt, opts));
opts.beforeWeiXinShareToFriend && (shareParams = opts.beforeWeiXinShareToFriend(shareParams));
WeixinJSBridge.invoke("sendAppMessage", shareParams, function (res) {
opts.onShareWeiXinFriend && opts.onShareWeiXinFriend(res);
});
}
},
WeiXinShareToTimeline: function(opts) {