mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(config) rm notification: do nothing
This commit is contained in:
parent
189d1c7c1d
commit
9bc577a83a
6 changed files with 0 additions and 65 deletions
1
HELP.md
1
HELP.md
|
|
@ -244,7 +244,6 @@ Here is description of options:
|
|||
"packer" : "tar", /* default, could be "tar" or "zip" */
|
||||
"diff" : true, /* when save - send patch, not whole file */
|
||||
"zip" : true, /* zip text before send / unzip before save */
|
||||
"notifications" : false, /* show notifications when tab is not active*/
|
||||
"localStorage" : true, /* local storage */
|
||||
"buffer" : true, /* buffer for copying files */
|
||||
"dirStorage" : true, /* store directory listing to localStorage */
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@ const {Dialog} = DOM;
|
|||
const TITLE = 'Config';
|
||||
const alert = currify(Dialog.alert, TITLE);
|
||||
|
||||
const Notify = DOM.Notify;
|
||||
|
||||
const Config = module.exports;
|
||||
|
||||
const showLoad = () => {
|
||||
|
|
@ -203,11 +201,6 @@ function onChange(el) {
|
|||
else if (name === 'auth')
|
||||
onAuthChange(data);
|
||||
|
||||
if (name === 'notifications') {
|
||||
if (data && !Notify.check())
|
||||
Notify.request();
|
||||
}
|
||||
|
||||
obj[name] = data;
|
||||
|
||||
Config.save(obj);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ DOM.Storage = require('./storage');
|
|||
DOM.Files = require('./files');
|
||||
DOM.RESTful = require('./rest');
|
||||
DOM.load = require('./load');
|
||||
DOM.Notify = require('./notify');
|
||||
|
||||
function DOMTreeProto() {
|
||||
const DOM = this;
|
||||
|
|
|
|||
|
|
@ -1,46 +0,0 @@
|
|||
/* global CloudCmd */
|
||||
|
||||
'use strict';
|
||||
|
||||
const Events = require('./events');
|
||||
|
||||
let Show;
|
||||
|
||||
Events.add({
|
||||
'blur': () => {
|
||||
Show = true;
|
||||
},
|
||||
'focus': () => {
|
||||
Show = false;
|
||||
}
|
||||
});
|
||||
|
||||
module.exports.send = (msg) => {
|
||||
const notifications = CloudCmd.config('notifications');
|
||||
const focus = window.focus.bind(window);
|
||||
const granted = check();
|
||||
|
||||
if (!notifications || !granted || !Show)
|
||||
return;
|
||||
|
||||
const notify = new Notification(msg, {
|
||||
icon: '/img/favicon/favicon-notify.png'
|
||||
});
|
||||
|
||||
Events.addClick(notify, focus);
|
||||
};
|
||||
|
||||
module.exports.check = check;
|
||||
|
||||
function check() {
|
||||
const Not = Notification;
|
||||
const perm = Not && Not.permission;
|
||||
|
||||
return perm === 'granted';
|
||||
}
|
||||
|
||||
module.exports.request = () => {
|
||||
if (Notification)
|
||||
Notification.requestPermission();
|
||||
};
|
||||
|
||||
|
|
@ -7,7 +7,6 @@
|
|||
"packer": "tar",
|
||||
"diff": true,
|
||||
"zip" : true,
|
||||
"notifications": false,
|
||||
"localStorage": true,
|
||||
"buffer": true,
|
||||
"dirStorage": false,
|
||||
|
|
|
|||
|
|
@ -48,15 +48,6 @@
|
|||
<option {{ deepword-selected }}>deepword</option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
<input
|
||||
data-name="js-notifications"
|
||||
type="checkbox"
|
||||
{{ notifications }}>
|
||||
Notifications
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
<input
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue