Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Settings to Toggle Notifications
- //Requires Chapel's Notify Macro
- //Method 1: JavaScript + CSS
- //JavaScript
- var settingNoNotificationHandler = function () {
- if (settings.notif) { // is true
- $("html").addClass("nonotif");
- }
- else { // is false
- $("html").removeClass("nonotif");
- }
- };
- Setting.addToggle("notif", {
- label : "<b>Disable Notification</b>",
- default : false,
- onInit : settingNoNotificationHandler,
- onChange : settingNoNotificationHandler
- });
- //CSS
- html.nonotif #notify.open { display: none; }
- //Method 2: JavaScript + <<if>> macro
- //JavaScript
- Setting.addToggle("notifications", {
- label : "Enable Notification.",
- default : true,
- });
- //Sugarcube
- <<if settings.notifications>><<notify 3s>>Notification active!<</notify>><</if>>
Advertisement
Add Comment
Please, Sign In to add comment