Fully end to end encrypted anonymous chat program. Server only stores public key lookup for users and the encrypted messages. No credentials are transfered to the server, but kept in local browser storage. This allows 100% safe chatting.
https://safechat.ch
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.0 KiB
43 lines
1.0 KiB
var nodes = require('../nodes') |
|
, Parser = require('../selector-parser'); |
|
|
|
/** |
|
* Return a list with raw selectors parts |
|
* of the current group. |
|
* |
|
* For example: |
|
* |
|
* .a, .b |
|
* .c |
|
* .d |
|
* test: selectors() // => '.a,.b', '& .c', '& .d' |
|
* |
|
* @return {Expression} |
|
* @api public |
|
*/ |
|
|
|
module.exports = function selectors(){ |
|
var stack = this.selectorStack |
|
, expr = new nodes.Expression(true); |
|
|
|
if (stack.length) { |
|
for (var i = 0; i < stack.length; i++) { |
|
var group = stack[i] |
|
, nested; |
|
|
|
if (group.length > 1) { |
|
expr.push(new nodes.String(group.map(function(selector) { |
|
nested = new Parser(selector.val).parse().nested; |
|
return (nested && i ? '& ' : '') + selector.val; |
|
}).join(','))) |
|
} else { |
|
var selector = group[0].val |
|
nested = new Parser(selector).parse().nested; |
|
expr.push(new nodes.String((nested && i ? '& ' : '') + selector)); |
|
} |
|
} |
|
} else { |
|
expr.push(new nodes.String('&')); |
|
} |
|
return expr; |
|
};
|
|
|