notification桌面通知被禁止穿拖鞋上班的通知了怎么办

点击notification通知栏时启动的activity只有该activity本身,回退后就是桌面
[问题点数:40分,结帖人u]
点击notification通知栏时启动的activity只有该activity本身,回退后就是桌面
[问题点数:40分,结帖人u]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
2015年2月 移动开发大版内专家分月排行榜第二
2015年4月 移动开发大版内专家分月排行榜第三2015年1月 移动开发大版内专家分月排行榜第三
匿名用户不能发表回复!|
每天回帖即可获得10分可用分!小技巧:
你还可以输入10000个字符
(Ctrl+Enter)
请遵守CSDN,不得违反国家法律法规。
转载文章请注明出自“CSDN(www.csdn.net)”。如是商业用途请联系原作者。如何删除Discuz X3.1一直弹出的请求桌面通知?
积分帖子听众
, 积分 41, 距离下一级还需 9 积分
, 积分 41, 距离下一级还需 9 积分
都是恰三门峡人,赶紧免费注册个账号吧,美女帅哥大家都在等着你,注册之后,你的生活更加精彩。
才可以下载或查看,没有帐号?
  具体代码在template/default/common/footer.htm里面
  大约136行到152行,具体内容如下:
&!--{if ($_G[member][neWPm] || $_G[member][newprompt]) && empty($_G['cookie']['ignore_notice'])}--&
& && &&&&script type=&text/javascript& src=&{$_G[setting][jspath]}html5notification.js?{VERHASH}&&&/script&
& && &&&&script type=&text/javascript&&
& && &&&var h5n = new Html5notification();
& && &&&if(h5n.issupport()) {
& && && && && & &!--{if $_G[member][newpm] && $_GET[do] != 'pm'}--&
& && && && && & h5n.shownotification('pm', '$_G[siteurl]home.php?mod=space&do=pm', '&!--{avatar($_G[uid],small,true)}--&', '{lang newpm_subject}', '{lang newpm_notice_info}');
& && && && && & &!--{/if}--&
& && && && && & &!--{if $_G[member][newprompt] && $_GET[do] != 'notice'}--&
& && && && && && && && && && &&&&!--{loop $_G['member']['category_num'] $key $val}--&
& && && && && && && && && && && && && & &!--{eval $noticetitle = lang('template', 'notice_'.$key);}--&
& && && && && && && && && && && && && & h5n.shownotification('notice_$key', '$_G[siteurl]home.php?mod=space&do=notice&view=$key', '&!--{avatar($_G[uid],small,true)}--&', '$noticetitle ($val)', '{lang newnotice_notice_info}');
& && && && && && && && && && &&&&!--{/loop}--&
& && && && && & &!--{/if}--&
& && &&&}
& && &&&&/script&
&!--{/if}--&复制代码全部删除即可。
  顺便提一下,应用中心的插件更新提示在124到127行:
