mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-27 02:46:15 -04:00
swipe chat notification to the right to make it fade out
This commit is contained in:
parent
040dc78df9
commit
79e684ac34
3 changed files with 12 additions and 3 deletions
|
@ -15,6 +15,7 @@
|
||||||
, "pad_connectionstatus.js"
|
, "pad_connectionstatus.js"
|
||||||
, "chat.js"
|
, "chat.js"
|
||||||
, "gritter.js"
|
, "gritter.js"
|
||||||
|
, "hammer.js"
|
||||||
, "$tinycon/tinycon.js"
|
, "$tinycon/tinycon.js"
|
||||||
, "excanvas.js"
|
, "excanvas.js"
|
||||||
, "farbtastic.js"
|
, "farbtastic.js"
|
||||||
|
|
|
@ -18,6 +18,7 @@ var padutils = require('./pad_utils').padutils;
|
||||||
var padcookie = require('./pad_cookie').padcookie;
|
var padcookie = require('./pad_cookie').padcookie;
|
||||||
var Tinycon = require('tinycon/tinycon');
|
var Tinycon = require('tinycon/tinycon');
|
||||||
var hooks = require('./pluginfw/hooks');
|
var hooks = require('./pluginfw/hooks');
|
||||||
|
var Hammer = require('./hammer');
|
||||||
|
|
||||||
var chat = (function()
|
var chat = (function()
|
||||||
{
|
{
|
||||||
|
@ -149,6 +150,7 @@ var chat = (function()
|
||||||
$("#chatcounter").text(count);
|
$("#chatcounter").text(count);
|
||||||
|
|
||||||
if(!chatOpen) {
|
if(!chatOpen) {
|
||||||
|
|
||||||
$.gritter.add({
|
$.gritter.add({
|
||||||
// (string | mandatory) the heading of the notification
|
// (string | mandatory) the heading of the notification
|
||||||
title: ctx.authorName,
|
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
|
// (bool | optional) if you want it to fade out on its own or just sit there
|
||||||
sticky: ctx.sticky,
|
sticky: ctx.sticky,
|
||||||
// (int | optional) the time you want it to be alive for before fading out
|
// (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();
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,6 @@ var createCookie = require('./pad_utils').createCookie;
|
||||||
var readCookie = require('./pad_utils').readCookie;
|
var readCookie = require('./pad_utils').readCookie;
|
||||||
var randomString = require('./pad_utils').randomString;
|
var randomString = require('./pad_utils').randomString;
|
||||||
var gritter = require('./gritter').gritter;
|
var gritter = require('./gritter').gritter;
|
||||||
|
|
||||||
var hooks = require('./pluginfw/hooks');
|
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 */
|
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.pad = pad;
|
||||||
exports.init = init;
|
exports.init = init;
|
||||||
exports.alertBar = alertBar;
|
exports.alertBar = alertBar;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue