web/res/js/notify.js

(开头部分) 7KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/**
*	桌面通知插件(支持IE啊)
*	createname:雨中磐石
*	homeurl:http://www.rockoa.com/
*	Copyright (c) 2016 rainrock (xh829.com)
*	Date:2016-01-01
*	var notify = notifyClass({
*		'sound':'声音文件地址','soundbo':true,'icon':'通知图标'
*	});
*	notify.showpopup('这是个通知?');
*	soundbo 声音提示
*	sound 声音文件地址
*/

function notifyClass(opts){
	var me 		= this;
	this.title 	= '系统提醒';
	this.icon  	= 'images/logo.png';
	this.notbool =true;
	this.lastmsg = '';
	this.sound 	 = '';
	this.sounderr= '';
	this.soundbo = true;
	this.showbool= false;
	this.macos	 = false;
	this._init=function(){
		if(opts)for(var o1 in opts)this[o1]=opts[o1];
		var strsr = '';
		if(typeof(Notification)=='undefined'){
			this.notbool=false;
			strsr = '<bgsound id="notify_sound_audio" src="" hidden="true" autostart="false" loop="false">';
		}else{
			strsr = '<audio id="notify_sound_audio" src="web/res/sound/wu.mp3" autoplay="autoplay" hidden="true"></audio>';
		}
		if(this.sound)$('body').append(strsr);
		var llq = navigator.userAgent.toLowerCase();
		if(llq.indexOf('reimclient')>0)this.macos = true;
	};
	this.setsound	= function(bo){
		this.soundbo=bo;
	};
	this.getsound	= function(){
		return this.soundbo;
	};
	this.opennotify = function(clsfun){
		if(!this.notbool)return false;
		if(!clsfun)clsfun=function(){};
		if(Notification.permission === 'granted')return false;
		if(Notification.permission !== 'denied'){
			Notification.requestPermission(function (permission){
				clsfun();
				if(!('permission' in Notification)) {
					Notification.permission = permission;
				}
				if(permission==='granted') {
					
				}
			});
		}
	};
后面还有 172 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。