&!--{if $_G['uid'] && $_G['member']['allowadmincp'] == 1 && empty($_G['cookie']['pluginnotice'])}--&
& && &&&&div class=&focus plugin& id=&plugin_notice&&&/div&
& && &&&&script type=&text/javascript&&pluginNotice();&/script&
&!--{/if}--&复制代码我删除了这2个,没有了那个烦人的无下限的请求桌面通知和插件更新的提示了,爽!
积分帖子听众
, 积分 418, 距离下一级还需 82 积分
, 积分 418, 距离下一级还需 82 积分
你太有才了。
积分帖子听众
, 积分 396, 距离下一级还需 104 积分
, 积分 396, 距离下一级还需 104 积分
生活TMD好玩,因为生活老TMD玩我!
积分帖子听众
希望各位和我一样创业的朋友,在这个路上,我们一起为明天奋斗。
积分帖子听众
, 积分 384, 距离下一级还需 116 积分
, 积分 384, 距离下一级还需 116 积分
起那么早干吗?酒吧还没开门呢!
积分帖子听众
, 积分 1320, 距离下一级还需 1680 积分
, 积分 1320, 距离下一级还需 1680 积分
呵呵,低调,低调!二次元同好交流新大陆
扫码下载App
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
刘国利:白色,是我的世界的颜色,独特而隐逸。我的“自由”不单纯是不让别人决定我的人生,还是认识我的个性,维护我的个性,决定我生活目标的代名词,也从不以“地位”、“权力”为目标,只为了自己心底的梦、珍重的事、守护的情而奋斗。
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
API介绍  桌面提醒功能是由window对象下的webkitNotifications来实现的,通过window.webkitNotifications将返回一个NotificationCenter对象。这个对象没有属性,但是却关联着四个方法:构建桌面通知的基本步骤一、检测浏览器是否支持通过window.webkitNotifications可以判断浏览器是否支持notificationif(!window.webkitNotifications){ alert("您的浏览器不支持Notification桌面通知!");}二、权限只有获得用户授权才可以显示Notification。requestPermission()  这个方法用于向用户请求获得消息提醒的权限,分别对应着3中状态:“granted”(状态值:0)表示用户同意消息提醒;“default”(状态值:1)表示默认状态,用户既未拒绝,也未同意;“denied”(状态值:1)表示用户拒绝消息提醒。只有在状态值为0的时候才能够允许消息提醒,这个值保存在一个内部变量中,并且是只读的,通过checkPermission()方法可以提取到这个状态值。//请求授权,如果成功则执行回调函数function RequestPermission (callback) {
window.webkitNotifications.requestPermission(callback);}function showNotification(){
if (window.webkitNotifications.checkPermission() & 0) { RequestPermission(showNotification);
//show Notification here..
}}三、createNotification()  这个方法以纯消息的方式创建提醒消息,它接受三个参数:iconURL, title, body。这三个参数均为字符串格式,iconURL表示一个图标地址、title表示消息标题、body表示消息主体,默认这三个参数为空字符串。调用这个方法会返回一个Notification对象,我们可以针对这个对象做更多的设置。属性:  dir:设置消息的排列方向,可取值为“auto”(自动), “ltr”(left to right), “rtl”(right to left)。  tag:为消息添加标签。如果设置此属性,当有新消息提醒时,标签相同的消息,后一个消息框会替换先前一个,不会出现多重消息提示框。  onshow:事件属性,当消息框显示的时候触发该事件;  onclick:事件属性,当点击消息框的时候触发该事件;  onclose:事件属性,当消息关闭的时候触发该事件;  onerror:事件属性,当出现错误的时候触发该事件;(TODO:错误类型)方法:  addEventListener && removeEventListener:常规的添加和移除事件方法;  show:显示消息提醒框;  close:关闭消息提醒框;  cancel:关闭消息提醒框(这个方法和close方法产生的效果是一样,不清楚他们之间有什么深层次的区别)四、createHTMLNotification()  这个方法以HTML方式创建消息提醒,它接受一个参数,即HTML消息文档的URL。同样调用这个方法也会返回一个Notification对象,这个对象与用纯文本方式创建消息提醒返回的Notification对象相同,故对其属性和方法就不重述了。注意:桌面提醒功能要在服务器的环境下才能够正常使用【下面内容为对api的运用】1. 只弹出一个通知窗口这个问题比较好解决,因为通知对象拥有一个名为"replaceId"的属性。指定该属性后,只要是相同replaceId的通知窗口弹出,都会覆盖之前弹出的窗口。在实际项目中是给所有的弹出窗口赋了一个相同的replaceId。不过需要注意的是,这种覆盖行为只在同域下有效。2. 确保页面Focus时不弹出通知窗口这个问题主要是在于判断浏览器窗口是否处于Focus状态,目前除了监听window的onfocus和onblur事件之外,貌似没有更好的方式。在项目中就是通过这种方式来记录窗口的Focus状态,然后当消息到达时根据Focus状态来判断是否弹出窗口。$(window).bind( 'blur', this.windowBlur).bind( 'focus', this.windowFocus); &&使用该方法需要注意的地方是,事件注册的事件点应该尽可能的靠前,如果注册太晚则当用户打开页面后再离开就会很容易出现状态的误判。3. 识别多Tab的Focus状态多页面间的状态共享可以通过本地存储来实现:浏览器窗口Focus时修改本地存储中指定key的值为"focus"浏览器窗口Blur时修改本地存储中指定key的值为"blur"需要注意的是,Chrome下从一个Tab切换到另一个Tab时,Blur有可能比Focus后写入存储中,因此修改Focus状态时需要异步处理。/*window on focus事件*/ & &&//用延时是为了解决多个Tab之间切换时,始终让Focus覆盖其他Tab的Blur事件 & &&//注: 如果在点击Tab之前没有Focus到document上则点击Tab是不会触发Focus的 & &&setTimeout( function(){ & &&& & Storage.setItem( 'kxchat_focus_win_state', 'focus' ); & &&}, 100); & &&/*window on blur事件*/ & &&Storage.setItem( 'kxchat_focus_win_state', 'blur' ); & &实现以上状态共享后,新的消息到达后,只需要查看本地存储中’kxchat_focus_win_state’的值是否为blur,如果为blur才弹出窗口。4. 通知窗口的事件响应通知窗口支持onclick等事件响应,而响应函数中的作用范围属于创建该窗口的页面。如下代码:var n = dn.createNotification( & &&& & img, & &&& & title, & &&& & content & &&); & &&//确保只有一个提醒 & &&n.replaceId = this.replaceId; & &&n.onclick = function(){ & &&& & //激活弹出该通知窗口的浏览器窗口 & &&& & window.focus(); & &&& & //打开IM窗口 & &&& & WM.openWinByID( data ); & &&& & //关闭通知窗口 & &&& & n.cancel(); & &&}; & &&在onclick的响应函数中访问的window对象即属于当前创建页面,因此可以很方便的与当前页面进行交互。以上代码便实现了点击弹出窗口会跳转到对应的浏览器窗口和打开IM窗口。【最后是当前谷歌提供的api官方文档】This is a DRAFT specification and subject to change.&Note that the latest version of the spec is here: http://dev.w3.org/2006/webapi/WebNotifications/publish/ but this page reflects what's implemented in the latest version of Chromium.The Notification interfaceThis interface represents a notification object.interface Notification : EventTarget {&// display methods&void show();&void cancel();&// event handler attributes&attribute F&attribute F&attribute F&attribute F}Attributesondisplayevent listener function corresponding to event type "display". &This listener must be called when the notification is displayed to the user, which need not be immediately when show() is called.onerrorevent listener function corresponding to event type "error". &This listener must be called when the notification cannot be displayed to the user because of an error.oncloseevent listener function corresponding to event type "close". &This listener must be called when the notification is closed by the user. &This event must not occur until the "display" event.onclickevent listener function corresponding to event type "click". &This listener must be called when the notification has been clicked on by the user.MethodsshowCauses the notification to displayed to the user. &This may or may not happen immediately, depending on the constraints of the presentation method.cancelCauses the notification to not be displayed. &If the notification has been displayed already, it must be closed. &If it has not yet been displayed, it must be removed from the set of pending notifications.The NotificationCenter interfaceThe NotificationCenter interface exposes the ability for web pages to create Notification objects.interface NotificationCenter {&// Notification factory methods.&Notification createNotification(in DOMString iconUrl, in DOMString title, in DOMString body) throws(Exception);&optional Notification createHTMLNotification(in DOMString url) throws(Exception);&// Permission values&const unsigned int PERMISSION_ALLOWED = 0;&const unsigned int PERMISSION_NOT_ALLOWED = 1;&const unsigned int PERMISSION_DENIED = 2;&// Permission methods&int checkPermission();&void requestPermission(in Function callback);}The NotificationCenter interface is available via the Window interface through the webkitNotifications property.interface Window {...&attribute NotificationCenter webkitN...}MethodscreateNotificationCreates a new notification object with the provided content. &iconUrl contains the URL of an image resource to be shown w title contains a string which is the primary text body contains a string which is secondary text for the notification. &If the origin of the script which executes this method does not have permission level PERMISSION_ALLOWED, this method will throw a security exception.createHTMLNotificationThe parameter url contains the URL of a resource which contains HTML content to be shown as the content of the notification. &If the origin of the script which executes this method does not have permission level PERMISSION_ALLOWED, this method will throw a security exception. &In Chromium, only http:, https:, and chrome-extension: schemes are allowed for url.checkPermissionReturns an integer, either PERMISSION_ALLOWED, PERMISSION_NOT_ALLOWED, or PERMISSION_DENIED, which indicates the permission level granted to the origin of the script currently executing.PERMISSION_ALLOWED (0) indicates that the user has granted permission to scripts with this origin to show notifications.PERMISSION_NOT_ALLOWED (1) indicates that the user has not taken an action regarding notifications for scripts from this origin.PERMISSION_DENIED (2) indicates that the user has explicitly blocked scripts with this origin from showing notifications.requestPermissionRequests that the user agent ask the user for permission to show notifications from scripts. &This method should only be called while han in other circumstances it will have no effect. This method is asynchronous. &The function provided in callback will be invoked when the user has responded to the permission request. &If the current permission level is PERMISSION_DENIED, the user agent may take no action in response to requestPermission.Lifetime of notificationsIf the page which generates a notification was generated is closed, the notification itself will not be closed, but events will not be delivered, as the script execution context is no longer present.链接地址:http://dev.chromium.org/developers/design-documents/desktop-notifications/api-specification
独行冰海推荐阅读:
& 10:45:44
& 22:45:41
& 10:44:06
& 22:49:42
& 23:55:06
& 23:40:56
阅读(4825)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
在LOFTER的更多文章
loftPermalink:'',
id:'fks_',
blogTitle:'HTML5-桌面通知Notification',
blogAbstract:'桌面通知,我们经常看到的比如QQ在右下角的消息提醒。在网页中我们也可以用Javascript模拟实现这一功能,只是这个消息框是浏览器中进行控制的。目前浏览器依然是一个严格的沙盒工作模式,这种模式把浏览器和桌面的通信隔离开。Notification可以跨越沙盒通过桌面向用户发出浏览器的通知。现在Html5中可以实现这一功能。在手机端,也就Blackberry browser实现了(完全实现),实现这一功能的浏览器均以webkit为内核。应用的范围还很有限,在HTML5如火如荼的今天,我们依然可以做个很好的展望。API介绍  桌面提醒功能是由window对象下的webkitNotifications来实现的,通过window.webkitNotifications将返回一个NotificationCenter对象。这个对象没有属性,但是却关联着四个方法:',
blogTag:'html5,桌面提醒,web,notification,桌面通知',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:7,
publishTime:2,
permalink:'blog/static/',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'刘国利:白色,是我的世界的颜色,独特而隐逸。我的“自由”不单纯是不让别人决定我的人生,还是认识我的个性,维护我的个性,决定我生活目标的代名词,也从不以“地位”、“权力”为目标,只为了自己心底的梦、珍重的事、守护的情而奋斗。',
hmcon:'1',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}桌面开关类排行
喜欢这个应用的还喜欢}

我要回帖

更多关于 外来人员禁止入内通知 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信