add icons to notice
Esse commit está contido em:
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="50"
|
||||
height="50"
|
||||
viewBox="0 0 50.000001 50.000001"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="megaphone_icon_black.svg">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="11.313708"
|
||||
inkscape:cx="26.612614"
|
||||
inkscape:cy="26.024336"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
units="px"
|
||||
inkscape:window-width="1129"
|
||||
inkscape:window-height="803"
|
||||
inkscape:window-x="767"
|
||||
inkscape:window-y="179"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-1002.3622)">
|
||||
<g
|
||||
id="g4187"
|
||||
transform="matrix(0.8407303,-0.32845911,0.32845911,0.8407303,-335.45536,177.93302)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4179"
|
||||
d="m 13.089486,1030.6489 c -1.897016,-0.058 -3.3981252,1.4421 -3.6614344,2.9988 -0.2633763,1.5573 0.6611344,3.4677 2.4728394,4.0357 l 9.830872,3.2352 c 1.000256,0.3363 2.114841,0.2234 2.939838,-0.2532 0.824996,-0.4765 1.362283,-1.2236 1.628867,-2.034 0.266582,-0.8104 0.278304,-1.7318 -0.102684,-2.605 -0.380603,-0.8724 -1.20937,-1.6246 -2.212614,-1.9482 l -9.857598,-3.2437 0.02251,0.01 c -0.341324,-0.1174 -0.698412,-0.1829 -1.059186,-0.1941 l -0.0014,0 z m -0.05486,1.799 a 1.8006546,1.8006546 0 0 1 0.530296,0.097 l 9.866038,3.2464 a 1.8006546,1.8006546 0 1 1 -1.125297,3.4209 l -9.866038,-3.2464 a 1.8006546,1.8006546 0 0 1 0.595001,-3.518 z"
|
||||
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
|
||||
<path
|
||||
id="path4151"
|
||||
transform="translate(0,1002.3622)"
|
||||
d="m 45.369141,1.0175781 a 4.2004198,4.2004198 0 0 0 -4.136719,4.2597657 l 0,3.3261718 -34.4316408,10.9941404 0,-0.708984 A 3.0003,3.0003 0 0 0 3.7558594,15.845703 3.0003,3.0003 0 0 0 0.80078125,18.888672 l 0,10.429687 a 3.0003,3.0003 0 1 0 5.99999995,0 l 0,-0.654297 34.4316408,11.427735 0,1.955078 a 4.2004198,4.2004198 0 1 0 8.398437,0 l 0,-36.7695312 A 4.2004198,4.2004198 0 0 0 45.369141,1.0175781 Z"
|
||||
style="fill:#000000;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Depois Largura: | Altura: | Tamanho: 4.1 KiB |
@@ -506,6 +506,10 @@ img.jsxc_vCard {
|
||||
background-image: image-url("bookmark_black.svg");
|
||||
}
|
||||
|
||||
.jsxc_announcementicon {
|
||||
background-image: image-url("megaphone_icon_black.svg");
|
||||
}
|
||||
|
||||
.jsxc_more {
|
||||
float: right;
|
||||
width: 44px;
|
||||
|
||||
@@ -26,7 +26,7 @@ jsxc.notice = {
|
||||
if (saved.hasOwnProperty(key)) {
|
||||
var val = saved[key];
|
||||
|
||||
jsxc.notice.add(val.msg, val.description, val.fnName, val.fnParams, key);
|
||||
jsxc.notice.add(val, val.fnName, val.fnParams, key);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -35,16 +35,19 @@ jsxc.notice = {
|
||||
* Add a new notice to the stack;
|
||||
*
|
||||
* @memberOf jsxc.notice
|
||||
* @param msg Header message
|
||||
* @param description Notice description
|
||||
* @param fnName Function name to be called if you open the notice
|
||||
* @param {Object} data
|
||||
* @param {String} data.msg Header message
|
||||
* @param {String} data.description Notice description
|
||||
* @param {String} fnName Function name to be called if you open the notice
|
||||
* @param fnParams Array of params for function
|
||||
* @param id Notice id
|
||||
* @param {String} id Notice id
|
||||
*/
|
||||
add: function(msg, description, fnName, fnParams, id) {
|
||||
add: function(data, fnName, fnParams, id) {
|
||||
var nid = id || Date.now();
|
||||
var list = $('#jsxc_notice ul');
|
||||
var notice = $('<li/>');
|
||||
var msg = data.msg;
|
||||
var description = data.description;
|
||||
|
||||
notice.click(function() {
|
||||
jsxc.notice.remove(nid);
|
||||
@@ -54,6 +57,10 @@ jsxc.notice = {
|
||||
return false;
|
||||
});
|
||||
|
||||
if (data.type) {
|
||||
notice.addClass('jsxc_' + data.type + 'icon');
|
||||
}
|
||||
|
||||
notice.text(msg);
|
||||
notice.attr('title', description || '');
|
||||
notice.attr('data-nid', nid);
|
||||
@@ -67,6 +74,7 @@ jsxc.notice = {
|
||||
saved[nid] = {
|
||||
msg: msg,
|
||||
description: description,
|
||||
type: data.type,
|
||||
fnName: fnName,
|
||||
fnParams: fnParams
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* This namespace handles the Notification API.
|
||||
*
|
||||
*
|
||||
* @namespace jsxc.notification
|
||||
*/
|
||||
jsxc.notification = {
|
||||
@@ -10,7 +10,7 @@ jsxc.notification = {
|
||||
|
||||
/**
|
||||
* Register notification on incoming messages.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.notification
|
||||
*/
|
||||
init: function() {
|
||||
@@ -39,7 +39,7 @@ jsxc.notification = {
|
||||
|
||||
/**
|
||||
* Shows a pop up notification and optional play sound.
|
||||
*
|
||||
*
|
||||
* @param title Title
|
||||
* @param msg Message
|
||||
* @param d Duration
|
||||
@@ -108,7 +108,7 @@ jsxc.notification = {
|
||||
/**
|
||||
* Checks if browser has support for notifications and add on chrome to the
|
||||
* default api.
|
||||
*
|
||||
*
|
||||
* @returns {Boolean} True if the browser has support.
|
||||
*/
|
||||
hasSupport: function() {
|
||||
@@ -163,7 +163,10 @@ jsxc.notification = {
|
||||
|
||||
$(document).one('postmessagein.jsxc', function() {
|
||||
setTimeout(function() {
|
||||
jsxc.notice.add($.t('Notifications') + '?', $.t('Should_we_notify_you_'), 'gui.showRequestNotification');
|
||||
jsxc.notice.add({
|
||||
msg: $.t('Notifications') + '?',
|
||||
description: $.t('Should_we_notify_you_')
|
||||
}, 'gui.showRequestNotification');
|
||||
}, 1000);
|
||||
});
|
||||
},
|
||||
@@ -187,7 +190,7 @@ jsxc.notification = {
|
||||
|
||||
/**
|
||||
* Check permission.
|
||||
*
|
||||
*
|
||||
* @returns {Boolean} True if we have the permission
|
||||
*/
|
||||
hasPermission: function() {
|
||||
@@ -196,7 +199,7 @@ jsxc.notification = {
|
||||
|
||||
/**
|
||||
* Plays the given file.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.notification
|
||||
* @param {string} soundFile File relative to the sound directory
|
||||
* @param {boolean} loop True for loop
|
||||
@@ -230,7 +233,7 @@ jsxc.notification = {
|
||||
|
||||
/**
|
||||
* Stop/remove current sound.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.notification
|
||||
*/
|
||||
stopSound: function() {
|
||||
@@ -244,7 +247,7 @@ jsxc.notification = {
|
||||
|
||||
/**
|
||||
* Mute sound.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.notification
|
||||
* @param {boolean} external True if triggered from external tab. Default:
|
||||
* false.
|
||||
@@ -259,7 +262,7 @@ jsxc.notification = {
|
||||
|
||||
/**
|
||||
* Unmute sound.
|
||||
*
|
||||
*
|
||||
* @memberOf jsxc.notification
|
||||
* @param {boolean} external True if triggered from external tab. Default:
|
||||
* false.
|
||||
|
||||
+14
-3
@@ -692,7 +692,11 @@ jsxc.xmpp = {
|
||||
jid: jid,
|
||||
approve: -1
|
||||
});
|
||||
jsxc.notice.add($.t('Friendship_request'), $.t('from') + ' ' + jid, 'gui.showApproveDialog', [jid]);
|
||||
jsxc.notice.add({
|
||||
msg: $.t('Friendship_request'),
|
||||
description: $.t('from') + ' ' + jid,
|
||||
type: 'contact'
|
||||
}, 'gui.showApproveDialog', [jid]);
|
||||
|
||||
return true;
|
||||
} else if (ptype === 'unavailable' || ptype === 'unsubscribed') {
|
||||
@@ -854,7 +858,10 @@ jsxc.xmpp = {
|
||||
var chat = jsxc.storage.getUserItem('chat', bid) || [];
|
||||
|
||||
if (chat.length === 0) {
|
||||
jsxc.notice.add($.t('Unknown_sender'), $.t('You_received_a_message_from_an_unknown_sender') + ' (' + bid + ').', 'gui.showUnknownSender', [bid]);
|
||||
jsxc.notice.add({
|
||||
msg: $.t('Unknown_sender'),
|
||||
description: $.t('You_received_a_message_from_an_unknown_sender') + ' (' + bid + ').'
|
||||
}, 'gui.showUnknownSender', [bid]);
|
||||
}
|
||||
|
||||
var msg = jsxc.removeHTML(body);
|
||||
@@ -966,7 +973,11 @@ jsxc.xmpp = {
|
||||
var subject = stanza.find('subject:first').text() || $.t('Notification');
|
||||
var body = stanza.find('body:first').text();
|
||||
|
||||
jsxc.notice.add(subject, body, 'gui.showNotification', [subject, body, from]);
|
||||
jsxc.notice.add({
|
||||
msg: subject,
|
||||
description: body,
|
||||
type: (domain === from) ? 'announcement' : null
|
||||
}, 'gui.showNotification', [subject, body, from]);
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário