diff --git a/src/node/utils/tar.json b/src/node/utils/tar.json index 70001f8f2..525d3961a 100644 --- a/src/node/utils/tar.json +++ b/src/node/utils/tar.json @@ -15,6 +15,7 @@ , "pad_connectionstatus.js" , "chat.js" , "gritter.js" + , "hammer.js" , "$tinycon/tinycon.js" , "excanvas.js" , "farbtastic.js" diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 65fc8dd94..5a2da0988 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -18,6 +18,7 @@ var padutils = require('./pad_utils').padutils; var padcookie = require('./pad_cookie').padcookie; var Tinycon = require('tinycon/tinycon'); var hooks = require('./pluginfw/hooks'); +var Hammer = require('./hammer'); var chat = (function() { @@ -149,6 +150,7 @@ var chat = (function() $("#chatcounter").text(count); if(!chatOpen) { + $.gritter.add({ // (string | mandatory) the heading of the notification title: ctx.authorName, @@ -157,7 +159,15 @@ var chat = (function() // (bool | optional) if you want it to fade out on its own or just sit there sticky: ctx.sticky, // (int | optional) the time you want it to be alive for before fading out - time: '4000' + time: '4000', + // after open allow it to be swiped + after_open: function(e){ + var gritterNotification = document.getElementById(e.context.id); + var hammertime = new Hammer(gritterNotification); + hammertime.on("swiperight", function(ev){ + $(gritterNotification).fadeOut(); + }); + } }); } } diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 73fcd3d6b..8022bf285 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -48,7 +48,6 @@ var createCookie = require('./pad_utils').createCookie; var readCookie = require('./pad_utils').readCookie; var randomString = require('./pad_utils').randomString; var gritter = require('./gritter').gritter; - var hooks = require('./pluginfw/hooks'); function createCookie(name, value, days, path){ /* Warning Internet Explorer doesn't use this it uses the one from pad_utils.js */ @@ -937,4 +936,3 @@ exports.handshake = handshake; exports.pad = pad; exports.init = init; exports.alertBar = alertBar; -