" )
- .attr({
- id: id,
- role: "tooltip"
- })
- .addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " +
- ( this.options.tooltipClass || "" ) );
- $( "
" )
- .addClass( "ui-tooltip-content" )
- .appendTo( tooltip );
- tooltip.appendTo( this.document[0].body );
- this.tooltips[ id ] = element;
- return tooltip;
- },
-
- _find: function( target ) {
- var id = target.data( "ui-tooltip-id" );
- return id ? $( "#" + id ) : $();
- },
-
- _removeTooltip: function( tooltip ) {
- tooltip.remove();
- delete this.tooltips[ tooltip.attr( "id" ) ];
- },
-
- _destroy: function() {
- var that = this;
-
- // close open tooltips
- $.each( this.tooltips, function( id, element ) {
- // Delegate to close method to handle common cleanup
- var event = $.Event( "blur" );
- event.target = event.currentTarget = element[0];
- that.close( event, true );
-
- // Remove immediately; destroying an open tooltip doesn't use the
- // hide animation
- $( "#" + id ).remove();
-
- // Restore the title
- if ( element.data( "ui-tooltip-title" ) ) {
- element.attr( "title", element.data( "ui-tooltip-title" ) );
- element.removeData( "ui-tooltip-title" );
- }
- });
- }
-});
-
-}( jQuery ) );
diff --git a/source/app/javascripts/jsjac.jingle.js b/source/app/javascripts/jsjac.jingle.js
deleted file mode 100644
index 322b9ee..0000000
--- a/source/app/javascripts/jsjac.jingle.js
+++ /dev/null
@@ -1,18789 +0,0 @@
-/**
- * jsjac-jingle [uncompressed]
- * @fileoverview JSJaC Jingle library, implementation of XEP-0166.
- *
- * @version 0.8.0
- * @date 2014-10-13
- * @author Valérian Saliou https://valeriansaliou.name/
- * @license MPL 2.0
- *
- * @url https://github.com/valeriansaliou/jsjac-jingle
- * @repository git+https://github.com/valeriansaliou/jsjac-jingle.git
- * @depends https://github.com/sstrigler/JSJaC
- */
-
-// Underscore.js 1.7.0
-// http://underscorejs.org
-// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
-// Underscore may be freely distributed under the MIT license.
-
-(function() {
-
- // Baseline setup
- // --------------
-
- // Establish the root object, `window` in the browser, or `exports` on the server.
- var root = this;
-
- // Save the previous value of the `_` variable.
- var previousUnderscore = root._;
-
- // Save bytes in the minified (but not gzipped) version:
- var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
-
- // Create quick reference variables for speed access to core prototypes.
- var
- push = ArrayProto.push,
- slice = ArrayProto.slice,
- concat = ArrayProto.concat,
- toString = ObjProto.toString,
- hasOwnProperty = ObjProto.hasOwnProperty;
-
- // All **ECMAScript 5** native function implementations that we hope to use
- // are declared here.
- var
- nativeIsArray = Array.isArray,
- nativeKeys = Object.keys,
- nativeBind = FuncProto.bind;
-
- // Create a safe reference to the Underscore object for use below.
- var _ = function(obj) {
- if (obj instanceof _) return obj;
- if (!(this instanceof _)) return new _(obj);
- this._wrapped = obj;
- };
-
- // Export the Underscore object for **Node.js**, with
- // backwards-compatibility for the old `require()` API. If we're in
- // the browser, add `_` as a global object.
- if (typeof exports !== 'undefined') {
- if (typeof module !== 'undefined' && module.exports) {
- exports = module.exports = _;
- }
- exports._ = _;
- } else {
- root._ = _;
- }
-
- // Current version.
- _.VERSION = '1.7.0';
-
- // Internal function that returns an efficient (for current engines) version
- // of the passed-in callback, to be repeatedly applied in other Underscore
- // functions.
- var createCallback = function(func, context, argCount) {
- if (context === void 0) return func;
- switch (argCount == null ? 3 : argCount) {
- case 1: return function(value) {
- return func.call(context, value);
- };
- case 2: return function(value, other) {
- return func.call(context, value, other);
- };
- case 3: return function(value, index, collection) {
- return func.call(context, value, index, collection);
- };
- case 4: return function(accumulator, value, index, collection) {
- return func.call(context, accumulator, value, index, collection);
- };
- }
- return function() {
- return func.apply(context, arguments);
- };
- };
-
- // A mostly-internal function to generate callbacks that can be applied
- // to each element in a collection, returning the desired result — either
- // identity, an arbitrary callback, a property matcher, or a property accessor.
- _.iteratee = function(value, context, argCount) {
- if (value == null) return _.identity;
- if (_.isFunction(value)) return createCallback(value, context, argCount);
- if (_.isObject(value)) return _.matches(value);
- return _.property(value);
- };
-
- // Collection Functions
- // --------------------
-
- // The cornerstone, an `each` implementation, aka `forEach`.
- // Handles raw objects in addition to array-likes. Treats all
- // sparse array-likes as if they were dense.
- _.each = _.forEach = function(obj, iteratee, context) {
- if (obj == null) return obj;
- iteratee = createCallback(iteratee, context);
- var i, length = obj.length;
- if (length === +length) {
- for (i = 0; i < length; i++) {
- iteratee(obj[i], i, obj);
- }
- } else {
- var keys = _.keys(obj);
- for (i = 0, length = keys.length; i < length; i++) {
- iteratee(obj[keys[i]], keys[i], obj);
- }
- }
- return obj;
- };
-
- // Return the results of applying the iteratee to each element.
- _.map = _.collect = function(obj, iteratee, context) {
- if (obj == null) return [];
- iteratee = _.iteratee(iteratee, context);
- var keys = obj.length !== +obj.length && _.keys(obj),
- length = (keys || obj).length,
- results = Array(length),
- currentKey;
- for (var index = 0; index < length; index++) {
- currentKey = keys ? keys[index] : index;
- results[index] = iteratee(obj[currentKey], currentKey, obj);
- }
- return results;
- };
-
- var reduceError = 'Reduce of empty array with no initial value';
-
- // **Reduce** builds up a single result from a list of values, aka `inject`,
- // or `foldl`.
- _.reduce = _.foldl = _.inject = function(obj, iteratee, memo, context) {
- if (obj == null) obj = [];
- iteratee = createCallback(iteratee, context, 4);
- var keys = obj.length !== +obj.length && _.keys(obj),
- length = (keys || obj).length,
- index = 0, currentKey;
- if (arguments.length < 3) {
- if (!length) throw new TypeError(reduceError);
- memo = obj[keys ? keys[index++] : index++];
- }
- for (; index < length; index++) {
- currentKey = keys ? keys[index] : index;
- memo = iteratee(memo, obj[currentKey], currentKey, obj);
- }
- return memo;
- };
-
- // The right-associative version of reduce, also known as `foldr`.
- _.reduceRight = _.foldr = function(obj, iteratee, memo, context) {
- if (obj == null) obj = [];
- iteratee = createCallback(iteratee, context, 4);
- var keys = obj.length !== + obj.length && _.keys(obj),
- index = (keys || obj).length,
- currentKey;
- if (arguments.length < 3) {
- if (!index) throw new TypeError(reduceError);
- memo = obj[keys ? keys[--index] : --index];
- }
- while (index--) {
- currentKey = keys ? keys[index] : index;
- memo = iteratee(memo, obj[currentKey], currentKey, obj);
- }
- return memo;
- };
-
- // Return the first value which passes a truth test. Aliased as `detect`.
- _.find = _.detect = function(obj, predicate, context) {
- var result;
- predicate = _.iteratee(predicate, context);
- _.some(obj, function(value, index, list) {
- if (predicate(value, index, list)) {
- result = value;
- return true;
- }
- });
- return result;
- };
-
- // Return all the elements that pass a truth test.
- // Aliased as `select`.
- _.filter = _.select = function(obj, predicate, context) {
- var results = [];
- if (obj == null) return results;
- predicate = _.iteratee(predicate, context);
- _.each(obj, function(value, index, list) {
- if (predicate(value, index, list)) results.push(value);
- });
- return results;
- };
-
- // Return all the elements for which a truth test fails.
- _.reject = function(obj, predicate, context) {
- return _.filter(obj, _.negate(_.iteratee(predicate)), context);
- };
-
- // Determine whether all of the elements match a truth test.
- // Aliased as `all`.
- _.every = _.all = function(obj, predicate, context) {
- if (obj == null) return true;
- predicate = _.iteratee(predicate, context);
- var keys = obj.length !== +obj.length && _.keys(obj),
- length = (keys || obj).length,
- index, currentKey;
- for (index = 0; index < length; index++) {
- currentKey = keys ? keys[index] : index;
- if (!predicate(obj[currentKey], currentKey, obj)) return false;
- }
- return true;
- };
-
- // Determine if at least one element in the object matches a truth test.
- // Aliased as `any`.
- _.some = _.any = function(obj, predicate, context) {
- if (obj == null) return false;
- predicate = _.iteratee(predicate, context);
- var keys = obj.length !== +obj.length && _.keys(obj),
- length = (keys || obj).length,
- index, currentKey;
- for (index = 0; index < length; index++) {
- currentKey = keys ? keys[index] : index;
- if (predicate(obj[currentKey], currentKey, obj)) return true;
- }
- return false;
- };
-
- // Determine if the array or object contains a given value (using `===`).
- // Aliased as `include`.
- _.contains = _.include = function(obj, target) {
- if (obj == null) return false;
- if (obj.length !== +obj.length) obj = _.values(obj);
- return _.indexOf(obj, target) >= 0;
- };
-
- // Invoke a method (with arguments) on every item in a collection.
- _.invoke = function(obj, method) {
- var args = slice.call(arguments, 2);
- var isFunc = _.isFunction(method);
- return _.map(obj, function(value) {
- return (isFunc ? method : value[method]).apply(value, args);
- });
- };
-
- // Convenience version of a common use case of `map`: fetching a property.
- _.pluck = function(obj, key) {
- return _.map(obj, _.property(key));
- };
-
- // Convenience version of a common use case of `filter`: selecting only objects
- // containing specific `key:value` pairs.
- _.where = function(obj, attrs) {
- return _.filter(obj, _.matches(attrs));
- };
-
- // Convenience version of a common use case of `find`: getting the first object
- // containing specific `key:value` pairs.
- _.findWhere = function(obj, attrs) {
- return _.find(obj, _.matches(attrs));
- };
-
- // Return the maximum element (or element-based computation).
- _.max = function(obj, iteratee, context) {
- var result = -Infinity, lastComputed = -Infinity,
- value, computed;
- if (iteratee == null && obj != null) {
- obj = obj.length === +obj.length ? obj : _.values(obj);
- for (var i = 0, length = obj.length; i < length; i++) {
- value = obj[i];
- if (value > result) {
- result = value;
- }
- }
- } else {
- iteratee = _.iteratee(iteratee, context);
- _.each(obj, function(value, index, list) {
- computed = iteratee(value, index, list);
- if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
- result = value;
- lastComputed = computed;
- }
- });
- }
- return result;
- };
-
- // Return the minimum element (or element-based computation).
- _.min = function(obj, iteratee, context) {
- var result = Infinity, lastComputed = Infinity,
- value, computed;
- if (iteratee == null && obj != null) {
- obj = obj.length === +obj.length ? obj : _.values(obj);
- for (var i = 0, length = obj.length; i < length; i++) {
- value = obj[i];
- if (value < result) {
- result = value;
- }
- }
- } else {
- iteratee = _.iteratee(iteratee, context);
- _.each(obj, function(value, index, list) {
- computed = iteratee(value, index, list);
- if (computed < lastComputed || computed === Infinity && result === Infinity) {
- result = value;
- lastComputed = computed;
- }
- });
- }
- return result;
- };
-
- // Shuffle a collection, using the modern version of the
- // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
- _.shuffle = function(obj) {
- var set = obj && obj.length === +obj.length ? obj : _.values(obj);
- var length = set.length;
- var shuffled = Array(length);
- for (var index = 0, rand; index < length; index++) {
- rand = _.random(0, index);
- if (rand !== index) shuffled[index] = shuffled[rand];
- shuffled[rand] = set[index];
- }
- return shuffled;
- };
-
- // Sample **n** random values from a collection.
- // If **n** is not specified, returns a single random element.
- // The internal `guard` argument allows it to work with `map`.
- _.sample = function(obj, n, guard) {
- if (n == null || guard) {
- if (obj.length !== +obj.length) obj = _.values(obj);
- return obj[_.random(obj.length - 1)];
- }
- return _.shuffle(obj).slice(0, Math.max(0, n));
- };
-
- // Sort the object's values by a criterion produced by an iteratee.
- _.sortBy = function(obj, iteratee, context) {
- iteratee = _.iteratee(iteratee, context);
- return _.pluck(_.map(obj, function(value, index, list) {
- return {
- value: value,
- index: index,
- criteria: iteratee(value, index, list)
- };
- }).sort(function(left, right) {
- var a = left.criteria;
- var b = right.criteria;
- if (a !== b) {
- if (a > b || a === void 0) return 1;
- if (a < b || b === void 0) return -1;
- }
- return left.index - right.index;
- }), 'value');
- };
-
- // An internal function used for aggregate "group by" operations.
- var group = function(behavior) {
- return function(obj, iteratee, context) {
- var result = {};
- iteratee = _.iteratee(iteratee, context);
- _.each(obj, function(value, index) {
- var key = iteratee(value, index, obj);
- behavior(result, value, key);
- });
- return result;
- };
- };
-
- // Groups the object's values by a criterion. Pass either a string attribute
- // to group by, or a function that returns the criterion.
- _.groupBy = group(function(result, value, key) {
- if (_.has(result, key)) result[key].push(value); else result[key] = [value];
- });
-
- // Indexes the object's values by a criterion, similar to `groupBy`, but for
- // when you know that your index values will be unique.
- _.indexBy = group(function(result, value, key) {
- result[key] = value;
- });
-
- // Counts instances of an object that group by a certain criterion. Pass
- // either a string attribute to count by, or a function that returns the
- // criterion.
- _.countBy = group(function(result, value, key) {
- if (_.has(result, key)) result[key]++; else result[key] = 1;
- });
-
- // Use a comparator function to figure out the smallest index at which
- // an object should be inserted so as to maintain order. Uses binary search.
- _.sortedIndex = function(array, obj, iteratee, context) {
- iteratee = _.iteratee(iteratee, context, 1);
- var value = iteratee(obj);
- var low = 0, high = array.length;
- while (low < high) {
- var mid = low + high >>> 1;
- if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
- }
- return low;
- };
-
- // Safely create a real, live array from anything iterable.
- _.toArray = function(obj) {
- if (!obj) return [];
- if (_.isArray(obj)) return slice.call(obj);
- if (obj.length === +obj.length) return _.map(obj, _.identity);
- return _.values(obj);
- };
-
- // Return the number of elements in an object.
- _.size = function(obj) {
- if (obj == null) return 0;
- return obj.length === +obj.length ? obj.length : _.keys(obj).length;
- };
-
- // Split a collection into two arrays: one whose elements all satisfy the given
- // predicate, and one whose elements all do not satisfy the predicate.
- _.partition = function(obj, predicate, context) {
- predicate = _.iteratee(predicate, context);
- var pass = [], fail = [];
- _.each(obj, function(value, key, obj) {
- (predicate(value, key, obj) ? pass : fail).push(value);
- });
- return [pass, fail];
- };
-
- // Array Functions
- // ---------------
-
- // Get the first element of an array. Passing **n** will return the first N
- // values in the array. Aliased as `head` and `take`. The **guard** check
- // allows it to work with `_.map`.
- _.first = _.head = _.take = function(array, n, guard) {
- if (array == null) return void 0;
- if (n == null || guard) return array[0];
- if (n < 0) return [];
- return slice.call(array, 0, n);
- };
-
- // Returns everything but the last entry of the array. Especially useful on
- // the arguments object. Passing **n** will return all the values in
- // the array, excluding the last N. The **guard** check allows it to work with
- // `_.map`.
- _.initial = function(array, n, guard) {
- return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
- };
-
- // Get the last element of an array. Passing **n** will return the last N
- // values in the array. The **guard** check allows it to work with `_.map`.
- _.last = function(array, n, guard) {
- if (array == null) return void 0;
- if (n == null || guard) return array[array.length - 1];
- return slice.call(array, Math.max(array.length - n, 0));
- };
-
- // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
- // Especially useful on the arguments object. Passing an **n** will return
- // the rest N values in the array. The **guard**
- // check allows it to work with `_.map`.
- _.rest = _.tail = _.drop = function(array, n, guard) {
- return slice.call(array, n == null || guard ? 1 : n);
- };
-
- // Trim out all falsy values from an array.
- _.compact = function(array) {
- return _.filter(array, _.identity);
- };
-
- // Internal implementation of a recursive `flatten` function.
- var flatten = function(input, shallow, strict, output) {
- if (shallow && _.every(input, _.isArray)) {
- return concat.apply(output, input);
- }
- for (var i = 0, length = input.length; i < length; i++) {
- var value = input[i];
- if (!_.isArray(value) && !_.isArguments(value)) {
- if (!strict) output.push(value);
- } else if (shallow) {
- push.apply(output, value);
- } else {
- flatten(value, shallow, strict, output);
- }
- }
- return output;
- };
-
- // Flatten out an array, either recursively (by default), or just one level.
- _.flatten = function(array, shallow) {
- return flatten(array, shallow, false, []);
- };
-
- // Return a version of the array that does not contain the specified value(s).
- _.without = function(array) {
- return _.difference(array, slice.call(arguments, 1));
- };
-
- // Produce a duplicate-free version of the array. If the array has already
- // been sorted, you have the option of using a faster algorithm.
- // Aliased as `unique`.
- _.uniq = _.unique = function(array, isSorted, iteratee, context) {
- if (array == null) return [];
- if (!_.isBoolean(isSorted)) {
- context = iteratee;
- iteratee = isSorted;
- isSorted = false;
- }
- if (iteratee != null) iteratee = _.iteratee(iteratee, context);
- var result = [];
- var seen = [];
- for (var i = 0, length = array.length; i < length; i++) {
- var value = array[i];
- if (isSorted) {
- if (!i || seen !== value) result.push(value);
- seen = value;
- } else if (iteratee) {
- var computed = iteratee(value, i, array);
- if (_.indexOf(seen, computed) < 0) {
- seen.push(computed);
- result.push(value);
- }
- } else if (_.indexOf(result, value) < 0) {
- result.push(value);
- }
- }
- return result;
- };
-
- // Produce an array that contains the union: each distinct element from all of
- // the passed-in arrays.
- _.union = function() {
- return _.uniq(flatten(arguments, true, true, []));
- };
-
- // Produce an array that contains every item shared between all the
- // passed-in arrays.
- _.intersection = function(array) {
- if (array == null) return [];
- var result = [];
- var argsLength = arguments.length;
- for (var i = 0, length = array.length; i < length; i++) {
- var item = array[i];
- if (_.contains(result, item)) continue;
- for (var j = 1; j < argsLength; j++) {
- if (!_.contains(arguments[j], item)) break;
- }
- if (j === argsLength) result.push(item);
- }
- return result;
- };
-
- // Take the difference between one array and a number of other arrays.
- // Only the elements present in just the first array will remain.
- _.difference = function(array) {
- var rest = flatten(slice.call(arguments, 1), true, true, []);
- return _.filter(array, function(value){
- return !_.contains(rest, value);
- });
- };
-
- // Zip together multiple lists into a single array -- elements that share
- // an index go together.
- _.zip = function(array) {
- if (array == null) return [];
- var length = _.max(arguments, 'length').length;
- var results = Array(length);
- for (var i = 0; i < length; i++) {
- results[i] = _.pluck(arguments, i);
- }
- return results;
- };
-
- // Converts lists into objects. Pass either a single array of `[key, value]`
- // pairs, or two parallel arrays of the same length -- one of keys, and one of
- // the corresponding values.
- _.object = function(list, values) {
- if (list == null) return {};
- var result = {};
- for (var i = 0, length = list.length; i < length; i++) {
- if (values) {
- result[list[i]] = values[i];
- } else {
- result[list[i][0]] = list[i][1];
- }
- }
- return result;
- };
-
- // Return the position of the first occurrence of an item in an array,
- // or -1 if the item is not included in the array.
- // If the array is large and already in sort order, pass `true`
- // for **isSorted** to use binary search.
- _.indexOf = function(array, item, isSorted) {
- if (array == null) return -1;
- var i = 0, length = array.length;
- if (isSorted) {
- if (typeof isSorted == 'number') {
- i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted;
- } else {
- i = _.sortedIndex(array, item);
- return array[i] === item ? i : -1;
- }
- }
- for (; i < length; i++) if (array[i] === item) return i;
- return -1;
- };
-
- _.lastIndexOf = function(array, item, from) {
- if (array == null) return -1;
- var idx = array.length;
- if (typeof from == 'number') {
- idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1);
- }
- while (--idx >= 0) if (array[idx] === item) return idx;
- return -1;
- };
-
- // Generate an integer Array containing an arithmetic progression. A port of
- // the native Python `range()` function. See
- // [the Python documentation](http://docs.python.org/library/functions.html#range).
- _.range = function(start, stop, step) {
- if (arguments.length <= 1) {
- stop = start || 0;
- start = 0;
- }
- step = step || 1;
-
- var length = Math.max(Math.ceil((stop - start) / step), 0);
- var range = Array(length);
-
- for (var idx = 0; idx < length; idx++, start += step) {
- range[idx] = start;
- }
-
- return range;
- };
-
- // Function (ahem) Functions
- // ------------------
-
- // Reusable constructor function for prototype setting.
- var Ctor = function(){};
-
- // Create a function bound to a given object (assigning `this`, and arguments,
- // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
- // available.
- _.bind = function(func, context) {
- var args, bound;
- if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
- if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');
- args = slice.call(arguments, 2);
- bound = function() {
- if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
- Ctor.prototype = func.prototype;
- var self = new Ctor;
- Ctor.prototype = null;
- var result = func.apply(self, args.concat(slice.call(arguments)));
- if (_.isObject(result)) return result;
- return self;
- };
- return bound;
- };
-
- // Partially apply a function by creating a version that has had some of its
- // arguments pre-filled, without changing its dynamic `this` context. _ acts
- // as a placeholder, allowing any combination of arguments to be pre-filled.
- _.partial = function(func) {
- var boundArgs = slice.call(arguments, 1);
- return function() {
- var position = 0;
- var args = boundArgs.slice();
- for (var i = 0, length = args.length; i < length; i++) {
- if (args[i] === _) args[i] = arguments[position++];
- }
- while (position < arguments.length) args.push(arguments[position++]);
- return func.apply(this, args);
- };
- };
-
- // Bind a number of an object's methods to that object. Remaining arguments
- // are the method names to be bound. Useful for ensuring that all callbacks
- // defined on an object belong to it.
- _.bindAll = function(obj) {
- var i, length = arguments.length, key;
- if (length <= 1) throw new Error('bindAll must be passed function names');
- for (i = 1; i < length; i++) {
- key = arguments[i];
- obj[key] = _.bind(obj[key], obj);
- }
- return obj;
- };
-
- // Memoize an expensive function by storing its results.
- _.memoize = function(func, hasher) {
- var memoize = function(key) {
- var cache = memoize.cache;
- var address = hasher ? hasher.apply(this, arguments) : key;
- if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);
- return cache[address];
- };
- memoize.cache = {};
- return memoize;
- };
-
- // Delays a function for the given number of milliseconds, and then calls
- // it with the arguments supplied.
- _.delay = function(func, wait) {
- var args = slice.call(arguments, 2);
- return setTimeout(function(){
- return func.apply(null, args);
- }, wait);
- };
-
- // Defers a function, scheduling it to run after the current call stack has
- // cleared.
- _.defer = function(func) {
- return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
- };
-
- // Returns a function, that, when invoked, will only be triggered at most once
- // during a given window of time. Normally, the throttled function will run
- // as much as it can, without ever going more than once per `wait` duration;
- // but if you'd like to disable the execution on the leading edge, pass
- // `{leading: false}`. To disable execution on the trailing edge, ditto.
- _.throttle = function(func, wait, options) {
- var context, args, result;
- var timeout = null;
- var previous = 0;
- if (!options) options = {};
- var later = function() {
- previous = options.leading === false ? 0 : _.now();
- timeout = null;
- result = func.apply(context, args);
- if (!timeout) context = args = null;
- };
- return function() {
- var now = _.now();
- if (!previous && options.leading === false) previous = now;
- var remaining = wait - (now - previous);
- context = this;
- args = arguments;
- if (remaining <= 0 || remaining > wait) {
- clearTimeout(timeout);
- timeout = null;
- previous = now;
- result = func.apply(context, args);
- if (!timeout) context = args = null;
- } else if (!timeout && options.trailing !== false) {
- timeout = setTimeout(later, remaining);
- }
- return result;
- };
- };
-
- // Returns a function, that, as long as it continues to be invoked, will not
- // be triggered. The function will be called after it stops being called for
- // N milliseconds. If `immediate` is passed, trigger the function on the
- // leading edge, instead of the trailing.
- _.debounce = function(func, wait, immediate) {
- var timeout, args, context, timestamp, result;
-
- var later = function() {
- var last = _.now() - timestamp;
-
- if (last < wait && last > 0) {
- timeout = setTimeout(later, wait - last);
- } else {
- timeout = null;
- if (!immediate) {
- result = func.apply(context, args);
- if (!timeout) context = args = null;
- }
- }
- };
-
- return function() {
- context = this;
- args = arguments;
- timestamp = _.now();
- var callNow = immediate && !timeout;
- if (!timeout) timeout = setTimeout(later, wait);
- if (callNow) {
- result = func.apply(context, args);
- context = args = null;
- }
-
- return result;
- };
- };
-
- // Returns the first function passed as an argument to the second,
- // allowing you to adjust arguments, run code before and after, and
- // conditionally execute the original function.
- _.wrap = function(func, wrapper) {
- return _.partial(wrapper, func);
- };
-
- // Returns a negated version of the passed-in predicate.
- _.negate = function(predicate) {
- return function() {
- return !predicate.apply(this, arguments);
- };
- };
-
- // Returns a function that is the composition of a list of functions, each
- // consuming the return value of the function that follows.
- _.compose = function() {
- var args = arguments;
- var start = args.length - 1;
- return function() {
- var i = start;
- var result = args[start].apply(this, arguments);
- while (i--) result = args[i].call(this, result);
- return result;
- };
- };
-
- // Returns a function that will only be executed after being called N times.
- _.after = function(times, func) {
- return function() {
- if (--times < 1) {
- return func.apply(this, arguments);
- }
- };
- };
-
- // Returns a function that will only be executed before being called N times.
- _.before = function(times, func) {
- var memo;
- return function() {
- if (--times > 0) {
- memo = func.apply(this, arguments);
- } else {
- func = null;
- }
- return memo;
- };
- };
-
- // Returns a function that will be executed at most one time, no matter how
- // often you call it. Useful for lazy initialization.
- _.once = _.partial(_.before, 2);
-
- // Object Functions
- // ----------------
-
- // Retrieve the names of an object's properties.
- // Delegates to **ECMAScript 5**'s native `Object.keys`
- _.keys = function(obj) {
- if (!_.isObject(obj)) return [];
- if (nativeKeys) return nativeKeys(obj);
- var keys = [];
- for (var key in obj) if (_.has(obj, key)) keys.push(key);
- return keys;
- };
-
- // Retrieve the values of an object's properties.
- _.values = function(obj) {
- var keys = _.keys(obj);
- var length = keys.length;
- var values = Array(length);
- for (var i = 0; i < length; i++) {
- values[i] = obj[keys[i]];
- }
- return values;
- };
-
- // Convert an object into a list of `[key, value]` pairs.
- _.pairs = function(obj) {
- var keys = _.keys(obj);
- var length = keys.length;
- var pairs = Array(length);
- for (var i = 0; i < length; i++) {
- pairs[i] = [keys[i], obj[keys[i]]];
- }
- return pairs;
- };
-
- // Invert the keys and values of an object. The values must be serializable.
- _.invert = function(obj) {
- var result = {};
- var keys = _.keys(obj);
- for (var i = 0, length = keys.length; i < length; i++) {
- result[obj[keys[i]]] = keys[i];
- }
- return result;
- };
-
- // Return a sorted list of the function names available on the object.
- // Aliased as `methods`
- _.functions = _.methods = function(obj) {
- var names = [];
- for (var key in obj) {
- if (_.isFunction(obj[key])) names.push(key);
- }
- return names.sort();
- };
-
- // Extend a given object with all the properties in passed-in object(s).
- _.extend = function(obj) {
- if (!_.isObject(obj)) return obj;
- var source, prop;
- for (var i = 1, length = arguments.length; i < length; i++) {
- source = arguments[i];
- for (prop in source) {
- if (hasOwnProperty.call(source, prop)) {
- obj[prop] = source[prop];
- }
- }
- }
- return obj;
- };
-
- // Return a copy of the object only containing the whitelisted properties.
- _.pick = function(obj, iteratee, context) {
- var result = {}, key;
- if (obj == null) return result;
- if (_.isFunction(iteratee)) {
- iteratee = createCallback(iteratee, context);
- for (key in obj) {
- var value = obj[key];
- if (iteratee(value, key, obj)) result[key] = value;
- }
- } else {
- var keys = concat.apply([], slice.call(arguments, 1));
- obj = new Object(obj);
- for (var i = 0, length = keys.length; i < length; i++) {
- key = keys[i];
- if (key in obj) result[key] = obj[key];
- }
- }
- return result;
- };
-
- // Return a copy of the object without the blacklisted properties.
- _.omit = function(obj, iteratee, context) {
- if (_.isFunction(iteratee)) {
- iteratee = _.negate(iteratee);
- } else {
- var keys = _.map(concat.apply([], slice.call(arguments, 1)), String);
- iteratee = function(value, key) {
- return !_.contains(keys, key);
- };
- }
- return _.pick(obj, iteratee, context);
- };
-
- // Fill in a given object with default properties.
- _.defaults = function(obj) {
- if (!_.isObject(obj)) return obj;
- for (var i = 1, length = arguments.length; i < length; i++) {
- var source = arguments[i];
- for (var prop in source) {
- if (obj[prop] === void 0) obj[prop] = source[prop];
- }
- }
- return obj;
- };
-
- // Create a (shallow-cloned) duplicate of an object.
- _.clone = function(obj) {
- if (!_.isObject(obj)) return obj;
- return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
- };
-
- // Invokes interceptor with the obj, and then returns obj.
- // The primary purpose of this method is to "tap into" a method chain, in
- // order to perform operations on intermediate results within the chain.
- _.tap = function(obj, interceptor) {
- interceptor(obj);
- return obj;
- };
-
- // Internal recursive comparison function for `isEqual`.
- var eq = function(a, b, aStack, bStack) {
- // Identical objects are equal. `0 === -0`, but they aren't identical.
- // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
- if (a === b) return a !== 0 || 1 / a === 1 / b;
- // A strict comparison is necessary because `null == undefined`.
- if (a == null || b == null) return a === b;
- // Unwrap any wrapped objects.
- if (a instanceof _) a = a._wrapped;
- if (b instanceof _) b = b._wrapped;
- // Compare `[[Class]]` names.
- var className = toString.call(a);
- if (className !== toString.call(b)) return false;
- switch (className) {
- // Strings, numbers, regular expressions, dates, and booleans are compared by value.
- case '[object RegExp]':
- // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
- case '[object String]':
- // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
- // equivalent to `new String("5")`.
- return '' + a === '' + b;
- case '[object Number]':
- // `NaN`s are equivalent, but non-reflexive.
- // Object(NaN) is equivalent to NaN
- if (+a !== +a) return +b !== +b;
- // An `egal` comparison is performed for other numeric values.
- return +a === 0 ? 1 / +a === 1 / b : +a === +b;
- case '[object Date]':
- case '[object Boolean]':
- // Coerce dates and booleans to numeric primitive values. Dates are compared by their
- // millisecond representations. Note that invalid dates with millisecond representations
- // of `NaN` are not equivalent.
- return +a === +b;
- }
- if (typeof a != 'object' || typeof b != 'object') return false;
- // Assume equality for cyclic structures. The algorithm for detecting cyclic
- // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
- var length = aStack.length;
- while (length--) {
- // Linear search. Performance is inversely proportional to the number of
- // unique nested structures.
- if (aStack[length] === a) return bStack[length] === b;
- }
- // Objects with different constructors are not equivalent, but `Object`s
- // from different frames are.
- var aCtor = a.constructor, bCtor = b.constructor;
- if (
- aCtor !== bCtor &&
- // Handle Object.create(x) cases
- 'constructor' in a && 'constructor' in b &&
- !(_.isFunction(aCtor) && aCtor instanceof aCtor &&
- _.isFunction(bCtor) && bCtor instanceof bCtor)
- ) {
- return false;
- }
- // Add the first object to the stack of traversed objects.
- aStack.push(a);
- bStack.push(b);
- var size, result;
- // Recursively compare objects and arrays.
- if (className === '[object Array]') {
- // Compare array lengths to determine if a deep comparison is necessary.
- size = a.length;
- result = size === b.length;
- if (result) {
- // Deep compare the contents, ignoring non-numeric properties.
- while (size--) {
- if (!(result = eq(a[size], b[size], aStack, bStack))) break;
- }
- }
- } else {
- // Deep compare objects.
- var keys = _.keys(a), key;
- size = keys.length;
- // Ensure that both objects contain the same number of properties before comparing deep equality.
- result = _.keys(b).length === size;
- if (result) {
- while (size--) {
- // Deep compare each member
- key = keys[size];
- if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
- }
- }
- }
- // Remove the first object from the stack of traversed objects.
- aStack.pop();
- bStack.pop();
- return result;
- };
-
- // Perform a deep comparison to check if two objects are equal.
- _.isEqual = function(a, b) {
- return eq(a, b, [], []);
- };
-
- // Is a given array, string, or object empty?
- // An "empty" object has no enumerable own-properties.
- _.isEmpty = function(obj) {
- if (obj == null) return true;
- if (_.isArray(obj) || _.isString(obj) || _.isArguments(obj)) return obj.length === 0;
- for (var key in obj) if (_.has(obj, key)) return false;
- return true;
- };
-
- // Is a given value a DOM element?
- _.isElement = function(obj) {
- return !!(obj && obj.nodeType === 1);
- };
-
- // Is a given value an array?
- // Delegates to ECMA5's native Array.isArray
- _.isArray = nativeIsArray || function(obj) {
- return toString.call(obj) === '[object Array]';
- };
-
- // Is a given variable an object?
- _.isObject = function(obj) {
- var type = typeof obj;
- return type === 'function' || type === 'object' && !!obj;
- };
-
- // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
- _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
- _['is' + name] = function(obj) {
- return toString.call(obj) === '[object ' + name + ']';
- };
- });
-
- // Define a fallback version of the method in browsers (ahem, IE), where
- // there isn't any inspectable "Arguments" type.
- if (!_.isArguments(arguments)) {
- _.isArguments = function(obj) {
- return _.has(obj, 'callee');
- };
- }
-
- // Optimize `isFunction` if appropriate. Work around an IE 11 bug.
- if (typeof /./ !== 'function') {
- _.isFunction = function(obj) {
- return typeof obj == 'function' || false;
- };
- }
-
- // Is a given object a finite number?
- _.isFinite = function(obj) {
- return isFinite(obj) && !isNaN(parseFloat(obj));
- };
-
- // Is the given value `NaN`? (NaN is the only number which does not equal itself).
- _.isNaN = function(obj) {
- return _.isNumber(obj) && obj !== +obj;
- };
-
- // Is a given value a boolean?
- _.isBoolean = function(obj) {
- return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
- };
-
- // Is a given value equal to null?
- _.isNull = function(obj) {
- return obj === null;
- };
-
- // Is a given variable undefined?
- _.isUndefined = function(obj) {
- return obj === void 0;
- };
-
- // Shortcut function for checking if an object has a given property directly
- // on itself (in other words, not on a prototype).
- _.has = function(obj, key) {
- return obj != null && hasOwnProperty.call(obj, key);
- };
-
- // Utility Functions
- // -----------------
-
- // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
- // previous owner. Returns a reference to the Underscore object.
- _.noConflict = function() {
- root._ = previousUnderscore;
- return this;
- };
-
- // Keep the identity function around for default iteratees.
- _.identity = function(value) {
- return value;
- };
-
- _.constant = function(value) {
- return function() {
- return value;
- };
- };
-
- _.noop = function(){};
-
- _.property = function(key) {
- return function(obj) {
- return obj[key];
- };
- };
-
- // Returns a predicate for checking whether an object has a given set of `key:value` pairs.
- _.matches = function(attrs) {
- var pairs = _.pairs(attrs), length = pairs.length;
- return function(obj) {
- if (obj == null) return !length;
- obj = new Object(obj);
- for (var i = 0; i < length; i++) {
- var pair = pairs[i], key = pair[0];
- if (pair[1] !== obj[key] || !(key in obj)) return false;
- }
- return true;
- };
- };
-
- // Run a function **n** times.
- _.times = function(n, iteratee, context) {
- var accum = Array(Math.max(0, n));
- iteratee = createCallback(iteratee, context, 1);
- for (var i = 0; i < n; i++) accum[i] = iteratee(i);
- return accum;
- };
-
- // Return a random integer between min and max (inclusive).
- _.random = function(min, max) {
- if (max == null) {
- max = min;
- min = 0;
- }
- return min + Math.floor(Math.random() * (max - min + 1));
- };
-
- // A (possibly faster) way to get the current timestamp as an integer.
- _.now = Date.now || function() {
- return new Date().getTime();
- };
-
- // List of HTML entities for escaping.
- var escapeMap = {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- "'": ''',
- '`': '`'
- };
- var unescapeMap = _.invert(escapeMap);
-
- // Functions for escaping and unescaping strings to/from HTML interpolation.
- var createEscaper = function(map) {
- var escaper = function(match) {
- return map[match];
- };
- // Regexes for identifying a key that needs to be escaped
- var source = '(?:' + _.keys(map).join('|') + ')';
- var testRegexp = RegExp(source);
- var replaceRegexp = RegExp(source, 'g');
- return function(string) {
- string = string == null ? '' : '' + string;
- return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
- };
- };
- _.escape = createEscaper(escapeMap);
- _.unescape = createEscaper(unescapeMap);
-
- // If the value of the named `property` is a function then invoke it with the
- // `object` as context; otherwise, return it.
- _.result = function(object, property) {
- if (object == null) return void 0;
- var value = object[property];
- return _.isFunction(value) ? object[property]() : value;
- };
-
- // Generate a unique integer id (unique within the entire client session).
- // Useful for temporary DOM ids.
- var idCounter = 0;
- _.uniqueId = function(prefix) {
- var id = ++idCounter + '';
- return prefix ? prefix + id : id;
- };
-
- // By default, Underscore uses ERB-style template delimiters, change the
- // following template settings to use alternative delimiters.
- _.templateSettings = {
- evaluate : /<%([\s\S]+?)%>/g,
- interpolate : /<%=([\s\S]+?)%>/g,
- escape : /<%-([\s\S]+?)%>/g
- };
-
- // When customizing `templateSettings`, if you don't want to define an
- // interpolation, evaluation or escaping regex, we need one that is
- // guaranteed not to match.
- var noMatch = /(.)^/;
-
- // Certain characters need to be escaped so that they can be put into a
- // string literal.
- var escapes = {
- "'": "'",
- '\\': '\\',
- '\r': 'r',
- '\n': 'n',
- '\u2028': 'u2028',
- '\u2029': 'u2029'
- };
-
- var escaper = /\\|'|\r|\n|\u2028|\u2029/g;
-
- var escapeChar = function(match) {
- return '\\' + escapes[match];
- };
-
- // JavaScript micro-templating, similar to John Resig's implementation.
- // Underscore templating handles arbitrary delimiters, preserves whitespace,
- // and correctly escapes quotes within interpolated code.
- // NB: `oldSettings` only exists for backwards compatibility.
- _.template = function(text, settings, oldSettings) {
- if (!settings && oldSettings) settings = oldSettings;
- settings = _.defaults({}, settings, _.templateSettings);
-
- // Combine delimiters into one regular expression via alternation.
- var matcher = RegExp([
- (settings.escape || noMatch).source,
- (settings.interpolate || noMatch).source,
- (settings.evaluate || noMatch).source
- ].join('|') + '|$', 'g');
-
- // Compile the template source, escaping string literals appropriately.
- var index = 0;
- var source = "__p+='";
- text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
- source += text.slice(index, offset).replace(escaper, escapeChar);
- index = offset + match.length;
-
- if (escape) {
- source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
- } else if (interpolate) {
- source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
- } else if (evaluate) {
- source += "';\n" + evaluate + "\n__p+='";
- }
-
- // Adobe VMs need the match returned to produce the correct offest.
- return match;
- });
- source += "';\n";
-
- // If a variable is not specified, place data values in local scope.
- if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
-
- source = "var __t,__p='',__j=Array.prototype.join," +
- "print=function(){__p+=__j.call(arguments,'');};\n" +
- source + 'return __p;\n';
-
- try {
- var render = new Function(settings.variable || 'obj', '_', source);
- } catch (e) {
- e.source = source;
- throw e;
- }
-
- var template = function(data) {
- return render.call(this, data, _);
- };
-
- // Provide the compiled source as a convenience for precompilation.
- var argument = settings.variable || 'obj';
- template.source = 'function(' + argument + '){\n' + source + '}';
-
- return template;
- };
-
- // Add a "chain" function. Start chaining a wrapped Underscore object.
- _.chain = function(obj) {
- var instance = _(obj);
- instance._chain = true;
- return instance;
- };
-
- // OOP
- // ---------------
- // If Underscore is called as a function, it returns a wrapped object that
- // can be used OO-style. This wrapper holds altered versions of all the
- // underscore functions. Wrapped objects may be chained.
-
- // Helper function to continue chaining intermediate results.
- var result = function(obj) {
- return this._chain ? _(obj).chain() : obj;
- };
-
- // Add your own custom functions to the Underscore object.
- _.mixin = function(obj) {
- _.each(_.functions(obj), function(name) {
- var func = _[name] = obj[name];
- _.prototype[name] = function() {
- var args = [this._wrapped];
- push.apply(args, arguments);
- return result.call(this, func.apply(_, args));
- };
- });
- };
-
- // Add all of the Underscore functions to the wrapper object.
- _.mixin(_);
-
- // Add all mutator Array functions to the wrapper.
- _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
- var method = ArrayProto[name];
- _.prototype[name] = function() {
- var obj = this._wrapped;
- method.apply(obj, arguments);
- if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];
- return result.call(this, obj);
- };
- });
-
- // Add all accessor Array functions to the wrapper.
- _.each(['concat', 'join', 'slice'], function(name) {
- var method = ArrayProto[name];
- _.prototype[name] = function() {
- return result.call(this, method.apply(this._wrapped, arguments));
- };
- });
-
- // Extracts the result from a wrapped and chained object.
- _.prototype.value = function() {
- return this._wrapped;
- };
-
- // AMD registration happens at the end for compatibility with AMD loaders
- // that may not enforce next-turn semantics on modules. Even though general
- // practice for AMD registration is to be anonymous, underscore registers
- // as a named module because, like jQuery, it is a base library that is
- // popular enough to be bundled in a third party lib, but not be part of
- // an AMD load request. Those cases could generate an error when an
- // anonymous define() is called outside of a loader request.
- if (typeof define === 'function' && define.amd) {
- define('underscore', [], function() {
- return _;
- });
- }
-}.call(this));
-
-/*
-Ring.js
-
-Copyright (c) 2013, Nicolas Vanhoren
-
-Released under the MIT license
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
-Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-(function() {
-/* jshint es3: true, proto: true */
-"use strict";
-
-if (typeof(exports) !== "undefined") { // nodejs
- var underscore = require("underscore");
- underscore.extend(exports, declare(underscore));
-} else if (typeof(define) !== "undefined") { // amd
- define(["underscore"], declare);
-} else { // define global variable
- window.ring = declare(_);
-}
-
-
-function declare(_) {
- var ring = {};
-
- function RingObject() {}
- /**
- ring.Object
-
- The base class of all other classes. It doesn't have much uses except
- testing testing if an object uses the Ring.js class system using
- ring.instance(x, ring.Object)
- */
- ring.Object = RingObject;
- _.extend(ring.Object, {
- __mro__: [ring.Object],
- __properties__: {__ringConstructor__: function() {}},
- __classId__: 1,
- __parents__: [],
- __classIndex__: {"1": ring.Object}
- });
- _.extend(ring.Object.prototype, {
- __ringConstructor__: ring.Object.__properties__.__ringConstructor__
- });
-
- // utility function to have Object.create on all browsers
- var objectCreate = function(o) {
- function CreatedObject(){}
- CreatedObject.prototype = o;
- var tmp = new CreatedObject();
- tmp.__proto__ = o;
- return tmp;
- };
- ring.__objectCreate = objectCreate;
-
- var classCounter = 3;
- var fnTest = /xyz/.test(function(){xyz();}) ? /\$super\b/ : /.*/;
-
- /**
- ring.create([parents,] properties)
-
- Creates a new class and returns it.
-
- properties is a dictionary of the methods and attributes that should
- be added to the new class' prototype.
-
- parents is a list of the classes this new class should extend. If not
- specified or an empty list is specified this class will inherit from one
- class: ring.Object.
- */
- ring.create = function() {
- // arguments parsing
- var args = _.toArray(arguments);
- args.reverse();
- var props = args[0];
- var parents = args.length >= 2 ? args[1] : [];
- if (! (parents instanceof Array))
- parents = [parents];
- _.each(parents, function(el) {
- toRingClass(el);
- });
- if (parents.length === 0)
- parents = [ring.Object];
- // constructor handling
- var cons = props.constructor !== Object ? props.constructor : undefined;
- props = _.clone(props);
- delete props.constructor;
- if (cons)
- props.__ringConstructor__ = cons;
- else { //retro compatibility
- cons = props.init;
- delete props.init;
- if (cons)
- props.__ringConstructor__ = cons;
- }
- // create real class
- var claz = function Instance() {
- this.$super = null;
- this.__ringConstructor__.apply(this, arguments);
- };
- claz.__properties__ = props;
- // mro creation
- var toMerge = _.pluck(parents, "__mro__");
- toMerge = toMerge.concat([parents]);
- var __mro__ = [claz].concat(mergeMro(toMerge));
- //generate prototype
- var prototype = Object.prototype;
- _.each(_.clone(__mro__).reverse(), function(claz) {
- var current = objectCreate(prototype);
- _.extend(current, claz.__properties__);
- _.each(_.keys(current), function(key) {
- var p = current[key];
- if (typeof p !== "function" || ! fnTest.test(p) || p.__classId__ ||
- (key !== "__ringConstructor__" && claz.__ringConvertedObject__))
- return;
- current[key] = (function(name, fct, supProto) {
- return function() {
- var tmp = this.$super;
- this.$super = supProto[name];
- try {
- return fct.apply(this, arguments);
- } finally {
- this.$super = tmp;
- }
- };
- })(key, p, prototype);
- });
- current.constructor = claz;
- prototype = current;
- });
- // remaining operations
- var id = classCounter++;
- claz.__mro__ = __mro__;
- claz.__parents__ = parents;
- claz.prototype = prototype;
- claz.__classId__ = id;
- // construct classes index
- claz.__classIndex__ = {};
- _.each(claz.__mro__, function(c) {
- claz.__classIndex__[c.__classId__] = c;
- });
- // class init
- if (claz.prototype.classInit) {
- claz.__classInit__ = claz.prototype.classInit;
- delete claz.prototype.classInit;
- }
- _.each(_.chain(claz.__mro__).clone().reverse().value(), function(c) {
- if (c.__classInit__) {
- var ret = c.__classInit__(claz.prototype);
- if (ret !== undefined)
- claz.prototype = ret;
- }
- });
-
- return claz;
- };
-
- var mergeMro = function(toMerge) {
- /* jshint loopfunc:true */
- // C3 merge() implementation
- var __mro__ = [];
- var current = _.clone(toMerge);
- while (true) {
- var found = false;
- for (var i=0; i < current.length; i++) {
- if (current[i].length === 0)
- continue;
- var currentClass = current[i][0];
- var isInTail = _.find(current, function(lst) {
- return _.contains(_.rest(lst), currentClass);
- });
- if (! isInTail) {
- found = true;
- __mro__.push(currentClass);
- current = _.map(current, function(lst) {
- if (_.head(lst) === currentClass)
- return _.rest(lst);
- else
- return lst;
- });
- break;
- }
- }
- if (found)
- continue;
- if (_.all(current, function(i) { return i.length === 0; }))
- return __mro__;
- throw new ring.ValueError("Cannot create a consistent method resolution order (MRO)");
- }
- };
-
- /**
- Convert an existing class to be used with the ring.js class system.
- */
- var toRingClass = function(claz) {
- if (claz.__classId__)
- return;
- var proto = ! Object.getOwnPropertyNames ? claz.prototype : (function() {
- var keys = {};
- (function crawl(p) {
- if (p === Object.prototype)
- return;
- _.extend(keys, _.chain(Object.getOwnPropertyNames(p))
- .map(function(el) {return [el, true];})
- .object().value());
- crawl(Object.getPrototypeOf(p));
- })(claz.prototype);
- return _.object(_.map(_.keys(keys), function(k) {return [k, claz.prototype[k]];}));
- })();
- proto = _.chain(proto).map(function(v, k) { return [k, v]; })
- .filter(function(el) {return el[0] !== "constructor" && el[0] !== "__proto__";})
- .object().value();
- var id = classCounter++;
- _.extend(claz, {
- __mro__: [claz, ring.Object],
- __properties__: _.extend({}, proto, {
- __ringConstructor__: function() {
- this.$super.apply(this, arguments);
- var tmp = this.$super;
- this.$super = null;
- try {
- claz.apply(this, arguments);
- } finally {
- this.$super = tmp;
- }
- }
- }),
- __classId__: id,
- __parents__: [ring.Object],
- __classIndex__: {"1": ring.Object},
- __ringConvertedObject__: true
- });
- claz.__classIndex__[id] = claz;
- };
-
- /**
- ring.instance(obj, type)
-
- Returns true if obj is an instance of type or an instance of a sub-class of type.
-
- It is necessary to use this method instead of instanceof when using the Ring.js class
- system because instanceof will not be able to detect sub-classes.
-
- If used with obj or type that do not use the Ring.js class system this method will
- use instanceof instead. So it should be safe to replace all usages of instanceof
- by ring.instance() in any program, whether or not it uses Ring.js.
-
- Additionaly this method allows to test the type of simple JavaScript types like strings.
- To do so, pass a string instead of a type as second argument. Examples:
-
- ring.instance("", "string") // returns true
- ring.instance(function() {}, "function") // returns true
- ring.instance({}, "object") // returns true
- ring.instance(1, "number") // returns true
- */
- ring.instance = function(obj, type) {
- if (obj !== null && typeof(obj) === "object" && obj.constructor && obj.constructor.__classIndex__ &&
- typeof(type) === "function" && typeof(type.__classId__) === "number") {
- return obj.constructor.__classIndex__[type.__classId__] !== undefined;
- }
- if (typeof(type) === "string")
- return typeof(obj) === type;
- return obj instanceof type;
- };
-
- /**
- A class to easily create new classes representing exceptions. This class is special
- because it is a sub-class of the standard Error class of JavaScript. Examples:
-
- ring.instance(e, Error)
-
- e instanceof Error
-
- This two expressions will always be true if e is an instance of ring.Error or any
- sub-class of ring.Error.
-
- */
- ring.Error = ring.create({
- /**
- The name attribute is used in the default implementation of the toString() method
- of the standard JavaScript Error class. According to the standard, all sub-classes
- of Error should define a new name.
- */
- name: "ring.Error",
- /**
- A default message to use in instances of this class if there is no arguments given
- to the constructor.
- */
- defaultMessage: "",
- /**
- Constructor arguments:
-
- message: The message to put in the instance. If there is no message specified, the
- message will be this.defaultMessage.
- */
- constructor: function(message) {
- this.message = message || this.defaultMessage;
- },
- classInit: function(prototype) {
- // some black magic to reconstitute a complete prototype chain
- // with Error at the end
- var protos = [];
- var gather = function(proto) {
- if (! proto)
- return;
- protos.push(proto);
- gather(proto.__proto__);
- };
- gather(prototype);
- var current = new Error();
- _.each(_.clone(protos).reverse(), function(proto) {
- var tmp = objectCreate(current);
- // using _.each to avoid traversing prototypes
- _.each(proto, function(v, k) {
- if (k !== "__proto__")
- tmp[k] = v;
- });
- current = tmp;
- });
- return current;
- }
- });
-
- /**
- A type of exception to inform that a method received an argument with an incorrect value.
- */
- ring.ValueError = ring.create([ring.Error], {
- name: "ring.ValueError"
- });
-
- /**
- This method allows to find the super of a method when that method has been re-defined
- in a child class.
-
- Contrary to this.$super(), this function allows to find a super method in another method
- than the re-defining one. Example:
-
- var A = ring.create({
- fctA: function() {...};
- });
-
- var B = ring.create([A], {
- fctA: function() {...};
- fctB: function() {
- ring.getSuper(B, this, "fctA")(); // here we call the original fctA() method
- // as it was defined in the A class
- };
- });
-
- This method is much slower than this.$super(), so this.$super() should always be
- preferred when it is possible to use it.
-
- Arguments:
-
- * currentClass: The current class. It is necessary to specify it for this function
- to work properly.
- * obj: The current object (this in most cases).
- * attributeName: The name of the desired attribute as it appeared in the base class.
-
- Returns the attribute as it was defined in the base class. If that attribute is a function,
- it will be binded to obj.
- */
- ring.getSuper = function(currentClass, obj, attributeName) {
- var pos;
- var __mro__ = obj.constructor.__mro__;
- for (var i = 0; i < __mro__.length; i++) {
- if (__mro__[i] === currentClass) {
- pos = i;
- break;
- }
- }
- if (pos === undefined)
- throw new ring.ValueError("Class not found in instance's method resolution order.");
- var find = function(proto, counter) {
- if (counter === 0)
- return proto;
- return find(proto.__proto__, counter - 1);
- };
- var proto = find(obj.constructor.prototype, pos + 1);
- var att;
- if (attributeName !== "constructor" && attributeName !== "init") // retro compatibility
- att = proto[attributeName];
- else
- att = proto.__ringConstructor__;
- if (ring.instance(att, "function"))
- return _.bind(att, obj);
- else
- return att;
- };
-
- return ring;
-}
-})();
-
-/**
- * @fileoverview JSJaC Jingle library - Header
- *
- * @url https://github.com/valeriansaliou/jsjac-jingle
- * @depends https://github.com/sstrigler/JSJaC
- * @author Valérian Saliou https://valeriansaliou.name/
- * @license Mozilla Public License v2.0 (MPL v2.0)
- */
-
-
-/** @module jsjac-jingle/header */
-
-
-/**
- * Implements:
- *
- * See the PROTOCOL.md file for a list of supported protocol extensions
- *
- *
- * Workflow:
- *
- * This negotiation example associates JSJaCJingle.js methods to a real workflow
- * We assume in this workflow example remote user accepts the call he gets
- *
- * 1.cmt Local user wants to start a WebRTC session with remote user
- * 1.snd Local user sends a session-initiate type='set'
- * 1.hdl Remote user sends back a type='result' to '1.snd' stanza (ack)
- *
- * 2.cmt Local user waits silently for remote user to send a session-accept
- * 2.hdl Remote user sends a session-accept type='set'
- * 2.snd Local user sends back a type='result' to '2.hdl' stanza (ack)
- *
- * 3.cmt WebRTC session starts
- * 3.cmt Users chat, and chat, and chat. Happy Jabbering to them!
- *
- * 4.cmt Local user wants to stop WebRTC session with remote user
- * 4.snd Local user sends a session-terminate type='set'
- * 4.hdl Remote user sends back a type='result' to '4.snd' stanza (ack)
- */
-/**
- * @fileoverview JSJaC Jingle library - Constants map
- *
- * @url https://github.com/valeriansaliou/jsjac-jingle
- * @depends https://github.com/sstrigler/JSJaC
- * @author Valérian Saliou https://valeriansaliou.name/
- * @license Mozilla Public License v2.0 (MPL v2.0)
- */
-
-
-/** @module jsjac-jingle/constants */
-
-
-/**
- * JINGLE WEBRTC
- */
-
-/**
- * @constant
- * @global
- * @type {Function}
- * @readonly
- * @default
- * @public
- */
-var WEBRTC_GET_MEDIA = ( navigator.webkitGetUserMedia ||
- navigator.mozGetUserMedia ||
- navigator.msGetUserMedia ||
- navigator.getUserMedia );
-
-/**
- * @constant
- * @global
- * @type {Function}
- * @readonly
- * @default
- * @public
- */
-var WEBRTC_PEER_CONNECTION = ( window.webkitRTCPeerConnection ||
- window.mozRTCPeerConnection ||
- window.RTCPeerConnection );
-
-/**
- * @constant
- * @global
- * @type {Function}
- * @readonly
- * @default
- * @public
- */
-var WEBRTC_SESSION_DESCRIPTION = ( window.mozRTCSessionDescription ||
- window.RTCSessionDescription );
-
-/**
- * @constant
- * @global
- * @type {Function}
- * @readonly
- * @default
- * @public
- */
-var WEBRTC_ICE_CANDIDATE = ( window.mozRTCIceCandidate ||
- window.RTCIceCandidate );
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var WEBRTC_CONFIGURATION = {
- peer_connection : {
- config : {
- iceServers : [{
- url: 'stun:stun.jappix.com'
- }]
- },
-
- constraints : {
- optional : [{
- 'DtlsSrtpKeyAgreement': true
- }]
- }
- },
-
- create_offer : {
- mandatory: {
- 'OfferToReceiveAudio' : true,
- 'OfferToReceiveVideo' : true
- }
- },
-
- create_answer : {
- mandatory: {
- 'OfferToReceiveAudio' : true,
- 'OfferToReceiveVideo' : true
- }
- }
-};
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var WEBRTC_SDP_LINE_BREAK = '\r\n';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var WEBRTC_SDP_TYPE_OFFER = 'offer';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var WEBRTC_SDP_TYPE_ANSWER = 'answer';
-
-/**
- * @constant
- * @global
- * @type {RegExp}
- * @readonly
- * @default
- * @public
- */
-var R_WEBRTC_SHORT_CANDIDATE = 'candidate:(\\w{1,32}) (\\d{1,5}) (udp|tcp) (\\d{1,10}) ([a-zA-Z0-9:\\.]{1,45}) (\\d{1,5}) (typ) (host|srflx|prflx|relay)( (raddr) ([a-zA-Z0-9:\\.]{1,45}) (rport) (\\d{1,5}))?( (generation) (\\d))?';
-
-/**
- * @constant
- * @global
- * @type {RegExp}
- * @readonly
- * @default
- * @public
- */
-var R_WEBRTC_DATA_CANDIDATE = new RegExp('^(?:a=)?' + R_WEBRTC_SHORT_CANDIDATE, 'i');
-
-/**
- * @constant
- * @global
- * @type {RegExp}
- * @readonly
- * @default
- * @public
- */
-var R_WEBRTC_SDP_CANDIDATE = new RegExp('^a=' + R_WEBRTC_SHORT_CANDIDATE, 'i');
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var R_WEBRTC_SDP_ICE_PAYLOAD = {
- rtpmap : /^a=rtpmap:(\d+) (([^\s\/]+)\/(\d+)(\/([^\s\/]+))?)?/i,
- fmtp : /^a=fmtp:(\d+) (.+)/i,
- group : /^a=group:(\S+) (.+)/,
- rtcp_fb : /^a=rtcp-fb:(\S+) (\S+)( (\S+))?/i,
- rtcp_fb_trr_int : /^a=rtcp-fb:(\d+) trr-int (\d+)/i,
- pwd : /^a=ice-pwd:(\S+)/i,
- ufrag : /^a=ice-ufrag:(\S+)/i,
- ptime : /^a=ptime:(\d+)/i,
- maxptime : /^a=maxptime:(\d+)/i,
- ssrc : /^a=ssrc:(\d+) (\w+)(:(.+))?/i,
- ssrc_group : /^a=ssrc-group:(\S+) ([\d ]+)/i,
- rtcp_mux : /^a=rtcp-mux/i,
- crypto : /^a=crypto:(\d{1,9}) (\S+) (\S+)( (\S+))?/i,
- zrtp_hash : /^a=zrtp-hash:(\S+) (\S+)/i,
- fingerprint : /^a=fingerprint:(\S+) (\S+)/i,
- setup : /^a=setup:(\S+)/i,
- extmap : /^a=extmap:([^\s\/]+)(\/([^\s\/]+))? (\S+)/i,
- bandwidth : /^b=(\w+):(\d+)/i,
- media : /^m=(audio|video|application|data) /i
-};
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var R_NETWORK_PROTOCOLS = {
- stun: /^stun:/i
-};
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var R_NETWORK_IP = {
- all: {
- v4: /((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])/,
- v6: /^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i
- },
-
- lan: {
- v4: /(^127\.0\.0\.1)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)/,
- v6: /((::1)|(^fe80::))(.+)?/i
- }
-};
-
-/**
- * @constant
- * @global
- * @type {RegExp}
- * @readonly
- * @default
- * @public
- */
-var R_JSJAC_JINGLE_SERVICE_URI = /^(\w+):([^:\?]+)(?::(\d+))?(?:\?transport=(\w+))?/i;
-
-
-/**
- * JINGLE NAMESPACES
- */
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE = 'urn:xmpp:jingle:1';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE_ERRORS = 'urn:xmpp:jingle:errors:1';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE_APPS_RTP = 'urn:xmpp:jingle:apps:rtp:1';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE_APPS_RTP_INFO = 'urn:xmpp:jingle:apps:rtp:info:1';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE_APPS_RTP_AUDIO = 'urn:xmpp:jingle:apps:rtp:audio';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE_APPS_RTP_VIDEO = 'urn:xmpp:jingle:apps:rtp:video';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE_APPS_RTP_RTP_HDREXT = 'urn:xmpp:jingle:apps:rtp:rtp-hdrext:0';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE_APPS_RTP_RTCP_FB = 'urn:xmpp:jingle:apps:rtp:rtcp-fb:0';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE_APPS_RTP_ZRTP = 'urn:xmpp:jingle:apps:rtp:zrtp:1';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE_APPS_RTP_SSMA = 'urn:xmpp:jingle:apps:rtp:ssma:0';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE_APPS_STUB = 'urn:xmpp:jingle:apps:stub:0';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE_APPS_DTLS = 'urn:xmpp:tmp:jingle:apps:dtls:0';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE_APPS_GROUPING = 'urn:xmpp:jingle:apps:grouping:0';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE_TRANSPORTS_RAWUDP = 'urn:xmpp:jingle:transports:raw-udp:1';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE_TRANSPORTS_ICEUDP = 'urn:xmpp:jingle:transports:ice-udp:1';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE_TRANSPORTS_STUB = 'urn:xmpp:jingle:transports:stub:0';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE_SECURITY_STUB = 'urn:xmpp:jingle:security:stub:0';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JINGLE_MESSAGE = 'urn:xmpp:jingle-message:0';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JABBER_JINGLENODES = 'http://jabber.org/protocol/jinglenodes';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JABBER_JINGLENODES_CHANNEL = 'http://jabber.org/protocol/jinglenodes#channel';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JABBER_MUC = 'http://jabber.org/protocol/muc';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JABBER_MUC_OWNER = 'http://jabber.org/protocol/muc#owner';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JABBER_MUC_ROOMCONFIG = 'http://jabber.org/protocol/muc#roomconfig';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JABBER_MUC_USER = 'http://jabber.org/protocol/muc#user';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JABBER_CONFERENCE = 'jabber:x:conference';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_JABBER_DATA = 'jabber:x:data';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_MUJI = 'urn:xmpp:muji:tmp';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_MUJI_INVITE = 'urn:xmpp:muji:invite:tmp';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_EXTDISCO = 'urn:xmpp:extdisco:1';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_IETF_XMPP_STANZAS = 'urn:ietf:params:xml:ns:xmpp-stanzas';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_IETF_RFC_3264 = 'urn:ietf:rfc:3264';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_IETF_RFC_5576 = 'urn:ietf:rfc:5576';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var NS_IETF_RFC_5888 = 'urn:ietf:rfc:5888';
-
-/**
- * @constant
- * @global
- * @type {RegExp}
- * @readonly
- * @default
- * @public
- */
-var R_NS_JINGLE_APP = /^urn:xmpp:jingle:app:(\w+)(:(\w+))?(:(\d+))?$/;
-
-/**
- * @constant
- * @global
- * @type {RegExp}
- * @readonly
- * @default
- * @public
- */
-var R_NS_JINGLE_TRANSPORT = /^urn:xmpp:jingle:transport:(\w+)$/;
-
-/**
- * @constant
- * @global
- * @type {Array}
- * @readonly
- * @default
- * @public
- */
-var MAP_DISCO_JINGLE = [
- /* http://xmpp.org/extensions/xep-0166.html#support */
- /* http://xmpp.org/extensions/xep-0167.html#support */
- NS_JINGLE,
- NS_JINGLE_APPS_RTP,
- NS_JINGLE_APPS_RTP_AUDIO,
- NS_JINGLE_APPS_RTP_VIDEO,
-
- /* http://xmpp.org/extensions/xep-0177.html */
- NS_JINGLE_TRANSPORTS_RAWUDP,
-
- /* http://xmpp.org/extensions/xep-0176.html#support */
- NS_JINGLE_TRANSPORTS_ICEUDP,
- NS_IETF_RFC_3264,
-
- /* http://xmpp.org/extensions/xep-0339.html#disco */
- NS_IETF_RFC_5576,
-
- /* http://xmpp.org/extensions/xep-0338.html#disco */
- NS_IETF_RFC_5888,
-
- /* http://xmpp.org/extensions/xep-0293.html#determining-support */
- NS_JINGLE_APPS_RTP_RTCP_FB,
-
- /* http://xmpp.org/extensions/xep-0294.html#determining-support */
- NS_JINGLE_APPS_RTP_RTP_HDREXT,
-
- /* http://xmpp.org/extensions/xep-0320.html#disco */
- NS_JINGLE_APPS_DTLS,
-
- /* http://xmpp.org/extensions/xep-0262.html */
- NS_JINGLE_APPS_RTP_ZRTP,
-
- /* http://xmpp.org/extensions/xep-0353.html */
- NS_JINGLE_MESSAGE,
-
- /* http://xmpp.org/extensions/xep-0278.html */
- NS_JABBER_JINGLENODES,
-
- /* http://xmpp.org/extensions/xep-0215.html */
- NS_EXTDISCO
-];
-
-
-/**
- * @constant
- * @global
- * @type {Array}
- * @readonly
- * @default
- * @public
- */
-var MAP_DISCO_MUJI = [
- /* http://xmpp.org/extensions/xep-0272.html */
- NS_MUJI,
-
- /* http://xmpp.org/extensions/xep-0272.html#inviting */
- NS_MUJI_INVITE,
-
- /* http://xmpp.org/extensions/xep-0249.html */
- NS_JABBER_CONFERENCE
-];
-
-
-
-/**
- * JSJAC JINGLE CONSTANTS
- */
-
-/**
- * @constant
- * @global
- * @type {Boolean}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_AVAILABLE = WEBRTC_GET_MEDIA ? true : false;
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SESSION_SINGLE = 'single';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SESSION_MUJI = 'muji';
-
-/**
- * @constant
- * @global
- * @type {Number}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_PEER_TIMEOUT_DEFAULT = 15;
-
-/**
- * @constant
- * @global
- * @type {Number}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_PEER_TIMEOUT_DISCONNECT = 5;
-
-/**
- * @constant
- * @global
- * @type {Number}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MEDIA_READYSTATE_UNINITIALIZED = 0;
-
-/**
- * @constant
- * @global
- * @type {Number}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MEDIA_READYSTATE_LOADING = 1;
-
-/**
- * @constant
- * @global
- * @type {Number}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MEDIA_READYSTATE_LOADED = 2;
-
-/**
- * @constant
- * @global
- * @type {Number}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MEDIA_READYSTATE_INTERACTIVE = 3;
-
-/**
- * @constant
- * @global
- * @type {Number}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MEDIA_READYSTATE_COMPLETED = 4;
-
-/**
- * @constant
- * @global
- * @type {Number}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_STANZA_TIMEOUT = 10;
-
-/**
- * @constant
- * @global
- * @type {Number}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_BROADCAST_TIMEOUT = 30;
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_STANZA_ID_PRE = 'jj';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_NETWORK = '0';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_GENERATION = '0';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_DIRECTION_LOCAL = 'local';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_DIRECTION_REMOTE = 'remote';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_BROWSER_FIREFOX = 'Firefox';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_BROWSER_CHROME = 'Chrome';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_BROWSER_SAFARI = 'Safari';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_BROWSER_OPERA = 'Opera';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_BROWSER_IE = 'IE';
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SENDERS_BOTH = { jingle: 'both', sdp: 'sendrecv' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SENDERS_INITIATOR = { jingle: 'initiator', sdp: 'sendonly' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SENDERS_NONE = { jingle: 'none', sdp: 'inactive' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SENDERS_RESPONDER = { jingle: 'responder', sdp: 'recvonly' };
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_CREATOR_INITIATOR = 'initiator';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_CREATOR_RESPONDER = 'responder';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_STATUS_INACTIVE = 'inactive';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_STATUS_INITIATING = 'initiating';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_STATUS_INITIATED = 'initiated';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_STATUS_ACCEPTING = 'accepting';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_STATUS_ACCEPTED = 'accepted';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_STATUS_TERMINATING = 'terminating';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_STATUS_TERMINATED = 'terminated';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ACTION_CONTENT_ACCEPT = 'content-accept';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ACTION_CONTENT_ADD = 'content-add';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ACTION_CONTENT_MODIFY = 'content-modify';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ACTION_CONTENT_REJECT = 'content-reject';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ACTION_CONTENT_REMOVE = 'content-remove';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ACTION_DESCRIPTION_INFO = 'description-info';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ACTION_SECURITY_INFO = 'security-info';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ACTION_SESSION_ACCEPT = 'session-accept';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ACTION_SESSION_INFO = 'session-info';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ACTION_SESSION_INITIATE = 'session-initiate';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ACTION_SESSION_TERMINATE = 'session-terminate';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ACTION_TRANSPORT_ACCEPT = 'transport-accept';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ACTION_TRANSPORT_INFO = 'transport-info';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ACTION_TRANSPORT_REJECT = 'transport-reject';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ACTION_TRANSPORT_REPLACE = 'transport-replace';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MESSAGE_ACTION_PROPOSE = 'propose';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MESSAGE_ACTION_RETRACT = 'retract';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MESSAGE_ACTION_ACCEPT = 'accept';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MESSAGE_ACTION_PROCEED = 'proceed';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MESSAGE_ACTION_REJECT = 'reject';
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ERROR_OUT_OF_ORDER = { jingle: 'out-of-order', xmpp: 'unexpected-request', type: 'wait' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ERROR_TIE_BREAK = { jingle: 'tie-break', xmpp: 'conflict', type: 'cancel' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ERROR_UNKNOWN_SESSION = { jingle: 'unknown-session', xmpp: 'item-not-found', type: 'cancel' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ERROR_UNSUPPORTED_INFO = { jingle: 'unsupported-info', xmpp: 'feature-not-implemented', type: 'modify' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ERROR_SECURITY_REQUIRED = { jingle: 'security-required', xmpp: 'not-acceptable', type: 'cancel' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var XMPP_ERROR_UNEXPECTED_REQUEST = { xmpp: 'unexpected-request', type: 'wait' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var XMPP_ERROR_CONFLICT = { xmpp: 'conflict', type: 'cancel' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var XMPP_ERROR_ITEM_NOT_FOUND = { xmpp: 'item-not-found', type: 'cancel' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var XMPP_ERROR_NOT_ACCEPTABLE = { xmpp: 'not-acceptable', type: 'modify' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var XMPP_ERROR_NOT_AUTHORIZED = { xmpp: 'not-authorized', type: 'auth' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var XMPP_ERROR_FEATURE_NOT_IMPLEMENTED = { xmpp: 'feature-not-implemented', type: 'cancel' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var XMPP_ERROR_SERVICE_UNAVAILABLE = { xmpp: 'service-unavailable', type: 'cancel' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var XMPP_ERROR_REDIRECT = { xmpp: 'redirect', type: 'modify' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var XMPP_ERROR_RESOURCE_CONSTRAINT = { xmpp: 'resource-constraint', type: 'wait' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var XMPP_ERROR_BAD_REQUEST = { xmpp: 'bad-request', type: 'cancel' };
-
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASON_ALTERNATIVE_SESSION = 'alternative-session';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASON_BUSY = 'busy';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASON_CANCEL = 'cancel';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASON_CONNECTIVITY_ERROR = 'connectivity-error';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASON_DECLINE = 'decline';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASON_EXPIRED = 'expired';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASON_FAILED_APPLICATION = 'failed-application';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASON_FAILED_TRANSPORT = 'failed-transport';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASON_GENERAL_ERROR = 'general-error';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASON_GONE = 'gone';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASON_INCOMPATIBLE_PARAMETERS = 'incompatible-parameters';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASON_MEDIA_ERROR = 'media-error';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASON_SECURITY_ERROR = 'security-error';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASON_SUCCESS = 'success';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASON_TIMEOUT = 'timeout';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASON_UNSUPPORTED_APPLICATIONS = 'unsupported-applications';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASON_UNSUPPORTED_TRANSPORTS = 'unsupported-transports';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SESSION_INFO_ACTIVE = 'active';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SESSION_INFO_HOLD = 'hold';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SESSION_INFO_MUTE = 'mute';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SESSION_INFO_RINGING = 'ringing';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SESSION_INFO_UNHOLD = 'unhold';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SESSION_INFO_UNMUTE = 'unmute';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MEDIA_AUDIO = 'audio';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MEDIA_VIDEO = 'video';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_VIDEO_SOURCE_CAMERA = 'camera';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_VIDEO_SOURCE_SCREEN = 'screen';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_STANZA_IQ = 'iq';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_STANZA_MESSAGE = 'message';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_STANZA_PRESENCE = 'presence';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MESSAGE_TYPE_ALL = 'all';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MESSAGE_TYPE_NORMAL = 'normal';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MESSAGE_TYPE_CHAT = 'chat';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MESSAGE_TYPE_HEADLINE = 'headline';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MESSAGE_TYPE_GROUPCHAT = 'groupchat';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MESSAGE_TYPE_ERROR = 'error';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_PRESENCE_TYPE_ALL = 'all';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_PRESENCE_TYPE_AVAILABLE = 'available';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_PRESENCE_TYPE_UNAVAILABLE = 'unavailable';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_PRESENCE_TYPE_ERROR = 'error';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_IQ_TYPE_ALL = 'all';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_IQ_TYPE_RESULT = 'result';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_IQ_TYPE_SET = 'set';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_IQ_TYPE_GET = 'get';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_IQ_TYPE_ERROR = 'error';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ICE_CONNECTION_STATE_NEW = 'new';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ICE_CONNECTION_STATE_CHECKING = 'checking';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ICE_CONNECTION_STATE_CONNECTED = 'connected';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ICE_CONNECTION_STATE_COMPLETED = 'completed';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ICE_CONNECTION_STATE_FAILED = 'failed';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ICE_CONNECTION_STATE_DISCONNECTED = 'disconnected';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ICE_CONNECTION_STATE_CLOSED = 'closed';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_TYPE_HOST = 'host';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_TYPE_SRFLX = 'srflx';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_TYPE_PRFLX = 'prflx';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_TYPE_RELAY = 'relay';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_METHOD_ICE = 'ice';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_METHOD_RAW = 'raw';
-
-/**
- * @constant
- * @global
- * @type {Array}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_MAP_ICEUDP = [
- { n: 'component', r: 1 },
- { n: 'foundation', r: 1 },
- { n: 'generation', r: 1 },
- { n: 'id', r: 1 },
- { n: 'ip', r: 1 },
- { n: 'network', r: 1 },
- { n: 'port', r: 1 },
- { n: 'priority', r: 1 },
- { n: 'protocol', r: 1 },
- { n: 'rel-addr', r: 0 },
- { n: 'rel-port', r: 0 },
- { n: 'type', r: 1 }
-];
-
-/**
- * @constant
- * @global
- * @type {Array}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_MAP_RAWUDP = [
- { n: 'component', r: 1 },
- { n: 'generation', r: 1 },
- { n: 'id', r: 1 },
- { n: 'ip', r: 1 },
- { n: 'port', r: 1 },
- { n: 'type', r: 1 }
-];
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_SCOPE_LOCAL = 'IN';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_SCOPE_REMOTE = 'IN';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_IPVERSION_V4 = 'IP4';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_IPVERSION_V6 = 'IP6';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_PROTOCOL_TCP = 'tcp';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_PROTOCOL_UDP = 'udp';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_IP_V4 = '0.0.0.0';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_IP_V6 = '::';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_IP_DEFAULT = JSJAC_JINGLE_SDP_CANDIDATE_IP_V4;
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_PORT_DEFAULT = '1';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_SCOPE_DEFAULT = JSJAC_JINGLE_SDP_CANDIDATE_SCOPE_REMOTE;
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_IPVERSION_DEFAULT = JSJAC_JINGLE_SDP_CANDIDATE_IPVERSION_V4;
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_PROTOCOL_DEFAULT = JSJAC_JINGLE_SDP_CANDIDATE_PROTOCOL_UDP;
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_PRIORITY_DEFAULT = '1';
-
-
-
-/**
- * JSJAC JINGLE MUJI CONSTANTS
- */
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_ACTION_PREPARE = 'prepare';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_ACTION_INITIATE = 'initiate';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_ACTION_LEAVE = 'leave';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_STATUS_INACTIVE = 'inactive';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_STATUS_PREPARING = 'preparing';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_STATUS_PREPARED = 'prepared';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_STATUS_INITIATING = 'initiating';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_STATUS_INITIATED = 'initiated';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_STATUS_LEAVING = 'leaving';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_STATUS_LEFT = 'left';
-
-/**
- * @constant
- * @global
- * @type {Number}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_INITIATE_WAIT = 2;
-
-/**
- * @constant
- * @global
- * @type {Number}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_LEAVE_WAIT = 1;
-
-/**
- * @constant
- * @global
- * @type {Number}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_PARTICIPANT_ACCEPT_WAIT = 0.250;
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_HANDLER_GET_USER_MEDIA = 'get_user_media';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_MUC_AFFILIATION_ADMIN = 'admin';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_MUC_AFFILIATION_MEMBER = 'member';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_MUC_AFFILIATION_NONE = 'none';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_MUC_AFFILIATION_OUTCAST = 'outcast';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_MUC_AFFILIATION_OWNER = 'owner';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_MUC_OWNER_SUBMIT = 'submit';
-
-/**
- * @constant
- * @global
- * @type {String}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_MUC_CONFIG_SECRET = 'muc#roomconfig_roomsecret';
-
-
-
-/**
- * JSJSAC JINGLE CONSTANTS MAPPING
- */
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ICE_CONNECTION_STATES = {};
-JSJAC_JINGLE_ICE_CONNECTION_STATES[JSJAC_JINGLE_ICE_CONNECTION_STATE_NEW] = 1;
-JSJAC_JINGLE_ICE_CONNECTION_STATES[JSJAC_JINGLE_ICE_CONNECTION_STATE_CHECKING] = 1;
-JSJAC_JINGLE_ICE_CONNECTION_STATES[JSJAC_JINGLE_ICE_CONNECTION_STATE_CONNECTED] = 1;
-JSJAC_JINGLE_ICE_CONNECTION_STATES[JSJAC_JINGLE_ICE_CONNECTION_STATE_COMPLETED] = 1;
-JSJAC_JINGLE_ICE_CONNECTION_STATES[JSJAC_JINGLE_ICE_CONNECTION_STATE_FAILED] = 1;
-JSJAC_JINGLE_ICE_CONNECTION_STATES[JSJAC_JINGLE_ICE_CONNECTION_STATE_DISCONNECTED] = 1;
-JSJAC_JINGLE_ICE_CONNECTION_STATES[JSJAC_JINGLE_ICE_CONNECTION_STATE_CLOSED] = 1;
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SDP_CANDIDATE_TYPES = {};
-JSJAC_JINGLE_SDP_CANDIDATE_TYPES[JSJAC_JINGLE_SDP_CANDIDATE_TYPE_HOST] = JSJAC_JINGLE_SDP_CANDIDATE_METHOD_ICE;
-JSJAC_JINGLE_SDP_CANDIDATE_TYPES[JSJAC_JINGLE_SDP_CANDIDATE_TYPE_SRFLX] = JSJAC_JINGLE_SDP_CANDIDATE_METHOD_ICE;
-JSJAC_JINGLE_SDP_CANDIDATE_TYPES[JSJAC_JINGLE_SDP_CANDIDATE_TYPE_PRFLX] = JSJAC_JINGLE_SDP_CANDIDATE_METHOD_ICE;
-JSJAC_JINGLE_SDP_CANDIDATE_TYPES[JSJAC_JINGLE_SDP_CANDIDATE_TYPE_RELAY] = JSJAC_JINGLE_SDP_CANDIDATE_METHOD_RAW;
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_BROWSERS = {};
-JSJAC_JINGLE_BROWSERS[JSJAC_JINGLE_BROWSER_FIREFOX] = 1;
-JSJAC_JINGLE_BROWSERS[JSJAC_JINGLE_BROWSER_CHROME] = 1;
-JSJAC_JINGLE_BROWSERS[JSJAC_JINGLE_BROWSER_SAFARI] = 1;
-JSJAC_JINGLE_BROWSERS[JSJAC_JINGLE_BROWSER_OPERA] = 1;
-JSJAC_JINGLE_BROWSERS[JSJAC_JINGLE_BROWSER_IE] = 1;
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SENDERS = {};
-JSJAC_JINGLE_SENDERS[JSJAC_JINGLE_SENDERS_BOTH.jingle] = JSJAC_JINGLE_SENDERS_BOTH.sdp;
-JSJAC_JINGLE_SENDERS[JSJAC_JINGLE_SENDERS_INITIATOR.jingle] = JSJAC_JINGLE_SENDERS_INITIATOR.sdp;
-JSJAC_JINGLE_SENDERS[JSJAC_JINGLE_SENDERS_NONE.jingle] = JSJAC_JINGLE_SENDERS_NONE.sdp;
-JSJAC_JINGLE_SENDERS[JSJAC_JINGLE_SENDERS_RESPONDER.jingle] = JSJAC_JINGLE_SENDERS_RESPONDER.sdp;
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_CREATORS = {};
-JSJAC_JINGLE_CREATORS[JSJAC_JINGLE_CREATOR_INITIATOR] = 1;
-JSJAC_JINGLE_CREATORS[JSJAC_JINGLE_CREATOR_RESPONDER] = 1;
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_STATUSES = {};
-JSJAC_JINGLE_STATUSES[JSJAC_JINGLE_STATUS_INACTIVE] = 1;
-JSJAC_JINGLE_STATUSES[JSJAC_JINGLE_STATUS_INITIATING] = 1;
-JSJAC_JINGLE_STATUSES[JSJAC_JINGLE_STATUS_INITIATED] = 1;
-JSJAC_JINGLE_STATUSES[JSJAC_JINGLE_STATUS_ACCEPTING] = 1;
-JSJAC_JINGLE_STATUSES[JSJAC_JINGLE_STATUS_ACCEPTED] = 1;
-JSJAC_JINGLE_STATUSES[JSJAC_JINGLE_STATUS_TERMINATING] = 1;
-JSJAC_JINGLE_STATUSES[JSJAC_JINGLE_STATUS_TERMINATED] = 1;
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ACTIONS = {};
-JSJAC_JINGLE_ACTIONS[JSJAC_JINGLE_ACTION_CONTENT_ACCEPT] = 1;
-JSJAC_JINGLE_ACTIONS[JSJAC_JINGLE_ACTION_CONTENT_ADD] = 1;
-JSJAC_JINGLE_ACTIONS[JSJAC_JINGLE_ACTION_CONTENT_MODIFY] = 1;
-JSJAC_JINGLE_ACTIONS[JSJAC_JINGLE_ACTION_CONTENT_REJECT] = 1;
-JSJAC_JINGLE_ACTIONS[JSJAC_JINGLE_ACTION_CONTENT_REMOVE] = 1;
-JSJAC_JINGLE_ACTIONS[JSJAC_JINGLE_ACTION_DESCRIPTION_INFO] = 1;
-JSJAC_JINGLE_ACTIONS[JSJAC_JINGLE_ACTION_SECURITY_INFO] = 1;
-JSJAC_JINGLE_ACTIONS[JSJAC_JINGLE_ACTION_SESSION_ACCEPT] = 1;
-JSJAC_JINGLE_ACTIONS[JSJAC_JINGLE_ACTION_SESSION_INFO] = 1;
-JSJAC_JINGLE_ACTIONS[JSJAC_JINGLE_ACTION_SESSION_INITIATE] = 1;
-JSJAC_JINGLE_ACTIONS[JSJAC_JINGLE_ACTION_SESSION_TERMINATE] = 1;
-JSJAC_JINGLE_ACTIONS[JSJAC_JINGLE_ACTION_TRANSPORT_ACCEPT] = 1;
-JSJAC_JINGLE_ACTIONS[JSJAC_JINGLE_ACTION_TRANSPORT_INFO] = 1;
-JSJAC_JINGLE_ACTIONS[JSJAC_JINGLE_ACTION_TRANSPORT_REJECT] = 1;
-JSJAC_JINGLE_ACTIONS[JSJAC_JINGLE_ACTION_TRANSPORT_REPLACE] = 1;
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MESSAGE_ACTIONS = {};
-JSJAC_JINGLE_MESSAGE_ACTIONS[JSJAC_JINGLE_MESSAGE_ACTION_PROPOSE] = 1;
-JSJAC_JINGLE_MESSAGE_ACTIONS[JSJAC_JINGLE_MESSAGE_ACTION_RETRACT] = 1;
-JSJAC_JINGLE_MESSAGE_ACTIONS[JSJAC_JINGLE_MESSAGE_ACTION_ACCEPT] = 1;
-JSJAC_JINGLE_MESSAGE_ACTIONS[JSJAC_JINGLE_MESSAGE_ACTION_PROCEED] = 1;
-JSJAC_JINGLE_MESSAGE_ACTIONS[JSJAC_JINGLE_MESSAGE_ACTION_REJECT] = 1;
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_ERRORS = {};
-JSJAC_JINGLE_ERRORS[JSJAC_JINGLE_ERROR_OUT_OF_ORDER.jingle] = 1;
-JSJAC_JINGLE_ERRORS[JSJAC_JINGLE_ERROR_TIE_BREAK.jingle] = 1;
-JSJAC_JINGLE_ERRORS[JSJAC_JINGLE_ERROR_UNKNOWN_SESSION.jingle] = 1;
-JSJAC_JINGLE_ERRORS[JSJAC_JINGLE_ERROR_UNSUPPORTED_INFO.jingle] = 1;
-JSJAC_JINGLE_ERRORS[JSJAC_JINGLE_ERROR_SECURITY_REQUIRED.jingle] = 1;
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var XMPP_ERRORS = {};
-XMPP_ERRORS[XMPP_ERROR_UNEXPECTED_REQUEST.xmpp] = 1;
-XMPP_ERRORS[XMPP_ERROR_CONFLICT.xmpp] = 1;
-XMPP_ERRORS[XMPP_ERROR_ITEM_NOT_FOUND.xmpp] = 1;
-XMPP_ERRORS[XMPP_ERROR_NOT_ACCEPTABLE.xmpp] = 1;
-XMPP_ERRORS[XMPP_ERROR_FEATURE_NOT_IMPLEMENTED.xmpp] = 1;
-XMPP_ERRORS[XMPP_ERROR_SERVICE_UNAVAILABLE.xmpp] = 1;
-XMPP_ERRORS[XMPP_ERROR_REDIRECT.xmpp] = 1;
-XMPP_ERRORS[XMPP_ERROR_RESOURCE_CONSTRAINT.xmpp] = 1;
-XMPP_ERRORS[XMPP_ERROR_BAD_REQUEST.xmpp] = 1;
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_REASONS = {};
-JSJAC_JINGLE_REASONS[JSJAC_JINGLE_REASON_ALTERNATIVE_SESSION] = 1;
-JSJAC_JINGLE_REASONS[JSJAC_JINGLE_REASON_BUSY] = 1;
-JSJAC_JINGLE_REASONS[JSJAC_JINGLE_REASON_CANCEL] = 1;
-JSJAC_JINGLE_REASONS[JSJAC_JINGLE_REASON_CONNECTIVITY_ERROR] = 1;
-JSJAC_JINGLE_REASONS[JSJAC_JINGLE_REASON_DECLINE] = 1;
-JSJAC_JINGLE_REASONS[JSJAC_JINGLE_REASON_EXPIRED] = 1;
-JSJAC_JINGLE_REASONS[JSJAC_JINGLE_REASON_FAILED_APPLICATION] = 1;
-JSJAC_JINGLE_REASONS[JSJAC_JINGLE_REASON_FAILED_TRANSPORT] = 1;
-JSJAC_JINGLE_REASONS[JSJAC_JINGLE_REASON_GENERAL_ERROR] = 1;
-JSJAC_JINGLE_REASONS[JSJAC_JINGLE_REASON_GONE] = 1;
-JSJAC_JINGLE_REASONS[JSJAC_JINGLE_REASON_INCOMPATIBLE_PARAMETERS] = 1;
-JSJAC_JINGLE_REASONS[JSJAC_JINGLE_REASON_MEDIA_ERROR] = 1;
-JSJAC_JINGLE_REASONS[JSJAC_JINGLE_REASON_SECURITY_ERROR] = 1;
-JSJAC_JINGLE_REASONS[JSJAC_JINGLE_REASON_SUCCESS] = 1;
-JSJAC_JINGLE_REASONS[JSJAC_JINGLE_REASON_TIMEOUT] = 1;
-JSJAC_JINGLE_REASONS[JSJAC_JINGLE_REASON_UNSUPPORTED_APPLICATIONS] = 1;
-JSJAC_JINGLE_REASONS[JSJAC_JINGLE_REASON_UNSUPPORTED_TRANSPORTS] = 1;
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_SESSION_INFOS = {};
-JSJAC_JINGLE_SESSION_INFOS[JSJAC_JINGLE_SESSION_INFO_ACTIVE] = 1;
-JSJAC_JINGLE_SESSION_INFOS[JSJAC_JINGLE_SESSION_INFO_HOLD] = 1;
-JSJAC_JINGLE_SESSION_INFOS[JSJAC_JINGLE_SESSION_INFO_MUTE] = 1;
-JSJAC_JINGLE_SESSION_INFOS[JSJAC_JINGLE_SESSION_INFO_RINGING] = 1;
-JSJAC_JINGLE_SESSION_INFOS[JSJAC_JINGLE_SESSION_INFO_UNHOLD] = 1;
-JSJAC_JINGLE_SESSION_INFOS[JSJAC_JINGLE_SESSION_INFO_UNMUTE] = 1;
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MEDIAS = {};
-JSJAC_JINGLE_MEDIAS[JSJAC_JINGLE_MEDIA_AUDIO] = { label: '0' };
-JSJAC_JINGLE_MEDIAS[JSJAC_JINGLE_MEDIA_VIDEO] = { label: '1' };
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_VIDEO_SOURCES = {};
-JSJAC_JINGLE_VIDEO_SOURCES[JSJAC_JINGLE_VIDEO_SOURCE_CAMERA] = 1;
-JSJAC_JINGLE_VIDEO_SOURCES[JSJAC_JINGLE_VIDEO_SOURCE_SCREEN] = 1;
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MESSAGE_TYPES = {};
-JSJAC_JINGLE_MESSAGE_TYPES[JSJAC_JINGLE_MESSAGE_TYPE_ALL] = 1;
-JSJAC_JINGLE_MESSAGE_TYPES[JSJAC_JINGLE_MESSAGE_TYPE_NORMAL] = 1;
-JSJAC_JINGLE_MESSAGE_TYPES[JSJAC_JINGLE_MESSAGE_TYPE_CHAT] = 1;
-JSJAC_JINGLE_MESSAGE_TYPES[JSJAC_JINGLE_MESSAGE_TYPE_HEADLINE] = 1;
-JSJAC_JINGLE_MESSAGE_TYPES[JSJAC_JINGLE_MESSAGE_TYPE_GROUPCHAT] = 1;
-JSJAC_JINGLE_MESSAGE_TYPES[JSJAC_JINGLE_MESSAGE_TYPE_ERROR] = 1;
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_PRESENCE_TYPES = {};
-JSJAC_JINGLE_PRESENCE_TYPES[JSJAC_JINGLE_PRESENCE_TYPE_ALL] = 1;
-JSJAC_JINGLE_PRESENCE_TYPES[JSJAC_JINGLE_PRESENCE_TYPE_AVAILABLE] = 1;
-JSJAC_JINGLE_PRESENCE_TYPES[JSJAC_JINGLE_PRESENCE_TYPE_UNAVAILABLE] = 1;
-JSJAC_JINGLE_PRESENCE_TYPES[JSJAC_JINGLE_PRESENCE_TYPE_ERROR] = 1;
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_IQ_TYPES = {};
-JSJAC_JINGLE_IQ_TYPES[JSJAC_JINGLE_IQ_TYPE_ALL] = 1;
-JSJAC_JINGLE_IQ_TYPES[JSJAC_JINGLE_IQ_TYPE_RESULT] = 1;
-JSJAC_JINGLE_IQ_TYPES[JSJAC_JINGLE_IQ_TYPE_SET] = 1;
-JSJAC_JINGLE_IQ_TYPES[JSJAC_JINGLE_IQ_TYPE_GET] = 1;
-JSJAC_JINGLE_IQ_TYPES[JSJAC_JINGLE_IQ_TYPE_ERROR] = 1;
-
-
-
-/**
- * JSJAC JINGLE MUJI CONSTANTS MAPPING
- */
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_ACTIONS = {};
-JSJAC_JINGLE_MUJI_ACTIONS[JSJAC_JINGLE_MUJI_ACTION_PREPARE] = 1;
-JSJAC_JINGLE_MUJI_ACTIONS[JSJAC_JINGLE_MUJI_ACTION_INITIATE] = 1;
-JSJAC_JINGLE_MUJI_ACTIONS[JSJAC_JINGLE_MUJI_ACTION_LEAVE] = 1;
-
-/**
- * @constant
- * @global
- * @type {Object}
- * @readonly
- * @default
- * @public
- */
-var JSJAC_JINGLE_MUJI_STATUS = {};
-JSJAC_JINGLE_MUJI_STATUS[JSJAC_JINGLE_MUJI_STATUS_INACTIVE] = 1;
-JSJAC_JINGLE_MUJI_STATUS[JSJAC_JINGLE_MUJI_STATUS_PREPARING] = 1;
-JSJAC_JINGLE_MUJI_STATUS[JSJAC_JINGLE_MUJI_STATUS_PREPARED] = 1;
-JSJAC_JINGLE_MUJI_STATUS[JSJAC_JINGLE_MUJI_STATUS_INITIATING] = 1;
-JSJAC_JINGLE_MUJI_STATUS[JSJAC_JINGLE_MUJI_STATUS_INITIATED] = 1;
-JSJAC_JINGLE_MUJI_STATUS[JSJAC_JINGLE_MUJI_STATUS_LEAVING] = 1;
-JSJAC_JINGLE_MUJI_STATUS[JSJAC_JINGLE_MUJI_STATUS_LEFT] = 1;
-
-/**
- * @fileoverview JSJaC Jingle library - Storage layer
- *
- * @url https://github.com/valeriansaliou/jsjac-jingle
- * @depends https://github.com/sstrigler/JSJaC
- * @author Valérian Saliou https://valeriansaliou.name/
- * @license Mozilla private License v2.0 (MPL v2.0)
- */
-
-
-/** @module jsjac-jingle/storage */
-/** @exports JSJaCJingleStorage */
-
-
-/**
- * Storage layer wrapper.
- * @instance
- * @requires nicolas-van/ring.js
- * @requires jsjac-jingle/constants
- * @see {@link http://ringjs.neoname.eu/|Ring.js}
- * @see {@link http://stefan-strigler.de/jsjac-1.3.4/doc/|JSJaC Documentation}
- */
-var JSJaCJingleStorage = new (ring.create(
- /** @lends JSJaCJingleStorage.prototype */
- {
- /**
- * Constructor
- */
- constructor: function() {
- /**
- * JSJAC JINGLE STORAGE
- */
-
- /**
- * @member {JSJaCConnection}
- * @default
- * @private
- */
- this._connection = null;
-
- /**
- * @type {Object}
- * @default
- * @private
- */
- this._sessions = {};
- this._sessions[JSJAC_JINGLE_SESSION_SINGLE] = {};
- this._sessions[JSJAC_JINGLE_SESSION_MUJI] = {};
-
- /**
- * @type {Object}
- * @default
- * @private
- */
- this._broadcast_ids = {};
-
- /**
- * @type {Function}
- * @default
- * @private
- */
- this._single_initiate = undefined;
-
- /**
- * @type {Function}
- * @default
- * @private
- */
- this._single_propose = undefined;
-
- /**
- * @type {Function}
- * @default
- * @private
- */
- this._single_retract = undefined;
-
- /**
- * @type {Function}
- * @default
- * @private
- */
- this._single_accept = undefined;
-
- /**
- * @type {Function}
- * @default
- * @private
- */
- this._single_reject = undefined;
-
- /**
- * @type {Function}
- * @default
- * @private
- */
- this._single_proceed = undefined;
-
- /**
- * @type {Function}
- * @default
- * @private
- */
- this._muji_invite = undefined;
-
- /**
- * @type {Object}
- * @default
- * @private
- */
- this._debug = {
- log : function() {}
- };
-
- /**
- * @type {Object}
- * @default
- * @private
- */
- this._extdisco = {
- stun : [],
- turn : []
- };
-
- /**
- * @type {Object}
- * @default
- * @private
- */
- this._fallback = {
- stun : [],
- turn : []
- };
-
- /**
- * @type {Object}
- * @default
- * @private
- */
- this._relaynodes = {
- stun : []
- };
-
- /**
- * @type {Object}
- * @default
- * @private
- */
- this._defer = {
- deferred : false,
- count : 0,
- fn : []
- };
- },
-
-
-
- /**
- * JSJSAC JINGLE STORAGE GETTERS
- */
-
- /**
- * Gets the connection object
- * @public
- * @returns {JSJaCConnection} Connection
- */
- get_connection: function() {
- return this._connection;
- },
-
- /**
- * Gets the sessions storage
- * @public
- * @returns {Object} Sessions
- */
- get_sessions: function() {
- return this._sessions;
- },
-
- /**
- * Gets the broadcast_ids storage
- * @public
- * @returns {Object} Broadcast ID medias
- */
- get_broadcast_ids: function(id) {
- if(id in this._broadcast_ids)
- return this._broadcast_ids[id];
-
- return null;
- },
-
- /**
- * Gets the Single initiate function
- * @public
- * @returns {Function} Single initiate
- */
- get_single_initiate: function() {
- if(typeof this._single_initiate == 'function')
- return this._single_initiate;
-
- return function(stanza) {};
- },
-
- /**
- * Gets the Single initiate raw value
- * @public
- * @returns {Function} Single initiate raw value
- */
- get_single_initiate_raw: function() {
- return this._single_initiate;
- },
-
- /**
- * Gets the Single propose function
- * @public
- * @returns {Function} Single propose
- */
- get_single_propose: function() {
- if(typeof this._single_propose == 'function')
- return this._single_propose;
-
- return function(stanza) {};
- },
-
- /**
- * Gets the Single retract function
- * @public
- * @returns {Function} Single retract
- */
- get_single_retract: function() {
- if(typeof this._single_retract == 'function')
- return this._single_retract;
-
- return function(stanza) {};
- },
-
- /**
- * Gets the Single accept function
- * @public
- * @returns {Function} Single accept
- */
- get_single_accept: function() {
- if(typeof this._single_accept == 'function')
- return this._single_accept;
-
- return function(stanza) {};
- },
-
- /**
- * Gets the Single reject function
- * @public
- * @returns {Function} Single reject
- */
- get_single_reject: function() {
- if(typeof this._single_reject == 'function')
- return this._single_reject;
-
- return function(stanza) {};
- },
-
- /**
- * Gets the Single proceed function
- * @public
- * @returns {Function} Single proceed
- */
- get_single_proceed: function() {
- if(typeof this._single_proceed == 'function')
- return this._single_proceed;
-
- return function(stanza) {};
- },
-
- /**
- * Gets the Muji invite function
- * @public
- * @returns {Function} Muji invite
- */
- get_muji_invite: function() {
- if(typeof this._muji_invite == 'function')
- return this._muji_invite;
-
- return function(stanza) {};
- },
-
- /**
- * Gets the Muji invite raw value
- * @public
- * @returns {Function} Muji invite raw value
- */
- get_muji_invite_raw: function() {
- return this._muji_invite;
- },
-
- /**
- * Gets the debug interface
- * @public
- * @returns {Object} Debug
- */
- get_debug: function() {
- return this._debug;
- },
-
- /**
- * Gets the extdisco storage
- * @public
- * @returns {Object} Extdisco
- */
- get_extdisco: function() {
- return this._extdisco;
- },
-
- /**
- * Gets the fallback storage
- * @public
- * @returns {Object} Fallback
- */
- get_fallback: function() {
- return this._fallback;
- },
-
- /**
- * Gets the relay nodes storage
- * @public
- * @returns {Object} Relay nodes
- */
- get_relaynodes: function() {
- return this._relaynodes;
- },
-
- /**
- * Gets the defer storage
- * @public
- * @returns {Object} Defer
- */
- get_defer: function() {
- return this._defer;
- },
-
-
-
- /**
- * JSJSAC JINGLE STORAGE SETTERS
- */
-
- /**
- * Sets the connection object
- * @public
- * @param {JSJaCConnection} Connection
- */
- set_connection: function(connection) {
- this._connection = connection;
- },
-
- /**
- * Sets the sessions storage
- * @public
- * @param {Object} sessions
- */
- set_sessions: function(sessions) {
- this._sessions = sessions;
- },
-
- /**
- * Sets the broadcast IDs storage
- * @public
- * @param {String} id
- * @param {Object} medias
- * @param {Boolean} [proceed_unset]
- */
- set_broadcast_ids: function(id, medias, proceed_unset) {
- this._broadcast_ids[id] = medias;
-
- if(proceed_unset === true && id in this._broadcast_ids)
- delete this._broadcast_ids[id];
- },
-
- /**
- * Sets the Single initiate function
- * @public
- * @param {Function} Single initiate
- */
- set_single_initiate: function(single_initiate) {
- this._single_initiate = single_initiate;
- },
-
- /**
- * Sets the Single propose function
- * @public
- * @param {Function} Single propose
- */
- set_single_propose: function(single_propose) {
- this._single_propose = single_propose;
- },
-
- /**
- * Sets the Single retract function
- * @public
- * @param {Function} Single retract
- */
- set_single_retract: function(single_retract) {
- this._single_retract = single_retract;
- },
-
- /**
- * Sets the Single accept function
- * @public
- * @param {Function} Single accept
- */
- set_single_accept: function(single_accept) {
- this._single_accept = single_accept;
- },
-
- /**
- * Sets the Single reject function
- * @public
- * @param {Function} Single reject
- */
- set_single_reject: function(single_reject) {
- this._single_reject = single_reject;
- },
-
- /**
- * Sets the Single proceed function
- * @public
- * @param {Function} Single proceed
- */
- set_single_proceed: function(single_proceed) {
- this._single_proceed = single_proceed;
- },
-
- /**
- * Sets the Muji invite function
- * @public
- * @param {Function} Muji invite
- */
- set_muji_invite: function(muji_invite) {
- this._muji_invite = muji_invite;
- },
-
- /**
- * Sets the debug interface
- * @public
- * @param {Object} Debug
- */
- set_debug: function(debug) {
- this._debug = debug;
- },
-
- /**
- * Sets the extdisco storage
- * @public
- * @param {Object} Extdisco
- */
- set_extdisco: function(extdisco) {
- this._extdisco = extdisco;
- },
-
- /**
- * Sets the fallback storage
- * @public
- * @param {Object} Fallback
- */
- set_fallback: function(fallback) {
- this._fallback = fallback;
- },
-
- /**
- * Sets the relay nodes storage
- * @public
- * @param {Object} Relay nodes
- */
- set_relaynodes: function(relaynodes) {
- this._relaynodes = relaynodes;
- },
-
- /**
- * Sets the defer storage
- * @public
- * @param {Object} Defer
- */
- set_defer: function(defer) {
- this._defer = defer;
- },
- }
-))();
-
-/**
- * @fileoverview JSJaC Jingle library - Utilities
- *
- * @url https://github.com/valeriansaliou/jsjac-jingle
- * @depends https://github.com/sstrigler/JSJaC
- * @author Valérian Saliou https://valeriansaliou.name/
- * @license Mozilla Public License v2.0 (MPL v2.0)
- */
-
-
-/** @module jsjac-jingle/utils */
-/** @exports JSJaCJingleUtils */
-
-
-/**
- * Utilities class.
- * @class
- * @classdesc Utilities class.
- * @param {JSJaCJingleSingle|JSJaCJingleMuji} parent Parent class.
- * @requires nicolas-van/ring.js
- * @requires sstrigler/JSJaC
- * @see {@link http://ringjs.neoname.eu/|Ring.js}
- * @see {@link http://stefan-strigler.de/jsjac-1.3.4/doc/|JSJaC Documentation}
- */
-var JSJaCJingleUtils = ring.create(
- /** @lends JSJaCJingleUtils.prototype */
- {
- /**
- * Constructor
- */
- constructor: function(parent) {
- /**
- * @constant
- * @member {JSJaCJingleSingle|JSJaCJingleMuji}
- * @readonly
- * @default
- * @public
- */
- this.parent = parent;
- },
-
- /**
- * Removes a given array value
- * @public
- * @param {Array} array
- * @param {*} value
- * @returns {Array} New array
- */
- array_remove_value: function(array, value) {
- try {
- var i;
-
- for(i = 0; i < array.length; i++) {
- if(array[i] === value) {
- array.splice(i, 1); i--;
- }
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] array_remove_value > ' + e, 1);
- }
-
- return array;
- },
-
- /**
- * Returns whether an object is empty or not
- * @public
- * @param {Object} object
- * @returns {Number} Object length
- */
- object_length: function(object) {
- var key;
- var l = 0;
-
- try {
- for(key in object) {
- if(object.hasOwnProperty(key)) l++;
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] object_length > ' + e, 1);
- }
-
- return l;
- },
-
- /**
- * Returns whether given objects are equal or not
- * @public
- * @param {...Object} arguments - Objects to be compared
- * @returns {Boolean} Equality
- */
- object_equal: function() {
- var equal = true,
- last_value = null;
-
- if(arguments.length >= 1) {
- for(var i = 0; i < arguments.length; i++) {
- if(i > 0) {
- equal = (JSON.stringify(last_value) === JSON.stringify(arguments[i]));
- if(equal !== true) break;
- }
-
- last_value = arguments[i];
- }
- } else {
- equal = false;
- }
-
- return equal;
- },
-
- /**
- * Collects given objects
- * @public
- * @param {...Object} arguments - Objects to be collected
- * @returns {Object} Collected object
- */
- object_collect: function() {
- var i, p;
-
- var collect_obj = {};
-
- for(i = 0; i < arguments.length; i++) {
- for(p in arguments[i]) {
- if(arguments[i].hasOwnProperty(p))
- collect_obj[p] = arguments[i][p];
- }
- }
-
- return collect_obj;
- },
-
- /**
- * Collects given arrays
- * @public
- * @param {...Array} arguments - Arrays to be collected
- * @returns {Array} Collected array
- */
- array_collect: function() {
- var i, j, p,
- cur_arr;
-
- var collect_arr = [];
-
- for(i = 0; i < arguments.length; i++) {
- cur_arr = arguments[i];
-
- loop_arr: for(j = 0; j < cur_arr.length; j++) {
- // Ensure uniqueness of object
- for(p in collect_arr) {
- if(this.object_equal(cur_arr[j], collect_arr[p])) continue loop_arr;
- }
-
- collect_arr.push(cur_arr[j]);
- }
- }
-
- return collect_arr;
- },
-
- /**
- * Clones a given object
- * @public
- * @param {Object} object
- * @returns {Date|Array|Object} Cloned object
- */
- object_clone: function(object) {
- try {
- var copy, i, attr;
-
- // Assert
- if(object === null || typeof object !== 'object') return object;
-
- // Handle Date
- if(object instanceof Date) {
- copy = new Date();
- copy.setTime(object.getTime());
-
- return copy;
- }
-
- // Handle Array
- if(object instanceof Array) {
- copy = [];
-
- for(i = 0, len = object.length; i < len; i++)
- copy[i] = this.object_clone(object[i]);
-
- return copy;
- }
-
- // Handle Object
- if(object instanceof Object) {
- copy = {};
-
- for(attr in object) {
- if(object.hasOwnProperty(attr))
- copy[attr] = this.object_clone(object[attr]);
- }
-
- return copy;
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] object_clone > ' + e, 1);
- }
-
- this.parent.get_debug().log('[JSJaCJingle:utils] object_clone > Cannot clone this object.', 1);
- },
-
- /**
- * Gets the browser info
- * @public
- * @returns {Object} Browser info
- */
- browser: function() {
- var browser_info = {
- name : 'Generic'
- };
-
- try {
- var user_agent, detect_arr, cur_browser;
-
- detect_arr = {
- 'firefox' : JSJAC_JINGLE_BROWSER_FIREFOX,
- 'chrome' : JSJAC_JINGLE_BROWSER_CHROME,
- 'safari' : JSJAC_JINGLE_BROWSER_SAFARI,
- 'opera' : JSJAC_JINGLE_BROWSER_OPERA,
- 'msie' : JSJAC_JINGLE_BROWSER_IE
- };
-
- user_agent = navigator.userAgent.toLowerCase();
-
- for(cur_browser in detect_arr) {
- if(user_agent.indexOf(cur_browser) > -1) {
- browser_info.name = detect_arr[cur_browser];
- break;
- }
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] browser > ' + e, 1);
- }
-
- return browser_info;
- },
-
- /**
- * Gets the ICE config
- * @public
- * @returns {Object} ICE config
- */
- config_ice: function() {
- try {
- // Collect data (user + server)
- var stun_config = this.array_collect(
- this.parent.get_stun(),
- JSJaCJingleStorage.get_extdisco().stun,
- JSJaCJingleStorage.get_relaynodes().stun,
- JSJaCJingleStorage.get_fallback().stun
- );
-
- var turn_config = this.array_collect(
- this.parent.get_turn(),
- JSJaCJingleStorage.get_extdisco().turn,
- JSJaCJingleStorage.get_fallback().turn
- );
-
- // Can proceed?
- if(stun_config.length || turn_config.length) {
- var config = {
- iceServers : []
- };
-
- // STUN servers
- var i, cur_stun_obj, cur_stun_config;
-
- for(i in stun_config) {
- cur_stun_obj = stun_config[i];
-
- cur_stun_config = {};
- cur_stun_config.url = 'stun:' + cur_stun_obj.host;
-
- if(cur_stun_obj.port)
- cur_stun_config.url += ':' + cur_stun_obj.port;
-
- if(cur_stun_obj.transport && this.browser().name != JSJAC_JINGLE_BROWSER_FIREFOX)
- cur_stun_config.url += '?transport=' + cur_stun_obj.transport;
-
- (config.iceServers).push(cur_stun_config);
- }
-
- // TURN servers
- var j, cur_turn_obj, cur_turn_config;
-
- for(j in turn_config) {
- cur_turn_obj = turn_config[j];
-
- cur_turn_config = {};
- cur_turn_config.url = 'turn:' + cur_turn_obj.host;
-
- if(cur_turn_obj.port)
- cur_turn_config.url += ':' + cur_turn_obj.port;
-
- if(cur_turn_obj.transport)
- cur_turn_config.url += '?transport=' + cur_turn_obj.transport;
-
- if(cur_turn_obj.username)
- cur_turn_config.username = cur_turn_obj.username;
-
- if(cur_turn_obj.password)
- cur_turn_config.password = cur_turn_obj.password;
-
- (config.iceServers).push(cur_turn_config);
- }
-
- // Check we have at least a STUN server (if user can traverse NAT)
- var k;
- var has_stun = false;
-
- for(k in config.iceServers) {
- if((config.iceServers[k].url).match(R_NETWORK_PROTOCOLS.stun)) {
- has_stun = true; break;
- }
- }
-
- if(!has_stun) {
- (config.iceServers).push({
- url: (WEBRTC_CONFIGURATION.peer_connection.config.iceServers)[0].url
- });
- }
-
- return config;
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] config_ice > ' + e, 1);
- }
-
- return WEBRTC_CONFIGURATION.peer_connection.config;
- },
-
- /**
- * Gets the node value from a stanza element
- * @public
- * @param {DOM} stanza
- * @returns {String|Object} Node value
- */
- stanza_get_value: function(stanza) {
- try {
- return stanza.firstChild.nodeValue || null;
- } catch(e) {
- try {
- return (stanza[0]).firstChild.nodeValue || null;
- } catch(_e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_get_value > ' + _e, 1);
- }
- }
-
- return null;
- },
-
- /**
- * Gets the attribute value from a stanza element
- * @public
- * @param {DOM} stanza
- * @param {String} name
- * @returns {String|Object} Attribute value
- */
- stanza_get_attribute: function(stanza, name) {
- if(!name) return null;
-
- try {
- return stanza.getAttribute(name) || null;
- } catch(e) {
- try {
- return (stanza[0]).getAttribute(name) || null;
- } catch(_e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_get_attribute > ' + _e, 1);
- }
- }
-
- return null;
- },
-
- /**
- * Sets the attribute value to a stanza element
- * @public
- * @param {DOM} stanza
- * @param {String} name
- * @param {*} value
- */
- stanza_set_attribute: function(stanza, name, value) {
- if(!(name && value && stanza)) return;
-
- try {
- stanza.setAttribute(name, value);
- } catch(e) {
- try {
- (stanza[0]).setAttribute(name, value);
- } catch(_e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_set_attribute > ' + _e, 1);
- }
- }
- },
-
- /**
- * Gets the Jingle node from a stanza
- * @public
- * @param {DOM} stanza
- * @param {String} name
- * @param {String} [ns]
- * @returns {DOM} Selected DOM elements
- */
- stanza_get_element: function(stanza, name, ns) {
- var matches_result = [];
-
- // Assert
- if(!stanza) return matches_result;
- if(stanza.length) stanza = stanza[0];
-
- ns = (ns || '*');
-
- try {
- var i;
-
- // Get only in lower level (not all sub-levels)
- var matches = stanza.getElementsByTagNameNS(ns, name);
-
- if(matches && matches.length) {
- for(i = 0; i < matches.length; i++) {
- if(matches[i] && matches[i].parentNode == stanza)
- matches_result.push(matches[i]);
- }
- }
-
- return matches_result;
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_get_element > ' + e, 1);
- }
-
- return matches_result;
- },
-
- /**
- * Gets the error node from a stanza
- * @private
- * @param {JSJaCPacket} stanza
- * @param {Object} [error_match_obj]
- * @returns {Boolean} Password invalid state
- */
- stanza_get_error: function(stanza, error_match_obj) {
- var matches_result = [];
-
- try {
- var i,
- error_child, cur_error_child;
-
- error_child = stanza.getChild('error', NS_CLIENT);
-
- if(error_child && error_child.length) {
- for(i = 0; i < error_child.length; i++) {
- cur_error_child = error_child[i];
-
- if(typeof error_match_obj == 'object') {
- if(cur_error_child.getAttribute('type') === error_match_obj.type &&
- cur_error_child.getChild(error_match_obj.xmpp, NS_IETF_XMPP_STANZAS)) {
- matches_result.push(cur_error_child);
- }
- } else {
- matches_result.push(cur_error_child);
- }
- }
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:utils] stanza_get_error > ' + e, 1);
- }
-
- return matches_result;
- },
-
- /**
- * Gets the Jingle node from a stanza
- * @public
- * @param {JSJaCPacket} stanza
- * @returns {DOM|Object} Jingle node
- */
- stanza_jingle: function(stanza) {
- try {
- return stanza.getChild('jingle', this.parent.get_namespace());
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_jingle > ' + e, 1);
- }
-
- return null;
- },
-
- /**
- * Gets the Jingle Muji node from a stanza
- * @public
- * @param {JSJaCPacket} stanza
- * @returns {DOM|Object} Jingle node
- */
- stanza_muji: function(stanza) {
- try {
- return stanza.getChild('muji', NS_MUJI);
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_muji > ' + e, 1);
- }
-
- return null;
- },
-
- /**
- * Gets the from value from a stanza
- * @public
- * @param {JSJaCPacket} stanza
- * @returns {String|Object} From value
- */
- stanza_from: function(stanza) {
- try {
- return stanza.getFrom() || null;
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_from > ' + e, 1);
- }
-
- return null;
- },
-
- /**
- * Extracts username from stanza
- * @public
- * @param {JSJaCPacket} stanza
- * @returns {String|Object} Username
- */
- stanza_username: function(stanza) {
- try {
- return this.extract_username(stanza.getFrom());
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_username > ' + e, 1);
- }
-
- return null;
- },
-
- /**
- * Gets the SID value from a stanza
- * @public
- * @param {JSJaCPacket} stanza
- * @returns {String|Object} SID value
- */
- stanza_sid: function(stanza) {
- try {
- return this.stanza_get_attribute(
- this.stanza_jingle(stanza),
- 'sid'
- );
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_sid > ' + e, 1);
- }
- },
-
- /**
- * Checks if a stanza is safe (known SID + sender)
- * @public
- * @param {JSJaCPacket} stanza
- * @returns {Boolean} Safety state
- */
- stanza_safe: function(stanza) {
- try {
- return !((stanza.getType() == JSJAC_JINGLE_IQ_TYPE_SET && this.stanza_sid(stanza) != this.parent.get_sid()) || this.stanza_from(stanza) != this.parent.get_to());
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_safe > ' + e, 1);
- }
-
- return false;
- },
-
- /**
- * Gets a stanza terminate reason
- * @public
- * @param {JSJaCPacket} stanza
- * @returns {String|Object} Reason code
- */
- stanza_terminate_reason: function(stanza) {
- try {
- var jingle = this.stanza_jingle(stanza);
-
- if(jingle) {
- var reason = this.stanza_get_element(jingle, 'reason', this.parent.get_namespace());
-
- if(reason.length) {
- var cur_reason;
-
- for(cur_reason in JSJAC_JINGLE_REASONS) {
- if(this.stanza_get_element(reason[0], cur_reason, this.parent.get_namespace()).length)
- return cur_reason;
- }
- }
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_terminate_reason > ' + e, 1);
- }
-
- return null;
- },
-
- /**
- * Gets a stanza session info
- * @public
- * @param {JSJaCPacket} stanza
- * @returns {String|Object} Info code
- */
- stanza_session_info: function(stanza) {
- try {
- var jingle = this.stanza_jingle(stanza);
-
- if(jingle) {
- var cur_info;
-
- for(cur_info in JSJAC_JINGLE_SESSION_INFOS) {
- if(this.stanza_get_element(jingle, cur_info, NS_JINGLE_APPS_RTP_INFO).length)
- return cur_info;
- }
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_session_info > ' + e, 1);
- }
-
- return null;
- },
-
- /**
- * Set a timeout limit to a stanza
- * @public
- * @param {String} t_type
- * @param {String} t_id
- * @param {Object} [handlers]
- */
- stanza_timeout: function(t_node, t_type, t_id, handlers) {
- try {
- var t_sid = this.parent.get_sid();
- var t_status = this.parent.get_status();
-
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_timeout > Registered (node: ' + t_node + ', type: ' + t_type + ', id: ' + t_id + ', status: ' + t_status + ').', 4);
-
- var _this = this;
-
- setTimeout(function() {
- _this.parent.get_debug().log('[JSJaCJingle:utils] stanza_timeout > Cheking (node: ' + t_node + ', type: ' + t_type + ', id: ' + t_id + ', status: ' + t_status + '-' + _this.parent.get_status() + ').', 4);
-
- // State did not change?
- if(_this.parent.get_sid() == t_sid && _this.parent.get_status() == t_status && !(t_id in _this.parent.get_received_id())) {
- _this.parent.get_debug().log('[JSJaCJingle:utils] stanza_timeout > Stanza timeout.', 2);
-
- _this.parent.unregister_handler(t_node, t_type, t_id);
-
- if(typeof handlers == 'object') {
- if(handlers.external) (handlers.external)(_this);
- if(handlers.internal) (handlers.internal)();
- }
- } else {
- _this.parent.get_debug().log('[JSJaCJingle:utils] stanza_timeout > Stanza successful.', 4);
- }
- }, (JSJAC_JINGLE_STANZA_TIMEOUT * 1000));
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_timeout > ' + e, 1);
- }
- },
-
- /**
- * Parses stanza node
- * @public
- * @param {DOM} parent
- * @param {String} name
- * @param {String} ns
- * @param {Object} obj
- * @param {Array} attrs
- * @param {Object} [value]
- */
- stanza_parse_node: function(parent, name, ns, obj, attrs, value) {
- try {
- var i, j,
- error, child, child_arr;
- var children = this.stanza_get_element(parent, name, ns);
-
- if(children.length) {
- for(i = 0; i < children.length; i++) {
- // Initialize
- error = 0;
- child = children[i];
- child_arr = {};
-
- // Parse attributes
- for(j in attrs) {
- child_arr[attrs[j].n] = this.stanza_get_attribute(child, attrs[j].n);
-
- if(attrs[j].r && !child_arr[attrs[j].n]) {
- error++; break;
- }
- }
-
- // Parse value
- if(value) {
- child_arr[value.n] = this.stanza_get_value(child);
- if(value.r && !child_arr[value.n]) error++;
- }
-
- if(error !== 0) continue;
-
- // Push current children
- obj.push(child_arr);
- }
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_parse_node > ' + e, 1);
- }
- },
-
- /**
- * Parses stanza content
- * @public
- * @param {JSJaCPacket} stanza
- * @returns {Boolean} Success
- */
- stanza_parse_content: function(stanza) {
- try {
- var i,
- jingle, namespace, content, cur_content,
- content_creator, content_name, content_senders,
- cur_candidates;
-
- // Parse initiate stanza
- switch(stanza.name) {
- case JSJAC_JINGLE_STANZA_IQ:
- // Jingle elements are encapsulated into IQs
- jingle = this.stanza_jingle(stanza); break;
-
- case JSJAC_JINGLE_STANZA_PRESENCE:
- // Muji elements are encapsulated into Presences
- jingle = this.stanza_muji(stanza); break;
-
- default:
- throw 'Stanza is not Jingle, nor Muji.';
- }
-
- if(jingle) {
- // Childs
- content = this.stanza_get_element(jingle, 'content', this.parent.get_namespace());
-
- if(content && content.length) {
- for(i = 0; i < content.length; i++) {
- cur_content = content[i];
-
- // Attrs (avoids senders & creators to be changed later in the flow)
- content_name = this.stanza_get_attribute(cur_content, 'name');
- content_senders = this.parent.get_senders(content_name) || this.stanza_get_attribute(cur_content, 'senders');
- content_creator = this.parent.get_creator(content_name) || this.stanza_get_attribute(cur_content, 'creator');
-
- this.parent._set_name(content_name);
- this.parent._set_senders(content_name, content_senders);
- this.parent._set_creator(content_name, content_creator);
-
- // Payloads (non-destructive setters / cumulative)
- this.parent._set_payloads_remote_add(
- content_name,
- this.stanza_parse_payload(cur_content)
- );
-
- // Candidates (enqueue them for ICE processing, too)
- cur_candidate = this.stanza_parse_candidate(cur_content);
-
- this.parent._set_candidates_remote_add(
- content_name,
- cur_candidate
- );
-
- this.parent._set_candidates_queue_remote(
- content_name,
- cur_candidate
- );
- }
-
- return true;
- }
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_parse_content > ' + e, 1);
- }
-
- return false;
- },
-
- /**
- * Parses stanza group
- * @public
- * @param {JSJaCPacket} stanza
- * @returns {Boolean} Success
- */
- stanza_parse_group: function(stanza) {
- try {
- var i, j,
- jingle,
- group, cur_group,
- content, cur_content, group_content_names;
-
- // Parse initiate stanza
- jingle = this.stanza_jingle(stanza);
-
- if(jingle) {
- // Childs
- group = this.stanza_get_element(jingle, 'group', NS_JINGLE_APPS_GROUPING);
-
- if(group && group.length) {
- for(i = 0; i < group.length; i++) {
- cur_group = group[i];
- group_content_names = [];
-
- // Attrs
- group_semantics = this.stanza_get_attribute(cur_group, 'semantics');
-
- // Contents
- content = this.stanza_get_element(cur_group, 'content', NS_JINGLE_APPS_GROUPING);
-
- for(j = 0; j < content.length; j++) {
- cur_content = content[j];
-
- // Content attrs
- group_content_names.push(
- this.stanza_get_attribute(cur_content, 'name')
- );
- }
-
- // Payloads (non-destructive setters / cumulative)
- this.parent._set_group_remote(
- group_semantics,
- group_content_names
- );
- }
- }
- }
-
- return true;
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_parse_group > ' + e, 1);
- }
-
- return false;
- },
-
- /**
- * Parses stanza payload
- * @public
- * @param {DOM} stanza_content
- * @returns {Object} Payload object
- */
- stanza_parse_payload: function(stanza_content) {
- var payload_obj = {
- descriptions : {},
- transports : {}
- };
-
- try {
- // Common vars
- var j, k, l, error,
- cur_ssrc, cur_ssrc_id,
- cur_ssrc_group, cur_ssrc_group_semantics,
- cur_payload, cur_payload_arr, cur_payload_id;
-
- // Common functions
- var init_content = function() {
- var ic_key;
- var ic_arr = {
- 'attrs' : {},
- 'rtcp-fb' : [],
- 'bandwidth' : [],
- 'payload' : {},
- 'rtp-hdrext' : [],
- 'rtcp-mux' : 0,
-
- 'encryption' : {
- 'attrs' : {},
- 'crypto' : [],
- 'zrtp-hash' : []
- },
-
- 'ssrc': {},
- 'ssrc-group': {}
- };
-
- for(ic_key in ic_arr)
- if(!(ic_key in payload_obj.descriptions)) payload_obj.descriptions[ic_key] = ic_arr[ic_key];
- };
-
- var init_payload = function(id) {
- var ip_key;
- var ip_arr = {
- 'attrs' : {},
- 'parameter' : [],
- 'rtcp-fb' : [],
- 'rtcp-fb-trr-int' : []
- };
-
- if(!(id in payload_obj.descriptions.payload)) payload_obj.descriptions.payload[id] = {};
-
- for(ip_key in ip_arr)
- if(!(ip_key in payload_obj.descriptions.payload[id])) payload_obj.descriptions.payload[id][ip_key] = ip_arr[ip_key];
- };
-
- var init_ssrc_group_semantics = function(semantics) {
- if(typeof payload_obj.descriptions['ssrc-group'][semantics] != 'object')
- payload_obj.descriptions['ssrc-group'][semantics] = [];
- };
-
- // Parse session description
- var description = this.stanza_get_element(stanza_content, 'description', NS_JINGLE_APPS_RTP);
-
- if(description.length) {
- description = description[0];
-
- var cd_media = this.stanza_get_attribute(description, 'media');
- var cd_ssrc = this.stanza_get_attribute(description, 'ssrc');
-
- if(!cd_media)
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_parse_payload > No media attribute to ' + cc_name + ' stanza.', 1);
-
- // Initialize current description
- init_content();
-
- payload_obj.descriptions.attrs.media = cd_media;
- payload_obj.descriptions.attrs.ssrc = cd_ssrc;
-
- // Loop on multiple payloads
- var payload = this.stanza_get_element(description, 'payload-type', NS_JINGLE_APPS_RTP);
-
- if(payload.length) {
- for(j = 0; j < payload.length; j++) {
- error = 0;
- cur_payload = payload[j];
- cur_payload_arr = {};
-
- cur_payload_arr.channels = this.stanza_get_attribute(cur_payload, 'channels');
- cur_payload_arr.clockrate = this.stanza_get_attribute(cur_payload, 'clockrate');
- cur_payload_arr.id = this.stanza_get_attribute(cur_payload, 'id') || error++;
- cur_payload_arr.name = this.stanza_get_attribute(cur_payload, 'name');
-
- payload_obj.descriptions.attrs.ptime = this.stanza_get_attribute(cur_payload, 'ptime');
- payload_obj.descriptions.attrs.maxptime = this.stanza_get_attribute(cur_payload, 'maxptime');
-
- if(error !== 0) continue;
-
- // Initialize current payload
- cur_payload_id = cur_payload_arr.id;
- init_payload(cur_payload_id);
-
- // Push current payload
- payload_obj.descriptions.payload[cur_payload_id].attrs = cur_payload_arr;
-
- // Loop on multiple parameters
- this.stanza_parse_node(
- cur_payload,
- 'parameter',
- NS_JINGLE_APPS_RTP,
- payload_obj.descriptions.payload[cur_payload_id].parameter,
- [ { n: 'name', r: 1 }, { n: 'value', r: 0 } ]
- );
-
- // Loop on multiple RTCP-FB
- this.stanza_parse_node(
- cur_payload,
- 'rtcp-fb',
- NS_JINGLE_APPS_RTP_RTCP_FB,
- payload_obj.descriptions.payload[cur_payload_id]['rtcp-fb'],
- [ { n: 'type', r: 1 }, { n: 'subtype', r: 0 } ]
- );
-
- // Loop on multiple RTCP-FB-TRR-INT
- this.stanza_parse_node(
- cur_payload,
- 'rtcp-fb-trr-int',
- NS_JINGLE_APPS_RTP_RTCP_FB,
- payload_obj.descriptions.payload[cur_payload_id]['rtcp-fb-trr-int'],
- [ { n: 'value', r: 1 } ]
- );
- }
- }
-
- // Parse the encryption element
- var encryption = this.stanza_get_element(description, 'encryption', NS_JINGLE_APPS_RTP);
-
- if(encryption.length) {
- encryption = encryption[0];
-
- payload_obj.descriptions.encryption.attrs.required = this.stanza_get_attribute(encryption, 'required') || '0';
-
- // Loop on multiple cryptos
- this.stanza_parse_node(
- encryption,
- 'crypto',
- NS_JINGLE_APPS_RTP,
- payload_obj.descriptions.encryption.crypto,
- [ { n: 'crypto-suite', r: 1 }, { n: 'key-params', r: 1 }, { n: 'session-params', r: 0 }, { n: 'tag', r: 1 } ]
- );
-
- // Loop on multiple zrtp-hash
- this.stanza_parse_node(
- encryption,
- 'zrtp-hash',
- NS_JINGLE_APPS_RTP_ZRTP,
- payload_obj.descriptions.encryption['zrtp-hash'],
- [ { n: 'version', r: 1 } ],
- { n: 'value', r: 1 }
- );
- }
-
- // Parse the SSRC-GROUP elements
- var ssrc_group = this.stanza_get_element(description, 'ssrc-group', NS_JINGLE_APPS_RTP_SSMA);
-
- if(ssrc_group && ssrc_group.length) {
- for(k = 0; k < ssrc_group.length; k++) {
- cur_ssrc_group = ssrc_group[k];
- cur_ssrc_group_semantics = this.stanza_get_attribute(cur_ssrc_group, 'semantics') || null;
-
- if(cur_ssrc_group_semantics !== null) {
- cur_ssrc_group_semantics_obj = {
- 'sources': []
- };
-
- init_ssrc_group_semantics(cur_ssrc_group_semantics);
-
- this.stanza_parse_node(
- cur_ssrc_group,
- 'source',
- NS_JINGLE_APPS_RTP_SSMA,
- cur_ssrc_group_semantics_obj.sources,
- [ { n: 'ssrc', r: 1 } ]
- );
-
- payload_obj.descriptions['ssrc-group'][cur_ssrc_group_semantics].push(cur_ssrc_group_semantics_obj);
- }
- }
- }
-
- // Parse the SSRC (source) elements
- var ssrc = this.stanza_get_element(description, 'source', NS_JINGLE_APPS_RTP_SSMA);
-
- if(ssrc && ssrc.length) {
- for(l = 0; l < ssrc.length; l++) {
- cur_ssrc = ssrc[l];
- cur_ssrc_id = this.stanza_get_attribute(cur_ssrc, 'ssrc') || null;
-
- if(cur_ssrc_id !== null) {
- payload_obj.descriptions.ssrc[cur_ssrc_id] = [];
-
- this.stanza_parse_node(
- cur_ssrc,
- 'parameter',
- NS_JINGLE_APPS_RTP_SSMA,
- payload_obj.descriptions.ssrc[cur_ssrc_id],
- [ { n: 'name', r: 1 }, { n: 'value', r: 0 } ]
- );
- }
- }
- }
-
- // Loop on common RTCP-FB
- this.stanza_parse_node(
- description,
- 'rtcp-fb',
- NS_JINGLE_APPS_RTP_RTCP_FB,
- payload_obj.descriptions['rtcp-fb'],
- [ { n: 'type', r: 1 }, { n: 'subtype', r: 0 } ]
- );
-
- // Loop on bandwidth
- this.stanza_parse_node(
- description,
- 'bandwidth',
- NS_JINGLE_APPS_RTP,
- payload_obj.descriptions.bandwidth,
- [ { n: 'type', r: 1 } ],
- { n: 'value', r: 1 }
- );
-
- // Parse the RTP-HDREXT element
- this.stanza_parse_node(
- description,
- 'rtp-hdrext',
- NS_JINGLE_APPS_RTP_RTP_HDREXT,
- payload_obj.descriptions['rtp-hdrext'],
- [ { n: 'id', r: 1 }, { n: 'uri', r: 1 }, { n: 'senders', r: 0 } ]
- );
-
- // Parse the RTCP-MUX element
- var rtcp_mux = this.stanza_get_element(description, 'rtcp-mux', NS_JINGLE_APPS_RTP);
-
- if(rtcp_mux.length) {
- payload_obj.descriptions['rtcp-mux'] = 1;
- }
- }
-
- // Parse transport (need to get 'ufrag' and 'pwd' there)
- var transport = this.stanza_get_element(stanza_content, 'transport', NS_JINGLE_TRANSPORTS_ICEUDP);
-
- if(transport.length) {
- payload_obj.transports.pwd = this.stanza_get_attribute(transport, 'pwd');
- payload_obj.transports.ufrag = this.stanza_get_attribute(transport, 'ufrag');
-
- var fingerprint = this.stanza_get_element(transport, 'fingerprint', NS_JINGLE_APPS_DTLS);
-
- if(fingerprint.length) {
- payload_obj.transports.fingerprint = {};
- payload_obj.transports.fingerprint.setup = this.stanza_get_attribute(fingerprint, 'setup');
- payload_obj.transports.fingerprint.hash = this.stanza_get_attribute(fingerprint, 'hash');
- payload_obj.transports.fingerprint.value = this.stanza_get_value(fingerprint);
- }
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_parse_payload > ' + e, 1);
- }
-
- return payload_obj;
- },
-
- /**
- * Parses stanza candidate
- * @public
- * @param {Array} Candidates array
- */
- stanza_parse_candidate: function(stanza_content) {
- var candidate_arr = [];
-
- try {
- var _this = this;
-
- var fn_parse_transport = function(namespace, parse_obj) {
- var transport = _this.stanza_get_element(stanza_content, 'transport', namespace);
-
- if(transport.length) {
- _this.stanza_parse_node(
- transport,
- 'candidate',
- namespace,
- candidate_arr,
- parse_obj
- );
- }
- };
-
- // Parse ICE-UDP transport candidates
- fn_parse_transport(
- NS_JINGLE_TRANSPORTS_ICEUDP,
- JSJAC_JINGLE_SDP_CANDIDATE_MAP_ICEUDP
- );
-
- // Parse RAW-UDP transport candidates
- fn_parse_transport(
- NS_JINGLE_TRANSPORTS_RAWUDP,
- JSJAC_JINGLE_SDP_CANDIDATE_MAP_RAWUDP
- );
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_parse_candidate > ' + e, 1);
- }
-
- return candidate_arr;
- },
-
- /*
- * Builds stanza node
- * @param {JSJaCPacket} doc
- * @param {DOM} parent
- * @param {Array} children
- * @param {String} name
- * @param {String} ns
- * @param {String} [value]
- * @returns {DOM} Built node
- */
- stanza_build_node: function(doc, parent, children, name, ns, value) {
- var node = null;
-
- try {
- var i, child, attr;
-
- if(children && children.length) {
- for(i in children) {
- child = children[i];
-
- if(!child) continue;
-
- node = parent.appendChild(doc.buildNode(
- name,
- { 'xmlns': ns },
- (value && child[value]) ? child[value] : null
- ));
-
- for(attr in child)
- if(attr != value) this.stanza_set_attribute(node, attr, child[attr]);
- }
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_build_node > name: ' + name + ' > ' + e, 1);
- }
-
- return node;
- },
-
- /**
- * Generates stanza Jingle node
- * @public
- * @param {JSJaCPacket} stanza
- * @param {Object} attrs
- * @returns {DOM} Jingle node
- */
- stanza_generate_jingle: function(stanza, attrs) {
- var jingle = null;
-
- try {
- var cur_attr;
-
- jingle = stanza.getNode().appendChild(stanza.buildNode('jingle', { 'xmlns': this.parent.get_namespace() }));
-
- if(!attrs.sid) attrs.sid = this.parent.get_sid();
-
- for(cur_attr in attrs) this.stanza_set_attribute(jingle, cur_attr, attrs[cur_attr]);
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_generate_jingle > ' + e, 1);
- }
-
- return jingle;
- },
-
- /**
- * Generates stanza Muji node
- * @public
- * @param {JSJaCPacket} stanza
- * @returns {DOM} Muji node
- */
- stanza_generate_muji: function(stanza) {
- var muji = null;
-
- try {
- muji = stanza.getNode().appendChild(stanza.buildNode('muji', { 'xmlns': NS_MUJI }));
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_generate_muji > ' + e, 1);
- }
-
- return muji;
- },
-
- /**
- * Generates stanza session info
- * @public
- * @param {JSJaCPacket} stanza
- * @param {DOM} jingle
- * @param {Object} args
- */
- stanza_generate_session_info: function(stanza, jingle, args) {
- try {
- var info = jingle.appendChild(stanza.buildNode(args.info, { 'xmlns': NS_JINGLE_APPS_RTP_INFO }));
-
- // Info attributes
- switch(args.info) {
- case JSJAC_JINGLE_SESSION_INFO_MUTE:
- case JSJAC_JINGLE_SESSION_INFO_UNMUTE:
- this.stanza_set_attribute(info, 'creator', this.parent.get_creator_this());
- this.stanza_set_attribute(info, 'name', args.name);
-
- break;
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_generate_session_info > ' + e, 1);
- }
- },
-
- /**
- * Generates stanza local content
- * @public
- * @param {JSJaCPacket} stanza
- * @param {DOM} jingle
- * @param {Boolean} has_transport
- * @param {Object} [override_content]
- */
- stanza_generate_content_local: function(stanza, jingle, has_transport, override_content) {
- try {
- var cur_media;
- var content_local = override_content ? override_content : this.parent.get_content_local();
-
- var _this = this;
-
- var fn_build_transport = function(content, transport_obj, namespace) {
- var transport = _this.stanza_build_node(
- stanza,
- content,
- [transport_obj.attrs],
- 'transport',
- namespace
- );
-
- // Fingerprint
- _this.stanza_build_node(
- stanza,
- transport,
- [transport_obj.fingerprint],
- 'fingerprint',
- NS_JINGLE_APPS_DTLS,
- 'value'
- );
-
- // Candidates
- _this.stanza_build_node(
- stanza,
- transport,
- transport_obj.candidate,
- 'candidate',
- namespace
- );
- };
-
- for(cur_media in content_local) {
- var cur_content = content_local[cur_media];
-
- var content = jingle.appendChild(stanza.buildNode('content', { 'xmlns': this.parent.get_namespace() }));
-
- this.stanza_set_attribute(content, 'creator', cur_content.creator);
- this.stanza_set_attribute(content, 'name', cur_content.name);
- this.stanza_set_attribute(content, 'senders', cur_content.senders);
-
- // Build description (if action type allows that element)
- if(this.stanza_get_attribute(jingle, 'action') != JSJAC_JINGLE_ACTION_TRANSPORT_INFO) {
- var cs_description = cur_content.description;
- var cs_d_attrs = cs_description.attrs;
- var cs_d_rtcp_fb = cs_description['rtcp-fb'];
- var cs_d_bandwidth = cs_description.bandwidth;
- var cs_d_payload = cs_description.payload;
- var cs_d_encryption = cs_description.encryption;
- var cs_d_ssrc = cs_description.ssrc;
- var cs_d_ssrc_group = cs_description['ssrc-group'];
- var cs_d_rtp_hdrext = cs_description['rtp-hdrext'];
- var cs_d_rtcp_mux = cs_description['rtcp-mux'];
-
- var description = this.stanza_build_node(
- stanza, content,
- [cs_d_attrs],
- 'description',
- NS_JINGLE_APPS_RTP
- );
-
- // Payload-type
- if(cs_d_payload) {
- var i, j,
- cur_ssrc_id,
- cur_cs_d_ssrc_group_semantics, cur_cs_d_ssrc_group_semantics_sub,
- cs_d_p, payload_type;
-
- for(i in cs_d_payload) {
- cs_d_p = cs_d_payload[i];
-
- payload_type = this.stanza_build_node(
- stanza,
- description,
- [cs_d_p.attrs],
- 'payload-type',
- NS_JINGLE_APPS_RTP
- );
-
- // Parameter
- this.stanza_build_node(
- stanza,
- payload_type,
- cs_d_p.parameter,
- 'parameter',
- NS_JINGLE_APPS_RTP
- );
-
- // RTCP-FB (sub)
- this.stanza_build_node(
- stanza,
- payload_type,
- cs_d_p['rtcp-fb'],
- 'rtcp-fb',
- NS_JINGLE_APPS_RTP_RTCP_FB
- );
-
- // RTCP-FB-TRR-INT
- this.stanza_build_node(
- stanza,
- payload_type,
- cs_d_p['rtcp-fb-trr-int'],
- 'rtcp-fb-trr-int',
- NS_JINGLE_APPS_RTP_RTCP_FB
- );
- }
-
- // SSRC-GROUP
- if(cs_d_ssrc_group) {
- for(cur_cs_d_ssrc_group_semantics in cs_d_ssrc_group) {
- for(j in cs_d_ssrc_group[cur_cs_d_ssrc_group_semantics]) {
- cur_cs_d_ssrc_group_semantics_sub = cs_d_ssrc_group[cur_cs_d_ssrc_group_semantics][j];
-
- if(cur_cs_d_ssrc_group_semantics_sub !== undefined) {
- var ssrc_group = description.appendChild(stanza.buildNode('ssrc-group', {
- 'semantics': cur_cs_d_ssrc_group_semantics,
- 'xmlns': NS_JINGLE_APPS_RTP_SSMA
- }));
-
- this.stanza_build_node(
- stanza,
- ssrc_group,
- cur_cs_d_ssrc_group_semantics_sub.sources,
- 'source',
- NS_JINGLE_APPS_RTP_SSMA
- );
- }
- }
- }
- }
-
- // SSRC
- if(cs_d_ssrc) {
- for(cur_ssrc_id in cs_d_ssrc) {
- var ssrc = description.appendChild(stanza.buildNode('source', {
- 'ssrc': cur_ssrc_id,
- 'xmlns': NS_JINGLE_APPS_RTP_SSMA
- }));
-
- this.stanza_build_node(
- stanza,
- ssrc,
- cs_d_ssrc[cur_ssrc_id],
- 'parameter',
- NS_JINGLE_APPS_RTP_SSMA
- );
- }
- }
-
- // Encryption?
- if(has_transport === true) {
- if(cs_d_encryption &&
- (cs_d_encryption.crypto && cs_d_encryption.crypto.length ||
- cs_d_encryption['zrtp-hash'] && cs_d_encryption['zrtp-hash'].length)) {
- var encryption = description.appendChild(stanza.buildNode('encryption', { 'xmlns': NS_JINGLE_APPS_RTP }));
-
- this.stanza_set_attribute(encryption, 'required', (cs_d_encryption.attrs.required || '0'));
-
- // Crypto
- this.stanza_build_node(
- stanza,
- encryption,
- cs_d_encryption.crypto,
- 'crypto',
- NS_JINGLE_APPS_RTP
- );
-
- // ZRTP-HASH
- this.stanza_build_node(
- stanza,
- encryption,
- cs_d_encryption['zrtp-hash'],
- 'zrtp-hash',
- NS_JINGLE_APPS_RTP_ZRTP,
- 'value'
- );
- }
- }
-
- // RTCP-FB (common)
- this.stanza_build_node(
- stanza,
- description,
- cs_d_rtcp_fb,
- 'rtcp-fb',
- NS_JINGLE_APPS_RTP_RTCP_FB
- );
-
- // Bandwidth
- this.stanza_build_node(
- stanza,
- description,
- cs_d_bandwidth,
- 'bandwidth',
- NS_JINGLE_APPS_RTP,
- 'value'
- );
-
- // RTP-HDREXT
- this.stanza_build_node(
- stanza,
- description,
- cs_d_rtp_hdrext,
- 'rtp-hdrext',
- NS_JINGLE_APPS_RTP_RTP_HDREXT
- );
-
- // RTCP-MUX
- if(cs_d_rtcp_mux)
- description.appendChild(stanza.buildNode('rtcp-mux', { 'xmlns': NS_JINGLE_APPS_RTP }));
- }
- }
-
- // Build transport?
- if(has_transport === true) {
- var cs_transport = this.generate_transport(cur_content.transport);
-
- // Transport candidates: ICE-UDP
- if((cs_transport.ice.candidate).length > 0) {
- fn_build_transport(
- content,
- cs_transport.ice,
- NS_JINGLE_TRANSPORTS_ICEUDP
- );
- }
-
- // Transport candidates: RAW-UDP
- if((cs_transport.raw.candidate).length > 0) {
- fn_build_transport(
- content,
- cs_transport.raw,
- NS_JINGLE_TRANSPORTS_RAWUDP
- );
- }
- }
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_generate_content_local > ' + e, 1);
- }
- },
-
- /**
- * Generates stanza local group
- * @public
- * @param {JSJaCPacket} stanza
- * @param {DOM} jingle
- */
- stanza_generate_group_local: function(stanza, jingle) {
- try {
- var i,
- cur_semantics, cur_group, cur_group_name,
- group;
-
- var group_local = this.parent.get_group_local();
-
- for(cur_semantics in group_local) {
- cur_group = group_local[cur_semantics];
-
- group = jingle.appendChild(stanza.buildNode('group', {
- 'xmlns': NS_JINGLE_APPS_GROUPING,
- 'semantics': cur_semantics
- }));
-
- for(i in cur_group) {
- cur_group_name = cur_group[i];
-
- group.appendChild(stanza.buildNode('content', {
- 'xmlns': NS_JINGLE_APPS_GROUPING,
- 'name': cur_group_name
- }));
- }
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] stanza_generate_group_local > ' + e, 1);
- }
- },
-
- /**
- * Generates content
- * @public
- * @param {String} creator
- * @param {String} name
- * @param {Object} senders
- * @param {Object} payloads
- * @param {Object} transports
- * @returns {Object} Content object
- */
- generate_content: function(creator, name, senders, payloads, transports) {
- var content_obj = {};
-
- try {
- // Generation process
- content_obj.creator = creator;
- content_obj.name = name;
- content_obj.senders = senders;
- content_obj.description = {};
- content_obj.transport = {};
-
- // Generate description
- var i;
- var description_cpy = this.object_clone(payloads.descriptions);
- var description_ptime = description_cpy.attrs.ptime;
- var description_maxptime = description_cpy.attrs.maxptime;
-
- if(description_ptime) delete description_cpy.attrs.ptime;
- if(description_maxptime) delete description_cpy.attrs.maxptime;
-
- for(i in description_cpy.payload) {
- if(!('attrs' in description_cpy.payload[i]))
- description_cpy.payload[i].attrs = {};
-
- description_cpy.payload[i].attrs.ptime = description_ptime;
- description_cpy.payload[i].attrs.maxptime = description_maxptime;
- }
-
- content_obj.description = description_cpy;
-
- // Generate transport
- content_obj.transport.candidate = transports;
- content_obj.transport.attrs = {};
- content_obj.transport.attrs.pwd = payloads.transports ? payloads.transports.pwd : null;
- content_obj.transport.attrs.ufrag = payloads.transports ? payloads.transports.ufrag : null;
-
- if(payloads.transports && payloads.transports.fingerprint)
- content_obj.transport.fingerprint = payloads.transports.fingerprint;
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] generate_content > ' + e, 1);
- }
-
- return content_obj;
- },
-
- /**
- * Generates transport
- * @public
- * @param {Object} transport_init_obj
- * @returns {Object} Transport object
- */
- generate_transport: function(transport_init_obj) {
- var transport_obj = {
- 'ice': {},
- 'raw': {}
- };
-
- try {
- var i, j, k,
- cur_attr,
- cur_candidate, cur_transport;
-
- // Reduce RAW-UDP map object for simpler search
- var rawudp_map = {};
- for(i in JSJAC_JINGLE_SDP_CANDIDATE_MAP_RAWUDP) {
- rawudp_map[JSJAC_JINGLE_SDP_CANDIDATE_MAP_RAWUDP[i].n] = 1;
- }
-
- var fn_init_obj = function(transport_sub_obj) {
- transport_sub_obj.attrs = transport_init_obj.attrs;
- transport_sub_obj.fingerprint = transport_init_obj.fingerprint;
- transport_sub_obj.candidate = [];
- };
-
- for(j in transport_obj)
- fn_init_obj(transport_obj[j]);
-
- // Nest candidates in their category
- for(k = 0; k < (transport_init_obj.candidate).length; k++) {
- cur_candidate = this.object_clone(transport_init_obj.candidate[k]);
-
- if(cur_candidate.type in JSJAC_JINGLE_SDP_CANDIDATE_TYPES) {
- // Remove attributes that are not required by RAW-UDP (XEP-0177 compliance)
- if(JSJAC_JINGLE_SDP_CANDIDATE_TYPES[cur_candidate.type] === JSJAC_JINGLE_SDP_CANDIDATE_METHOD_RAW) {
- for(cur_attr in cur_candidate) {
- if(typeof rawudp_map[cur_attr] == 'undefined')
- delete cur_candidate[cur_attr];
- }
- }
-
- cur_transport = transport_obj[JSJAC_JINGLE_SDP_CANDIDATE_TYPES[cur_candidate.type]];
- cur_transport.candidate.push(cur_candidate);
- }
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] generate_transport > ' + e, 1);
- }
-
- return transport_obj;
- },
-
- /**
- * Builds local content
- * @public
- */
- build_content_local: function() {
- try {
- var cur_name;
-
- for(cur_name in this.parent.get_name()) {
- this.parent._set_content_local(
- cur_name,
-
- this.generate_content(
- JSJAC_JINGLE_SENDERS_INITIATOR.jingle,
- cur_name,
- this.parent.get_senders(cur_name),
- this.parent.get_payloads_local(cur_name),
- this.parent.get_candidates_local(cur_name)
- )
- );
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] build_content_local > ' + e, 1);
- }
- },
-
- /**
- * Builds remote content
- * @public
- */
- build_content_remote: function() {
- try {
- var cur_name;
-
- for(cur_name in this.parent.get_name()) {
- this.parent._set_content_remote(
- cur_name,
-
- this.generate_content(
- this.parent.get_creator(cur_name),
- cur_name,
- this.parent.get_senders(cur_name),
- this.parent.get_payloads_remote(cur_name),
- this.parent.get_candidates_remote(cur_name)
- )
- );
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] build_content_remote > ' + e, 1);
- }
- },
-
- /**
- * Generates media name
- * @public
- * @param {String} media
- * @returns {String} Media name
- */
- name_generate: function(media) {
- var name = null;
-
- try {
- var i, cur_name;
-
- var content_all = [];
-
- // Push remote contents
- var cur_participant, participants,
- content_remote = {};
-
- if(typeof this.parent.get_content_remote == 'function')
- content_remote = this.parent.get_content_remote();
-
- for(cur_participant in content_remote) {
- content_all.push(
- content_remote[cur_participant]
- );
- }
-
- // Push local content
- content_all.push(
- this.parent.get_content_local()
- );
-
- for(i in content_all) {
- for(cur_name in content_all[i]) {
- try {
- if(content_all[i][cur_name].description.attrs.media === media) {
- name = cur_name; break;
- }
- } catch(e) {}
- }
-
- if(name) break;
- }
-
- if(!name) name = media;
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] name_generate > ' + e, 1);
- }
-
- return name;
- },
-
- /**
- * Generates media
- * @public
- * @param {String} name
- * @returns {String} Media
- */
- media_generate: function(name) {
- var cur_media;
- var media = null;
-
- try {
- if(typeof name == 'number') {
- for(cur_media in JSJAC_JINGLE_MEDIAS) {
- if(name == parseInt(JSJAC_JINGLE_MEDIAS[cur_media].label, 10)) {
- media = cur_media; break;
- }
- }
- } else {
- for(cur_media in JSJAC_JINGLE_MEDIAS) {
- if(name == this.name_generate(cur_media)) {
- media = cur_media; break;
- }
- }
- }
-
- if(!media) media = name;
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] media_generate > ' + e, 1);
- }
-
- return media;
- },
-
- /**
- * Generates a MD5 hash from the given value
- * @public
- * @param {String} value
- * @returns {String} MD5 hash value
- */
- generate_hash_md5: function(value) {
- return hex_md5(value);
- },
-
- /**
- * Generates a random value
- * @public
- * @param {Number} i
- * @returns {String} Random value
- */
- generate_random: function(i) {
- return JSJaCUtils.cnonce(i);
- },
-
- /**
- * Generates a random SID value
- * @public
- * @returns {String} SID value
- */
- generate_sid: function() {
- return this.generate_random(16);
- },
-
- /**
- * Generates a random IID value
- * @public
- * @returns {String} IID value
- */
- generate_iid: function() {
- return this.generate_random(24);
- },
-
- /**
- * Generates a random password value
- * @public
- * @returns {String} Password value
- */
- generate_password: function() {
- return this.generate_random(64);
- },
-
- /**
- * Generates a random ID value
- * @public
- * @returns {String} ID value
- */
- generate_id: function() {
- return this.generate_random(10);
- },
-
- /**
- * Generates the constraints object
- * @public
- * @returns {Object} constraints object
- */
- generate_constraints: function() {
- var constraints = {
- audio : false,
- video : false
- };
-
- try {
- // Medias?
- constraints.audio = true;
- constraints.video = (this.parent.get_media() == JSJAC_JINGLE_MEDIA_VIDEO);
-
- // Video configuration
- if(constraints.video === true) {
- // Resolution?
- switch(this.parent.get_resolution()) {
- // 16:9
- case '720':
- case 'hd':
- constraints.video = {
- mandatory : {
- minWidth : 1280,
- minHeight : 720,
- minAspectRatio : 1.77
- }
- };
- break;
-
- case '360':
- case 'md':
- constraints.video = {
- mandatory : {
- minWidth : 640,
- minHeight : 360,
- minAspectRatio : 1.77
- }
- };
- break;
-
- case '180':
- case 'sd':
- constraints.video = {
- mandatory : {
- minWidth : 320,
- minHeight : 180,
- minAspectRatio : 1.77
- }
- };
- break;
-
- // 4:3
- case '960':
- constraints.video = {
- mandatory : {
- minWidth : 960,
- minHeight : 720
- }
- };
- break;
-
- case '640':
- case 'vga':
- constraints.video = {
- mandatory : {
- maxWidth : 640,
- maxHeight : 480
- }
- };
- break;
-
- case '320':
- constraints.video = {
- mandatory : {
- maxWidth : 320,
- maxHeight : 240
- }
- };
- break;
- }
-
- // Bandwidth?
- if(this.parent.get_bandwidth())
- constraints.video.optional = [{ bandwidth: this.parent.get_bandwidth() }];
-
- // FPS?
- if(this.parent.get_fps())
- constraints.video.mandatory.minFrameRate = this.parent.get_fps();
-
- // Custom video source? (screenshare)
- if(this.parent.get_media() == JSJAC_JINGLE_MEDIA_VIDEO &&
- this.parent.get_video_source() != JSJAC_JINGLE_VIDEO_SOURCE_CAMERA ) {
- if(document.location.protocol !== 'https:')
- this.parent.get_debug().log('[JSJaCJingle:utils] generate_constraints > HTTPS might be required to share screen, otherwise you may get a permission denied error.', 0);
-
- // Unsupported browser? (for that feature)
- if(this.browser().name != JSJAC_JINGLE_BROWSER_CHROME) {
- this.parent.get_debug().log('[JSJaCJingle:utils] generate_constraints > Video source not supported by ' + this.browser().name + ' (source: ' + this.parent.get_video_source() + ').', 1);
-
- this.parent.terminate(JSJAC_JINGLE_REASON_MEDIA_ERROR);
- return;
- }
-
- constraints.audio = false;
- constraints.video.mandatory = {
- 'chromeMediaSource': this.parent.get_video_source()
- };
- }
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] generate_constraints > ' + e, 1);
- }
-
- return constraints;
- },
-
- /**
- * Returns whether SDP credentials are common or not (fingerprint & so)
- * @public
- * @param {Array} payloads
- * @returns {Boolean} Credientials same state
- */
- is_sdp_common_credentials: function(payloads) {
- var is_same = true;
-
- try {
- var i,
- prev_credentials, cur_credentials;
-
- for(i in payloads) {
- cur_credentials = payloads[i].transports;
-
- if(typeof prev_credentials == 'object') {
- if((prev_credentials.ufrag !== cur_credentials.ufrag) ||
- (prev_credentials.pwd !== cur_credentials.pwd) ||
- this.object_equal(prev_credentials.fingerprint, cur_credentials.fingerprint)
- ) {
- is_same = false;
- break;
- }
- }
-
- prev_credentials = cur_credentials;
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] is_sdp_common_credentials > ' + e, 1);
- }
-
- return is_same;
- },
-
- /**
- * Returns number of candidates in candidates object
- * @public
- * @param {Object} candidates_obj
- * @returns {Number} Number of candidates
- */
- count_candidates: function(candidates_obj) {
- var count_candidates = 0;
-
- try {
- var i;
-
- for(i in candidates_obj) {
- count_candidates += (typeof candidates_obj[i] == 'object') ? candidates_obj[i].length : 0;
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] count_candidates > ' + e, 1);
- } finally {
- return count_candidates;
- }
-
- },
-
- /**
- * Extracts network main details
- * @public
- * @param {String} media
- * @param {Array} candidates
- * @returns {Object} Network details
- */
- network_extract_main: function(media, candidates) {
- var network_obj = {
- 'ip': JSJAC_JINGLE_SDP_CANDIDATE_IP_DEFAULT,
- 'port': JSJAC_JINGLE_SDP_CANDIDATE_PORT_DEFAULT,
- 'scope': JSJAC_JINGLE_SDP_CANDIDATE_SCOPE_DEFAULT,
- 'protocol': JSJAC_JINGLE_SDP_CANDIDATE_IPVERSION_DEFAULT
- };
-
- var local_obj, remote_obj;
-
- try {
- var i,
- cur_candidate, cur_candidate_parse;
-
- var fn_proceed_parse = function(type, candidate_eval) {
- var r_lan, protocol;
-
- var parse_obj = {
- 'ip': candidate_eval.ip,
- 'port': candidate_eval.port
- };
-
- if(candidate_eval.ip.match(R_NETWORK_IP.all.v4)) {
- r_lan = R_NETWORK_IP.lan.v4;
- parse_obj.protocol = JSJAC_JINGLE_SDP_CANDIDATE_IPVERSION_V4;
- } else if(candidate_eval.ip.match(R_NETWORK_IP.all.v6)) {
- r_lan = R_NETWORK_IP.lan.v6;
- parse_obj.protocol = JSJAC_JINGLE_SDP_CANDIDATE_IPVERSION_V6;
- } else {
- return;
- }
-
- if((type === JSJAC_JINGLE_SDP_CANDIDATE_TYPE_HOST) &&
- candidate_eval.ip.match(r_lan)) {
- // Local
- parse_obj.scope = JSJAC_JINGLE_SDP_CANDIDATE_SCOPE_LOCAL;
- } else if(type === JSJAC_JINGLE_SDP_CANDIDATE_TYPE_SRFLX) {
- // Remote
- parse_obj.scope = JSJAC_JINGLE_SDP_CANDIDATE_SCOPE_REMOTE;
- } else {
- return;
- }
-
- return parse_obj;
- };
-
- for(i in candidates) {
- cur_candidate = candidates[i];
-
- if(cur_candidate.id == media || cur_candidate.label == media) {
- cur_candidate_parse = this.parent.sdp._parse_candidate(cur_candidate.candidate);
-
- if(cur_candidate_parse.type === JSJAC_JINGLE_SDP_CANDIDATE_TYPE_HOST) {
- // Only proceed if no local network yet
- if(typeof local_obj == 'undefined') {
- local_obj = fn_proceed_parse(JSJAC_JINGLE_SDP_CANDIDATE_TYPE_HOST, cur_candidate_parse);
- }
- } else if(cur_candidate_parse.type === JSJAC_JINGLE_SDP_CANDIDATE_TYPE_SRFLX) {
- // Only proceed if no remote network yet
- if(typeof remote_obj == 'undefined') {
- remote_obj = fn_proceed_parse(JSJAC_JINGLE_SDP_CANDIDATE_TYPE_SRFLX, cur_candidate_parse);
- }
- }
- }
- }
-
- if(typeof remote_obj != 'undefined') {
- network_obj = remote_obj;
- } else if(typeof local_obj != 'undefined') {
- network_obj = local_obj;
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] network_extract_main > ' + e, 1);
- }
-
- return network_obj;
- },
-
- /**
- * Extracts username from full JID
- * @public
- * @param {String} full_jid
- * @returns {String|Object} Username
- */
- extract_username: function(full_jid) {
- try {
- return (new JSJaCJID(full_jid)).getResource();
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] extract_username > ' + e, 1);
- }
-
- return null;
- },
-
- /**
- * Returns our negotiation status
- * @public
- * @returns {String} Negotiation status
- */
- negotiation_status: function() {
- return (this.parent.get_initiator() == this.connection_jid()) ? JSJAC_JINGLE_SENDERS_INITIATOR.jingle : JSJAC_JINGLE_SENDERS_RESPONDER.jingle;
- },
-
- /**
- * Get my connection JID
- * @public
- * @returns {String} JID value
- */
- connection_jid: function() {
- return this.parent.get_connection().username + '@' +
- this.parent.get_connection().domain + '/' +
- this.parent.get_connection().resource;
- },
-
- /**
- * Get my connection username
- * @public
- * @returns {String} Username value
- */
- connection_username: function() {
- return this.parent.get_connection().username;
- },
-
- /**
- * Get my connection domain
- * @public
- * @returns {String} Domain value
- */
- connection_domain: function() {
- return this.parent.get_connection().domain;
- },
-
- /**
- * Get my connection resource
- * @public
- * @returns {String} Resource value
- */
- connection_resource: function() {
- return this.parent.get_connection().resource;
- },
-
- /**
- * Registers a view to map
- * @public
- * @param {String} type
- * @returns {Object} View register functions map
- */
- map_register_view: function(type) {
- var fn = {
- type : null,
- mute : false,
-
- view : {
- get : null,
- set : null
- },
-
- stream : {
- get : null,
- set : null
- }
- };
-
- try {
- switch(type) {
- case JSJAC_JINGLE_DIRECTION_LOCAL:
- fn.type = type;
- fn.mute = true;
- fn.view.get = this.parent.get_local_view;
- fn.view.set = this.parent._set_local_view;
- fn.stream.get = this.parent.get_local_stream;
- fn.stream.set = this.parent._set_local_stream;
- break;
-
- case JSJAC_JINGLE_DIRECTION_REMOTE:
- fn.type = type;
- fn.view.get = this.parent.get_remote_view;
- fn.view.set = this.parent._set_remote_view;
- fn.stream.get = this.parent.get_remote_stream;
- fn.stream.set = this.parent._set_remote_stream;
- break;
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:utils] map_register_view > ' + e, 1);
- }
-
- return fn;
- },
-
- /**
- * Unregister a view from map
- * @public
- * @param {String} type
- * @returns {Object} View unregister functions map
- */
- map_unregister_view: function(type) {
- return this.map_register_view(type);
- },
- }
-);
-
-/**
- * @fileoverview JSJaC Jingle library - SDP tools
- *
- * @url https://github.com/valeriansaliou/jsjac-jingle
- * @depends https://github.com/sstrigler/JSJaC
- * @author Valérian Saliou https://valeriansaliou.name/
- * @license Mozilla Public License v2.0 (MPL v2.0)
- */
-
-
-/** @module jsjac-jingle/sdp */
-/** @exports JSJaCJingleSDP */
-
-
-/**
- * SDP helpers class.
- * @class
- * @classdesc SDP helpers class.
- * @requires nicolas-van/ring.js
- * @requires sstrigler/JSJaC
- * @see {@link http://ringjs.neoname.eu/|Ring.js}
- * @param {JSJaCJingleSingle|JSJaCJingleMuji} parent Parent class.
- */
-var JSJaCJingleSDP = ring.create(
- /** @lends JSJaCJingleSDP.prototype */
- {
- /**
- * Constructor
- */
- constructor: function(parent) {
- /**
- * @constant
- * @member {JSJaCJingleSingle|JSJaCJingleMuji}
- * @readonly
- * @default
- * @public
- */
- this.parent = parent;
- },
-
-
- /**
- * Parses SDP payload
- * @private
- * @param {String} sdp_payload
- * @returns {Object} Parsed payload object
- */
- _parse_payload: function(sdp_payload) {
- var payload = {};
-
- try {
- if(!sdp_payload || sdp_payload.indexOf('\n') == -1) return payload;
-
- // Common vars
- var lines = sdp_payload.split('\n');
- var cur_name = null;
- var cur_media = null;
-
- var common_transports = {
- 'fingerprint' : {},
- 'pwd' : null,
- 'ufrag' : null
- };
-
- var error, i, j, k,
- cur_line,
- cur_fmtp, cur_fmtp_id, cur_fmtp_values, cur_fmtp_attrs, cur_fmtp_key, cur_fmtp_value,
- cur_rtpmap, cur_rtcp_fb, cur_rtcp_fb_trr_int,
- cur_crypto, cur_zrtp_hash, cur_fingerprint, cur_ssrc,
- cur_ssrc_group, cur_ssrc_group_semantics, cur_ssrc_group_ids, cur_ssrc_group_id,
- cur_extmap, cur_rtpmap_id, cur_rtcp_fb_id, cur_bandwidth,
- m_rtpmap, m_fmtp, m_rtcp_fb, m_rtcp_fb_trr_int, m_crypto, m_zrtp_hash,
- m_fingerprint, m_pwd, m_ufrag, m_ptime, m_maxptime, m_bandwidth, m_media, m_candidate,
- cur_check_name, cur_transport_sub;
-
- // Common functions
- var init_content = function(name) {
- if(!(name in payload)) payload[name] = {};
- };
-
- var init_descriptions = function(name, sub, sub_default) {
- init_content(name);
-
- if(!('descriptions' in payload[name])) payload[name].descriptions = {};
- if(!(sub in payload[name].descriptions)) payload[name].descriptions[sub] = sub_default;
- };
-
- var init_transports = function(name, sub, sub_default) {
- init_content(name);
-
- if(!('transports' in payload[name])) payload[name].transports = {};
- if(!(sub in payload[name].transports)) payload[name].transports[sub] = sub_default;
- };
-
- var init_ssrc = function(name, id) {
- init_descriptions(name, 'ssrc', {});
-
- if(!(id in payload[name].descriptions.ssrc))
- payload[name].descriptions.ssrc[id] = [];
- };
-
- var init_ssrc_group = function(name, semantics) {
- init_descriptions(name, 'ssrc-group', {});
-
- if(!(semantics in payload[name].descriptions['ssrc-group']))
- payload[name].descriptions['ssrc-group'][semantics] = [];
- };
-
- var init_payload = function(name, id) {
- init_descriptions(name, 'payload', {});
-
- if(!(id in payload[name].descriptions.payload)) {
- payload[name].descriptions.payload[id] = {
- 'attrs' : {},
- 'parameter' : [],
- 'rtcp-fb' : [],
- 'rtcp-fb-trr-int' : []
- };
- }
- };
-
- var init_encryption = function(name) {
- init_descriptions(name, 'encryption', {
- 'attrs' : {
- 'required' : '1'
- },
-
- 'crypto' : [],
- 'zrtp-hash' : []
- });
- };
-
- for(i in lines) {
- cur_line = lines[i];
-
- m_media = (R_WEBRTC_SDP_ICE_PAYLOAD.media).exec(cur_line);
-
- // 'audio/video' line?
- if(m_media) {
- cur_media = m_media[1];
- cur_name = this.parent.utils.name_generate(cur_media);
-
- // Push it to parent array
- init_descriptions(cur_name, 'attrs', {});
- payload[cur_name].descriptions.attrs.media = cur_media;
-
- continue;
- }
-
- m_bandwidth = (R_WEBRTC_SDP_ICE_PAYLOAD.bandwidth).exec(cur_line);
-
- // 'bandwidth' line?
- if(m_bandwidth) {
- // Populate current object
- error = 0;
- cur_bandwidth = {};
-
- cur_bandwidth.type = m_bandwidth[1] || error++;
- cur_bandwidth.value = m_bandwidth[2] || error++;
-
- // Incomplete?
- if(error !== 0) continue;
-
- // Push it to parent array
- init_descriptions(cur_name, 'bandwidth', []);
- payload[cur_name].descriptions.bandwidth.push(cur_bandwidth);
-
- continue;
- }
-
- m_rtpmap = (R_WEBRTC_SDP_ICE_PAYLOAD.rtpmap).exec(cur_line);
-
- // 'rtpmap' line?
- if(m_rtpmap) {
- // Populate current object
- error = 0;
- cur_rtpmap = {};
-
- cur_rtpmap.channels = m_rtpmap[6];
- cur_rtpmap.clockrate = m_rtpmap[4];
- cur_rtpmap.id = m_rtpmap[1] || error++;
- cur_rtpmap.name = m_rtpmap[3];
-
- // Incomplete?
- if(error !== 0) continue;
-
- cur_rtpmap_id = cur_rtpmap.id;
-
- // Push it to parent array
- init_payload(cur_name, cur_rtpmap_id);
- payload[cur_name].descriptions.payload[cur_rtpmap_id].attrs = cur_rtpmap;
-
- continue;
- }
-
- m_fmtp = (R_WEBRTC_SDP_ICE_PAYLOAD.fmtp).exec(cur_line);
-
- // 'fmtp' line?
- if(m_fmtp) {
- cur_fmtp_id = m_fmtp[1];
-
- if(cur_fmtp_id) {
- cur_fmtp_values = m_fmtp[2] ? (m_fmtp[2]).split(';') : [];
-
- for(j in cur_fmtp_values) {
- // Parse current attribute
- if(cur_fmtp_values[j].indexOf('=') !== -1) {
- cur_fmtp_attrs = cur_fmtp_values[j].split('=');
- cur_fmtp_key = cur_fmtp_attrs[0];
- cur_fmtp_value = cur_fmtp_attrs[1];
-
- while(cur_fmtp_key.length && !cur_fmtp_key[0])
- cur_fmtp_key = cur_fmtp_key.substring(1);
- } else {
- cur_fmtp_key = cur_fmtp_values[j];
- cur_fmtp_value = null;
- }
-
- // Populate current object
- error = 0;
- cur_fmtp = {};
-
- cur_fmtp.name = cur_fmtp_key || error++;
- cur_fmtp.value = cur_fmtp_value;
-
- // Incomplete?
- if(error !== 0) continue;
-
- // Push it to parent array
- init_payload(cur_name, cur_fmtp_id);
- payload[cur_name].descriptions.payload[cur_fmtp_id].parameter.push(cur_fmtp);
- }
- }
-
- continue;
- }
-
- m_rtcp_fb = (R_WEBRTC_SDP_ICE_PAYLOAD.rtcp_fb).exec(cur_line);
-
- // 'rtcp-fb' line?
- if(m_rtcp_fb) {
- // Populate current object
- error = 0;
- cur_rtcp_fb = {};
-
- cur_rtcp_fb.id = m_rtcp_fb[1] || error++;
- cur_rtcp_fb.type = m_rtcp_fb[2];
- cur_rtcp_fb.subtype = m_rtcp_fb[4];
-
- // Incomplete?
- if(error !== 0) continue;
-
- cur_rtcp_fb_id = cur_rtcp_fb.id;
-
- // Push it to parent array
- if(cur_rtcp_fb_id == '*') {
- init_descriptions(cur_name, 'rtcp-fb', []);
- (payload[cur_name].descriptions['rtcp-fb']).push(cur_rtcp_fb);
- } else {
- init_payload(cur_name, cur_rtcp_fb_id);
- (payload[cur_name].descriptions.payload[cur_rtcp_fb_id]['rtcp-fb']).push(cur_rtcp_fb);
- }
-
- continue;
- }
-
- m_rtcp_fb_trr_int = (R_WEBRTC_SDP_ICE_PAYLOAD.rtcp_fb_trr_int).exec(cur_line);
-
- // 'rtcp-fb-trr-int' line?
- if(m_rtcp_fb_trr_int) {
- // Populate current object
- error = 0;
- cur_rtcp_fb_trr_int = {};
-
- cur_rtcp_fb_trr_int.id = m_rtcp_fb_trr_int[1] || error++;
- cur_rtcp_fb_trr_int.value = m_rtcp_fb_trr_int[2] || error++;
-
- // Incomplete?
- if(error !== 0) continue;
-
- cur_rtcp_fb_trr_int_id = cur_rtcp_fb_trr_int.id;
-
- // Push it to parent array
- init_payload(cur_name, cur_rtcp_fb_trr_int_id);
- (payload[cur_name].descriptions.payload[cur_rtcp_fb_trr_int_id]['rtcp-fb-trr-int']).push(cur_rtcp_fb_trr_int);
-
- continue;
- }
-
- m_crypto = (R_WEBRTC_SDP_ICE_PAYLOAD.crypto).exec(cur_line);
-
- // 'crypto' line?
- if(m_crypto) {
- // Populate current object
- error = 0;
- cur_crypto = {};
-
- cur_crypto['crypto-suite'] = m_crypto[2] || error++;
- cur_crypto['key-params'] = m_crypto[3] || error++;
- cur_crypto['session-params'] = m_crypto[5];
- cur_crypto.tag = m_crypto[1] || error++;
-
- // Incomplete?
- if(error !== 0) continue;
-
- // Push it to parent array
- init_encryption(cur_name);
- (payload[cur_name].descriptions.encryption.crypto).push(cur_crypto);
-
- continue;
- }
-
- m_zrtp_hash = (R_WEBRTC_SDP_ICE_PAYLOAD.zrtp_hash).exec(cur_line);
-
- // 'zrtp-hash' line?
- if(m_zrtp_hash) {
- // Populate current object
- error = 0;
- cur_zrtp_hash = {};
-
- cur_zrtp_hash.version = m_zrtp_hash[1] || error++;
- cur_zrtp_hash.value = m_zrtp_hash[2] || error++;
-
- // Incomplete?
- if(error !== 0) continue;
-
- // Push it to parent array
- init_encryption(cur_name);
- (payload[cur_name].descriptions.encryption['zrtp-hash']).push(cur_zrtp_hash);
-
- continue;
- }
-
- m_ptime = (R_WEBRTC_SDP_ICE_PAYLOAD.ptime).exec(cur_line);
-
- // 'ptime' line?
- if(m_ptime) {
- // Push it to parent array
- init_descriptions(cur_name, 'attrs', {});
- payload[cur_name].descriptions.attrs.ptime = m_ptime[1];
-
- continue;
- }
-
- m_maxptime = (R_WEBRTC_SDP_ICE_PAYLOAD.maxptime).exec(cur_line);
-
- // 'maxptime' line?
- if(m_maxptime) {
- // Push it to parent array
- init_descriptions(cur_name, 'attrs', {});
- payload[cur_name].descriptions.attrs.maxptime = m_maxptime[1];
-
- continue;
- }
-
- m_ssrc = (R_WEBRTC_SDP_ICE_PAYLOAD.ssrc).exec(cur_line);
-
- // 'ssrc' line?
- if(m_ssrc) {
- // Populate current object
- error = 0;
- cur_ssrc = {};
-
- cur_ssrc_id = m_ssrc[1] || error++;
- cur_ssrc.name = m_ssrc[2] || error++;
- cur_ssrc.value = m_ssrc[4];
-
- // Incomplete?
- if(error !== 0) continue;
-
- // Push it to storage array
- init_ssrc(cur_name, cur_ssrc_id);
- (payload[cur_name].descriptions.ssrc[cur_ssrc_id]).push(cur_ssrc);
-
- // Push it to parent array (common attr required for Jingle)
- init_descriptions(cur_name, 'attrs', {});
- payload[cur_name].descriptions.attrs.ssrc = cur_ssrc_id;
-
- continue;
- }
-
- m_ssrc_group = (R_WEBRTC_SDP_ICE_PAYLOAD.ssrc_group).exec(cur_line);
-
- // 'ssrc-group' line?
- if(m_ssrc_group) {
- // Populate current object
- error = 0;
- cur_ssrc_group = {};
-
- cur_ssrc_group_semantics = m_ssrc_group[1] || error++;
- cur_ssrc_group_ids = m_ssrc_group[2] || error++;
-
- // Explode sources into a list
- cur_ssrc_group.sources = [];
- cur_ssrc_group_ids = cur_ssrc_group_ids.trim();
-
- if(cur_ssrc_group_ids) {
- cur_ssrc_group_ids = cur_ssrc_group_ids.split(' ');
-
- for(k in cur_ssrc_group_ids) {
- cur_ssrc_group_id = cur_ssrc_group_ids[k].trim();
-
- if(cur_ssrc_group_id) {
- cur_ssrc_group.sources.push({
- 'ssrc': cur_ssrc_group_id
- });
- }
- }
- }
-
- if(cur_ssrc_group.sources.length === 0) error++;
-
- // Incomplete?
- if(error !== 0) continue;
-
- // Push it to storage array
- init_ssrc_group(cur_name, cur_ssrc_group_semantics);
- (payload[cur_name].descriptions['ssrc-group'][cur_ssrc_group_semantics]).push(cur_ssrc_group);
-
- continue;
- }
-
- m_rtcp_mux = (R_WEBRTC_SDP_ICE_PAYLOAD.rtcp_mux).exec(cur_line);
-
- // 'rtcp-mux' line?
- if(m_rtcp_mux) {
- // Push it to parent array
- init_descriptions(cur_name, 'rtcp-mux', 1);
-
- continue;
- }
-
- m_extmap = (R_WEBRTC_SDP_ICE_PAYLOAD.extmap).exec(cur_line);
-
- // 'extmap' line?
- if(m_extmap) {
- // Populate current object
- error = 0;
- cur_extmap = {};
-
- cur_extmap.id = m_extmap[1] || error++;
- cur_extmap.uri = m_extmap[4] || error++;
- cur_extmap.senders = m_extmap[3];
-
- // Incomplete?
- if(error !== 0) continue;
-
- // Push it to parent array
- init_descriptions(cur_name, 'rtp-hdrext', []);
- (payload[cur_name].descriptions['rtp-hdrext']).push(cur_extmap);
-
- continue;
- }
-
- m_fingerprint = (R_WEBRTC_SDP_ICE_PAYLOAD.fingerprint).exec(cur_line);
-
- // 'fingerprint' line?
- if(m_fingerprint) {
- // Populate current object
- error = 0;
- cur_fingerprint = common_transports.fingerprint || {};
-
- cur_fingerprint.hash = m_fingerprint[1] || error++;
- cur_fingerprint.value = m_fingerprint[2] || error++;
-
- // Incomplete?
- if(error !== 0) continue;
-
- // Push it to parent array
- init_transports(cur_name, 'fingerprint', cur_fingerprint);
- common_transports.fingerprint = cur_fingerprint;
-
- continue;
- }
-
- m_setup = (R_WEBRTC_SDP_ICE_PAYLOAD.setup).exec(cur_line);
-
- // 'setup' line?
- if(m_setup) {
- // Populate current object
- cur_fingerprint = common_transports.fingerprint || {};
- cur_fingerprint.setup = m_setup[1];
-
- // Push it to parent array
- if(cur_fingerprint.setup) {
- // Map it to fingerprint as XML-wise it is related
- init_transports(cur_name, 'fingerprint', cur_fingerprint);
- common_transports.fingerprint = cur_fingerprint;
- }
-
- continue;
- }
-
- m_pwd = (R_WEBRTC_SDP_ICE_PAYLOAD.pwd).exec(cur_line);
-
- // 'pwd' line?
- if(m_pwd) {
- init_transports(cur_name, 'pwd', m_pwd[1]);
-
- if(!common_transports.pwd)
- common_transports.pwd = m_pwd[1];
-
- continue;
- }
-
- m_ufrag = (R_WEBRTC_SDP_ICE_PAYLOAD.ufrag).exec(cur_line);
-
- // 'ufrag' line?
- if(m_ufrag) {
- init_transports(cur_name, 'ufrag', m_ufrag[1]);
-
- if(!common_transports.ufrag)
- common_transports.ufrag = m_ufrag[1];
-
- continue;
- }
-
- // 'candidate' line? (shouldn't be there)
- m_candidate = R_WEBRTC_SDP_CANDIDATE.exec(cur_line);
-
- if(m_candidate) {
- this._parse_candidate_store({
- media : cur_media,
- candidate : cur_line
- });
-
- continue;
- }
- }
-
- // Filter medias
- for(cur_check_name in payload) {
- // Undesired media?
- if(!this.parent.get_name()[cur_check_name]) {
- delete payload[cur_check_name]; continue;
- }
-
- // Validate transports
- if(typeof payload[cur_check_name].transports !== 'object')
- payload[cur_check_name].transports = {};
-
- for(cur_transport_sub in common_transports) {
- if(!payload[cur_check_name].transports[cur_transport_sub])
- payload[cur_check_name].transports[cur_transport_sub] = common_transports[cur_transport_sub];
- }
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:sdp] _parse_payload > ' + e, 1);
- }
-
- return payload;
- },
-
- /**
- * Parses SDP group
- * @private
- * @param {String} sdp_payload
- * @returns {Object} Parsed group object
- */
- _parse_group: function(sdp_payload) {
- var group = {};
-
- try {
- if(!sdp_payload || sdp_payload.indexOf('\n') == -1) return group;
-
- // Common vars
- var lines = sdp_payload.split('\n');
- var i, cur_line,
- m_group;
-
- var init_group = function(semantics) {
- if(!(semantics in group)) group[semantics] = [];
- };
-
- for(i in lines) {
- cur_line = lines[i];
-
- // 'group' line?
- m_group = (R_WEBRTC_SDP_ICE_PAYLOAD.group).exec(cur_line);
-
- if(m_group) {
- if(m_group[1] && m_group[2]) {
- init_group(m_group[1]);
-
- group[m_group[1]] = (m_group[2].indexOf(' ') === -1 ? [m_group[2]] : m_group[2].split(' '));
- }
-
- continue;
- }
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:sdp] _parse_group > ' + e, 1);
- }
-
- return group;
- },
-
- /**
- * Update video resolution in payload
- * @private
- * @param {Object} payload
- * @returns {Object} Updated payload
- */
- _resolution_payload: function(payload) {
- try {
- if(!payload || typeof payload !== 'object') return {};
-
- // No video?
- if(this.parent.get_media_all().indexOf(JSJAC_JINGLE_MEDIA_VIDEO) === -1) return payload;
-
- var i, j, k, cur_media;
- var cur_payload, res_arr, constraints;
- var res_height = null;
- var res_width = null;
-
- // Try local view? (more reliable)
- for(i in this.parent.get_local_view()) {
- if(typeof this.parent.get_local_view()[i].videoWidth == 'number' &&
- typeof this.parent.get_local_view()[i].videoHeight == 'number' ) {
- res_height = this.parent.get_local_view()[i].videoHeight;
- res_width = this.parent.get_local_view()[i].videoWidth;
-
- if(res_height && res_width) break;
- }
- }
-
- // Try media constraints? (less reliable)
- if(!res_height || !res_width) {
- this.parent.get_debug().log('[JSJaCJingle:sdp] _resolution_payload > Could not get local video resolution, falling back on constraints (local video may not be ready).', 0);
-
- constraints = this.parent.utils.generate_constraints();
-
- // Still nothing?!
- if(typeof constraints.video !== 'object' ||
- typeof constraints.video.mandatory !== 'object' ||
- typeof constraints.video.mandatory.minWidth !== 'number' ||
- typeof constraints.video.mandatory.minHeight !== 'number' ) {
- this.parent.get_debug().log('[JSJaCJingle:sdp] _resolution_payload > Could not get local video resolution (not sending it).', 1);
- return payload;
- }
-
- res_height = constraints.video.mandatory.minHeight;
- res_width = constraints.video.mandatory.minWidth;
- }
-
- // Constraints to be used
- res_arr = [
- {
- name : 'height',
- value : res_height
- },
-
- {
- name : 'width',
- value : res_width
- }
- ];
-
- for(cur_media in payload) {
- if(cur_media != JSJAC_JINGLE_MEDIA_VIDEO) continue;
-
- cur_payload = payload[cur_media].descriptions.payload;
-
- for(j in cur_payload) {
- if(typeof cur_payload[j].parameter !== 'object') cur_payload[j].parameter = [];
-
- for(k in res_arr)
- (cur_payload[j].parameter).push(res_arr[k]);
- }
- }
-
- this.parent.get_debug().log('[JSJaCJingle:sdp] _resolution_payload > Got local video resolution (' + res_width + 'x' + res_height + ').', 2);
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:sdp] _resolution_payload > ' + e, 1);
- }
-
- return payload;
- },
-
- /**
- * Parses SDP candidate
- * @private
- * @param {String} sdp_candidate
- * @returns {Object} Parsed candidates object
- */
- _parse_candidate: function(sdp_candidate) {
- var candidate = {};
-
- try {
- if(!sdp_candidate) return candidate;
-
- var error = 0;
- var matches = R_WEBRTC_DATA_CANDIDATE.exec(sdp_candidate);
-
- // Matches!
- if(matches) {
- candidate.component = matches[2] || error++;
- candidate.foundation = matches[1] || error++;
- candidate.generation = matches[16] || JSJAC_JINGLE_GENERATION;
- candidate.id = this.parent.utils.generate_id();
- candidate.ip = matches[5] || error++;
- candidate.network = JSJAC_JINGLE_NETWORK;
- candidate.port = matches[6] || error++;
- candidate.priority = matches[4] || error++;
- candidate.protocol = matches[3] || error++;
- candidate['rel-addr'] = matches[11];
- candidate['rel-port'] = matches[13];
- candidate.type = matches[8] || error++;
- }
-
- // Incomplete?
- if(error !== 0) return {};
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:sdp] _parse_candidate > ' + e, 1);
- }
-
- return candidate;
- },
-
- /**
- * Parses SDP candidate & store it
- * @private
- * @param {Object} sdp_candidate
- */
- _parse_candidate_store: function(sdp_candidate) {
- // Store received candidate
- var candidate_media = sdp_candidate.media;
- var candidate_data = sdp_candidate.candidate;
-
- // Convert SDP raw data to an object
- var candidate_obj = this._parse_candidate(candidate_data);
- var candidate_name = this.parent.utils.name_generate(candidate_media);
-
- this.parent._set_candidates_local(
- candidate_name,
- candidate_obj
- );
-
- // Enqueue candidate
- this.parent._set_candidates_queue_local(
- candidate_name,
- candidate_obj
- );
- },
-
- /**
- * Parses SDP candidate & store it from data
- * @private
- * @param {Object} data
- */
- _parse_candidate_store_store_data: function(data) {
- this._parse_candidate_store({
- media : (isNaN(data.candidate.sdpMid) ? data.candidate.sdpMid
- : this.parent.utils.media_generate(parseInt(data.candidate.sdpMid, 10))),
- candidate : data.candidate.candidate
- });
- },
-
- /**
- * Generates SDP description
- * @private
- * @param {String} type
- * @param {Object} group
- * @param {Object} payloads
- * @param {Object} candidates
- * @returns {Object} SDP object
- */
- _generate: function(type, group, payloads, candidates) {
- try {
- var sdp_obj = {};
-
- sdp_obj.candidates = this._generate_candidates(candidates);
- sdp_obj.description = this._generate_description(type, group, payloads, sdp_obj.candidates);
-
- return sdp_obj;
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:sdp] _generate > ' + e, 1);
- }
-
- return {};
- },
-
- /**
- * Generate SDP candidates
- * @private
- * @param {Object} candidates
- * @returns {Array} SDP candidates array
- */
- _generate_candidates: function(candidates) {
- var candidates_arr = [];
-
- try {
- // Parse candidates
- var i,
- cur_media, cur_name, cur_c_name, cur_candidate, cur_label, cur_id, cur_candidate_str;
-
- for(cur_name in candidates) {
- cur_c_name = candidates[cur_name];
- cur_media = this.parent.utils.media_generate(cur_name);
-
- for(i in cur_c_name) {
- cur_candidate = cur_c_name[i];
-
- cur_label = JSJAC_JINGLE_MEDIAS[cur_media].label;
- cur_id = cur_label;
- cur_candidate_str = '';
-
- cur_candidate_str += 'a=candidate:';
- cur_candidate_str += (cur_candidate.foundation || cur_candidate.id);
- cur_candidate_str += ' ';
- cur_candidate_str += cur_candidate.component;
- cur_candidate_str += ' ';
- cur_candidate_str += cur_candidate.protocol || JSJAC_JINGLE_SDP_CANDIDATE_PROTOCOL_DEFAULT;
- cur_candidate_str += ' ';
- cur_candidate_str += cur_candidate.priority || JSJAC_JINGLE_SDP_CANDIDATE_PRIORITY_DEFAULT;
- cur_candidate_str += ' ';
- cur_candidate_str += cur_candidate.ip;
- cur_candidate_str += ' ';
- cur_candidate_str += cur_candidate.port;
-
- if(cur_candidate.type) {
- cur_candidate_str += ' ';
- cur_candidate_str += 'typ';
- cur_candidate_str += ' ';
- cur_candidate_str += cur_candidate.type;
- }
-
- if(cur_candidate['rel-addr'] && cur_candidate['rel-port']) {
- cur_candidate_str += ' ';
- cur_candidate_str += 'raddr';
- cur_candidate_str += ' ';
- cur_candidate_str += cur_candidate['rel-addr'];
- cur_candidate_str += ' ';
- cur_candidate_str += 'rport';
- cur_candidate_str += ' ';
- cur_candidate_str += cur_candidate['rel-port'];
- }
-
- if(cur_candidate.generation) {
- cur_candidate_str += ' ';
- cur_candidate_str += 'generation';
- cur_candidate_str += ' ';
- cur_candidate_str += cur_candidate.generation;
- }
-
- cur_candidate_str += WEBRTC_SDP_LINE_BREAK;
-
- candidates_arr.push({
- label : cur_label,
- id : cur_id,
- candidate : cur_candidate_str
- });
- }
- }
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:sdp] _generate_candidates > ' + e, 1);
- }
-
- return candidates_arr;
- },
-
- /**
- * Generates SDP description
- * @private
- * @param {String} type
- * @param {Object} group
- * @param {Object} payloads
- * @param {Object} sdp_candidates
- * @returns {Object} SDP description payloads
- */
- _generate_description: function(type, group, payloads, sdp_candidates) {
- var payloads_obj = {};
-
- try {
- var payloads_str = '';
- var is_common_credentials = this.parent.utils.is_sdp_common_credentials(payloads);
-
- // Common vars
- var i, c, j, k, l, m, n, o, p, q, r, s, t, u,
- cur_name, cur_name_first, cur_name_obj,
- cur_media, cur_senders,
- cur_group_semantics, cur_group_names, cur_group_name,
- cur_network_obj, cur_transports_obj, cur_transports_obj_first, cur_description_obj,
- cur_d_pwd, cur_d_ufrag, cur_d_fingerprint,
- cur_d_attrs, cur_d_rtcp_fb, cur_d_bandwidth, cur_d_encryption,
- cur_d_ssrc, cur_d_ssrc_id, cur_d_ssrc_obj, cur_d_ssrc_group, cur_d_ssrc_group_semantics, cur_d_ssrc_group_obj,
- cur_d_rtcp_fb_obj,
- cur_d_payload, cur_d_payload_obj, cur_d_payload_obj_attrs, cur_d_payload_obj_id,
- cur_d_payload_obj_parameter, cur_d_payload_obj_parameter_obj, cur_d_payload_obj_parameter_str,
- cur_d_payload_obj_rtcp_fb, cur_d_payload_obj_rtcp_fb_obj,
- cur_d_payload_obj_rtcp_fb_ttr_int, cur_d_payload_obj_rtcp_fb_ttr_int_obj,
- cur_d_crypto_obj, cur_d_zrtp_hash_obj,
- cur_d_rtp_hdrext, cur_d_rtp_hdrext_obj,
- cur_d_rtcp_mux;
-
- // Payloads headers
- payloads_str += this._generate_protocol_version();
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- payloads_str += this._generate_origin();
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- payloads_str += this._generate_session_name();
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- payloads_str += this._generate_timing();
- payloads_str += WEBRTC_SDP_LINE_BREAK;
-
- // Add groups
- for(cur_group_semantics in group) {
- cur_group_names = group[cur_group_semantics];
-
- payloads_str += 'a=group:' + cur_group_semantics;
-
- for(s in cur_group_names) {
- cur_group_name = cur_group_names[s];
- payloads_str += ' ' + cur_group_name;
- }
-
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- }
-
- // Common credentials?
- if(is_common_credentials === true) {
- for(cur_name_first in payloads) {
- cur_transports_obj_first = payloads[cur_name_first].transports || {};
-
- payloads_str += this._generate_credentials(
- cur_transports_obj_first.ufrag,
- cur_transports_obj_first.pwd,
- cur_transports_obj_first.fingerprint
- );
-
- break;
- }
- }
-
- // Add media groups
- for(cur_name in payloads) {
- cur_name_obj = payloads[cur_name];
- cur_senders = this.parent.get_senders(cur_name);
- cur_media = this.parent.get_name(cur_name) ? this.parent.utils.media_generate(cur_name) : null;
-
- // No media?
- if(!cur_media) continue;
-
- // Network
- cur_network_obj = this.parent.utils.network_extract_main(cur_name, sdp_candidates);
-
- // Transports
- cur_transports_obj = cur_name_obj.transports || {};
- cur_d_pwd = cur_transports_obj.pwd;
- cur_d_ufrag = cur_transports_obj.ufrag;
- cur_d_fingerprint = cur_transports_obj.fingerprint;
-
- // Descriptions
- cur_description_obj = cur_name_obj.descriptions;
- cur_d_attrs = cur_description_obj.attrs;
- cur_d_rtcp_fb = cur_description_obj['rtcp-fb'];
- cur_d_bandwidth = cur_description_obj.bandwidth;
- cur_d_payload = cur_description_obj.payload;
- cur_d_encryption = cur_description_obj.encryption;
- cur_d_ssrc = cur_description_obj.ssrc;
- cur_d_ssrc_group = cur_description_obj['ssrc-group'];
- cur_d_rtp_hdrext = cur_description_obj['rtp-hdrext'];
- cur_d_rtcp_mux = cur_description_obj['rtcp-mux'];
-
- // Current media
- payloads_str += this._generate_description_media(
- cur_media,
- cur_network_obj.port,
- cur_d_encryption,
- cur_d_fingerprint,
- cur_d_payload
- );
- payloads_str += WEBRTC_SDP_LINE_BREAK;
-
- payloads_str += 'c=' +
- cur_network_obj.scope + ' ' +
- cur_network_obj.protocol + ' ' +
- cur_network_obj.ip;
- payloads_str += WEBRTC_SDP_LINE_BREAK;
-
- payloads_str += 'a=rtcp:' +
- cur_network_obj.port + ' ' +
- cur_network_obj.scope + ' ' +
- cur_network_obj.protocol + ' ' +
- cur_network_obj.ip;
- payloads_str += WEBRTC_SDP_LINE_BREAK;
-
- // Specific credentials?
- if(is_common_credentials === false) {
- payloads_str += this._generate_credentials(
- cur_d_ufrag,
- cur_d_pwd,
- cur_d_fingerprint
- );
- }
-
- // Fingerprint
- if(cur_d_fingerprint && cur_d_fingerprint.setup) {
- payloads_str += 'a=setup:' + cur_d_fingerprint.setup;
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- }
-
- // RTP-HDREXT
- if(cur_d_rtp_hdrext && cur_d_rtp_hdrext.length) {
- for(i in cur_d_rtp_hdrext) {
- cur_d_rtp_hdrext_obj = cur_d_rtp_hdrext[i];
-
- payloads_str += 'a=extmap:' + cur_d_rtp_hdrext_obj.id;
-
- if(cur_d_rtp_hdrext_obj.senders)
- payloads_str += '/' + cur_d_rtp_hdrext_obj.senders;
-
- payloads_str += ' ' + cur_d_rtp_hdrext_obj.uri;
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- }
- }
-
- // Senders
- if(cur_senders) {
- payloads_str += 'a=' + JSJAC_JINGLE_SENDERS[cur_senders];
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- }
-
- // Name
- if(cur_media && JSJAC_JINGLE_MEDIAS[cur_media]) {
- payloads_str += 'a=mid:' + (JSJAC_JINGLE_MEDIAS[cur_media]).label;
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- }
-
- // RTCP-MUX
- // WARNING: no spec!
- // See: http://code.google.com/p/libjingle/issues/detail?id=309
- // http://mail.jabber.org/pipermail/jingle/2011-December/001761.html
- if(cur_d_rtcp_mux) {
- payloads_str += 'a=rtcp-mux';
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- }
-
- // 'encryption'
- if(cur_d_encryption) {
- // 'crypto'
- for(j in cur_d_encryption.crypto) {
- cur_d_crypto_obj = cur_d_encryption.crypto[j];
-
- payloads_str += 'a=crypto:' +
- cur_d_crypto_obj.tag + ' ' +
- cur_d_crypto_obj['crypto-suite'] + ' ' +
- cur_d_crypto_obj['key-params'] +
- (cur_d_crypto_obj['session-params'] ? (' ' + cur_d_crypto_obj['session-params']) : '');
-
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- }
-
- // 'zrtp-hash'
- for(p in cur_d_encryption['zrtp-hash']) {
- cur_d_zrtp_hash_obj = cur_d_encryption['zrtp-hash'][p];
-
- payloads_str += 'a=zrtp-hash:' +
- cur_d_zrtp_hash_obj.version + ' ' +
- cur_d_zrtp_hash_obj.value;
-
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- }
- }
-
- // 'rtcp-fb' (common)
- for(n in cur_d_rtcp_fb) {
- cur_d_rtcp_fb_obj = cur_d_rtcp_fb[n];
-
- payloads_str += 'a=rtcp-fb:*';
- payloads_str += ' ' + cur_d_rtcp_fb_obj.type;
-
- if(cur_d_rtcp_fb_obj.subtype)
- payloads_str += ' ' + cur_d_rtcp_fb_obj.subtype;
-
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- }
-
- // 'bandwidth' (common)
- for(q in cur_d_bandwidth) {
- cur_d_bandwidth_obj = cur_d_bandwidth[q];
-
- payloads_str += 'b=' + cur_d_bandwidth_obj.type;
- payloads_str += ':' + cur_d_bandwidth_obj.value;
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- }
-
- // 'payload-type'
- for(k in cur_d_payload) {
- cur_d_payload_obj = cur_d_payload[k];
- cur_d_payload_obj_attrs = cur_d_payload_obj.attrs;
- cur_d_payload_obj_parameter = cur_d_payload_obj.parameter;
- cur_d_payload_obj_rtcp_fb = cur_d_payload_obj['rtcp-fb'];
- cur_d_payload_obj_rtcp_fb_ttr_int = cur_d_payload_obj['rtcp-fb-trr-int'];
-
- cur_d_payload_obj_id = cur_d_payload_obj_attrs.id;
-
- payloads_str += 'a=rtpmap:' + cur_d_payload_obj_id;
-
- // 'rtpmap'
- if(cur_d_payload_obj_attrs.name) {
- payloads_str += ' ' + cur_d_payload_obj_attrs.name;
-
- if(cur_d_payload_obj_attrs.clockrate) {
- payloads_str += '/' + cur_d_payload_obj_attrs.clockrate;
-
- if(cur_d_payload_obj_attrs.channels)
- payloads_str += '/' + cur_d_payload_obj_attrs.channels;
- }
- }
-
- payloads_str += WEBRTC_SDP_LINE_BREAK;
-
- // 'parameter'
- if(cur_d_payload_obj_parameter.length) {
- payloads_str += 'a=fmtp:' + cur_d_payload_obj_id + ' ';
- cur_d_payload_obj_parameter_str = '';
-
- for(o in cur_d_payload_obj_parameter) {
- cur_d_payload_obj_parameter_obj = cur_d_payload_obj_parameter[o];
-
- if(cur_d_payload_obj_parameter_str) cur_d_payload_obj_parameter_str += ';';
-
- cur_d_payload_obj_parameter_str += cur_d_payload_obj_parameter_obj.name;
-
- if(cur_d_payload_obj_parameter_obj.value !== null) {
- cur_d_payload_obj_parameter_str += '=';
- cur_d_payload_obj_parameter_str += cur_d_payload_obj_parameter_obj.value;
- }
- }
-
- payloads_str += cur_d_payload_obj_parameter_str;
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- }
-
- // 'rtcp-fb' (sub)
- for(l in cur_d_payload_obj_rtcp_fb) {
- cur_d_payload_obj_rtcp_fb_obj = cur_d_payload_obj_rtcp_fb[l];
-
- payloads_str += 'a=rtcp-fb:' + cur_d_payload_obj_id;
- payloads_str += ' ' + cur_d_payload_obj_rtcp_fb_obj.type;
-
- if(cur_d_payload_obj_rtcp_fb_obj.subtype)
- payloads_str += ' ' + cur_d_payload_obj_rtcp_fb_obj.subtype;
-
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- }
-
- // 'rtcp-fb-ttr-int'
- for(m in cur_d_payload_obj_rtcp_fb_ttr_int) {
- cur_d_payload_obj_rtcp_fb_ttr_int_obj = cur_d_payload_obj_rtcp_fb_ttr_int[m];
-
- payloads_str += 'a=rtcp-fb:' + cur_d_payload_obj_id;
- payloads_str += ' ' + 'trr-int';
- payloads_str += ' ' + cur_d_payload_obj_rtcp_fb_ttr_int_obj.value;
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- }
- }
-
- if(cur_d_attrs.ptime) payloads_str += 'a=ptime:' + cur_d_attrs.ptime + WEBRTC_SDP_LINE_BREAK;
- if(cur_d_attrs.maxptime) payloads_str += 'a=maxptime:' + cur_d_attrs.maxptime + WEBRTC_SDP_LINE_BREAK;
-
- // 'ssrc-group'
- for(cur_d_ssrc_group_semantics in cur_d_ssrc_group) {
- for(t in cur_d_ssrc_group[cur_d_ssrc_group_semantics]) {
- cur_d_ssrc_group_obj = cur_d_ssrc_group[cur_d_ssrc_group_semantics][t];
-
- payloads_str += 'a=ssrc-group';
- payloads_str += ':' + cur_d_ssrc_group_semantics;
-
- for(u in cur_d_ssrc_group_obj.sources) {
- payloads_str += ' ' + cur_d_ssrc_group_obj.sources[u].ssrc;
- }
-
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- }
- }
-
- // 'ssrc'
- for(cur_d_ssrc_id in cur_d_ssrc) {
- for(r in cur_d_ssrc[cur_d_ssrc_id]) {
- cur_d_ssrc_obj = cur_d_ssrc[cur_d_ssrc_id][r];
-
- payloads_str += 'a=ssrc';
- payloads_str += ':' + cur_d_ssrc_id;
- payloads_str += ' ' + cur_d_ssrc_obj.name;
-
- if(cur_d_ssrc_obj.value)
- payloads_str += ':' + cur_d_ssrc_obj.value;
-
- payloads_str += WEBRTC_SDP_LINE_BREAK;
- }
- }
-
- // Candidates (some browsers require them there, too)
- if(typeof sdp_candidates == 'object') {
- for(c in sdp_candidates) {
- if((sdp_candidates[c]).label == JSJAC_JINGLE_MEDIAS[cur_media].label)
- payloads_str += (sdp_candidates[c]).candidate;
- }
- }
- }
-
- // Push to object
- payloads_obj.type = type;
- payloads_obj.sdp = payloads_str;
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:sdp] _generate_description > ' + e, 1);
- }
-
- return payloads_obj;
- },
-
- /**
- * Generates SDP protocol version
- * @private
- * @returns {String} SDP protocol version raw text
- */
- _generate_protocol_version: function() {
- return 'v=0';
- },
-
- /**
- * Generates SDP origin
- * @private
- * @returns {String} SDP origin raw text
- */
- _generate_origin: function() {
- var sdp_origin = '';
-
- try {
- // Values
- var jid = new JSJaCJID(this.parent.get_initiator());
-
- var username = jid.getNode() ? jid.getNode() : '-';
- var session_id = '1';
- var session_version = '1';
- var nettype = JSJAC_JINGLE_SDP_CANDIDATE_SCOPE_DEFAULT;
- var addrtype = JSJAC_JINGLE_SDP_CANDIDATE_IPVERSION_DEFAULT;
- var unicast_address = JSJAC_JINGLE_SDP_CANDIDATE_IP_DEFAULT;
-
- // Line content
- sdp_origin += 'o=';
- sdp_origin += username + ' ';
- sdp_origin += session_id + ' ';
- sdp_origin += session_version + ' ';
- sdp_origin += nettype + ' ';
- sdp_origin += addrtype + ' ';
- sdp_origin += unicast_address;
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:sdp] _generate_origin > ' + e, 1);
- }
-
- return sdp_origin;
- },
-
- /**
- * Generates SDP session name
- * @private
- * @returns {String} SDP session name raw text
- */
- _generate_session_name: function() {
- return 's=' + (this.parent.get_sid() || '-');
- },
-
- /**
- * Generates SDP timing
- * @private
- * @returns {String} SDP timing raw text
- */
- _generate_timing: function() {
- return 't=0 0';
- },
-
- /**
- * Generates SDP credentials
- * @private
- * @param {String} ufrag
- * @param {String} pwd
- * @param {Object} fingerprint
- * @returns {String} SDP credentials raw text
- */
- _generate_credentials: function(ufrag, pwd, fingerprint) {
- var sdp = '';
-
- // ICE credentials
- if(ufrag) sdp += 'a=ice-ufrag:' + ufrag + WEBRTC_SDP_LINE_BREAK;
- if(pwd) sdp += 'a=ice-pwd:' + pwd + WEBRTC_SDP_LINE_BREAK;
-
- // Fingerprint
- if(fingerprint) {
- if(fingerprint.hash && fingerprint.value) {
- sdp += 'a=fingerprint:' + fingerprint.hash + ' ' + fingerprint.value;
- sdp += WEBRTC_SDP_LINE_BREAK;
- }
- }
-
- return sdp;
- },
-
- /**
- * Generates SDP media description
- * @private
- * @param {String} media
- * @param {String} port
- * @param {String} crypto
- * @param {Object} fingerprint
- * @param {Array} payload
- * @returns {String} SDP media raw text
- */
- _generate_description_media: function(media, port, crypto, fingerprint, payload) {
- var sdp_media = '';
-
- try {
- var i;
- var type_ids = [];
-
- sdp_media += 'm=' + media + ' ' + port + ' ';
-
- // Protocol
- if((crypto && crypto.length) || (fingerprint && fingerprint.hash && fingerprint.value))
- sdp_media += 'RTP/SAVPF';
- else
- sdp_media += 'RTP/AVPF';
-
- // Payload type IDs
- for(i in payload) type_ids.push(payload[i].attrs.id);
-
- sdp_media += ' ' + type_ids.join(' ');
- } catch(e) {
- this.parent.get_debug().log('[JSJaCJingle:sdp] _generate_description_media > ' + e, 1);
- }
-
- return sdp_media;
- },
- }
-);
-
-/**
- * @fileoverview JSJaC Jingle library - Base call lib
- *
- * @url https://github.com/valeriansaliou/jsjac-jingle
- * @depends https://github.com/sstrigler/JSJaC
- * @author Valérian Saliou https://valeriansaliou.name/
- * @license Mozilla Public License v2.0 (MPL v2.0)
- */
-
-
-/** @module jsjac-jingle/base */
-/** @exports __JSJaCJingleBase */
-
-
-/**
- * Abstract base class for XMPP Jingle sessions.
- * @abstract
- * @class
- * @classdesc Abstract base class for XMPP Jingle sessions.
- * @requires nicolas-van/ring.js
- * @requires sstrigler/JSJaC
- * @requires jsjac-jingle/utils
- * @requires jsjac-jingle/sdp
- * @see {@link http://ringjs.neoname.eu/|Ring.js}
- * @see {@link http://stefan-strigler.de/jsjac-1.3.4/doc/|JSJaC Documentation}
- * @param {Object} [args] - Jingle session arguments.
- * @property {DOM} [args.local_view] - The path to the local stream view element.
- * @property {Boolean} [args.local_stream_readonly] - Whether the local stream is read-only or not.
- * @property {String} [args.to] - The full JID to start the Jingle session with.
- * @property {String} [args.connection] - The connection to be attached to.
- * @property {String} [args.media] - The media type to be used in the Jingle session.
- * @property {String} [args.resolution] - The resolution to be used for video in the Jingle session.
- * @property {String} [args.bandwidth] - The bandwidth to be limited for video in the Jingle session.
- * @property {String} [args.fps] - The framerate to be used for video in the Jingle session.
- * @property {Array} [args.stun] - A list of STUN servers to use (override the default one).
- * @property {Array} [args.turn] - A list of TURN servers to use.
- * @property {Boolean} [args.sdp_trace] - Log SDP trace in console (requires a debug interface).
- * @property {Boolean} [args.net_trace] - Log network packet trace in console (requires a debug interface).
- * @property {JSJaCDebugger} [args.debug] - A reference to a debugger implementing the JSJaCDebugger interface.
- */
-var __JSJaCJingleBase = ring.create(
- /** @lends __JSJaCJingleBase.prototype */
- {
- /**
- * Constructor
- */
- constructor: function(args) {
- /**
- * @constant
- * @member {JSJaCJingleUtils}
- * @readonly
- * @default
- * @public
- */
- this.utils = new JSJaCJingleUtils(this);
-
- /**
- * @constant
- * @member {JSJaCJingleSDP}
- * @readonly
- * @default
- * @public
- */
- this.sdp = new JSJaCJingleSDP(this);
-
- if(args && args.to)
- /**
- * @constant
- * @member {String}
- * @default
- * @private
- */
- this._to = args.to;
-
- if(args && args.connection) {
- /**
- * @constant
- * @member {JSJaCConnection}
- * @default
- * @private
- */
- this._connection = args.connection;
- } else {
- /**
- * @constant
- * @member {JSJaCConnection}
- * @default
- * @private
- */
- this._connection = JSJaCJingleStorage.get_connection();
- }
-
- if(args && args.media)
- /**
- * @member {String}
- * @default
- * @private
- */
- this._media = args.media;
-
- if(args && args.video_source)
- /**
- * @member {String}
- * @default
- * @private
- */
- this._video_source = args.video_source;
-
- if(args && args.resolution)
- /**
- * @member {String}
- * @default
- * @private
- */
- this._resolution = args.resolution;
-
- if(args && args.bandwidth)
- /**
- * @member {Number}
- * @default
- * @private
- */
- this._bandwidth = args.bandwidth;
-
- if(args && args.fps)
- /**
- * @member {Number}
- * @default
- * @private
- */
- this._fps = args.fps;
-
- if(args && args.local_view) {
- if(args.local_view instanceof Array) {
- /**
- * @member {DOM}
- * @default
- * @private
- */
- this._local_view = args.local_view;
- } else {
- /**
- * @member {DOM}
- * @default
- * @private
- */
- this._local_view = [args.local_view];
- }
- }
-
- if(args && args.local_stream_readonly) {
- /**
- * @constant
- * @member {Boolean}
- * @default
- * @private
- */
- this._local_stream_readonly = args.local_stream_readonly;
- } else {
- this._local_stream_readonly = false;
- }
-
- if(args && args.stun) {
- /**
- * @constant
- * @member {Array}
- * @default
- * @private
- */
- this._stun = args.stun;
- } else {
- this._stun = [];
- }
-
- if(args && args.turn) {
- /**
- * @constant
- * @member {Array}
- * @default
- * @private
- */
- this._turn = args.turn;
- } else {
- this._turn = [];
- }
-
- if(args && args.sdp_trace)
- /**
- * @member {Boolean}
- * @default
- * @private
- */
- this._sdp_trace = args.sdp_trace;
-
- if(args && args.net_trace)
- /**
- * @member {Boolean}
- * @default
- * @private
- */
- this._net_trace = args.net_trace;
-
- if(args && args.debug && args.debug.log) {
- /**
- * @member {JSJaCDebugger}
- * @default
- * @private
- */
- this._debug = args.debug;
- } else {
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._debug = JSJaCJingleStorage.get_debug();
- }
-
- /**
- * @member {String}
- * @default
- * @private
- */
- this._initiator = '';
-
- /**
- * @member {String}
- * @default
- * @private
- */
- this._responder = '';
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._creator = {};
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._senders = {};
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._local_stream = null;
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._content_local = [];
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._peer_connection = {};
-
- /**
- * @member {Number}
- * @default
- * @private
- */
- this._id = 0;
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._sent_id = {};
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._received_id = {};
-
- /**
- * @member {Array}
- * @default
- * @private
- */
- this._payloads_local = [];
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._group_local = {};
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._candidates_local = {};
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._candidates_queue_local = {};
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._registered_handlers = {};
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._deferred_handlers = {};
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._mute = {};
-
- /**
- * @member {Boolean}
- * @default
- * @private
- */
- this._lock = false;
-
- /**
- * @member {Boolean}
- * @default
- * @private
- */
- this._media_busy = false;
-
- /**
- * @member {String}
- * @default
- * @private
- */
- this._sid = '';
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._name = {};
- },
-
-
-
- /**
- * JSJSAC JINGLE REGISTERS
- */
-
- /**
- * Registers a given handler on a given Jingle stanza
- * @public
- * @param {String} node
- * @param {String} type
- * @param {String} id
- * @param {Function} fn
- * @returns {Boolean} Success
- */
- register_handler: function(node, type, id, fn) {
- this.get_debug().log('[JSJaCJingle:base] register_handler', 4);
-
- try {
- if(typeof fn !== 'function') {
- this.get_debug().log('[JSJaCJingle:base] register_handler > fn parameter not passed or not a function!', 1);
- return false;
- }
-
- if(id) {
- this._set_registered_handlers(node, type, id, fn);
-
- this.get_debug().log('[JSJaCJingle:base] register_handler > Registered handler for node: ' + node + ', id: ' + id + ' and type: ' + type, 3);
- return true;
- } else {
- this.get_debug().log('[JSJaCJingle:base] register_handler > Could not register handler (no ID).', 1);
- return false;
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:base] register_handler > ' + e, 1);
- }
-
- return false;
- },
-
- /**
- * Unregisters the given handler on a given Jingle stanza
- * @public
- * @param {String} node
- * @param {String} type
- * @param {String} id
- * @returns {Boolean} Success
- */
- unregister_handler: function(node, type, id) {
- this.get_debug().log('[JSJaCJingle:base] unregister_handler', 4);
-
- try {
- if(this.get_registered_handlers(node, type, id).length >= 1) {
- this._set_registered_handlers(node, type, id, null);
-
- this.get_debug().log('[JSJaCJingle:base] unregister_handler > Unregistered handler for node: ' + node + ', id: ' + id + ' and type: ' + type, 3);
- return true;
- } else {
- this.get_debug().log('[JSJaCJingle:base] unregister_handler > Could not unregister handler with node: ' + node + ', id: ' + id + ' and type: ' + type + ' (not found).', 2);
- return false;
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:base] unregister_handler > ' + e, 1);
- }
-
- return false;
- },
-
- /**
- * Defers a given handler
- * @public
- * @param {String} ns
- * @param {Function} fn
- * @returns {Boolean} Success
- */
- defer_handler: function(ns, fn) {
- this.get_debug().log('[JSJaCJingle:base] defer_handler', 4);
-
- try {
- if(typeof fn !== 'function') {
- this.get_debug().log('[JSJaCJingle:base] defer_handler > fn parameter not passed or not a function!', 1);
- return false;
- }
-
- this._set_deferred_handlers(ns, fn);
-
- this.get_debug().log('[JSJaCJingle:base] defer_handler > Deferred handler for namespace: ' + ns, 3);
- return true;
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:base] defer_handler > ' + e, 1);
- }
-
- return false;
- },
-
- /**
- * Undefers the given handler
- * @public
- * @param {String} ns
- * @returns {Boolean} Success
- */
- undefer_handler: function(ns) {
- this.get_debug().log('[JSJaCJingle:base] undefer_handler', 4);
-
- try {
- if(ns in this._deferred_handlers) {
- this._set_deferred_handlers(ns, null);
-
- this.get_debug().log('[JSJaCJingle:base] undefer_handler > Undeferred handler for namespace: ' + ns, 3);
- return true;
- } else {
- this.get_debug().log('[JSJaCJingle:base] undefer_handler > Could not undefer handler with namespace: ' + ns + ' (not found).', 2);
- return false;
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:base] undefer_handler > ' + e, 1);
- }
-
- return false;
- },
-
- /**
- * Registers a view element
- * @public
- * @param {String} tyoe
- * @param {DOM} view
- * @returns {Boolean} Success
- */
- register_view: function(type, view) {
- this.get_debug().log('[JSJaCJingle:base] register_view', 4);
-
- try {
- // Get view functions
- var fn = this.utils.map_register_view(type);
-
- if(fn.type == type) {
- var i;
-
- // Check view is not already registered
- for(i in (fn.view.get)()) {
- if((fn.view.get)()[i] == view) {
- this.get_debug().log('[JSJaCJingle:base] register_view > Could not register view of type: ' + type + ' (already registered).', 2);
- return true;
- }
- }
-
- // Proceeds registration
- (fn.view.set)(view);
-
- this.utils._peer_stream_attach(
- [view],
- (fn.stream.get)(),
- fn.mute
- );
-
- this.get_debug().log('[JSJaCJingle:base] register_view > Registered view of type: ' + type, 3);
-
- return true;
- } else {
- this.get_debug().log('[JSJaCJingle:base] register_view > Could not register view of type: ' + type + ' (type unknown).', 1);
- return false;
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:base] register_view > ' + e, 1);
- }
-
- return false;
- },
-
- /**
- * Unregisters a view element
- * @public
- * @param {String} type
- * @param {DOM} view
- * @returns {Boolean} Success
- */
- unregister_view: function(type, view) {
- this.get_debug().log('[JSJaCJingle:base] unregister_view', 4);
-
- try {
- // Get view functions
- var fn = this.utils.map_unregister_view(type);
-
- if(fn.type == type) {
- var i;
-
- // Check view is registered
- for(i in (fn.view.get)()) {
- if((fn.view.get)()[i] == view) {
- // Proceeds un-registration
- this.utils._peer_stream_detach(
- [view]
- );
-
- this.utils.array_remove_value(
- (fn.view.get)(),
- view
- );
-
- this.get_debug().log('[JSJaCJingle:base] unregister_view > Unregistered view of type: ' + type, 3);
- return true;
- }
- }
-
- this.get_debug().log('[JSJaCJingle:base] unregister_view > Could not unregister view of type: ' + type + ' (not found).', 2);
- return true;
- } else {
- this.get_debug().log('[JSJaCJingle:base] unregister_view > Could not unregister view of type: ' + type + ' (type unknown).', 1);
- return false;
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:base] unregister_view > ' + e, 1);
- }
-
- return false;
- },
-
-
-
- /**
- * JSJSAC JINGLE PEER TOOLS
- */
-
- /**
- * Creates a new peer connection
- * @private
- * @param {Function} sdp_message_callback
- */
- _peer_connection_create: function(sdp_message_callback) {
- this.get_debug().log('[JSJaCJingle:base] _peer_connection_create', 4);
-
- try {
- // Create peer connection instance
- this._peer_connection_create_instance();
-
- // Event callbacks
- this._peer_connection_callbacks(sdp_message_callback);
-
- // Add local stream
- this._peer_connection_create_local_stream();
-
- // Create offer/answer
- this._peer_connection_create_dispatch(sdp_message_callback);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:base] _peer_connection_create > ' + e, 1);
- }
- },
-
- /**
- * Creates peer connection local stream
- * @private
- */
- _peer_connection_create_local_stream: function() {
- this.get_debug().log('[JSJaCJingle:base] _peer_connection_create_local_stream', 4);
-
- try {
- this.get_peer_connection().addStream(
- this.get_local_stream()
- );
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:base] _peer_connection_create_local_stream > ' + e, 1);
- }
- },
-
- /**
- * Requests the user media (audio/video)
- * @private
- * @param {Function} callback
- */
- _peer_get_user_media: function(callback) {
- this.get_debug().log('[JSJaCJingle:base] _peer_get_user_media', 4);
-
- try {
- if(this.get_local_stream() === null) {
- this.get_debug().log('[JSJaCJingle:base] _peer_get_user_media > Getting user media...', 2);
-
- (WEBRTC_GET_MEDIA.bind(navigator))(
- this.utils.generate_constraints(),
- this._peer_got_user_media_success.bind(this, callback),
- this._peer_got_user_media_error.bind(this)
- );
- } else {
- this.get_debug().log('[JSJaCJingle:base] _peer_get_user_media > User media already acquired.', 2);
-
- callback();
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:base] _peer_get_user_media > ' + e, 1);
- }
- },
-
- /**
- * Triggers the media obtained success event
- * @private
- * @param {Function} callback
- * @param {Object} stream
- */
- _peer_got_user_media_success: function(callback, stream) {
- this.get_debug().log('[JSJaCJingle:base] _peer_got_user_media_success', 4);
-
- try {
- this.get_debug().log('[JSJaCJingle:base] _peer_got_user_media_success > Got user media.', 2);
-
- this._set_local_stream(stream);
-
- if(callback && typeof callback == 'function') {
- if((this.get_media() == JSJAC_JINGLE_MEDIA_VIDEO) && this.get_local_view().length) {
- var _this = this;
-
- var fn_loaded = function() {
- _this.get_debug().log('[JSJaCJingle:base] _peer_got_user_media_success > Local video loaded.', 2);
-
- this.removeEventListener('loadeddata', fn_loaded, false);
- callback();
- };
-
- if(_this.get_local_view()[0].readyState >= JSJAC_JINGLE_MEDIA_READYSTATE_LOADED) {
- fn_loaded();
- } else {
- this.get_debug().log('[JSJaCJingle:base] _peer_got_user_media_success > Waiting for local video to be loaded...', 2);
-
- _this.get_local_view()[0].addEventListener('loadeddata', fn_loaded, false);
- }
- } else {
- callback();
- }
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:base] _peer_got_user_media_success > ' + e, 1);
- }
- },
-
- /**
- * Triggers the SDP description retrieval success event
- * @private
- * @param {Object} sdp_local
- * @param {Function} [sdp_message_callback]
- */
- _peer_got_description: function(sdp_local, sdp_message_callback) {
- this.get_debug().log('[JSJaCJingle:base] _peer_got_description', 4);
-
- try {
- this.get_debug().log('[JSJaCJingle:base] _peer_got_description > Got local description.', 2);
-
- if(this.get_sdp_trace()) this.get_debug().log('[JSJaCJingle:base] _peer_got_description > SDP (local:raw)' + '\n\n' + sdp_local.sdp, 4);
-
- // Convert SDP raw data to an object
- var cur_name;
- var payload_parsed = this.sdp._parse_payload(sdp_local.sdp);
- this.sdp._resolution_payload(payload_parsed);
-
- for(cur_name in payload_parsed) {
- this._set_payloads_local(
- cur_name,
- payload_parsed[cur_name]
- );
- }
-
- var cur_semantics;
- var group_parsed = this.sdp._parse_group(sdp_local.sdp);
-
- for(cur_semantics in group_parsed) {
- this._set_group_local(
- cur_semantics,
- group_parsed[cur_semantics]
- );
- }
-
- // Filter our local description (remove unused medias)
- var sdp_local_desc = this.sdp._generate_description(
- sdp_local.type,
- this.get_group_local(),
- this.get_payloads_local(),
-
- this.sdp._generate_candidates(
- this.get_candidates_local()
- )
- );
-
- if(this.get_sdp_trace()) this.get_debug().log('[JSJaCJingle:base] _peer_got_description > SDP (local:gen)' + '\n\n' + sdp_local_desc.sdp, 4);
-
- var _this = this;
-
- this.get_peer_connection().setLocalDescription(
- (new WEBRTC_SESSION_DESCRIPTION(sdp_local_desc)),
-
- function() {
- // Success (descriptions are compatible)
- },
-
- function(e) {
- var error_str = (typeof e == 'string') ? e : null;
- error_str = (error_str || e.message || e.name || 'Unknown error');
-
- if(_this.get_sdp_trace()) _this.get_debug().log('[JSJaCJingle:base] _peer_got_description > SDP (local:error)' + '\n\n' + error_str, 1);
-
- // Error (descriptions are incompatible)
- }
- );
-
- // Need to wait for local candidates?
- if(typeof sdp_message_callback == 'function') {
- this.get_debug().log('[JSJaCJingle:base] _peer_got_description > Executing SDP message callback.', 2);
-
- /* @function */
- sdp_message_callback();
- } else if(this.utils.count_candidates(this._shortcut_local_user_candidates()) === 0) {
- this.get_debug().log('[JSJaCJingle:base] _peer_got_description > Waiting for local candidates...', 2);
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:base] _peer_got_description > ' + e, 1);
- }
- },
-
- /**
- * Triggers the SDP description not retrieved error event
- * @private
- */
- _peer_fail_description: function() {
- this.get_debug().log('[JSJaCJingle:base] _peer_fail_description', 4);
-
- try {
- this.get_debug().log('[JSJaCJingle:base] _peer_fail_description > Could not get local description!', 1);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:base] _peer_fail_description > ' + e, 1);
- }
- },
-
- /**
- * Enables/disables the local stream sound
- * @private
- * @param {Boolean} enable
- */
- _peer_sound: function(enable) {
- this.get_debug().log('[JSJaCJingle:base] _peer_sound', 4);
-
- try {
- this.get_debug().log('[JSJaCJingle:base] _peer_sound > Enable: ' + enable, 2);
-
- var i;
- var audio_tracks = this.get_local_stream().getAudioTracks();
-
- for(i = 0; i < audio_tracks.length; i++)
- audio_tracks[i].enabled = enable;
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:base] _peer_sound > ' + e, 1);
- }
- },
-
- /**
- * Attaches given stream to given DOM element
- * @private
- * @param {DOM} element
- * @param {Object} stream
- * @param {Boolean} mute
- */
- _peer_stream_attach: function(element, stream, mute) {
- try {
- var i;
- var stream_src = stream ? URL.createObjectURL(stream) : '';
-
- for(i in element) {
- element[i].src = stream_src;
-
- if(navigator.mozGetUserMedia)
- element[i].play();
- else
- element[i].autoplay = true;
-
- if(typeof mute == 'boolean') element[i].muted = mute;
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:base] _peer_stream_attach > ' + e, 1);
- }
- },
-
- /**
- * Detaches stream from given DOM element
- * @private
- * @param {DOM} element
- */
- _peer_stream_detach: function(element) {
- try {
- var i;
-
- for(i in element) {
- element[i].pause();
- element[i].src = '';
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:base] _peer_stream_detach > ' + e, 1);
- }
- },
-
-
-
- /**
- * JSJSAC JINGLE STATES
- */
-
- /**
- * Am I responder?
- * @public
- * @returns {Boolean} Receiver state
- */
- is_responder: function() {
- return this.utils.negotiation_status() == JSJAC_JINGLE_SENDERS_RESPONDER.jingle;
- },
-
- /**
- * Am I initiator?
- * @public
- * @returns {Boolean} Initiator state
- */
- is_initiator: function() {
- return this.utils.negotiation_status() == JSJAC_JINGLE_SENDERS_INITIATOR.jingle;
- },
-
-
-
- /**
- * JSJSAC JINGLE SHORTCUTS
- */
-
- /**
- * Gets function handler for given member
- * @private
- * @param {Function|Object} member
- * @returns {Function} Handler
- */
- _shortcut_get_handler: function(member) {
- if(typeof member == 'function')
- return member;
-
- return function() {};
- },
-
-
-
- /**
- * JSJSAC JINGLE GETTERS
- */
-
- /**
- * Gets the namespace
- * @public
- * @returns {String} Namespace value
- */
- get_namespace: function() {
- return this._namespace;
- },
-
- /**
- * Gets the local payloads
- * @public
- * @param {String} [name]
- * @returns {Object} Local payloads object
- */
- get_payloads_local: function(name) {
- if(name)
- return (name in this._payloads_local) ? this._payloads_local[name] : {};
-
- return this._payloads_local;
- },
-
- /**
- * Gets the local group
- * @public
- * @param {String} [semantics]
- * @returns {Object} Local group object
- */
- get_group_local: function(semantics) {
- if(semantics)
- return (semantics in this._group_local) ? this._group_local[semantics] : {};
-
- return this._group_local;
- },
-
- /**
- * Gets the local candidates
- * @public
- * @param {String} [name]
- * @returns {Object} Local candidates object
- */
- get_candidates_local: function(name) {
- if(name)
- return (name in this._candidates_local) ? this._candidates_local[name] : {};
-
- return this._candidates_local;
- },
-
- /**
- * Gets the local candidates queue
- * @public
- * @param {String} [name]
- * @returns {Object} Local candidates queue object
- */
- get_candidates_queue_local: function(name) {
- if(name)
- return (name in this._candidates_queue_local) ? this._candidates_queue_local[name] : {};
-
- return this._candidates_queue_local;
- },
-
- /**
- * Gets the local content
- * @public
- * @param {String} [name]
- * @returns {Object} Local content object
- */
- get_content_local: function(name) {
- if(name)
- return (name in this._content_local) ? this._content_local[name] : {};
-
- return this._content_local;
- },
-
- /**
- * Gets the peer connection
- * @public
- * @returns {Object} Peer connection
- */
- get_peer_connection: function() {
- return this._peer_connection;
- },
-
- /**
- * Gets the ID
- * @public
- * @returns {Number} ID value
- */
- get_id: function() {
- return this._id;
- },
-
- /**
- * Gets the new ID
- * @public
- * @returns {String} New ID value
- */
- get_id_new: function() {
- var trans_id = this.get_id() + 1;
- this._set_id(trans_id);
-
- return this.get_id_pre() + trans_id;
- },
-
- /**
- * Gets the sent IDs
- * @public
- * @returns {Object} Sent IDs object
- */
- get_sent_id: function() {
- return this._sent_id;
- },
-
- /**
- * Gets the received IDs
- * @public
- * @returns {Object} Received IDs object
- */
- get_received_id: function() {
- return this._received_id;
- },
-
- /**
- * Gets the registered stanza handler
- * @public
- * @param {String} node
- * @param {String} type
- * @param {String} id
- * @returns {Array} Stanza handler
- */
- get_registered_handlers: function(node, type, id) {
- if(id && node in this._registered_handlers &&
- type in this._registered_handlers[node] &&
- typeof this._registered_handlers[node][type][id] == 'object')
- return this._registered_handlers[node][type][id];
-
- return [];
- },
-
- /**
- * Gets the deferred stanza handler
- * @public
- * @param {String} ns
- * @returns {Array} Stanza handler
- */
- get_deferred_handlers: function(ns) {
- return this._deferred_handlers[ns] || [];
- },
-
- /**
- * Gets the mute state
- * @public
- * @param {String} [name]
- * @returns {Boolean} Mute value
- */
- get_mute: function(name) {
- if(!name) name = '*';
-
- return (name in this._mute) ? this._mute[name] : false;
- },
-
- /**
- * Gets the lock value
- * @public
- * @returns {Boolean} Lock value
- */
- get_lock: function() {
- return this._lock || !JSJAC_JINGLE_AVAILABLE;
- },
-
- /**
- * Gets the media busy value
- * @public
- * @returns {Boolean} Media busy value
- */
- get_media_busy: function() {
- return this._media_busy;
- },
-
- /**
- * Gets the sid value
- * @public
- * @returns {String} SID value
- */
- get_sid: function() {
- return this._sid;
- },
-
- /**
- * Gets the status value
- * @public
- * @returns {String} Status value
- */
- get_status: function() {
- return this._status;
- },
-
- /**
- * Gets the connection value
- * @public
- * @returns {JSJaCConnection} Connection value
- */
- get_connection: function() {
- return this._connection;
- },
-
- /**
- * Gets the to value
- * @public
- * @returns {String} To value
- */
- get_to: function() {
- return this._to;
- },
-
- /**
- * Gets the initiator value
- * @public
- * @returns {String} Initiator value
- */
- get_initiator: function() {
- return this._initiator;
- },
-
- /**
- * Gets the responder value
- * @public
- * @returns {String} Responder value
- */
- get_responder: function() {
- return this._responder;
- },
-
- /**
- * Gets the creator value
- * @public
- * @param {String} [name]
- * @returns {String|Object} Creator value
- */
- get_creator: function(name) {
- if(name)
- return (name in this._creator) ? this._creator[name] : null;
-
- return this._creator;
- },
-
- /**
- * Gets the creator value (for this)
- * @public
- * @param {String} name
- * @returns {String} Creator value
- */
- get_creator_this: function(name) {
- return this.get_responder() == this.get_to() ? JSJAC_JINGLE_CREATOR_INITIATOR : JSJAC_JINGLE_CREATOR_RESPONDER;
- },
-
- /**
- * Gets the senders value
- * @public
- * @param {String} [name]
- * @returns {String} Senders value
- */
- get_senders: function(name) {
- if(name)
- return (name in this._senders) ? this._senders[name] : null;
-
- return this._senders;
- },
-
- /**
- * Gets the media value
- * @public
- * @returns {String} Media value
- */
- get_media: function() {
- return (this._media && this._media in JSJAC_JINGLE_MEDIAS) ? this._media : JSJAC_JINGLE_MEDIA_VIDEO;
- },
-
- /**
- * Gets a list of medias in use
- * @public
- * @returns {Object} Media list
- */
- get_media_all: function() {
- if(this.get_media() == JSJAC_JINGLE_MEDIA_AUDIO)
- return [JSJAC_JINGLE_MEDIA_AUDIO];
-
- return [JSJAC_JINGLE_MEDIA_AUDIO, JSJAC_JINGLE_MEDIA_VIDEO];
- },
-
- /**
- * Gets the video source value
- * @public
- * @returns {String} Video source value
- */
- get_video_source: function() {
- return (this._video_source && this._video_source in JSJAC_JINGLE_VIDEO_SOURCES) ? this._video_source : JSJAC_JINGLE_VIDEO_SOURCE_CAMERA;
- },
-
- /**
- * Gets the resolution value
- * @public
- * @returns {String} Resolution value
- */
- get_resolution: function() {
- return this._resolution ? (this._resolution).toString() : null;
- },
-
- /**
- * Gets the bandwidth value
- * @public
- * @returns {String} Bandwidth value
- */
- get_bandwidth: function() {
- return this._bandwidth ? (this._bandwidth).toString() : null;
- },
-
- /**
- * Gets the FPS value
- * @public
- * @returns {String} FPS value
- */
- get_fps: function() {
- return this._fps ? (this._fps).toString() : null;
- },
-
- /**
- * Gets the name value
- * @public
- * @param {String} [name]
- * @returns {String} Name value
- */
- get_name: function(name) {
- if(name)
- return name in this._name;
-
- return this._name;
- },
-
- /**
- * Gets the local stream
- * @public
- * @returns {Object} Local stream instance
- */
- get_local_stream: function() {
- return this._local_stream;
- },
-
- /**
- * Gets the local stream read-only state
- * @public
- * @returns {Boolean} Read-only state
- */
- get_local_stream_readonly: function() {
- return this._local_stream_readonly;
- },
-
- /**
- * Gets the local view value
- * @public
- * @returns {DOM} Local view
- */
- get_local_view: function() {
- return (typeof this._local_view == 'object') ? this._local_view : [];
- },
-
- /**
- * Gets the STUN servers
- * @public
- * @returns {Array} STUN servers
- */
- get_stun: function() {
- return (typeof this._stun == 'object') ? this._stun : [];
- },
-
- /**
- * Gets the TURN servers
- * @public
- * @returns {Array} TURN servers
- */
- get_turn: function() {
- return (typeof this._turn == 'object') ? this._turn : [];
- },
-
- /**
- * Gets the SDP trace value
- * @public
- * @returns {Boolean} SDP trace value
- */
- get_sdp_trace: function() {
- return (this._sdp_trace === true);
- },
-
- /**
- * Gets the network packet trace value
- * @public
- * @returns {Boolean} Network packet trace value
- */
- get_net_trace: function() {
- return (this._net_trace === true);
- },
-
- /**
- * Gets the debug value
- * @public
- * @returns {JSJaCDebugger} Debug value
- */
- get_debug: function() {
- return this._debug;
- },
-
-
-
- /**
- * JSJSAC JINGLE SETTERS
- */
-
- /**
- * Sets the namespace
- * @private
- * @param {String} Namespace value
- */
- _set_namespace: function(namespace) {
- this._namespace = namespace;
- },
-
- /**
- * Sets the local stream
- * @private
- * @param {Object} local_stream
- */
- _set_local_stream: function(local_stream) {
- try {
- if(this.get_local_stream_readonly() === true) {
- this.get_debug().log('[JSJaCJingle:base] _set_local_stream > Local stream is read-only, not setting it.', 0); return;
- }
-
- if(!local_stream && this._local_stream) {
- (this._local_stream).stop();
-
- this._peer_stream_detach(
- this.get_local_view()
- );
- }
-
- this._set_local_stream_raw(local_stream);
-
- if(local_stream) {
- this._peer_stream_attach(
- this.get_local_view(),
- this.get_local_stream(),
- true
- );
- } else {
- this._peer_stream_detach(
- this.get_local_view()
- );
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:base] _set_local_stream > ' + e, 1);
- }
- },
-
- /**
- * Sets the local stream raw object (no further processing)
- * @private
- * @param {Object} local_stream
- */
- _set_local_stream_raw: function(local_stream) {
- this._local_stream = local_stream;
- },
-
- /**
- * Sets the local stream read-only state
- * @private
- * @param {Boolean} local_stream_readonly
- */
- _set_local_stream_readonly: function(local_stream_readonly) {
- this._local_stream_readonly = local_stream_readonly;
- },
-
- /**
- * Sets the local view
- * @private
- * @param {DOM} local_view
- */
- _set_local_view: function(local_view) {
- if(typeof this._local_view !== 'object')
- this._local_view = [];
-
- this._local_view.push(local_view);
- },
-
- /**
- * Sets the local payload
- * @private
- * @param {String} name
- * @param {Object} payload_data
- */
- _set_payloads_local: function(name, payload_data) {
- this._payloads_local[name] = payload_data;
- },
-
- /**
- * Sets the local group
- * @private
- * @param {String} name
- * @param {Object} group_data
- */
- _set_group_local: function(semantics, group_data) {
- this._group_local[semantics] = group_data;
- },
-
- /**
- * Sets the local candidates
- * @private
- * @param {String} name
- * @param {Object} candidate_data
- */
- _set_candidates_local: function(name, candidate_data) {
- if(!(name in this._candidates_local)) this._candidates_local[name] = [];
-
- (this._candidates_local[name]).push(candidate_data);
- },
-
- /**
- * Sets the local candidates queue
- * @private
- * @param {String} name
- * @param {Object} candidate_data
- */
- _set_candidates_queue_local: function(name, candidate_data) {
- try {
- if(name === null) {
- this._candidates_queue_local = {};
- } else {
- if(!(name in this._candidates_queue_local)) this._candidates_queue_local[name] = [];
-
- (this._candidates_queue_local[name]).push(candidate_data);
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:base] _set_candidates_queue_local > ' + e, 1);
- }
- },
-
- /**
- * Sets the local content
- * @private
- * @param {String} name
- * @param {Object} content_local
- */
- _set_content_local: function(name, content_local) {
- this._content_local[name] = content_local;
- },
-
- /**
- * Sets the peer connection
- * @private
- * @param {Object} peer_connection
- */
- _set_peer_connection: function(peer_connection) {
- this._peer_connection = peer_connection;
- },
-
- /**
- * Sets the ID
- * @private
- * @param {String|Number} id
- */
- _set_id: function(id) {
- this._id = id;
- },
-
- /**
- * Sets the sent ID
- * @private
- * @param {String|Number} sent_id
- */
- _set_sent_id: function(sent_id) {
- this._sent_id[sent_id] = 1;
- },
-
- /**
- * Sets the last received ID
- * @private
- * @param {String|Number} received_id
- */
- _set_received_id: function(received_id) {
- this._received_id[received_id] = 1;
- },
-
- /**
- * Sets the registered stanza handlers
- * @private
- * @param {String} node
- * @param {String} type
- * @param {String|Number} id
- * @param {Function} handler
- */
- _set_registered_handlers: function(node, type, id, handler) {
- if(!(node in this._registered_handlers)) this._registered_handlers[node] = {};
- if(!(type in this._registered_handlers[node])) this._registered_handlers[node][type] = {};
-
- if(handler === null) {
- if(id in this._registered_handlers[node][type])
- delete this._registered_handlers[node][type][id];
- } else {
- if(typeof this._registered_handlers[node][type][id] != 'object')
- this._registered_handlers[node][type][id] = [];
-
- this._registered_handlers[node][type][id].push(handler);
- }
- },
-
- /**
- * Sets the deferred stanza handlers
- * @private
- * @param {String} ns
- * @param {Function|Object} handler
- */
- _set_deferred_handlers: function(ns, handler) {
- if(!(ns in this._deferred_handlers)) this._deferred_handlers[ns] = [];
-
- if(handler === null)
- delete this._deferred_handlers[ns];
- else
- this._deferred_handlers[ns].push(handler);
- },
-
- /**
- * Sets the mute state
- * @private
- * @param {String} [name]
- * @param {String} mute
- */
- _set_mute: function(name, mute) {
- if(!name || name == '*') {
- this._mute = {};
- name = '*';
- }
-
- this._mute[name] = mute;
- },
-
- /**
- * Sets the lock value
- * @private
- * @param {Boolean} lock
- */
- _set_lock: function(lock) {
- this._lock = lock;
- },
-
- /**
- * Gets the media busy value
- * @private
- * @param {Boolean} busy
- */
- _set_media_busy: function(busy) {
- this._media_busy = busy;
- },
-
- /**
- * Sets the session ID
- * @private
- * @param {String} sid
- */
- _set_sid: function(sid) {
- this._sid = sid;
- },
-
- /**
- * Sets the session status
- * @private
- * @param {String} status
- */
- _set_status: function(status) {
- this._status = status;
- },
-
- /**
- * Sets the session to value
- * @private
- * @param {String} to
- */
- _set_to: function(to) {
- this._to = to;
- },
-
- /**
- * Sets the session connection value
- * @private
- * @param {JSJaCConnection} connection
- */
- _set_connection: function(connection) {
- this._connection = connection;
- },
-
- /**
- * Sets the session initiator
- * @private
- * @param {String} initiator
- */
- _set_initiator: function(initiator) {
- this._initiator = initiator;
- },
-
- /**
- * Sets the session responder
- * @private
- * @param {String} responder
- */
- _set_responder: function(responder) {
- this._responder = responder;
- },
-
- /**
- * Sets the session creator
- * @private
- * @param {String} name
- * @param {String} creator
- */
- _set_creator: function(name, creator) {
- if(!(creator in JSJAC_JINGLE_CREATORS)) creator = JSJAC_JINGLE_CREATOR_INITIATOR;
-
- this._creator[name] = creator;
- },
-
- /**
- * Sets the session senders
- * @private
- * @param {String} name
- * @param {String} senders
- */
- _set_senders: function(name, senders) {
- if(!(senders in JSJAC_JINGLE_SENDERS)) senders = JSJAC_JINGLE_SENDERS_BOTH.jingle;
-
- this._senders[name] = senders;
- },
-
- /**
- * Sets the session media
- * @private
- * @param {String} media
- */
- _set_media: function(media) {
- this._media = media;
- },
-
- /**
- * Sets the video source
- * @private
- */
- _set_video_source: function() {
- this._video_source = video_source;
- },
-
- /**
- * Sets the video resolution
- * @private
- * @param {String} resolution
- */
- _set_resolution: function(resolution) {
- this._resolution = resolution;
- },
-
- /**
- * Sets the video bandwidth
- * @private
- * @param {Number} bandwidth
- */
- _set_bandwidth: function(bandwidth) {
- this._bandwidth = bandwidth;
- },
-
- /**
- * Sets the video FPS
- * @private
- * @param {Number} fps
- */
- _set_fps: function(fps) {
- this._fps = fps;
- },
-
- /**
- * Sets the source name
- * @private
- * @param {String} name
- */
- _set_name: function(name) {
- this._name[name] = 1;
- },
-
- /**
- * Sets the STUN server address
- * @private
- * @param {String} stun_host
- * @param {Object} stun_data
- */
- _set_stun: function(stun_host, stun_data) {
- this._stun.push(
- this.utils.object_collect(
- { 'host': stun_host },
- stun_data
- )
- );
- },
-
- /**
- * Sets the TURN server address
- * @private
- * @param {String} turn_host
- * @param {Object} turn_data
- */
- _set_turn: function(turn_host, turn_data) {
- this._turn.push(
- this.utils.object_collect(
- { 'host': turn_host },
- turn_data
- )
- );
- },
-
- /**
- * Enables/disables SDP traces
- * @public
- * @param {Boolean} sdp_trace
- */
- set_sdp_trace: function(sdp_trace) {
- this._sdp_trace = sdp_trace;
- },
-
- /**
- * Enables/disables network traces
- * @public
- * @param {Boolean} net_trace
- */
- set_net_trace: function(net_trace) {
- this._net_trace = net_trace;
- },
-
- /**
- * Sets the debugging wrapper
- * @public
- * @param {JSJaCDebugger} debug
- */
- set_debug: function(debug) {
- this._debug = debug;
- },
- }
-);
-
-/**
- * @fileoverview JSJaC Jingle library - Single (one-to-one) call lib
- *
- * @url https://github.com/valeriansaliou/jsjac-jingle
- * @depends https://github.com/sstrigler/JSJaC
- * @author Valérian Saliou https://valeriansaliou.name/
- * @license Mozilla Public License v2.0 (MPL v2.0)
- */
-
-
-/** @module jsjac-jingle/single */
-/** @exports JSJaCJingleSingle */
-
-
-/**
- * Creates a new XMPP Jingle session.
- * @class
- * @classdesc Creates a new XMPP Jingle session.
- * @augments __JSJaCJingleBase
- * @requires nicolas-van/ring.js
- * @requires sstrigler/JSJaC
- * @requires jsjac-jingle/main
- * @requires jsjac-jingle/base
- * @see {@link http://xmpp.org/extensions/xep-0166.html|XEP-0166: Jingle}
- * @see {@link http://ringjs.neoname.eu/|Ring.js}
- * @see {@link http://stefan-strigler.de/jsjac-1.3.4/doc/|JSJaC Documentation}
- * @param {Object} [args] - Jingle session arguments.
- * @property {*} [args.*] - Herits of JSJaCJingle() baseclass prototype.
- * @property {Function} [args.session_initiate_pending] - The initiate pending custom handler.
- * @property {Function} [args.session_initiate_success] - The initiate success custom handler.
- * @property {Function} [args.session_initiate_error] - The initiate error custom handler.
- * @property {Function} [args.session_initiate_request] - The initiate request custom handler.
- * @property {Function} [args.session_accept_pending] - The accept pending custom handler.
- * @property {Function} [args.session_accept_success] - The accept success custom handler.
- * @property {Function} [args.session_accept_error] - The accept error custom handler.
- * @property {Function} [args.session_accept_request] - The accept request custom handler.
- * @property {Function} [args.session_info_pending] - The info request custom handler.
- * @property {Function} [args.session_info_success] - The info success custom handler.
- * @property {Function} [args.session_info_error] - The info error custom handler.
- * @property {Function} [args.session_info_request] - The info request custom handler.
- * @property {Function} [args.session_terminate_pending] - The terminate pending custom handler.
- * @property {Function} [args.session_terminate_success] - The terminate success custom handler.
- * @property {Function} [args.session_terminate_error] - The terminate error custom handler.
- * @property {Function} [args.session_terminate_request] - The terminate request custom handler.
- * @property {Function} [args.stream_add] - The stream add custom handler.
- * @property {Function} [args.stream_remove] - The stream remove custom handler.
- * @property {Function} [args.stream_connected] - The stream connected custom handler.
- * @property {Function} [args.stream_disconnected] - The stream disconnected custom handler.
- * @property {DOM} [args.remote_view] - The path to the remote stream view element.
- * @property {DOM} [args.sid] - The session ID (forced).
- */
-var JSJaCJingleSingle = ring.create([__JSJaCJingleBase],
- /** @lends JSJaCJingleSingle.prototype */
- {
- /**
- * Constructor
- */
- constructor: function(args) {
- this.$super(args);
-
- if(args && args.session_initiate_pending)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_initiate_pending = args.session_initiate_pending;
-
- if(args && args.session_initiate_success)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_initiate_success = args.session_initiate_success;
-
- if(args && args.session_initiate_error)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_initiate_error = args.session_initiate_error;
-
- if(args && args.session_initiate_request)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_initiate_request = args.session_initiate_request;
-
- if(args && args.session_accept_pending)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_accept_pending = args.session_accept_pending;
-
- if(args && args.session_accept_success)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_accept_success = args.session_accept_success;
-
- if(args && args.session_accept_error)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_accept_error = args.session_accept_error;
-
- if(args && args.session_accept_request)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_accept_request = args.session_accept_request;
-
- if(args && args.session_info_pending)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_info_pending = args.session_info_pending;
-
- if(args && args.session_info_success)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_info_success = args.session_info_success;
-
- if(args && args.session_info_error)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_info_error = args.session_info_error;
-
- if(args && args.session_info_request)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_info_request = args.session_info_request;
-
- if(args && args.session_terminate_pending)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_terminate_pending = args.session_terminate_pending;
-
- if(args && args.session_terminate_success)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_terminate_success = args.session_terminate_success;
-
- if(args && args.session_terminate_error)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_terminate_error = args.session_terminate_error;
-
- if(args && args.session_terminate_request)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_terminate_request = args.session_terminate_request;
-
- if(args && args.stream_add)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._stream_add = args.stream_add;
-
- if(args && args.stream_remove)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._stream_remove = args.stream_remove;
-
- if(args && args.stream_connected)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._stream_connected = args.stream_connected;
-
- if(args && args.stream_disconnected)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._stream_disconnected = args.stream_disconnected;
-
- if(args && args.remote_view)
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._remote_view = [args.remote_view];
-
- if(args && args.sid)
- /**
- * @member {String}
- * @default
- * @private
- */
- this._sid = [args.sid];
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._remote_stream = {};
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._content_remote = {};
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._payloads_remote = {};
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._group_remote = {};
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._candidates_remote = {};
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._candidates_queue_remote = {};
-
- /**
- * @member {String|Object}
- * @default
- * @private
- */
- this._last_ice_state = null;
-
- /**
- * @constant
- * @member {String}
- * @default
- * @private
- */
- this._status = JSJAC_JINGLE_STATUS_INACTIVE;
-
- /**
- * @constant
- * @member {String}
- * @default
- * @private
- */
- this._reason = JSJAC_JINGLE_REASON_CANCEL;
-
- /**
- * @constant
- * @member {String}
- * @default
- * @private
- */
- this._namespace = NS_JINGLE;
- },
-
-
- /**
- * Initiates a new Jingle session.
- * @public
- * @fires JSJaCJingleSingle#get_session_initiate_pending
- */
- initiate: function() {
- this.get_debug().log('[JSJaCJingle:single] initiate', 4);
-
- try {
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:single] initiate > Cannot initiate, resource locked. Please open another session or check WebRTC support.', 0);
- return;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.initiate(); })) {
- this.get_debug().log('[JSJaCJingle:single] initiate > Deferred (waiting for the library components to be initiated).', 0);
- return;
- }
-
- // Slot unavailable?
- if(this.get_status() !== JSJAC_JINGLE_STATUS_INACTIVE) {
- this.get_debug().log('[JSJaCJingle:single] initiate > Cannot initiate, resource not inactive (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- this.get_debug().log('[JSJaCJingle:single] initiate > New Jingle Single session with media: ' + this.get_media(), 2);
-
- // Common vars
- var i, cur_name;
-
- // Trigger init pending custom callback
- /* @function */
- (this.get_session_initiate_pending())(this);
-
- // Change session status
- this._set_status(JSJAC_JINGLE_STATUS_INITIATING);
-
- // Set session values
- if(!this.get_sid()) this._set_sid(this.utils.generate_sid());
-
- this._set_initiator(this.utils.connection_jid());
- this._set_responder(this.get_to());
-
- for(i in this.get_media_all()) {
- cur_name = this.utils.name_generate(
- this.get_media_all()[i]
- );
-
- this._set_name(cur_name);
-
- this._set_senders(
- cur_name,
- JSJAC_JINGLE_SENDERS_BOTH.jingle
- );
-
- this._set_creator(
- cur_name,
- JSJAC_JINGLE_CREATOR_INITIATOR
- );
- }
-
- // Register session to common router
- JSJaCJingle._add(JSJAC_JINGLE_SESSION_SINGLE, this.get_sid(), this);
-
- // Initialize WebRTC
- this._peer_get_user_media(function() {
- _this._peer_connection_create(
- function() {
- _this.get_debug().log('[JSJaCJingle:single] initiate > Ready to begin Jingle negotiation.', 2);
-
- _this.send(JSJAC_JINGLE_IQ_TYPE_SET, { action: JSJAC_JINGLE_ACTION_SESSION_INITIATE });
- }
- );
- });
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] initiate > ' + e, 1);
- }
- },
-
- /**
- * Accepts the Jingle session.
- * @public
- * @fires JSJaCJingleSingle#get_session_accept_pending
- */
- accept: function() {
- this.get_debug().log('[JSJaCJingle:single] accept', 4);
-
- try {
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:single] accept > Cannot accept, resource locked. Please open another session or check WebRTC support.', 0);
- return;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.accept(); })) {
- this.get_debug().log('[JSJaCJingle:single] accept > Deferred (waiting for the library components to be initiated).', 0);
- return;
- }
-
- // Slot unavailable?
- if(this.get_status() !== JSJAC_JINGLE_STATUS_INITIATED) {
- this.get_debug().log('[JSJaCJingle:single] accept > Cannot accept, resource not initiated (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- this.get_debug().log('[JSJaCJingle:single] accept > New Jingle session with media: ' + this.get_media(), 2);
-
- // Trigger accept pending custom callback
- /* @function */
- (this.get_session_accept_pending())(this);
-
- // Change session status
- this._set_status(JSJAC_JINGLE_STATUS_ACCEPTING);
-
- // Initialize WebRTC
- this._peer_get_user_media(function() {
- _this._peer_connection_create(
- function() {
- _this.get_debug().log('[JSJaCJingle:single] accept > Ready to complete Jingle negotiation.', 2);
-
- // Process accept actions
- _this.send(JSJAC_JINGLE_IQ_TYPE_SET, { action: JSJAC_JINGLE_ACTION_SESSION_ACCEPT });
- }
- );
- });
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] accept > ' + e, 1);
- }
- },
-
- /**
- * Sends a Jingle session info.
- * @public
- * @param {String} name
- * @param {Object} [args]
- */
- info: function(name, args) {
- this.get_debug().log('[JSJaCJingle:single] info', 4);
-
- try {
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:single] info > Cannot accept, resource locked. Please open another session or check WebRTC support.', 0);
- return;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.info(name, args); })) {
- this.get_debug().log('[JSJaCJingle:single] info > Deferred (waiting for the library components to be initiated).', 0);
- return;
- }
-
- // Slot unavailable?
- if(!(this.get_status() === JSJAC_JINGLE_STATUS_INITIATED ||
- this.get_status() === JSJAC_JINGLE_STATUS_ACCEPTING ||
- this.get_status() === JSJAC_JINGLE_STATUS_ACCEPTED)) {
- this.get_debug().log('[JSJaCJingle:single] info > Cannot send info, resource not active (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- // Trigger info pending custom callback
- /* @function */
- (this.get_session_info_pending())(this);
-
- if(typeof args !== 'object') args = {};
-
- // Build final args parameter
- args.action = JSJAC_JINGLE_ACTION_SESSION_INFO;
- if(name) args.info = name;
-
- this.send(JSJAC_JINGLE_IQ_TYPE_SET, args);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] info > ' + e, 1);
- }
- },
-
- /**
- * Terminates the Jingle session.
- * @public
- * @fires JSJaCJingleSingle#get_session_terminate_pending
- * @param {String} reason
- */
- terminate: function(reason) {
- this.get_debug().log('[JSJaCJingle:single] terminate', 4);
-
- try {
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:single] terminate > Cannot terminate, resource locked. Please open another session or check WebRTC support.', 0);
- return;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.terminate(reason); })) {
- this.get_debug().log('[JSJaCJingle:single] terminate > Deferred (waiting for the library components to be initiated).', 0);
- return;
- }
-
- // Slot unavailable?
- if(this.get_status() === JSJAC_JINGLE_STATUS_TERMINATED) {
- this.get_debug().log('[JSJaCJingle:single] terminate > Cannot terminate, resource already terminated (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- // Change session status
- this._set_status(JSJAC_JINGLE_STATUS_TERMINATING);
-
- // Trigger terminate pending custom callback
- /* @function */
- (this.get_session_terminate_pending())(this);
-
- // Process terminate actions
- this.send(JSJAC_JINGLE_IQ_TYPE_SET, { action: JSJAC_JINGLE_ACTION_SESSION_TERMINATE, reason: reason });
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] terminate > ' + e, 1);
- }
- },
-
- /**
- * Aborts the Jingle session.
- * @public
- * @param {Boolean} [set_lock]
- */
- abort: function(set_lock) {
- this.get_debug().log('[JSJaCJingle:single] abort', 4);
-
- try {
- // Change session status
- this._set_status(JSJAC_JINGLE_STATUS_TERMINATED);
-
- // Stop WebRTC
- this._peer_stop();
-
- // Lock session? (cannot be used later)
- if(set_lock === true) this._set_lock(true);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] abort > ' + e, 1);
- }
- },
-
- /**
- * Sends a given Jingle stanza packet
- * @public
- * @param {String} type
- * @param {Object} [args]
- * @returns {Boolean} Success
- */
- send: function(type, args) {
- this.get_debug().log('[JSJaCJingle:single] send', 4);
-
- try {
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:single] send > Cannot send, resource locked. Please open another session or check WebRTC support.', 0);
- return false;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.send(type, args); })) {
- this.get_debug().log('[JSJaCJingle:single] send > Deferred (waiting for the library components to be initiated).', 0);
- return false;
- }
-
- // Assert
- if(typeof args !== 'object') args = {};
-
- // Build stanza
- var stanza = new JSJaCIQ();
- stanza.setTo(this.get_to());
-
- if(type) stanza.setType(type);
-
- if(!args.id) args.id = this.get_id_new();
- stanza.setID(args.id);
-
- if(type == JSJAC_JINGLE_IQ_TYPE_SET) {
- if(!(args.action && args.action in JSJAC_JINGLE_ACTIONS)) {
- this.get_debug().log('[JSJaCJingle:single] send > Stanza action unknown: ' + (args.action || 'undefined'), 1);
- return false;
- }
-
- // Submit to registered handler
- switch(args.action) {
- case JSJAC_JINGLE_ACTION_CONTENT_ACCEPT:
- this._send_content_accept(stanza); break;
-
- case JSJAC_JINGLE_ACTION_CONTENT_ADD:
- this._send_content_add(stanza); break;
-
- case JSJAC_JINGLE_ACTION_CONTENT_MODIFY:
- this._send_content_modify(stanza); break;
-
- case JSJAC_JINGLE_ACTION_CONTENT_REJECT:
- this._send_content_reject(stanza); break;
-
- case JSJAC_JINGLE_ACTION_CONTENT_REMOVE:
- this._send_content_remove(stanza); break;
-
- case JSJAC_JINGLE_ACTION_DESCRIPTION_INFO:
- this._send_description_info(stanza); break;
-
- case JSJAC_JINGLE_ACTION_SECURITY_INFO:
- this._send_security_info(stanza); break;
-
- case JSJAC_JINGLE_ACTION_SESSION_ACCEPT:
- this._send_session_accept(stanza, args); break;
-
- case JSJAC_JINGLE_ACTION_SESSION_INFO:
- this._send_session_info(stanza, args); break;
-
- case JSJAC_JINGLE_ACTION_SESSION_INITIATE:
- this._send_session_initiate(stanza, args); break;
-
- case JSJAC_JINGLE_ACTION_SESSION_TERMINATE:
- this._send_session_terminate(stanza, args); break;
-
- case JSJAC_JINGLE_ACTION_TRANSPORT_ACCEPT:
- this._send_transport_accept(stanza); break;
-
- case JSJAC_JINGLE_ACTION_TRANSPORT_INFO:
- this._send_transport_info(stanza, args); break;
-
- case JSJAC_JINGLE_ACTION_TRANSPORT_REJECT:
- this._send_transport_reject(stanza); break;
-
- case JSJAC_JINGLE_ACTION_TRANSPORT_REPLACE:
- this._send_transport_replace(stanza); break;
-
- default:
- this.get_debug().log('[JSJaCJingle:single] send > Unexpected error.', 1);
-
- return false;
- }
- } else if(type != JSJAC_JINGLE_IQ_TYPE_RESULT) {
- this.get_debug().log('[JSJaCJingle:single] send > Stanza type must either be set or result.', 1);
-
- return false;
- }
-
- this._set_sent_id(args.id);
-
- this.get_connection().send(stanza);
-
- if(this.get_net_trace()) this.get_debug().log('[JSJaCJingle:single] send > Outgoing packet sent' + '\n\n' + stanza.xml());
-
- return true;
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] send > ' + e, 1);
- }
-
- return false;
- },
-
- /**
- * Handles a given Jingle stanza response
- * @private
- * @fires JSJaCJingleSingle#_handle_content_accept
- * @fires JSJaCJingleSingle#_handle_content_add
- * @fires JSJaCJingleSingle#_handle_content_modify
- * @fires JSJaCJingleSingle#_handle_content_reject
- * @fires JSJaCJingleSingle#_handle_content_remove
- * @fires JSJaCJingleSingle#_handle_description_info
- * @fires JSJaCJingleSingle#_handle_security_info
- * @fires JSJaCJingleSingle#_handle_session_accept
- * @fires JSJaCJingleSingle#_handle_session_info
- * @fires JSJaCJingleSingle#_handle_session_initiate
- * @fires JSJaCJingleSingle#_handle_session_terminate
- * @fires JSJaCJingleSingle#_handle_transport_accept
- * @fires JSJaCJingleSingle#_handle_transport_info
- * @fires JSJaCJingleSingle#_handle_transport_reject
- * @fires JSJaCJingleSingle#_handle_transport_replace
- * @param {JSJaCPacket} stanza
- */
- handle: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] handle', 4);
-
- try {
- if(this.get_net_trace()) this.get_debug().log('[JSJaCJingle:single] handle > Incoming packet received' + '\n\n' + stanza.xml());
-
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:single] handle > Cannot handle, resource locked. Please open another session or check WebRTC support.', 0);
- return;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.handle(stanza); })) {
- this.get_debug().log('[JSJaCJingle:single] handle > Deferred (waiting for the library components to be initiated).', 0);
- return;
- }
-
- var id = stanza.getID();
- var type = stanza.getType();
-
- if(id && type == JSJAC_JINGLE_IQ_TYPE_RESULT) this._set_received_id(id);
-
- // Submit to custom handler
- var i, handlers = this.get_registered_handlers(JSJAC_JINGLE_STANZA_IQ, type, id);
-
- if(typeof handlers == 'object' && handlers.length) {
- this.get_debug().log('[JSJaCJingle:single] handle > Submitted to custom registered handlers.', 2);
-
- for(i in handlers) {
- /* @function */
- handlers[i](stanza);
- }
-
- this.unregister_handler(JSJAC_JINGLE_STANZA_IQ, type, id);
-
- return;
- }
-
- var jingle = this.utils.stanza_jingle(stanza);
-
- // Don't handle non-Jingle stanzas there...
- if(!jingle) return;
-
- var action = this.utils.stanza_get_attribute(jingle, 'action');
-
- // Don't handle action-less Jingle stanzas there...
- if(!action) return;
-
- // Submit to registered handler
- switch(action) {
- case JSJAC_JINGLE_ACTION_CONTENT_ACCEPT:
- this._handle_content_accept(stanza); break;
-
- case JSJAC_JINGLE_ACTION_CONTENT_ADD:
- this._handle_content_add(stanza); break;
-
- case JSJAC_JINGLE_ACTION_CONTENT_MODIFY:
- this._handle_content_modify(stanza); break;
-
- case JSJAC_JINGLE_ACTION_CONTENT_REJECT:
- this._handle_content_reject(stanza); break;
-
- case JSJAC_JINGLE_ACTION_CONTENT_REMOVE:
- this._handle_content_remove(stanza); break;
-
- case JSJAC_JINGLE_ACTION_DESCRIPTION_INFO:
- this._handle_description_info(stanza); break;
-
- case JSJAC_JINGLE_ACTION_SECURITY_INFO:
- this._handle_security_info(stanza); break;
-
- case JSJAC_JINGLE_ACTION_SESSION_ACCEPT:
- this._handle_session_accept(stanza); break;
-
- case JSJAC_JINGLE_ACTION_SESSION_INFO:
- this._handle_session_info(stanza); break;
-
- case JSJAC_JINGLE_ACTION_SESSION_INITIATE:
- this._handle_session_initiate(stanza); break;
-
- case JSJAC_JINGLE_ACTION_SESSION_TERMINATE:
- this._handle_session_terminate(stanza); break;
-
- case JSJAC_JINGLE_ACTION_TRANSPORT_ACCEPT:
- this._handle_transport_accept(stanza); break;
-
- case JSJAC_JINGLE_ACTION_TRANSPORT_INFO:
- this._handle_transport_info(stanza); break;
-
- case JSJAC_JINGLE_ACTION_TRANSPORT_REJECT:
- this._handle_transport_reject(stanza); break;
-
- case JSJAC_JINGLE_ACTION_TRANSPORT_REPLACE:
- this._handle_transport_replace(stanza); break;
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] handle > ' + e, 1);
- }
- },
-
- /**
- * Mutes a Jingle session (local)
- * @public
- * @param {String} name
- */
- mute: function(name) {
- this.get_debug().log('[JSJaCJingle:single] mute', 4);
-
- try {
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:single] mute > Cannot mute, resource locked. Please open another session or check WebRTC support.', 0);
- return;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.mute(name); })) {
- this.get_debug().log('[JSJaCJingle:single] mute > Deferred (waiting for the library components to be initiated).', 0);
- return;
- }
-
- // Already muted?
- if(this.get_mute(name) === true) {
- this.get_debug().log('[JSJaCJingle:single] mute > Resource already muted.', 0);
- return;
- }
-
- this._peer_sound(false);
- this._set_mute(name, true);
-
- this.send(JSJAC_JINGLE_IQ_TYPE_SET, { action: JSJAC_JINGLE_ACTION_SESSION_INFO, info: JSJAC_JINGLE_SESSION_INFO_MUTE, name: name });
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] mute > ' + e, 1);
- }
- },
-
- /**
- * Unmutes a Jingle session (local)
- * @public
- * @param {String} name
- */
- unmute: function(name) {
- this.get_debug().log('[JSJaCJingle:single] unmute', 4);
-
- try {
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:single] unmute > Cannot unmute, resource locked. Please open another session or check WebRTC support.', 0);
- return;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.unmute(name); })) {
- this.get_debug().log('[JSJaCJingle:single] unmute > Deferred (waiting for the library components to be initiated).', 0);
- return;
- }
-
- // Already unmute?
- if(this.get_mute(name) === false) {
- this.get_debug().log('[JSJaCJingle:single] unmute > Resource already unmuted.', 0);
- return;
- }
-
- this._peer_sound(true);
- this._set_mute(name, false);
-
- this.send(JSJAC_JINGLE_IQ_TYPE_SET, { action: JSJAC_JINGLE_ACTION_SESSION_INFO, info: JSJAC_JINGLE_SESSION_INFO_UNMUTE, name: name });
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] unmute > ' + e, 1);
- }
- },
-
- /**
- * Toggles media type in a Jingle session
- * @todo Code media() (Single version)
- * @public
- * @param {String} [media]
- */
- media: function(media) {
- /* DEV: don't expect this to work as of now! */
- /* MEDIA() - SINGLE VERSION */
-
- this.get_debug().log('[JSJaCJingle:single] media', 4);
-
- try {
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:single] media > Cannot change media, resource locked. Please open another session or check WebRTC support.', 0);
- return;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.media(media); })) {
- this.get_debug().log('[JSJaCJingle:single] media > Deferred (waiting for the library components to be initiated).', 0);
- return;
- }
-
- // Toggle media?
- if(!media)
- media = (this.get_media() == JSJAC_JINGLE_MEDIA_VIDEO) ? JSJAC_JINGLE_MEDIA_AUDIO : JSJAC_JINGLE_MEDIA_VIDEO;
-
- // Media unknown?
- if(!(media in JSJAC_JINGLE_MEDIAS)) {
- this.get_debug().log('[JSJaCJingle:single] media > No media provided or media unsupported (media: ' + media + ').', 0);
- return;
- }
-
- // Already using provided media?
- if(this.get_media() == media) {
- this.get_debug().log('[JSJaCJingle:single] media > Resource already using this media (media: ' + media + ').', 0);
- return;
- }
-
- // Switch locked for now? (another one is being processed)
- if(this.get_media_busy()) {
- this.get_debug().log('[JSJaCJingle:single] media > Resource already busy switching media (busy: ' + this.get_media() + ', media: ' + media + ').', 0);
- return;
- }
-
- this.get_debug().log('[JSJaCJingle:single] media > Changing media to: ' + media + '...', 2);
-
- // Store new media
- this._set_media(media);
- this._set_media_busy(true);
-
- // Toggle video mode (add/remove)
- if(media == JSJAC_JINGLE_MEDIA_VIDEO) {
- /* @todo the flow is something like that... */
- /*this._peer_get_user_media(function() {
- this._peer_connection_create(
- function() {
- this.get_debug().log('[JSJaCJingle:muji] media > Ready to change media (to: ' + media + ').', 2);
-
- // 'content-add' >> video
- // @todo restart video stream configuration
-
- // WARNING: only change get user media, DO NOT TOUCH THE STREAM THING (don't stop active stream as it's flowing!!)
-
- this.send(JSJAC_JINGLE_IQ_TYPE_SET, { action: JSJAC_JINGLE_ACTION_CONTENT_ADD, name: JSJAC_JINGLE_MEDIA_VIDEO });
- }
- )
- });*/
- } else {
- /* @todo the flow is something like that... */
- /*this._peer_get_user_media(function() {
- this._peer_connection_create(
- function() {
- this.get_debug().log('[JSJaCJingle:muji] media > Ready to change media (to: ' + media + ').', 2);
-
- // 'content-remove' >> video
- // @todo remove video stream configuration
-
- // WARNING: only change get user media, DO NOT TOUCH THE STREAM THING (don't stop active stream as it's flowing!!)
- // here, only stop the video stream, do not touch the audio stream
-
- this.send(JSJAC_JINGLE_IQ_TYPE_SET, { action: JSJAC_JINGLE_ACTION_CONTENT_REMOVE, name: JSJAC_JINGLE_MEDIA_VIDEO });
- }
- )
- });*/
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] media > ' + e, 1);
- }
- },
-
-
- /**
- * JSJSAC JINGLE SENDERS
- */
-
- /**
- * Sends the Jingle content accept
- * @private
- * @param {JSJaCPacket} stanza
- */
- _send_content_accept: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _send_content_accept', 4);
-
- try {
- /* @todo remove from remote 'content-add' queue */
- /* @todo reprocess content_local/content_remote */
-
- // Not implemented for now
- this.get_debug().log('[JSJaCJingle:single] _send_content_accept > Feature not implemented!', 0);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _send_content_accept > ' + e, 1);
- }
- },
-
- /**
- * Sends the Jingle content add
- * @private
- * @param {JSJaCPacket} stanza
- */
- _send_content_add: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _send_content_add', 4);
-
- try {
- /* @todo push to local 'content-add' queue */
-
- // Not implemented for now
- this.get_debug().log('[JSJaCJingle:single] _send_content_add > Feature not implemented!', 0);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _send_content_add > ' + e, 1);
- }
- },
-
- /**
- * Sends the Jingle content modify
- * @private
- * @param {JSJaCPacket} stanza
- */
- _send_content_modify: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _send_content_modify', 4);
-
- try {
- /* @todo push to local 'content-modify' queue */
-
- // Not implemented for now
- this.get_debug().log('[JSJaCJingle:single] _send_content_modify > Feature not implemented!', 0);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _send_content_modify > ' + e, 1);
- }
- },
-
- /**
- * Sends the Jingle content reject
- * @private
- * @param {JSJaCPacket} stanza
- */
- _send_content_reject: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _send_content_reject', 4);
-
- try {
- /* @todo remove from remote 'content-add' queue */
-
- // Not implemented for now
- this.get_debug().log('[JSJaCJingle:single] _send_content_reject > Feature not implemented!', 0);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _send_content_reject > ' + e, 1);
- }
- },
-
- /**
- * Sends the Jingle content remove
- * @private
- * @param {JSJaCPacket} stanza
- */
- _send_content_remove: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _send_content_remove', 4);
-
- try {
- /* @todo add to local 'content-remove' queue */
-
- // Not implemented for now
- this.get_debug().log('[JSJaCJingle:single] _send_content_remove > Feature not implemented!', 0);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _send_content_remove > ' + e, 1);
- }
- },
-
- /**
- * Sends the Jingle description info
- * @private
- * @param {JSJaCPacket} stanza
- */
- _send_description_info: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _send_description_info', 4);
-
- try {
- // Not implemented for now
- this.get_debug().log('[JSJaCJingle:single] _send_description_info > Feature not implemented!', 0);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _send_description_info > ' + e, 1);
- }
- },
-
- /**
- * Sends the Jingle security info
- * @private
- * @param {JSJaCPacket} stanza
- */
- _send_security_info: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _send_security_info', 4);
-
- try {
- // Not implemented for now
- this.get_debug().log('[JSJaCJingle:single] _send_security_info > Feature not implemented!', 0);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _send_security_info > ' + e, 1);
- }
- },
-
- /**
- * Sends the Jingle session accept
- * @private
- * @fires JSJaCJingleSingle#_handle_session_accept_success
- * @fires JSJaCJingleSingle#_handle_session_accept_error
- * @fires JSJaCJingleSingle#get_session_accept_success
- * @fires JSJaCJingleSingle#get_session_accept_error
- * @param {JSJaCPacket} stanza
- * @param {Object} args
- */
- _send_session_accept: function(stanza, args) {
- this.get_debug().log('[JSJaCJingle:single] _send_session_accept', 4);
-
- try {
- if(this.get_status() !== JSJAC_JINGLE_STATUS_ACCEPTING) {
- this.get_debug().log('[JSJaCJingle:single] _send_session_accept > Cannot send accept stanza, resource not accepting (status: ' + this.get_status() + ').', 0);
- this._send_error(stanza, JSJAC_JINGLE_ERROR_OUT_OF_ORDER);
- return;
- }
-
- if(!args) {
- this.get_debug().log('[JSJaCJingle:single] _send_session_accept > Arguments not provided.', 1);
- return;
- }
-
- // Build Jingle stanza
- var jingle = this.utils.stanza_generate_jingle(stanza, {
- 'action' : JSJAC_JINGLE_ACTION_SESSION_ACCEPT,
- 'responder' : this.get_responder()
- });
-
- this.utils.stanza_generate_content_local(stanza, jingle, true);
- this.utils.stanza_generate_group_local(stanza, jingle);
-
- // Schedule success
- var _this = this;
-
- this.register_handler(JSJAC_JINGLE_STANZA_IQ, JSJAC_JINGLE_IQ_TYPE_RESULT, args.id, function(stanza) {
- /* @function */
- (_this.get_session_accept_success())(_this, stanza);
- _this._handle_session_accept_success(stanza);
- });
-
- // Schedule error timeout
- this.utils.stanza_timeout(JSJAC_JINGLE_STANZA_IQ, JSJAC_JINGLE_IQ_TYPE_RESULT, args.id, {
- /* @function */
- external: this.get_session_accept_error().bind(this),
- internal: this._handle_session_accept_error.bind(this)
- });
-
- this.get_debug().log('[JSJaCJingle:single] _send_session_accept > Sent.', 4);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _send_session_accept > ' + e, 1);
- }
- },
-
- /**
- * Sends the Jingle session info
- * @private
- * @fires JSJaCJingleSingle#_handle_session_info_success
- * @fires JSJaCJingleSingle#_handle_session_info_error
- * @param {JSJaCPacket} stanza
- * @param {Object} args
- */
- _send_session_info: function(stanza, args) {
- this.get_debug().log('[JSJaCJingle:single] _send_session_info', 4);
-
- try {
- if(!args) {
- this.get_debug().log('[JSJaCJingle:single] _send_session_info > Arguments not provided.', 1);
- return;
- }
-
- // Filter info
- args.info = args.info || JSJAC_JINGLE_SESSION_INFO_ACTIVE;
-
- // Build Jingle stanza
- var jingle = this.utils.stanza_generate_jingle(stanza, {
- 'action' : JSJAC_JINGLE_ACTION_SESSION_INFO,
- 'initiator' : this.get_initiator()
- });
-
- this.utils.stanza_generate_session_info(stanza, jingle, args);
-
- // Schedule success
- var _this = this;
-
- this.register_handler(JSJAC_JINGLE_STANZA_IQ, JSJAC_JINGLE_IQ_TYPE_RESULT, args.id, function(stanza) {
- /* @function */
- (_this.get_session_info_success())(this, stanza);
- _this._handle_session_info_success(stanza);
- });
-
- // Schedule error timeout
- this.utils.stanza_timeout(JSJAC_JINGLE_STANZA_IQ, JSJAC_JINGLE_IQ_TYPE_RESULT, args.id, {
- /* @function */
- external: this.get_session_info_error().bind(this),
- internal: this._handle_session_info_error.bind(this)
- });
-
- this.get_debug().log('[JSJaCJingle:single] _send_session_info > Sent (name: ' + args.info + ').', 2);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _send_session_info > ' + e, 1);
- }
- },
-
- /**
- * Sends the Jingle session initiate
- * @private
- * @fires JSJaCJingleSingle#_handle_initiate_info_success
- * @fires JSJaCJingleSingle#_handle_initiate_info_error
- * @fires JSJaCJingleSingle#get_session_initiate_success
- * @fires JSJaCJingleSingle#get_session_initiate_error
- * @param {JSJaCPacket} stanza
- * @param {Object} args
- */
- _send_session_initiate: function(stanza, args) {
- this.get_debug().log('[JSJaCJingle:single] _send_session_initiate', 4);
-
- try {
- if(this.get_status() !== JSJAC_JINGLE_STATUS_INITIATING) {
- this.get_debug().log('[JSJaCJingle:single] _send_session_initiate > Cannot send initiate stanza, resource not initiating (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- if(!args) {
- this.get_debug().log('[JSJaCJingle:single] _send_session_initiate > Arguments not provided.', 1);
- return;
- }
-
- // Build Jingle stanza
- var jingle = this.utils.stanza_generate_jingle(stanza, {
- 'action' : JSJAC_JINGLE_ACTION_SESSION_INITIATE,
- 'initiator' : this.get_initiator()
- });
-
- this.utils.stanza_generate_content_local(stanza, jingle, true);
- this.utils.stanza_generate_group_local(stanza, jingle);
-
- // Schedule success
- var _this = this;
-
- this.register_handler(JSJAC_JINGLE_STANZA_IQ, JSJAC_JINGLE_IQ_TYPE_RESULT, args.id, function(stanza) {
- /* @function */
- (_this.get_session_initiate_success())(_this, stanza);
- _this._handle_session_initiate_success(stanza);
- });
-
- // Schedule error timeout
- this.utils.stanza_timeout(JSJAC_JINGLE_STANZA_IQ, JSJAC_JINGLE_IQ_TYPE_RESULT, args.id, {
- /* @function */
- external: this.get_session_initiate_error().bind(this),
- internal: this._handle_session_initiate_error.bind(this)
- });
-
- this.get_debug().log('[JSJaCJingle:single] _send_session_initiate > Sent.', 2);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _send_session_initiate > ' + e, 1);
- }
- },
-
- /**
- * Sends the Jingle session terminate
- * @private
- * @fires JSJaCJingleSingle#_handle_session_terminate_success
- * @fires JSJaCJingleSingle#_handle_session_terminate_error
- * @fires JSJaCJingleSingle#get_session_terminate_success
- * @fires JSJaCJingleSingle#get_session_terminate_error
- * @param {JSJaCPacket} stanza
- * @param {Object} args
- */
- _send_session_terminate: function(stanza, args) {
- this.get_debug().log('[JSJaCJingle:single] _send_session_terminate', 4);
-
- try {
- if(this.get_status() !== JSJAC_JINGLE_STATUS_TERMINATING) {
- this.get_debug().log('[JSJaCJingle:single] _send_session_terminate > Cannot send terminate stanza, resource not terminating (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- if(!args) {
- this.get_debug().log('[JSJaCJingle:single] _send_session_terminate > Arguments not provided.', 1);
- return;
- }
-
- // Filter reason
- args.reason = args.reason || JSJAC_JINGLE_REASON_SUCCESS;
-
- // Store terminate reason
- this._set_reason(args.reason);
-
- // Build terminate stanza
- var jingle = this.utils.stanza_generate_jingle(stanza, {
- 'action': JSJAC_JINGLE_ACTION_SESSION_TERMINATE
- });
-
- var jingle_reason = jingle.appendChild(stanza.buildNode('reason', {'xmlns': this.get_namespace()}));
- jingle_reason.appendChild(stanza.buildNode(args.reason, {'xmlns': this.get_namespace()}));
-
- // Schedule success
- var _this = this;
-
- this.register_handler(JSJAC_JINGLE_STANZA_IQ, JSJAC_JINGLE_IQ_TYPE_RESULT, args.id, function(stanza) {
- /* @function */
- (_this.get_session_terminate_success())(_this, stanza);
- _this._handle_session_terminate_success(stanza);
- });
-
- // Schedule error timeout
- this.utils.stanza_timeout(JSJAC_JINGLE_STANZA_IQ, JSJAC_JINGLE_IQ_TYPE_RESULT, args.id, {
- /* @function */
- external: this.get_session_terminate_error().bind(this),
- internal: this._handle_session_terminate_error.bind(this)
- });
-
- this.get_debug().log('[JSJaCJingle:single] _send_session_terminate > Sent (reason: ' + args.reason + ').', 2);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _send_session_terminate > ' + e, 1);
- }
- },
-
- /**
- * Sends the Jingle transport accept
- * @private
- * @param {JSJaCPacket} stanza
- */
- _send_transport_accept: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _send_transport_accept', 4);
-
- try {
- // Not implemented for now
- this.get_debug().log('[JSJaCJingle:single] _send_transport_accept > Feature not implemented!', 0);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _send_transport_accept > ' + e, 1);
- }
- },
-
- /**
- * Sends the Jingle transport info
- * @private
- * @fires JSJaCJingleSingle#_handle_transport_info_success
- * @fires JSJaCJingleSingle#_handle_transport_info_error
- * @param {JSJaCPacket} stanza
- * @param {Object} args
- */
- _send_transport_info: function(stanza, args) {
- this.get_debug().log('[JSJaCJingle:single] _send_transport_info', 4);
-
- try {
- if(this.get_status() !== JSJAC_JINGLE_STATUS_INITIATED &&
- this.get_status() !== JSJAC_JINGLE_STATUS_ACCEPTING &&
- this.get_status() !== JSJAC_JINGLE_STATUS_ACCEPTED) {
- this.get_debug().log('[JSJaCJingle:single] _send_transport_info > Cannot send transport info, resource not initiated, nor accepting, nor accepted (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- if(!args) {
- this.get_debug().log('[JSJaCJingle:single] _send_transport_info > Arguments not provided.', 1);
- return;
- }
-
- if(this.utils.object_length(this.get_candidates_queue_local()) === 0) {
- this.get_debug().log('[JSJaCJingle:single] _send_transport_info > No local candidate in queue.', 1);
- return;
- }
-
- // Build Jingle stanza
- var jingle = this.utils.stanza_generate_jingle(stanza, {
- 'action' : JSJAC_JINGLE_ACTION_TRANSPORT_INFO,
- 'initiator' : this.get_initiator()
- });
-
- // Build queue content
- var cur_name;
- var content_queue_local = {};
-
- for(cur_name in this.get_name()) {
- content_queue_local[cur_name] = this.utils.generate_content(
- this.get_creator(cur_name),
- cur_name,
- this.get_senders(cur_name),
- this.get_payloads_local(cur_name),
- this.get_candidates_queue_local(cur_name)
- );
- }
-
- this.utils.stanza_generate_content_local(stanza, jingle, true, content_queue_local);
- this.utils.stanza_generate_group_local(stanza, jingle);
-
- // Schedule success
- var _this = this;
-
- this.register_handler(JSJAC_JINGLE_STANZA_IQ, JSJAC_JINGLE_IQ_TYPE_RESULT, args.id, function(stanza) {
- _this._handle_transport_info_success(stanza);
- });
-
- // Schedule error timeout
- this.utils.stanza_timeout(JSJAC_JINGLE_STANZA_IQ, JSJAC_JINGLE_IQ_TYPE_RESULT, args.id, {
- internal: this._handle_transport_info_error.bind(this)
- });
-
- this.get_debug().log('[JSJaCJingle:single] _send_transport_info > Sent.', 2);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _send_transport_info > ' + e, 1);
- }
- },
-
- /**
- * Sends the Jingle transport reject
- * @private
- * @param {JSJaCPacket} stanza
- */
- _send_transport_reject: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _send_transport_reject', 4);
-
- try {
- // Not implemented for now
- this.get_debug().log('[JSJaCJingle:single] _send_transport_reject > Feature not implemented!', 0);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _send_transport_reject > ' + e, 1);
- }
- },
-
- /**
- * Sends the Jingle transport replace
- * @private
- * @param {JSJaCPacket} stanza
- */
- _send_transport_replace: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _send_transport_replace', 4);
-
- try {
- // Not implemented for now
- this.get_debug().log('[JSJaCJingle:single] _send_transport_replace > Feature not implemented!', 0);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _send_transport_replace > ' + e, 1);
- }
- },
-
- /**
- * Sends the Jingle transport replace
- * @private
- * @param {JSJaCPacket} stanza
- * @param {Object} error
- */
- _send_error: function(stanza, error) {
- this.get_debug().log('[JSJaCJingle:single] _send_error', 4);
-
- try {
- // Assert
- if(!('type' in error)) {
- this.get_debug().log('[JSJaCJingle:single] _send_error > Type unknown.', 1);
- return;
- }
-
- if('jingle' in error && !(error.jingle in JSJAC_JINGLE_ERRORS)) {
- this.get_debug().log('[JSJaCJingle:single] _send_error > Jingle condition unknown (' + error.jingle + ').', 1);
- return;
- }
-
- if('xmpp' in error && !(error.xmpp in XMPP_ERRORS)) {
- this.get_debug().log('[JSJaCJingle:single] _send_error > XMPP condition unknown (' + error.xmpp + ').', 1);
- return;
- }
-
- var stanza_error = new JSJaCIQ();
-
- stanza_error.setType('error');
- stanza_error.setID(stanza.getID());
- stanza_error.setTo(this.get_to());
-
- var error_node = stanza_error.getNode().appendChild(stanza_error.buildNode('error', {'xmlns': NS_CLIENT, 'type': error.type}));
-
- if('xmpp' in error) error_node.appendChild(stanza_error.buildNode(error.xmpp, { 'xmlns': NS_STANZAS }));
- if('jingle' in error) error_node.appendChild(stanza_error.buildNode(error.jingle, { 'xmlns': NS_JINGLE_ERRORS }));
-
- this.get_connection().send(stanza_error);
-
- this.get_debug().log('[JSJaCJingle:single] _send_error > Sent: ' + (error.jingle || error.xmpp), 2);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _send_error > ' + e, 1);
- }
- },
-
-
-
- /**
- * JSJSAC JINGLE HANDLERS
- */
-
- /**
- * Handles the Jingle content accept
- * @private
- * @event JSJaCJingleSingle#_handle_content_accept
- * @param {JSJaCPacket} stanza
- */
- _handle_content_accept: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_content_accept', 4);
-
- try {
- /* @todo start to flow accepted stream */
- /* @todo remove accepted content from local 'content-add' queue */
- /* @todo reprocess content_local/content_remote */
-
- // Not implemented for now
- this._send_error(stanza, XMPP_ERROR_FEATURE_NOT_IMPLEMENTED);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_content_accept > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle content add
- * @private
- * @event JSJaCJingleSingle#_handle_content_add
- * @param {JSJaCPacket} stanza
- */
- _handle_content_add: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_content_add', 4);
-
- try {
- /* @todo request the user to start this content (need a custom handler)
- * on accept: send content-accept */
- /* @todo push to remote 'content-add' queue */
- /* @todo reprocess content_local/content_remote */
-
- // Not implemented for now
- this._send_error(stanza, XMPP_ERROR_FEATURE_NOT_IMPLEMENTED);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_content_add > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle content modify
- * @private
- * @event JSJaCJingleSingle#_handle_content_modify
- * @param {JSJaCPacket} stanza
- */
- _handle_content_modify: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_content_modify', 4);
-
- try {
- /* @todo change 'senders' value (direction of the stream)
- * if(send:from_me): notify the user that media is requested
- * if(unacceptable): terminate the session
- * if(accepted): change local/remote SDP */
- /* @todo reprocess content_local/content_remote */
-
- // Not implemented for now
- this._send_error(stanza, XMPP_ERROR_FEATURE_NOT_IMPLEMENTED);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_content_modify > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle content reject
- * @private
- * @event JSJaCJingleSingle#_handle_content_reject
- * @param {JSJaCPacket} stanza
- */
- _handle_content_reject: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_content_reject', 4);
-
- try {
- /* @todo remove rejected content from local 'content-add' queue */
-
- // Not implemented for now
- this._send_error(stanza, XMPP_ERROR_FEATURE_NOT_IMPLEMENTED);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_content_reject > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle content remove
- * @private
- * @event JSJaCJingleSingle#_handle_content_remove
- * @param {JSJaCPacket} stanza
- */
- _handle_content_remove: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_content_remove', 4);
-
- try {
- /* @todo stop flowing removed stream */
- /* @todo reprocess content_local/content_remote */
-
- // Not implemented for now
- this._send_error(stanza, XMPP_ERROR_FEATURE_NOT_IMPLEMENTED);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_content_remove > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle description info
- * @private
- * @event JSJaCJingleSingle#_handle_description_info
- * @param {JSJaCPacket} stanza
- */
- _handle_description_info: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_description_info', 4);
-
- try {
- // Not implemented for now
- this._send_error(stanza, XMPP_ERROR_FEATURE_NOT_IMPLEMENTED);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_description_info > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle security info
- * @private
- * @event JSJaCJingleSingle#_handle_security_info
- * @param {JSJaCPacket} stanza
- */
- _handle_security_info: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_security_info', 4);
-
- try {
- // Not implemented for now
- this._send_error(stanza, XMPP_ERROR_FEATURE_NOT_IMPLEMENTED);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_security_info > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session accept
- * @private
- * @event JSJaCJingleSingle#_handle_session_accept
- * @fires JSJaCJingleSingle#_handle_session_accept_success
- * @fires JSJaCJingleSingle#_handle_session_accept_error
- * @fires JSJaCJingleSingle#get_session_accept_success
- * @fires JSJaCJingleSingle#get_session_accept_error
- * @fires JSJaCJingleSingle#get_session_accept_request
- * @param {JSJaCPacket} stanza
- */
- _handle_session_accept: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_accept', 4);
-
- try {
- // Security preconditions
- if(!this.utils.stanza_safe(stanza)) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_accept > Dropped unsafe stanza.', 0);
-
- this._send_error(stanza, JSJAC_JINGLE_ERROR_UNKNOWN_SESSION);
- return;
- }
-
- // Can now safely dispatch the stanza
- switch(stanza.getType()) {
- case JSJAC_JINGLE_IQ_TYPE_RESULT:
- /* @function */
- (this.get_session_accept_success())(this, stanza);
- this._handle_session_accept_success(stanza);
-
- break;
-
- case 'error':
- /* @function */
- (this.get_session_accept_error())(this, stanza);
- this._handle_session_accept_error(stanza);
-
- break;
-
- case JSJAC_JINGLE_IQ_TYPE_SET:
- // External handler must be set before internal one here...
- /* @function */
- (this.get_session_accept_request())(this, stanza);
- this._handle_session_accept_request(stanza);
-
- break;
-
- default:
- this._send_error(stanza, XMPP_ERROR_FEATURE_NOT_IMPLEMENTED);
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_accept > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session accept success
- * @private
- * @event JSJaCJingleSingle#_handle_session_accept_success
- * @param {JSJaCPacket} stanza
- */
- _handle_session_accept_success: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_accept_success', 4);
-
- try {
- // Change session status
- this._set_status(JSJAC_JINGLE_STATUS_ACCEPTED);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_accept_success > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session accept error
- * @private
- * @event JSJaCJingleSingle#_handle_session_accept_error
- * @param {JSJaCPacket} stanza
- */
- _handle_session_accept_error: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_accept_error', 4);
-
- try {
- // Terminate the session (timeout)
- this.terminate(JSJAC_JINGLE_REASON_TIMEOUT);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_accept_error > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session accept request
- * @private
- * @event JSJaCJingleSingle#_handle_session_accept_request
- * @fires JSJaCJingleSingle#_handle_session_accept_success
- * @fires JSJaCJingleSingle#_handle_session_accept_error
- * @fires JSJaCJingleSingle#get_session_accept_success
- * @fires JSJaCJingleSingle#get_session_accept_error
- * @param {JSJaCPacket} stanza
- */
- _handle_session_accept_request: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_accept_request', 4);
-
- try {
- // Slot unavailable?
- if(this.get_status() !== JSJAC_JINGLE_STATUS_INITIATED) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_accept_request > Cannot handle, resource already accepted (status: ' + this.get_status() + ').', 0);
- this._send_error(stanza, JSJAC_JINGLE_ERROR_OUT_OF_ORDER);
- return;
- }
-
- // Common vars
- var i, cur_candidate_obj;
-
- // Change session status
- this._set_status(JSJAC_JINGLE_STATUS_ACCEPTING);
-
- var rd_sid = this.utils.stanza_sid(stanza);
-
- // Request is valid?
- if(rd_sid && this.is_initiator() && this.utils.stanza_parse_content(stanza)) {
- // Handle additional data (optional)
- this.utils.stanza_parse_group(stanza);
-
- // Generate and store content data
- this.utils.build_content_remote();
-
- // Trigger accept success callback
- /* @function */
- (this.get_session_accept_success())(this, stanza);
- this._handle_session_accept_success(stanza);
-
- var sdp_remote = this.sdp._generate(
- WEBRTC_SDP_TYPE_ANSWER,
- this.get_group_remote(),
- this.get_payloads_remote(),
- this.get_candidates_queue_remote()
- );
-
- if(this.get_sdp_trace()) this.get_debug().log('[JSJaCJingle:single] SDP (remote)' + '\n\n' + sdp_remote.description.sdp, 4);
-
- // Remote description
- var _this = this;
-
- this.get_peer_connection().setRemoteDescription(
- (new WEBRTC_SESSION_DESCRIPTION(sdp_remote.description)),
-
- function() {
- // Success (descriptions are compatible)
- },
-
- function(e) {
- if(_this.get_sdp_trace()) _this.get_debug().log('[JSJaCJingle:single] SDP (remote:error)' + '\n\n' + (e.message || e.name || 'Unknown error'), 4);
-
- // Error (descriptions are incompatible)
- _this.terminate(JSJAC_JINGLE_REASON_INCOMPATIBLE_PARAMETERS);
- }
- );
-
- // ICE candidates
- for(i in sdp_remote.candidates) {
- cur_candidate_obj = sdp_remote.candidates[i];
-
- this.get_peer_connection().addIceCandidate(
- new WEBRTC_ICE_CANDIDATE({
- sdpMLineIndex : cur_candidate_obj.id,
- candidate : cur_candidate_obj.candidate
- })
- );
- }
-
- // Empty the unapplied candidates queue
- this._set_candidates_queue_remote(null);
-
- // Success reply
- this.send(JSJAC_JINGLE_IQ_TYPE_RESULT, { id: stanza.getID() });
- } else {
- // Trigger accept error callback
- /* @function */
- (this.get_session_accept_error())(this, stanza);
- this._handle_session_accept_error(stanza);
-
- // Send error reply
- this._send_error(stanza, XMPP_ERROR_BAD_REQUEST);
-
- this.get_debug().log('[JSJaCJingle:single] _handle_session_accept_request > Error.', 1);
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_accept_request > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session info
- * @private
- * @event JSJaCJingleSingle#_handle_session_info
- * @fires JSJaCJingleSingle#_handle_session_info_success
- * @fires JSJaCJingleSingle#_handle_session_info_error
- * @fires JSJaCJingleSingle#_handle_session_info_request
- * @fires JSJaCJingleSingle#get_session_info_success
- * @fires JSJaCJingleSingle#get_session_info_error
- * @fires JSJaCJingleSingle#get_session_info_request
- * @param {JSJaCPacket} stanza
- */
- _handle_session_info: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_info', 4);
-
- try {
- // Security preconditions
- if(!this.utils.stanza_safe(stanza)) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_info > Dropped unsafe stanza.', 0);
-
- this._send_error(stanza, JSJAC_JINGLE_ERROR_UNKNOWN_SESSION);
- return;
- }
-
- // Can now safely dispatch the stanza
- switch(stanza.getType()) {
- case JSJAC_JINGLE_IQ_TYPE_RESULT:
- /* @function */
- (this.get_session_info_success())(this, stanza);
- this._handle_session_info_success(stanza);
-
- break;
-
- case 'error':
- /* @function */
- (this.get_session_info_error())(this, stanza);
- this._handle_session_info_error(stanza);
-
- break;
-
- case JSJAC_JINGLE_IQ_TYPE_SET:
- /* @function */
- (this.get_session_info_request())(this, stanza);
- this._handle_session_info_request(stanza);
-
- break;
-
- default:
- this._send_error(stanza, XMPP_ERROR_FEATURE_NOT_IMPLEMENTED);
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_info > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session info success
- * @private
- * @event JSJaCJingleSingle#_handle_session_info_success
- * @param {JSJaCPacket} stanza
- */
- _handle_session_info_success: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_info_success', 4);
- },
-
- /**
- * Handles the Jingle session info error
- * @private
- * @event JSJaCJingleSingle#_handle_session_info_error
- * @param {JSJaCPacket} stanza
- */
- _handle_session_info_error: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_info_error', 4);
- },
-
- /**
- * Handles the Jingle session info request
- * @private
- * @event JSJaCJingleSingle#_handle_session_info_request
- * @fires JSJaCJingleSingle#_handle_session_info_success
- * @fires JSJaCJingleSingle#_handle_session_info_error
- * @fires JSJaCJingleSingle#get_session_info_success
- * @fires JSJaCJingleSingle#get_session_info_error
- * @param {JSJaCPacket} stanza
- */
- _handle_session_info_request: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_info_request', 4);
-
- try {
- // Parse stanza
- var info_name = this.utils.stanza_session_info(stanza);
- var info_result = false;
-
- switch(info_name) {
- case JSJAC_JINGLE_SESSION_INFO_ACTIVE:
- case JSJAC_JINGLE_SESSION_INFO_RINGING:
- case JSJAC_JINGLE_SESSION_INFO_MUTE:
- case JSJAC_JINGLE_SESSION_INFO_UNMUTE:
- info_result = true; break;
- }
-
- if(info_result) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_info_request > (name: ' + (info_name || 'undefined') + ').', 3);
-
- // Process info actions
- this.send(JSJAC_JINGLE_IQ_TYPE_RESULT, { id: stanza.getID() });
-
- // Trigger info success custom callback
- /* @function */
- (this.get_session_info_success())(this, stanza);
- this._handle_session_info_success(stanza);
- } else {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_info_request > Error (name: ' + (info_name || 'undefined') + ').', 1);
-
- // Send error reply
- this._send_error(stanza, XMPP_ERROR_FEATURE_NOT_IMPLEMENTED);
-
- // Trigger info error custom callback
- /* @function */
- (this.get_session_info_error())(this, stanza);
- this._handle_session_info_error(stanza);
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_info_request > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session initiate
- * @private
- * @event JSJaCJingleSingle#_handle_session_initiate
- * @fires JSJaCJingleSingle#_handle_session_initiate_success
- * @fires JSJaCJingleSingle#_handle_session_initiate_error
- * @fires JSJaCJingleSingle#_handle_session_initiate_request
- * @fires JSJaCJingleSingle#get_session_initiate_success
- * @fires JSJaCJingleSingle#get_session_initiate_error
- * @fires JSJaCJingleSingle#get_session_initiate_request
- * @param {JSJaCPacket} stanza
- */
- _handle_session_initiate: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_initiate', 4);
-
- try {
- switch(stanza.getType()) {
- case JSJAC_JINGLE_IQ_TYPE_RESULT:
- /* @function */
- (this.get_session_initiate_success())(this, stanza);
- this._handle_session_initiate_success(stanza);
-
- break;
-
- case 'error':
- /* @function */
- (this.get_session_initiate_error())(this, stanza);
- this._handle_session_initiate_error(stanza);
-
- break;
-
- case JSJAC_JINGLE_IQ_TYPE_SET:
- /* @function */
- (this.get_session_initiate_request())(this, stanza);
- this._handle_session_initiate_request(stanza);
-
- break;
-
- default:
- this._send_error(stanza, XMPP_ERROR_FEATURE_NOT_IMPLEMENTED);
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_initiate > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session initiate success
- * @private
- * @event JSJaCJingleSingle#_handle_session_initiate_success
- * @param {JSJaCPacket} stanza
- */
- _handle_session_initiate_success: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_initiate_success', 4);
-
- try {
- // Change session status
- this._set_status(JSJAC_JINGLE_STATUS_INITIATED);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_initiate_success > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session initiate error
- * @private
- * @event JSJaCJingleSingle#_handle_session_initiate_error
- * @param {JSJaCPacket} stanza
- */
- _handle_session_initiate_error: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_initiate_error', 4);
-
- try {
- // Change session status
- this._set_status(JSJAC_JINGLE_STATUS_INACTIVE);
-
- // Stop WebRTC
- this._peer_stop();
-
- // Lock session (cannot be used later)
- this._set_lock(true);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_initiate_error > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session initiate request
- * @private
- * @event JSJaCJingleSingle#_handle_session_initiate_request
- * @fires JSJaCJingleSingle#_handle_session_initiate_success
- * @fires JSJaCJingleSingle#_handle_session_initiate_error
- * @fires JSJaCJingleSingle#get_session_initiate_success
- * @fires JSJaCJingleSingle#get_session_initiate_error
- * @param {JSJaCPacket} stanza
- */
- _handle_session_initiate_request: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_initiate_request', 4);
-
- try {
- // Slot unavailable?
- if(this.get_status() !== JSJAC_JINGLE_STATUS_INACTIVE) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_initiate_request > Cannot handle, resource already initiated (status: ' + this.get_status() + ').', 0);
- this._send_error(stanza, JSJAC_JINGLE_ERROR_OUT_OF_ORDER);
- return;
- }
-
- // Change session status
- this._set_status(JSJAC_JINGLE_STATUS_INITIATING);
-
- // Common vars
- var rd_from = this.utils.stanza_from(stanza);
- var rd_sid = this.utils.stanza_sid(stanza);
-
- // Request is valid?
- if(rd_sid && this.utils.stanza_parse_content(stanza)) {
- // Handle additional data (optional)
- this.utils.stanza_parse_group(stanza);
-
- // Set session values
- this._set_sid(rd_sid);
- this._set_to(rd_from);
- this._set_initiator(rd_from);
- this._set_responder(this.utils.connection_jid());
-
- // Register session to common router
- JSJaCJingle._add(JSJAC_JINGLE_SESSION_SINGLE, rd_sid, this);
-
- // Generate and store content data
- this.utils.build_content_remote();
-
- // Video or audio-only session?
- if(JSJAC_JINGLE_MEDIA_VIDEO in this.get_content_remote()) {
- this._set_media(JSJAC_JINGLE_MEDIA_VIDEO);
- } else if(JSJAC_JINGLE_MEDIA_AUDIO in this.get_content_remote()) {
- this._set_media(JSJAC_JINGLE_MEDIA_AUDIO);
- } else {
- // Session initiation not done
- /* @function */
- (this.get_session_initiate_error())(this, stanza);
- this._handle_session_initiate_error(stanza);
-
- // Error (no media is supported)
- this.terminate(JSJAC_JINGLE_REASON_UNSUPPORTED_APPLICATIONS);
-
- this.get_debug().log('[JSJaCJingle:single] _handle_session_initiate_request > Error (unsupported media).', 1);
- return;
- }
-
- // Session initiate done
- /* @function */
- (this.get_session_initiate_success())(this, stanza);
- this._handle_session_initiate_success(stanza);
-
- this.send(JSJAC_JINGLE_IQ_TYPE_RESULT, { id: stanza.getID() });
- } else {
- // Session initiation not done
- /* @function */
- (this.get_session_initiate_error())(this, stanza);
- this._handle_session_initiate_error(stanza);
-
- // Send error reply
- this._send_error(stanza, XMPP_ERROR_BAD_REQUEST);
-
- this.get_debug().log('[JSJaCJingle:single] _handle_session_initiate_request > Error (bad request).', 1);
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_initiate_request > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session terminate
- * @private
- * @event JSJaCJingleSingle#_handle_session_terminate
- * @fires JSJaCJingleSingle#_handle_session_terminate_success
- * @fires JSJaCJingleSingle#_handle_session_terminate_error
- * @fires JSJaCJingleSingle#_handle_session_terminate_request
- * @fires JSJaCJingleSingle#get_session_terminate_success
- * @fires JSJaCJingleSingle#get_session_terminate_error
- * @fires JSJaCJingleSingle#get_session_terminate_request
- * @param {JSJaCPacket} stanza
- */
- _handle_session_terminate: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_terminate', 4);
-
- try {
- var type = stanza.getType();
-
- // Security preconditions
- if(!this.utils.stanza_safe(stanza)) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_terminate > Dropped unsafe stanza.', 0);
-
- this._send_error(stanza, JSJAC_JINGLE_ERROR_UNKNOWN_SESSION);
- return;
- }
-
- // Can now safely dispatch the stanza
- switch(stanza.getType()) {
- case JSJAC_JINGLE_IQ_TYPE_RESULT:
- /* @function */
- (this.get_session_terminate_success())(this, stanza);
- this._handle_session_terminate_success(stanza);
-
- break;
-
- case 'error':
- /* @function */
- (this.get_session_terminate_error())(this, stanza);
- this._handle_session_terminate_error(stanza);
-
- break;
-
- case JSJAC_JINGLE_IQ_TYPE_SET:
- /* @function */
- (this.get_session_terminate_request())(this, stanza);
- this._handle_session_terminate_request(stanza);
-
- break;
-
- default:
- this._send_error(stanza, XMPP_ERROR_FEATURE_NOT_IMPLEMENTED);
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_terminate > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session terminate success
- * @private
- * @event JSJaCJingleSingle#_handle_session_terminate_success
- * @param {JSJaCPacket} stanza
- */
- _handle_session_terminate_success: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_terminate_success', 4);
-
- try {
- this.abort();
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_terminate_success > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session terminate error
- * @private
- * @event JSJaCJingleSingle#_handle_session_terminate_error
- * @param {JSJaCPacket} stanza
- */
- _handle_session_terminate_error: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_terminate_error', 4);
-
- try {
- this.abort(true);
-
- this.get_debug().log('[JSJaCJingle:single] _handle_session_terminate_error > Forced session termination locally.', 0);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_terminate_error > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session terminate request
- * @private
- * @event JSJaCJingleSingle#_handle_session_terminate_request
- * @fires JSJaCJingleSingle#_handle_session_terminate_success
- * @fires JSJaCJingleSingle#get_session_terminate_success
- * @param {JSJaCPacket} stanza
- */
- _handle_session_terminate_request: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_terminate_request', 4);
-
- try {
- // Slot unavailable?
- if(this.get_status() === JSJAC_JINGLE_STATUS_INACTIVE ||
- this.get_status() === JSJAC_JINGLE_STATUS_TERMINATED) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_terminate_request > Cannot handle, resource not active (status: ' + this.get_status() + ').', 0);
- this._send_error(stanza, JSJAC_JINGLE_ERROR_OUT_OF_ORDER);
- return;
- }
-
- // Change session status
- this._set_status(JSJAC_JINGLE_STATUS_TERMINATING);
-
- // Store termination reason
- this._set_reason(this.utils.stanza_terminate_reason(stanza));
-
- // Trigger terminate success callbacks
- /* @function */
- (this.get_session_terminate_success())(this, stanza);
- this._handle_session_terminate_success(stanza);
-
- // Process terminate actions
- this.send(JSJAC_JINGLE_IQ_TYPE_RESULT, { id: stanza.getID() });
-
- this.get_debug().log('[JSJaCJingle:single] _handle_session_terminate_request > (reason: ' + this.get_reason() + ').', 3);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_session_terminate_request > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle transport accept
- * @private
- * @event JSJaCJingleSingle#_handle_transport_accept
- * @param {JSJaCPacket} stanza
- */
- _handle_transport_accept: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_transport_accept', 4);
-
- try {
- // Not implemented for now
- this._send_error(stanza, XMPP_ERROR_FEATURE_NOT_IMPLEMENTED);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_content_accept > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle transport info
- * @private
- * @event JSJaCJingleSingle#_handle_transport_info
- * @param {JSJaCPacket} stanza
- */
- _handle_transport_info: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_transport_info', 4);
-
- try {
- // Slot unavailable?
- if(this.get_status() !== JSJAC_JINGLE_STATUS_INITIATED &&
- this.get_status() !== JSJAC_JINGLE_STATUS_ACCEPTING &&
- this.get_status() !== JSJAC_JINGLE_STATUS_ACCEPTED) {
- this.get_debug().log('[JSJaCJingle:single] _handle_transport_info > Cannot handle, resource not initiated, nor accepting, nor accepted (status: ' + this.get_status() + ').', 0);
- this._send_error(stanza, JSJAC_JINGLE_ERROR_OUT_OF_ORDER);
- return;
- }
-
- // Common vars
- var i, cur_candidate_obj;
-
- // Parse the incoming transport
- var rd_sid = this.utils.stanza_sid(stanza);
-
- // Request is valid?
- if(rd_sid && this.utils.stanza_parse_content(stanza)) {
- // Handle additional data (optional)
- // Still unsure if it is relevant to parse groups there... (are they allowed in such stanza?)
- //this.utils.stanza_parse_group(stanza);
-
- // Re-generate and store new content data
- this.utils.build_content_remote();
-
- var sdp_candidates_remote = this.sdp._generate_candidates(
- this.get_candidates_queue_remote()
- );
-
- // ICE candidates
- for(i in sdp_candidates_remote) {
- cur_candidate_obj = sdp_candidates_remote[i];
-
- this.get_peer_connection().addIceCandidate(
- new WEBRTC_ICE_CANDIDATE({
- sdpMLineIndex : cur_candidate_obj.id,
- candidate : cur_candidate_obj.candidate
- })
- );
- }
-
- // Empty the unapplied candidates queue
- this._set_candidates_queue_remote(null);
-
- // Success reply
- this.send(JSJAC_JINGLE_IQ_TYPE_RESULT, { id: stanza.getID() });
- } else {
- // Send error reply
- this._send_error(stanza, XMPP_ERROR_BAD_REQUEST);
-
- this.get_debug().log('[JSJaCJingle:single] _handle_transport_info > Error.', 1);
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_transport_info > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle transport info success
- * @private
- * @event JSJaCJingleSingle#_handle_transport_info_success
- * @param {JSJaCPacket} stanza
- */
- _handle_transport_info_success: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_transport_info_success', 4);
- },
-
- /**
- * Handles the Jingle transport info error
- * @private
- * @event JSJaCJingleSingle#_handle_transport_info_error
- * @param {JSJaCPacket} stanza
- */
- _handle_transport_info_error: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_transport_info_error', 4);
- },
-
- /**
- * Handles the Jingle transport reject
- * @private
- * @event JSJaCJingleSingle#_handle_transport_reject
- * @param {JSJaCPacket} stanza
- */
- _handle_transport_reject: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_transport_reject', 4);
-
- try {
- // Not implemented for now
- this._send_error(stanza, XMPP_ERROR_FEATURE_NOT_IMPLEMENTED);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_transport_reject > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle transport replace
- * @private
- * @event JSJaCJingleSingle#_handle_transport_replace
- * @param {JSJaCPacket} stanza
- */
- _handle_transport_replace: function(stanza) {
- this.get_debug().log('[JSJaCJingle:single] _handle_transport_replace', 4);
-
- try {
- // Not implemented for now
- this._send_error(stanza, XMPP_ERROR_FEATURE_NOT_IMPLEMENTED);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _handle_transport_replace > ' + e, 1);
- }
- },
-
-
-
- /**
- * JSJSAC JINGLE PEER TOOLS
- */
-
- /**
- * Creates peer connection instance
- * @private
- */
- _peer_connection_create_instance: function() {
- this.get_debug().log('[JSJaCJingle:single] _peer_connection_create_instance', 4);
-
- try {
- // Log STUN servers in use
- var i;
- var ice_config = this.utils.config_ice();
-
- if(typeof ice_config.iceServers == 'object') {
- for(i = 0; i < (ice_config.iceServers).length; i++)
- this.get_debug().log('[JSJaCJingle:single] _peer_connection_create_instance > Using ICE server at: ' + ice_config.iceServers[i].url + ' (' + (i + 1) + ').', 2);
- } else {
- this.get_debug().log('[JSJaCJingle:single] _peer_connection_create_instance > No ICE server configured. Network may not work properly.', 0);
- }
-
- // Create the RTCPeerConnection object
- this._set_peer_connection(
- new WEBRTC_PEER_CONNECTION(
- ice_config,
- WEBRTC_CONFIGURATION.peer_connection.constraints
- )
- );
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _peer_connection_create_instance > ' + e, 1);
- }
- },
-
- /**
- * Attaches peer connection callbacks
- * @private
- * @fires JSJaCJingleSingle#_peer_connection_callback_onicecandidate
- * @fires JSJaCJingleSingle#_peer_connection_callback_oniceconnectionstatechange
- * @fires JSJaCJingleSingle#_peer_connection_callback_onaddstream
- * @fires JSJaCJingleSingle#_peer_connection_callback_onremovestream
- * @param {Function} sdp_message_callback
- */
- _peer_connection_callbacks: function(sdp_message_callback) {
- this.get_debug().log('[JSJaCJingle:single] _peer_connection_callbacks', 4);
-
- try {
- var _this = this;
-
- /**
- * Listens for incoming ICE candidates
- * @event JSJaCJingleSingle#_peer_connection_callback_onicecandidate
- * @type {Function}
- */
- this.get_peer_connection().onicecandidate = function(data) {
- _this._peer_connection_callback_onicecandidate.bind(this)(_this, sdp_message_callback, data);
- };
-
- /**
- * Listens for ICE connection state change
- * @event JSJaCJingleSingle#_peer_connection_callback_oniceconnectionstatechange
- * @type {Function}
- */
- this.get_peer_connection().oniceconnectionstatechange = function(data) {
- switch(this.iceConnectionState) {
- case JSJAC_JINGLE_ICE_CONNECTION_STATE_CONNECTED:
- case JSJAC_JINGLE_ICE_CONNECTION_STATE_COMPLETED:
- if(_this.get_last_ice_state() !== JSJAC_JINGLE_ICE_CONNECTION_STATE_CONNECTED) {
- /* @function */
- (_this.get_stream_connected()).bind(this)(_this, data);
- _this._set_last_ice_state(JSJAC_JINGLE_ICE_CONNECTION_STATE_CONNECTED);
- } break;
-
- case JSJAC_JINGLE_ICE_CONNECTION_STATE_DISCONNECTED:
- case JSJAC_JINGLE_ICE_CONNECTION_STATE_CLOSED:
- if(_this.get_last_ice_state() !== JSJAC_JINGLE_ICE_CONNECTION_STATE_DISCONNECTED) {
- /* @function */
- (_this.get_stream_disconnected()).bind(this)(_this, data);
- _this._set_last_ice_state(JSJAC_JINGLE_ICE_CONNECTION_STATE_DISCONNECTED);
- } break;
- }
-
- _this._peer_connection_callback_oniceconnectionstatechange.bind(this)(_this, data);
- };
-
- /**
- * Listens for stream add
- * @event JSJaCJingleSingle#_peer_connection_callback_onaddstream
- * @type {Function}
- */
- this.get_peer_connection().onaddstream = function(data) {
- /* @function */
- (_this.get_stream_add()).bind(this)(_this, data);
- _this._peer_connection_callback_onaddstream.bind(this)(_this, data);
- };
-
- /**
- * Listens for stream remove
- * @event JSJaCJingleSingle#_peer_connection_callback_onremovestream
- * @type {Function}
- */
- this.get_peer_connection().onremovestream = function(data) {
- /* @function */
- (_this.get_stream_remove()).bind(this)(_this, data);
- _this._peer_connection_callback_onremovestream.bind(this)(_this, data);
- };
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _peer_connection_callbacks > ' + e, 1);
- }
- },
-
- /**
- * Generates peer connection callback for 'onicecandidate'
- * @private
- * @callback
- * @param {JSJaCJingleSingle} _this
- * @param {Function} sdp_message_callback
- * @param {Object} data
- */
- _peer_connection_callback_onicecandidate: function(_this, sdp_message_callback, data) {
- _this.get_debug().log('[JSJaCJingle:single] _peer_connection_callback_onicecandidate', 4);
-
- try {
- if(data.candidate) {
- _this.sdp._parse_candidate_store_store_data(data);
- } else {
- // Build or re-build content (local)
- _this.utils.build_content_local();
-
- // In which action stanza should candidates be sent?
- if((_this.is_initiator() && _this.get_status() === JSJAC_JINGLE_STATUS_INITIATING) ||
- (_this.is_responder() && _this.get_status() === JSJAC_JINGLE_STATUS_ACCEPTING)) {
- _this.get_debug().log('[JSJaCJingle:single] _peer_connection_callback_onicecandidate > Got initial candidates.', 2);
-
- // Execute what's next (initiate/accept session)
- sdp_message_callback();
- } else {
- _this.get_debug().log('[JSJaCJingle:single] _peer_connection_callback_onicecandidate > Got more candidates (on the go).', 2);
-
- // Send unsent candidates
- var candidates_queue_local = _this.get_candidates_queue_local();
-
- if(_this.utils.object_length(candidates_queue_local) > 0)
- _this.send(JSJAC_JINGLE_IQ_TYPE_SET, { action: JSJAC_JINGLE_ACTION_TRANSPORT_INFO, candidates: candidates_queue_local });
- }
-
- // Empty the unsent candidates queue
- _this._set_candidates_queue_local(null);
- }
- } catch(e) {
- _this.get_debug().log('[JSJaCJingle:single] _peer_connection_callback_onicecandidate > ' + e, 1);
- }
- },
-
- /**
- * Generates peer connection callback for 'oniceconnectionstatechange'
- * @private
- * @callback
- * @param {JSJaCJingleSingle} _this
- * @param {Object} data
- */
- _peer_connection_callback_oniceconnectionstatechange: function(_this, data) {
- _this.get_debug().log('[JSJaCJingle:single] _peer_connection_callback_oniceconnectionstatechange', 4);
-
- try {
- // Connection errors?
- switch(this.iceConnectionState) {
- case 'disconnected':
- _this._peer_timeout(this.iceConnectionState, {
- timer : JSJAC_JINGLE_PEER_TIMEOUT_DISCONNECT,
- reason : JSJAC_JINGLE_REASON_CONNECTIVITY_ERROR
- });
- break;
-
- case 'checking':
- _this._peer_timeout(this.iceConnectionState); break;
- }
-
- _this.get_debug().log('[JSJaCJingle:single] _peer_connection_callback_oniceconnectionstatechange > (state: ' + this.iceConnectionState + ').', 2);
- } catch(e) {
- _this.get_debug().log('[JSJaCJingle:single] _peer_connection_callback_oniceconnectionstatechange > ' + e, 1);
- }
- },
-
- /**
- * Generates peer connection callback for 'onaddstream'
- * @private
- * @callback
- * @param {JSJaCJingleSingle} _this
- * @param {Object} data
- */
- _peer_connection_callback_onaddstream: function(_this, data) {
- _this.get_debug().log('[JSJaCJingle:single] _peer_connection_callback_onaddstream', 4);
-
- try {
- if(!data) {
- _this.get_debug().log('[JSJaCJingle:single] _peer_connection_callback_onaddstream > No data passed, dropped.', 2); return;
- }
-
- // Attach remote stream to DOM view
- _this._set_remote_stream(data.stream);
- } catch(e) {
- _this.get_debug().log('[JSJaCJingle:single] _peer_connection_callback_onaddstream > ' + e, 1);
- }
- },
-
- /**
- * Generates peer connection callback for 'onremovestream'
- * @private
- * @callback
- * @param {JSJaCJingleSingle} _this
- * @param {Object} data
- */
- _peer_connection_callback_onremovestream: function(_this, data) {
- _this.get_debug().log('[JSJaCJingle:single] _peer_connection_callback_onremovestream', 4);
-
- try {
- // Detach remote stream from DOM view
- _this._set_remote_stream(null);
- } catch(e) {
- _this.get_debug().log('[JSJaCJingle:single] _peer_connection_callback_onremovestream > ' + e, 1);
- }
- },
-
- /**
- * Dispatches peer connection to correct creator (offer/answer)
- * @private
- * @param {Function} [sdp_message_callback] - Not used there
- */
- _peer_connection_create_dispatch: function(sdp_message_callback) {
- this.get_debug().log('[JSJaCJingle:single] _peer_connection_create_dispatch', 4);
-
- try {
- if(this.is_initiator())
- this._peer_connection_create_offer();
- else
- this._peer_connection_create_answer();
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _peer_connection_create_dispatch > ' + e, 1);
- }
- },
-
- /**
- * Creates peer connection offer
- * @private
- * @param {Function} [sdp_message_callback] - Not used there
- */
- _peer_connection_create_offer: function(sdp_message_callback) {
- this.get_debug().log('[JSJaCJingle:single] _peer_connection_create_offer', 4);
-
- try {
- // Create offer
- this.get_debug().log('[JSJaCJingle:single] _peer_connection_create_offer > Getting local description...', 2);
-
- // Local description
- var _this = this;
-
- this.get_peer_connection().createOffer(
- function(sdp_local) {
- _this._peer_got_description(sdp_local);
- }.bind(this),
-
- this._peer_fail_description.bind(this),
- WEBRTC_CONFIGURATION.create_offer
- );
-
- // Then, wait for responder to send back its remote description
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _peer_connection_create_offer > ' + e, 1);
- }
- },
-
- /**
- * Creates peer connection answer
- * @private
- */
- _peer_connection_create_answer: function() {
- this.get_debug().log('[JSJaCJingle:single] _peer_connection_create_answer', 4);
-
- try {
- // Create offer
- this.get_debug().log('[JSJaCJingle:single] _peer_connection_create_answer > Getting local description...', 2);
-
- // Apply SDP data
- sdp_remote = this.sdp._generate(
- WEBRTC_SDP_TYPE_OFFER,
- this.get_group_remote(),
- this.get_payloads_remote(),
- this.get_candidates_queue_remote()
- );
-
- if(this.get_sdp_trace()) this.get_debug().log('[JSJaCJingle:single] _peer_connection_create_answer > SDP (remote)' + '\n\n' + sdp_remote.description.sdp, 4);
-
- // Remote description
- var _this = this;
-
- this.get_peer_connection().setRemoteDescription(
- (new WEBRTC_SESSION_DESCRIPTION(sdp_remote.description)),
-
- function() {
- // Success (descriptions are compatible)
- },
-
- function(e) {
- if(_this.get_sdp_trace()) _this.get_debug().log('[JSJaCJingle:single] _peer_connection_create_answer > SDP (remote:error)' + '\n\n' + (e.message || e.name || 'Unknown error'), 4);
-
- // Error (descriptions are incompatible)
- _this.terminate(JSJAC_JINGLE_REASON_INCOMPATIBLE_PARAMETERS);
- }
- );
-
- // Local description
- this.get_peer_connection().createAnswer(
- function(sdp_local) {
- _this._peer_got_description(sdp_local);
- }.bind(this),
-
- this._peer_fail_description.bind(this),
- WEBRTC_CONFIGURATION.create_answer
- );
-
- // ICE candidates
- var c;
- var cur_candidate_obj;
-
- for(c in sdp_remote.candidates) {
- cur_candidate_obj = sdp_remote.candidates[c];
-
- this.get_peer_connection().addIceCandidate(
- new WEBRTC_ICE_CANDIDATE({
- sdpMLineIndex : cur_candidate_obj.id,
- candidate : cur_candidate_obj.candidate
- })
- );
- }
-
- // Empty the unapplied candidates queue
- this._set_candidates_queue_remote(null);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _peer_connection_create_answer > ' + e, 1);
- }
- },
-
- /**
- * Triggers the media not obtained error event
- * @private
- * @fires JSJaCJingleSingle#get_session_initiate_error
- * @param {Object} error
- */
- _peer_got_user_media_error: function(error) {
- this.get_debug().log('[JSJaCJingle:single] _peer_got_user_media_error', 4);
-
- try {
- /* @function */
- (this.get_session_initiate_error())(this);
-
- // Not needed in case we are the responder (breaks termination)
- if(this.is_initiator()) this._handle_session_initiate_error();
-
- // Not needed in case we are the initiator (no packet sent, ever)
- if(this.is_responder()) this.terminate(JSJAC_JINGLE_REASON_MEDIA_ERROR);
-
- this.get_debug().log('[JSJaCJingle:single] _peer_got_user_media_error > Failed (' + (error.PERMISSION_DENIED ? 'permission denied' : 'unknown' ) + ').', 1);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _peer_got_user_media_error > ' + e, 1);
- }
- },
-
- /**
- * Set a timeout limit to peer connection
- * @private
- * @param {String} state
- * @param {Object} [args]
- */
- _peer_timeout: function(state, args) {
- try {
- // Assert
- if(typeof args !== 'object') args = {};
-
- var t_sid = this.get_sid();
-
- var _this = this;
-
- setTimeout(function() {
- // State did not change?
- if(_this.get_sid() == t_sid && _this.get_peer_connection().iceConnectionState == state) {
- _this.get_debug().log('[JSJaCJingle:single] _peer_timeout > Peer timeout.', 2);
-
- // Error (transports are incompatible)
- _this.terminate(args.reason || JSJAC_JINGLE_REASON_FAILED_TRANSPORT);
- }
- }, ((args.timer || JSJAC_JINGLE_PEER_TIMEOUT_DEFAULT) * 1000));
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _peer_timeout > ' + e, 1);
- }
- },
-
- /**
- * Stops ongoing peer connections
- * @private
- */
- _peer_stop: function() {
- this.get_debug().log('[JSJaCJingle:single] _peer_stop', 4);
-
- // Detach media streams from DOM view
- this._set_local_stream(null);
- this._set_remote_stream(null);
-
- // Close the media stream
- if(this.get_peer_connection() &&
- (typeof this.get_peer_connection().close == 'function'))
- this.get_peer_connection().close();
-
- // Remove this session from router
- JSJaCJingle._remove(JSJAC_JINGLE_SESSION_SINGLE, this.get_sid());
- },
-
-
-
- /**
- * JSJSAC JINGLE SHORTCUTS
- */
-
- /**
- * Returns local user candidates
- * @private
- * @returns {Object} Candidates
- */
- _shortcut_local_user_candidates: function() {
- return this.get_candidates_local();
- },
-
-
-
- /**
- * JSJSAC JINGLE GETTERS
- */
-
- /**
- * Gets the session initiate pending callback function
- * @public
- * @event JSJaCJingleSingle#get_session_initiate_pending
- * @returns {Function} Callback function
- */
- get_session_initiate_pending: function() {
- return this._shortcut_get_handler(
- this._session_initiate_pending
- );
- },
-
- /**
- * Gets the session initiate success callback function
- * @public
- * @event JSJaCJingleSingle#get_session_initiate_success
- * @returns {Function} Callback function
- */
- get_session_initiate_success: function() {
- return this._shortcut_get_handler(
- this._session_initiate_success
- );
- },
-
- /**
- * Gets the session initiate error callback function
- * @public
- * @event JSJaCJingleSingle#get_session_initiate_error
- * @returns {Function} Callback function
- */
- get_session_initiate_error: function() {
- return this._shortcut_get_handler(
- this._session_initiate_error
- );
- },
-
- /**
- * Gets the session initiate request callback function
- * @public
- * @event JSJaCJingleSingle#get_session_initiate_request
- * @returns {Function} Callback function
- */
- get_session_initiate_request: function() {
- return this._shortcut_get_handler(
- this._session_initiate_request
- );
- },
-
- /**
- * Gets the session accept pending callback function
- * @public
- * @event JSJaCJingleSingle#get_session_accept_pending
- * @returns {Function} Callback function
- */
- get_session_accept_pending: function() {
- return this._shortcut_get_handler(
- this._session_accept_pending
- );
- },
-
- /**
- * Gets the session accept success callback function
- * @public
- * @event JSJaCJingleSingle#get_session_accept_success
- * @returns {Function} Callback function
- */
- get_session_accept_success: function() {
- return this._shortcut_get_handler(
- this._session_accept_success
- );
- },
-
- /**
- * Gets the session accept error callback function
- * @public
- * @event JSJaCJingleSingle#get_session_accept_error
- * @returns {Function} Callback function
- */
- get_session_accept_error: function() {
- return this._shortcut_get_handler(
- this._session_accept_error
- );
- },
-
- /**
- * Gets the session accept request callback function
- * @public
- * @event JSJaCJingleSingle#get_session_accept_request
- * @returns {Function} Callback function
- */
- get_session_accept_request: function() {
- return this._shortcut_get_handler(
- this._session_accept_request
- );
- },
-
- /**
- * Gets the session info pending callback function
- * @public
- * @event JSJaCJingleSingle#get_session_info_pending
- * @returns {Function} Callback function
- */
- get_session_info_pending: function() {
- return this._shortcut_get_handler(
- this._session_info_pending
- );
- },
-
- /**
- * Gets the session info success callback function
- * @public
- * @event JSJaCJingleSingle#get_session_info_success
- * @returns {Function} Callback function
- */
- get_session_info_success: function() {
- return this._shortcut_get_handler(
- this._session_info_success
- );
- },
-
- /**
- * Gets the session info error callback function
- * @public
- * @event JSJaCJingleSingle#get_session_info_error
- * @returns {Function} Callback function
- */
- get_session_info_error: function() {
- return this._shortcut_get_handler(
- this._session_info_error
- );
- },
-
- /**
- * Gets the session info request callback function
- * @public
- * @event JSJaCJingleSingle#get_session_info_request
- * @returns {Function} Callback function
- */
- get_session_info_request: function() {
- return this._shortcut_get_handler(
- this._session_info_request
- );
- },
-
- /**
- * Gets the session terminate pending callback function
- * @public
- * @event JSJaCJingleSingle#get_session_terminate_pending
- * @returns {Function} Callback function
- */
- get_session_terminate_pending: function() {
- return this._shortcut_get_handler(
- this._session_terminate_pending
- );
- },
-
- /**
- * Gets the session terminate success callback function
- * @public
- * @event JSJaCJingleSingle#get_session_terminate_success
- * @returns {Function} Callback function
- */
- get_session_terminate_success: function() {
- return this._shortcut_get_handler(
- this._session_terminate_success
- );
- },
-
- /**
- * Gets the session terminate error callback function
- * @public
- * @event JSJaCJingleSingle#get_session_terminate_error
- * @returns {Function} Callback function
- */
- get_session_terminate_error: function() {
- return this._shortcut_get_handler(
- this._session_terminate_error
- );
- },
-
- /**
- * Gets the session terminate request callback function
- * @public
- * @event JSJaCJingleSingle#get_session_terminate_request
- * @returns {Function} Callback function
- */
- get_session_terminate_request: function() {
- return this._shortcut_get_handler(
- this._session_terminate_request
- );
- },
-
- /**
- * Gets the stream add event callback function
- * @public
- * @event JSJaCJingleSingle#stream_add
- * @returns {Function} Callback function
- */
- get_stream_add: function() {
- return this._shortcut_get_handler(
- this._stream_add
- );
- },
-
- /**
- * Gets the stream remove event callback function
- * @public
- * @event JSJaCJingleSingle#stream_remove
- * @returns {Function} Callback function
- */
- get_stream_remove: function() {
- return this._shortcut_get_handler(
- this._stream_remove
- );
- },
-
- /**
- * Gets the stream connected event callback function
- * @public
- * @event JSJaCJingleSingle#stream_connected
- * @returns {Function} Callback function
- */
- get_stream_connected: function() {
- return this._shortcut_get_handler(
- this._stream_connected
- );
- },
-
- /**
- * Gets the stream disconnected event callback function
- * @public
- * @event JSJaCJingleSingle#stream_disconnected
- * @returns {Function} Callback function
- */
- get_stream_disconnected: function() {
- return this._shortcut_get_handler(
- this._stream_disconnected
- );
- },
-
- /**
- * Gets the prepended ID
- * @public
- * @returns {String} Prepended ID value
- */
- get_id_pre: function() {
- return JSJAC_JINGLE_STANZA_ID_PRE + '_' + (this.get_sid() || '0') + '_';
- },
-
- /**
- * Gets the reason value
- * @public
- * @returns {String} Reason value
- */
- get_reason: function() {
- return this._reason;
- },
-
- /**
- * Gets the remote_view value
- * @public
- * @returns {DOM} Remote view
- */
- get_remote_view: function() {
- return this._remote_view;
- },
-
- /**
- * Gets the remote stream
- * @public
- * @returns {Object} Remote stream instance
- */
- get_remote_stream: function() {
- return this._remote_stream;
- },
-
- /**
- * Gets the remote content
- * @public
- * @param {String} [name]
- * @returns {Object} Remote content object
- */
- get_content_remote: function(name) {
- if(name)
- return (name in this._content_remote) ? this._content_remote[name] : {};
-
- return this._content_remote;
- },
-
- /**
- * Gets the remote payloads
- * @public
- * @param {String} [name]
- * @returns {Object} Remote payloads object
- */
- get_payloads_remote: function(name) {
- if(name)
- return (name in this._payloads_remote) ? this._payloads_remote[name] : {};
-
- return this._payloads_remote;
- },
-
- /**
- * Gets the remote group
- * @public
- * @param {String} [semantics]
- * @returns {Object} Remote group object
- */
- get_group_remote: function(semantics) {
- if(semantics)
- return (semantics in this._group_remote) ? this._group_remote[semantics] : {};
-
- return this._group_remote;
- },
-
- /**
- * Gets the remote candidates
- * @public
- * @param {String} [name]
- * @returns {Object} Remote candidates object
- */
- get_candidates_remote: function(name) {
- if(name)
- return (name in this._candidates_remote) ? this._candidates_remote[name] : [];
-
- return this._candidates_remote;
- },
-
- /**
- * Gets the remote candidates queue
- * @public
- * @param {String} [name]
- * @returns {Object} Remote candidates queue object
- */
- get_candidates_queue_remote: function(name) {
- if(name)
- return (name in this._candidates_queue_remote) ? this._candidates_queue_remote[name] : {};
-
- return this._candidates_queue_remote;
- },
-
- /**
- * Gets the last ICE state value
- * @public
- * @returns {String|Object} Last ICE state value
- */
- get_last_ice_state: function() {
- return this._last_ice_state;
- },
-
-
-
- /**
- * JSJSAC JINGLE SETTERS
- */
-
- /**
- * Sets the session initiate pending callback function
- * @private
- * @param {Function} session_initiate_pending
- */
- _set_session_initiate_pending: function(session_initiate_pending) {
- this._session_initiate_pending = session_initiate_pending;
- },
-
- /**
- * Sets the session initiate success callback function
- * @private
- * @param {Function} initiate_success
- */
- _set_session_initiate_success: function(initiate_success) {
- this._session_initiate_success = initiate_success;
- },
-
- /**
- * Sets the session initiate error callback function
- * @private
- * @param {Function} initiate_error
- */
- _set_session_initiate_error: function(initiate_error) {
- this._session_initiate_error = initiate_error;
- },
-
- /**
- * Sets the session initiate request callback function
- * @private
- * @param {Function} initiate_request
- */
- _set_session_initiate_request: function(initiate_request) {
- this._session_initiate_request = initiate_request;
- },
-
- /**
- * Sets the session accept pending callback function
- * @private
- * @param {Function} accept_pending
- */
- _set_session_accept_pending: function(accept_pending) {
- this._session_accept_pending = accept_pending;
- },
-
- /**
- * Sets the session accept success callback function
- * @private
- * @param {Function} accept_success
- */
- _set_session_accept_success: function(accept_success) {
- this._session_accept_success = accept_success;
- },
-
- /**
- * Sets the session accept error callback function
- * @private
- * @param {Function} accept_error
- */
- _set_session_accept_error: function(accept_error) {
- this._session_accept_error = accept_error;
- },
-
- /**
- * Sets the session accept request callback function
- * @private
- * @param {Function} accept_request
- */
- _set_session_accept_request: function(accept_request) {
- this._session_accept_request = accept_request;
- },
-
- /**
- * Sets the session info pending callback function
- * @private
- * @param {Function} info_pending
- */
- _set_session_info_pending: function(info_pending) {
- this._session_info_pending = info_pending;
- },
-
- /**
- * Sets the session info success callback function
- * @private
- * @param {Function} info_success
- */
- _set_session_info_success: function(info_success) {
- this._session_info_success = info_success;
- },
-
- /**
- * Sets the session info error callback function
- * @private
- * @param {Function} info_error
- */
- _set_session_info_error: function(info_error) {
- this._session_info_error = info_error;
- },
-
- /**
- * Sets the session info request callback function
- * @private
- * @param {Function} info_request
- */
- _set_session_info_request: function(info_request) {
- this._session_info_request = info_request;
- },
-
- /**
- * Sets the session terminate pending callback function
- * @private
- * @param {Function} terminate_pending
- */
- _set_session_terminate_pending: function(terminate_pending) {
- this._session_terminate_pending = terminate_pending;
- },
-
- /**
- * Sets the session terminate success callback function
- * @private
- * @param {Function} terminate_success
- */
- _set_session_terminate_success: function(terminate_success) {
- this._session_terminate_success = terminate_success;
- },
-
- /**
- * Sets the session terminate error callback function
- * @private
- * @param {Function} terminate_error
- */
- _set_session_terminate_error: function(terminate_error) {
- this._session_terminate_error = terminate_error;
- },
-
- /**
- * Sets the session terminate request callback function
- * @private
- * @param {Function} terminate_request
- */
- _set_session_terminate_request: function(terminate_request) {
- this._session_terminate_request = terminate_request;
- },
-
- /**
- * Sets the stream add event callback function
- * @private
- * @param {Function} stream_add
- */
- _set_stream_add: function(stream_add) {
- this._stream_add = stream_add;
- },
-
- /**
- * Sets the stream remove event callback function
- * @private
- * @param {Function} stream_remove
- */
- _set_stream_remove: function(stream_remove) {
- this._stream_remove = stream_remove;
- },
-
- /**
- * Sets the stream connected event callback function
- * @private
- * @param {Function} stream_connected
- */
- _set_stream_connected: function(stream_connected) {
- this._stream_connected = stream_connected;
- },
-
- /**
- * Sets the stream disconnected event callback function
- * @private
- * @param {Function} stream_disconnected
- */
- _set_stream_disconnected: function(stream_disconnected) {
- this._stream_disconnected = stream_disconnected;
- },
-
- /**
- * Sets the termination reason
- * @private
- * @param {String} reason
- */
- _set_reason: function(reason) {
- this._reason = reason || JSJAC_JINGLE_REASON_CANCEL;
- },
-
- /**
- * Sets the remote stream
- * @private
- * @param {DOM} [remote_stream]
- */
- _set_remote_stream: function(remote_stream) {
- try {
- if(!remote_stream && this._remote_stream !== null) {
- this._peer_stream_detach(
- this.get_remote_view()
- );
- }
-
- if(remote_stream) {
- this._remote_stream = remote_stream;
-
- this._peer_stream_attach(
- this.get_remote_view(),
- this.get_remote_stream(),
- false
- );
- } else {
- this._remote_stream = null;
-
- this._peer_stream_detach(
- this.get_remote_view()
- );
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _set_remote_stream > ' + e, 1);
- }
- },
-
- /**
- * Sets the remote view
- * @private
- * @param {DOM} [remote_view]
- */
- _set_remote_view: function(remote_view) {
- if(typeof this._remote_view !== 'object')
- this._remote_view = [];
-
- this._remote_view.push(remote_view);
- },
-
- /**
- * Sets the remote content
- * @private
- * @param {String} name
- * @param {Object} content_remote
- */
- _set_content_remote: function(name, content_remote) {
- this._content_remote[name] = content_remote;
- },
-
- /**
- * Sets the remote payloads
- * @private
- * @param {String} name
- * @param {Object} payload_data
- */
- _set_payloads_remote: function(name, payload_data) {
- this._payloads_remote[name] = payload_data;
- },
-
- /**
- * Adds a remote payload
- * @private
- * @param {String} name
- * @param {Object} payload_data
- */
- _set_payloads_remote_add: function(name, payload_data) {
- try {
- if(!(name in this._payloads_remote)) {
- this._set_payloads_remote(name, payload_data);
- } else {
- var key;
- var payloads_store = this._payloads_remote[name].descriptions.payload;
- var payloads_add = payload_data.descriptions.payload;
-
- for(key in payloads_add) {
- if(!(key in payloads_store))
- payloads_store[key] = payloads_add[key];
- }
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _set_payloads_remote_add > ' + e, 1);
- }
- },
-
- /**
- * Sets the remote group
- * @private
- * @param {String} semantics
- * @param {Object} group_data
- */
- _set_group_remote: function(semantics, group_data) {
- this._group_remote[semantics] = group_data;
- },
-
- /**
- * Sets the remote candidates
- * @private
- * @param {String} name
- * @param {Object} candidate_data
- */
- _set_candidates_remote: function(name, candidate_data) {
- this._candidates_remote[name] = candidate_data;
- },
-
- /**
- * Sets the session initiate pending callback function
- * @private
- * @param {String} name
- * @param {Object} candidate_data
- */
- _set_candidates_queue_remote: function(name, candidate_data) {
- if(name === null)
- this._candidates_queue_remote = {};
- else
- this._candidates_queue_remote[name] = (candidate_data);
- },
-
- /**
- * Adds a remote candidate
- * @private
- * @param {String} name
- * @param {Object} candidate_data
- */
- _set_candidates_remote_add: function(name, candidate_data) {
- try {
- if(!name) return;
-
- if(!(name in this._candidates_remote))
- this._set_candidates_remote(name, []);
-
- var c, i;
- var candidate_ids = [];
-
- for(c in this.get_candidates_remote(name))
- candidate_ids.push(this.get_candidates_remote(name)[c].id);
-
- for(i in candidate_data) {
- if((candidate_data[i].id).indexOf(candidate_ids) !== -1)
- this.get_candidates_remote(name).push(candidate_data[i]);
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:single] _set_candidates_remote_add > ' + e, 1);
- }
- },
-
- /**
- * Sets the last ICE state value
- * @private
- * @param {String|Object} last_ice_state
- */
- _set_last_ice_state: function(last_ice_state) {
- this._last_ice_state = last_ice_state;
- },
- }
-);
-
-/**
- * @fileoverview JSJaC Jingle library - Multi-user call lib
- *
- * @url https://github.com/valeriansaliou/jsjac-jingle
- * @depends https://github.com/sstrigler/JSJaC
- * @author Valérian Saliou https://valeriansaliou.name/
- * @license Mozilla Public License v2.0 (MPL v2.0)
- */
-
-
-/** @module jsjac-jingle/muji */
-/** @exports JSJaCJingleMuji */
-
-
-/**
- * Creates a new XMPP Jingle Muji session.
- * @class
- * @classdesc Creates a new XMPP Jingle Muji session.
- * @augments __JSJaCJingleBase
- * @requires nicolas-van/ring.js
- * @requires sstrigler/JSJaC
- * @requires jsjac-jingle/main
- * @requires jsjac-jingle/base
- * @see {@link http://xmpp.org/extensions/xep-0272.html|XEP-0272: Multiparty Jingle (Muji)}
- * @see {@link http://ringjs.neoname.eu/|Ring.js}
- * @see {@link http://stefan-strigler.de/jsjac-1.3.4/doc/|JSJaC Documentation}
- * @param {Object} [args] - Muji session arguments.
- * @property {*} [args.*] - Herits of JSJaCJingle() baseclass prototype.
- * @property {String} [args.username] - The username when joining room.
- * @property {String} [args.password] - The room password.
- * @property {Boolean} [args.password_protect] - Automatically password-protect the MUC if first joiner.
- * @property {Function} [args.room_message_in] - The incoming message custom handler.
- * @property {Function} [args.room_message_out] - The outgoing message custom handler.
- * @property {Function} [args.room_presence_in] - The incoming presence custom handler.
- * @property {Function} [args.room_presence_out] - The outgoing presence custom handler.
- * @property {Function} [args.session_prepare_pending] - The session prepare pending custom handler.
- * @property {Function} [args.session_prepare_success] - The session prepare success custom handler.
- * @property {Function} [args.session_prepare_error] - The session prepare error custom handler.
- * @property {Function} [args.session_initiate_pending] - The session initiate pending custom handler.
- * @property {Function} [args.session_initiate_success] - The session initiate success custom handler.
- * @property {Function} [args.session_initiate_error] - The session initiate error custom handler.
- * @property {Function} [args.session_leave_pending] - The session leave pending custom handler.
- * @property {Function} [args.session_leave_success] - The session leave success custom handler.
- * @property {Function} [args.session_leave_error] - The session leave error custom handler.
- * @property {Function} [args.participant_prepare] - The participant prepare custom handler.
- * @property {Function} [args.participant_initiate] - The participant initiate custom handler.
- * @property {Function} [args.participant_leave] - The participant session leave custom handler.
- * @property {Function} [args.participant_session_initiate_pending] - The participant session initiate pending custom handler.
- * @property {Function} [args.participant_session_initiate_success] - The participant session initiate success custom handler.
- * @property {Function} [args.participant_session_initiate_error] - The participant session initiate error custom handler.
- * @property {Function} [args.participant_session_initiate_request] - The participant session initiate request custom handler.
- * @property {Function} [args.participant_session_accept_pending] - The participant session accept pending custom handler.
- * @property {Function} [args.participant_session_accept_success] - The participant session accept success custom handler.
- * @property {Function} [args.participant_session_accept_error] - The participant session accept error custom handler.
- * @property {Function} [args.participant_session_accept_request] - The participant session accept request custom handler.
- * @property {Function} [args.participant_session_info_pending] - The participant session info request custom handler.
- * @property {Function} [args.participant_session_info_success] - The participant session info success custom handler.
- * @property {Function} [args.participant_session_info_error] - The participant session info error custom handler.
- * @property {Function} [args.participant_session_info_request] - The participant session info request custom handler.
- * @property {Function} [args.participant_session_terminate_pending] - The participant session terminate pending custom handler.
- * @property {Function} [args.participant_session_terminate_success] - The participant session terminate success custom handler.
- * @property {Function} [args.participant_session_terminate_error] - The participant session terminate error custom handler.
- * @property {Function} [args.participant_session_terminate_request] - The participant session terminate request custom handler.
- * @property {Function} [args.participant_stream_add] - The participant stream add custom handler.
- * @property {Function} [args.participant_stream_remove] - The participant stream remove custom handler.
- * @property {Function} [args.participant_stream_connected] - The participant stream connected custom handler.
- * @property {Function} [args.participant_stream_disconnected] - The participant stream disconnected custom handler.
- * @property {Function} [args.add_remote_view] - The remote view media add (audio/video) custom handler.
- * @property {Function} [args.remove_remote_view] - The remote view media removal (audio/video) custom handler.
- */
-var JSJaCJingleMuji = ring.create([__JSJaCJingleBase],
- /** @lends JSJaCJingleMuji.prototype */
- {
- /**
- * Constructor
- */
- constructor: function(args) {
- this.$super(args);
-
- if(args && args.room_message_in)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._room_message_in = args.room_message_in;
-
- if(args && args.room_message_out)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._room_message_out = args.room_message_out;
-
- if(args && args.room_presence_in)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._room_presence_in = args.room_presence_in;
-
- if(args && args.room_presence_out)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._room_presence_out = args.room_presence_out;
-
- if(args && args.session_prepare_pending)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_prepare_pending = args.session_prepare_pending;
-
- if(args && args.session_prepare_success)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_prepare_success = args.session_prepare_success;
-
- if(args && args.session_prepare_error)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_prepare_error = args.session_prepare_error;
-
- if(args && args.session_initiate_pending)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_initiate_pending = args.session_initiate_pending;
-
- if(args && args.session_initiate_success)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_initiate_success = args.session_initiate_success;
-
- if(args && args.session_initiate_error)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_initiate_error = args.session_initiate_error;
-
- if(args && args.session_leave_pending)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_leave_pending = args.session_leave_pending;
-
- if(args && args.session_leave_success)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_leave_success = args.session_leave_success;
-
- if(args && args.session_leave_error)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._session_leave_error = args.session_leave_error;
-
- if(args && args.participant_prepare)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_prepare = args.participant_prepare;
-
- if(args && args.participant_initiate)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_initiate = args.participant_initiate;
-
- if(args && args.participant_leave)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_leave = args.participant_leave;
-
- if(args && args.participant_session_initiate_pending)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_session_initiate_pending = args.participant_session_initiate_pending;
-
- if(args && args.participant_session_initiate_success)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_session_initiate_success = args.participant_session_initiate_success;
-
- if(args && args.participant_session_initiate_error)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_session_initiate_error = args.participant_session_initiate_error;
-
- if(args && args.participant_session_initiate_request)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_session_initiate_request = args.participant_session_initiate_request;
-
- if(args && args.participant_session_accept_pending)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_session_accept_pending = args.participant_session_accept_pending;
-
- if(args && args.participant_session_accept_success)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_session_accept_success = args.participant_session_accept_success;
-
- if(args && args.participant_session_accept_error)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_session_accept_error = args.participant_session_accept_error;
-
- if(args && args.participant_session_accept_request)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_session_accept_request = args.participant_session_accept_request;
-
- if(args && args.participant_session_info_pending)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_session_info_pending = args.participant_session_info_pending;
-
- if(args && args.participant_session_info_success)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_session_info_success = args.participant_session_info_success;
-
- if(args && args.participant_session_info_error)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_session_info_error = args.participant_session_info_error;
-
- if(args && args.participant_session_info_request)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_session_info_request = args.participant_session_info_request;
-
- if(args && args.participant_session_terminate_pending)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_session_terminate_pending = args.participant_session_terminate_pending;
-
- if(args && args.participant_session_terminate_success)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_session_terminate_success = args.participant_session_terminate_success;
-
- if(args && args.participant_session_terminate_error)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_session_terminate_error = args.participant_session_terminate_error;
-
- if(args && args.participant_session_terminate_request)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_session_terminate_request = args.participant_session_terminate_request;
-
- if(args && args.participant_stream_add)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_stream_add = args.participant_stream_add;
-
- if(args && args.participant_stream_remove)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_stream_remove = args.participant_stream_remove;
-
- if(args && args.participant_stream_connected)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_stream_connected = args.participant_stream_connected;
-
- if(args && args.participant_stream_disconnected)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._participant_stream_disconnected = args.participant_stream_disconnected;
-
- if(args && args.add_remote_view)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._add_remote_view = args.add_remote_view;
-
- if(args && args.remove_remote_view)
- /**
- * @member {Function}
- * @default
- * @private
- */
- this._remove_remote_view = args.remove_remote_view;
-
- if(args && args.username) {
- /**
- * @member {String}
- * @default
- * @private
- */
- this._username = args.username;
- } else {
- /**
- * @member {String}
- * @default
- * @private
- */
- this._username = this.utils.connection_username();
- }
-
- if(args && args.password)
- /**
- * @member {String}
- * @default
- * @private
- */
- this._password = args.password;
-
- if(args && args.password_protect)
- /**
- * @member {Boolean}
- * @default
- * @private
- */
- this._password_protect = args.password_protect;
-
- /**
- * @member {Object}
- * @default
- * @private
- */
- this._participants = {};
-
- /**
- * @member {String}
- * @default
- * @private
- */
- this._iid = '';
-
- /**
- * @member {Boolean}
- * @default
- * @private
- */
- this._is_room_owner = false;
-
- /**
- * @constant
- * @member {String}
- * @default
- * @private
- */
- this._status = JSJAC_JINGLE_MUJI_STATUS_INACTIVE;
-
- /**
- * @constant
- * @member {String}
- * @default
- * @private
- */
- this._namespace = NS_MUJI;
- },
-
-
- /**
- * Initiates a new Muji session.
- * @public
- * @fires JSJaCJingleMuji#get_session_initiate_pending
- */
- join: function() {
- this.get_debug().log('[JSJaCJingle:muji] join', 4);
-
- try {
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:muji] join > Cannot join, resource locked. Please open another session or check WebRTC support.', 0);
- return;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.join(); })) {
- this.get_debug().log('[JSJaCJingle:muji] join > Deferred (waiting for the library components to be initiated).', 0);
- return;
- }
-
- // Slot unavailable?
- if(this.get_status() !== JSJAC_JINGLE_STATUS_INACTIVE) {
- this.get_debug().log('[JSJaCJingle:muji] join > Cannot join, resource not inactive (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- this.get_debug().log('[JSJaCJingle:muji] join > New Jingle Muji session with media: ' + this.get_media(), 2);
-
- // Common vars
- var i, cur_name;
-
- // Trigger session prepare pending custom callback
- /* @function */
- (this.get_session_prepare_pending())(this);
-
- // Change session status
- this._set_status(JSJAC_JINGLE_MUJI_STATUS_PREPARING);
-
- // Set session values
- this._set_iid(this.utils.generate_iid());
- this._set_sid(
- this.utils.generate_hash_md5(this.get_to())
- );
-
- this._set_initiator(this.get_to());
- this._set_responder(this.utils.connection_jid());
-
- for(i in this.get_media_all()) {
- cur_name = this.utils.name_generate(
- this.get_media_all()[i]
- );
-
- this._set_name(cur_name);
-
- this._set_senders(
- cur_name,
- JSJAC_JINGLE_SENDERS_BOTH.jingle
- );
-
- this._set_creator(
- cur_name,
- JSJAC_JINGLE_CREATOR_INITIATOR
- );
- }
-
- // Register session to common router
- JSJaCJingle._add(JSJAC_JINGLE_SESSION_MUJI, this.get_to(), this);
-
- // Send initial join presence
- this.send_presence({ action: JSJAC_JINGLE_MUJI_ACTION_PREPARE });
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] join > ' + e, 1);
- }
- },
-
-
- /**
- * Leaves current Muji session.
- * @public
- * @fires JSJaCJingleMuji#get_session_leave_pending
- */
- leave: function() {
- this.get_debug().log('[JSJaCJingle:muji] leave', 4);
-
- try {
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:muji] leave > Cannot leave, resource locked. Please open another session or check WebRTC support.', 0);
- return;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.leave(); })) {
- this.get_debug().log('[JSJaCJingle:muji] leave > Deferred (waiting for the library components to be initiated).', 0);
- return;
- }
-
- // Slot unavailable?
- if(this.get_status() === JSJAC_JINGLE_MUJI_STATUS_LEFT) {
- this.get_debug().log('[JSJaCJingle:muji] leave > Cannot terminate, resource already terminated (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- // Change session status
- this._set_status(JSJAC_JINGLE_MUJI_STATUS_LEAVING);
-
- // Trigger session leave pending custom callback
- /* @function */
- (this.get_session_leave_pending())(this);
-
- // Leave the room (after properly terminating participant sessions)
- this._terminate_participant_sessions(true, function() {
- _this.send_presence({ action: JSJAC_JINGLE_MUJI_ACTION_LEAVE });
- });
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] leave > ' + e, 1);
- }
- },
-
- /**
- * Aborts current Muji session.
- * @public
- * @param {Boolean} [set_lock]
- */
- abort: function(set_lock) {
- this.get_debug().log('[JSJaCJingle:muji] abort', 4);
-
- try {
- // Change session status
- this._set_status(JSJAC_JINGLE_MUJI_STATUS_LEFT);
-
- // Stop WebRTC
- this._peer_stop();
-
- // Flush all participant content
- this._set_participants(null);
-
- // Lock session? (cannot be used later)
- if(set_lock === true) this._set_lock(true);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] abort > ' + e, 1);
- }
- },
-
- /**
- * Invites people to current Muji session
- * @public
- * @param {String|Array} jid
- * @param {String} [reason]
- */
- invite: function(jid, reason) {
- this.get_debug().log('[JSJaCJingle:muji] invite', 4);
-
- try {
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:muji] invite > Cannot invite, resource locked. Please open another session or check WebRTC support.', 0);
- return;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.invite(jid); })) {
- this.get_debug().log('[JSJaCJingle:muji] invite > Deferred (waiting for the library components to be initiated).', 0);
- return;
- }
-
- if(!jid) {
- this.get_debug().log('[JSJaCJingle:muji] invite > JID parameter not provided or blank.', 0);
- return;
- }
-
- var i;
- jid_arr = (jid instanceof Array) ? jid : [jid];
-
- for(i = 0; i < jid_arr.length; i++) this._send_invite(jid_arr[i], reason);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] invite > ' + e, 1);
- }
- },
-
- /**
- * Mutes a Muji session (local)
- * @public
- * @param {String} name
- */
- mute: function(name) {
- this.get_debug().log('[JSJaCJingle:muji] mute', 4);
-
- try {
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:muji] mute > Cannot mute, resource locked. Please open another session or check WebRTC support.', 0);
- return;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.mute(name); })) {
- this.get_debug().log('[JSJaCJingle:muji] mute > Deferred (waiting for the library components to be initiated).', 0);
- return;
- }
-
- // Already muted?
- if(this.get_mute(name) === true) {
- this.get_debug().log('[JSJaCJingle:muji] mute > Resource already muted.', 0);
- return;
- }
-
- this._peer_sound(false);
- this._set_mute(name, true);
-
- // Mute all participants
- this._toggle_participants_mute(name, JSJAC_JINGLE_SESSION_INFO_MUTE);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] mute > ' + e, 1);
- }
- },
-
- /**
- * Unmutes a Muji session (local)
- * @public
- * @param {String} name
- */
- unmute: function(name) {
- this.get_debug().log('[JSJaCJingle:muji] unmute', 4);
-
- try {
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:muji] unmute > Cannot unmute, resource locked. Please open another session or check WebRTC support.', 0);
- return;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.unmute(name); })) {
- this.get_debug().log('[JSJaCJingle:muji] unmute > Deferred (waiting for the library components to be initiated).', 0);
- return;
- }
-
- // Already unmute?
- if(this.get_mute(name) === false) {
- this.get_debug().log('[JSJaCJingle:muji] unmute > Resource already unmuted.', 0);
- return;
- }
-
- this._peer_sound(true);
- this._set_mute(name, false);
-
- // Unmute all participants
- this._toggle_participants_mute(name, JSJAC_JINGLE_SESSION_INFO_UNMUTE);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] unmute > ' + e, 1);
- }
- },
-
- /**
- * Toggles media type in a Muji session (local)
- * @todo Code media() (Muji version)
- * @public
- * @param {String} [media]
- */
- media: function(media) {
- /* DEV: don't expect this to work as of now! */
- /* MEDIA() - MUJI VERSION */
-
- this.get_debug().log('[JSJaCJingle:muji] media', 4);
-
- try {
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:muji] media > Cannot change media, resource locked. Please open another session or check WebRTC support.', 0);
- return;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.media(media); })) {
- this.get_debug().log('[JSJaCJingle:muji] media > Deferred (waiting for the library components to be initiated).', 0);
- return;
- }
-
- // Toggle media?
- if(!media)
- media = (this.get_media() == JSJAC_JINGLE_MEDIA_VIDEO) ? JSJAC_JINGLE_MEDIA_AUDIO : JSJAC_JINGLE_MEDIA_VIDEO;
-
- // Media unknown?
- if(!(media in JSJAC_JINGLE_MEDIAS)) {
- this.get_debug().log('[JSJaCJingle:muji] media > No media provided or media unsupported (media: ' + media + ').', 0);
- return;
- }
-
- // Already using provided media?
- if(this.get_media() == media) {
- this.get_debug().log('[JSJaCJingle:muji] media > Resource already using this media (media: ' + media + ').', 0);
- return;
- }
-
- // Switch locked for now? (another one is being processed)
- if(this.get_media_busy()) {
- this.get_debug().log('[JSJaCJingle:muji] media > Resource already busy switching media (busy: ' + this.get_media() + ', media: ' + media + ').', 0);
- return;
- }
-
- this.get_debug().log('[JSJaCJingle:muji] media > Changing media to: ' + media + '...', 2);
-
- // Store new media
- this._set_media(media);
- this._set_media_busy(true);
-
- // Toggle video mode (add/remove)
- if(media == JSJAC_JINGLE_MEDIA_VIDEO) {
- /* @todo the flow is something like that... */
- /*this._peer_get_user_media(function() {
- this._peer_connection_create(
- function() {
- this.get_debug().log('[JSJaCJingle:muji] media > Ready to change media (to: ' + media + ').', 2);
-
- // 'content-add' >> video
- // @todo restart video stream configuration
-
- // WARNING: only change get user media, DO NOT TOUCH THE STREAM THING (don't stop active stream as it's flowing!!)
-
- this.send(JSJAC_JINGLE_IQ_TYPE_SET, { action: JSJAC_JINGLE_ACTION_CONTENT_ADD, name: JSJAC_JINGLE_MEDIA_VIDEO });
- }
- )
- });*/
- } else {
- /* @todo the flow is something like that... */
- /*this._peer_get_user_media(function() {
- this._peer_connection_create(
- function() {
- this.get_debug().log('[JSJaCJingle:muji] media > Ready to change media (to: ' + media + ').', 2);
-
- // 'content-remove' >> video
- // @todo remove video stream configuration
-
- // WARNING: only change get user media, DO NOT TOUCH THE STREAM THING (don't stop active stream as it's flowing!!)
- // here, only stop the video stream, do not touch the audio stream
-
- this.send(JSJAC_JINGLE_IQ_TYPE_SET, { action: JSJAC_JINGLE_ACTION_CONTENT_REMOVE, name: JSJAC_JINGLE_MEDIA_VIDEO });
- }
- )
- });*/
- }
-
- /* @todo loop on participant sessions and toggle medias individually */
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] media > ' + e, 1);
- }
- },
-
- /**
- * Sends a given Muji presence stanza
- * @public
- * @fires JSJaCJingleMuji#get_room_presence_out
- * @param {Object} [args]
- * @returns {Boolean} Success
- */
- send_presence: function(args) {
- this.get_debug().log('[JSJaCJingle:muji] send_presence', 4);
-
- try {
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:muji] send_presence > Cannot send, resource locked. Please open another session or check WebRTC support.', 0);
- return false;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.send_presence(args); })) {
- this.get_debug().log('[JSJaCJingle:muji] send_presence > Deferred (waiting for the library components to be initiated).', 0);
- return false;
- }
-
- if(typeof args !== 'object') args = {};
-
- // Build stanza
- var stanza = new JSJaCPresence();
- stanza.setTo(this.get_muc_to());
-
- if(!args.id) args.id = this.get_id_new();
- stanza.setID(args.id);
-
- // Submit to registered handler
- switch(args.action) {
- case JSJAC_JINGLE_MUJI_ACTION_PREPARE:
- this._send_session_prepare(stanza, args); break;
-
- case JSJAC_JINGLE_MUJI_ACTION_INITIATE:
- this._send_session_initiate(stanza, args); break;
-
- case JSJAC_JINGLE_MUJI_ACTION_LEAVE:
- this._send_session_leave(stanza, args); break;
-
- default:
- this.get_debug().log('[JSJaCJingle:muji] send_presence > Unexpected error.', 1);
-
- return false;
- }
-
- this._set_sent_id(args.id);
-
- this.get_connection().send(stanza);
-
- if(this.get_net_trace()) this.get_debug().log('[JSJaCJingle:muji] send_presence > Outgoing packet sent' + '\n\n' + stanza.xml());
-
- // Trigger custom callback
- /* @function */
- (this.get_room_presence_out())(this, stanza);
-
- return true;
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] send_presence > ' + e, 1);
- }
-
- return false;
- },
-
- /**
- * Sends a given Muji message stanza
- * @public
- * @fires JSJaCJingleMuji#get_room_message_out
- * @param {String} body
- * @returns {Boolean} Success
- */
- send_message: function(body) {
- this.get_debug().log('[JSJaCJingle:muji] send_message', 4);
-
- try {
- // Missing args?
- if(!body) {
- this.get_debug().log('[JSJaCJingle:muji] send_message > Message body missing.', 0);
- return false;
- }
-
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:muji] send_message > Cannot send, resource locked. Please open another session or check WebRTC support.', 0);
- return false;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.send_message(body); })) {
- this.get_debug().log('[JSJaCJingle:muji] send_message > Deferred (waiting for the library components to be initiated).', 0);
- return false;
- }
-
- // Build stanza
- var stanza = new JSJaCMessage();
-
- stanza.setTo(this.get_to());
- stanza.setType(JSJAC_JINGLE_MESSAGE_TYPE_GROUPCHAT);
- stanza.setBody(body);
-
- this.get_connection().send(stanza);
-
- if(this.get_net_trace()) this.get_debug().log('[JSJaCJingle:muji] send_message > Outgoing packet sent' + '\n\n' + stanza.xml());
-
- // Trigger custom callback
- /* @function */
- (this.get_room_message_out())(this, stanza);
-
- return true;
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] send_message > ' + e, 1);
- }
-
- return false;
- },
-
- /**
- * Handles a Muji presence stanza
- * @public
- * @fires JSJaCJingleMuji#_handle_participant_prepare
- * @fires JSJaCJingleMuji#_handle_participant_initiate
- * @fires JSJaCJingleMuji#_handle_participant_leave
- * @fires JSJaCJingleMuji#get_room_presence_in
- * @fires JSJaCJingleMuji#get_participant_prepare
- * @fires JSJaCJingleMuji#get_participant_initiate
- * @fires JSJaCJingleMuji#get_participant_leave
- * @param {JSJaCPacket} stanza
- */
- handle_presence: function(stanza) {
- this.get_debug().log('[JSJaCJingle:muji] handle_presence', 4);
-
- try {
- if(this.get_net_trace()) this.get_debug().log('[JSJaCJingle:muji] handle_presence > Incoming packet received' + '\n\n' + stanza.xml());
-
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:muji] handle_presence > Cannot handle, resource locked. Please open another session or check WebRTC support.', 0);
- return;
- }
-
- // Defer?
- var _this = this;
-
- if(JSJaCJingle._defer(function() { _this.handle_presence(stanza); })) {
- this.get_debug().log('[JSJaCJingle:muji] handle_presence > Deferred (waiting for the library components to be initiated).', 0);
- return;
- }
-
- // Trigger custom callback
- /* @function */
- (this.get_room_presence_in())(this, stanza);
-
- var id = stanza.getID();
- var type = (stanza.getType() || JSJAC_JINGLE_PRESENCE_TYPE_AVAILABLE);
-
- if(id) this._set_received_id(id);
-
- // Submit to custom handler (only for local user packets)
- var i, handlers, is_stanza_from_local;
-
- handlers = this.get_registered_handlers(JSJAC_JINGLE_STANZA_PRESENCE, type, id);
- is_stanza_from_local = this.is_stanza_from_local(stanza);
-
- if(typeof handlers == 'object' && handlers.length && is_stanza_from_local === true) {
- this.get_debug().log('[JSJaCJingle:muji] handle_presence > Submitted to custom registered handlers.', 2);
-
- for(i in handlers) {
- /* @function */
- handlers[i](stanza);
- }
-
- this.unregister_handler(JSJAC_JINGLE_STANZA_PRESENCE, type, id);
-
- return;
- }
-
- // Local stanza?
- if(is_stanza_from_local === true) {
- if(stanza.getType() === JSJAC_JINGLE_PRESENCE_TYPE_UNAVAILABLE) {
- this.get_debug().log('[JSJaCJingle:muji] handle_presence > Conference room going offline, forcing termination...', 1);
-
- // Change session status
- this._set_status(JSJAC_JINGLE_MUJI_STATUS_LEAVING);
-
- this._terminate_participant_sessions();
-
- // Trigger leave error handlers
- /* @function */
- this.get_session_leave_error()(this, stanza);
- this._handle_session_leave_error(stanza);
- } else {
- this.get_debug().log('[JSJaCJingle:muji] handle_presence > Dropped local stanza.', 1);
- }
- } else {
- // Defer if user media not ready yet
- this._defer_participant_handlers(function(is_deferred) {
- // Remote stanza handlers
- if(stanza.getType() === JSJAC_JINGLE_PRESENCE_TYPE_UNAVAILABLE) {
- _this._handle_participant_leave(stanza, is_deferred);
-
- /* @function */
- _this.get_participant_leave()(stanza);
- } else {
- var muji = _this.utils.stanza_muji(stanza);
-
- // Don't handle non-Muji stanzas there...
- if(!muji) return;
-
- // Submit to registered handler
- var username = _this.utils.stanza_username(stanza);
- var status = _this._shortcut_participant_status(username);
-
- var fn_log_drop = function() {
- _this.get_debug().log('[JSJaCJingle:muji] handle_presence > Dropped out-of-order participant stanza with status: ' + status, 1);
- };
-
- if(_this._stanza_has_preparing(muji)) {
- if(!status || status === JSJAC_JINGLE_MUJI_STATUS_INACTIVE) {
- _this._handle_participant_prepare(stanza, is_deferred);
-
- /* @function */
- _this.get_participant_prepare()(_this, stanza);
- } else {
- fn_log_drop();
- }
- } else if(_this._stanza_has_content(muji)) {
- if(!status || status === JSJAC_JINGLE_MUJI_STATUS_INACTIVE || status === JSJAC_JINGLE_MUJI_STATUS_PREPARED) {
- _this._handle_participant_initiate(stanza, is_deferred);
-
- /* @function */
- _this.get_participant_initiate()(_this, stanza);
- } else {
- fn_log_drop();
- }
- } else if(_this.is_stanza_from_participant(stanza)) {
- if(!status || status === JSJAC_JINGLE_MUJI_STATUS_INACTIVE || status === JSJAC_JINGLE_MUJI_STATUS_INITIATED) {
- _this._handle_participant_leave(stanza, is_deferred);
-
- /* @function */
- _this.get_participant_leave()(_this, stanza);
- } else {
- fn_log_drop();
- }
- }
- }
- });
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] handle_presence > ' + e, 1);
- }
- },
-
- /**
- * Handles a Muji message stanza
- * @public
- * @fires JSJaCJingleMuji#get_room_message_in
- * @param {JSJaCPacket} stanza
- */
- handle_message: function(stanza) {
- this.get_debug().log('[JSJaCJingle:muji] handle_message', 4);
-
- try {
- var stanza_type = stanza.getType();
-
- if(stanza_type != JSJAC_JINGLE_MESSAGE_TYPE_GROUPCHAT) {
- this.get_debug().log('[JSJaCJingle:muji] handle_message > Dropped invalid stanza type: ' + stanza_type, 0);
- return;
- }
-
- if(this.get_net_trace()) this.get_debug().log('[JSJaCJingle:muji] handle_message > Incoming packet received' + '\n\n' + stanza.xml());
-
- // Locked?
- if(this.get_lock()) {
- this.get_debug().log('[JSJaCJingle:muji] handle_message > Cannot handle, resource locked. Please open another session or check WebRTC support.', 0);
- return;
- }
-
- // Trigger custom callback
- /* @function */
- (this.get_room_message_in())(this, stanza);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] handle_message > ' + e, 1);
- }
- },
-
-
-
- /**
- * JSJSAC JINGLE MUJI SENDERS
- */
-
- /**
- * Sends the invite message.
- * @private
- * @param {String} jid
- */
- _send_invite: function(jid, reason) {
- this.get_debug().log('[JSJaCJingle:muji] _send_invite', 4);
-
- try {
- var cur_participant, participants,
- stanza, x_invite;
-
- stanza = new JSJaCMessage();
- stanza.setTo(jid);
-
- x_invite = stanza.buildNode('x', {
- 'jid': this.get_to(),
- 'xmlns': NS_JABBER_CONFERENCE
- });
-
- if(reason)
- x_invite.setAttribute('reason', reason);
- if(this.get_password())
- x_invite.setAttribute('password', this.get_password());
-
- stanza.getNode().appendChild(x_invite);
-
- stanza.appendNode('x', {
- 'media': this.get_media(),
- 'xmlns': NS_MUJI_INVITE
- });
-
- this.get_connection().send(stanza);
-
- if(this.get_net_trace()) this.get_debug().log('[JSJaCJingle:muji] _send_invite > Outgoing packet sent' + '\n\n' + stanza.xml());
-
- // Trigger custom callback
- /* @function */
- (this.get_room_message_out())(this, stanza);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _send_invite > ' + e, 1);
- }
- },
-
- /**
- * Sends the session prepare event.
- * @private
- * @fires JSJaCJingleMuji#_handle_session_prepare_success
- * @fires JSJaCJingleMuji#_handle_session_prepare_error
- * @fires JSJaCJingleMuji#get_session_prepare_success
- * @fires JSJaCJingleMuji#get_session_prepare_error
- * @fires JSJaCJingleMuji#get_session_prepare_pending
- * @param {JSJaCPacket} stanza
- * @param {Object} args
- */
- _send_session_prepare: function(stanza, args) {
- this.get_debug().log('[JSJaCJingle:muji] _send_session_prepare', 4);
-
- try {
- if(this.get_status() !== JSJAC_JINGLE_MUJI_STATUS_PREPARING) {
- this.get_debug().log('[JSJaCJingle:muji] _send_session_prepare > Cannot send prepare stanza, resource already prepared (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- if(!args) {
- this.get_debug().log('[JSJaCJingle:muji] _send_session_prepare > Arguments not provided.', 1);
- return;
- }
-
- // Build Muji stanza
- var muji = this.utils.stanza_generate_muji(stanza);
- muji.appendChild(stanza.buildNode('preparing', { 'xmlns': NS_MUJI }));
-
- // Password-protected room?
- if(this.get_password()) {
- var x_muc = stanza.getNode().appendChild(stanza.buildNode('x', { 'xmlns': NS_JABBER_MUC }));
-
- x_muc.appendChild(
- stanza.buildNode('password', { 'xmlns': NS_JABBER_MUC }, this.get_password())
- );
- }
-
- // Schedule success
- var _this = this;
-
- this.register_handler(JSJAC_JINGLE_STANZA_PRESENCE, JSJAC_JINGLE_PRESENCE_TYPE_AVAILABLE, args.id, function(stanza) {
- /* @function */
- (_this.get_session_prepare_success())(_this, stanza);
- _this._handle_session_prepare_success(stanza);
- });
-
- this.register_handler(JSJAC_JINGLE_STANZA_PRESENCE, JSJAC_JINGLE_PRESENCE_TYPE_ERROR, args.id, function(stanza) {
- /* @function */
- (_this.get_session_prepare_error())(_this, stanza);
- _this._handle_session_prepare_error(stanza);
- });
-
- // Schedule timeout
- this.utils.stanza_timeout(JSJAC_JINGLE_STANZA_PRESENCE, JSJAC_JINGLE_PRESENCE_TYPE_AVAILABLE, args.id, {
- /* @function */
- external: this.get_session_prepare_error().bind(this),
- internal: this._handle_session_prepare_error.bind(this)
- });
- this.utils.stanza_timeout(JSJAC_JINGLE_STANZA_PRESENCE, JSJAC_JINGLE_PRESENCE_TYPE_ERROR, args.id);
-
- this.get_debug().log('[JSJaCJingle:muji] _send_session_prepare > Sent.', 2);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _send_session_prepare > ' + e, 1);
- }
- },
-
- /**
- * Sends the session initiate event.
- * @private
- * @fires JSJaCJingleMuji#_handle_session_initiate_success
- * @fires JSJaCJingleMuji#_handle_session_initiate_error
- * @fires JSJaCJingleMuji#get_session_initiate_success
- * @fires JSJaCJingleMuji#get_session_initiate_error
- * @param {JSJaCPacket} stanza
- * @param {Object} args
- */
- _send_session_initiate: function(stanza, args) {
- this.get_debug().log('[JSJaCJingle:muji] _send_session_initiate', 4);
-
- try {
- if(this.get_status() !== JSJAC_JINGLE_MUJI_STATUS_INITIATING) {
- this.get_debug().log('[JSJaCJingle:muji] _send_session_initiate > Cannot send initiate stanza, resource already initiated (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- if(!args) {
- this.get_debug().log('[JSJaCJingle:muji] _send_session_initiate > Arguments not provided.', 1);
- return;
- }
-
- // Build Muji stanza
- var muji = this.utils.stanza_generate_muji(stanza);
-
- this.utils.stanza_generate_content_local(stanza, muji, false);
- this.utils.stanza_generate_group_local(stanza, muji);
-
- // Schedule success
- var _this = this;
-
- this.register_handler(JSJAC_JINGLE_STANZA_PRESENCE, JSJAC_JINGLE_PRESENCE_TYPE_AVAILABLE, args.id, function(stanza) {
- /* @function */
- (_this.get_session_initiate_success())(_this, stanza);
- _this._handle_session_initiate_success(stanza);
- });
-
- this.register_handler(JSJAC_JINGLE_STANZA_PRESENCE, JSJAC_JINGLE_PRESENCE_TYPE_ERROR, args.id, function(stanza) {
- /* @function */
- (_this.get_session_initiate_error())(_this, stanza);
- _this._handle_session_initiate_error(stanza);
- });
-
- // Schedule timeout
- this.utils.stanza_timeout(JSJAC_JINGLE_STANZA_PRESENCE, JSJAC_JINGLE_PRESENCE_TYPE_AVAILABLE, args.id, {
- /* @function */
- external: this.get_session_initiate_error().bind(this),
- internal: this._handle_session_initiate_error.bind(this)
- });
- this.utils.stanza_timeout(JSJAC_JINGLE_STANZA_PRESENCE, JSJAC_JINGLE_PRESENCE_TYPE_ERROR, args.id);
-
- this.get_debug().log('[JSJaCJingle:muji] _send_session_initiate > Sent.', 2);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _send_session_initiate > ' + e, 1);
- }
- },
-
- /**
- * Sends the session leave event.
- * @private
- * @fires JSJaCJingleMuji#_handle_session_leave_success
- * @fires JSJaCJingleMuji#_handle_session_leave_error
- * @fires JSJaCJingleMuji#get_session_leave_success
- * @fires JSJaCJingleMuji#get_session_leave_error
- * @param {JSJaCPacket} stanza
- * @param {Object} args
- */
- _send_session_leave: function(stanza, args) {
- this.get_debug().log('[JSJaCJingle:muji] _send_session_leave', 4);
-
- try {
- if(this.get_status() !== JSJAC_JINGLE_MUJI_STATUS_LEAVING) {
- this.get_debug().log('[JSJaCJingle:muji] _send_session_leave > Cannot send leave stanza, resource already left (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- if(!args) {
- this.get_debug().log('[JSJaCJingle:muji] _send_session_leave > Arguments not provided.', 1);
- return;
- }
-
- stanza.setType(JSJAC_JINGLE_PRESENCE_TYPE_UNAVAILABLE);
-
- // Schedule success
- var _this = this;
-
- this.register_handler(JSJAC_JINGLE_STANZA_PRESENCE, JSJAC_JINGLE_PRESENCE_TYPE_UNAVAILABLE, args.id, function(stanza) {
- /* @function */
- (_this.get_session_leave_success())(_this, stanza);
- _this._handle_session_leave_success(stanza);
- });
-
- this.register_handler(JSJAC_JINGLE_STANZA_PRESENCE, JSJAC_JINGLE_PRESENCE_TYPE_ERROR, args.id, function(stanza) {
- /* @function */
- (_this.get_session_leave_error())(_this, stanza);
- _this._handle_session_leave_error(stanza);
- });
-
- // Schedule timeout
- this.utils.stanza_timeout(JSJAC_JINGLE_STANZA_PRESENCE, JSJAC_JINGLE_PRESENCE_TYPE_UNAVAILABLE, args.id, {
- /* @function */
- external: this.get_session_leave_error().bind(this),
- internal: this._handle_session_leave_error.bind(this)
- });
- this.utils.stanza_timeout(JSJAC_JINGLE_STANZA_PRESENCE, JSJAC_JINGLE_PRESENCE_TYPE_ERROR, args.id);
-
- this.get_debug().log('[JSJaCJingle:muji] _send_session_leave > Sent.', 2);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _send_session_leave > ' + e, 1);
- }
- },
-
-
-
- /**
- * JSJSAC JINGLE MUJI HANDLERS
- */
-
- /**
- * Handles the Jingle session prepare success
- * @private
- * @event JSJaCJingleMuji#_handle_session_prepare_success
- * @param {JSJaCPacket} stanza
- */
- _handle_session_prepare_success: function(stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_prepare_success', 4);
-
- try {
- if(this.get_status() !== JSJAC_JINGLE_MUJI_STATUS_PREPARING) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_prepare_success > Cannot handle prepare success stanza, resource already prepared (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- var username = this.utils.stanza_username(stanza);
-
- if(!username) {
- throw 'No username provided, not accepting session prepare stanza.';
- }
-
- if(this._stanza_has_room_owner(stanza)) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_prepare_success > Current MUC affiliation is owner.', 2);
-
- this._set_is_room_owner(true);
- }
-
- if(this._stanza_has_password_invalid(stanza)) {
- // Password protected room?
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_prepare_success > Password-protected room, aborting.', 1);
-
- /* @function */
- (this.get_session_leave_success())(this, stanza);
- this._handle_session_leave_success(stanza);
- } else if(this._stanza_has_username_conflict(stanza)) {
- // Username conflict
- var alt_username = (this.get_username() + this.utils.generate_random(4));
-
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_prepare_success > Conflicting username, changing it to: ' + alt_username, 2);
-
- this._set_username(alt_username);
- this.send_presence({ action: JSJAC_JINGLE_MUJI_ACTION_PREPARE });
- } else {
- // Change session status
- this._set_status(JSJAC_JINGLE_MUJI_STATUS_PREPARED);
-
- // Initialize WebRTC
- var _this = this;
-
- this._peer_get_user_media(function() {
- _this._peer_connection_create(function() {
- _this.get_debug().log('[JSJaCJingle:muji] _handle_session_prepare_success > Ready to begin Muji initiation.', 2);
-
- // Trigger session initiate pending custom callback
- /* @function */
- (_this.get_session_initiate_pending())(_this);
-
- // Build content (local)
- _this.utils.build_content_local();
-
- // Change session status
- _this._set_status(JSJAC_JINGLE_MUJI_STATUS_INITIATING);
-
- _this.send_presence({ action: JSJAC_JINGLE_MUJI_ACTION_INITIATE });
- });
- });
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_prepare_success > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session prepare error
- * @private
- * @event JSJaCJingleMuji#_handle_session_prepare_error
- * @param {JSJaCPacket} stanza
- */
- _handle_session_prepare_error: function(stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_prepare_error', 4);
-
- try {
- if(this.get_status() !== JSJAC_JINGLE_MUJI_STATUS_PREPARING) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_prepare_error > Cannot handle prepare error stanza, resource already prepared (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- this.leave();
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_prepare_error > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session initiate success
- * @private
- * @event JSJaCJingleMuji#_handle_session_initiate_success
- * @param {JSJaCPacket} stanza
- */
- _handle_session_initiate_success: function(stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_initiate_success', 4);
-
- try {
- if(this.get_status() !== JSJAC_JINGLE_MUJI_STATUS_INITIATING) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_initiate_success > Cannot handle initiate success stanza, resource already initiated (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- // Change session status
- this._set_status(JSJAC_JINGLE_MUJI_STATUS_INITIATED);
-
- // Undefer pending participant handlers
- this._undefer_participant_handlers();
-
- // Autoconfigure room password if new MUC
- if(this.get_is_room_owner() === true &&
- this.get_password_protect() === true &&
- this.utils.object_length(this.get_participants()) === 0) {
- this._autoconfigure_room_password();
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_initiate_success > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session initiate error
- * @private
- * @event JSJaCJingleMuji#_handle_session_initiate_error
- * @param {JSJaCPacket} stanza
- */
- _handle_session_initiate_error: function(stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_initiate_error', 4);
-
- try {
- if(this.get_status() !== JSJAC_JINGLE_MUJI_STATUS_INITIATING) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_initiate_error > Cannot handle initiate error stanza, resource already initiated (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- this.leave();
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_initiate_error > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session leave success
- * @private
- * @event JSJaCJingleMuji#_handle_session_leave_success
- * @param {JSJaCPacket} stanza
- */
- _handle_session_leave_success: function(stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_leave_success', 4);
-
- try {
- if(this.get_status() !== JSJAC_JINGLE_MUJI_STATUS_LEAVING) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_leave_success > Cannot handle leave success stanza, resource already left (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- this.abort();
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_leave_success > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session leave error
- * @private
- * @event JSJaCJingleMuji#_handle_session_leave_error
- * @param {JSJaCPacket} stanza
- */
- _handle_session_leave_error: function(stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_leave_error', 4);
-
- try {
- if(this.get_status() !== JSJAC_JINGLE_MUJI_STATUS_LEAVING) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_leave_success > Cannot handle leave error stanza, resource already left (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- this.abort(true);
-
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_leave_error > Forced session exit locally.', 0);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_session_leave_error > ' + e, 1);
- }
- },
-
- /**
- * Handles the participant prepare event.
- * @private
- * @event JSJaCJingleMuji#_handle_participant_prepare
- * @param {JSJaCPacket} stanza
- * @param {Boolean} [is_deferred]
- */
- _handle_participant_prepare: function(stanza, is_deferred) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_prepare', 4);
-
- try {
- var username = this.utils.stanza_username(stanza);
-
- if(!username) {
- throw 'No username provided, not accepting participant prepare stanza.';
- }
-
- // Local slot unavailable?
- if(this.get_status() === JSJAC_JINGLE_MUJI_STATUS_INACTIVE ||
- this.get_status() === JSJAC_JINGLE_MUJI_STATUS_LEAVING ||
- this.get_status() === JSJAC_JINGLE_MUJI_STATUS_LEFT) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_prepare > [' + username + '] > Cannot handle, resource not available (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- // Remote slot unavailable?
- var status = this._shortcut_participant_status(username);
-
- if(status !== JSJAC_JINGLE_MUJI_STATUS_INACTIVE) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_prepare > [' + username + '] > Cannot handle prepare stanza, participant already prepared (status: ' + status + ').', 0);
- return;
- }
-
- this._set_participants(username, {
- status: JSJAC_JINGLE_MUJI_STATUS_PREPARED,
- view: this._shortcut_participant_view(username)
- });
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_prepare > ' + e, 1);
- }
- },
-
- /**
- * Handles the participant initiate event.
- * @private
- * @event JSJaCJingleMuji#_handle_participant_initiate
- * @param {JSJaCPacket} stanza
- * @param {Boolean} [is_deferred]
- */
- _handle_participant_initiate: function(stanza, is_deferred) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_initiate', 4);
-
- try {
- var username = this.utils.stanza_username(stanza);
-
- if(!username) {
- throw 'No username provided, not accepting participant initiate stanza.';
- }
-
- // Local slot unavailable?
- if(this.get_status() === JSJAC_JINGLE_MUJI_STATUS_INACTIVE ||
- this.get_status() === JSJAC_JINGLE_MUJI_STATUS_LEAVING ||
- this.get_status() === JSJAC_JINGLE_MUJI_STATUS_LEFT) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_initiate > [' + username + '] > Cannot handle, resource not available (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- // Remote slot unavailable?
- var status = this._shortcut_participant_status(username);
-
- if(status !== JSJAC_JINGLE_MUJI_STATUS_INACTIVE &&
- status !== JSJAC_JINGLE_MUJI_STATUS_PREPARED) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_initiate > [' + username + '] > Cannot handle initiate stanza, participant already initiated (status: ' + status + ').', 0);
- return;
- }
-
- // Need to initiate? (participant was here before we joined)
- /* @see {@link http://xmpp.org/extensions/xep-0272.html#joining|XEP-0272: Multiparty Jingle (Muji) - Joining a Conference} */
- if(is_deferred === true) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_initiate > [' + username + '] Initiating participant Jingle session...', 2);
-
- // Create Jingle session
- this._create_participant_session(username).initiate();
- } else {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_initiate > [' + username + '] Waiting for participant Jingle initiation request...', 2);
-
- this._set_participants(username, {
- status: JSJAC_JINGLE_MUJI_STATUS_INITIATED,
- view: this._shortcut_participant_view(username)
- });
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_initiate > ' + e, 1);
- }
- },
-
- /**
- * Handles the participant leave event.
- * @private
- * @event JSJaCJingleMuji#_handle_participant_leave
- * @param {JSJaCPacket} stanza
- * @param {Boolean} [is_deferred]
- */
- _handle_participant_leave: function(stanza, is_deferred) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_leave', 4);
-
- try {
- var username = this.utils.stanza_username(stanza);
-
- if(!username) {
- throw 'No username provided, not accepting participant leave stanza.';
- }
-
- // Local slot unavailable?
- if(this.get_status() === JSJAC_JINGLE_MUJI_STATUS_INACTIVE ||
- this.get_status() === JSJAC_JINGLE_MUJI_STATUS_LEAVING ||
- this.get_status() === JSJAC_JINGLE_MUJI_STATUS_LEFT) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_leave > [' + username + '] > Cannot handle, resource not available (status: ' + this.get_status() + ').', 0);
- return;
- }
-
- // Remote slot unavailable?
- var status = this._shortcut_participant_status(username);
-
- if(status !== JSJAC_JINGLE_MUJI_STATUS_PREPARED &&
- status !== JSJAC_JINGLE_MUJI_STATUS_INITIATED) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_leave > [' + username + '] > Cannot handle leave stanza, participant already left or inactive (status: ' + status + ').', 0);
- return;
- }
-
- // Remove participant session
- var session = (this.get_participants(username) || {}).session;
-
- if(session && session.get_status() !== JSJAC_JINGLE_STATUS_TERMINATED)
- session.abort(true);
-
- this._set_participants(username, null);
- this.get_remove_remote_view()(this, username);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_leave > ' + e, 1);
- }
- },
-
-
-
- /**
- * JSJSAC JINGLE SESSION HANDLERS
- */
-
- /**
- * Handles the Jingle session prepare success
- * @private
- * @event JSJaCJingleMuji#_handle_participant_session_initiate_pending
- * @param {JSJaCJingleSingle} session
- */
- _handle_participant_session_initiate_pending: function(session) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_initiate_pending', 4);
-
- try {
- /* @function */
- (this.get_participant_session_initiate_pending())(this, session);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_initiate_pending > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session prepare success
- * @private
- * @event JSJaCJingleMuji#_handle_participant_session_initiate_success
- * @param {JSJaCJingleSingle} session
- * @param {JSJaCPacket} stanza
- */
- _handle_participant_session_initiate_success: function(session, stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_initiate_success', 4);
-
- try {
- /* @function */
- (this.get_participant_session_initiate_success())(this, session, stanza);
-
- // Mute participant?
- var cur_media_name;
-
- for(cur_media_name in this._mute) {
- if(this.get_mute(cur_media_name) === true) {
- this._toggle_participants_mute(
- cur_media_name,
- JSJAC_JINGLE_SESSION_INFO_MUTE,
- username
- );
- }
- }
-
- // Auto-accept incoming sessions
- if(session.is_responder()) {
- // Accept after a while
- setTimeout(function() {
- session.accept();
- }, (JSJAC_JINGLE_MUJI_PARTICIPANT_ACCEPT_WAIT * 1000));
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_initiate_success > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session prepare success
- * @private
- * @event JSJaCJingleMuji#_handle_participant_session_initiate_error
- * @param {JSJaCJingleSingle} session
- * @param {JSJaCPacket} stanza
- */
- _handle_participant_session_initiate_error: function(session, stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_initiate_error', 4);
-
- try {
- /* @function */
- (this.get_participant_session_initiate_error())(this, session, stanza);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_initiate_error > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session prepare success
- * @private
- * @event JSJaCJingleMuji#_handle_participant_session_initiate_request
- * @param {JSJaCJingleSingle} session
- * @param {JSJaCPacket} stanza
- */
- _handle_participant_session_initiate_request: function(session, stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_initiate_request', 4);
-
- try {
- /* @function */
- (this.get_participant_session_initiate_request())(this, session, stanza);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_initiate_request > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session prepare success
- * @private
- * @event JSJaCJingleMuji#_handle_participant_session_accept_pending
- * @param {JSJaCJingleSingle} session
- */
- _handle_participant_session_accept_pending: function(session) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_accept_pending', 4);
-
- try {
- /* @function */
- (this.get_participant_session_accept_pending())(this, session);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_accept_pending > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session prepare success
- * @private
- * @event JSJaCJingleMuji#_handle_participant_session_accept_success
- * @param {JSJaCJingleSingle} session
- * @param {JSJaCPacket} stanza
- */
- _handle_participant_session_accept_success: function(session, stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_accept_success', 4);
-
- try {
- /* @function */
- (this.get_participant_session_accept_success())(this, session, stanza);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_accept_success > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session prepare success
- * @private
- * @event JSJaCJingleMuji#_handle_participant_session_accept_error
- * @param {JSJaCJingleSingle} session
- * @param {JSJaCPacket} stanza
- */
- _handle_participant_session_accept_error: function(session, stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_accept_error', 4);
-
- try {
- /* @function */
- (this.get_participant_session_accept_error())(this, session, stanza);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_accept_error > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session prepare success
- * @private
- * @event JSJaCJingleMuji#_handle_participant_session_accept_request
- * @param {JSJaCJingleSingle} session
- * @param {JSJaCPacket} stanza
- */
- _handle_participant_session_accept_request: function(session, stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_accept_request', 4);
-
- try {
- /* @function */
- (this.get_participant_session_accept_request())(this, session, stanza);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_accept_request > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session prepare success
- * @private
- * @event JSJaCJingleMuji#_handle_participant_session_info_pending
- * @param {JSJaCJingleSingle} session
- */
- _handle_participant_session_info_pending: function(session) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_info_pending', 4);
-
- try {
- /* @function */
- (this.get_participant_session_info_pending())(this, session);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_info_pending > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session prepare success
- * @private
- * @event JSJaCJingleMuji#_handle_participant_session_info_success
- * @param {JSJaCJingleSingle} session
- * @param {JSJaCPacket} stanza
- */
- _handle_participant_session_info_success: function(session, stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_info_success', 4);
-
- try {
- /* @function */
- (this.get_participant_session_info_success())(this, session, stanza);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_info_success > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session prepare success
- * @private
- * @event JSJaCJingleMuji#_handle_participant_session_info_error
- * @param {JSJaCJingleSingle} session
- * @param {JSJaCPacket} stanza
- */
- _handle_participant_session_info_error: function(session, stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_info_error', 4);
-
- try {
- /* @function */
- (this.get_participant_session_info_error())(this, session, stanza);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_info_error > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session prepare success
- * @private
- * @event JSJaCJingleMuji#_handle_participant_session_info_request
- * @param {JSJaCJingleSingle} session
- * @param {JSJaCPacket} stanza
- */
- _handle_participant_session_info_request: function(session, stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_info_request', 4);
-
- try {
- /* @function */
- (this.get_participant_session_info_request())(this, session, stanza);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_info_request > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session prepare success
- * @private
- * @event JSJaCJingleMuji#_handle_participant_session_terminate_pending
- * @param {JSJaCJingleSingle} session
- */
- _handle_participant_session_terminate_pending: function(session) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_terminate_pending', 4);
-
- try {
- /* @function */
- (this.get_participant_session_terminate_pending())(this, session);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_terminate_pending > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session prepare success
- * @private
- * @event JSJaCJingleMuji#_handle_participant_session_terminate_success
- * @param {JSJaCJingleSingle} session
- * @param {JSJaCPacket} stanza
- */
- _handle_participant_session_terminate_success: function(session, stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_terminate_success', 4);
-
- try {
- /* @function */
- (this.get_participant_session_terminate_success())(this, session, stanza);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_terminate_success > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session prepare success
- * @private
- * @event JSJaCJingleMuji#_handle_participant_session_terminate_error
- * @param {JSJaCJingleSingle} session
- * @param {JSJaCPacket} stanza
- */
- _handle_participant_session_terminate_error: function(session, stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_terminate_error', 4);
-
- try {
- /* @function */
- (this.get_participant_session_terminate_error())(this, session, stanza);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_terminate_error > ' + e, 1);
- }
- },
-
- /**
- * Handles the Jingle session prepare success
- * @private
- * @event JSJaCJingleMuji#_handle_participant_session_terminate_request
- * @param {JSJaCJingleSingle} session
- * @param {JSJaCPacket} stanza
- */
- _handle_participant_session_terminate_request: function(session, stanza) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_terminate_request', 4);
-
- try {
- /* @function */
- (this.get_participant_session_terminate_request())(this, session, stanza);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_session_terminate_request > ' + e, 1);
- }
- },
-
- /**
- * Handles the stream add event
- * @private
- * @event JSJaCJingleMuji#_handle_participant_stream_add
- * @param {JSJaCJingleSingle} session
- * @param {MediaStreamEvent} data
- */
- _handle_participant_stream_add: function(session, data) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_stream_add', 4);
-
- try {
- /* @function */
- (this.get_participant_stream_add())(this, session, data);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_stream_add > ' + e, 1);
- }
- },
-
- /**
- * Handles the stream remove event
- * @private
- * @event JSJaCJingleMuji#_handle_participant_stream_remove
- * @param {JSJaCJingleSingle} session
- * @param {MediaStreamEvent} data
- */
- _handle_participant_stream_remove: function(session, data) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_stream_remove', 4);
-
- try {
- /* @function */
- (this.get_participant_stream_remove())(this, session, data);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_stream_remove > ' + e, 1);
- }
- },
-
- /**
- * Handles the stream connected event
- * @private
- * @event JSJaCJingleMuji#_handle_participant_stream_connected
- * @param {JSJaCJingleSingle} session
- * @param {MediaStreamEvent} data
- */
- _handle_participant_stream_connected: function(session, data) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_stream_connected', 4);
-
- try {
- /* @function */
- (this.get_participant_stream_connected())(this, session, data);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_stream_connected > ' + e, 1);
- }
- },
-
- /**
- * Handles the stream disconnected event
- * @private
- * @event JSJaCJingleMuji#_handle_participant_stream_disconnected
- * @param {JSJaCJingleSingle} session
- * @param {MediaStreamEvent} data
- */
- _handle_participant_stream_disconnected: function(session, data) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_stream_disconnected', 4);
-
- try {
- /* @function */
- (this.get_participant_stream_disconnected())(this, session, data);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _handle_participant_stream_disconnected > ' + e, 1);
- }
- },
-
-
-
- /**
- * JSJSAC JINGLE STANZA PARSERS
- */
-
- /**
- * Returns whether user is preparing or not
- * @private
- * @param {DOM} muji
- * @returns {Boolean} Preparing state
- */
- _stanza_has_preparing: function(muji) {
- return this.utils.stanza_get_element(muji, 'preparing', NS_MUJI).length && true;
- },
-
- /**
- * Returns whether user has content or not
- * @private
- * @param {DOM} muji
- * @returns {Boolean} Content state
- */
- _stanza_has_content: function(muji) {
- return this.utils.stanza_get_element(muji, 'content', NS_MUJI).length && true;
- },
-
- /**
- * Returns whether stanza has the room owner code or not
- * @private
- * @param {JSJaCPacket} stanza
- * @returns {Boolean} Room owner state
- */
- _stanza_has_room_owner: function(stanza) {
- var is_room_owner = false;
-
- try {
- var i, items,
- x_muc_user = stanza.getChild('x', NS_JABBER_MUC_USER);
-
- if(x_muc_user) {
- items = this.utils.stanza_get_element(x_muc_user, 'item', NS_JABBER_MUC_USER);
-
- for(i = 0; i < items.length; i++) {
- if(items[i].getAttribute('affiliation') === JSJAC_JINGLE_MUJI_MUC_AFFILIATION_OWNER) {
- is_room_owner = true; break;
- }
- }
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _stanza_has_room_owner > ' + e, 1);
- } finally {
- return is_room_owner;
- }
- },
-
- /**
- * Returns whether stanza is a password invalid or not
- * @private
- * @param {JSJaCPacket} stanza
- * @returns {Boolean} Password invalid state
- */
- _stanza_has_password_invalid: function(stanza) {
- return (this.utils.stanza_get_error(stanza, XMPP_ERROR_NOT_AUTHORIZED).length >= 1) && true;
- },
-
- /**
- * Returns whether stanza is an username conflict or not
- * @private
- * @param {JSJaCPacket} stanza
- * @returns {Boolean} Local user state
- */
- _stanza_has_username_conflict: function(stanza) {
- return (this.utils.stanza_get_error(stanza, XMPP_ERROR_CONFLICT).length >= 1) && true;
- },
-
-
-
- /**
- * JSJSAC JINGLE PEER TOOLS
- */
-
- /**
- * Creates peer connection instance
- * @private
- */
- _peer_connection_create_instance: function() {
- this.get_debug().log('[JSJaCJingle:muji] _peer_connection_create_instance', 4);
-
- try {
- // Create the RTCPeerConnection object
- this._set_peer_connection(
- new WEBRTC_PEER_CONNECTION(
- null,
- WEBRTC_CONFIGURATION.peer_connection.constraints
- )
- );
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _peer_connection_create_instance > ' + e, 1);
- }
- },
-
- /**
- * Attaches peer connection callbacks (not used)
- * @private
- * @param {Function} [sdp_message_callback]
- */
- _peer_connection_callbacks: function(sdp_message_callback) {
- this.get_debug().log('[JSJaCJingle:muji] _peer_connection_callbacks', 4);
-
- try {
- // Not used for Muji
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _peer_connection_callbacks > ' + e, 1);
- }
- },
-
- /**
- * Dispatches peer connection to correct creator (offer/answer)
- * @private
- * @param {Function} [sdp_message_callback]
- */
- _peer_connection_create_dispatch: function(sdp_message_callback) {
- this.get_debug().log('[JSJaCJingle:muji] _peer_connection_create_dispatch', 4);
-
- try {
- this._peer_connection_create_offer(sdp_message_callback);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _peer_connection_create_dispatch > ' + e, 1);
- }
- },
-
- /**
- * Creates peer connection offer
- * @private
- * @param {Function} [sdp_message_callback]
- */
- _peer_connection_create_offer: function(sdp_message_callback) {
- this.get_debug().log('[JSJaCJingle:muji] _peer_connection_create_offer', 4);
-
- try {
- // Create offer
- this.get_debug().log('[JSJaCJingle:muji] _peer_connection_create_offer > Getting local description...', 2);
-
- // Local description
- this.get_peer_connection().createOffer(
- function(sdp_local) {
- this._peer_got_description(sdp_local, sdp_message_callback);
- }.bind(this),
-
- this._peer_fail_description.bind(this),
- WEBRTC_CONFIGURATION.create_offer
- );
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _peer_connection_create_offer > ' + e, 1);
- }
- },
-
- /**
- * Triggers the media not obtained error event
- * @private
- * @fires JSJaCJingleMuji#get_session_initiate_error
- * @param {Object} error
- */
- _peer_got_user_media_error: function(error) {
- this.get_debug().log('[JSJaCJingle:muji] _peer_got_user_media_error', 4);
-
- try {
- /* @function */
- (this.get_session_initiate_error())(this);
- this.handle_session_initiate_error();
-
- this.get_debug().log('[JSJaCJingle:muji] _peer_got_user_media_error > Failed (' + (error.PERMISSION_DENIED ? 'permission denied' : 'unknown' ) + ').', 1);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _peer_got_user_media_error > ' + e, 1);
- }
- },
-
- /**
- * Set a timeout limit to peer connection
- * @private
- * @param {String} state
- * @param {Object} [args]
- */
- _peer_timeout: function(state, args) {
- try {
- // Assert
- if(typeof args !== 'object') args = {};
-
- var t_iid = this.get_iid();
-
- var _this = this;
-
- setTimeout(function() {
- try {
- // State did not change?
- if(_this.get_iid() == t_iid && _this.get_peer_connection().iceConnectionState == state) {
- _this.get_debug().log('[JSJaCJingle:muji] _peer_timeout > Peer timeout.', 2);
- }
- } catch(e) {
- _this.get_debug().log('[JSJaCJingle:muji] _peer_timeout > ' + e, 1);
- }
- }, ((args.timer || JSJAC_JINGLE_PEER_TIMEOUT_DEFAULT) * 1000));
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _peer_timeout > ' + e, 1);
- }
- },
-
- /**
- * Stops ongoing peer connections
- * @private
- */
- _peer_stop: function() {
- this.get_debug().log('[JSJaCJingle:muji] _peer_stop', 4);
-
- // Detach media streams from DOM view
- this._set_local_stream(null);
-
- // Close the media stream
- if(this.get_peer_connection() &&
- (typeof this.get_peer_connection().close == 'function'))
- this.get_peer_connection().close();
-
- // Remove this session from router
- JSJaCJingle._remove(JSJAC_JINGLE_SESSION_SINGLE, this.get_sid());
- },
-
-
-
- /**
- * JSJSAC JINGLE STATES
- */
-
- /**
- * Is user media ready?
- * @public
- * @returns {Boolean} Ready state
- */
- is_ready_user_media: function() {
- return (this.get_local_stream() !== null) && true;
- },
-
- /**
- * Is this stanza from a participant?
- * @public
- * @param {JSJaCPacket} stanza
- * @returns {Boolean} Participant state
- */
- is_stanza_from_participant: function(stanza) {
- var username = this.utils.stanza_username(stanza);
- return (this.get_participants(username) in JSJAC_JINGLE_MUJI_STATUS) && true;
- },
-
- /**
- * Is this stanza from local user?
- * @public
- * @param {JSJaCPacket} stanza
- * @returns {Boolean} Local user state
- */
- is_stanza_from_local: function(stanza) {
- return this.utils.stanza_username(stanza) === this.get_username();
- },
-
-
-
- /**
- * JSJSAC JINGLE SHORTCUTS
- */
-
- /**
- * Returns participant status (even if inexistant)
- * @private
- * @param {String} username
- * @returns {String} Status
- */
- _shortcut_participant_status: function(username) {
- return ((this.get_participants(username) || {}).status || JSJAC_JINGLE_MUJI_STATUS_INACTIVE);
- },
-
- /**
- * Returns local user candidates
- * @private
- * @returns {Object} Candidates
- */
- _shortcut_local_user_candidates: function() {
- return this.get_candidates_local();
- },
-
- /**
- * Gets participant view (or create it)
- * @private
- * @param {String} username
- * @returns {Object} View
- */
- _shortcut_participant_view: function(username) {
- if((this.get_participants(username) || {}).view)
- return this.get_participants(username).view;
-
- return this.get_add_remote_view()(this, username, this.get_media());
- },
-
-
-
- /**
- * JSJSAC JINGLE VARIOUS TOOLS
- */
-
- /**
- * Terminate participant sessions
- * @private
- * @param {Boolean} [send_terminate]
- * @param {Function} [leave_callback]
- */
- _terminate_participant_sessions: function(send_terminate, leave_callback) {
- try {
- // Terminate each session
- var cur_username, cur_participant,
- participants = this.get_participants();
-
- for(cur_username in participants) {
- cur_participant = participants[cur_username];
-
- if(typeof cur_participant.session != 'undefined') {
- if(send_terminate === true)
- cur_participant.session.terminate();
-
- this.get_remove_remote_view()(this, cur_username);
- }
- }
-
- // Execute callback after a while
- var _this = this;
-
- if(typeof leave_callback == 'function') {
- setTimeout(function() {
- try {
- leave_callback();
- } catch(e) {
- _this.get_debug().log('[JSJaCJingle:muji] _terminate_participant_sessions > ' + e, 1);
- }
- }, (JSJAC_JINGLE_MUJI_LEAVE_WAIT * 1000));
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _terminate_participant_sessions > ' + e, 1);
- }
- },
-
- /**
- * Mutes/unmutes all or given participant(s)
- * @private
- * @param {String} media_name
- * @param {String} mute_action
- * @param {String} [username]
- */
- _toggle_participants_mute: function(media_name, mute_action, username) {
- try {
- var i, cur_participant;
- var participants = {};
-
- // One specific or all?
- if(username)
- participants[username] = this.get_participants(username);
- else
- participants = this.get_participants();
-
- for(i in participants) {
- cur_participant = participants[i];
-
- if(cur_participant.session.get_status() === JSJAC_JINGLE_STATUS_ACCEPTED) {
- switch(mute_action) {
- case JSJAC_JINGLE_SESSION_INFO_MUTE:
- cur_participant.session.mute(media_name); break;
-
- case JSJAC_JINGLE_SESSION_INFO_UNMUTE:
- cur_participant.session.unmute(media_name); break;
- }
- }
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _toggle_participants_mute > ' + e, 1);
- }
- },
-
- /**
- * Defers given participant handler (or executes it)
- * @private
- * @param {Function} fn
- * @returns {Boolean} Defer status
- */
- _defer_participant_handlers: function(fn) {
- var is_deferred = false;
-
- try {
- var _this = this;
-
- if(this.get_status() !== JSJAC_JINGLE_MUJI_STATUS_INITIATED &&
- this.get_status() !== JSJAC_JINGLE_MUJI_STATUS_LEAVING &&
- this.get_status() !== JSJAC_JINGLE_MUJI_STATUS_LEFT
- ) {
- this.defer_handler(JSJAC_JINGLE_MUJI_HANDLER_GET_USER_MEDIA, function() {
- fn.bind(_this)(true);
- });
-
- is_deferred = true;
-
- this.get_debug().log('[JSJaCJingle:muji] _defer_participant_handlers > Deferred participant handler (waiting for user media).', 0);
- } else {
- fn(false);
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _defer_participant_handlers > ' + e, 1);
- } finally {
- return is_deferred;
- }
- },
-
- /**
- * Undefers participant handlers
- * @private
- */
- _undefer_participant_handlers: function() {
- try {
- // Undefer pending handlers
- var i, handlers;
- handlers = this.get_deferred_handlers(JSJAC_JINGLE_MUJI_HANDLER_GET_USER_MEDIA);
-
- if(typeof handlers == 'object' && handlers.length) {
- this.get_debug().log('[JSJaCJingle:muji] _undefer_participant_handlers > Submitted to deferred handlers.', 2);
-
- for(i = 0; i < handlers.length; i++) {
- /* @function */
- handlers[i]();
- }
-
- this.undefer_handler(JSJAC_JINGLE_MUJI_HANDLER_GET_USER_MEDIA);
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _undefer_participant_handlers > ' + e, 1);
- }
- },
-
- /**
- * Creates participant Jingle session
- * @private
- * @param {String} username
- * @returns {JSJaCJingleSingle|Object} Jingle session instance
- */
- _create_participant_session: function(username) {
- var session = null;
-
- try {
- // Create Jingle session
- var session_args = this._generate_participant_session_args(username);
-
- session = new JSJaCJingleSingle(session_args);
-
- this._set_participants(username, {
- status: JSJAC_JINGLE_MUJI_STATUS_INITIATED,
- session: session,
- view: session_args.remote_view
- });
-
- // Configure Jingle session
- this.get_participants(username).session._set_local_stream_raw(
- this.get_local_stream()
- );
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _create_participant_session > ' + e, 1);
- } finally {
- return session;
- }
- },
-
- /**
- * Generates participant Jingle session arguments
- * @private
- * @param {String} username
- * @returns {Object} Jingle session arguments
- */
- _generate_participant_session_args: function(username) {
- args = {};
-
- try {
- // Main values
- args.connection = this.get_connection();
- args.to = this.get_to() + '/' + username;
- args.local_view = this.get_local_view();
- args.remote_view = this._shortcut_participant_view(username);
- args.local_stream_readonly = true;
-
- // Propagate values
- args.media = this.get_media();
- args.video_source = this.get_video_source();
- args.resolution = this.get_resolution();
- args.bandwidth = this.get_bandwidth();
- args.fps = this.get_fps();
- args.stun = this.get_stun();
- args.turn = this.get_turn();
- args.sdp_trace = this.get_sdp_trace();
- args.net_trace = this.get_net_trace();
- args.debug = this.get_debug();
-
- // Handlers
- args.session_initiate_pending = this._handle_participant_session_initiate_pending.bind(this);
- args.session_initiate_success = this._handle_participant_session_initiate_success.bind(this);
- args.session_initiate_error = this._handle_participant_session_initiate_error.bind(this);
- args.session_initiate_request = this._handle_participant_session_initiate_request.bind(this);
-
- args.session_accept_pending = this._handle_participant_session_accept_pending.bind(this);
- args.session_accept_success = this._handle_participant_session_accept_success.bind(this);
- args.session_accept_error = this._handle_participant_session_accept_error.bind(this);
- args.session_accept_request = this._handle_participant_session_accept_request.bind(this);
-
- args.session_info_pending = this._handle_participant_session_info_pending.bind(this);
- args.session_info_success = this._handle_participant_session_info_success.bind(this);
- args.session_info_error = this._handle_participant_session_info_error.bind(this);
- args.session_info_request = this._handle_participant_session_info_request.bind(this);
-
- args.session_terminate_pending = this._handle_participant_session_terminate_pending.bind(this);
- args.session_terminate_success = this._handle_participant_session_terminate_success.bind(this);
- args.session_terminate_error = this._handle_participant_session_terminate_error.bind(this);
- args.session_terminate_request = this._handle_participant_session_terminate_request.bind(this);
-
- args.stream_add = this._handle_participant_stream_add.bind(this);
- args.stream_remove = this._handle_participant_stream_remove.bind(this);
- args.stream_connected = this._handle_participant_stream_connected.bind(this);
- args.stream_disconnected = this._handle_participant_stream_disconnected.bind(this);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _generate_participant_session_args > ' + e, 1);
- } finally {
- return args;
- }
- },
-
- /**
- * Autoconfigures MUC room password
- * @private
- */
- _autoconfigure_room_password: function() {
- try {
- // Build stanza
- stanza = new JSJaCIQ();
-
- stanza.setTo(this.get_to());
- stanza.setType(JSJAC_JINGLE_IQ_TYPE_GET);
-
- stanza.setQuery(NS_JABBER_MUC_OWNER);
-
- var _this = this;
-
- this.get_connection().send(stanza, function(_stanza) {
- if(_this.get_net_trace()) _this.get_debug().log('[JSJaCJingle:muji] _autoconfigure_room_password > Incoming packet received' + '\n\n' + _stanza.xml());
-
- if(_stanza.getType() === JSJAC_JINGLE_IQ_TYPE_ERROR)
- _this.get_debug().log('[JSJaCJingle:muji] _autoconfigure_room_password > Could not get room configuration.', 1);
- else
- _this._receive_autoconfigure_room_password(_stanza);
- });
-
- if(this.get_net_trace()) this.get_debug().log('[JSJaCJingle:muji] _autoconfigure_room_password > Outgoing packet sent' + '\n\n' + stanza.xml());
-
- this.get_debug().log('[JSJaCJingle:muji] _autoconfigure_room_password > Getting room configuration...', 4);
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _autoconfigure_room_password > ' + e, 1);
- }
- },
-
- /**
- * Receives MUC room password configuration
- * @private
- * @param {JSJaCPacket} stanza
- */
- _receive_autoconfigure_room_password: function(stanza) {
- try {
- var parse_obj = this._parse_autoconfigure_room_password(stanza);
-
- this._set_password(parse_obj.password);
-
- if(parse_obj.password != parse_obj.old_password) {
- this._send_autoconfigure_room_password(stanza, parse_obj);
- } else {
- this.get_debug().log('[JSJaCJingle:muji] _parse_autoconfigure_room_password > Room password already configured (password: ' + parse_obj.password + ').', 2);
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _receive_autoconfigure_room_password > ' + e, 1);
- }
- },
-
- /**
- * Parses MUC room password configuration
- * @private
- * @param {JSJaCPacket} stanza
- * @returns {Object} Parse results
- */
- _parse_autoconfigure_room_password: function(stanza) {
- var i,
- x_data_sel, field_item_sel, password_field_sel, password_value_sel,
- old_password, password;
-
- try {
- // Get stanza items
- query_sel = stanza.getQuery(NS_JABBER_MUC_OWNER);
-
- if(!query_sel) throw 'No query element received.';
-
- x_data_sel = this.utils.stanza_get_element(query_sel, 'x', NS_JABBER_DATA);
- if(!x_data_sel || x_data_sel.length === 0) throw 'No X data element received.';
-
- x_data_sel = x_data_sel[0];
-
- field_item_sel = this.utils.stanza_get_element(x_data_sel, 'field', NS_JABBER_DATA);
- if(!field_item_sel || field_item_sel.length === 0) throw 'No field element received.';
-
- for(i = 0; i < field_item_sel.length; i++) {
- if(field_item_sel[i].getAttribute('var') === JSJAC_JINGLE_MUJI_MUC_CONFIG_SECRET) {
- password_field_sel = field_item_sel[i]; break;
- }
- }
-
- if(password_field_sel === undefined) throw 'No password field element received.';
-
- password_value_sel = this.utils.stanza_get_element(password_field_sel, 'value', NS_JABBER_DATA);
- if(!password_value_sel || password_value_sel.length === 0) throw 'No password field value element received.';
-
- password_value_sel = password_value_sel[0];
-
- // Get old password
- old_password = password_value_sel.nodeValue;
-
- // Apply password?
- if(this.get_password() && old_password != this.get_password()) {
- password = this.get_password();
- } else if(old_password) {
- password = old_password;
- } else {
- password = this.utils.generate_password();
- }
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _parse_autoconfigure_room_password > ' + e, 1);
- } finally {
- return {
- password : password,
- old_password : old_password,
- x_data_sel : x_data_sel,
- field_item_sel : field_item_sel,
- password_field_sel : password_field_sel,
- password_value_sel : password_value_sel,
- };
- }
- },
-
- /**
- * Receives MUC room password configuration
- * @private
- * @param {JSJaCPacket} stanza
- * @param {Object} parse_obj
- */
- _send_autoconfigure_room_password: function(stanza, parse_obj) {
- try {
- // Change stanza headers
- stanza.setID(this.get_id_new());
- stanza.setType(JSJAC_JINGLE_IQ_TYPE_SET);
- stanza.setTo(stanza.getFrom());
- stanza.setFrom(null);
-
- // Change stanza items
- parse_obj.x_data_sel.setAttribute('type', JSJAC_JINGLE_MUJI_MUC_OWNER_SUBMIT);
-
- parse_obj.password_value_sel.parentNode.removeChild(parse_obj.password_value_sel);
- parse_obj.password_field_sel.appendChild(
- stanza.buildNode('value', { 'xmlns': NS_JABBER_DATA }, parse_obj.password)
- );
-
- var _this = this;
-
- this.get_connection().send(stanza, function(_stanza) {
- if(_this.get_net_trace()) _this.get_debug().log('[JSJaCJingle:muji] _send_autoconfigure_room_password > Incoming packet received' + '\n\n' + _stanza.xml());
-
- if(_stanza.getType() === JSJAC_JINGLE_IQ_TYPE_ERROR) {
- _this._set_password(undefined);
-
- _this.get_debug().log('[JSJaCJingle:muji] _send_autoconfigure_room_password > Could not autoconfigure room password.', 1);
- } else {
- _this.get_debug().log('[JSJaCJingle:muji] _send_autoconfigure_room_password > Successfully autoconfigured room password.', 2);
- }
- });
-
- this.get_debug().log('[JSJaCJingle:muji] _send_autoconfigure_room_password > Autoconfiguring room password (password: ' + parse_obj.password + ')...', 4);
-
- if(this.get_net_trace()) this.get_debug().log('[JSJaCJingle:muji] _send_autoconfigure_room_password > Outgoing packet sent' + '\n\n' + stanza.xml());
- } catch(e) {
- this.get_debug().log('[JSJaCJingle:muji] _send_autoconfigure_room_password > ' + e, 1);
- }
- },
-
-
-
- /**
- * JSJSAC JINGLE MUJI GETTERS
- */
-
- /**
- * Gets the participants object
- * @public
- * @param {String} username
- * @returns {Object} Participants object
- */
- get_participants: function(username) {
- if(username)
- return this._participants[username];
-
- return this._participants;
- },
-
- /**
- * Gets the creator value
- * @public
- * @returns {String} Creator value
- */
- get_creator: function() {
- return this.get_to();
- },
-
- /**
- * Gets the incoming message callback function
- * @public
- * @event JSJaCJingleMuji#get_room_message_in
- * @returns {Function} Incoming message callback function
- */
- get_room_message_in: function() {
- return this._shortcut_get_handler(
- this._room_message_in
- );
- },
-
- /**
- * Gets the outgoing message callback function
- * @public
- * @event JSJaCJingleMuji#get_room_message_out
- * @returns {Function} Outgoing message callback function
- */
- get_room_message_out: function() {
- return this._shortcut_get_handler(
- this._room_message_out
- );
- },
-
- /**
- * Gets the incoming presence callback function
- * @public
- * @event JSJaCJingleMuji#get_room_presence_in
- * @returns {Function} Incoming presence callback function
- */
- get_room_presence_in: function() {
- return this._shortcut_get_handler(
- this._room_presence_in
- );
- },
-
- /**
- * Gets the outgoing presence callback function
- * @public
- * @event JSJaCJingleMuji#get_room_presence_out
- * @returns {Function} Outgoing presence callback function
- */
- get_room_presence_out: function() {
- return this._shortcut_get_handler(
- this._room_presence_out
- );
- },
-
- /**
- * Gets the session prepare pending callback function
- * @public
- * @event JSJaCJingleMuji#get_session_prepare_pending
- * @returns {Function} Session prepare pending callback function
- */
- get_session_prepare_pending: function() {
- return this._shortcut_get_handler(
- this._session_prepare_pending
- );
- },
-
- /**
- * Gets the session prepare success callback function
- * @public
- * @event JSJaCJingleMuji#get_session_prepare_success
- * @returns {Function} Session prepare success callback function
- */
- get_session_prepare_success: function() {
- return this._shortcut_get_handler(
- this._session_prepare_success
- );
- },
-
- /**
- * Gets the session prepare error callback function
- * @public
- * @event JSJaCJingleMuji#get_session_prepare_error
- * @returns {Function} Session prepare error callback function
- */
- get_session_prepare_error: function() {
- return this._shortcut_get_handler(
- this._session_prepare_error
- );
- },
-
- /**
- * Gets the session initiate pending callback function
- * @public
- * @event JSJaCJingleMuji#get_session_initiate_pending
- * @returns {Function} Session initiate pending callback function
- */
- get_session_initiate_pending: function() {
- return this._shortcut_get_handler(
- this._session_initiate_pending
- );
- },
-
- /**
- * Gets the session initiate success callback function
- * @public
- * @event JSJaCJingleMuji#get_session_initiate_success
- * @returns {Function} Session initiate success callback function
- */
- get_session_initiate_success: function() {
- return this._shortcut_get_handler(
- this._session_initiate_success
- );
- },
-
- /**
- * Gets the session initiate error callback function
- * @public
- * @event JSJaCJingleMuji#get_session_initiate_error
- * @returns {Function} Session initiate error callback function
- */
- get_session_initiate_error: function() {
- return this._shortcut_get_handler(
- this._session_initiate_error
- );
- },
-
- /**
- * Gets the session leave pending callback function
- * @public
- * @event JSJaCJingleMuji#get_session_leave_pending
- * @returns {Function} Session leave pending callback function
- */
- get_session_leave_pending: function() {
- return this._shortcut_get_handler(
- this._session_leave_pending
- );
- },
-
- /**
- * Gets the session leave success callback function
- * @public
- * @event JSJaCJingleMuji#get_session_leave_success
- * @returns {Function} Session leave success callback function
- */
- get_session_leave_success: function() {
- return this._shortcut_get_handler(
- this._session_leave_success
- );
- },
-
- /**
- * Gets the session leave error callback function
- * @public
- * @event JSJaCJingleMuji#get_session_leave_error
- * @returns {Function} Session leave error callback function
- */
- get_session_leave_error: function() {
- return this._shortcut_get_handler(
- this._session_leave_error
- );
- },
-
- /**
- * Gets the participant prepare callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_prepare
- * @returns {Function} Participant prepare callback function
- */
- get_participant_prepare: function() {
- return this._shortcut_get_handler(
- this._participant_prepare
- );
- },
-
- /**
- * Gets the participant initiate callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_initiate
- * @returns {Function} Participant initiate callback function
- */
- get_participant_initiate: function() {
- return this._shortcut_get_handler(
- this._participant_initiate
- );
- },
-
- /**
- * Gets the participant leave callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_leave
- * @returns {Function} Participant leave callback function
- */
- get_participant_leave: function() {
- return this._shortcut_get_handler(
- this._participant_leave
- );
- },
-
- /**
- * Gets the participant session initiate pending callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_session_initiate_pending
- * @returns {Function} Participant session initiate pending callback function
- */
- get_participant_session_initiate_pending: function() {
- return this._shortcut_get_handler(
- this._participant_session_initiate_pending
- );
- },
-
- /**
- * Gets the participant session initiate success callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_session_initiate_success
- * @returns {Function} Participant session initiate success callback function
- */
- get_participant_session_initiate_success: function() {
- return this._shortcut_get_handler(
- this._participant_session_initiate_success
- );
- },
-
- /**
- * Gets the participant session initiate error callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_session_initiate_error
- * @returns {Function} Participant session initiate error callback function
- */
- get_participant_session_initiate_error: function() {
- return this._shortcut_get_handler(
- this._participant_session_initiate_error
- );
- },
-
- /**
- * Gets the participant session initiate request callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_session_initiate_request
- * @returns {Function} Participant session initiate request callback function
- */
- get_participant_session_initiate_request: function() {
- return this._shortcut_get_handler(
- this._participant_session_initiate_request
- );
- },
-
- /**
- * Gets the participant session accept pending callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_session_accept_pending
- * @returns {Function} Participant session accept pending callback function
- */
- get_participant_session_accept_pending: function() {
- return this._shortcut_get_handler(
- this._participant_session_accept_pending
- );
- },
-
- /**
- * Gets the participant session accept success callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_session_accept_success
- * @returns {Function} Participant session accept success callback function
- */
- get_participant_session_accept_success: function() {
- return this._shortcut_get_handler(
- this._participant_session_accept_success
- );
- },
-
- /**
- * Gets the participant session accept error callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_session_accept_error
- * @returns {Function} Participant session accept error callback function
- */
- get_participant_session_accept_error: function() {
- return this._shortcut_get_handler(
- this._participant_session_accept_error
- );
- },
-
- /**
- * Gets the participant session accept request callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_session_accept_request
- * @returns {Function} Participant session accept request callback function
- */
- get_participant_session_accept_request: function() {
- return this._shortcut_get_handler(
- this._participant_session_accept_request
- );
- },
-
- /**
- * Gets the participant session info pending callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_session_info_pending
- * @returns {Function} Participant session info pending callback function
- */
- get_participant_session_info_pending: function() {
- return this._shortcut_get_handler(
- this._participant_session_info_pending
- );
- },
-
- /**
- * Gets the participant session info success callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_session_info_success
- * @returns {Function} Participant session info success callback function
- */
- get_participant_session_info_success: function() {
- return this._shortcut_get_handler(
- this._participant_session_info_success
- );
- },
-
- /**
- * Gets the participant session info error callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_session_info_error
- * @returns {Function} Participant session info error callback function
- */
- get_participant_session_info_error: function() {
- return this._shortcut_get_handler(
- this._participant_session_info_error
- );
- },
-
- /**
- * Gets the participant session info request callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_session_info_request
- * @returns {Function} Participant session info request callback function
- */
- get_participant_session_info_request: function() {
- return this._shortcut_get_handler(
- this._participant_session_info_request
- );
- },
-
- /**
- * Gets the participant session terminate pending callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_session_terminate_pending
- * @returns {Function} Participant session terminate pending callback function
- */
- get_participant_session_terminate_pending: function() {
- return this._shortcut_get_handler(
- this._participant_session_terminate_pending
- );
- },
-
- /**
- * Gets the participant session terminate success callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_session_terminate_success
- * @returns {Function} Participant session terminate success callback function
- */
- get_participant_session_terminate_success: function() {
- return this._shortcut_get_handler(
- this._participant_session_terminate_success
- );
- },
-
- /**
- * Gets the participant session terminate error callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_session_terminate_error
- * @returns {Function} Participant session terminate error callback function
- */
- get_participant_session_terminate_error: function() {
- return this._shortcut_get_handler(
- this._participant_session_terminate_error
- );
- },
-
- /**
- * Gets the participant session terminate request callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_session_terminate_request
- * @returns {Function} Participant session terminate request callback function
- */
- get_participant_session_terminate_request: function() {
- return this._shortcut_get_handler(
- this._participant_session_terminate_request
- );
- },
-
- /**
- * Gets the participant stream add event callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_stream_add
- * @returns {Function} Participant stream add event callback function
- */
- get_participant_stream_add: function() {
- return this._shortcut_get_handler(
- this._participant_stream_add
- );
- },
-
- /**
- * Gets the participant stream remove event callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_stream_remove
- * @returns {Function} Participant stream remove event callback function
- */
- get_participant_stream_remove: function() {
- return this._shortcut_get_handler(
- this._participant_stream_remove
- );
- },
-
- /**
- * Gets the participant stream connected event callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_stream_connected
- * @returns {Function} Participant stream connected event callback function
- */
- get_participant_stream_connected: function() {
- return this._shortcut_get_handler(
- this._participant_stream_connected
- );
- },
-
- /**
- * Gets the participant stream disconnected event callback function
- * @public
- * @event JSJaCJingleMuji#get_participant_stream_disconnected
- * @returns {Function} Participant stream disconnected event callback function
- */
- get_participant_stream_disconnected: function() {
- return this._shortcut_get_handler(
- this._participant_stream_disconnected
- );
- },
-
- /**
- * Gets the remote view add callback function
- * @public
- * @event JSJaCJingleMuji#get_add_remote_view
- * @returns {Function} Remote view add callback function
- */
- get_add_remote_view: function() {
- return this._shortcut_get_handler(
- this._add_remote_view
- );
- },
-
- /**
- * Gets the remote view removal callback function
- * @public
- * @event JSJaCJingleMuji#get_remove_remote_view
- * @returns {Function} Remote view removal callback function
- */
- get_remove_remote_view: function() {
- return this._shortcut_get_handler(
- this._remove_remote_view
- );
- },
-
- /**
- * Gets the local username
- * @public
- * @returns {String} Local username
- */
- get_username: function() {
- return this._username;
- },
-
- /**
- * Gets the room password
- * @public
- * @returns {String} Room password
- */
- get_password: function() {
- return this._password;
- },
-
- /**
- * Gets the password protect state
- * @public
- * @returns {Boolean} Password protect state
- */
- get_password_protect: function() {
- return this._password_protect;
- },
-
- /**
- * Gets the MUC to value
- * @public
- * @returns {String} To value for MUC
- */
- get_muc_to: function() {
- return (this.get_to() + '/' + this.get_username());
- },
-
- /**
- * Gets the prepended ID
- * @public
- * @returns {String} Prepended ID value
- */
- get_id_pre: function() {
- return JSJAC_JINGLE_STANZA_ID_PRE + '_' + (this.get_sid() || '0') + '_' + this.get_username() + '_';
- },
-
- /**
- * Gets the instance ID
- * @public
- * @returns {String} IID value
- */
- get_iid: function() {
- return this._iid;
- },
-
- /**
- * Gets the room owner state
- * @public
- * @returns {Boolean} Room owner state
- */
- get_is_room_owner: function() {
- return this._is_room_owner;
- },
-
-
-
- /**
- * JSJSAC JINGLE MUJI SETTERS
- */
-
- /**
- * Sets the room message in callback function
- * @private
- * @param {Function} room_message_in
- */
- _set_room_message_in: function(room_message_in) {
- this._room_message_in = room_message_in;
- },
-
- /**
- * Sets the room message out callback function
- * @private
- * @param {Function} room_message_out
- */
- _set_room_message_out: function(room_message_out) {
- this._room_message_out = room_message_out;
- },
-
- /**
- * Sets the room presence in callback function
- * @private
- * @param {Function} room_presence_in
- */
- _set_room_presence_in: function(room_presence_in) {
- this._room_presence_in = room_presence_in;
- },
-
- /**
- * Sets the room presence out callback function
- * @private
- * @param {Function} room_presence_out
- */
- _set_room_presence_out: function(room_presence_out) {
- this._room_presence_out = room_presence_out;
- },
-
- /**
- * Sets the session prepare pending callback function
- * @private
- * @param {Function} session_prepare_pending
- */
- _set_session_prepare_pending: function(session_prepare_pending) {
- this._session_prepare_pending = session_prepare_pending;
- },
-
- /**
- * Sets the session prepare success callback function
- * @private
- * @param {Function} session_prepare_success
- */
- _set_session_prepare_success: function(session_prepare_success) {
- this._session_prepare_success = session_prepare_success;
- },
-
- /**
- * Sets the session prepare error callback function
- * @private
- * @param {Function} session_prepare_error
- */
- _set_session_prepare_error: function(session_prepare_error) {
- this._session_prepare_error = session_prepare_error;
- },
-
- /**
- * Sets the session initiate pending callback function
- * @private
- * @param {Function} session_initiate_pending
- */
- _set_session_initiate_pending: function(session_initiate_pending) {
- this._session_initiate_pending = session_initiate_pending;
- },
-
- /**
- * Sets the session initiate success callback function
- * @private
- * @param {Function} session_initiate_success
- */
- _set_session_initiate_success: function(session_initiate_success) {
- this._session_initiate_success = session_initiate_success;
- },
-
- /**
- * Sets the session initiate error callback function
- * @private
- * @param {Function} session_initiate_error
- */
- _set_session_initiate_error: function(session_initiate_error) {
- this._session_initiate_error = session_initiate_error;
- },
-
- /**
- * Sets the session leave pending callback function
- * @private
- * @param {Function} session_leave_pending
- */
- _set_session_leave_pending: function(session_leave_pending) {
- this._session_leave_pending = session_leave_pending;
- },
-
- /**
- * Sets the session leave success callback function
- * @private
- * @param {Function} session_leave_success
- */
- _set_session_leave_success: function(session_leave_success) {
- this._session_leave_success = session_leave_success;
- },
-
- /**
- * Sets the session leave error callback function
- * @private
- * @param {Function} session_leave_error
- */
- _set_session_leave_error: function(session_leave_error) {
- this._session_leave_error = session_leave_error;
- },
-
- /**
- * Sets the participant prepare callback function
- * @private
- * @param {Function} participant_prepare
- */
- _set_participant_prepare: function(participant_prepare) {
- this._participant_prepare = participant_prepare;
- },
-
- /**
- * Sets the participant initiate callback function
- * @private
- * @param {Function} participant_initiate
- */
- _set_participant_initiate: function(participant_initiate) {
- this._participant_initiate = participant_initiate;
- },
-
- /**
- * Sets the participant leave callback function
- * @private
- * @param {Function} participant_leave
- */
- _set_participant_leave: function(participant_leave) {
- this._participant_leave = participant_leave;
- },
-
- /**
- * Sets the participant session initiate pending callback function
- * @private
- * @param {Function} participant_session_initiate_pending
- */
- _set_participant_session_initiate_pending: function(participant_session_initiate_pending) {
- this._participant_session_initiate_pending = participant_session_initiate_pending;
- },
-
- /**
- * Sets the participant session initiate success callback function
- * @private
- * @param {Function} participant_session_initiate_success
- */
- _set_participant_session_initiate_success: function(participant_session_initiate_success) {
- this._participant_session_initiate_success = participant_session_initiate_success;
- },
-
- /**
- * Sets the participant session initiate error callback function
- * @private
- * @param {Function} participant_session_initiate_error
- */
- _set_participant_session_initiate_error: function(participant_session_initiate_error) {
- this._participant_session_initiate_error = participant_session_initiate_error;
- },
-
- /**
- * Sets the participant session initiate request callback function
- * @private
- * @param {Function} participant_session_initiate_request
- */
- _set_participant_session_initiate_request: function(participant_session_initiate_request) {
- this._participant_session_initiate_request = participant_session_initiate_request;
- },
-
- /**
- * Sets the participant session accept pending callback function
- * @private
- * @param {Function} participant_session_accept_pending
- */
- _set_participant_session_accept_pending: function(participant_session_accept_pending) {
- this._participant_session_accept_pending = participant_session_accept_pending;
- },
-
- /**
- * Sets the participant session accept success callback function
- * @private
- * @param {Function} participant_session_accept_success
- */
- _set_participant_session_accept_success: function(participant_session_accept_success) {
- this._participant_session_accept_success = participant_session_accept_success;
- },
-
- /**
- * Sets the participant session accept error callback function
- * @private
- * @param {Function} participant_session_accept_error
- */
- _set_participant_session_accept_error: function(participant_session_accept_error) {
- this._participant_session_accept_error = participant_session_accept_error;
- },
-
- /**
- * Sets the participant session accept request callback function
- * @private
- * @param {Function} participant_session_accept_request
- */
- _set_participant_session_accept_request: function(participant_session_accept_request) {
- this._participant_session_accept_request = participant_session_accept_request;
- },
-
- /**
- * Sets the participant session info pending callback function
- * @private
- * @param {Function} participant_session_info_pending
- */
- _set_participant_session_info_pending: function(participant_session_info_pending) {
- this._participant_session_info_pending = participant_session_info_pending;
- },
-
- /**
- * Sets the participant session info success callback function
- * @private
- * @param {Function} participant_session_info_success
- */
- _set_participant_session_info_success: function(participant_session_info_success) {
- this._participant_session_info_success = participant_session_info_success;
- },
-
- /**
- * Sets the participant session info error callback function
- * @private
- * @param {Function} participant_session_info_error
- */
- _set_participant_session_info_error: function(participant_session_info_error) {
- this._participant_session_info_error = participant_session_info_error;
- },
-
- /**
- * Sets the participant session info request callback function
- * @private
- * @param {Function} participant_session_info_request
- */
- _set_participant_session_info_request: function(participant_session_info_request) {
- this._participant_session_info_request = participant_session_info_request;
- },
-
- /**
- * Sets the participant session terminate pending callback function
- * @private
- * @param {Function} participant_session_terminate_pending
- */
- _set_participant_session_terminate_pending: function(participant_session_terminate_pending) {
- this._participant_session_terminate_pending = participant_session_terminate_pending;
- },
-
- /**
- * Sets the participant session terminate success callback function
- * @private
- * @param {Function} participant_session_terminate_success
- */
- _set_participant_session_terminate_success: function(participant_session_terminate_success) {
- this._participant_session_terminate_success = participant_session_terminate_success;
- },
-
- /**
- * Sets the participant session terminate error callback function
- * @private
- * @param {Function} participant_session_terminate_error
- */
- _set_participant_session_terminate_error: function(participant_session_terminate_error) {
- this._participant_session_terminate_error = participant_session_terminate_error;
- },
-
- /**
- * Sets the participant session terminate request callback function
- * @private
- * @param {Function} participant_session_terminate_request
- */
- _set_participant_session_terminate_request: function(participant_session_terminate_request) {
- this._participant_session_terminate_request = participant_session_terminate_request;
- },
-
- /**
- * Sets the participant stream add event callback function
- * @private
- * @param {Function} participant_stream_add
- */
- _set_participant_stream_add: function(participant_stream_add) {
- this._participant_stream_add = participant_stream_add;
- },
-
- /**
- * Sets the participant stream remove event callback function
- * @private
- * @param {Function} participant_stream_remove
- */
- _set_participant_stream_remove: function(participant_stream_remove) {
- this._participant_stream_remove = participant_stream_remove;
- },
-
- /**
- * Sets the participant stream connected event callback function
- * @private
- * @param {Function} participant_stream_connected
- */
- _set_participant_stream_connected: function(participant_stream_connected) {
- this._participant_stream_connected = participant_stream_connected;
- },
-
- /**
- * Sets the participant stream disconnected event callback function
- * @private
- * @param {Function} participant_stream_disconnected
- */
- _set_participant_stream_disconnected: function(participant_stream_disconnected) {
- this._participant_stream_disconnected = participant_stream_disconnected;
- },
-
- /**
- * Sets the add remote view callback function
- * @private
- * @param {Function} add_remote_view
- */
- _set_add_remote_view: function(add_remote_view) {
- this._add_remote_view = add_remote_view;
- },
-
- /**
- * Sets the remove remote view pending callback function
- * @private
- * @param {Function} remove_remote_view
- */
- _set_remove_remote_view: function(remove_remote_view) {
- this._remove_remote_view = remove_remote_view;
- },
-
- /**
- * Sets the participants object
- * @private
- * @param {String} username
- * @param {Object} data_obj
- */
- _set_participants: function(username, data_obj) {
- if(username === null) {
- this._participants = {};
- } else if(data_obj === null) {
- if(username in this._participants)
- delete this._participants[username];
- } else if(username) {
- this._participants[username] = data_obj;
- }
- },
-
- /**
- * Sets the local username
- * @private
- * @param {String} username
- */
- _set_username: function(username) {
- this._username = username;
- },
-
- /**
- * Sets the room password
- * @private
- * @param {String} password
- */
- _set_password: function(password) {
- this._password = password;
- },
-
- /**
- * Sets the password protect state
- * @private
- * @param {Boolean} password_protect
- */
- _set_password_protect: function(password_protect) {
- this._password_protect = password_protect;
- },
-
- /**
- * Sets the instance ID
- * @private
- * @param {String} iid
- */
- _set_iid: function(iid) {
- this._iid = iid;
- },
-
- /**
- * Sets the room owner state
- * @private
- * @param {Boolean} is_room_owner
- */
- _set_is_room_owner: function(is_room_owner) {
- this._is_room_owner = is_room_owner;
- },
- }
-);
-/**
- * @fileoverview JSJaC Jingle library - Initialization broadcast lib (XEP-0353)
- *
- * @url https://github.com/valeriansaliou/jsjac-jingle
- * @depends https://github.com/sstrigler/JSJaC
- * @author Valérian Saliou https://valeriansaliou.name/
- * @license Mozilla Public License v2.0 (MPL v2.0)
- */
-
-
-/** @module jsjac-jingle/broadcast */
-/** @exports JSJaCJingleBroadcast */
-
-
-/**
- * Library initialization class.
- * @class
- * @classdesc Initialization broadcast class.
- * @requires nicolas-van/ring.js
- * @requires jsjac-jingle/main
- * @see {@link http://ringjs.neoname.eu/|Ring.js}
- * @see {@link http://stefan-strigler.de/jsjac-1.3.4/doc/|JSJaC Documentation}
- * @see {@link http://xmpp.org/extensions/xep-0353.html|XEP-0353: Jingle Message Initiation}
- */
-var JSJaCJingleBroadcast = new (ring.create(
- /** @lends JSJaCJingleBroadcast.prototype */
- {
- /**
- * Proposes a call
- * @public
- * @param {String} to
- * @param {Object} medias
- * @returns {String} Call ID
- */
- propose: function(to, medias, cb_timeout) {
- var id, self;
-
- try {
- self = this;
- id = this._send_remote_propose(to, medias);
-
- if(typeof cb_timeout == 'function') {
- setTimeout(function() {
- // Call answered
- if(self._exists_id(id) === false) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] propose > Propose successful.', 4);
- } else {
- cb_timeout(id);
-
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] propose > Propose timeout.', 2);
- }
- }, (JSJAC_JINGLE_BROADCAST_TIMEOUT * 1000));
- }
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] propose > ' + e, 1);
- } finally {
- return id;
- }
- },
-
- /**
- * Retracts from a call
- * @public
- * @param {String} to
- * @param {String} id
- */
- retract: function(to, id) {
- try {
- this._send_remote_retract(to, id);
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] retract > ' + e, 1);
- }
- },
-
- /**
- * Accepts a call
- * @public
- * @param {String} to
- * @param {String} id
- * @param {Object} medias
- */
- accept: function(to, id, medias) {
- try {
- this._register_id(id, medias);
-
- this._send_local_accept(id);
- this._send_remote_proceed(to, id);
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] accept > ' + e, 1);
- }
- },
-
- /**
- * Rejects a call
- * @public
- * @param {String} to
- * @param {String} id
- * @param {Object} medias
- */
- reject: function(to, id, medias) {
- try {
- this._register_id(id, medias);
-
- this._send_local_reject(id);
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] reject > ' + e, 1);
- }
- },
-
- /**
- * Handles a call
- * @public
- * @param {JSJaCPacket} stanza
- */
- handle: function(stanza) {
- var i,
- is_handled, stanza_child,
- description, cur_description, cur_media,
- proposed_medias,
- id;
-
- try {
- is_handled = false;
-
- stanza_child = stanza.getChild(
- '*', NS_JINGLE_MESSAGE
- );
-
- if(stanza_child) {
- var _this = this;
-
- var id_unregister_fn = function(stanza) {
- id = _this.get_call_id(stanza);
- if(id) _this._unregister_id(id);
- };
-
- switch(stanza_child.tagName) {
- case JSJAC_JINGLE_MESSAGE_ACTION_PROPOSE:
- proposed_medias = {};
-
- description = stanza_child.getElementsByTagNameNS(
- NS_JINGLE_APPS_RTP, 'description'
- );
-
- for(i = 0; i < description.length; i++) {
- cur_description = description[i];
-
- if(cur_description) {
- cur_media = cur_description.getAttribute('media');
-
- if(cur_media && cur_media in JSJAC_JINGLE_MEDIAS) {
- proposed_medias[cur_media] = 1;
- }
- }
- }
-
- JSJaCJingleStorage.get_single_propose()(stanza, proposed_medias);
-
- is_handled = true; break;
-
- case JSJAC_JINGLE_MESSAGE_ACTION_RETRACT:
- JSJaCJingleStorage.get_single_retract()(stanza);
- id_unregister_fn(stanza);
-
- is_handled = true; break;
-
- case JSJAC_JINGLE_MESSAGE_ACTION_ACCEPT:
- JSJaCJingleStorage.get_single_accept()(stanza);
- id_unregister_fn(stanza);
-
- is_handled = true; break;
-
- case JSJAC_JINGLE_MESSAGE_ACTION_REJECT:
- JSJaCJingleStorage.get_single_reject()(stanza);
- id_unregister_fn(stanza);
-
- is_handled = true; break;
-
- case JSJAC_JINGLE_MESSAGE_ACTION_PROCEED:
- JSJaCJingleStorage.get_single_proceed()(stanza);
- id_unregister_fn(stanza);
-
- is_handled = true; break;
- }
- }
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] handle > ' + e, 1);
- } finally {
- return is_handled;
- }
- },
-
- /**
- * Returns the call ID
- * @public
- * @param {JSJaCPacket} stanza
- * @returns {String} Call ID
- */
- get_call_id: function(stanza) {
- var call_id = null;
-
- try {
- var stanza_child = stanza.getChild(
- '*', NS_JINGLE_MESSAGE
- );
-
- if(stanza_child) {
- call_id = stanza_child.getAttribute('id') || null;
- }
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] get_call_id > ' + e, 1);
- } finally {
- return call_id;
- }
- },
-
- /**
- * Returns the call medias
- * @public
- * @param {String} id
- * @returns {Object} Call medias
- */
- get_call_medias: function(id) {
- var call_medias = [];
-
- try {
- call_medias = JSJaCJingleStorage.get_broadcast_ids(id) || [];
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] get_call_medias > ' + e, 1);
- } finally {
- return call_medias;
- }
- },
-
- /**
- * Broadcasts a Jingle session proposal (remote packet)
- * @private
- * @see {@link http://xmpp.org/extensions/xep-0353.html#intent|XEP-0353 - Propose}
- */
- _send_remote_propose: function(to, medias) {
- var i, cur_media, propose, id;
-
- try {
- id = this._register_id(null, medias);
- propose = this._build_stanza(
- to, id, JSJAC_JINGLE_MESSAGE_ACTION_PROPOSE
- );
-
- if(medias && typeof medias == 'object' && medias.length) {
- for(i = 0; i < medias.length; i++) {
- cur_media = medias[i];
-
- if(cur_media) {
- propose[1].appendChild(
- propose[0].buildNode('description', {
- 'xmlns': NS_JINGLE_APPS_RTP,
- 'media': cur_media
- })
- );
- }
- }
- }
-
- this._send_stanza(propose);
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] _send_remote_propose > ' + e, 1);
- } finally {
- return id;
- }
- },
-
- /**
- * Broadcasts a Jingle session retract (remote packet)
- * @private
- * @see {@link http://xmpp.org/extensions/xep-0353.html#retract|XEP-0353 - Retract}
- */
- _send_remote_retract: function(to, id) {
- try {
- if(this._exists_id(id) === true) {
- var retract = this._build_stanza(
- to, id, JSJAC_JINGLE_MESSAGE_ACTION_RETRACT
- );
-
- this._send_stanza(retract);
- this._unregister_id(id);
- } else {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] _send_remote_retract > Cannot retract, target ID not existing.', 0);
- }
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] _send_remote_retract > ' + e, 1);
- }
- },
-
- /**
- * Broadcasts a Jingle session proceed (remote packet)
- * @private
- * @see {@link http://xmpp.org/extensions/xep-0353.html#accept|XEP-0353 - Accept}
- */
- _send_remote_proceed: function(to, id) {
- try {
- // ID shouldn't exist at this point since we're the receiving party
- if(this._exists_id(id) === true) {
- var proceed = this._build_stanza(
- to, id, JSJAC_JINGLE_MESSAGE_ACTION_PROCEED
- );
-
- this._send_stanza(proceed);
- this._unregister_id(id);
- } else {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] _send_remote_proceed > Cannot proceed, target ID not existing.', 0);
- }
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] _send_remote_proceed > ' + e, 1);
- }
- },
-
- /**
- * Broadcasts a Jingle session accept (local packet)
- * @private-
- * @see {@link http://xmpp.org/extensions/xep-0353.html#accept|XEP-0353 - Accept}
- */
- _send_local_accept: function(id) {
- try {
- // ID shouldn't exist at this point since we're the receiving party
- if(this._exists_id(id) === true) {
- var accept = this._build_stanza(
- null, id, JSJAC_JINGLE_MESSAGE_ACTION_ACCEPT
- );
-
- this._send_stanza(accept);
- } else {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] _send_local_accept > Cannot accept, target ID not existing.', 0);
- }
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] _send_local_accept > ' + e, 1);
- }
- },
-
- /**
- * Broadcasts a Jingle session reject (local packet)
- * @private
- * @see {@link http://xmpp.org/extensions/xep-0353.html#reject|XEP-0353 - Reject}
- */
- _send_local_reject: function(id) {
- try {
- // ID shouldn't exist at this point since we're the receiving party
- if(this._exists_id(id) === true) {
- var reject = this._build_stanza(
- null, id, JSJAC_JINGLE_MESSAGE_ACTION_REJECT
- );
-
- this._send_stanza(reject);
- } else {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] _send_local_reject > Cannot reject, target ID not existing.', 0);
- }
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] _send_local_reject > ' + e, 1);
- }
- },
-
- /**
- * Builds a XEP-0353 stanza
- * @private
- */
- _build_stanza: function(to, id, action) {
- stanza_arr = [];
-
- try {
- var connection, stanza, node;
-
- stanza = new JSJaCMessage();
-
- // Set to connection user?
- if(to === null) {
- connection = JSJaCJingleStorage.get_connection();
- to = (connection.username + '@' + connection.domain);
- }
-
- stanza.setTo(to);
-
- node = stanza.getNode().appendChild(
- stanza.buildNode(action, {
- 'xmlns': NS_JINGLE_MESSAGE,
- 'id': id
- })
- );
-
- stanza_arr = [stanza, node];
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] _build_stanza > ' + e, 1);
- } finally {
- return stanza_arr;
- }
- },
-
- /**
- * Sends a XEP-0353 stanza
- * @private
- */
- _send_stanza: function(stanza_arr) {
- try {
- JSJaCJingleStorage.get_connection().send(
- stanza_arr[0]
- );
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] _send_stanza > ' + e, 1);
- }
- },
-
- /**
- * Returns whether an ID exists or not
- * @private
- */
- _exists_id: function(id) {
- var is_existing = false;
-
- try {
- is_existing = (JSJaCJingleStorage.get_broadcast_ids(id) !== null) && true;
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] _exists_id > ' + e, 1);
- } finally {
- return is_existing;
- }
- },
-
- /**
- * Registers an ID
- * @private
- */
- _register_id: function(id, medias) {
- try {
- id = id || JSJaCUtils.cnonce(16);
-
- JSJaCJingleStorage.set_broadcast_ids(id, medias);
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] _register_id > ' + e, 1);
- } finally {
- return id;
- }
- },
-
- /**
- * Unregisters an ID
- * @private
- */
- _unregister_id: function(id) {
- try {
- JSJaCJingleStorage.set_broadcast_ids(id, null, true);
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:broadcast] _unregister_id > ' + e, 1);
- }
- },
- }
-))();
-
-/**
- * @fileoverview JSJaC Jingle library - Initialization components
- *
- * @url https://github.com/valeriansaliou/jsjac-jingle
- * @depends https://github.com/sstrigler/JSJaC
- * @author Valérian Saliou https://valeriansaliou.name/
- * @license Mozilla Public License v2.0 (MPL v2.0)
- */
-
-
-/** @module jsjac-jingle/init */
-/** @exports JSJaCJingleInit */
-
-
-/**
- * Library initialization class.
- * @class
- * @classdesc Library initialization class.
- * @requires nicolas-van/ring.js
- * @requires jsjac-jingle/main
- * @see {@link http://ringjs.neoname.eu/|Ring.js}
- * @see {@link http://stefan-strigler.de/jsjac-1.3.4/doc/|JSJaC Documentation}
- */
-var JSJaCJingleInit = new (ring.create(
- /** @lends JSJaCJingleInit.prototype */
- {
- /**
- * Query the server for external services
- * @private
- */
- _extdisco: function() {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _extdisco > Discovering available services...', 2);
-
- try {
- // Pending state (defer other requests)
- JSJaCJingle._defer(true);
-
- // Build request
- var request = new JSJaCIQ();
-
- request.setTo(JSJaCJingleStorage.get_connection().domain);
- request.setType(JSJAC_JINGLE_IQ_TYPE_GET);
-
- request.getNode().appendChild(request.buildNode('services', { 'xmlns': NS_EXTDISCO }));
-
- JSJaCJingleStorage.get_connection().send(request, function(response) {
- try {
- // Parse response
- if(response.getType() == JSJAC_JINGLE_IQ_TYPE_RESULT) {
- var i,
- service_arr, cur_service,
- cur_host, cur_password, cur_port, cur_transport, cur_type, cur_username,
- store_obj;
-
- var services = response.getChild('services', NS_EXTDISCO);
-
- if(services) {
- service_arr = services.getElementsByTagNameNS(NS_EXTDISCO, 'service');
-
- for(i = 0; i < service_arr.length; i++) {
- cur_service = service_arr[i];
-
- cur_host = cur_service.getAttribute('host') || null;
- cur_port = cur_service.getAttribute('port') || null;
- cur_transport = cur_service.getAttribute('transport') || null;
- cur_type = cur_service.getAttribute('type') || null;
-
- cur_username = cur_service.getAttribute('username') || null;
- cur_password = cur_service.getAttribute('password') || null;
-
- if(!cur_host || !cur_type) continue;
-
- if(!(cur_type in JSJaCJingleStorage.get_extdisco())) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _extdisco > handle > Service skipped (type: ' + cur_type + ', host: ' + cur_host + ', port: ' + cur_port + ', transport: ' + cur_transport + ').', 4);
- continue;
- }
-
- store_obj = {
- 'host' : cur_host,
- 'port' : cur_port,
- 'transport' : cur_transport,
- 'type' : cur_type
- };
-
- if(cur_type == 'turn') {
- store_obj.username = cur_username;
- store_obj.password = cur_password;
- }
-
- JSJaCJingleStorage.get_extdisco()[cur_type].push(store_obj);
-
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _extdisco > handle > Service stored (type: ' + cur_type + ', host: ' + cur_host + ', port: ' + cur_port + ', transport: ' + cur_transport + ').', 4);
- }
- }
-
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _extdisco > handle > Discovered available services.', 2);
- } else {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _extdisco > handle > Could not discover services (server might not support XEP-0215).', 0);
- }
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _extdisco > handle > ' + e, 1);
- }
-
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _extdisco > Ready.', 2);
-
- // Execute deferred requests
- JSJaCJingle._defer(false);
- });
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _extdisco > ' + e, 1);
-
- // Execute deferred requests
- JSJaCJingle._defer(false);
- }
- },
-
- /**
- * Query the server for Jingle Relay Nodes services
- * @private
- */
- _relaynodes: function() {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _relaynodes > Discovering available Jingle Relay Nodes services...', 2);
-
- try {
- // Pending state (defer other requests)
- JSJaCJingle._defer(true);
-
- // Build request
- var request = new JSJaCIQ();
-
- request.setTo(JSJaCJingleStorage.get_connection().domain);
- request.setType(JSJAC_JINGLE_IQ_TYPE_GET);
-
- request.getNode().appendChild(request.buildNode('services', { 'xmlns': NS_JABBER_JINGLENODES }));
-
- JSJaCJingleStorage.get_connection().send(request, function(response) {
- try {
- // Parse response
- if(response.getType() == JSJAC_JINGLE_IQ_TYPE_RESULT) {
- var i,
- stun_arr, cur_stun,
- cur_policy, cur_address, cur_protocol;
-
- var services = response.getChild('services', NS_JABBER_JINGLENODES);
-
- if(services) {
- // Parse STUN servers
- stun_arr = services.getElementsByTagNameNS(NS_JABBER_JINGLENODES, 'stun');
-
- for(i = 0; i < stun_arr.length; i++) {
- cur_stun = stun_arr[i];
-
- cur_policy = cur_stun.getAttribute('policy') || null;
- cur_address = cur_stun.getAttribute('address') || null;
- cur_port = cur_stun.getAttribute('port') || null;
- cur_protocol = cur_stun.getAttribute('protocol') || null;
-
- if(!cur_address || !cur_protocol || !cur_policy || (cur_policy && cur_policy != 'public')) continue;
-
- JSJaCJingleStorage.get_relaynodes().stun.push({
- 'host' : cur_address,
- 'port' : cur_port,
- 'transport' : cur_protocol,
- 'type' : 'stun'
- });
-
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _relaynodes > handle > STUN service stored (address: ' + cur_address + ', port: ' + cur_port + ', policy: ' + cur_policy + ', protocol: ' + cur_protocol + ').', 4);
- }
- }
-
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _relaynodes > handle > Discovered available Jingle Relay Nodes services.', 2);
- } else {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _relaynodes > handle > Could not discover Jingle Relay Nodes services (server might not support XEP-0278).', 0);
- }
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _relaynodes > handle > ' + e, 1);
- }
-
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _relaynodes > Ready.', 2);
-
- // Execute deferred requests
- JSJaCJingle._defer(false);
- });
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _relaynodes > ' + e, 1);
-
- // Execute deferred requests
- JSJaCJingle._defer(false);
- }
- },
-
- /**
- * Query some external APIs for fallback STUN/TURN (must be configured)
- * @private
- * @param {String} fallback_url
- */
- _fallback: function(fallback_url) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _fallback > Discovering fallback services...', 2);
-
- try {
- // Pending state (defer other requests)
- JSJaCJingle._defer(true);
-
- // Generate fallback API URL
- fallback_url += '?username=' +
- encodeURIComponent(JSJaCJingleStorage.get_connection().username + '@' + JSJaCJingleStorage.get_connection().domain);
-
- // Proceed request
- var xhr = new XMLHttpRequest();
- xhr.open('GET', fallback_url, true);
-
- xhr.onreadystatechange = function() {
- if(xhr.readyState === 4) {
- // Success?
- if(xhr.status === 200) {
- var data = JSON.parse(xhr.responseText);
-
- var cur_parse,
- i, cur_url,
- cur_type, cur_host, cur_port, cur_transport,
- cur_username, cur_password,
- store_obj;
-
- if(data.uris && data.uris.length) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _fallback > handle > Parsing ' + data.uris.length + ' URIs...', 2);
-
- for(i in data.uris) {
- cur_url = data.uris[i];
-
- if(cur_url) {
- // Parse current URL
- cur_parse = R_JSJAC_JINGLE_SERVICE_URI.exec(cur_url);
-
- if(cur_parse) {
- cur_type = cur_parse[1] || null;
- cur_host = cur_parse[2] || null;
- cur_port = cur_parse[3] || null;
- cur_transport = cur_parse[4] || null;
-
- cur_username = data.username || null;
- cur_password = data.password || null;
-
- if(!cur_host || !cur_type) continue;
-
- if(!(cur_type in JSJaCJingleStorage.get_fallback())) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _fallback > handle > Service skipped (type: ' + cur_type + ', host: ' + cur_host + ', port: ' + cur_port + ', transport: ' + cur_transport + ').', 4);
- continue;
- }
-
- store_obj = {
- 'host' : cur_host,
- 'port' : cur_port,
- 'transport' : cur_transport,
- 'type' : cur_type
- };
-
- if(cur_type == 'turn') {
- store_obj.username = cur_username;
- store_obj.password = cur_password;
- }
-
- JSJaCJingleStorage.get_fallback()[cur_type].push(store_obj);
-
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _fallback > handle > Fallback service stored (type: ' + cur_type + ', host: ' + cur_host + ', port: ' + cur_port + ', transport: ' + cur_transport + ').', 4);
- } else {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _fallback > handle > Fallback service not stored, weird URI (' + cur_url + ').', 0);
- }
- }
- }
-
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _fallback > handle > Finished parsing URIs.', 2);
- } else {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _fallback > handle > No URI to parse.', 2);
- }
-
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _fallback > handle > Discovered fallback services.', 2);
- } else {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _fallback > handle > Could not discover fallback services (API malfunction).', 0);
- }
-
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _fallback > Ready.', 2);
-
- // Execute deferred requests
- JSJaCJingle._defer(false);
- }
- };
-
- xhr.send();
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:init] _fallback > ' + e, 1);
- }
- },
- }
-))();
-/**
- * @fileoverview JSJaC Jingle library - Common components
- *
- * @url https://github.com/valeriansaliou/jsjac-jingle
- * @depends https://github.com/sstrigler/JSJaC
- * @author Valérian Saliou https://valeriansaliou.name/
- * @license Mozilla Public License v2.0 (MPL v2.0)
- */
-
-
-/** @module jsjac-jingle/main */
-/** @exports JSJaCJingle */
-
-
-/**
- * Library main class.
- * @instance
- * @requires nicolas-van/ring.js
- * @requires sstrigler/JSJaC
- * @requires jsjac-jingle/init
- * @requires jsjac-jingle/single
- * @requires jsjac-jingle/muji
- * @see {@link http://ringjs.neoname.eu/|Ring.js}
- * @see {@link http://stefan-strigler.de/jsjac-1.3.4/doc/|JSJaC Documentation}
- */
-var JSJaCJingle = new (ring.create(
- /** @lends JSJaCJingle.prototype */
- {
- /**
- * Starts a new Jingle session
- * @public
- * @param {String} type
- * @param {Object} [args]
- * @returns {JSJaCJingleSingle|JSJaCJingleMuji} JSJaCJingle session instance
- */
- session: function(type, args) {
- var jingle;
-
- try {
- switch(type) {
- case JSJAC_JINGLE_SESSION_SINGLE:
- jingle = new JSJaCJingleSingle(args);
- break;
-
- case JSJAC_JINGLE_SESSION_MUJI:
- jingle = new JSJaCJingleMuji(args);
- break;
-
- default:
- throw ('Unknown session type: ' + type);
- }
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] session > ' + e, 1);
- } finally {
- return jingle;
- }
- },
-
- /**
- * Listens for Jingle events
- * @public
- * @param {Object} [args]
- * @property {JSJaCConnection} [args.connection] - The connection to be attached to.
- * @property {Function} [args.single_initiate] - The Jingle session initiate request custom handler.
- * @property {Function} [args.single_propose] - The Jingle session propose request custom handler.
- * @property {Function} [args.single_retract] - The Jingle session retract request custom handler.
- * @property {Function} [args.single_accept] - The Jingle session accept request custom handler.
- * @property {Function} [args.single_reject] - The Jingle session reject request custom handler.
- * @property {Function} [args.single_proceed] - The Jingle session proceed request custom handler.
- * @property {Function} [args.muji_invite] - The Muji session invite message custom handler.
- * @property {JSJaCDebugger} [args.debug] - A reference to a debugger implementing the JSJaCDebugger interface.
- * @property {Boolean} [args.extdisco] - Whether or not to discover external services as per XEP-0215.
- * @property {Boolean} [args.relaynodes] - Whether or not to discover relay nodes as per XEP-0278.
- * @property {Boolean} [args.fallback] - Whether or not to request STUN/TURN from a fallback URL.
- * @see {@link https://github.com/valeriansaliou/jsjac-jingle/blob/master/examples/fallback.json|Fallback JSON Sample} - Fallback URL format.
- */
- listen: function(args) {
- try {
- // Apply arguments
- if(args && args.connection)
- JSJaCJingleStorage.set_connection(args.connection);
- if(args && args.single_initiate)
- JSJaCJingleStorage.set_single_initiate(args.single_initiate);
- if(args && args.single_propose)
- JSJaCJingleStorage.set_single_propose(args.single_propose);
- if(args && args.single_retract)
- JSJaCJingleStorage.set_single_retract(args.single_retract);
- if(args && args.single_accept)
- JSJaCJingleStorage.set_single_accept(args.single_accept);
- if(args && args.single_reject)
- JSJaCJingleStorage.set_single_reject(args.single_reject);
- if(args && args.single_proceed)
- JSJaCJingleStorage.set_single_proceed(args.single_proceed);
- if(args && args.muji_invite)
- JSJaCJingleStorage.set_muji_invite(args.muji_invite);
- if(args && args.debug)
- JSJaCJingleStorage.set_debug(args.debug);
-
- // Incoming IQs handler
- var cur_type, route_map = {};
- route_map[JSJAC_JINGLE_STANZA_IQ] = this._route_iq;
- route_map[JSJAC_JINGLE_STANZA_MESSAGE] = this._route_message;
- route_map[JSJAC_JINGLE_STANZA_PRESENCE] = this._route_presence;
-
- for(cur_type in route_map) {
- JSJaCJingleStorage.get_connection().registerHandler(
- cur_type,
- route_map[cur_type].bind(this)
- );
- }
-
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] listen > Listening.', 2);
-
- // Discover available network services
- if(!args || args.extdisco !== false)
- JSJaCJingleInit._extdisco();
- if(!args || args.relaynodes !== false)
- JSJaCJingleInit._relaynodes();
- if(args.fallback && typeof args.fallback === 'string')
- JSJaCJingleInit._fallback(args.fallback);
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] listen > ' + e, 1);
- }
- },
-
- /**
- * Maps the Jingle disco features
- * @public
- * @returns {Array} Feature namespaces
- */
- disco: function() {
- // Check for listen status
- var has_muji = (typeof JSJaCJingleStorage.get_muji_invite_raw() == 'function' && true);
- var has_jingle = ((has_muji || (typeof JSJaCJingleStorage.get_single_initiate_raw() == 'function')) && true);
-
- if(JSJAC_JINGLE_AVAILABLE && has_jingle) {
- if(has_muji) {
- return MAP_DISCO_JINGLE.concat(MAP_DISCO_MUJI);
- } else {
- return MAP_DISCO_JINGLE;
- }
- }
-
- return [];
- },
-
- /**
- * Routes Jingle IQ stanzas
- * @private
- * @param {JSJaCPacket} stanza
- */
- _route_iq: function(stanza) {
- try {
- var from = stanza.getFrom();
-
- if(from) {
- var jid_obj = new JSJaCJID(from);
- var from_bare = (jid_obj.getNode() + '@' + jid_obj.getDomain());
-
- // Single or Muji?
- var is_muji = (this._read(JSJAC_JINGLE_SESSION_MUJI, from_bare) !== null);
- var is_single = !is_muji;
-
- var action = null;
- var sid = null;
- var session_route = null;
-
- // Route the incoming stanza
- var jingle = stanza.getChild('jingle', NS_JINGLE);
-
- if(jingle) {
- sid = jingle.getAttribute('sid');
- action = jingle.getAttribute('action');
- } else {
- var stanza_id = stanza.getID();
-
- if(stanza_id) {
- var is_jingle = stanza_id.indexOf(JSJAC_JINGLE_STANZA_ID_PRE + '_') !== -1;
-
- if(is_jingle) {
- var stanza_id_split = stanza_id.split('_');
- sid = stanza_id_split[1];
- }
- }
- }
-
- // WebRTC not available ATM?
- if(jingle && !JSJAC_JINGLE_AVAILABLE) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] _route_iq > Dropped Jingle packet (WebRTC not available).', 0);
-
- (new JSJaCJingleSingle({ to: from }))._send_error(stanza, XMPP_ERROR_SERVICE_UNAVAILABLE);
- } else if(is_muji) {
- var username, participant;
-
- username = jid_obj.getResource();
- session_route = this._read(JSJAC_JINGLE_SESSION_MUJI, from_bare);
- participant = session_route.get_participants(username);
-
- // Muji: new session? Or registered one?
- if(participant && participant.session &&
- (participant.session instanceof JSJaCJingleSingle)) {
- // Route to Single session
- var session_route_single = this._read(
- JSJAC_JINGLE_SESSION_SINGLE,
- participant.session.get_sid()
- );
-
- if(session_route_single !== null) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] _route_iq > [' + username + '] > Routed to Muji participant session (sid: ' + sid + ').', 2);
-
- session_route_single.handle(stanza);
- } else if(stanza.getType() == JSJAC_JINGLE_IQ_TYPE_SET && from) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] _route_iq > Unknown Muji participant session route (sid: ' + sid + ').', 0);
-
- (new JSJaCJingleSingle({ to: from }))._send_error(stanza, JSJAC_JINGLE_ERROR_UNKNOWN_SESSION);
- }
- } else if(sid) {
- if(action == JSJAC_JINGLE_ACTION_SESSION_INITIATE) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] _route_iq > [' + username + '] > New Muji participant session (sid: ' + sid + ').', 2);
-
- session_route._create_participant_session(username).handle(stanza);
- } else if(stanza.getType() == JSJAC_JINGLE_IQ_TYPE_SET && from) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] _route_iq > Unknown Muji participant session (sid: ' + sid + ').', 0);
-
- (new JSJaCJingleSingle({ to: from }))._send_error(stanza, JSJAC_JINGLE_ERROR_UNKNOWN_SESSION);
- }
- }
- } else if(is_single) {
- // Single: new session? Or registered one?
- session_route = this._read(JSJAC_JINGLE_SESSION_SINGLE, sid);
-
- if(action == JSJAC_JINGLE_ACTION_SESSION_INITIATE && session_route === null) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] _route_iq > New Jingle session (sid: ' + sid + ').', 2);
-
- JSJaCJingleStorage.get_single_initiate()(stanza);
- } else if(sid) {
- if(session_route !== null) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] _route_iq > Routed to Jingle session (sid: ' + sid + ').', 2);
-
- session_route.handle(stanza);
- } else if(stanza.getType() == JSJAC_JINGLE_IQ_TYPE_SET && from) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] _route_iq > Unknown Jingle session (sid: ' + sid + ').', 0);
-
- (new JSJaCJingleSingle({ to: from }))._send_error(stanza, JSJAC_JINGLE_ERROR_UNKNOWN_SESSION);
- }
- }
- } else {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] _route_iq > No route to session, not Jingle nor Muji (sid: ' + sid + ').', 0);
- }
- }
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] _route_iq > ' + e, 1);
- }
- },
-
- /**
- * Routes Jingle message stanzas
- * @private
- * @param {JSJaCPacket} stanza
- */
- _route_message: function(stanza) {
- try {
- var from = stanza.getFrom();
-
- if(from) {
- var jid = new JSJaCJID(from);
-
- // Broadcast message?
- var is_handled_broadcast = JSJaCJingleBroadcast.handle(stanza);
-
- if(is_handled_broadcast === true) {
- // XEP-0353: Jingle Message Initiation
- // Nothing to do there.
- } else {
- // Muji?
- var room = jid.getNode() + '@' + jid.getDomain();
-
- var session_route = this._read(JSJAC_JINGLE_SESSION_MUJI, room);
-
- var x_conference = stanza.getChild('x', NS_JABBER_CONFERENCE);
- var x_invite = stanza.getChild('x', NS_MUJI_INVITE);
-
- var is_invite = (x_conference && x_invite && true);
-
- if(is_invite === true) {
- if(session_route === null) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] _route_message > Muji invite received (room: ' + room + ').', 2);
-
- // Read invite data
- var err = 0;
- var args = {
- from : (from || err++),
- jid : (x_conference.getAttribute('jid') || err++),
- password : (x_conference.getAttribute('password') || null),
- reason : (x_conference.getAttribute('reason') || null),
- media : (x_invite.getAttribute('media') || err++)
- };
-
- if(err === 0) {
- JSJaCJingleStorage.get_muji_invite()(stanza, args);
- } else {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] _route_message > Dropped invite because incomplete (room: ' + room + ').', 0);
- }
- } else {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] _route_message > Dropped invite because Muji already joined (room: ' + room + ').', 0);
- }
- } else {
- if(session_route !== null) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] _route_message > Routed to Jingle session (room: ' + room + ').', 2);
-
- session_route.handle_message(stanza);
- }
- }
- }
- }
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] _route_message > ' + e, 1);
- }
- },
-
- /**
- * Routes Jingle presence stanzas
- * @private
- * @param {JSJaCPacket} stanza
- */
- _route_presence: function(stanza) {
- try {
- // Muji?
- var from = stanza.getFrom();
-
- if(from) {
- var jid = new JSJaCJID(from);
- var room = jid.getNode() + '@' + jid.getDomain();
-
- var session_route = this._read(JSJAC_JINGLE_SESSION_MUJI, room);
-
- if(session_route !== null) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] _route_presence > Routed to Jingle session (room: ' + room + ').', 2);
-
- session_route.handle_presence(stanza);
- }
- }
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] _route_presence > ' + e, 1);
- }
- },
-
- /**
- * Adds a new Jingle session
- * @private
- * @param {String} type
- * @param {String} sid
- * @param {Object} obj
- */
- _add: function(type, sid, obj) {
- JSJaCJingleStorage.get_sessions()[type][sid] = obj;
- },
-
- /**
- * Reads a new Jingle session
- * @private
- * @param {String} type
- * @param {String} sid
- * @returns {Object} Session
- */
- _read: function(type, sid) {
- return (sid in JSJaCJingleStorage.get_sessions()[type]) ? JSJaCJingleStorage.get_sessions()[type][sid] : null;
- },
-
- /**
- * Removes a new Jingle session
- * @private
- * @param {String} type
- * @param {String} sid
- */
- _remove: function(type, sid) {
- delete JSJaCJingleStorage.get_sessions()[type][sid];
- },
-
- /**
- * Defer given task/execute deferred tasks
- * @private
- * @param {(Function|Boolean)} arg
- */
- _defer: function(arg) {
- try {
- if(typeof arg == 'function') {
- // Deferring?
- if(JSJaCJingleStorage.get_defer().deferred) {
- (JSJaCJingleStorage.get_defer().fn).push(arg);
-
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] defer > Registered a function to be executed once ready.', 2);
- }
-
- return JSJaCJingleStorage.get_defer().deferred;
- } else if(!arg || typeof arg == 'boolean') {
- JSJaCJingleStorage.get_defer().deferred = (arg === true);
-
- if(JSJaCJingleStorage.get_defer().deferred === false) {
- // Execute deferred tasks?
- if((--JSJaCJingleStorage.get_defer().count) <= 0) {
- JSJaCJingleStorage.get_defer().count = 0;
-
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] defer > Executing ' + JSJaCJingleStorage.get_defer().fn.length + ' deferred functions...', 2);
-
- while(JSJaCJingleStorage.get_defer().fn.length)
- ((JSJaCJingleStorage.get_defer().fn).shift())();
-
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] defer > Done executing deferred functions.', 2);
- }
- } else {
- ++JSJaCJingleStorage.get_defer().count;
- }
- }
- } catch(e) {
- JSJaCJingleStorage.get_debug().log('[JSJaCJingle:main] defer > ' + e, 1);
- }
- },
- }
-))();
diff --git a/source/app/javascripts/jsjac.js b/source/app/javascripts/jsjac.js
deleted file mode 100644
index 7d69e38..0000000
--- a/source/app/javascripts/jsjac.js
+++ /dev/null
@@ -1,5090 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the JSJaC library for Jappix (from trunk)
-
--------------------------------------------------
-
-Licenses: Mozilla Public License version 1.1, GNU GPL, AGPL
-Authors: Stefan Strigler, Valérian Saliou, Zash, Maranda
-
-*/
-
-/**
- * @fileoverview Magic dependency loading. Taken from script.aculo.us
- * and modified to break it.
- * @author Stefan Strigler steve@zeank.in-berlin.de
- * @version 1.3
- */
-
-var JSJaC = {
- Version: '1.3',
- bind: function(fn, obj, optArg) {
- return function(arg) {
- return fn.apply(obj, [arg, optArg]);
- };
- }
-};
-
-
-
-/* Copyright 2006 Erik Arvidsson
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you
- * may not use this file except in compliance with the License. You
- * may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/**
- * @fileoverview Wrapper to make working with XmlHttpRequest and the
- * DOM more convenient (cross browser compliance).
- * this code is taken from
- * http://webfx.eae.net/dhtml/xmlextras/xmlextras.html
- * @author Stefan Strigler steve@zeank.in-berlin.de
- * @version 1.3
- */
-
-/**
- * XmlHttp factory
- * @private
- */
-function XmlHttp() {}
-
-/**
- * creates a cross browser compliant XmlHttpRequest object
- */
-XmlHttp.create = function () {
- try {
- // Are we cross-domain?
- if(!BOSH_SAME_ORIGIN) {
- // Able to use CORS?
- if (window.XMLHttpRequest) {
- var req = new XMLHttpRequest();
-
- if (req.withCredentials !== undefined)
- return req;
- }
-
- // Fallback on JSONP
- return new jXHR();
- }
- // Might be local-domain?
- if (window.XMLHttpRequest) {
- var req = new XMLHttpRequest();
-
- // some versions of Moz do not support the readyState property
- // and the onreadystate event so we patch it!
- if (req.readyState == null) {
- req.readyState = 1;
- req.addEventListener("load", function () {
- req.readyState = 4;
- if (typeof req.onreadystatechange == "function")
- req.onreadystatechange();
- }, false);
- }
-
- return req;
- }
- if (window.ActiveXObject) {
- return new ActiveXObject(XmlHttp.getPrefix() + ".XmlHttp");
- }
- }
- catch (ex) {}
- // fell through
- throw new Error("Your browser does not support XmlHttp objects");
-};
-
-/**
- * used to find the Automation server name
- * @private
- */
-XmlHttp.getPrefix = function() {
- if (XmlHttp.prefix) // I know what you did last summer
- return XmlHttp.prefix;
-
- var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"];
- var o;
- for (var i = 0; i < prefixes.length; i++) {
- try {
- // try to create the objects
- o = new ActiveXObject(prefixes[i] + ".XmlHttp");
- return XmlHttp.prefix = prefixes[i];
- }
- catch (ex) {};
- }
-
- throw new Error("Could not find an installed XML parser");
-};
-
-
-/**
- * XmlDocument factory
- * @private
- */
-function XmlDocument() {}
-
-XmlDocument.create = function (name,ns) {
- name = name || 'foo';
- ns = ns || '';
-
- try {
- var doc;
- // DOM2
- if (document.implementation && document.implementation.createDocument) {
- doc = document.implementation.createDocument(ns, name, null);
- // some versions of Moz do not support the readyState property
- // and the onreadystate event so we patch it!
- if (doc.readyState == null) {
- doc.readyState = 1;
- doc.addEventListener("load", function () {
- doc.readyState = 4;
- if (typeof doc.onreadystatechange == "function")
- doc.onreadystatechange();
- }, false);
- }
- } else if (window.ActiveXObject) {
- doc = new ActiveXObject(XmlDocument.getPrefix() + ".DomDocument");
- }
-
- if (!doc.documentElement || doc.documentElement.tagName != name ||
- (doc.documentElement.namespaceURI &&
- doc.documentElement.namespaceURI != ns)) {
- try {
- if (ns != '')
- doc.appendChild(doc.createElement(name)).
- setAttribute('xmlns',ns);
- else
- doc.appendChild(doc.createElement(name));
- } catch (dex) {
- doc = document.implementation.createDocument(ns,name,null);
-
- if (doc.documentElement == null)
- doc.appendChild(doc.createElement(name));
-
- // fix buggy opera 8.5x
- if (ns != '' &&
- doc.documentElement.getAttribute('xmlns') != ns) {
- doc.documentElement.setAttribute('xmlns',ns);
- }
- }
- }
-
- return doc;
- }
- catch (ex) { }
- throw new Error("Your browser does not support XmlDocument objects");
-};
-
-/**
- * used to find the Automation server name
- * @private
- */
-XmlDocument.getPrefix = function() {
- if (XmlDocument.prefix)
- return XmlDocument.prefix;
-
- var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"];
- var o;
- for (var i = 0; i < prefixes.length; i++) {
- try {
- // try to create the objects
- o = new ActiveXObject(prefixes[i] + ".DomDocument");
- return XmlDocument.prefix = prefixes[i];
- }
- catch (ex) {};
- }
-
- throw new Error("Could not find an installed XML parser");
-};
-
-
-// Create the loadXML method
-if (typeof(Document) != 'undefined' && window.DOMParser) {
-
- /**
- * XMLDocument did not extend the Document interface in some
- * versions of Mozilla.
- * @private
- */
- Document.prototype.loadXML = function (s) {
-
- // parse the string to a new doc
- var doc2 = (new DOMParser()).parseFromString(s, "text/xml");
-
- // remove all initial children
- while (this.hasChildNodes())
- this.removeChild(this.lastChild);
-
- // insert and import nodes
- for (var i = 0; i < doc2.childNodes.length; i++) {
- this.appendChild(this.importNode(doc2.childNodes[i], true));
- }
- };
- }
-
-// Create xml getter for Mozilla
-if (window.XMLSerializer &&
- window.Node && Node.prototype && Node.prototype.__defineGetter__) {
-
- /**
- * xml getter
- *
- * This serializes the DOM tree to an XML String
- *
- * Usage: var sXml = oNode.xml
- * @deprecated
- * @private
- */
- // XMLDocument did not extend the Document interface in some versions
- // of Mozilla. Extend both!
- XMLDocument.prototype.__defineGetter__("xml", function () {
- return (new XMLSerializer()).serializeToString(this);
- });
- /**
- * xml getter
- *
- * This serializes the DOM tree to an XML String
- *
- * Usage: var sXml = oNode.xml
- * @deprecated
- * @private
- */
- Document.prototype.__defineGetter__("xml", function () {
- return (new XMLSerializer()).serializeToString(this);
- });
-
- /**
- * xml getter
- *
- * This serializes the DOM tree to an XML String
- *
- * Usage: var sXml = oNode.xml
- * @deprecated
- * @private
- */
- Node.prototype.__defineGetter__("xml", function () {
- return (new XMLSerializer()).serializeToString(this);
- });
- }
-
-
-/**
- * @fileoverview Collection of functions to make live easier
- * @author Stefan Strigler
- * @version 1.3
- */
-
-/**
- * Convert special chars to HTML entities
- * @addon
- * @return The string with chars encoded for HTML
- * @type String
- */
-String.prototype.htmlEnc = function() {
- if(!this)
- return this;
-
- return this.replace(/&(?!(amp|apos|gt|lt|quot);)/g,"&")
- .replace(//g,">")
- .replace(/\'/g,"'")
- .replace(/\"/g,""")
- .replace(/\n/g,"
");
-};
-
-/**
- * Convert HTML entities to special chars
- * @addon
- * @return The normal string
- * @type String
- */
-String.prototype.revertHtmlEnc = function() {
- if(!this)
- return this;
-
- var str = this.replace(/&/gi,'&');
- str = str.replace(/</gi,'<');
- str = str.replace(/>/gi,'>');
- str = str.replace(/'/gi,'\'');
- str = str.replace(/"/gi,'\"');
- str = str.replace(/
/gi,'\n');
- return str;
-};
-
-/**
- * Converts from jabber timestamps to JavaScript Date objects
- * @addon
- * @param {String} ts A string representing a jabber datetime timestamp as
- * defined by {@link http://www.xmpp.org/extensions/xep-0082.html XEP-0082}
- * @return A javascript Date object corresponding to the jabber DateTime given
- * @type Date
- */
-Date.jab2date = function(ts) {
- // Timestamp
- if(!isNaN(ts))
- return new Date(ts * 1000);
-
- // Get the UTC date
- var date = new Date(Date.UTC(ts.substr(0,4),ts.substr(5,2)-1,ts.substr(8,2),ts.substr(11,2),ts.substr(14,2),ts.substr(17,2)));
-
- if (ts.substr(ts.length-6,1) != 'Z') { // there's an offset
- var date_offset = date.getTimezoneOffset() * 60 * 1000;
- var offset = new Date();
- offset.setTime(0);
- offset.setUTCHours(ts.substr(ts.length-5,2));
- offset.setUTCMinutes(ts.substr(ts.length-2,2));
- if (ts.substr(ts.length-6,1) == '+')
- date.setTime(date.getTime() + offset.getTime() + date_offset);
- else if (ts.substr(ts.length-6,1) == '-')
- date.setTime(date.getTime() - offset.getTime() + date_offset);
- }
- return date;
-};
-
-/**
- * Takes a timestamp in the form of 2004-08-13T12:07:04+02:00 as argument
- * and converts it to some sort of humane readable format
- * @addon
- */
-Date.hrTime = function(ts) {
- return Date.jab2date(ts).toLocaleString();
-};
-
-
- /**
- * Current timestamp.
- * @return Seconds since 1.1.1970.
- * @type int
- */
- if (!Date.now) {
- Date.now = function() { return new Date().getTime(); }
- }
-
- /**
- * somewhat opposit to {@link #hrTime}
- * expects a javascript Date object as parameter and returns a jabber
- * date string conforming to
- * {@link http://www.xmpp.org/extensions/xep-0082.html XEP-0082}
- * @see #hrTime
- * @return The corresponding jabber DateTime string
- * @type String
- */
-Date.prototype.jabberDate = function() {
- var padZero = function(i) {
- if (i < 10) return "0" + i;
- return i;
- };
-
- var jDate = this.getUTCFullYear() + "-";
- jDate += padZero(this.getUTCMonth()+1) + "-";
- jDate += padZero(this.getUTCDate()) + "T";
- jDate += padZero(this.getUTCHours()) + ":";
- jDate += padZero(this.getUTCMinutes()) + ":";
- jDate += padZero(this.getUTCSeconds()) + "Z";
-
- return jDate;
-};
-
-/**
- * Determines the maximum of two given numbers
- * @addon
- * @param {Number} A a number
- * @param {Number} B another number
- * @return the maximum of A and B
- * @type Number
- */
-Number.max = function(A, B) {
- return (A > B)? A : B;
-};
-
-Number.min = function(A, B) {
- return (A < B)? A : B;
-};
-
-
-/* Copyright (c) 1998 - 2007, Paul Johnston & Contributors
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following
- * disclaimer. Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * Neither the name of the author nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-/**
- * @fileoverview Collection of MD5 and SHA1 hashing and encoding
- * methods.
- * @author Stefan Strigler steve@zeank.in-berlin.de
- */
-
-
-/*
- * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
- * in FIPS PUB 180-1
- * Version 2.1a Copyright Paul Johnston 2000 - 2002.
- * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
- * Distributed under the BSD License
- * See http://pajhome.org.uk/crypt/md5 for details.
- */
-
-/*
- * Configurable variables. You may need to tweak these to be compatible with
- * the server-side, but the defaults work in most cases.
- */
-var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
-var b64pad = "="; /* base-64 pad character. "=" for strict RFC compliance */
-var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
-
-/*
- * These are the functions you'll usually want to call
- * They take string arguments and return either hex or base-64 encoded strings
- */
-function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
-function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
-function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
-function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
-function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
-function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}
-
-/*
- * Perform a simple self-test to see if the VM is working
- */
-function sha1_vm_test()
-{
- return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d";
-}
-
-/*
- * Calculate the SHA-1 of an array of big-endian words, and a bit length
- */
-function core_sha1(x, len)
-{
- /* append padding */
- x[len >> 5] |= 0x80 << (24 - len % 32);
- x[((len + 64 >> 9) << 4) + 15] = len;
-
- var w = new Array(80);
- var a = 1732584193;
- var b = -271733879;
- var c = -1732584194;
- var d = 271733878;
- var e = -1009589776;
-
- var i, j, t, olda, oldb, oldc, oldd, olde;
- for (i = 0; i < x.length; i += 16)
- {
- olda = a;
- oldb = b;
- oldc = c;
- oldd = d;
- olde = e;
-
- for (j = 0; j < 80; j++)
- {
- if (j < 16) { w[j] = x[i + j]; }
- else { w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1); }
- t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
- safe_add(safe_add(e, w[j]), sha1_kt(j)));
- e = d;
- d = c;
- c = rol(b, 30);
- b = a;
- a = t;
- }
-
- a = safe_add(a, olda);
- b = safe_add(b, oldb);
- c = safe_add(c, oldc);
- d = safe_add(d, oldd);
- e = safe_add(e, olde);
- }
- return [a, b, c, d, e];
-}
-
-/*
- * Perform the appropriate triplet combination function for the current
- * iteration
- */
-function sha1_ft(t, b, c, d)
-{
- if (t < 20) { return (b & c) | ((~b) & d); }
- if (t < 40) { return b ^ c ^ d; }
- if (t < 60) { return (b & c) | (b & d) | (c & d); }
- return b ^ c ^ d;
-}
-
-/*
- * Determine the appropriate additive constant for the current iteration
- */
-function sha1_kt(t)
-{
- return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :
- (t < 60) ? -1894007588 : -899497514;
-}
-
-/*
- * Calculate the HMAC-SHA1 of a key and some data
- */
-function core_hmac_sha1(key, data)
-{
- var bkey = str2binb(key);
- if (bkey.length > 16) { bkey = core_sha1(bkey, key.length * chrsz); }
-
- var ipad = new Array(16), opad = new Array(16);
- for (var i = 0; i < 16; i++)
- {
- ipad[i] = bkey[i] ^ 0x36363636;
- opad[i] = bkey[i] ^ 0x5C5C5C5C;
- }
-
- var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
- return core_sha1(opad.concat(hash), 512 + 160);
-}
-
-/*
- * Add integers, wrapping at 2^32. This uses 16-bit operations internally
- * to work around bugs in some JS interpreters.
- */
-function safe_add(x, y)
-{
- var lsw = (x & 0xFFFF) + (y & 0xFFFF);
- var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
- return (msw << 16) | (lsw & 0xFFFF);
-}
-
-/*
- * Bitwise rotate a 32-bit number to the left.
- */
-function rol(num, cnt)
-{
- return (num << cnt) | (num >>> (32 - cnt));
-}
-
-/*
- * Convert an 8-bit or 16-bit string to an array of big-endian words
- * In 8-bit function, characters >255 have their hi-byte silently ignored.
- */
-function str2binb(str)
-{
- var bin = [];
- var mask = (1 << chrsz) - 1;
- for (var i = 0; i < str.length * chrsz; i += chrsz)
- {
- bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32);
- }
- return bin;
-}
-
-/*
- * Convert an array of big-endian words to a string
- */
-function binb2str(bin)
-{
- var str = "";
- var mask = (1 << chrsz) - 1;
- for (var i = 0; i < bin.length * 32; i += chrsz)
- {
- str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask);
- }
- return str;
-}
-
-/*
- * Convert an array of big-endian words to a hex string.
- */
-function binb2hex(binarray)
-{
- var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
- var str = "";
- for (var i = 0; i < binarray.length * 4; i++)
- {
- str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
- hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);
- }
- return str;
-}
-
-/*
- * Convert an array of big-endian words to a base-64 string
- */
-function binb2b64(binarray)
-{
- var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- var str = "";
- var triplet, j;
- for (var i = 0; i < binarray.length * 4; i += 3)
- {
- triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16) |
- (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 ) |
- ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
- for (j = 0; j < 4; j++)
- {
- if (i * 8 + j * 6 > binarray.length * 32) { str += b64pad; }
- else { str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); }
- }
- }
- return str;
-}
-
-
-/*
- * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
- * Digest Algorithm, as defined in RFC 1321.
- * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
- * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
- * Distributed under the BSD License
- * See http://pajhome.org.uk/crypt/md5 for more info.
- */
-
-/*
- * These are the functions you'll usually want to call
- * They take string arguments and return either hex or base-64 encoded strings
- */
-function hex_md5(s) { return rstr2hex(rstr_md5(str2rstr_utf8(s))); }
-function b64_md5(s) { return rstr2b64(rstr_md5(str2rstr_utf8(s))); }
-function any_md5(s, e) { return rstr2any(rstr_md5(str2rstr_utf8(s)), e); }
-function hex_hmac_md5(k, d)
- { return rstr2hex(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
-function b64_hmac_md5(k, d)
- { return rstr2b64(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
-function any_hmac_md5(k, d, e)
- { return rstr2any(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)), e); }
-
-/*
- * Perform a simple self-test to see if the VM is working
- */
-function md5_vm_test()
-{
- return hex_md5("abc").toLowerCase() == "900150983cd24fb0d6963f7d28e17f72";
-}
-
-/*
- * Calculate the MD5 of a raw string
- */
-function rstr_md5(s)
-{
- return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));
-}
-
-/*
- * Calculate the HMAC-MD5, of a key and some data (raw strings)
- */
-function rstr_hmac_md5(key, data)
-{
- var bkey = rstr2binl(key);
- if(bkey.length > 16) bkey = binl_md5(bkey, key.length * 8);
-
- var ipad = Array(16), opad = Array(16);
- for(var i = 0; i < 16; i++)
- {
- ipad[i] = bkey[i] ^ 0x36363636;
- opad[i] = bkey[i] ^ 0x5C5C5C5C;
- }
-
- var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
- return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));
-}
-
-/*
- * Convert a raw string to a hex string
- */
-function rstr2hex(input)
-{
- try { hexcase } catch(e) { hexcase=0; }
- var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
- var output = "";
- var x;
- for(var i = 0; i < input.length; i++)
- {
- x = input.charCodeAt(i);
- output += hex_tab.charAt((x >>> 4) & 0x0F)
- + hex_tab.charAt( x & 0x0F);
- }
- return output;
-}
-
-/*
- * Convert a raw string to a base-64 string
- */
-function rstr2b64(input)
-{
- try { b64pad } catch(e) { b64pad=''; }
- var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- var output = "";
- var len = input.length;
- for(var i = 0; i < len; i += 3)
- {
- var triplet = (input.charCodeAt(i) << 16)
- | (i + 1 < len ? input.charCodeAt(i+1) << 8 : 0)
- | (i + 2 < len ? input.charCodeAt(i+2) : 0);
- for(var j = 0; j < 4; j++)
- {
- if(i * 8 + j * 6 > input.length * 8) output += b64pad;
- else output += tab.charAt((triplet >>> 6*(3-j)) & 0x3F);
- }
- }
- return output;
-}
-
-/*
- * Convert a raw string to an arbitrary string encoding
- */
-function rstr2any(input, encoding)
-{
- var divisor = encoding.length;
- var i, j, q, x, quotient;
-
- /* Convert to an array of 16-bit big-endian values, forming the dividend */
- var dividend = Array(Math.ceil(input.length / 2));
- for(i = 0; i < dividend.length; i++)
- {
- dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);
- }
-
- /*
- * Repeatedly perform a long division. The binary array forms the dividend,
- * the length of the encoding is the divisor. Once computed, the quotient
- * forms the dividend for the next step. All remainders are stored for later
- * use.
- */
- var full_length = Math.ceil(input.length * 8 /
- (Math.log(encoding.length) / Math.log(2)));
- var remainders = Array(full_length);
- for(j = 0; j < full_length; j++)
- {
- quotient = Array();
- x = 0;
- for(i = 0; i < dividend.length; i++)
- {
- x = (x << 16) + dividend[i];
- q = Math.floor(x / divisor);
- x -= q * divisor;
- if(quotient.length > 0 || q > 0)
- quotient[quotient.length] = q;
- }
- remainders[j] = x;
- dividend = quotient;
- }
-
- /* Convert the remainders to the output string */
- var output = "";
- for(i = remainders.length - 1; i >= 0; i--)
- output += encoding.charAt(remainders[i]);
-
- return output;
-}
-
-/*
- * Encode a string as utf-8.
- * For efficiency, this assumes the input is valid utf-16.
- */
-function str2rstr_utf8(input)
-{
- var output = "";
- var i = -1;
- var x, y;
-
- while(++i < input.length)
- {
- /* Decode utf-16 surrogate pairs */
- x = input.charCodeAt(i);
- y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;
- if(0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF)
- {
- x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);
- i++;
- }
-
- /* Encode output as utf-8 */
- if(x <= 0x7F)
- output += String.fromCharCode(x);
- else if(x <= 0x7FF)
- output += String.fromCharCode(0xC0 | ((x >>> 6 ) & 0x1F),
- 0x80 | ( x & 0x3F));
- else if(x <= 0xFFFF)
- output += String.fromCharCode(0xE0 | ((x >>> 12) & 0x0F),
- 0x80 | ((x >>> 6 ) & 0x3F),
- 0x80 | ( x & 0x3F));
- else if(x <= 0x1FFFFF)
- output += String.fromCharCode(0xF0 | ((x >>> 18) & 0x07),
- 0x80 | ((x >>> 12) & 0x3F),
- 0x80 | ((x >>> 6 ) & 0x3F),
- 0x80 | ( x & 0x3F));
- }
- return output;
-}
-
-/*
- * Encode a string as utf-16
- */
-function str2rstr_utf16le(input)
-{
- var output = "";
- for(var i = 0; i < input.length; i++)
- output += String.fromCharCode( input.charCodeAt(i) & 0xFF,
- (input.charCodeAt(i) >>> 8) & 0xFF);
- return output;
-}
-
-function str2rstr_utf16be(input)
-{
- var output = "";
- for(var i = 0; i < input.length; i++)
- output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF,
- input.charCodeAt(i) & 0xFF);
- return output;
-}
-
-/*
- * Convert a raw string to an array of little-endian words
- * Characters >255 have their high-byte silently ignored.
- */
-function rstr2binl(input)
-{
- var output = Array(input.length >> 2);
- for(var i = 0; i < output.length; i++)
- output[i] = 0;
- for(var i = 0; i < input.length * 8; i += 8)
- output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);
- return output;
-}
-
-/*
- * Convert an array of little-endian words to a string
- */
-function binl2rstr(input)
-{
- var output = "";
- for(var i = 0; i < input.length * 32; i += 8)
- output += String.fromCharCode((input[i>>5] >>> (i % 32)) & 0xFF);
- return output;
-}
-
-/*
- * Calculate the MD5 of an array of little-endian words, and a bit length.
- */
-function binl_md5(x, len)
-{
- /* append padding */
- x[len >> 5] |= 0x80 << ((len) % 32);
- x[(((len + 64) >>> 9) << 4) + 14] = len;
-
- var a = 1732584193;
- var b = -271733879;
- var c = -1732584194;
- var d = 271733878;
-
- for(var i = 0; i < x.length; i += 16)
- {
- var olda = a;
- var oldb = b;
- var oldc = c;
- var oldd = d;
-
- a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
- d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
- c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
- b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
- a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
- d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
- c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
- b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
- a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
- d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
- c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
- b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
- a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
- d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
- c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
- b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
-
- a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
- d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
- c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
- b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
- a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
- d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
- c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
- b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
- a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
- d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
- c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
- b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
- a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
- d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
- c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
- b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
-
- a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
- d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
- c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
- b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
- a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
- d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
- c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
- b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
- a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
- d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
- c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
- b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
- a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
- d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
- c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
- b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
-
- a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
- d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
- c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
- b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
- a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
- d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
- c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
- b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
- a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
- d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
- c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
- b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
- a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
- d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
- c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
- b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
-
- a = safe_add(a, olda);
- b = safe_add(b, oldb);
- c = safe_add(c, oldc);
- d = safe_add(d, oldd);
- }
- return Array(a, b, c, d);
-}
-
-/*
- * These functions implement the four basic operations the algorithm uses.
- */
-function md5_cmn(q, a, b, x, s, t)
-{
- return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
-}
-function md5_ff(a, b, c, d, x, s, t)
-{
- return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
-}
-function md5_gg(a, b, c, d, x, s, t)
-{
- return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
-}
-function md5_hh(a, b, c, d, x, s, t)
-{
- return md5_cmn(b ^ c ^ d, a, b, x, s, t);
-}
-function md5_ii(a, b, c, d, x, s, t)
-{
- return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
-}
-
-/*
- * Add integers, wrapping at 2^32. This uses 16-bit operations internally
- * to work around bugs in some JS interpreters.
- */
-function safe_add(x, y)
-{
- var lsw = (x & 0xFFFF) + (y & 0xFFFF);
- var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
- return (msw << 16) | (lsw & 0xFFFF);
-}
-
-/*
- * Bitwise rotate a 32-bit number to the left.
- */
-function bit_rol(num, cnt)
-{
- return (num << cnt) | (num >>> (32 - cnt));
-}
-
-
-/* #############################################################################
- UTF-8 Decoder and Encoder
- base64 Encoder and Decoder
- written by Tobias Kieslich, justdreams
- Contact: tobias@justdreams.de http://www.justdreams.de/
- ############################################################################# */
-
-// returns an array of byterepresenting dezimal numbers which represent the
-// plaintext in an UTF-8 encoded version. Expects a string.
-// This function includes an exception management for those nasty browsers like
-// NN401, which returns negative decimal numbers for chars>128. I hate it!!
-// This handling is unfortunately limited to the user's charset. Anyway, it works
-// in most of the cases! Special signs with an unicode>256 return numbers, which
-// can not be converted to the actual unicode and so not to the valid utf-8
-// representation. Anyway, this function does always return values which can not
-// misinterpretd by RC4 or base64 en- or decoding, because every value is >0 and
-// <255!!
-// Arrays are faster and easier to handle in b64 encoding or encrypting....
-function utf8t2d(t)
-{
- t = t.replace(/\r\n/g,"\n");
- var d=new Array; var test=String.fromCharCode(237);
- if (test.charCodeAt(0) < 0)
- for(var n=0; n
0)
- d[d.length]= c;
- else {
- d[d.length]= (((256+c)>>6)|192);
- d[d.length]= (((256+c)&63)|128);}
- }
- else
- for(var n=0; n 1byte
- if (c<128)
- d[d.length]= c;
- // all the signs between 127 and 2047 => 2byte
- else if((c>127) && (c<2048)) {
- d[d.length]= ((c>>6)|192);
- d[d.length]= ((c&63)|128);}
- // all the signs between 2048 and 66536 => 3byte
- else {
- d[d.length]= ((c>>12)|224);
- d[d.length]= (((c>>6)&63)|128);
- d[d.length]= ((c&63)|128);}
- }
- return d;
-}
-
-// returns plaintext from an array of bytesrepresenting dezimal numbers, which
-// represent an UTF-8 encoded text; browser which does not understand unicode
-// like NN401 will show "?"-signs instead
-// expects an array of byterepresenting decimals; returns a string
-function utf8d2t(d)
-{
- var r=new Array; var i=0;
- while(i191) && (d[i]<224)) {
- r[r.length]= String.fromCharCode(((d[i]&31)<<6) | (d[i+1]&63)); i+=2;}
- else {
- r[r.length]= String.fromCharCode(((d[i]&15)<<12) | ((d[i+1]&63)<<6) | (d[i+2]&63)); i+=3;}
- }
- return r.join("");
-}
-
-// included in it creates two arrays which makes base64
-// en- and decoding faster
-// this speed is noticeable especially when coding larger texts (>5k or so)
-function b64arrays() {
- var b64s='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
- b64 = new Array();f64 =new Array();
- for (var i=0; i>2];
- r[r.length] = b64[((d[i]&3)<<4) | (d[i+1]>>4)];
- r[r.length] = b64[((d[i+1]&15)<<2) | (d[i+2]>>6)];
- r[r.length] = b64[d[i+2]&63];
- i+=3;
- }
- // this is again for the padding
- if ((dl%3) == 1)
- r[r.length-1] = r[r.length-2] = "=";
- if ((dl%3) == 2)
- r[r.length-1] = "=";
- // we join the array to return a textstring
- var t=r.join("");
- return t;
-}
-
-// returns array of byterepresenting numbers created of an base64 encoded text
-// it is still the slowest function in this modul; I hope I can make it faster
-// expects string; returns an array
-function b64t2d(t) {
- var d=new Array; var i=0;
- // here we fix this CRLF sequenz created by MS-OS; arrrgh!!!
- t=t.replace(/\n|\r/g,""); t=t.replace(/=/g,"");
- while (i>4);
- d[d.length] = (((f64[t.charAt(i+1)]&15)<<4) | (f64[t.charAt(i+2)]>>2));
- d[d.length] = (((f64[t.charAt(i+2)]&3)<<6) | (f64[t.charAt(i+3)]));
- i+=4;
- }
- if (t.length%4 == 2)
- d = d.slice(0, d.length-2);
- if (t.length%4 == 3)
- d = d.slice(0, d.length-1);
- return d;
-}
-
-if (typeof(atob) == 'undefined' || typeof(btoa) == 'undefined')
- b64arrays();
-
-if (typeof(atob) == 'undefined') {
- b64decode = function(s) {
- return utf8d2t(b64t2d(s));
- }
-} else {
- b64decode = function(s) {
- return decodeURIComponent(escape(atob(s)));
- }
-}
-
-if (typeof(btoa) == 'undefined') {
- b64encode = function(s) {
- return b64d2t(utf8t2d(s));
- }
-} else {
- b64encode = function(s) {
- return btoa(unescape(encodeURIComponent(s)));
- }
-}
-
-function cnonce(size) {
- var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
- var cnonce = '';
- for (var i=0; i','@'];
-
-/**
- * Creates a new JSJaCJID object
- * @class JSJaCJID models xmpp jid objects
- * @constructor
- * @param {Object} jid jid may be either of type String or a JID represented
- * by JSON with fields 'node', 'domain' and 'resource'
- * @throws JSJaCJIDInvalidException Thrown if jid is not valid
- * @return a new JSJaCJID object
- */
-function JSJaCJID(jid) {
- /**
- *@private
- */
- this._node = '';
- /**
- *@private
- */
- this._domain = '';
- /**
- *@private
- */
- this._resource = '';
-
- if (typeof(jid) == 'string') {
- if (jid.indexOf('@') != -1) {
- this.setNode(jid.substring(0,jid.indexOf('@')));
- jid = jid.substring(jid.indexOf('@')+1);
- }
- if (jid.indexOf('/') != -1) {
- this.setResource(jid.substring(jid.indexOf('/')+1));
- jid = jid.substring(0,jid.indexOf('/'));
- }
- this.setDomain(jid);
- } else {
- this.setNode(jid.node);
- this.setDomain(jid.domain);
- this.setResource(jid.resource);
- }
-}
-
-
-/**
- * Gets the node part of the jid
- * @return A string representing the node name
- * @type String
- */
-JSJaCJID.prototype.getNode = function() { return this._node; };
-
-/**
- * Gets the domain part of the jid
- * @return A string representing the domain name
- * @type String
- */
-JSJaCJID.prototype.getDomain = function() { return this._domain; };
-
-/**
- * Gets the resource part of the jid
- * @return A string representing the resource
- * @type String
- */
-JSJaCJID.prototype.getResource = function() { return this._resource; };
-
-
-/**
- * Sets the node part of the jid
- * @param {String} node Name of the node
- * @throws JSJaCJIDInvalidException Thrown if node name contains invalid chars
- * @return This object
- * @type JSJaCJID
- */
-JSJaCJID.prototype.setNode = function(node) {
- JSJaCJID._checkNodeName(node);
- this._node = node || '';
- return this;
-};
-
-/**
- * Sets the domain part of the jid
- * @param {String} domain Name of the domain
- * @throws JSJaCJIDInvalidException Thrown if domain name contains invalid
- * chars or is empty
- * @return This object
- * @type JSJaCJID
- */
-JSJaCJID.prototype.setDomain = function(domain) {
- if (!domain || domain == '')
- throw new JSJaCJIDInvalidException("domain name missing");
- // chars forbidden for a node are not allowed in domain names
- // anyway, so let's check
- JSJaCJID._checkNodeName(domain);
- this._domain = domain;
- return this;
-};
-
-/**
- * Sets the resource part of the jid
- * @param {String} resource Name of the resource
- * @return This object
- * @type JSJaCJID
- */
-JSJaCJID.prototype.setResource = function(resource) {
- this._resource = resource || '';
- return this;
-};
-
-/**
- * The string representation of the full jid
- * @return A string representing the jid
- * @type String
- */
-JSJaCJID.prototype.toString = function() {
- var jid = '';
- if (this.getNode() && this.getNode() != '')
- jid = this.getNode() + '@';
- jid += this.getDomain(); // we always have a domain
- if (this.getResource() && this.getResource() != "")
- jid += '/' + this.getResource();
- return jid;
-};
-
-/**
- * Removes the resource part of the jid
- * @return This object
- * @type JSJaCJID
- */
-JSJaCJID.prototype.removeResource = function() {
- return this.setResource();
-};
-
-/**
- * creates a copy of this JSJaCJID object
- * @return A copy of this
- * @type JSJaCJID
- */
-JSJaCJID.prototype.clone = function() {
- return new JSJaCJID(this.toString());
-};
-
-/**
- * Compares two jids if they belong to the same entity (i.e. w/o resource)
- * @param {String} jid a jid as string or JSJaCJID object
- * @return 'true' if jid is same entity as this
- * @type Boolean
- */
-JSJaCJID.prototype.isEntity = function(jid) {
- if (typeof jid == 'string')
- jid = (new JSJaCJID(jid));
- jid.removeResource();
- return (this.clone().removeResource().toString() === jid.toString());
-};
-
-/**
- * Check if node name is valid
- * @private
- * @param {String} node A name for a node
- * @throws JSJaCJIDInvalidException Thrown if name for node is not allowed
- */
-JSJaCJID._checkNodeName = function(nodeprep) {
- if (!nodeprep || nodeprep == '')
- return;
- for (var i=0; i< JSJACJID_FORBIDDEN.length; i++) {
- if (nodeprep.indexOf(JSJACJID_FORBIDDEN[i]) != -1) {
- throw new JSJaCJIDInvalidException("forbidden char in nodename: "+JSJACJID_FORBIDDEN[i]);
- }
- }
-};
-
-/**
- * Creates a new Exception of type JSJaCJIDInvalidException
- * @class Exception to indicate invalid values for a jid
- * @constructor
- * @param {String} message The message associated with this Exception
- */
-function JSJaCJIDInvalidException(message) {
- /**
- * The exceptions associated message
- * @type String
- */
- this.message = message;
- /**
- * The name of the exception
- * @type String
- */
- this.name = "JSJaCJIDInvalidException";
-}
-
-
-/* Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-/**
- * @private
- * This code is taken from {@link
- * http://wiki.script.aculo.us/scriptaculous/show/Builder
- * script.aculo.us' Dom Builder} and has been modified to suit our
- * needs.
- * The original parts of the code do have the following
- * copyright and license notice:
- * Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us,
- * http://mir.acu lo.us)
- * script.aculo.us is freely distributable under the terms of an
- * MIT-style license.
- * For details, see the script.aculo.us web site:
- * http://script.aculo.us/
- */
-var JSJaCBuilder = {
- /**
- * @private
- */
- buildNode: function(doc, elementName) {
-
- var element, ns = arguments[4];
-
- // attributes (or text)
- if(arguments[2])
- if(JSJaCBuilder._isStringOrNumber(arguments[2]) ||
- (arguments[2] instanceof Array)) {
- element = this._createElement(doc, elementName, ns);
- JSJaCBuilder._children(doc, element, arguments[2]);
- } else {
- ns = arguments[2]['xmlns'] || ns;
- element = this._createElement(doc, elementName, ns);
- for(attr in arguments[2]) {
- if (arguments[2].hasOwnProperty(attr) && attr != 'xmlns')
- element.setAttribute(attr, arguments[2][attr]);
- }
- }
- else
- element = this._createElement(doc, elementName, ns);
- // text, or array of children
- if(arguments[3])
- JSJaCBuilder._children(doc, element, arguments[3], ns);
-
- return element;
- },
-
- _createElement: function(doc, elementName, ns) {
- try {
- if (ns)
- return doc.createElementNS(ns, elementName);
- } catch (ex) { }
-
- var el = doc.createElement(elementName);
-
- if (ns)
- el.setAttribute("xmlns", ns);
-
- return el;
- },
-
- /**
- * @private
- */
- _text: function(doc, text) {
- return doc.createTextNode(text);
- },
-
- /**
- * @private
- */
- _children: function(doc, element, children, ns) {
- if(typeof children=='object') { // array can hold nodes and text
- for (var i in children) {
- if (children.hasOwnProperty(i)) {
- var e = children[i];
- if (typeof e=='object') {
- if (e instanceof Array) {
- var node = JSJaCBuilder.buildNode(doc, e[0], e[1], e[2], ns);
- element.appendChild(node);
- } else {
- element.appendChild(e);
- }
- } else {
- if(JSJaCBuilder._isStringOrNumber(e)) {
- element.appendChild(JSJaCBuilder._text(doc, e));
- }
- }
- }
- }
- } else {
- if(JSJaCBuilder._isStringOrNumber(children)) {
- element.appendChild(JSJaCBuilder._text(doc, children));
- }
- }
- },
-
- _attributes: function(attributes) {
- var attrs = [];
- for(attribute in attributes)
- if (attributes.hasOwnProperty(attribute))
- attrs.push(attribute +
- '="' + attributes[attribute].toString().htmlEnc() + '"');
- return attrs.join(" ");
- },
-
- _isStringOrNumber: function(param) {
- return(typeof param=='string' || typeof param=='number');
- }
-};
-
-
-/**
- * @fileoverview Contains all Jabber/XMPP packet related classes.
- * @author Stefan Strigler steve@zeank.in-berlin.de
- * @version 1.3
- */
-
-var JSJACPACKET_USE_XMLNS = true;
-
-/**
- * Creates a new packet with given root tag name (for internal use)
- * @class Somewhat abstract base class for all kinds of specialised packets
- * @param {String} name The root tag name of the packet
- * (i.e. one of 'message', 'iq' or 'presence')
- */
-function JSJaCPacket(name) {
- /**
- * @private
- */
- this.name = name;
-
- if (typeof(JSJACPACKET_USE_XMLNS) != 'undefined' && JSJACPACKET_USE_XMLNS)
- /**
- * @private
- */
- this.doc = XmlDocument.create(name,'jabber:client');
- else
- /**
- * @private
- */
- this.doc = XmlDocument.create(name,'');
-}
-
-/**
- * Gets the type (name of root element) of this packet, i.e. one of
- * 'presence', 'message' or 'iq'
- * @return the top level tag name
- * @type String
- */
-JSJaCPacket.prototype.pType = function() { return this.name; };
-
-/**
- * Gets the associated Document for this packet.
- * @type {@link http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#i-Document Document}
- */
-JSJaCPacket.prototype.getDoc = function() {
- return this.doc;
-};
-/**
- * Gets the root node of this packet
- * @type {@link http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247 Node}
- */
-JSJaCPacket.prototype.getNode = function() {
- if (this.getDoc() && this.getDoc().documentElement)
- return this.getDoc().documentElement;
- else
- return null;
-};
-
-/**
- * Sets the 'to' attribute of the root node of this packet
- * @param {String} to
- * @type JSJaCPacket
- */
-JSJaCPacket.prototype.setTo = function(to) {
- if (!to || to == '')
- this.getNode().removeAttribute('to');
- else if (typeof(to) == 'string')
- this.getNode().setAttribute('to',to);
- else
- this.getNode().setAttribute('to',to.toString());
- return this;
-};
-/**
- * Sets the 'from' attribute of the root node of this
- * packet. Usually this is not needed as the server will take care
- * of this automatically.
- * @type JSJaCPacket
- */
-JSJaCPacket.prototype.setFrom = function(from) {
- if (!from || from == '')
- this.getNode().removeAttribute('from');
- else if (typeof(from) == 'string')
- this.getNode().setAttribute('from',from);
- else
- this.getNode().setAttribute('from',from.toString());
- return this;
-};
-/**
- * Sets 'id' attribute of the root node of this packet.
- * @param {String} id The id of the packet.
- * @type JSJaCPacket
- */
-JSJaCPacket.prototype.setID = function(id) {
- if (!id || id == '')
- this.getNode().removeAttribute('id');
- else
- this.getNode().setAttribute('id',id);
- return this;
-};
-/**
- * Sets the 'type' attribute of the root node of this packet.
- * @param {String} type The type of the packet.
- * @type JSJaCPacket
- */
-JSJaCPacket.prototype.setType = function(type) {
- if (!type || type == '')
- this.getNode().removeAttribute('type');
- else
- this.getNode().setAttribute('type',type);
- return this;
-};
-/**
- * Sets 'xml:lang' for this packet
- * @param {String} xmllang The xml:lang of the packet.
- * @type JSJaCPacket
- */
-JSJaCPacket.prototype.setXMLLang = function(xmllang) {
- // Fix IE bug with xml:lang attribute
-
- // Also due to issues with both BD and jQuery being used, employ a simple regexp since the detection
- // here is very limited.
- if (navigator.appVersion.match(/^.*MSIE (\d)/) || navigator.userAgent.match(/Trident\/(\d+)((\.)(\d+))?/))
- return this;
- if (!xmllang || xmllang == '')
- this.getNode().removeAttribute('xml:lang');
- else
- this.getNode().setAttribute('xml:lang',xmllang);
- return this;
-};
-
-/**
- * Gets the 'to' attribute of this packet
- * @type String
- */
-JSJaCPacket.prototype.getTo = function() {
- return this.getNode().getAttribute('to');
-};
-/**
- * Gets the 'from' attribute of this packet.
- * @type String
- */
-JSJaCPacket.prototype.getFrom = function() {
- return this.getNode().getAttribute('from');
-};
-/**
- * Gets the 'to' attribute of this packet as a JSJaCJID object
- * @type JSJaCJID
- */
-JSJaCPacket.prototype.getToJID = function() {
- return new JSJaCJID(this.getTo());
-};
-/**
- * Gets the 'from' attribute of this packet as a JSJaCJID object
- * @type JSJaCJID
- */
-JSJaCPacket.prototype.getFromJID = function() {
- return new JSJaCJID(this.getFrom());
-};
-/**
- * Gets the 'id' of this packet
- * @type String
- */
-JSJaCPacket.prototype.getID = function() {
- return this.getNode().getAttribute('id');
-};
-/**
- * Gets the 'type' of this packet
- * @type String
- */
-JSJaCPacket.prototype.getType = function() {
- return this.getNode().getAttribute('type');
-};
-/**
- * Gets the 'xml:lang' of this packet
- * @type String
- */
-JSJaCPacket.prototype.getXMLLang = function() {
- return this.getNode().getAttribute('xml:lang');
-};
-/**
- * Gets the 'xmlns' (xml namespace) of the root node of this packet
- * @type String
- */
-JSJaCPacket.prototype.getXMLNS = function() {
- return this.getNode().namespaceURI || this.getNode().getAttribute('xmlns');
-};
-
-/**
- * Gets a child element of this packet. If no params given returns first child.
- * @param {String} name Tagname of child to retrieve. Use '*' to match any tag. [optional]
- * @param {String} ns Namespace of child. Use '*' to match any ns.[optional]
- * @return The child node, null if none found
- * @type {@link http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247 Node}
- */
-JSJaCPacket.prototype.getChild = function(name, ns) {
- if (!this.getNode()) {
- return null;
- }
-
- name = name || '*';
- ns = ns || '*';
-
- if (this.getNode().getElementsByTagNameNS) {
- return this.getNode().getElementsByTagNameNS(ns, name).item(0);
- }
-
- // fallback
- var nodes = this.getNode().getElementsByTagName(name);
- if (ns != '*') {
- for (var i=0; i 0)
- for (var i = 0, il = node.attributes.length;i < il; i++) {
- var attr = node.attributes.item(i);
- if (attr.nodeName == 'xmlns' && newNode.getAttribute('xmlns') != null ) continue;
- if (newNode.setAttributeNS && attr.namespaceURI) {
- newNode.setAttributeNS(attr.namespaceURI,
- attr.nodeName,
- attr.nodeValue);
- } else {
- newNode.setAttribute(attr.nodeName,
- attr.nodeValue);
- }
- }
- /* are we going after children too, and does the node have any? */
- if (allChildren && node.childNodes && node.childNodes.length > 0) {
- for (var i = 0, il = node.childNodes.length; i < il; i++) {
- newNode.appendChild(this._importNode(node.childNodes.item(i), allChildren));
- }
- }
- return newNode;
- break;
- case document.TEXT_NODE:
- case document.CDATA_SECTION_NODE:
- case document.COMMENT_NODE:
- return this.getDoc().createTextNode(node.nodeValue);
- break;
- }
-};
-
-/**
- * Set node value of a child node
- * @private
- */
-JSJaCPacket.prototype._setChildNode = function(nodeName, nodeValue) {
- var aNode = this.getChild(nodeName);
- var tNode = this.getDoc().createTextNode(nodeValue);
- if (aNode)
- try {
- aNode.replaceChild(tNode,aNode.firstChild);
- } catch (e) { }
- else {
- try {
- aNode = this.getDoc().createElementNS(this.getNode().namespaceURI,
- nodeName);
- } catch (ex) {
- aNode = this.getDoc().createElement(nodeName)
- }
- this.getNode().appendChild(aNode);
- aNode.appendChild(tNode);
- }
- return aNode;
-};
-
-/**
- * Builds a node using {@link
- * http://wiki.script.aculo.us/scriptaculous/show/Builder
- * script.aculo.us' Dom Builder} notation.
- * This code is taken from {@link
- * http://wiki.script.aculo.us/scriptaculous/show/Builder
- * script.aculo.us' Dom Builder} and has been modified to suit our
- * needs.
- * The original parts of the code do have the following copyright
- * and license notice:
- * Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us,
- * http://mir.acu lo.us)
- * script.aculo.us is freely distributable under the terms of an
- * MIT-style licen se. // For details, see the script.aculo.us web
- * site: http://script.aculo.us/
- * @author Thomas Fuchs
- * @author Stefan Strigler
- * @return The newly created node
- * @type {@link http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247 Node}
- */
-JSJaCPacket.prototype.buildNode = function(elementName) {
- return JSJaCBuilder.buildNode(this.getDoc(),
- elementName,
- arguments[1],
- arguments[2]);
-};
-
-/**
- * Appends node created by buildNode to this packets parent node.
- * @param {@link http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247 Node} element The node to append or
- * @param {String} element A name plus an object hash with attributes (optional) plus an array of childnodes (optional)
- * @see #buildNode
- * @return This packet
- * @type JSJaCPacket
- */
-JSJaCPacket.prototype.appendNode = function(element) {
- if (typeof element=='object') { // seems to be a prebuilt node
- return this.getNode().appendChild(element)
- } else { // build node
- return this.getNode().appendChild(this.buildNode(element,
- arguments[1],
- arguments[2],
- null,
- this.getNode().namespaceURI));
- }
-};
-
-
-/**
- * A jabber/XMPP presence packet
- * @class Models the XMPP notion of a 'presence' packet
- * @extends JSJaCPacket
- */
-function JSJaCPresence() {
- /**
- * @ignore
- */
- this.base = JSJaCPacket;
- this.base('presence');
-}
-JSJaCPresence.prototype = new JSJaCPacket;
-
-/**
- * Sets the status message for current status. Usually this is set
- * to some human readable string indicating what the user is
- * doing/feel like currently.
- * @param {String} status A status message
- * @return this
- * @type JSJaCPacket
- */
-JSJaCPresence.prototype.setStatus = function(status) {
- this._setChildNode("status", status);
- return this;
-};
-/**
- * Sets the online status for this presence packet.
- * @param {String} show An XMPP complient status indicator. Must
- * be one of 'chat', 'away', 'xa', 'dnd'
- * @return this
- * @type JSJaCPacket
- */
-JSJaCPresence.prototype.setShow = function(show) {
- if (show == 'chat' || show == 'away' || show == 'xa' || show == 'dnd')
- this._setChildNode("show",show);
- return this;
-};
-/**
- * Sets the priority of the resource bind to with this connection
- * @param {int} prio The priority to set this resource to
- * @return this
- * @type JSJaCPacket
- */
-JSJaCPresence.prototype.setPriority = function(prio) {
- this._setChildNode("priority", prio);
- return this;
-};
-/**
- * Some combined method that allowes for setting show, status and
- * priority at once
- * @param {String} show A status message
- * @param {String} status A status indicator as defined by XMPP
- * @param {int} prio A priority for this resource
- * @return this
- * @type JSJaCPacket
- */
-JSJaCPresence.prototype.setPresence = function(show,status,prio) {
- if (show)
- this.setShow(show);
- if (status)
- this.setStatus(status);
- if (prio)
- this.setPriority(prio);
- return this;
-};
-
-/**
- * Gets the status message of this presence
- * @return The (human readable) status message
- * @type String
- */
-JSJaCPresence.prototype.getStatus = function() {
- return this.getChildVal('status');
-};
-/**
- * Gets the status of this presence.
- * Either one of 'chat', 'away', 'xa' or 'dnd' or null.
- * @return The status indicator as defined by XMPP
- * @type String
- */
-JSJaCPresence.prototype.getShow = function() {
- return this.getChildVal('show');
-};
-/**
- * Gets the priority of this status message
- * @return A resource priority
- * @type int
- */
-JSJaCPresence.prototype.getPriority = function() {
- return this.getChildVal('priority');
-};
-
-
-/**
- * A jabber/XMPP iq packet
- * @class Models the XMPP notion of an 'iq' packet
- * @extends JSJaCPacket
- */
-function JSJaCIQ() {
- /**
- * @ignore
- */
- this.base = JSJaCPacket;
- this.base('iq');
-}
-JSJaCIQ.prototype = new JSJaCPacket;
-
-/**
- * Some combined method to set 'to', 'type' and 'id' at once
- * @param {String} to the recepients JID
- * @param {String} type A XMPP compliant iq type (one of 'set', 'get', 'result' and 'error'
- * @param {String} id A packet ID
- * @return this
- * @type JSJaCIQ
- */
-JSJaCIQ.prototype.setIQ = function(to,type,id) {
- if (to)
- this.setTo(to);
- if (type)
- this.setType(type);
- if (id)
- this.setID(id);
- return this;
-};
-/**
- * Creates a 'query' child node with given XMLNS
- * @param {String} xmlns The namespace for the 'query' node
- * @return The query node
- * @type {@link http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247 Node}
- */
-JSJaCIQ.prototype.setQuery = function(xmlns) {
- var query;
- try {
- query = this.getDoc().createElementNS(xmlns,'query');
- } catch (e) {
- query = this.getDoc().createElement('query');
- query.setAttribute('xmlns',xmlns);
- }
- this.getNode().appendChild(query);
- return query;
-};
-
-/**
- * Gets the 'query' node of this packet
- * @return The query node
- * @type {@link http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247 Node}
- */
-JSJaCIQ.prototype.getQuery = function() {
- return this.getNode().getElementsByTagName('query').item(0);
-};
-/**
- * Gets the XMLNS of the query node contained within this packet
- * @return The namespace of the query node
- * @type String
- */
-JSJaCIQ.prototype.getQueryXMLNS = function() {
- if (this.getQuery()) {
- return this.getQuery().namespaceURI || this.getQuery().getAttribute('xmlns');
- } else {
- return null;
- }
-};
-
-/**
- * Creates an IQ reply with type set to 'result'. If given appends payload to first child if IQ. Payload maybe XML as string or a DOM element (or an array of such elements as well).
- * @param {Element} payload A payload to be appended [optional]
- * @return An IQ reply packet
- * @type JSJaCIQ
- */
-JSJaCIQ.prototype.reply = function(payload) {
- var rIQ = this.clone();
- rIQ.setTo(this.getFrom());
- rIQ.setFrom();
- rIQ.setType('result');
- if (payload) {
- if (typeof payload == 'string')
- rIQ.getChild().appendChild(rIQ.getDoc().loadXML(payload));
- else if (payload.constructor == Array) {
- var node = rIQ.getChild();
- for (var i=0; inull is being returned.
- * @type JSJaCPacket
- */
-JSJaCPacket.wrapNode = function(node) {
- var oPacket = null;
-
- switch (node.nodeName.toLowerCase()) {
- case 'presence':
- oPacket = new JSJaCPresence();
- break;
- case 'message':
- oPacket = new JSJaCMessage();
- break;
- case 'iq':
- oPacket = new JSJaCIQ();
- break;
- }
-
- if (oPacket) {
- oPacket.getDoc().replaceChild(oPacket._importNode(node, true),
- oPacket.getNode());
- }
-
- return oPacket;
-};
-
-
-
-/**
- * an error packet for internal use
- * @private
- * @constructor
- */
-function JSJaCError(code,type,condition) {
- var xmldoc = XmlDocument.create("error","jsjac");
-
- xmldoc.documentElement.setAttribute('code',code);
- xmldoc.documentElement.setAttribute('type',type);
- if (condition)
- xmldoc.documentElement.appendChild(xmldoc.createElement(condition)).
- setAttribute('xmlns','urn:ietf:params:xml:ns:xmpp-stanzas');
- return xmldoc.documentElement;
-}
-
-
-
-/**
- * Creates a new set of hash keys
- * @class Reflects a set of sha1/md5 hash keys for securing sessions
- * @constructor
- * @param {Function} func The hash function to be used for creating the keys
- * @param {Debugger} oDbg Reference to debugger implementation [optional]
- */
-function JSJaCKeys(func,oDbg) {
- var seed = Math.random();
-
- /**
- * @private
- */
- this._k = new Array();
- this._k[0] = seed.toString();
- if (oDbg)
- /**
- * Reference to Debugger
- * @type Debugger
- */
- this.oDbg = oDbg;
- else {
- this.oDbg = {};
- this.oDbg.log = function() {};
- }
-
- if (func) {
- for (var i=1; itrue if there's only one key left, false otherwise
- * @type boolean
- */
- this.lastKey = function() { return (this._indexAt == 0); };
- /**
- * Returns number of overall/initial stack size
- * @return Number of keys created
- * @type int
- */
- this.size = function() { return this._k.length; };
-
- /**
- * @private
- */
- this._getSuspendVars = function() {
- return ('_k,_indexAt').split(',');
- }
-}
-
-
-/**
- * @fileoverview Contains all things in common for all subtypes of connections
- * supported.
- * @author Stefan Strigler steve@zeank.in-berlin.de
- * @version 1.3
- */
-
-/**
- * Creates a new Jabber connection (a connection to a jabber server)
- * @class Somewhat abstract base class for jabber connections. Contains all
- * of the code in common for all jabber connections
- * @constructor
- * @param {JSON http://www.json.org/index} oArg JSON with properties:
- * * httpbase
the http base address of the service to be used for
- * connecting to jabber
- * * oDbg
(optional) a reference to a debugger interface
- */
-function JSJaCConnection(oArg) {
-
- if (oArg && oArg.oDbg && oArg.oDbg.log) {
- /**
- * Reference to debugger interface
- * (needs to implement method log
)
- * @type Debugger
- */
- this.oDbg = oArg.oDbg;
- } else {
- this.oDbg = new Object(); // always initialise a debugger
- this.oDbg.log = function() { };
- }
-
- if (oArg && oArg.timerval)
- this.setPollInterval(oArg.timerval);
- else
- this.setPollInterval(JSJAC_TIMERVAL);
-
- if (oArg && oArg.httpbase)
- /**
- * @private
- */
- this._httpbase = oArg.httpbase;
-
- if (oArg &&oArg.allow_plain)
- /**
- * @private
- */
- this.allow_plain = oArg.allow_plain;
- else
- this.allow_plain = JSJAC_ALLOW_PLAIN;
-
- if (oArg && oArg.cookie_prefix)
- /**
- * @private
- */
- this._cookie_prefix = oArg.cookie_prefix;
- else
- this._cookie_prefix = "";
-
- /**
- * @private
- */
- this._connected = false;
- /**
- * @private
- */
- this._events = new Array();
- /**
- * @private
- */
- this._keys = null;
- /**
- * @private
- */
- this._ID = 0;
- /**
- * @private
- */
- this._inQ = new Array();
- /**
- * @private
- */
- this._pQueue = new Array();
- /**
- * @private
- */
- this._regIDs = new Array();
- /**
- * @private
- */
- this._req = new Array();
- /**
- * @private
- */
- this._status = 'intialized';
- /**
- * @private
- */
- this._errcnt = 0;
- /**
- * @private
- */
- this._inactivity = JSJAC_INACTIVITY;
- /**
- * @private
- */
- this._sendRawCallbacks = new Array();
-}
-
-// Generates an ID
-var STANZA_ID = 1;
-
-function genID() {
- return STANZA_ID++;
-}
-
-JSJaCConnection.prototype.connect = function(oArg) {
- this._setStatus('connecting');
-
- this.domain = oArg.domain || 'localhost';
- this.username = oArg.username;
- this.resource = oArg.resource;
- this.pass = oArg.pass;
- this.register = oArg.register;
-
- this.authhost = oArg.authhost || this.domain;
- this.authtype = oArg.authtype || 'sasl';
-
- if (oArg.xmllang && oArg.xmllang != '')
- this._xmllang = oArg.xmllang;
- else
- this._xmllang = 'en';
-
- this.host = oArg.host || this.domain;
- this.port = oArg.port || 5222;
- if (oArg.secure)
- this.secure = 'true';
- else
- this.secure = 'false';
-
- if (oArg.wait)
- this._wait = oArg.wait;
-
- this.jid = this.username + '@' + this.domain;
- this.fulljid = this.jid + '/' + this.resource;
-
- this._rid = Math.round( 100000.5 + ( ( (900000.49999) - (100000.5) ) * Math.random() ) );
-
- // setupRequest must be done after rid is created but before first use in reqstr
- var slot = this._getFreeSlot();
- this._req[slot] = this._setupRequest(true);
-
- var reqstr = this._getInitialRequestString();
-
- this.oDbg.log(reqstr,4);
-
- this._req[slot].r.onreadystatechange =
- JSJaC.bind(function() {
- var r = this._req[slot].r;
- if (r.readyState == 4) {
- this.oDbg.log("async recv: "+r.responseText,4);
- this._handleInitialResponse(r); // handle response
- }
- }, this);
-
- if (typeof(this._req[slot].r.onerror) != 'undefined') {
- this._req[slot].r.onerror =
- JSJaC.bind(function(e) {
- this.oDbg.log('XmlHttpRequest error',1);
- return false;
- }, this);
- }
-
- this._req[slot].r.send(reqstr);
-};
-
-/**
- * Tells whether this connection is connected
- * @return true
if this connections is connected,
- * false
otherwise
- * @type boolean
- */
-JSJaCConnection.prototype.connected = function() { return this._connected; };
-
-/**
- * Disconnects from jabber server and terminates session (if applicable)
- */
-JSJaCConnection.prototype.disconnect = function() {
- this._setStatus('disconnecting');
-
- if (!this.connected())
- return;
- this._connected = false;
-
- clearInterval(this._interval);
- clearInterval(this._inQto);
-
- if (this._timeout)
- clearTimeout(this._timeout); // remove timer
-
- var slot = this._getFreeSlot();
- // Intentionally synchronous
- this._req[slot] = this._setupRequest(false);
-
- request = this._getRequestString(false, true);
-
- this.oDbg.log("Disconnecting: " + request,4);
- this._req[slot].r.send(request);
-
- try {
- DataStore.removeDB(MINI_HASH, 'jsjac', 'state');
- } catch (e) {}
-
- this.oDbg.log("Disconnected: "+this._req[slot].r.responseText,2);
- this._handleEvent('ondisconnect');
-};
-
-/**
- * Gets current value of polling interval
- * @return Polling interval in milliseconds
- * @type int
- */
-JSJaCConnection.prototype.getPollInterval = function() {
- return this._timerval;
-};
-
-/**
- * Registers an event handler (callback) for this connection.
-
- * Note: All of the packet handlers for specific packets (like
- * message_in, presence_in and iq_in) fire only if there's no
- * callback associated with the id.
-
- *
Example:
- * con.registerHandler('iq', 'query', 'jabber:iq:version', handleIqVersion);
-
-
- * @param {String} event One of
-
- *
- * onConnect - connection has been established and authenticated
- * onDisconnect - connection has been disconnected
- * onResume - connection has been resumed
-
- * onStatusChanged - connection status has changed, current
- * status as being passed argument to handler. See {@link #status}.
-
- * onError - an error has occured, error node is supplied as
- * argument, like this:<error code='404' type='cancel'>
- * <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
- * </error>
-
- * packet_in - a packet has been received (argument: the
- * packet)
-
- * packet_out - a packet is to be sent(argument: the
- * packet)
-
- * message_in | message - a message has been received (argument:
- * the packet)
-
- * message_out - a message packet is to be sent (argument: the
- * packet)
-
- * presence_in | presence - a presence has been received
- * (argument: the packet)
-
- * presence_out - a presence packet is to be sent (argument: the
- * packet)
-
- * iq_in | iq - an iq has been received (argument: the packet)
- * iq_out - an iq is to be sent (argument: the packet)
- *
-
- * @param {String} childName A childnode's name that must occur within a
- * retrieved packet [optional]
-
- * @param {String} childNS A childnode's namespace that must occure within
- * a retrieved packet (works only if childName is given) [optional]
-
- * @param {String} type The type of the packet to handle (works only if childName and chidNS are given (both may be set to '*' in order to get skipped) [optional]
-
- * @param {Function} handler The handler to be called when event occurs. If your handler returns 'true' it cancels bubbling of the event. No other registered handlers for this event will be fired.
- */
-JSJaCConnection.prototype.registerHandler = function(event) {
- event = event.toLowerCase(); // don't be case-sensitive here
- var eArg = {handler: arguments[arguments.length-1],
- childName: '*',
- childNS: '*',
- type: '*'};
- if (arguments.length > 2)
- eArg.childName = arguments[1];
- if (arguments.length > 3)
- eArg.childNS = arguments[2];
- if (arguments.length > 4)
- eArg.type = arguments[3];
- if (!this._events[event])
- this._events[event] = new Array(eArg);
- else
- this._events[event] = this._events[event].concat(eArg);
-
- // sort events in order how specific they match criterias thus using
- // wildcard patterns puts them back in queue when it comes to
- // bubbling the event
- this._events[event] =
- this._events[event].sort(function(a,b) {
- var aRank = 0;
- var bRank = 0;
- with (a) {
- if (type == '*')
- aRank++;
- if (childNS == '*')
- aRank++;
- if (childName == '*')
- aRank++;
- }
- with (b) {
- if (type == '*')
- bRank++;
- if (childNS == '*')
- bRank++;
- if (childName == '*')
- bRank++;
- }
- if (aRank > bRank)
- return 1;
- if (aRank < bRank)
- return -1;
- return 0;
- });
- this.oDbg.log("registered handler for event '"+event+"'",2);
-};
-
-JSJaCConnection.prototype.unregisterHandler = function(event,handler) {
- event = event.toLowerCase(); // don't be case-sensitive here
-
- if (!this._events[event])
- return;
-
- var arr = this._events[event], res = new Array();
- for (var i=0; i
- * 'initializing' ... well
- * 'connecting' if connect() was called
- * 'resuming' if resume() was called
- * 'processing' if it's about to operate as normal
- * 'onerror_fallback' if there was an error with the request object
- * 'protoerror_fallback' if there was an error at the http binding protocol flow (most likely that's where you interested in)
- * 'internal_server_error' in case of an internal server error
- * 'suspending' if suspend() is being called
- * 'aborted' if abort() was called
- * 'disconnecting' if disconnect() has been called
- *
- * @type String
- */
-JSJaCConnection.prototype.status = function() { return this._status; };
-
-/**
- * Suspends this connection (saving state for later resume)
- * Saves state to cookie
- * @return Whether suspend (saving to cookie) was successful
- * @type boolean
- */
-JSJaCConnection.prototype.suspend = function(has_pause) {
- var data = this.suspendToData(has_pause);
-
- try {
- var c = DataStore.setDB(MINI_HASH, 'jsjac', 'state', JSJaCJSON.toString(data));
- return c;
- } catch (e) {
- this.oDbg.log("Failed creating cookie '"+this._cookie_prefix+
- "JSJaC_State': "+e.message,1);
- }
- return false;
-};
-
-/**
- * Suspend connection and return serialized JSJaC connection state
- * @return JSJaC connection state object
- * @type Object
- */
-JSJaCConnection.prototype.suspendToData = function(has_pause) {
-
- // remove timers
- if(has_pause) {
- clearTimeout(this._timeout);
- clearInterval(this._interval);
- clearInterval(this._inQto);
-
- this._suspend();
- }
-
- var u = ('_connected,_keys,_ID,_inQ,_pQueue,_regIDs,_errcnt,_inactivity,domain,username,resource,jid,fulljid,_sid,_httpbase,_timerval,_is_polling').split(',');
- u = u.concat(this._getSuspendVars());
- var s = new Object();
-
- for (var i=0; i ",
- this._doSASLAuthDone);
- }
- this.oDbg.log("SASL ANONYMOUS requested but not supported",1);
- } else {
- if (this.mechs['DIGEST-MD5']) {
- this.oDbg.log("SASL using mechanism 'DIGEST-MD5'",2);
- return this._sendRaw(" ",
- this._doSASLAuthDigestMd5S1);
- } else if (this.allow_plain && this.mechs['PLAIN']) {
- this.oDbg.log("SASL using mechanism 'PLAIN'",2);
- var authStr = this.username+'@'+
- this.domain+String.fromCharCode(0)+
- this.username+String.fromCharCode(0)+
- this.pass;
- this.oDbg.log("authenticating with '"+authStr+"'",2);
- authStr = b64encode(authStr);
- return this._sendRaw(""+authStr+" ",
- this._doSASLAuthDone);
- }
- this.oDbg.log("No SASL mechanism applied",1);
- this.authtype = 'nonsasl'; // fallback
- }
- return false;
-};
-
-/**
- * @private
- */
-JSJaCConnection.prototype._doSASLAuthDigestMd5S1 = function(el) {
- if (el.nodeName != "challenge") {
- this.oDbg.log("challenge missing",1);
- this._handleEvent('onerror',JSJaCError('401','auth','not-authorized'));
- this.disconnect();
- } else {
- var challenge = b64decode(el.firstChild.nodeValue);
- this.oDbg.log("got challenge: "+challenge,2);
- this._nonce = challenge.substring(challenge.indexOf("nonce=")+7);
- this._nonce = this._nonce.substring(0,this._nonce.indexOf("\""));
- this.oDbg.log("nonce: "+this._nonce,2);
- if (this._nonce == '' || this._nonce.indexOf('\"') != -1) {
- this.oDbg.log("nonce not valid, aborting",1);
- this.disconnect();
- return;
- }
-
- this._digest_uri = "xmpp/";
- // if (typeof(this.host) != 'undefined' && this.host != '') {
- // this._digest-uri += this.host;
- // if (typeof(this.port) != 'undefined' && this.port)
- // this._digest-uri += ":" + this.port;
- // this._digest-uri += '/';
- // }
- this._digest_uri += this.domain;
-
- this._cnonce = cnonce(14);
-
- this._nc = '00000001';
-
- var X = this.username+':'+this.domain+':'+this.pass;
- var Y = rstr_md5(str2rstr_utf8(X));
-
- var A1 = Y+':'+this._nonce+':'+this._cnonce;
- var HA1 = rstr2hex(rstr_md5(A1));
-
- var A2 = 'AUTHENTICATE:'+this._digest_uri;
- var HA2 = hex_md5(A2);
-
- var response = hex_md5(HA1+':'+this._nonce+':'+this._nc+':'+
- this._cnonce+':auth:'+HA2);
-
- var rPlain = 'username="'+this.username+'",realm="'+this.domain+
- '",nonce="'+this._nonce+'",cnonce="'+this._cnonce+'",nc="'+this._nc+
- '",qop=auth,digest-uri="'+this._digest_uri+'",response="'+response+
- '",charset="utf-8"';
-
- this.oDbg.log("response: "+rPlain,2);
-
- this._sendRaw(""+
- b64encode(rPlain)+" ",
- this._doSASLAuthDigestMd5S2);
- }
-};
-
-/**
- * @private
- */
-JSJaCConnection.prototype._doSASLAuthDigestMd5S2 = function(el) {
- if (el.nodeName == 'failure') {
- if (el.xml)
- this.oDbg.log("auth error: "+el.xml,1);
- else
- this.oDbg.log("auth error",1);
- this._handleEvent('onerror',JSJaCError('401','auth','not-authorized'));
- this.disconnect();
- return;
- }
-
- var response = b64decode(el.firstChild.nodeValue);
- this.oDbg.log("response: "+response,2);
-
- var rspauth = response.substring(response.indexOf("rspauth=")+8);
- this.oDbg.log("rspauth: "+rspauth,2);
-
- var X = this.username+':'+this.domain+':'+this.pass;
- var Y = rstr_md5(str2rstr_utf8(X));
-
- var A1 = Y+':'+this._nonce+':'+this._cnonce;
- var HA1 = rstr2hex(rstr_md5(A1));
-
- var A2 = ':'+this._digest_uri;
- var HA2 = hex_md5(A2);
-
- var rsptest = hex_md5(HA1+':'+this._nonce+':'+this._nc+':'+
- this._cnonce+':auth:'+HA2);
- this.oDbg.log("rsptest: "+rsptest,2);
-
- if (rsptest != rspauth) {
- this.oDbg.log("SASL Digest-MD5: server repsonse with wrong rspauth",1);
- this.disconnect();
- return;
- }
-
- if (el.nodeName == 'success') {
- this._reInitStream(JSJaC.bind(this._doStreamBind, this));
- } else { // some extra turn
- this._sendRaw(" ",
- this._doSASLAuthDone);
- }
-};
-
-/**
- * @private
- */
-JSJaCConnection.prototype._doSASLAuthDone = function (el) {
- if (el.nodeName != 'success') {
- this.oDbg.log("auth failed",1);
- this._handleEvent('onerror',JSJaCError('401','auth','not-authorized'));
- this.disconnect();
- } else {
- this._reInitStream(JSJaC.bind(this._doStreamBind, this));
- }
-};
-
-/**
- * @private
- */
-JSJaCConnection.prototype._doStreamBind = function() {
- var iq = new JSJaCIQ();
- iq.setIQ(null,'set','bind_1');
- iq.appendNode("bind", {xmlns: "urn:ietf:params:xml:ns:xmpp-bind"},
- [["resource", this.resource]]);
- this.oDbg.log(iq.xml());
- this.send(iq,this._doXMPPSess);
-};
-
-/**
- * @private
- */
-JSJaCConnection.prototype._doXMPPSess = function(iq) {
- if (iq.getType() != 'result' || iq.getType() == 'error') { // failed
- this.disconnect();
- if (iq.getType() == 'error')
- this._handleEvent('onerror',iq.getChild('error'));
- return;
- }
-
- this.fulljid = iq.getChildVal("jid");
- this.jid = this.fulljid.substring(0,this.fulljid.lastIndexOf('/'));
-
- if (!this.legacy_sessions) {
- this._handleEvent('onconnect');
- return;
- }
-
- iq = new JSJaCIQ();
- iq.setIQ(null,'set','sess_1');
- iq.appendNode("session", {xmlns: "urn:ietf:params:xml:ns:xmpp-session"},
- []);
- this.oDbg.log(iq.xml());
- this.send(iq,this._doXMPPSessDone);
-};
-
-/**
- * @private
- */
-JSJaCConnection.prototype._doXMPPSessDone = function(iq) {
- if (iq.getType() != 'result' || iq.getType() == 'error') { // failed
- this.disconnect();
- if (iq.getType() == 'error')
- this._handleEvent('onerror',iq.getChild('error'));
- return;
- } else
- this._handleEvent('onconnect');
-};
-
-/**
- * @private
- */
-JSJaCConnection.prototype._handleEvent = function(event,arg) {
- event = event.toLowerCase(); // don't be case-sensitive here
- this.oDbg.log("incoming event '"+event+"'",3);
- if (!this._events[event])
- return;
- this.oDbg.log("handling event '"+event+"'",2);
- for (var i=0;i match for handler "+aEvent.handler,3);
- }
- if (aEvent.handler(arg)) {
- // handled!
- break;
- }
- }
- else
- if (aEvent.handler()) {
- // handled!
- break;
- }
- } catch (e) {
-
- if (e.fileName&&e.lineNumber) {
- this.oDbg.log(aEvent.handler+"\n>>>"+e.name+": "+ e.message+' in '+e.fileName+' line '+e.lineNumber,1);
- } else {
- this.oDbg.log(aEvent.handler+"\n>>>"+e.name+": "+ e.message,1);
- }
-
- }
- }
- }
-};
-
-/**
- * @private
- */
-JSJaCConnection.prototype._handlePID = function(packet) {
- if (!packet.getID())
- return false;
-
- var jid = packet.getFrom() || this.jid;
-
- if (packet.getFrom() == this.domain)
- jid = this.jid;
-
- var id = packet.getID();
- if (this._regIDs[jid] && this._regIDs[jid][id]) {
- try {
- this.oDbg.log("handling id "+id,3);
- var reg = this._regIDs[jid][id];
- if (reg.cb.call(this, packet, reg.arg) === false) {
- // don't unregister
- return false;
- } else {
- delete this._regIDs[jid][id];
- return true;
- }
- } catch (e) {
- // broken handler?
- this.oDbg.log(e.name+": "+ e.message, 1);
- delete this._regIDs[jid][id];
- return true;
- }
- } else {
- this.oDbg.log("not handling id '"+id+"' from jid "+jid, 1);
- }
- return false;
-};
-
-/**
- * @private
- */
-JSJaCConnection.prototype._handleResponse = function(req) {
- var rootEl = this._parseResponse(req);
-
- if (!rootEl)
- return;
-
- for (var i=0; i JSJAC_ERR_COUNT) {
- // abort
- this._abort();
- return false;
- }
-
- this._setStatus('onerror_fallback');
-
- // schedule next tick
- setTimeout(JSJaC.bind(this._resume, this),this.getPollInterval());
- return false;
- }, this);
- } catch(e) { } // well ... no onerror property available, maybe we
- // can catch the error somewhere else ...
-
- var reqstr = this._getRequestString();
-
- if (typeof(this._rid) != 'undefined') // remember request id if any
- this._req[slot].rid = this._rid;
-
- this.oDbg.log("sending: " + reqstr,4);
- this._req[slot].r.send(reqstr);
-};
-
-/**
- * @private
- @param {JSJaCPacket} packet The packet to be sent.
- @param {function} cb The callback to be called when response is received.
- @param {any} arg Optional arguments to be passed to 'cb' when executing it.
- @return Whether registering an ID was successful
- @type boolean
- */
-JSJaCConnection.prototype._registerPID = function(packet, cb, arg) {
- this.oDbg.log("registering id for packet "+packet.xml(), 3);
- var id = packet.getID();
- if (!id) {
- this.oDbg.log("id missing", 1);
- return false;
- }
-
- if (typeof cb != 'function') {
- this.oDbg.log("callback is not a function", 1);
- return false;
- }
-
- var jid = packet.getTo() || this.jid;
-
- if (packet.getTo() == this.domain)
- jid = this.jid;
-
- if (!this._regIDs[jid]) {
- this._regIDs[jid] = {};
- }
-
- if (this._regIDs[jid][id] != null) {
- this.oDbg.log("id already registered: " + id, 1);
- return false;
- }
- this._regIDs[jid][id] = {
- cb: cb,
- arg: arg,
- ts: Date.now()
- };
- this.oDbg.log("registered id "+id,3);
- this._cleanupRegisteredPIDs();
- return true;
-};
-
-/**
- * @private
- */
-JSJaCConnection.prototype._cleanupRegisteredPIDs = function() {
- var now = Date.now();
- for (var jid in this._regIDs) {
- if (this._regIDs.hasOwnProperty(jid)) {
- for (var id in this._regIDs[jid]) {
- if (this._regIDs[jid].hasOwnProperty(id)) {
- if (this._regIDs[jid][id].ts + JSJAC_REGID_TIMEOUT < now) {
- this.oDbg.log("deleting registered id '"+id+ "' due to timeout", 1);
- delete this._regIDs[jid][id];
- }
- }
- }
- }
- }
-};
-
-/**
- * Partial function binding sendEmpty to callback
- * @private
- */
-JSJaCConnection.prototype._prepSendEmpty = function(cb, ctx) {
- return function() {
- ctx._sendEmpty(JSJaC.bind(cb, ctx));
- };
-};
-
-/**
- * send empty request
- * waiting for stream id to be able to proceed with authentication
- * @private
- */
-JSJaCConnection.prototype._sendEmpty = function(cb) {
- var slot = this._getFreeSlot();
- this._req[slot] = this._setupRequest(true);
-
- this._req[slot].r.onreadystatechange =
- JSJaC.bind(function() {
- if (this._req[slot].r.readyState == 4) {
- this.oDbg.log("async recv: "+this._req[slot].r.responseText,4);
- cb(this._req[slot].r); // handle response
- }
- },this);
-
- if (typeof(this._req[slot].r.onerror) != 'undefined') {
- this._req[slot].r.onerror =
- JSJaC.bind(function(e) {
- this.oDbg.log('XmlHttpRequest error',1);
- return false;
- }, this);
- }
-
- var reqstr = this._getRequestString();
- this.oDbg.log("sending: " + reqstr,4);
- this._req[slot].r.send(reqstr);
-};
-
-/**
- * @private
- */
-JSJaCConnection.prototype._sendRaw = function(xml,cb,arg) {
- if (cb)
- this._sendRawCallbacks.push({fn: cb, arg: arg});
-
- this._pQueue.push(xml);
- this._process();
-
- return true;
-};
-
-/**
- * @private
- */
-JSJaCConnection.prototype._setStatus = function(status) {
- if (!status || status == '')
- return;
- if (status != this._status) { // status changed!
- this._status = status;
- this._handleEvent('onstatuschanged', status);
- this._handleEvent('status_changed', status);
- }
-};
-
-
-/**
- * @fileoverview All stuff related to HTTP Binding
- * @author Stefan Strigler steve@zeank.in-berlin.de
- * @version 1.3
- */
-
-/**
- * Instantiates an HTTP Binding session
- * @class Implementation of {@link
- * http://www.xmpp.org/extensions/xep-0206.html XMPP Over BOSH}
- * formerly known as HTTP Binding.
- * @extends JSJaCConnection
- * @constructor
- */
-function JSJaCHttpBindingConnection(oArg) {
- /**
- * @ignore
- */
- this.base = JSJaCConnection;
- this.base(oArg);
-
- // member vars
- /**
- * @private
- */
- this._hold = JSJACHBC_MAX_HOLD;
- /**
- * @private
- */
- this._inactivity = 0;
- /**
- * @private
- */
- this._last_requests = new Object(); // 'hash' storing hold+1 last requests
- /**
- * @private
- */
- this._last_rid = 0; // I know what you did last summer
- /**
- * @private
- */
- this._min_polling = 0;
-
- /**
- * @private
- */
- this._pause = 0;
- /**
- * @private
- */
- this._wait = JSJACHBC_MAX_WAIT;
-}
-JSJaCHttpBindingConnection.prototype = new JSJaCConnection();
-
-/**
- * Inherit an instantiated HTTP Binding session
- */
-JSJaCHttpBindingConnection.prototype.inherit = function(oArg) {
- if (oArg.jid) {
- var oJid = new JSJaCJID(oArg.jid);
- this.domain = oJid.getDomain();
- this.username = oJid.getNode();
- this.resource = oJid.getResource();
- } else {
- this.domain = oArg.domain || 'localhost';
- this.username = oArg.username;
- this.resource = oArg.resource;
- }
- this._sid = oArg.sid;
- this._rid = oArg.rid;
- this._min_polling = oArg.polling;
- this._inactivity = oArg.inactivity;
- this._setHold(oArg.requests-1);
- this.setPollInterval(this._timerval);
- if (oArg.wait)
- this._wait = oArg.wait; // for whatever reason
-
- this._connected = true;
-
- this._handleEvent('onconnect');
-
- this._interval= setInterval(JSJaC.bind(this._checkQueue, this),
- JSJAC_CHECKQUEUEINTERVAL);
- this._inQto = setInterval(JSJaC.bind(this._checkInQ, this),
- JSJAC_CHECKINQUEUEINTERVAL);
- this._timeout = setTimeout(JSJaC.bind(this._process, this),
- this.getPollInterval());
-};
-
-/**
- * Sets poll interval
- * @param {int} timerval the interval in seconds
- */
-JSJaCHttpBindingConnection.prototype.setPollInterval = function(timerval) {
- if (timerval && !isNaN(timerval)) {
- if (!this.isPolling())
- this._timerval = 100;
- else if (this._min_polling && timerval < this._min_polling*1000)
- this._timerval = this._min_polling*1000;
- else if (this._inactivity && timerval > this._inactivity*1000)
- this._timerval = this._inactivity*1000;
- else
- this._timerval = timerval;
- }
- return this._timerval;
-};
-
-/**
- * whether this session is in polling mode
- * @type boolean
- */
-JSJaCHttpBindingConnection.prototype.isPolling = function() { return (this._hold == 0) };
-
-/**
- * @private
- */
-JSJaCHttpBindingConnection.prototype._getFreeSlot = function() {
- for (var i=0; i" + raw + xml + "";
- } else {
- reqstr += "/>";
- }
-
- this._last_requests[this._rid] = new Object();
- this._last_requests[this._rid].xml = reqstr;
- this._last_rid = this._rid;
-
- for (var i in this._last_requests)
- if (this._last_requests.hasOwnProperty(i) &&
- i < this._rid-this._hold)
- delete(this._last_requests[i]); // truncate
- }
-
- return reqstr;
-};
-
-/**
- * @private
- */
-JSJaCHttpBindingConnection.prototype._getInitialRequestString = function() {
- var reqstr = " ";
- return reqstr;
-};
-
-/**
- * @private
- */
-JSJaCHttpBindingConnection.prototype._getStreamID = function(req) {
-
- this.oDbg.log(req.responseText,4);
-
- if (!req.responseXML || !req.responseXML.documentElement) {
- this._handleEvent('onerror',JSJaCError('503','cancel','service-unavailable'));
- return;
- }
- var body = req.responseXML.documentElement;
-
- // any session error?
- if(body.getAttribute('type') == 'terminate') {
- this._handleEvent('onerror',JSJaCError('503','cancel','service-unavailable'));
- return;
- }
-
- // extract stream id used for non-SASL authentication
- if (body.getAttribute('authid')) {
- this.streamid = body.getAttribute('authid');
- this.oDbg.log("got streamid: "+this.streamid,2);
- }
-
- if (!this._parseStreamFeatures(body)) {
- this._sendEmpty(JSJaC.bind(this._getStreamID, this));
- return;
- }
-
- this._timeout = setTimeout(JSJaC.bind(this._process, this),
- this.getPollInterval());
-
- if (this.register)
- this._doInBandReg();
- else
- this._doAuth();
-};
-
-/**
- * @private
- */
-JSJaCHttpBindingConnection.prototype._getSuspendVars = function() {
- return ('host,port,secure,_rid,_last_rid,_wait,_min_polling,_inactivity,_hold,_last_requests,_pause').split(',');
-};
-
-/**
- * @private
- */
-JSJaCHttpBindingConnection.prototype._handleInitialResponse = function(req) {
- try {
- // This will throw an error on Mozilla when the connection was refused
- this.oDbg.log(req.getAllResponseHeaders(),4);
- this.oDbg.log(req.responseText,4);
- } catch(ex) {
- this.oDbg.log("No response",4);
- }
-
- if (req.status != 200 || !req.responseXML) {
- this.oDbg.log("initial response broken (status: "+req.status+")",1);
- this._handleEvent('onerror',JSJaCError('503','cancel','service-unavailable'));
- return;
- }
- var body = req.responseXML.documentElement;
-
- if (!body || body.tagName != 'body' || body.namespaceURI != 'http://jabber.org/protocol/httpbind') {
- this.oDbg.log("no body element or incorrect body in initial response",1);
- this._handleEvent("onerror",JSJaCError("500","wait","internal-service-error"));
- return;
- }
-
- // Check for errors from the server
- if (body.getAttribute("type") == "terminate") {
- this.oDbg.log("invalid response:\n" + req.responseText,1);
- clearTimeout(this._timeout); // remove timer
- this._connected = false;
- this.oDbg.log("Disconnected.",1);
- this._handleEvent('ondisconnect');
- this._handleEvent('onerror',JSJaCError('503','cancel','service-unavailable'));
- return;
- }
-
- // get session ID
- this._sid = body.getAttribute('sid');
- this.oDbg.log("got sid: "+this._sid,2);
-
- // get attributes from response body
- if (body.getAttribute('polling'))
- this._min_polling = body.getAttribute('polling');
-
- if (body.getAttribute('inactivity'))
- this._inactivity = body.getAttribute('inactivity');
-
- if (body.getAttribute('requests'))
- this._setHold(body.getAttribute('requests')-1);
- this.oDbg.log("set hold to " + this._getHold(),2);
-
- if (body.getAttribute('ver'))
- this._bosh_version = body.getAttribute('ver');
-
- if (body.getAttribute('maxpause'))
- this._pause = Number.min(body.getAttribute('maxpause'), JSJACHBC_MAXPAUSE);
-
- // must be done after response attributes have been collected
- this.setPollInterval(this._timerval);
-
- /* start sending from queue for not polling connections */
- this._connected = true;
-
- this._inQto = setInterval(JSJaC.bind(this._checkInQ, this),
- JSJAC_CHECKINQUEUEINTERVAL);
- this._interval= setInterval(JSJaC.bind(this._checkQueue, this),
- JSJAC_CHECKQUEUEINTERVAL);
-
- /* wait for initial stream response to extract streamid needed
- * for digest auth
- */
- this._getStreamID(req);
-};
-
-/**
- * @private
- */
-JSJaCHttpBindingConnection.prototype._parseResponse = function(req) {
- if (!this.connected() || !req)
- return null;
-
- var r = req.r; // the XmlHttpRequest
-
- try {
- if (r.status == 404 || r.status == 403) {
- // connection manager killed session
- this._abort();
- return null;
- }
-
- if (r.status != 200 || !r.responseXML) {
- this._errcnt++;
- var errmsg = "invalid response ("+r.status+"):\n" + r.getAllResponseHeaders()+"\n"+r.responseText;
- if (!r.responseXML)
- errmsg += "\nResponse failed to parse!";
- this.oDbg.log(errmsg,1);
- if (this._errcnt > JSJAC_ERR_COUNT) {
- // abort
- this._abort();
- return null;
- }
-
- if (this.connected()) {
- this.oDbg.log("repeating ("+this._errcnt+")",1);
- this._setStatus('proto_error_fallback');
-
- // schedule next tick
- setTimeout(JSJaC.bind(this._resume, this),
- this.getPollInterval());
- }
-
- return null;
- }
- } catch (e) {
- this.oDbg.log("XMLHttpRequest error: status not available", 1);
- this._errcnt++;
- if (this._errcnt > JSJAC_ERR_COUNT) {
- // abort
- this._abort();
- } else {
- if (this.connected()) {
- this.oDbg.log("repeating ("+this._errcnt+")",1);
-
- this._setStatus('proto_error_fallback');
-
- // schedule next tick
- setTimeout(JSJaC.bind(this._resume, this),
- this.getPollInterval());
- }
- }
- return null;
- }
-
- var body = r.responseXML.documentElement;
- if (!body || body.tagName != 'body' ||
- body.namespaceURI != 'http://jabber.org/protocol/httpbind') {
- this.oDbg.log("invalid response:\n" + r.responseText,1);
-
- clearTimeout(this._timeout); // remove timer
- clearInterval(this._interval);
- clearInterval(this._inQto);
-
- this._connected = false;
- this.oDbg.log("Disconnected.",1);
- this._handleEvent('ondisconnect');
-
- this._setStatus('internal_server_error');
- this._handleEvent('onerror',
- JSJaCError('500','wait','internal-server-error'));
-
- return null;
- }
-
- if (typeof(req.rid) != 'undefined' && this._last_requests[req.rid]) {
- if (this._last_requests[req.rid].handled) {
- this.oDbg.log("already handled "+req.rid,2);
- return null;
- } else
- this._last_requests[req.rid].handled = true;
- }
-
-
- // Check for errors from the server
- if (body.getAttribute("type") == "terminate") {
- // read condition
- var condition = body.getAttribute('condition');
-
- if (condition != "item-not-found") {
- this.oDbg.log("session terminated:\n" + r.responseText,1);
-
- clearTimeout(this._timeout); // remove timer
- clearInterval(this._interval);
- clearInterval(this._inQto);
-
- try {
- DataStore.removeDB(MINI_HASH, 'jsjac', 'state');
- } catch (e) {}
-
- this._connected = false;
-
- if (condition == "remote-stream-error")
- if (body.getElementsByTagName("conflict").length > 0)
- this._setStatus("session-terminate-conflict");
- if (condition == null)
- condition = 'session-terminate';
- this._handleEvent('onerror',JSJaCError('503','cancel',condition));
-
- this.oDbg.log("Aborting remaining connections",4);
-
- for (var i=0; i JSJAC_ERR_COUNT)
- this._abort();
- }
- return null;
- }
-
- // no error
- this._errcnt = 0;
- return r.responseXML.documentElement;
-};
-
-/**
- * @private
- */
-JSJaCHttpBindingConnection.prototype._reInitStream = function(cb) {
- // tell http binding to reinit stream with/before next request
- this._reinit = true;
-
- this._sendEmpty(this._prepReInitStreamWait(cb));
-};
-
-
-JSJaCHttpBindingConnection.prototype._prepReInitStreamWait = function(cb) {
- return JSJaC.bind(function(req) {
- this._reInitStreamWait(req, cb);
- }, this);
-};
-
-/**
- * @private
- */
-JSJaCHttpBindingConnection.prototype._reInitStreamWait = function(req, cb) {
- this.oDbg.log("checking for stream features");
- var doc = req.responseXML.documentElement;
- this.oDbg.log(doc);
- if (doc.getElementsByTagNameNS) {
- this.oDbg.log("checking with namespace");
- var features = doc.getElementsByTagNameNS('http://etherx.jabber.org/streams',
- 'features').item(0);
- if (features) {
- var bind = features.getElementsByTagNameNS('urn:ietf:params:xml:ns:xmpp-bind',
- 'bind').item(0);
- }
- } else {
- var featuresNL = doc.getElementsByTagName('stream:features');
- for (var i=0, l=featuresNL.length; i= this._last_rid)
- this._rid = this._last_rid-1;
-
- this._process();
-};
-
-/**
- * @private
- */
-JSJaCHttpBindingConnection.prototype._setHold = function(hold) {
- if (!hold || isNaN(hold) || hold < 0)
- hold = 0;
- else if (hold > JSJACHBC_MAX_HOLD)
- hold = JSJACHBC_MAX_HOLD;
- this._hold = hold;
- return this._hold;
-};
-
-/**
- * @private
- */
-JSJaCHttpBindingConnection.prototype._setupRequest = function(async) {
- var req = new Object();
- var r = XmlHttp.create();
- try {
- r.open("POST",this._httpbase,async);
- r.setRequestHeader('Content-Type','text/xml; charset=utf-8');
- } catch(e) { this.oDbg.log(e,1); }
- req.r = r;
- this._rid++;
- req.rid = this._rid;
- return req;
-};
-
-/**
- * @private
- */
-JSJaCHttpBindingConnection.prototype._suspend = function() {
- if (this._pause == 0)
- return; // got nothing to do
-
- var slot = this._getFreeSlot();
- // Intentionally synchronous
- this._req[slot] = this._setupRequest(false);
-
- var reqstr = "";
-
- while (this._pQueue.length) {
- var curNode = this._pQueue[0];
- reqstr += curNode;
- this._pQueue = this._pQueue.slice(1,this._pQueue.length);
- }
-
- //reqstr += " ";
- reqstr += "";
-
- this.oDbg.log("Disconnecting: " + reqstr,4);
- this._req[slot].r.send(reqstr);
-};
-
-/**
- * @author Janusz Dziemidowicz rraptorr@nails.eu.org
- * @fileoverview All stuff related to WebSocket
- *
- * The WebSocket protocol is a bit of a mess. Various, incompatible,
- * protocol drafts were implemented in browsers. Fortunately, recently
- * a finished protocol was released in RFC6455. Further description
- * assumes RFC6455 WebSocket protocol version.
- *
- * WebSocket browser support. Current (November 2012) browser status:
- * - Chrome 16+ - works properly and supports RFC6455
- * - Firefox 16+ - works properly and support RFC6455 (ealier versions
- * have problems with proxies)
- * - Opera 12.10 - supports RFC6455, but does not work at all if a
- * proxy is configured (earlier versions do not support RFC6455)
- * - Internet Explorer 10+ - works properly and supports RFC6455
- *
- * Due to the above status, this code is currently recommended on
- * Chrome 16+, Firefox 16+ and Internet Explorer 10+. Using it on
- * other browsers is discouraged.
- *
- * Please also note that some users are only able to connect to ports
- * 80 and 443. Port 80 is sometimes intercepted by transparent HTTP
- * proxies, which mostly does not support WebSocket, so port 443 is
- * the best choice currently (it does not have to be
- * encrypted). WebSocket also usually does not work well with reverse
- * proxies, be sure to make extensive tests if you use one.
- *
- * There is no standard for XMPP over WebSocket. However, there is a
- * draft (http://tools.ietf.org/html/draft-ietf-xmpp-websocket-00) and
- * this implementation follows it.
- *
- * Tested servers:
- *
- * - node-xmpp-bosh (https://github.com/dhruvbird/node-xmpp-bosh) -
- * supports RFC6455 and works with no problems since 0.6.1, it also
- * transparently uses STARTTLS if necessary
- * - wxg (https://github.com/Gordin/wxg) - supports RFC6455 and works
- * with no problems, but cannot connect to servers requiring
- * STARTTLS (original wxg at https://github.com/hocken/wxg has some
- * issues, that were fixed by Gordin).
- * - ejabberd-websockets
- * (https://github.com/superfeedr/ejabberd-websockets) - does not
- * support RFC6455 hence it does not work, adapting it to support
- * RFC6455 should be quite easy for anyone knowing Erlang (some work
- * in progress can be found on github)
- * - Openfire (http://www.igniterealtime.org/projects/openfire/) -
- * unofficial plugin is available, but it lacks support
- * for RFC6455 hence it does not work
- * - Apache Vysper (http://mina.apache.org/vysper/) - does
- * not support RFC6455 hence does not work
- * - Tigase (http://www.tigase.org/) - works fine since 5.2.0.
- * - MongooseIM (https://github.com/esl/ejabberd) - a fork of ejabberd
- * with support for XMPP over Websockets.
- *
- */
-
-/*exported JSJaCWebSocketConnection */
-
-/**
- * Instantiates a WebSocket session.
- * @class Implementation of {@link http://tools.ietf.org/html/draft-ietf-xmpp-websocket-00 | An XMPP Sub-protocol for WebSocket}.
- * @extends JSJaCConnection
- * @constructor
- * @param {Object} oArg connection properties.
- * @param {string} oArg.httpbase WebSocket connection endpoint (i.e. ws://localhost:5280)
- * @param {JSJaCDebugger} [oArg.oDbg] A reference to a debugger implementing the JSJaCDebugger interface.
- */
-function JSJaCWebSocketConnection(oArg) {
- this.base = JSJaCConnection;
- this.base(oArg);
-
- this._ws = null;
-
- this.registerHandler('onerror', JSJaC.bind(this._cleanupWebSocket, this));
-}
-
-JSJaCWebSocketConnection.prototype = new JSJaCConnection();
-
-JSJaCWebSocketConnection.prototype._cleanupWebSocket = function() {
- if (this._ws !== null) {
- this._ws.onclose = null;
- this._ws.onerror = null;
- this._ws.onopen = null;
- this._ws.onmessage = null;
-
- this._ws.close();
- this._ws = null;
- }
-};
-
-/**
- * Connect to a jabber/XMPP server.
- * @param {Object} oArg The configuration to be used for connecting.
- * @param {string} oArg.domain The domain name of the XMPP service.
- * @param {string} oArg.username The username (nodename) to be logged in with.
- * @param {string} oArg.resource The resource to identify the login with.
- * @param {string} oArg.password The user's password.
- * @param {string} [oArg.authzid] Authorization identity. Used to act as another user, in most cases not needed and rarely supported by servers. If present should be a bare JID (user@example.net).
- * @param {boolean} [oArg.allow_plain] Whether to allow plain text logins.
- * @param {boolean} [oArg.allow_scram] Whether to allow SCRAM-SHA-1 authentication. Please note that it is quite slow, do some testing on all required browsers before enabling.
- * @param {boolean} [oArg.register] Whether to register a new account.
- * @param {string} [oArg.authhost] The host that handles the actualy authorization. There are cases where this is different from the settings above, e.g. if there's a service that provides anonymous logins at 'anon.example.org'.
- * @param {string} [oArg.authtype] Must be one of 'sasl' (default), 'nonsasl', 'saslanon', or 'anonymous'.
- * @param {string} [oArg.xmllang] The requested language for this login. Typically XMPP server try to respond with error messages and the like in this language if available.
- */
-JSJaCWebSocketConnection.prototype.connect = function(oArg) {
- this._setStatus('connecting');
-
- this.domain = oArg.domain || 'localhost';
- this.username = oArg.username;
- this.resource = oArg.resource;
- this.pass = oArg.password || oArg.pass;
- this.authzid = oArg.authzid || '';
- this.register = oArg.register;
-
- this.authhost = oArg.authhost || this.domain;
- this.authtype = oArg.authtype || 'sasl';
-
- this.jid = this.username + '@' + this.domain;
- this.fulljid = this.jid + '/' + this.resource;
-
- if (oArg.allow_plain) {
- this._allow_plain = oArg.allow_plain;
- } else {
- this._allow_plain = JSJAC_ALLOW_PLAIN;
- }
-
- if (oArg.allow_scram) {
- this._allow_scram = oArg.allow_scram;
- } else {
- this._allow_scram = JSJAC_ALLOW_SCRAM;
- }
-
- if (oArg.xmllang && oArg.xmllang !== '') {
- this._xmllang = oArg.xmllang;
- } else {
- this._xmllang = 'en';
- }
-
- if (typeof WebSocket === 'undefined') {
- this._handleEvent('onerror', JSJaCError('503', 'cancel', 'service-unavailable'));
- return;
- }
-
- this._ws = new WebSocket(this._httpbase, 'xmpp');
- this._ws.onclose = JSJaC.bind(this._onclose, this);
- this._ws.onerror = JSJaC.bind(this._onerror, this);
- this._ws.onopen = JSJaC.bind(this._onopen, this);
-};
-
-/**
- * @private
- */
-JSJaCWebSocketConnection.prototype._onopen = function() {
- var reqstr = this._getInitialRequestString();
-
- this.oDbg.log(reqstr, 4);
-
- this._ws.onmessage = JSJaC.bind(this._handleOpenStream, this);
- this._ws.send(reqstr);
-};
-
-/**
- * @private
- */
-JSJaCWebSocketConnection.prototype._handleOpenStream = function(event) {
- var open, stream;
-
- this.oDbg.log(event.data, 4);
-
- open = event.data;
- // skip XML prolog if any
- open = open.substr(open.indexOf(' ' && open.substr(-16) !== '') {
- // some servers send closed opening tag, some not
- open += '';
- }
- stream = this._parseXml(open);
- if(!stream) {
- this._handleEvent('onerror', JSJaCError('503', 'cancel', 'service-unavailable'));
- return;
- }
-
- // extract stream id used for non-SASL authentication
- this.streamid = stream.getAttribute('id');
-
- this.oDbg.log('got streamid: ' + this.streamid, 2);
- this._ws.onmessage = JSJaC.bind(this._handleInitialResponse, this);
-};
-
-/**
- * @private
- */
-JSJaCWebSocketConnection.prototype._handleInitialResponse = function(event) {
- var doc = this._parseXml(event.data);
- if (!this._parseStreamFeatures(doc)) {
- this._handleEvent('onerror', JSJaCError('503', 'cancel', 'service-unavailable'));
- return;
- }
-
- this._connected = true;
-
- if (this.register) {
- this._doInBandReg();
- } else {
- this._doAuth();
- }
-};
-
-/**
- * Disconnect from XMPP service
- *
- * When called upon leaving a page needs to use 'onbeforeunload' event
- * as Websocket would be closed already otherwise prior to this call.
- */
-JSJaCWebSocketConnection.prototype.disconnect = function() {
- this._setStatus('disconnecting');
-
- if (!this.connected()) {
- return;
- }
- this._connected = false;
-
- this.oDbg.log('Disconnecting', 4);
- this._sendRaw('', JSJaC.bind(this._cleanupWebSocket, this));
-
- this.oDbg.log('Disconnected', 2);
- this._handleEvent('ondisconnect');
-};
-
-/**
- * @private
- */
-JSJaCWebSocketConnection.prototype._onclose = function() {
- this.oDbg.log('websocket closed', 2);
- if (this._status !== 'disconnecting') {
- this._connected = false;
- this._handleEvent('onerror', JSJaCError('503', 'cancel', 'service-unavailable'));
- }
-};
-
-/**
- * @private
- */
-JSJaCWebSocketConnection.prototype._onerror = function() {
- this.oDbg.log('websocket error', 1);
- this._connected = false;
- this._handleEvent('onerror', JSJaCError('503', 'cancel', 'service-unavailable'));
-};
-
-/**
- * @private
- */
-JSJaCWebSocketConnection.prototype._onmessage = function(event) {
- var stanza, node, packet;
-
- stanza = event.data;
- this._setStatus('processing');
- if (!stanza || stanza === '') {
- return;
- }
-
- // WebSocket works only on modern browsers, so it is safe to assume
- // that namespaceURI and getElementsByTagNameNS are available.
- node = this._parseXml(stanza);
- if (node.namespaceURI === NS_STREAM && node.localName === 'error') {
- if (node.getElementsByTagNameNS(NS_STREAMS, 'conflict').length > 0) {
- this._setStatus('session-terminate-conflict');
- }
- this._connected = false;
- this._handleEvent('onerror', JSJaCError('503', 'cancel', 'remote-stream-error'));
- return;
- }
-
- packet = JSJaCPacket.wrapNode(node);
- if (!packet) {
- return;
- }
-
- this.oDbg.log('async recv: ' + event.data, 4);
- this._handleEvent('packet_in', packet);
-
- if (packet.pType && !this._handlePID(packet)) {
- this._handleEvent(packet.pType() + '_in', packet);
- this._handleEvent(packet.pType(), packet);
- }
-};
-
-/**
- * Parse single XML stanza. As proposed in XMPP Sub-protocol for
- * WebSocket draft, it assumes that every stanza is sent in a separate
- * WebSocket frame, which greatly simplifies parsing.
- * @private
- */
-JSJaCWebSocketConnection.prototype._parseXml = function(s) {
- var doc;
-
- this.oDbg.log('Parsing: ' + s, 4);
- try {
- doc = XmlDocument.create('stream', NS_STREAM);
- if(s.trim() == '') {
- // Consider session as closed
- this.oDbg.log("session terminated", 1);
-
- clearTimeout(this._timeout); // remove timer
- clearInterval(this._interval);
- clearInterval(this._inQto);
-
- try {
- DataStore.removeDB(MINI_HASH, 'jsjac', 'state');
- } catch (e) {}
-
- this._connected = false;
- this._handleEvent('onerror',JSJaCError('503','cancel','session-terminate'));
-
- this.oDbg.log("Disconnected.",1);
- this._handleEvent('ondisconnect');
-
- return null;
- } else if(s.indexOf('" + s + " ");
- return doc.documentElement.firstChild;
- } else {
- doc.loadXML(s);
- return doc.documentElement;
- }
- } catch (e) {
- this.oDbg.log('Error: ' + e);
- this._connected = false;
- this._handleEvent('onerror', JSJaCError('500', 'wait', 'internal-service-error'));
- }
-
- return null;
-};
-
-/**
- * @private
- */
-JSJaCWebSocketConnection.prototype._getInitialRequestString = function() {
- var streamto, reqstr;
-
- streamto = this.domain;
- if (this.authhost) {
- streamto = this.authhost;
- }
-
- reqstr = '';
- return reqstr;
-};
-
-JSJaCWebSocketConnection.prototype.send = function(packet, cb, arg) {
- this._ws.onmessage = JSJaC.bind(this._onmessage, this);
- if (!packet || !packet.pType) {
- this.oDbg.log('no packet: ' + packet, 1);
- return false;
- }
-
- if (!this.connected()) {
- return false;
- }
-
- // remember id for response if callback present
- if (cb) {
- if (!packet.getID()) {
- packet.setID('JSJaCID_' + this._ID++); // generate an ID
- }
-
- // register callback with id
- this._registerPID(packet, cb, arg);
- }
-
- try {
- this._handleEvent(packet.pType() + '_out', packet);
- this._handleEvent('packet_out', packet);
- this._ws.send(packet.xml());
- } catch (e) {
- this.oDbg.log(e.toString(), 1);
- return false;
- }
-
- return true;
-};
-
-/**
- * Resuming connections is not supported by WebSocket.
- */
-JSJaCWebSocketConnection.prototype.resume = function() {
- return false; // not supported for websockets
-};
-
-/**
- * Suspending connections is not supported by WebSocket.
- */
-JSJaCWebSocketConnection.prototype.suspend = function() {
- return false; // not supported for websockets
-};
-
-/**
- * @private
- */
-JSJaCWebSocketConnection.prototype._doSASLAuthScramSha1S1 = function(event) {
- var el = this._parseXml(event.data);
- return JSJaC.bind(JSJaCConnection.prototype._doSASLAuthScramSha1S1, this)(el);
-};
-
-/**
- * @private
- */
-JSJaCWebSocketConnection.prototype._doSASLAuthScramSha1S2 = function(event) {
- var el = this._parseXml(event.data);
- return JSJaC.bind(JSJaCConnection.prototype._doSASLAuthScramSha1S2, this)(el);
-};
-
-/**
- * @private
- */
-JSJaCWebSocketConnection.prototype._doSASLAuthDigestMd5S1 = function(event) {
- var el = this._parseXml(event.data);
- return JSJaC.bind(JSJaCConnection.prototype._doSASLAuthDigestMd5S1, this)(el);
-};
-
-/**
- * @private
- */
-JSJaCWebSocketConnection.prototype._doSASLAuthDigestMd5S2 = function(event) {
- var el = this._parseXml(event.data);
- return JSJaC.bind(JSJaCConnection.prototype._doSASLAuthDigestMd5S2, this)(el);
-};
-
-/**
- * @private
- */
-JSJaCWebSocketConnection.prototype._doSASLAuthDone = function(event) {
- var el = this._parseXml(event.data);
- return JSJaC.bind(JSJaCConnection.prototype._doSASLAuthDone, this)(el);
-};
-
-/**
- * @private
- */
-JSJaCWebSocketConnection.prototype._reInitStream = function(cb) {
- var reqstr, streamto = this.domain;
- if (this.authhost) {
- streamto = this.authhost;
- }
-
- reqstr = '';
- this._sendRaw(reqstr, cb);
-};
-
-/**
- * @private
- */
-JSJaCWebSocketConnection.prototype._sendRaw = function(xml, cb, arg) {
- if (!this._ws) {
- // Socket might have been closed already because of an 'onerror'
- // event. In this case we'd try to send a closing stream element
- // 'ondisconnect' which won't work.
- return false;
- }
- if (cb) {
- this._ws.onmessage = JSJaC.bind(cb, this, arg);
- }
- this._ws.send(xml);
- return true;
-};
-
-/*exported JSJaCUtils */
-
-/**
- * Various utilities put together so that they don't pollute global
- * name space.
- * @namespace
- */
-var JSJaCUtils = {
- /**
- * XOR two strings of equal length.
- * @param {string} s1 first string to XOR.
- * @param {string} s2 second string to XOR.
- * @return {string} s1 ^ s2.
- */
- xor: function(s1, s2) {
- /*jshint bitwise: false */
- if(!s1) {
- return s2;
- }
- if(!s2) {
- return s1;
- }
-
- var result = '';
- for(var i = 0; i < s1.length; i++) {
- result += String.fromCharCode(s1.charCodeAt(i) ^ s2.charCodeAt(i));
- }
- return result;
- },
-
- /**
- * Create nonce value of given size.
- * @param {int} size size of the nonce that should be generated.
- * @return {string} generated nonce.
- */
- cnonce: function(size) {
- var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
- var cnonce = '';
- for (var i = 0; i < size; i++) {
- cnonce += tab.charAt(Math.round(Math.random(new Date().getTime()) * (tab.length - 1)));
- }
- return cnonce;
- },
-
- /**
- * Current timestamp.
- * @return Seconds since 1.1.1970.
- * @type int
- */
- now: function() {
- if (Date.now && typeof Date.now == 'function') {
- return Date.now();
- } else {
- return new Date().getTime();
- }
- }
-
-};
diff --git a/source/app/javascripts/jxhr.js b/source/app/javascripts/jxhr.js
deleted file mode 100644
index fefdabc..0000000
--- a/source/app/javascripts/jxhr.js
+++ /dev/null
@@ -1,116 +0,0 @@
-// jXHR.js (JSON-P XHR)
-// v0.1 (c) Kyle Simpson
-// License: MIT
-// modified by gueron Jonathan to work with strophe lib
-// for http://www.iadvize.com
-
-(function(global){
- var SETTIMEOUT = global.setTimeout, // for better compression
- doc = global.document,
- callback_counter = 0;
-
- global.jXHR = function() {
- var script_url,
- script_loaded,
- jsonp_callback,
- scriptElem,
- publicAPI = null;
-
- function removeScript() { try { scriptElem.parentNode.removeChild(scriptElem); } catch (err) { } }
-
- function reset() {
- script_loaded = false;
- script_url = "";
- removeScript();
- scriptElem = null;
- fireReadyStateChange(0);
- }
-
- function ThrowError(msg) {
- try {
- publicAPI.onerror.call(publicAPI,msg,script_url);
- } catch (err) {
- //throw new Error(msg);
- }
- }
-
- function handleScriptLoad() {
- if ((this.readyState && this.readyState!=="complete" && this.readyState!=="loaded") || script_loaded) { return; }
- this.onload = this.onreadystatechange = null; // prevent memory leak
- script_loaded = true;
- if (publicAPI.readyState !== 4) ThrowError("handleScriptLoad: Script failed to load ["+script_url+"].");
- removeScript();
- }
-
- function parseXMLString(xmlStr) {
- var xmlDoc = null;
- if(window.DOMParser) {
- var parser = new DOMParser();
- xmlDoc = parser.parseFromString(xmlStr,"text/xml");
- }
- else {
- xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
- xmlDoc.async="false";
- xmlDoc.loadXML(xmlStr);
- }
- return xmlDoc;
- }
-
- function fireReadyStateChange(rs,args) {
-
- args = args || [];
- publicAPI.readyState = rs;
- if (rs == 4) {
- publicAPI.responseText = args[0].reply;
- publicAPI.responseXML = parseXMLString(args[0].reply);
- }
- if (typeof publicAPI.onreadystatechange === "function") publicAPI.onreadystatechange.apply(publicAPI,args);
- }
-
- publicAPI = {
- onerror:null,
- onreadystatechange:null,
- readyState:0,
- status:200,
- responseBody: null,
- responseText: null,
- responseXML: null,
- open:function(method,url){
- reset();
- var internal_callback = "cb"+(callback_counter++);
- (function(icb){
- global.jXHR[icb] = function() {
- try { fireReadyStateChange.call(publicAPI,4,arguments); }
- catch(err) {
- publicAPI.readyState = -1;
- ThrowError("Script failed to run ["+script_url+"].");
- }
- global.jXHR[icb] = null;
- };
- })(internal_callback);
- script_url = url + '?callback=?jXHR&data=';
- script_url = script_url.replace(/=\?jXHR/,"=jXHR."+internal_callback);
- fireReadyStateChange(1);
- },
- send:function(data){
- script_url = script_url + encodeURIComponent(data);
- SETTIMEOUT(function(){
- scriptElem = doc.createElement("script");
- scriptElem.setAttribute("type","text/javascript");
- scriptElem.onload = scriptElem.onreadystatechange = function(){handleScriptLoad.call(scriptElem);};
- scriptElem.setAttribute("src",script_url);
- doc.getElementsByTagName("head")[0].appendChild(scriptElem);
- },0);
- fireReadyStateChange(2);
- },
- abort:function(){},
- setRequestHeader:function(){}, // noop
- getResponseHeader:function(){return "";}, // basically noop
- getAllResponseHeaders:function(){return [];} // ditto
- };
-
- reset();
-
- return publicAPI;
- };
-})(window);
diff --git a/source/app/javascripts/links.js b/source/app/javascripts/links.js
deleted file mode 100644
index 44e6b63..0000000
--- a/source/app/javascripts/links.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the links JS script for Jappix
-
--------------------------------------------------
-
-License: dual-licensed under AGPL and MPLv2
-Authors: Valérian Saliou, Maranda
-
-*/
-
-// Bundle
-var Links = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Apply links in a string
- * @public
- * @param {string} string
- * @param {string} mode
- * @param {string} style
- * @return {string}
- */
- self.apply = function(string, mode, style) {
-
- try {
- var target;
-
- // Links style
- if(!style) {
- style = '';
- } else {
- style = ' style="' + style + '"';
- }
-
- // Open in new tabs
- if(mode != 'xhtml-im') {
- target = ' target="_blank"';
- } else {
- target = '';
- }
-
- // XMPP address
- string = string.replace(
- /(\s| |^)(([a-zA-Z0-9\._-]+)@([a-zA-Z0-9\.\/_-]+))(,|\s|$)/gi,
- '$1$2 $5'
- );
-
- // Simple link
- string = string.replace(
- /(\s| |^|\()((https?|ftp|file|xmpp|irc|mailto|vnc|webcal|ssh|ldap|smb|magnet|spotify)(:)([^<>'"\s\)]+))/gim,
- '$1$2 '
- );
-
- return string;
- } catch(e) {
- Console.error('Links.apply', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
-
-var JappixLinks = Links;
\ No newline at end of file
diff --git a/source/app/javascripts/mam.js b/source/app/javascripts/mam.js
deleted file mode 100644
index 5593179..0000000
--- a/source/app/javascripts/mam.js
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
-
-Jappix - An open social platform
-Implementation of XEP-0313: Message Archive Management
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var MAM = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /* Constants */
- self.REQ_MAX = 50;
- self.SCROLL_THRESHOLD = 200;
-
- self.PREF_DEFAULTS = {
- 'always' : 1,
- 'never' : 1,
- 'roster' : 1
- };
-
-
- /* Variables */
- self.map_reqs = {};
- self.map_pending = {};
- self.map_states = {};
- self.map_messages = {};
- self.msg_queue = {};
-
-
- /**
- * Gets the MAM configuration
- * @public
- * @return {undefined}
- */
- self.getConfig = function() {
-
- try {
- // Lock the archiving options
- $('#archiving').attr('disabled', true);
-
- // Get the archiving configuration
- var iq = new JSJaCIQ();
- iq.setType('get');
-
- iq.appendNode('prefs', { 'xmlns': NS_URN_MAM });
-
- con.send(iq, self.handleConfig);
- } catch(e) {
- Console.error('MAM.getConfig', e);
- }
-
- };
-
-
- /**
- * Handles the MAM configuration
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleConfig = function(iq) {
-
- try {
- if(iq.getType() != 'error') {
- // Read packet
- var cur_default = $(iq.getNode()).find('prefs[xmlns="' + NS_URN_MAM + '"]').attr('default') || 'never';
-
- if(!(cur_default in self.PREF_DEFAULTS)) {
- cur_default = 'never';
- }
-
- // Apply value to options
- $('#archiving').val(cur_default);
- }
-
- // Unlock the archiving option
- $('#archiving').removeAttr('disabled');
-
- // All done.
- Options.wait('mam');
- } catch(e) {
- Console.error('MAM.handleConfig', e);
- }
-
- };
-
-
- /**
- * Sets the MAM configuration
- * @public
- * @param {string} pref_default
- * @return {undefined}
- */
- self.setConfig = function(pref_default) {
-
- try {
- // Check parameters
- if(!(pref_default in self.PREF_DEFAULTS)) {
- pref_default = 'never';
- }
-
- // Send new configuration
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- iq.appendNode('prefs', { 'xmlns': NS_URN_MAM, 'default': pref_default });
-
- con.send(iq);
- } catch(e) {
- Console.error('MAM.setConfig', e);
- }
-
- };
-
-
- /**
- * Removes all (or given) MAM archives
- * @public
- * @param {object} args
- * @return {undefined}
- */
- self.purgeArchives = function(args) {
-
- try {
- if(typeof args != 'object') {
- args = {};
- }
-
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- var purge = iq.appendNode('purge', { 'xmlns': NS_METRONOME_MAM_PURGE });
-
- for(var c in args) {
- if(args[c]) purge.appendChild(iq.buildNode(c, {'xmlns': NS_METRONOME_MAM_PURGE}, args[c]));
- }
-
- con.send(iq, function(iq) {
- if(iq.getType() == 'result') {
- Console.info('Archives purged (MAM).');
- } else {
- Console.error('Error purging archives (MAM).');
- }
- });
- } catch(e) {
- Console.error('MAM.purgeArchives', e);
- }
-
- };
-
-
- /**
- * Gets the MAM configuration
- * @public
- * @param {object} args
- * @param {object} rsm_args
- * @param {function} callback
- * @return {undefined}
- */
- self.getArchives = function(args, rsm_args, callback) {
-
- try {
- if(typeof args != 'object') {
- args = {};
- }
-
- var req_id = genID();
-
- if(args['with']) {
- self.map_pending[args['with']] = 1;
- self.map_reqs[req_id] = args['with'];
- }
-
- var iq = new JSJaCIQ();
- iq.setType('get');
- iq.setID(req_id);
-
- var query = iq.setQuery(NS_URN_MAM);
-
- for(var c in args) {
- if(args[c] !== null) query.appendChild(iq.buildNode(c, {'xmlns': NS_URN_MAM}, args[c]));
- }
-
- if(rsm_args && typeof rsm_args == 'object') {
- var rsm_set = query.appendChild(iq.buildNode('set', {'xmlns': NS_RSM}));
-
- for(var r in rsm_args) {
- if(rsm_args[r] !== null) rsm_set.appendChild(iq.buildNode(r, {'xmlns': NS_RSM}, rsm_args[r]));
- }
- }
-
- con.send(iq, function(res_iq) {
- self.handleArchives(res_iq, callback);
- });
- } catch(e) {
- Console.error('MAM.getArchives', e);
- }
-
- };
-
-
- /**
- * Handles the MAM configuration
- * @public
- * @param {object} iq
- * @param {function} callback
- * @return {undefined}
- */
- self.handleArchives = function(iq, callback) {
-
- try {
- var res_id = iq.getID();
- var res_with;
-
- if(res_id && res_id in self.map_reqs) {
- res_with = self.map_reqs[res_id];
- }
-
- if(iq.getType() != 'error') {
- if(res_with) {
- var res_sel = $(iq.getQuery());
- var res_rsm_sel = res_sel.find('set[xmlns="' + NS_RSM + '"]');
-
- // Store that data
- self.map_states[res_with] = {
- 'date': {
- 'start': res_sel.find('start').eq(0).text(),
- 'end': res_sel.find('end').eq(0).text()
- },
-
- 'rsm': {
- 'first': res_rsm_sel.find('first').eq(0).text(),
- 'last': res_rsm_sel.find('last').eq(0).text(),
- 'count': parseInt(res_rsm_sel.find('count').eq(0).text() || 0)
- }
- };
-
- // Generate stamps for easy operations
- var start_stamp = DateUtils.extractStamp(Date.jab2date(self.map_states[res_with].date.start));
- var start_end = DateUtils.extractStamp(Date.jab2date(self.map_states[res_with].date.end));
-
- // Create MAM messages target
- var target_html = '
';
-
- var target_content_sel = $('#' + hex_md5(res_with) + ' .content');
- var target_wait_sel = target_content_sel.find('.wait-mam');
-
- if(target_wait_sel.size()) {
- target_wait_sel.after(target_html);
- } else {
- target_content_sel.prepend(target_html);
- }
-
- // Any enqueued message to display?
- if(typeof self.msg_queue[res_with] == 'object') {
- for(var i in self.msg_queue[res_with]) {
- (self.msg_queue[res_with][i])();
- }
-
- delete self.msg_queue[res_with];
- }
-
- // Remove XID from pending list
- if(res_with in self.map_pending) {
- delete self.map_pending[res_with];
- }
-
- Console.info('Got archives from: ' + res_with);
- } else {
- Console.warn('Could not associate archive response with a known JID.');
- }
- } else {
- Console.error('Error handing archives (MAM).');
- }
-
- // Execute callback?
- if(typeof callback == 'function') {
- callback(iq);
- }
- } catch(e) {
- Console.error('MAM.handleArchives', e);
- }
-
- };
-
-
- /**
- * Handles a MAM-forwarded message stanza
- * @public
- * @param {object} fwd_stanza
- * @param {object} c_delay
- * @return {undefined}
- */
- self.handleMessage = function(fwd_stanza, c_delay) {
-
- try {
- // Build message node
- var c_message = fwd_stanza.find('message');
-
- if(c_message[0]) {
- // Re-build a proper JSJaC message stanza
- var message = JSJaCPacket.wrapNode(c_message[0]);
- var message_node = message.getNode();
-
- // Check message type
- var type = message.getType() || 'chat';
-
- if(type == 'chat') {
- // Display function
- var c_display_fn;
- var c_display_msg_bool = false;
-
- // Read message data
- var xid = Common.bareXID(Common.getStanzaFrom(message));
- var id = message.getID();
- var from_xid = xid;
- var b_name = Name.getBuddy(xid);
- var mode = (xid == Common.getXID()) ? 'me': 'him';
-
- // Refactor chat XID (in case we were the sender of the archived message)
- if(mode == 'me') {
- xid = Common.bareXID(message.getTo());
- }
-
- var hash = hex_md5(xid);
- var body = message.getBody();
-
- // Content message?
- if(body) {
- // Read delay (required since we deal w/ a past message!)
- var time, stamp;
- var delay = c_delay.attr('stamp');
-
- if(delay) {
- time = DateUtils.relative(delay);
- stamp = DateUtils.extractStamp(Date.jab2date(delay));
- }
-
- // Last-minute checks before display
- if(time && stamp) {
- var mam_chunk_path = '#' + hash + ' .mam-chunk';
-
- // Markable message?
- var is_markable = Markers.hasRequestMarker(message_node);
-
- // No chat auto-scroll?
- var no_scroll = Common.exists(mam_chunk_path);
-
- // Select the custom target
- var c_target_sel = function() {
- return $(mam_chunk_path).filter(function() {
- return $(this).attr('data-start') <= stamp && $(this).attr('data-end') >= stamp;
- }).filter(':first');
- };
-
- // Display the message in that target
- c_display_fn = function() {
- // Display message
- Message.display(
- type,
- from_xid,
- hash,
- b_name.htmlEnc(),
- body,
- time,
- stamp,
- 'old-message',
- true,
- null,
- mode,
- id + '-mam',
- c_target_sel(),
- no_scroll,
- undefined,
- undefined,
- undefined,
- is_markable
- );
-
- self.map_messages[id] = 1;
- };
-
- c_display_msg_bool = c_target_sel().size() ? true : false;
-
- // Hack: do not display the message in case we would duplicate it w/ current session messages
- // only used when initiating a new chat, avoids collisions
- if(!(xid in self.map_states) && $('#' + hash).find('.one-line.user-message:last').text() == body) {
- return;
- }
- }
- } else if(Markers.hasResponseMarker(message_node)) {
- // Marked message? (by other party)
- if(mode == 'him') {
- var marked_message_id = Markers.getMessageID(message_node);
-
- c_display_fn = function() {
- var is_mam_marker = true;
-
- Markers.handle(
- from_xid,
- message_node,
- is_mam_marker
- );
- };
-
- c_display_msg_bool = (self.map_messages[marked_message_id] === 1) ? true : false;
- }
- }
-
- // Display message?
- if(typeof c_display_fn == 'function') {
- if(c_display_msg_bool === true) {
- // Display message now
- c_display_fn();
- } else {
- // Delay display (we may not have received the MAM reply ATM)
- if(typeof self.msg_queue[xid] != 'object') {
- self.msg_queue[xid] = [];
- }
-
- self.msg_queue[xid].push(c_display_fn);
- }
- }
- }
- }
- } catch(e) {
- Console.error('MAM.handleMessage', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/markers.js b/source/app/javascripts/markers.js
deleted file mode 100644
index badfca9..0000000
--- a/source/app/javascripts/markers.js
+++ /dev/null
@@ -1,428 +0,0 @@
-/*
-
-Jappix - An open social platform
-Implementation of XEP-0333: Chat Markers
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Markers = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /* Constants */
- self.MARK_TYPE_MARKABLE = 'markable';
- self.MARK_TYPE_RECEIVED = 'received';
- self.MARK_TYPE_DISPLAYED = 'displayed';
- self.MARK_TYPE_ACKNOWLEDGED = 'acknowledged';
-
- self.MARK_TYPES = {};
- self.MARK_TYPES[self.MARK_TYPE_MARKABLE] = 1;
- self.MARK_TYPES[self.MARK_TYPE_RECEIVED] = 1;
- self.MARK_TYPES[self.MARK_TYPE_DISPLAYED] = 1;
- self.MARK_TYPES[self.MARK_TYPE_ACKNOWLEDGED] = 1;
-
-
- /**
- * Returns whether entity supports message markers
- * @public
- * @param {string} xid
- * @return {boolean}
- */
- self.hasSupport = function(xid) {
-
- var has_support = false;
-
- try {
- has_support = true ? $('#' + hex_md5(xid)).attr('data-markers') == 'true' : false;
- } catch(e) {
- Console.error('Markers.hasSupport', e);
- } finally {
- return has_support;
- }
-
- };
-
-
- /**
- * Returns whether request message is marked or not
- * @public
- * @param {object} message
- * @return {boolean}
- */
- self.hasRequestMarker = function(message) {
-
- var has_request_marker = false;
-
- try {
- has_request_marker = ($(message).find('markable[xmlns="' + NS_URN_MARKERS + '"]').size() ? true : false);
- } catch(e) {
- Console.error('Markers.hasRequestMarker', e);
- } finally {
- return has_request_marker;
- }
-
- };
-
-
- /**
- * Returns whether response message is marked or not
- * @public
- * @param {object} message
- * @return {boolean}
- */
- self.hasResponseMarker = function(message) {
-
- var has_response_marker = false;
-
- try {
- var marker_sel = $(message).find('[xmlns="' + NS_URN_MARKERS + '"]');
-
- if(marker_sel.size()) {
- var mark_type = marker_sel.prop('tagName').toLowerCase();
-
- switch(mark_type) {
- case self.MARK_TYPE_RECEIVED:
- case self.MARK_TYPE_DISPLAYED:
- case self.MARK_TYPE_ACKNOWLEDGED:
- has_response_marker = true;
- break;
- }
- }
- } catch(e) {
- Console.error('Markers.hasResponseMarker', e);
- } finally {
- return has_response_marker;
- }
-
- };
-
-
- /**
- * Returns the marked message ID
- * @public
- * @param {object} message
- * @return {boolean}
- */
- self.getMessageID = function(message) {
-
- var message_id = null;
-
- try {
- message_id = $(message).find('[xmlns="' + NS_URN_MARKERS + '"]').attr('id');
- } catch(e) {
- Console.error('Markers.getMessageID', e);
- } finally {
- return message_id;
- }
-
- };
-
-
- /**
- * Marks a message
- * @public
- * @param {object} message
- * @return {undefined}
- */
- self.mark = function(message) {
-
- try {
- message.appendNode('markable', {
- 'xmlns': NS_URN_MARKERS
- });
- } catch(e) {
- Console.error('Markers.mark', e);
- }
-
- };
-
-
- /**
- * Changes received message status (once received or read)
- * @public
- * @param {string} mark_type
- * @param {object} message_id
- * @return {undefined}
- */
- self.change = function(to, mark_type, message_id, message_sel) {
-
- try {
- if(!(mark_type in self.MARK_TYPES)) {
- throw 'Marker type (' + mark_type + ') not supported, aborting.';
- }
-
- // Store mark state
- message_sel.attr('data-mark', mark_type);
-
- var message = new JSJaCMessage();
-
- message.setType('chat');
- message.setTo(to);
-
- message.appendNode(mark_type, {
- 'xmlns': NS_URN_MARKERS,
- 'id': message_id
- });
-
- con.send(message);
-
- Console.debug('Markers.change', 'Changed marker to: ' + mark_type + ' for message with ID: ' + message_id + ' from: ' + to);
- } catch(e) {
- Console.error('Markers.change', e);
- }
-
- };
-
-
- /**
- * Handles marker change coming from Carbons
- * @public
- * @param {string} message
- * @return {undefined}
- */
- self.handleCarbonChange = function(message) {
-
- try {
- // Check the marker element is existing
- var marker_sel = $(message).find('[xmlns="' + NS_URN_MARKERS + '"]');
-
- if(marker_sel.size()) {
- var xid = Common.bareXID(message.getTo());
-
- var mark_type = marker_sel.prop('tagName').toLowerCase();
- var mark_handle = false;
-
- // Filter allowed markers
- switch(mark_type) {
- case self.MARK_TYPE_RECEIVED:
- case self.MARK_TYPE_DISPLAYED:
- case self.MARK_TYPE_ACKNOWLEDGED:
- mark_handle = true;
- break;
- }
-
- if(mark_handle === true) {
- var mark_message_id = marker_sel.attr('id');
-
- var message_sel = $('#' + hex_md5(xid) + ' .content .one-line[data-mode="him"][data-markable="true"]').filter(function() {
- return ($(this).attr('data-id') + '') === (mark_message_id + '');
- }).filter(':last');
-
- if(!message_sel.size()) {
- Console.warn('Markers.handleCarbonChange', 'Unknown message marker to keep in sync with Carbons for: ' + xid);
- return false;
- }
-
- // Store mark state
- message_sel.attr('data-mark', mark_type);
-
- Console.debug('Markers.handleCarbonChange', 'Received Carbons chat marker (' + mark_type + ') from another resource for: ' + from);
- }
- }
- } catch(e) {
- Console.error('Markers.handleCarbonChange', e);
- }
-
- };
-
-
- /**
- * Handles a marked message
- * @public
- * @param {string} from
- * @param {object} message
- * @param {boolean} is_mam_marker
- * @return {undefined}
- */
- self.handle = function(from, message, is_mam_marker, is_groupchat_user) {
-
- try {
- var xid = ((is_groupchat_user !== true && Common.bareXID(from)) || from);
- var marker_sel = $(message).find('[xmlns="' + NS_URN_MARKERS + '"]');
-
- if(marker_sel.size()) {
- var mark_type = marker_sel.prop('tagName').toLowerCase();
- var mark_message_id = marker_sel.attr('id');
-
- if(is_mam_marker === true) {
- mark_message_id += '-mam';
- }
-
- // Filter allowed markers
- var mark_valid = false;
-
- switch(mark_type) {
- case self.MARK_TYPE_RECEIVED:
- case self.MARK_TYPE_DISPLAYED:
- case self.MARK_TYPE_ACKNOWLEDGED:
- mark_valid = true;
- break;
- }
-
- if(mark_valid === false) {
- Console.warn('Markers.handle', 'Dropping unexpected chat marker (' + mark_type + ') from: ' + from);
- return false;
- }
-
- // Find marked message target
- var message_sel = $('#' + hex_md5(xid) + ' .content .one-line[data-mode="me"]').filter(function() {
- return ($(this).attr('data-id') + '') === (mark_message_id + '');
- }).filter(':last');
-
- if(!message_sel.size()) {
- Console.warn('Markers.handle', 'Dropping chat marker (' + mark_type + ') for inexisting message ID (' + mark_message_id + ') from: ' + from);
- return false;
- }
-
- Console.debug('Markers.handle', 'Received chat marker (' + mark_type + ') from: ' + from);
-
- // Finally display received marker
- self._display(xid, message_sel, mark_type);
-
- return true;
- }
-
- return false;
- } catch(e) {
- Console.error('Markers.handle', e);
- return false;
- }
-
- };
-
-
- /**
- * Adds the markers input events
- * @public
- * @param {object} target
- * @param {string} xid
- * @param {string} hash
- * @param {string} type
- * @return {undefined}
- */
- self.events = function(target, xid, hash, type) {
-
- try {
- target.focus(function() {
- // Not needed
- if(target.is(':disabled')) {
- return;
- }
-
- // Send displayed message marker?
- if(type == 'chat' && self.hasSupport(xid) === true) {
- var last_message = $('#' + hash + ' .content .one-line.user-message[data-markable="true"]:last');
-
- if(last_message.attr('data-mark') != self.MARK_TYPE_DISPLAYED) {
- var last_message_id = last_message.attr('data-id');
- var full_xid = Presence.highestPriority(xid) || xid;
-
- if(last_message_id) {
- self.change(
- full_xid,
- self.MARK_TYPE_DISPLAYED,
- last_message_id,
- last_message
- );
- }
- }
- }
- });
- } catch(e) {
- Console.error('Markers.events', e);
- }
-
- };
-
-
- /**
- * Displays a marker
- * @private
- * @param {string} xid
- * @param {object} message_sel
- * @param {string} mark_type
- * @return {boolean}
- */
- self._display = function(xid, message_sel, mark_type) {
-
- try {
- // Get marker state translation
- var marker_sel = message_sel.find('.message-marker');
- var mark_message = null;
- var css_classes = 'talk-images message-marker-read';
- var marker_category = null;
-
- switch(mark_type) {
- case self.MARK_TYPE_RECEIVED:
- marker_category = 'delivered';
-
- marker_sel.removeClass(css_classes);
- marker_sel.text(
- Common._e("Delivered")
- );
- break;
-
- case self.MARK_TYPE_DISPLAYED:
- case self.MARK_TYPE_ACKNOWLEDGED:
- marker_category = 'read';
-
- marker_sel.addClass(css_classes);
- marker_sel.text(
- Common._e("Read")
- );
- break;
-
- default:
- return false;
- }
-
- if(marker_category !== null) {
- marker_sel.attr('data-category', marker_category);
- }
-
- // Reset sending state
- message_sel.removeClass('is-sending');
-
- // Toggle marker visibility
- message_sel.parents('.content').find('.one-line .message-marker').filter(function() {
- var data_category = $(this).attr('data-category');
-
- if(data_category != 'delivered' && data_category != 'read') {
- return false;
- }
-
- // Leave older "read" checkpoint on screen
- if(marker_category == 'delivered') {
- return data_category == marker_category;
- }
-
- return true;
- }).hide();
- marker_sel.show();
-
- return true;
- } catch(e) {
- Console.error('Markers._display', e);
- return false;
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/me.js b/source/app/javascripts/me.js
deleted file mode 100644
index 44c3daa..0000000
--- a/source/app/javascripts/me.js
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the Jappix Me tool functions for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Me = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Opens the Me tools
- * @public
- * @return {undefined}
- */
- self.open = function() {
-
- try {
- // Popup HTML content
- var html =
- '' + Common._e("Public profile") + '
' +
-
- '' +
- '
' +
-
- '
' +
- '
' + Common._e("Your profile anywhere on the Web.") + '
' +
- '
' + Common.printf(Common._e("%s is a Jappix.com service which makes your XMPP profile public. It is easier to share it. No XMPP account is required to view your social channel, your current position and your contact details."), 'Jappix Me ') + '
' +
- '
' + Common._e("Furthermore, every picture you post in your social channel is added to a beautiful picture timeline. You can now view the pictures you shared year by year.") + '
' +
- '
' + Common._e("You can also use your XMPP avatar as a single avatar for every website, blog and forum you use. When you change it on XMPP, the new avatar appears everywhere. What a genius improvement!") + '
' +
- '
' +
-
- '
' + Common._e("Yay, let's create your public profile!") + ' ' +
- '
' +
-
- '';
-
- // Create the popup
- Popup.create('me', html);
-
- // Associate the events
- self.instance();
-
- Console.log('Public profile tool opened.');
- } catch(e) {
- Console.error('Me.open', e);
- }
-
- };
-
-
- /**
- * Closes the Me tools
- * @public
- * @return {boolean}
- */
- self.close = function() {
-
- try {
- // Destroy the popup
- Popup.destroy('me');
-
- // We finished
- Welcome.is_done = false;
- } catch(e) {
- Console.error('Me.close', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Plugin launcher
- * @public
- * @return {undefined}
- */
- self.instance = function() {
-
- try {
- var me_sel = $('#me');
-
- // Click events
- me_sel.find('.content a.go').click(function() {
- self.close();
- });
-
- me_sel.find('.bottom .finish').click(self.close);
- } catch(e) {
- Console.error('Me.instance', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/message.js b/source/app/javascripts/message.js
deleted file mode 100644
index ec979d6..0000000
--- a/source/app/javascripts/message.js
+++ /dev/null
@@ -1,2068 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the messages JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Authors: Valérian Saliou, Maranda
-
-*/
-
-// Bundle
-var Message = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Handles MAM forwared messages
- * @private
- * @param {object} c_mam
- * @return {boolean}
- */
- self._handleMAM = function(c_mam) {
-
- try {
- var c_mam_sel = $(c_mam);
- var c_mam_delay = c_mam_sel.find('delay[xmlns="' + NS_URN_DELAY + '"]');
- var c_mam_forward = c_mam_sel.find('forwarded[xmlns="' + NS_URN_FORWARD + '"]');
-
- if(c_mam_forward.size()) {
- MAM.handleMessage(c_mam_forward, c_mam_delay);
- }
- } catch(e) {
- Console.error('Message._handleMAM', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Handles chatstate messages
- * @private
- * @param {string} from
- * @param {string} hash
- * @param {string} type
- * @param {object} node
- * @return {undefined}
- */
- self._handleChatstate = function(from, hash, type, node) {
-
- try {
- /* REF: http://xmpp.org/extensions/xep-0085.html */
-
- var node_sel = $(node);
-
- // Re-process the hash?
- var chatstate_hash = (type == 'groupchat') ? hex_md5(from) : hash;
-
- // Do something depending of the received state
- if(node_sel.find('active').size()) {
- ChatState.display('active', chatstate_hash, type);
-
- // Tell Jappix the entity supports chatstates
- $('#' + chatstate_hash + ' .message-area').attr('data-chatstates', 'true');
-
- Console.log('Active chatstate received from: ' + from);
- } else if(node_sel.find('composing').size()) {
- ChatState.display('composing', chatstate_hash, type);
-
- Console.log('Composing chatstate received from: ' + from);
- } else if(node_sel.find('paused').size()) {
- ChatState.display('paused', chatstate_hash, type);
-
- Console.log('Paused chatstate received from: ' + from);
- } else if(node_sel.find('inactive').size()){
- ChatState.display('inactive', chatstate_hash, type);
-
- Console.log('Inactive chatstate received from: ' + from);
- } else if(node_sel.find('gone').size()){
- ChatState.display('gone', chatstate_hash, type);
-
- Console.log('Gone chatstate received from: ' + from);
- }
- } catch(e) {
- Console.error('Message._doThat', e);
- }
-
- };
-
-
- /**
- * Handles Jappix App messages
- * @private
- * @param {string} xid
- * @param {string} body
- * @param {object} node
- * @return {boolean}
- */
- self._handleJappixApp = function(xid, body, node) {
-
- var is_exit = false;
-
- try {
- var node_sel = $(node);
-
- // Get notification data
- var jappix_app_node = node_sel.find('app[xmlns="jappix:app"]');
- var jappix_app_name = jappix_app_node.find('name');
-
- var jappix_app_name_id = jappix_app_name.attr('id');
- var jappix_app_name_value = jappix_app_name.text();
-
- // Jappix Me notification?
- if(jappix_app_name_id == 'me') {
- // Get more notification data
- var jappix_app_data = jappix_app_node.find('data[xmlns="jappix:app:me"]');
- var jappix_app_data_action = jappix_app_data.find('action');
- var jappix_app_data_url = jappix_app_data.find('url');
-
- var jappix_app_data_action_type = jappix_app_data_action.attr('type');
- var jappix_app_data_action_success = jappix_app_data_action.attr('success');
- var jappix_app_data_action_job = jappix_app_data_action.attr('job');
- var jappix_app_data_url_value = jappix_app_data_url.text();
-
- // Validate data
- if(jappix_app_data_action_type && jappix_app_data_action_success && jappix_app_data_action_job) {
- // Filter success
- jappix_app_data_action_success = parseInt(jappix_app_data_action_success) == 1 ? 'success' : 'error';
-
- // Generate notification namespace
- var jappix_me_notification_ns = jappix_app_name_id + '_' + jappix_app_data_action_type + '_' + jappix_app_data_action_job + '_' + jappix_app_data_action_success;
-
- // Open a new notification
- Notification.create(jappix_me_notification_ns, xid, [jappix_app_name_value, jappix_app_data_url_value], body);
-
- Console.log('Jappix Me notification from: ' + xid + ' with namespace: ' + jappix_me_notification_ns);
-
- is_exit = true;
- }
- }
- } catch(e) {
- Console.error('Message._handleJappixApp', e);
- } finally {
- return is_exit;
- }
-
- };
-
-
- /**
- * Handles invite messages
- * @private
- * @param {string} body
- * @param {object} node
- * @return {boolean}
- */
- self._handleInvite = function(body, node) {
-
- try {
- var node_sel = $(node);
-
- // We get the needed values
- var iFrom = node_sel.find('x[xmlns="' + NS_MUC_USER + '"] invite').attr('from');
- var iRoom = node_sel.find('x[xmlns="' + NS_XCONFERENCE + '"]').attr('jid') || from;
-
- // We display the notification
- Notification.create('invite_room', iFrom, [iRoom], body);
-
- Console.log('Invite Request from: ' + iFrom + ' to join: ' + iRoom);
- } catch(e) {
- Console.error('Message._handleInvite', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Handles request messages
- * @private
- * @param {string} xid
- * @param {object} message
- * @param {string} body
- * @return {boolean}
- */
- self._handleRequest = function(xid, message, body) {
-
- try {
- // Open a new notification
- Notification.create('request', xid, [message], body);
-
- Console.log('HTTP Request from: ' + xid);
- } catch(e) {
- Console.error('Message._handleRequest', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Handles OOB messages
- * @private
- * @param {string} from
- * @param {string} xid
- * @param {string} id
- * @param {object} node
- * @return {boolean}
- */
- self._handleOOB = function(from, xid, id, node) {
-
- try {
- OOB.handle(from, id, 'x', node);
-
- Console.log('Message OOB request from: ' + xid);
- } catch(e) {
- Console.error('Message._handleOOB', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Handles Roster Item Exchange messages
- * @private
- * @param {string} xid
- * @param {object} message
- * @param {string} body
- * @return {boolean}
- */
- self._handleRosterItemExchange = function(xid, message, body) {
-
- try {
- // Open a new notification
- Notification.create('rosterx', xid, [message], body);
-
- Console.log('Roster Item Exchange from: ' + xid);
- } catch(e) {
- Console.error('Message._handleRosterItemExchange', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Handles attention messages
- * @private
- * @param {string} xid
- * @param {string} body
- * @return {boolean}
- */
- self._handleAttention = function(xid, body) {
-
- try {
- Attention.receive(xid, body);
- } catch(e) {
- Console.error('Message._handleAttention', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Handles normal messages
- * @private
- * @param {string} xid
- * @param {string} subject
- * @param {string} body
- * @param {string} delay
- * @return {boolean}
- */
- self._handleNormal = function(xid, subject, body, delay) {
-
- try {
- var message_date = delay || DateUtils.getXMPPTime('utc');
- var message_id = hex_md5(xid + subject + message_date);
-
- // Store the received message
- Inbox.storeMessage(xid, subject, body, 'unread', message_id, message_date);
-
- // Display the inbox message
- if(Common.exists('#inbox')) {
- Inbox.displayMessage(xid, subject, body, 'unread', message_id, message_date);
- }
-
- // Check we have new messages (play a sound if any unread messages)
- if(Inbox.checkMessages()) {
- Audio.play('notification');
- }
-
- // Send it to the server
- Inbox.store();
- } catch(e) {
- Console.error('Message._handleNormal', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Handles Pubsub event messages
- * @private
- * @param {string} xid
- * @param {string} hash
- * @param {object} message
- * @param {object} node
- * @return {boolean}
- */
- self._handlePubsub = function(xid, hash, message, node) {
-
- try {
- // We get the needed values
- var items_sel = $(node).find('event items');
- var node_attr = items_sel.attr('node');
- var text;
-
- // Turn around the different result cases
- if(node_attr) {
- switch(node_attr) {
- // Mood
- case NS_MOOD:
- // Retrieve the values
- var mood = items_sel.find('mood');
- var value = '';
- text = '';
-
- // There's something
- if(mood.children().size()) {
- value = node.getElementsByTagName('mood').item(0).childNodes.item(0).nodeName || '';
- text = mood.find('text').text();
- }
-
- // Store the PEP event (and display it)
- PEP.store(xid, 'mood', value, text);
-
- break;
-
- // Activity
- case NS_ACTIVITY:
- // Retrieve the values
- var activity_sel = items_sel.find('activity');
- text = '';
-
- // There's something
- if(activity_sel.children().size()) {
- value = node.getElementsByTagName('activity').item(0).childNodes.item(0).nodeName || '';
- text = activity_sel.find('text').text();
- }
-
- // Store the PEP event (and display it)
- PEP.store(xid, 'activity', value, text);
-
- break;
-
- // Tune
- case NS_TUNE:
- // Retrieve the values
- var tune_sel = items_sel.find('tune');
- var artist = tune_sel.find('artist').text();
- var source = tune_sel.find('source').text();
- var title = tune_sel.find('title').text();
- var uri = tune_sel.find('uri').text();
-
- // Store the PEP event (and display it)
- PEP.store(xid, 'tune', artist, title, source, uri);
-
- break;
-
- // Geolocation
- case NS_GEOLOC:
- // Retrieve the values
- var geoloc_sel = items_sel.find('geoloc');
- var lat = geoloc_sel.find('lat').text();
- var lon = geoloc_sel.find('lon').text();
-
- // Any extra-values?
- var locality = geoloc_sel.find('locality').text();
- var region = geoloc_sel.find('region').text();
- var country = geoloc_sel.find('country').text();
- var human = PEP.humanPosition(locality, region, country);
-
- // Store the PEP event (and display it)
- PEP.store(xid, 'geoloc', lat, lon, human);
-
- break;
-
- // Microblog
- case NS_URN_MBLOG:
- Microblog.display(message, xid, hash, 'mixed', 'push');
-
- break;
-
- // Inbox
- case NS_URN_INBOX:
- // Do not handle friend's notifications
- if(xid == Common.getXID()) {
- Notification.handle(message);
- }
-
- break;
- }
- }
- } catch(e) {
- Console.error('Message._handlePubsub', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Handles room topic messages
- * @private
- * @param {string} type
- * @param {string} from
- * @param {string} hash
- * @param {string} subject
- * @param {string} resource
- * @param {string} time
- * @param {string} stamp
- * @return {undefined}
- */
- self._handleRoomTopic = function(type, from, hash, subject, resource, time, stamp) {
-
- try {
- // Filter the vars
- var filter_subject = subject.replace(/\n+/g, ' ');
- var filteredSubject = Filter.message(filter_subject, resource, true);
- var filteredName = resource.htmlEnc();
-
- // Display the new subject at the top
- $('#' + hash + ' .top .name .bc-infos .muc-topic').replaceWith(
- '' + filteredSubject + ' '
- );
-
- // Display the new subject as a system message
- if(resource) {
- var topic_body = filteredName + ' ' + Common._e("changed the subject to:") + ' ' + Filter.message(subject, resource, true);
- self.display(type, from, hash, filteredName, topic_body, time, stamp, 'system-message', false);
- }
- } catch(e) {
- Console.error('Message._handleRoomTopic', e);
- }
-
- };
-
-
- /**
- * Handles groupchat messages
- * @private
- * @param {string} from
- * @param {string} hash
- * @param {string} type
- * @param {string} resource
- * @param {string} id
- * @param {string} body
- * @param {string} raw_body
- * @param {string} time
- * @param {number} stamp
- * @param {boolean} html_escape
- * @param {string} delay
- * @param {object} message_edit
- * @param {boolean} is_storable
- * @return {undefined}
- */
- self._handleGroupchat = function(from, hash, type, resource, id, body, raw_body, time, stamp, html_escape, delay, message_edit, is_storable) {
-
- try {
- /* REF: http://xmpp.org/extensions/xep-0045.html */
-
- // Message type
- var message_type = 'user-message';
-
- if(delay && resource) {
- // Old message
- message_type = 'old-message';
- } else if(!resource) {
- // System message
- message_type = 'system-message';
- }
-
- var nickQuote = '';
-
- // If this is not an old message
- if(message_type == 'user-message') {
- var myNick = Name.getMUCNick(hash);
-
- // If an user quoted our nick (with some checks)
- var regex = new RegExp('((^)|( )|(@))' + Common.escapeRegex(myNick) + '(($)|(:)|(,)|( ))', 'gi');
-
- if(body.match(regex) && (myNick != resource) && (message_type == 'user-message')) {
- nickQuote = ' my-nick';
- }
-
- // We notify the user if there's a new personal message
- if(nickQuote) {
- Interface.messageNotify(hash, 'personal');
- Board.quick(from, 'groupchat', raw_body, resource);
- Audio.play('receive-message');
- }
-
- // We notify the user there's a new unread MUC message
- else {
- Interface.messageNotify(hash, 'unread');
-
- // Play sound to all users in the MUC, except user who sent the message.
- if(myNick != resource) {
- Audio.play('receive-message');
- }
- }
- }
-
- // Display the received message
- self.display(
- type,
- from,
- hash,
- resource.htmlEnc(),
- body,
- time,
- stamp,
- message_type,
- html_escape,
- nickQuote,
- undefined,
- id,
- undefined,
- undefined,
- message_edit.is_edited,
- message_edit.next_count,
- is_storable
- );
- } catch(e) {
- Console.error('Message._handleGroupchat', e);
- }
-
- };
-
-
- /**
- * Handles chat messages
- * @private
- * @param {string} from
- * @param {string} xid
- * @param {string} hash
- * @param {string} type
- * @param {string} resource
- * @param {string} id
- * @param {string} body
- * @param {string} raw_body
- * @param {string} time
- * @param {number} stamp
- * @param {boolean} html_escape
- * @param {object} message_edit
- * @param {boolean} is_storable
- * @param {boolean} is_markable
- * @param {boolean} is_groupchat_user
- * @param {object} message
- * @return {undefined}
- */
- self._handleChat = function(from, xid, hash, type, resource, id, body, raw_body, time, stamp, html_escape, message_edit, is_storable, is_markable, is_groupchat_user, message) {
-
- try {
- // Gets the nickname of the user
- var fromName = resource;
- var chatType = 'chat';
-
- // Must send a receipt notification?
- if(Receipts.has(message) && (id !== null)) {
- Receipts.sendReceived(type, from, id);
- }
-
- // It does not come from a groupchat user, get the full name
- if(!is_groupchat_user) {
- fromName = Name.getBuddy(xid);
- } else {
- chatType = 'private';
- }
-
- // If the chat isn't yet opened, open it !
- if(!Common.exists('#' + hash)) {
- // We create a new chat
- Chat.create(hash, xid, fromName, chatType);
-
- // We tell the user that a new chat has started
- Audio.play('new-chat');
- } else {
- Audio.play('receive-message');
- }
-
- // Display the received message
- var message_sel = self.display(
- type,
- xid,
- hash,
- fromName.htmlEnc(),
- body,
- time,
- stamp,
- 'user-message',
- html_escape,
- '',
- 'him',
- id,
- undefined,
- undefined,
- message_edit.is_edited,
- message_edit.next_count,
- is_storable,
- is_markable
- );
-
- // We notify the user
- Interface.messageNotify(hash, 'personal');
- Board.quick(xid, 'chat', raw_body, fromName);
-
- // Mark the message
- if(is_markable === true && Markers.hasSupport(xid)) {
- var mark_type = Markers.MARK_TYPE_RECEIVED;
-
- if(Interface.hasChanFocus(hash) === true) {
- mark_type = Markers.MARK_TYPE_DISPLAYED;
- }
-
- Markers.change(from, mark_type, id, message_sel);
- }
- } catch(e) {
- Console.error('Message._handleChat', e);
- }
-
- };
-
-
- /**
- * Sends an help message
- * @private
- * @param {string} type
- * @param {string} xid
- * @param {string} hash
- * @return {undefined}
- */
- self._sendHelp = function(type, xid, hash) {
-
- try {
- // Help text
- var help_text = '';
- help_text += '' + Common._e("Available shortcuts:") + ' ';
-
- // Shortcuts array
- var shortcuts = [];
-
- // Common shortcuts
- shortcuts.push(Common.printf(Common._e("%s removes the chat logs"), '/clear '));
- shortcuts.push(Common.printf(Common._e("%s joins a groupchat"), '/join jid '));
- shortcuts.push(Common.printf(Common._e("%s closes the chat"), '/part '));
- shortcuts.push(Common.printf(Common._e("%s shows the user profile"), '/whois jid '));
-
- // Groupchat shortcuts
- if(type == 'groupchat') {
- shortcuts.push(Common.printf(Common._e("%s sends a message to the room"), '/say message '));
- shortcuts.push(Common.printf(Common._e("%s changes your nickname"), '/nick nickname '));
- shortcuts.push(Common.printf(Common._e("%s sends a message to someone in the room"), '/msg nickname message '));
- shortcuts.push(Common.printf(Common._e("%s changes the room topic"), '/topic subject '));
- shortcuts.push(Common.printf(Common._e("%s kicks a user of the room"), '/kick [reason:] nickname '));
- shortcuts.push(Common.printf(Common._e("%s bans a user of the room"), '/ban [reason:] nickname '));
- shortcuts.push(Common.printf(Common._e("%s invites someone to join the room"), '/invite jid message '));
- }
-
- // Generate the code from the array
- shortcuts = shortcuts.sort();
-
- for(var s in shortcuts) {
- help_text += shortcuts[s] + ' ';
- }
-
- help_text += '
';
-
- // Display the message
- self.display(type, xid, hash, 'help', help_text, DateUtils.getCompleteTime(), DateUtils.getTimeStamp(), 'system-message', false);
-
- // Reset chatstate
- ChatState.send('active', xid, hash);
- } catch(e) {
- Console.error('Message._sendHelp', e);
- }
-
- };
-
-
- /**
- * Sends a clear message
- * @private
- * @param {string} xid
- * @param {string} hash
- * @return {undefined}
- */
- self._sendClear = function(xid, hash) {
-
- try {
- Chat.clean(hex_md5(xid));
-
- // Reset chatstate
- ChatState.send('active', xid, hash);
- } catch(e) {
- Console.error('Message._sendClear', e);
- }
-
- };
-
-
- /**
- * Sends a join message
- * @private
- * @param {string} xid
- * @param {string} hash
- * @param {string} e_1
- * @param {string} e_2
- * @return {undefined}
- */
- self._sendJoin = function(xid, hash, e_1, e_2) {
-
- try {
- // Join
- var room_gen = Common.generateXID(e_1, 'groupchat');
- var pass = e_2;
-
- Chat.checkCreate(room_gen, 'groupchat');
-
- // Reset chatstate
- ChatState.send('active', xid, hash);
- } catch(e) {
- Console.error('Message._sendJoin', e);
- }
-
- };
-
-
- /**
- * Sends a part message
- * @private
- * @param {string} xid
- * @param {string} type
- * @return {undefined}
- */
- self._sendPart = function(xid, type) {
-
- try {
- Interface.quitThisChat(xid, hex_md5(xid), type);
- } catch(e) {
- Console.error('Message._sendPart', e);
- }
-
- };
-
-
- /**
- * Sends a WHOIS message
- * @private
- * @param {string} type
- * @param {string} xid
- * @param {string} hash
- * @param {string} e_3
- * @return {undefined}
- */
- self._sendWHOIS = function(type, xid, hash, e_3) {
-
- try {
- var whois_xid = RegExp.$3;
-
- // Groupchat WHOIS
- if(type == 'groupchat') {
- nXID = Utils.getMUCUserXID(xid, whois_xid);
-
- if(!nXID) {
- Board.openThisInfo(6);
- } else {
- UserInfos.open(nXID);
- }
- }
-
- // Chat or private WHOIS
- else {
- if(!whois_xid) {
- UserInfos.open(xid);
- } else {
- UserInfos.open(whois_xid);
- }
- }
-
- // Reset chatstate
- ChatState.send('active', xid, hash);
- } catch(e) {
- Console.error('Message._sendWHOIS', e);
- }
-
- };
-
-
- /**
- * Sends an attention message
- * @private
- * @param {string} xid
- * @param {string} e_2
- * @return {undefined}
- */
- self._sendAttention = function(xid, e_2) {
-
- try {
- Attention.send(
- xid,
- $.trim(e_2)
- );
- } catch(e) {
- Console.error('Message._sendAttention', e);
- }
-
- };
-
-
- /**
- * Sends a chat message
- * @private
- * @param {string} xid
- * @param {string} hash
- * @param {string} id
- * @param {string} body
- * @param {object} message_packet
- * @return {undefined}
- */
- self._sendChat = function(xid, hash, id, body, message_packet) {
-
- try {
- message_packet.setType('chat');
-
- // Generates the correct message depending of the choosen style
- var genMsg = self.generate(message_packet, body, hash);
- var html_escape = (genMsg !== 'XHTML');
-
- // Receipt request
- var receipt_request = Receipts.request(hash);
-
- if(receipt_request) {
- message_packet.appendNode('request', {
- 'xmlns': NS_URN_RECEIPTS
- });
- }
-
- // Chatstate
- message_packet.appendNode('active', {
- 'xmlns': NS_CHATSTATES
- });
-
- // Markable message?
- var has_markers = Markers.hasSupport(xid);
-
- if(has_markers === true) {
- Markers.mark(message_packet);
- }
-
- // Send it!
- con.send(message_packet, Errors.handleReply);
-
- // Filter the xHTML message (for us!)
- if(!html_escape) {
- body = Filter.xhtml(message_packet.getNode());
- }
-
- // Finally we display the message we just sent
- var my_xid = Common.getXID();
-
- var message_sel = self.display(
- 'chat',
- my_xid,
- hash,
- Name.getBuddy(my_xid).htmlEnc(),
- body,
- DateUtils.getCompleteTime(),
- DateUtils.getTimeStamp(),
- 'user-message',
- html_escape,
- '',
- 'me',
- id
- );
-
- if(has_markers === true) {
- message_sel.addClass('is-sending');
- message_sel.find('.message-marker').text(
- Common._e("Sending...")
- ).show();
- }
-
- // Receipt timer
- if(receipt_request) {
- Receipts.checkReceived(hash, id);
- }
- } catch(e) {
- Console.error('Message._sendChat', e);
- }
-
- };
-
-
- /**
- * Sends a groupchat say message
- * @private
- * @param {string} hash
- * @param {string} body
- * @param {object} message_packet
- * @return {undefined}
- */
- self._sendGroupchatSat = function(hash, body, message_packet) {
-
- try {
- body = body.replace(/^\/say (.+)/, '$1');
-
- message_packet.setType('groupchat');
- self.generate(message_packet, body, hash);
-
- con.send(message_packet, Errors.handleReply);
- } catch(e) {
- Console.error('Message._sendGroupchatSat', e);
- }
-
- };
-
-
- /**
- * Sends a groupchat nick message
- * @private
- * @param {string} xid
- * @param {string} hash
- * @param {string} nick
- * @param {string} body
- * @return {undefined}
- */
- self._sendGroupchatNick = function(xid, hash, e_1, body) {
-
- try {
- var nick = $.trim(e_1);
-
- // Does not exist yet?
- if(nick && !Utils.getMUCUserXID(xid, nick)) {
- // Send a new presence
- Presence.send(
- (xid + '/' + nick),
- '',
- Presence.getUserShow(),
- Presence.getUserStatus(),
- '',
- false,
- false,
- Errors.handleReply
- );
-
- // Change the stored nickname
- $('#' + hex_md5(xid)).attr('data-nick', escape(nick));
-
- // Reset chatstate
- ChatState.send('active', xid, hash);
- }
- } catch(e) {
- Console.error('Message._sendGroupchatNick', e);
- }
-
- };
-
-
- /**
- * Sends a groupchat msg message
- * @private
- * @param {string} xid
- * @param {string} hash
- * @param {string} e_1
- * @param {string} e_2
- * @param {object} message_packet
- * @return {undefined}
- */
- self._sendGroupchatMsg = function(xid, hash, e_1, e_2, message_packet) {
-
- try {
- var msg_nick = e_1;
- var msg_body = e_2;
- var nick_xid = Utils.getMUCUserXID(xid, msg_nick);
-
- // We check if the user exists
- if(!nick_xid) {
- Board.openThisInfo(6);
- } else if(msg_body) {
- message_packet.setType('chat');
- message_packet.setTo(nick_xid);
- self.generate(message_packet, msg_body, hash);
-
- con.send(message_packet, Errors.handleReply);
- }
- } catch(e) {
- Console.error('Message._sendGroupchatMsg', e);
- }
-
- };
-
-
- /**
- * Sends a groupchat XXX message
- * @private
- * @param {string} xid
- * @param {string} hash
- * @param {string} body
- * @param {object} message_packet
- * @return {undefined}
- */
- self._sendGroupchatTopic = function(xid, hash, body, message_packet) {
-
- try {
- var topic = body.replace(/^\/topic (.+)/, '$1');
-
- message_packet.setType('groupchat');
- message_packet.setSubject(topic);
-
- con.send(message_packet, Errors.handleMessage);
-
- // Reset chatstate
- ChatState.send('active', xid, hash);
- } catch(e) {
- Console.error('Message._sendGroupchatTopic', e);
- }
-
- };
-
-
- /**
- * Sends a groupchat XXX message
- * @private
- * @param {string} xid
- * @param {string} hash
- * @param {string} body
- * @param {string} e_1
- * @param {string} e_2
- * @return {undefined}
- */
- self._sendGroupchatBan = function(xid, hash, body, e_1, e_2) {
-
- try {
- var ban_nick = $.trim(e_1);
- var ban_reason = '';
-
- // We check if the user exists, if not it may be because a reason is given
- // we do not check it at first because the nickname could contain ':'
- var ban_xid = Utils.getMUCUserRealXID(xid, ban_nick);
-
- if(!ban_xid && (body.match(/^\/ban ([^:]+)[:]*(.*)/))) {
- ban_reason = $.trim(e_1);
- ban_nick = $.trim(e_2);
-
- if(ban_nick.length === 0) {
- ban_nick = ban_reason;
- ban_reason = '';
- }
-
- ban_xid = Utils.getMUCUserXID(xid, ban_nick);
- }
-
- Groupchat.banUser(xid, ban_xid, ban_reason);
-
- // Reset chatstate
- ChatState.send('active', xid, hash);
- } catch(e) {
- Console.error('Message._sendGroupchatBan', e);
- }
-
- };
-
-
- /**
- * Sends a groupchat XXX message
- * @private
- * @param {string} xid
- * @param {string} hash
- * @param {string} body
- * @param {string} e_1
- * @param {string} e_2
- * @return {undefined}
- */
- self._sendGroupchatKick = function(xid, hash, body, e_1, e_2) {
-
- try {
- var kick_nick = $.trim(e_1);
- var kick_reason = '';
-
- // We check if the user exists, if not it may be because a reason is given
- // we do not check it at first because the nickname could contain ':'
- var kick_xid = Utils.getMUCUserRealXID(xid, kick_nick);
-
- if(!kick_xid && (body.match(/^\/kick ([^:]+)[:]*(.*)/))) {
- kick_reason = $.trim(e_1);
- kick_nick = $.trim(e_2);
-
- if(kick_nick.length === 0) {
- kick_nick = kick_reason;
- kick_reason = '';
- }
-
- kick_xid = Utils.getMUCUserXID(xid, kick_nick);
- }
-
- Groupchat.kickUser(xid, kick_xid, kick_nick, kick_reason);
-
- // Reset chatstate
- ChatState.send('active', xid, hash);
- } catch(e) {
- Console.error('Message._sendGroupchatKick', e);
- }
-
- };
-
-
- /**
- * Sends a groupchat XXX message
- * @private
- * @param {string} xid
- * @param {string} hash
- * @param {string} e_1
- * @param {string} e_2
- * @param {object} message_packet
- * @return {undefined}
- */
- self._sendGroupchatInvite = function(xid, hash, e_1, e_2, message_packet) {
-
- try {
- var i_xid = e_1;
- var invite_reason = e_2;
-
- var x = message_packet.appendNode('x', {
- 'xmlns': NS_MUC_USER
- });
-
- var node = x.appendChild(message_packet.buildNode('invite', {
- 'to': i_xid,
- 'xmlns': NS_MUC_USER
- }));
-
- if(invite_reason) {
- node.appendChild(message_packet.buildNode('reason', {
- 'xmlns': NS_MUC_USER
- }, invite_reason));
- }
-
- con.send(message_packet, Errors.handleReply);
-
- // Reset chatstate
- ChatState.send('active', xid, hash);
- } catch(e) {
- Console.error('Message._sendGroupchatInvite', e);
- }
-
- };
-
-
- /**
- * Sends a groupchat XXX message
- * @private
- * @param {string} xid
- * @param {string} hash
- * @param {string} type
- * @param {string} body
- * @param {object} message_packet
- * @return {undefined}
- */
- self._sendGroupchatMessage = function(xid, hash, type, body, message_packet) {
-
- try {
- message_packet.setType('groupchat');
-
- // Chatstate
- message_packet.appendNode('active', {
- 'xmlns': NS_CHATSTATES
- });
-
- self.generate(message_packet, body, hash);
-
- con.send(message_packet, Errors.handleMessage);
-
- Console.info('Message sent to: ' + xid + ' / ' + type);
- } catch(e) {
- Console.error('Message._sendGroupchatMessage', e);
- }
-
- };
-
-
- /**
- * Sends a groupchat message
- * @private
- * @param {string} xid
- * @param {string} hash
- * @param {string} type
- * @param {string} body
- * @param {object} message_packet
- * @return {undefined}
- */
- self._sendGroupchat = function(xid, hash, type, body, message_packet) {
-
- try {
- // /say shortcut
- if(body.match(/^\/say (.+)/)) {
- self._sendGroupchatSat(
- hash,
- body,
- message_packet
- );
- }
-
- // /nick shortcut
- else if(body.match(/^\/nick (.+)/)) {
- self._sendGroupchatNick(
- xid,
- hash,
- RegExp.$1,
- body
- );
- }
-
- // /msg shortcut
- else if(body.match(/^\/msg (\S+)\s+(.+)/)) {
- self._sendGroupchatMsg(
- xid,
- hash,
- RegExp.$1,
- RegExp.$2,
- message_packet
- );
- }
-
- // /topic shortcut
- else if(body.match(/^\/topic (.+)/)) {
- self._sendGroupchatTopic(
- xid,
- hash,
- body,
- message_packet
- );
- }
-
- // /ban shortcut
- else if(body.match(/^\/ban (.*)/)) {
- self._sendGroupchatBan(
- xid,
- hash,
- body,
- RegExp.$1,
- RegExp.$2
- );
- }
-
- // /kick shortcut
- else if(body.match(/^\/kick (.*)/)) {
- self._sendGroupchatKick(
- xid,
- hash,
- body,
- RegExp.$1,
- RegExp.$2
- );
- }
-
- // /invite shortcut
- else if(body.match(/^\/invite (\S+)\s*(.*)/)) {
- self._sendGroupchatInvite(
- xid,
- hash,
- RegExp.$1,
- RegExp.$2,
- message_packet
- );
- }
-
- // No shortcut, this is a message
- else {
- self._sendGroupchatMessage(
- xid,
- hash,
- type,
- body,
- message_packet
- );
- }
- } catch(e) {
- Console.error('Message._sendGroupchat', e);
- }
-
- };
-
-
- /**
- * Handles the incoming message packets
- * @public
- * @param {object} message
- * @return {boolean}
- */
- self.handle = function(message) {
-
- try {
- // Error packet? Stop!
- if(Errors.handleReply(message)) {
- return;
- }
-
- // Carbon-forwarded message?
- if(message.getChild('sent', NS_URN_CARBONS)) {
- Carbons.handleSent(message); return;
- }
- if(message.getChild('received', NS_URN_CARBONS)) {
- Carbons.handleReceived(message); return;
- }
-
- // MAM-forwarded message?
- var c_mam = message.getChild('result', NS_URN_MAM);
-
- if(c_mam) {
- return self._handleMAM(c_mam);
- }
-
- // We get the message items
- var from = Common.fullXID(Common.getStanzaFrom(message));
- var id = message.getID();
- var type = message.getType();
- var body = $.trim(message.getBody());
- var node = message.getNode();
- var subject = $.trim(message.getSubject());
-
- // Keep raw message body
- var raw_body = body;
-
- // We generate some values
- var xid = Common.bareXID(from);
- var resource = Common.thisResource(from);
- var hash = hex_md5(xid);
- var xHTML_sel = $(node).find('html body');
- var xHTML = xHTML_sel.size();
- var is_groupchat_user = false;
-
- // Check for non-empty body
- var has_body = (((xHTML && Filter.has_xhtml_body(xHTML_sel)) || body) && true);
-
- // This message comes from a Muji room (ignore)
- if(Muji.is_room(xid)) {
- return false;
- }
-
- // This message comes from a groupchat user
- if(Utils.isPrivate(xid) && ((type == 'chat') || !type) && resource) {
- is_groupchat_user = true;
- xid = from;
- hash = hex_md5(xid);
- }
-
- // Get message date
- var time, stamp;
- var delay = DateUtils.readMessageDelay(node);
-
- // Any delay?
- if(delay) {
- time = DateUtils.relative(delay);
- stamp = DateUtils.extractStamp(Date.jab2date(delay));
- } else {
- time = DateUtils.getCompleteTime();
- stamp = DateUtils.extractStamp(new Date());
- }
-
- // Received message
- if(Receipts.hasReceived(message)) {
- return Receipts.messageReceived(hash, id);
- }
-
- // Chatstate message
- if(node && !delay &&
- ((((type == 'chat') || !type) && !Common.exists('#page-switch .' + hash + ' .unavailable')) || (type == 'groupchat'))) {
- self._handleChatstate(from, hash, type, node);
- }
-
- // Jappix App message
- if(message.getChild('app', 'jappix:app')) {
- if(self._handleJappixApp(xid, body, node) === true) {
- return false;
- }
- }
-
- // Invite message
- if($(node).find('x[xmlns="' + NS_MUC_USER + '"] invite').size()) {
- return self._handleInvite(body, node);
- }
-
- // Request message
- if(message.getChild('confirm', NS_HTTP_AUTH)) {
- return self._handleRequest(xid, message, body);
- }
-
- // OOB message
- if(message.getChild('x', NS_XOOB)) {
- return self._handleOOB(from, xid, id, node);
- }
-
- // Roster Item Exchange message
- if(message.getChild('x', NS_ROSTERX)) {
- return self._handleRosterItemExchange(xid, message, body);
- }
-
- // Attention message
- if(message.getChild('attention', NS_URN_ATTENTION)) {
- return self._handleAttention(xid, body);
- }
-
- // Normal message
- if((type == 'normal') && body) {
- return self._handleNormal(xid, subject, body, delay);
- }
-
- // PubSub event
- if($(node).find('event').attr('xmlns') == NS_PUBSUB_EVENT) {
- return self._handlePubsub(xid, hash, message, node);
- }
-
- // If this is a room topic message
- if(subject && (type == 'groupchat')) {
- self._handleRoomTopic(type, from, hash, subject, resource, time, stamp);
- }
-
- // If the message has a content
- if(has_body === true) {
- var filteredMessage;
- var html_escape = true;
-
- // IE bug fix
- if((BrowserDetect.browser == 'Explorer') && (BrowserDetect.version < 9)) {
- xHTML = 0;
- }
-
- // If this is a xHTML message
- if(xHTML) {
- html_escape = false;
-
- // Filter the xHTML message
- body = Filter.xhtml(node);
- }
-
- // Catch message edit (XEP-0308)
- var message_edit = Correction.catch(message, hash, type);
-
- // Storable message?
- var is_storable = message.getChild('no-permanent-storage', NS_URN_HINTS) ? false : true;
-
- // Groupchat message
- if(type == 'groupchat') {
- self._handleGroupchat(
- from,
- hash,
- type,
- resource,
- id,
- body,
- raw_body,
- time,
- stamp,
- html_escape,
- delay,
- message_edit,
- is_storable
- );
- } else {
- // Markable message?
- var is_markable = Markers.hasRequestMarker(node);
-
- self._handleChat(
- from,
- xid,
- hash,
- type,
- resource,
- id,
- body,
- raw_body,
- time,
- stamp,
- html_escape,
- message_edit,
- is_storable,
- is_markable,
- is_groupchat_user,
- message
- );
- }
- }
-
- // Message marker?
- if(Markers.hasResponseMarker(node)) {
- return Markers.handle(from, node, false, is_groupchat_user);
- }
-
- return false;
- } catch(e) {
- Console.error('Message.handle', e);
- }
-
- };
-
-
- /**
- * Sends a given message
- * @public
- * @param {string} hash
- * @param {string} type
- * @return {boolean}
- */
- self.send = function(hash, type) {
-
- try {
- // Get the values
- var message_area = $('#' + hash + ' .message-area');
- var body = $.trim(message_area.val());
- var xid = unescape(message_area.attr('data-to'));
- var nXID;
-
- // If the user didn't entered any message, stop
- if(!body || !xid) {
- return false;
- }
-
- // We send the message through the XMPP network
- var message_packet = new JSJaCMessage();
- message_packet.setTo(xid);
-
- // Set an ID
- var id = genID();
- message_packet.setID(id);
-
- // /help shortcut
- if(body.match(/^\/help\s*(.*)/)) {
- self._sendHelp(type, xid, hash);
- }
-
- // /clear shortcut
- else if(body.match(/^\/clear/)) {
- self._sendClear(xid, hash);
- }
-
- // /join shortcut
- else if(body.match(/^\/join (\S+)\s*(.*)/)) {
- self._sendJoin(xid, hash, RegExp.$1, RegExp.$2);
- }
-
- // /part shortcut
- else if(body.match(/^\/part\s*(.*)/) &&
- (!Utils.isAnonymous() || (Utils.isAnonymous() &&
- (xid != Common.generateXID(ANONYMOUS_ROOM, 'groupchat'))))) {
- self._sendPart(xid, type);
- }
-
- // /whois shortcut
- else if(body.match(/^\/whois(( (\S+))|($))/)) {
- self._sendWHOIS(type, xid, hash, RegExp.$3);
- }
-
- // /attention shortcut
- else if(body.match(/^\/attention( (.*))?/) && type == 'chat') {
- self._sendAttention(xid, RegExp.$2);
- }
-
- // Chat message type
- else if(type == 'chat') {
- self._sendChat(
- xid,
- hash,
- id,
- body,
- message_packet
- );
- }
-
- // Groupchat message type
- else if(type == 'groupchat') {
- self._sendGroupchat(
- xid,
- hash,
- type,
- body,
- message_packet
- );
- }
-
- // We reset the message input
- $('#' + hash + ' .message-area').val('');
- } catch(e) {
- Console.error('Message.send', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Generates the correct message area style
- * @public
- * @param {string} hash
- * @return {string}
- */
- self.generateStyle = function() {
-
- try {
- // Initialize the vars
- var styles = '#' + hash + ' div.bubble-style';
- var font = styles + ' a.font-current';
- var fontsize = styles + ' a.fontsize-current';
- var checkbox = styles + ' input[type="checkbox"]';
- var color = '#' + hash + ' .message-area[data-color]';
- var style = '';
-
- // Get the font value
- $(font).filter('[data-font]').each(function() {
- style += 'font-family: ' + $(this).attr('data-font') + ';';
- });
-
- // Get the font value
- $(fontsize).filter('[data-value]').each(function() {
- style += 'font-size: ' + $(this).attr('data-value') + 'px;';
- });
-
- // Loop the input values
- $(checkbox).filter(':checked').each(function() {
- // If there is a previous element
- if(style) {
- style += ' ';
- }
-
- // Get the current style
- switch($(this).attr('class')) {
- case 'bold':
- style += 'font-weight: bold;';
- break;
-
- case 'italic':
- style += 'font-style: italic;';
- break;
-
- case 'underline':
- style += 'text-decoration: underline;';
- break;
- }
- });
-
- // Get the color value
- $(color).each(function() {
- style += 'color: #' + $(this).attr('data-color');
- });
-
- return style;
- } catch(e) {
- Console.error('Message.generateStyle', e);
- }
-
- };
-
-
- /**
- * Read messages from local archive
- * @public
- * @param {string} hash
- * @return {string}
- */
- self.readLocalArchive = function(hash) {
-
- try {
- return DataStore.getPersistent(Common.getXID(), 'history', hash);
- } catch(e) {
- Console.error('Message.readLocalArchive', e);
- }
-
- };
-
-
- /**
- * Stores message in local archive
- * @public
- * @param {string} hash
- * @param {string} store_html
- * @return {undefined}
- */
- self.storeLocalArchive = function(hash, store_html) {
-
- try {
- if(DataStore.getDB(Connection.desktop_hash, 'options', 'localarchives') != '0') {
- DataStore.setPersistent(Common.getXID(), 'history', hash, store_html);
- }
- } catch(e) {
- Console.error('Message.storeLocalArchive', e);
- }
-
- };
-
-
- /**
- * Removes messages from local archive
- * @public
- * @param {string} hash
- * @return {undefined}
- */
- self.removeLocalArchive = function(hash) {
-
- try {
- DataStore.removePersistent(Common.getXID(), 'history', hash);
- } catch(e) {
- Console.error('Message.removeLocalArchive', e);
- }
-
- };
-
-
- /**
- * Flushes local messages archive
- * @public
- * @return {undefined}
- */
- self.flushLocalArchive = function() {
-
- try {
- var flush_count = 0;
- var db_regex = new RegExp(('^' + Common.getXID() + '_') + ('history_'));
-
- for(var i = 0; i < JappixDataStore.storagePersistent.length; i++) {
- var db_current = JappixDataStore.storagePersistent.key(i);
-
- if(db_regex.exec(db_current)) {
- JappixDataStore.storagePersistent.removeItem(db_current);
- flush_count++;
- }
- }
-
- Console.info('Flushed ' + flush_count + ' archives in total.');
- } catch(e) {
- Console.error('Message.flushLocalArchive', e);
- }
-
- };
-
-
- /**
- * Generates the correct message code
- * @public
- * @param {object} message_packet
- * @param {string} body
- * @param {string} hash
- * @return {string}
- */
- self.generate = function(message_packet, body, hash) {
-
- try {
- // Create the classical body
- message_packet.setBody(body);
-
- // Get the style
- var style = $('#' + hash + ' .message-area').attr('style');
-
- // A message style is choosen
- if(style) {
- // Explode the message body new lines (to create one
element by line)
- var new_lines = new Array(body);
-
- if(body.match(/\n/)) {
- new_lines = body.split('\n');
- }
-
- // Create the XML elements
- var html_node = message_packet.appendNode('html', {
- 'xmlns': NS_XHTML_IM
- });
-
- var body_node = html_node.appendChild(message_packet.buildNode('body', {
- 'xmlns': NS_XHTML
- }));
-
- // Use the exploded body array to create one element per entry
- for(var i in new_lines) {
- // Current line
- var cLine = new_lines[i];
-
- // Blank line, we put a
- if(cLine.match(/(^)(\s+)($)/) || !cLine) {
- body_node.appendChild(message_packet.buildNode('br', {'xmlns': NS_XHTML}));
- }
-
- // Line with content, we put a
- else {
- // HTML encode the line
- cLine = cLine.htmlEnc();
-
- // Filter the links
- cLine = Links.apply(cLine, 'xhtml-im', style);
-
- // Append the filtered line
- $(body_node).append($('' + cLine + '
'));
- }
- }
-
- return 'XHTML';
- }
-
- return 'PLAIN';
- } catch(e) {
- Console.error('Message.generate', e);
- }
-
- };
-
-
- /**
- * Displays a given message in a chat tab
- * @public
- * @param {string} type
- * @param {string} xid
- * @param {string} hash
- * @param {string} name
- * @param {string} body
- * @param {string} time
- * @param {string} stamp
- * @param {string} message_type
- * @param {boolean} html_escape
- * @param {string} nick_quote
- * @param {string} mode
- * @param {string} id
- * @param {object} c_target_sel
- * @param {boolean} no_scroll
- * @param {boolean} is_edited
- * @param {number} edit_count
- * @param {boolean} is_storable
- * @param {boolean} is_markable
- * @return {object}
- */
- self.display = function(type, xid, hash, name, body, time, stamp, message_type, html_escape, nick_quote, mode, id, c_target_sel, no_scroll, is_edited, edit_count, is_storable, is_markable) {
-
- var message_sel = null;
-
- try {
- // Target
- if(typeof c_target_sel === 'undefined') {
- c_target_sel = $('#' + hash + ' .content');
- }
-
- // Auto-calculate mode for groupchat?
- if(type == 'groupchat' && !mode) {
- var own_groupchat_nickname = $('#' + hash).attr('data-nick') || '';
- own_groupchat_nickname = unescape(own_groupchat_nickname);
-
- if(name == own_groupchat_nickname) {
- mode = 'me';
- } else {
- mode = 'him';
- }
- }
-
- // Generate some stuffs
- var has_avatar = false;
- var xid_hash = '';
-
- if(!nick_quote) {
- nick_quote = '';
- }
-
- if(message_type != 'system-message') {
- has_avatar = true;
- xid_hash = hex_md5(xid);
- }
-
- // Can scroll?
- var cont_scroll = document.getElementById('chat-content-' + hash);
- var can_scroll = false;
-
- if((!cont_scroll.scrollTop || ((cont_scroll.clientHeight + cont_scroll.scrollTop) == cont_scroll.scrollHeight)) && no_scroll !== true) {
- can_scroll = true;
- }
-
- // Any ID?
- var data_id = '';
-
- if(id) {
- data_id = ' data-id="' + id + '"';
- }
-
- // Edited state?
- var data_edited = '';
- var data_edit_count = '';
-
- if(is_edited === true) {
- data_edited = ' data-edited="true"';
- data_edit_count = ' data-edit-count="' + (edit_count || 0) + '"';
- }
-
- // Markable state?
- var data_markable = (is_markable === true) ? ' data-markable="true"' : '';
-
- // Filter the message
- var filteredMessage = Filter.message(body, name, html_escape);
-
- // Display the received message in the room
- var message_code = '';
-
- // Name color attribute
- if(type == 'groupchat') {
- attribute = ' style="color: ' + Common.generateColor(name) + ';" class="name';
- } else {
- attribute = ' class="name';
-
- if(mode) {
- attribute += ' ' + mode;
- }
- }
-
- // Close the class attribute
- if(message_type == 'system-message') {
- attribute += ' hidden"';
- } else {
- attribute += '"';
- }
-
- // Filter the previous displayed message
- var last = c_target_sel.find('.one-group:not(.from-history):last');
- var last_name = last.find('b.name').attr('data-xid');
- var last_type = last.attr('data-type');
- var last_stamp = parseInt(last.attr('data-stamp'));
- var grouped = false;
-
- // We can group it with another previous message
- if((last_name == xid) && (message_type == last_type) && ((stamp - last_stamp) <= 1800)) {
- grouped = true;
- }
-
- // Is it a /me command?
- if(body.match(/(^|>)(\/me )([^<]+)/)) {
- filteredMessage = '' + filteredMessage + ' ';
- }
-
- message_code += filteredMessage + '
';
-
- // Message correction containers
- if(message_type == 'user-message') {
- // Message edit properties
- message_code += '
' + Common._e("Edit") + ' ';
-
- if(is_edited === true) {
- var edit_text = Common._e("Edited");
-
- if(edit_count > 1) {
- edit_text = Common._e(Common.printf("Edited (%s)", edit_count));
- }
-
- message_code += '
' + edit_text + ' ';
- }
- }
-
- // Message marker container
- if(type == 'chat') {
- message_code += '
';
- }
-
- message_code += '
';
-
- // Must group it?
- if(!grouped) {
- // Generate message headers
- var message_head = '';
-
- // Any avatar to add?
- if(has_avatar) {
- message_head += ' ';
- }
-
- // Add the date & the name
- message_head += '' + time + ' ' + name + ' ';
-
- // Generate message code
- message_code = '' + message_head + message_code + '
';
- }
-
- // Write the code in the DOM
- if(grouped) {
- c_target_sel.find('.one-group:last').append(message_code);
- } else {
- c_target_sel.append(message_code);
- }
-
- message_sel = c_target_sel.find('.one-line:last');
-
- // Store the last MAM.REQ_MAX message groups
- if(!Features.enabledMAM() && (type == 'chat') && (message_type == 'user-message')) {
- // Filter the DOM
- var dom_filter = $('#' + hash + ' .content').clone().contents();
- var default_avatar = ('./images/others/default-avatar.png').replace(/&/g, '&'); // Fixes #252
-
- $(dom_filter).find('.system-message').parent().remove();
- $(dom_filter).find('.avatar-container img.avatar').attr('src', default_avatar);
- $(dom_filter).find('.one-line').parent().slice(0, $(dom_filter).find('.one-line').parent().size() - MAM.REQ_MAX).remove();
-
- var store_html = $(dom_filter).parent().html();
-
- // Store the data
- if(store_html && is_storable !== false) {
- self.storeLocalArchive(hash, store_html);
- }
-
- if(is_storable === false) {
- Console.info('Message.display', 'Won\'t store message since it\'s labeled as not storable (' + xid + ')');
- }
- }
-
- // Must get the avatar?
- if(has_avatar && xid && !grouped) {
- Avatar.get(xid, 'cache', 'true', 'forget');
- }
-
- // Scroll to this message
- if(can_scroll) {
- Interface.autoScroll(hash);
- }
-
- // Add click events
- var xid_to = $('#' + hash).attr('data-xid');
-
- if(xid_to) {
- xid_to = unescape(xid_to);
-
- $('#' + hash + ' .content .one-line:last .correction-edit').click(function() {
- Correction.enter(xid_to);
- return false;
- });
- }
- } catch(e) {
- Console.error('Message.display', e);
- } finally {
- return message_sel;
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
diff --git a/source/app/javascripts/microblog.js b/source/app/javascripts/microblog.js
deleted file mode 100644
index 3071e0f..0000000
--- a/source/app/javascripts/microblog.js
+++ /dev/null
@@ -1,1967 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the microblog JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Authors: Valérian Saliou, Maranda
-
-*/
-
-// Bundle
-var Microblog = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Completes arrays of an entry's attached files
- * @public
- * @param {string} selector
- * @param {object} tFName
- * @param {object} tFURL
- * @param {object} tFThumb
- * @param {object} tFSource
- * @param {object} tFLength
- * @param {object} tFEComments
- * @param {object} tFNComments
- * @return {undefined}
- */
- self.attached = function(selector, tFName, tFURL, tFThumb, tFSource, tFType, tFLength, tFEComments, tFNComments) {
-
- try {
- tFName.push($(selector).attr('title') || '');
- tFURL.push($(selector).attr('href') || '');
- tFThumb.push($(selector).find('link[rel="self"][title="thumb"]:first').attr('href') || '');
- tFSource.push($(selector).attr('source') || '');
- tFType.push($(selector).attr('type') || '');
- tFLength.push($(selector).attr('length') || '');
-
- // Comments?
- var comments_href_c = $(selector).find('link[rel="replies"][title="comments_file"]:first').attr('href');
-
- if(comments_href_c && comments_href_c.match(/^xmpp:(.+)\?;node=(.+)/)) {
- tFEComments.push(RegExp.$1);
- tFNComments.push(decodeURIComponent(RegExp.$2));
- } else {
- tFEComments.push('');
- tFNComments.push('');
- }
- } catch(e) {
- Console.error('Microblog.attached', e);
- }
-
- };
-
-
- /**
- * Displays a given microblog item
- * @public
- * @param {object} packet
- * @param {string} from
- * @param {string} hash
- * @param {string} mode
- * @param {string} way
- * @return {undefined}
- */
- self.display = function(packet, from, hash, mode, way) {
-
- try {
- // Get some values
- var iParse = $(packet.getNode()).find('items item');
-
- iParse.each(function() {
- var this_sel = $(this);
-
- // Initialize
- var tContent, tFiltered, tTime, tDate, tStamp, tBody, tName, tID, tHash, tIndividual, tFEClick;
- var tHTMLEscape = false;
-
- // Arrays
- var tFName = [];
- var tFURL = [];
- var tFThumb = [];
- var tFSource = [];
- var tFType = [];
- var tFLength = [];
- var tFEComments = [];
- var tFNComments = [];
- var aFURL = [];
- var aFCat = [];
-
- // Get the values
- tDate = this_sel.find('published').text();
- tBody = this_sel.find('body').text();
- tID = this_sel.attr('id');
- tName = Name.getBuddy(from);
- tHash = 'update-' + hex_md5(tName + tDate + tID);
-
- // Read attached files with a thumb (place them at first)
- this_sel.find('link[rel="enclosure"]:has(link[rel="self"][title="thumb"])').each(function() {
- self.attached(this, tFName, tFURL, tFThumb, tFSource, tFType, tFLength, tFEComments, tFNComments);
- });
-
- // Read attached files without any thumb
- this_sel.find('link[rel="enclosure"]:not(:has(link[rel="self"][title="thumb"]))').each(function() {
- self.attached(this, tFName, tFURL, tFThumb, tFSource, tFType, tFLength, tFEComments, tFNComments);
- });
-
- // Get the repeat value
- var uRepeat = [this_sel.find('author name').text(), Common.explodeThis(':', this_sel.find('author uri').text(), 1)];
- var uRepeated = false;
-
- if(!uRepeat[0])
- uRepeat = [Name.getBuddy(from), uRepeat[1]];
- if(!uRepeat[1])
- uRepeat = [uRepeat[0], from];
-
- // Repeated?
- if(uRepeat[1] != from)
- uRepeated = true;
-
- // Get the comments node
- var entityComments, nodeComments;
-
- // Get the comments
- var comments_href = this_sel.find('link[title="comments"]:first').attr('href');
-
- if(comments_href && comments_href.match(/^xmpp:(.+)\?;node=(.+)/)) {
- entityComments = RegExp.$1;
- nodeComments = decodeURIComponent(RegExp.$2);
- }
-
- // No comments node?
- if(!entityComments || !nodeComments) {
- entityComments = '';
- nodeComments = '';
- }
-
- // Get the stamp & time
- if(tDate) {
- tStamp = DateUtils.extractStamp(Date.jab2date(tDate));
- tTime = DateUtils.relative(tDate);
- }
-
- else {
- tStamp = DateUtils.getTimeStamp();
- tTime = '';
- }
-
- // Get the item geoloc
- var tGeoloc = '';
- var sGeoloc = this_sel.find('geoloc:first');
- var gLat = sGeoloc.find('lat').text();
- var gLon = sGeoloc.find('lon').text();
-
- if(gLat && gLon) {
- tGeoloc += '';
-
- // Human-readable name?
- var gHuman = PEP.humanPosition(
- sGeoloc.find('locality').text(),
- sGeoloc.find('region').text(),
- sGeoloc.find('country').text()
- );
-
- if(gHuman) {
- tGeoloc += gHuman.htmlEnc();
- } else {
- tGeoloc += gLat.htmlEnc() + '; ' + gLon.htmlEnc();
- }
-
- tGeoloc += ' ';
- }
-
- // Entry content: HTML, parse!
- if(this_sel.find('content[type="html"]').size()) {
- // Filter the xHTML message
- tContent = Filter.xhtml(this);
- tHTMLEscape = false;
- }
-
- // Entry content: Fallback on PLAIN?
- if(!tContent) {
- tContent = this_sel.find('content[type="text"]').text();
-
- if(!tContent) {
- // Legacy?
- tContent = this_sel.find('title:not(source > title)').text();
-
- // Last chance?
- if(!tContent) {
- tContent = tBody;
- }
- }
-
- // Trim the content
- tContent = $.trim(tContent);
- tHTMLEscape = true;
- }
-
- // Any content?
- if(tContent) {
- // Apply links to message body
- tFiltered = Filter.message(tContent, tName.htmlEnc(), tHTMLEscape);
-
- // Display the received message
- var html = '' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
-
- '
' +
- '
';
-
- // Is it a repeat?
- if(uRepeated)
- html += ' ';
-
- html += '' + tName.htmlEnc() + ' ' + tFiltered + '
' +
- '
' + tTime + tGeoloc + '
';
-
- // Any file to display?
- if(tFURL.length)
- html += '
';
-
- // Generate an array of the files URL
- for(var a = 0; a < tFURL.length; a++) {
- // Not enough data?
- if(!tFURL[a]) {
- continue;
- }
-
- // Push the current URL! (YouTube or file)
- if(tFURL[a].match(/(\w{3,5})(:)(\S+)((\.youtube\.com\/watch(\?v|\?\S+v|\#\!v|\#\!\S+v)\=)|(youtu\.be\/))([^& ]+)((&\S)|(&\S)|\s|$)/gim)) {
- aFURL.push($.trim(RegExp.$8));
- aFCat.push('youtube');
- }
-
- else if(IntegrateBox.can(Common.strAfterLast('.', tFURL[a]))) {
- aFURL.push(tFURL[a]);
- aFCat.push(Utils.fileCategory(Common.strAfterLast('.', tFURL[a])));
- }
- }
-
- // Add each file code
- for(var f = 0; f < tFURL.length; f++) {
- // Not enough data?
- if(!tFURL[f]) {
- continue;
- }
-
- // Get the file type
- var tFLink = tFURL[f];
- var tFExt = Common.strAfterLast('.', tFLink);
- var tFCat = Utils.fileCategory(tFExt);
-
- // Youtube video?
- if(tFLink.match(/(\w{3,5})(:)(\S+)((\.youtube\.com\/watch(\?v|\?\S+v|\#\!v|\#\!\S+v)\=)|(youtu\.be\/))([^& ]+)((&\S)|(&\S)|\s|$)/gim)) {
- tFLink = $.trim(RegExp.$8);
- tFCat = 'youtube';
- }
-
- // Supported image/video/sound
- if(IntegrateBox.can(tFExt) || (tFCat == 'youtube')) {
- tFEClick = 'onclick="return IntegrateBox.apply(\'' + Utils.encodeOnclick(tFLink) + '\', \'' + Utils.encodeOnclick(tFCat) + '\', \'' + Utils.encodeOnclick(aFURL) + '\', \'' + Utils.encodeOnclick(aFCat) + '\', \'' + Utils.encodeOnclick(tFEComments) + '\', \'' + Utils.encodeOnclick(tFNComments) + '\', \'large\');" ';
- } else {
- tFEClick = '';
- }
-
- // Any thumbnail?
- if(tFThumb[f]) {
- html += ' ';
- } else {
- html += '' + tFName[f].htmlEnc() + ' ';
- }
- }
-
- if(tFURL.length) {
- html += '
';
- }
-
- // It's my own notice, we can remove it!
- if(from == Common.getXID()) {
- html += '
';
- }
-
- // Notice from another user
- else {
- // User profile
- html += '
';
-
- // If PEP is enabled
- if(Features.enabledPEP() && tHTMLEscape) {
- html += '
';
- }
- }
-
- html += '
';
-
- // Mixed mode
- if((mode == 'mixed') && !Common.exists('.mixed .' + tHash)) {
- // Remove the old element
- if(way == 'push') {
- $('#channel .content.mixed .one-update.update_' + hash).remove();
- }
-
- // Get the nearest element
- var nearest = Search.sortElementByStamp(tStamp, '#channel .mixed .one-update');
-
- // Append the content at the right position (date relative)
- if(nearest === 0) {
- $('#channel .content.mixed').append(html);
- } else {
- $('#channel .one-update[data-stamp="' + nearest + '"]:first').before(html);
- }
-
- // Show the new item
- if(way == 'push') {
- $('#channel .content.mixed .one-update.' + tHash).fadeIn('fast');
- } else {
- $('#channel .content.mixed .one-update.' + tHash).show();
- }
-
- // Remove the old notices to make the DOM lighter
- var oneUpdate = '#channel .content.mixed .one-update';
-
- if($(oneUpdate).size() > 80) {
- $(oneUpdate + ':last').remove();
- }
-
- // Click event on avatar/name
- $('.mixed .' + tHash + ' .avatar-container, .mixed .' + tHash + ' .body b').click(function() {
- self.get(from, hash);
- });
- }
-
- // Individual mode
- tIndividual = '#channel .content.individual.microblog-' + hash;
-
- // Can append individual content?
- var can_individual = true;
-
- if($('#channel .top.individual input[name="comments"]').val() && Common.exists(tIndividual + ' .one-update')) {
- can_individual = false;
- }
-
- if(can_individual && Common.exists(tIndividual) && !Common.exists('.individual .' + tHash)) {
- if(mode == 'mixed') {
- $(tIndividual).prepend(html);
- } else {
- $(tIndividual + ' a.more').before(html);
- }
-
- // Show the new item
- if(way == 'push') {
- $('#channel .content.individual .one-update.' + tHash).fadeIn('fast');
- } else {
- $('#channel .content.individual .one-update.' + tHash).show();
- }
-
- // Make 'more' link visible
- $(tIndividual + ' a.more').css('visibility', 'visible');
-
- // Click event on name (if not me!)
- if(from != Common.getXID()) {
- $('.individual .' + tHash + ' .avatar-container, .individual .' + tHash + ' .body b').click(function() {
- Chat.checkCreate(from, 'chat');
- });
- }
- }
-
- // Apply the click event
- $('.' + tHash + ' a.repost:not([data-event="true"])').click(function() {
- return self.publish(tContent, tFName, tFURL, tFType, tFLength, tFThumb, uRepeat, entityComments, nodeComments, tFEComments, tFNComments);
- })
-
- .attr('data-event', 'true');
-
- // Apply the hover event
- if(nodeComments) {
- $('.' + mode + ' .' + tHash).hover(function() {
- self.showComments($(this), entityComments, nodeComments, tHash);
- }, function() {
- if($(this).find('div.comments a.one-comment.loading').size()) {
- $(this).find('div.comments').remove();
- }
- });
- }
- }
- });
-
- // Display the avatar of this buddy
- Avatar.get(from, 'cache', 'true', 'forget');
- } catch(e) {
- Console.error('Microblog.display', e);
- }
-
- };
-
-
- /**
- * Removes a given microblog item
- * @public
- * @param {string} id
- * @param {string} hash
- * @param {string} pserver
- * @param {string} cnode
- * @return {boolean}
- */
- self.remove = function(id, hash, pserver, cnode) {
-
- /* REF: http://xmpp.org/extensions/xep-0060.html#publisher-delete */
-
- try {
- // Initialize
- var selector = $('.' + hash);
- var get_last = false;
-
- // Get the latest item for the mixed mode
- if(Common.exists('#channel .content.mixed .' + hash)) {
- get_last = true;
- }
-
- // Remove the item from our DOM
- selector.fadeOut('fast', function() {
- $(this).remove();
- });
-
- // Send the IQ to remove the item (and get eventual error callback)
- // Also attempt to remove the comments node.
- var retract_iq = new JSJaCIQ();
- retract_iq.setType('set');
-
- retract_iq.appendNode('pubsub', {
- 'xmlns': NS_PUBSUB
- }).appendChild(retract_iq.buildNode('retract', {
- 'node': NS_URN_MBLOG,
- 'xmlns': NS_PUBSUB
- })).appendChild(retract_iq.buildNode('item', {
- 'id': id,
- 'xmlns': NS_PUBSUB
- }));
-
- var comm_delete_iq;
- if(pserver !== '' && cnode !== '') {
- comm_delete_iq = new JSJaCIQ();
- comm_delete_iq.setType('set');
- comm_delete_iq.setTo(pserver);
- comm_delete_iq.appendNode('pubsub', {
- 'xmlns': 'http://jabber.org/protocol/pubsub#owner'
- }).appendChild(comm_delete_iq.buildNode('delete', {
- 'node': cnode,
- 'xmlns': 'http://jabber.org/protocol/pubsub#owner'
- }));
- }
-
- if(get_last) {
- if(comm_delete_iq) {
- con.send(comm_delete_iq);
- }
-
- con.send(retract_iq, self.handleRemove);
- } else {
- if(comm_delete_iq) {
- con.send(comm_delete_iq);
- }
-
- con.send(retract_iq, Errors.handleReply);
- }
- } catch(e) {
- Console.error('Microblog.remove', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Handles the microblog item removal
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleRemove = function(iq) {
-
- try {
- // Handle the error reply
- Errors.handleReply(iq);
-
- // Get the latest item
- self.request(Common.getXID(), '1', false, self.handleUpdateRemove);
- } catch(e) {
- Console.error('Microblog.handleRemove', e);
- }
-
- };
-
-
- /**
- * Handles the microblog update
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleUpdateRemove = function(iq) {
-
- try {
- // Error?
- if(iq.getType() == 'error') {
- return;
- }
-
- // Initialize
- var xid = Common.bareXID(Common.getStanzaFrom(iq));
- var hash = hex_md5(xid);
-
- // Display the item!
- self.display(iq, xid, hash, 'mixed', 'push');
- } catch(e) {
- Console.error('Microblog.handleUpdateRemove', e);
- }
-
- };
-
-
- /**
- * Gets a given microblog comments node
- * @public
- * @param {string} server
- * @param {string} node
- * @param {string} id
- * @return {boolean}
- */
- self.getComments = function(server, node, id) {
-
- /* REF: http://xmpp.org/extensions/xep-0060.html#subscriber-retrieve-requestall */
-
- try {
- var iq = new JSJaCIQ();
- iq.setType('get');
- iq.setID('get_' + genID() + '-' + id);
- iq.setTo(server);
-
- var pubsub = iq.appendNode('pubsub', {
- 'xmlns': NS_PUBSUB
- });
-
- pubsub.appendChild(iq.buildNode('items', {
- 'node': node,
- 'xmlns': NS_PUBSUB
- }));
-
- con.send(iq, self.handleComments);
- } catch(e) {
- Console.error('Microblog.getComments', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Handles a microblog comments node items
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleComments = function(iq) {
-
- try {
- // Path
- var id = Common.explodeThis('-', iq.getID(), 1);
- var path = 'div.comments[data-id="' + id + '"] div.comments-content';
-
- // Does not exist?
- if(!Common.exists(path)) {
- return false;
- }
-
- var path_sel = $(path);
-
- // Any error?
- if(Errors.handleReply(iq)) {
- path_sel.html('');
-
- return false;
- }
-
- // Initialize
- var data = iq.getNode();
- var server = Common.bareXID(Common.getStanzaFrom(iq));
- var node = $(data).find('items:first').attr('node');
- var users_xid = [];
- var code = '';
-
- // No node?
- if(!node) {
- node = $(data).find('publish:first').attr('node');
- }
-
- // Get the parent microblog item
- var parent_select = $('#channel .one-update:has(*[data-node="' + node + '"])');
- var parent_data = [parent_select.attr('data-xid'), NS_URN_MBLOG, parent_select.attr('data-id')];
-
- // Get the owner XID
- var owner_xid = parent_select.attr('data-xid');
- var repeat_xid = parent_select.find('a.repeat').attr('data-xid');
-
- // Must we create the complete DOM?
- var complete = true;
-
- if(path_sel.find('.one-comment.compose').size()) {
- complete = false;
- }
-
- // Add the comment tool
- if(complete) {
- code += '';
- }
-
- // Append the comments
- $(data).find('item').each(function() {
- var this_sel = $(this);
-
- // Get comment
- var current_id = this_sel.attr('id');
- var current_xid = Common.explodeThis(':', this_sel.find('author uri').text(), 1);
- var current_name = this_sel.find('author name').text();
- var current_date = this_sel.find('published').text();
- var current_body = this_sel.find('content[type="text"]').text();
- var current_bname = Name.getBuddy(current_xid);
-
- // Legacy?
- if(!current_body) {
- current_body = this_sel.find('title:not(source > title)').text();
- }
-
- // Yet displayed? (continue the loop)
- if(path_sel.find('.one-comment[data-id="' + current_id + '"]').size()) {
- return;
- }
-
- // No XID?
- if(!current_xid) {
- current_xid = '';
-
- if(!current_name) {
- current_name = Common._e("unknown");
- }
- }
-
- else if(!current_name || (current_bname != Common.getXIDNick(current_xid))) {
- current_name = current_bname;
- }
-
- // Any date?
- if(current_date) {
- current_date = DateUtils.relative(current_date);
- } else {
- current_date = DateUtils.getCompleteTime();
- }
-
- // Click event
- var onclick = 'false';
-
- if(current_xid != Common.getXID()) {
- onclick = 'Chat.checkCreate(\'' + Utils.encodeOnclick(current_xid) + '\', \'chat\')';
- }
-
- // If this is my comment, add a marker
- var type = 'him';
- var marker = '';
- var remove = '';
-
- if(current_xid == Common.getXID()) {
- type = 'me';
- marker = '
';
- remove = '' + Common._e("Remove") + ' ';
- }
-
- // New comment?
- var new_class = '';
-
- if(!complete) {
- new_class = ' new';
- }
-
- // Add the comment
- if(current_body) {
- // Add the XID
- if(!Utils.existArrayValue(users_xid, current_xid)) {
- users_xid.push(current_xid);
- }
-
- // Add the HTML code
- code = '' + code;
- }
- });
-
- // Add the HTML
- if(complete) {
- path_sel.html(code);
-
- // Focus on the compose input
- $(document).oneTime(10, function() {
- path_sel.find('.one-comment.compose input').focus();
- });
- }
-
- else {
- path_sel.find('.one-comment.compose').before(code);
-
- // Beautiful effect
- path_sel.find('.one-comment.new').slideDown('fast', function() {
- self.adaptComment(id);
- }).removeClass('new');
- }
-
- // Set the good widths
- self.adaptComment(id);
-
- // Get the avatars
- for(var a in users_xid) {
- Avatar.get(users_xid[a], 'cache', 'true', 'forget');
- }
-
- // Add the owner XID
- if(owner_xid && owner_xid.match('@') && !Utils.existArrayValue(users_xid, owner_xid)) {
- users_xid.push(owner_xid);
- }
-
- // Add the repeated from XID
- if(repeat_xid && repeat_xid.match('@') && !Utils.existArrayValue(users_xid, repeat_xid)) {
- users_xid.push(repeat_xid);
- }
-
- // Remove my own XID
- Utils.removeArrayValue(users_xid, Common.getXID());
-
- // DOM events
- if(complete) {
- // Update timer
- path_sel.everyTime('60s', function() {
- self.getComments(server, node, id);
-
- Console.log('Updating comments node: ' + node + ' on ' + server + '...');
- });
-
- // Input key event
- var comment_compose_input_sel = path_sel.find('.one-comment.compose input');
-
- comment_compose_input_sel.placeholder();
- comment_compose_input_sel.keyup(function(e) {
- var this_input_sel = $(this);
-
- if((e.keyCode == 13) && this_input_sel.val()) {
- // Send the comment!
- self.sendComment(this_input_sel.val(), server, node, id, users_xid, parent_data);
-
- // Reset the input value
- this_input_sel.val('');
-
- return false;
- }
- });
- }
- } catch(e) {
- Console.error('Microblog.handleComments', e);
- }
-
- };
-
-
- /**
- * Shows the microblog comments box
- * @public
- * @param {string} path
- * @param {string} entityComments
- * @param {string} nodeComments
- * @param {string} tHash
- * @return {undefined}
- */
- self.showComments = function(path, entityComments, nodeComments, tHash) {
-
- try {
- // Do not display it twice!
- if(path.find('div.comments').size())
- return;
-
- // Generate an unique ID
- var idComments = genID();
-
- // Create comments container
- path.find('div.comments-container').append(
- ''
- );
-
- // Click event
- path.find('div.comments a.one-comment').click(function() {
- // Set loading info
- $(this).parent().html('');
-
- // Request comments
- self.getComments(entityComments, nodeComments, idComments);
-
- // Remove the comments from the DOM if click away
- if(tHash) {
- $('#channel').off('click');
-
- $('#channel').on('click', function(evt) {
- if(!$(evt.target).parents('.' + tHash).size()) {
- $('#channel').off('click');
- $('#channel .one-update div.comments-content').stopTime();
- $('#channel .one-update div.comments').remove();
- }
- });
- }
-
- return false;
- });
- } catch(e) {
- Console.error('Microblog.showComments', e);
- }
-
- };
-
-
- /**
- * Sends a comment on a given microblog comments node
- * @public
- * @param {string} value
- * @param {string} server
- * @param {string} node
- * @param {string} id
- * @param {object} notifiy_arr
- * @param {string} parent_data
- * @return {boolean}
- */
- self.sendComment = function(value, server, node, id, notifiy_arr, parent_data) {
-
- /* REF: http://xmpp.org/extensions/xep-0060.html#publisher-publish */
-
- try {
- // Not enough data?
- if(!value || !server || !node) {
- return false;
- }
-
- // Get some values
- var date = DateUtils.getXMPPTime('utc');
- var hash = hex_md5(value + date);
-
- // New IQ
- var iq = new JSJaCIQ();
- iq.setType('set');
- iq.setTo(server);
- iq.setID('set_' + genID() + '-' + id);
-
- // PubSub main elements
- var pubsub = iq.appendNode('pubsub', {
- 'xmlns': NS_PUBSUB
- });
-
- var publish = pubsub.appendChild(iq.buildNode('publish', {
- 'node': node,
- 'xmlns': NS_PUBSUB
- }));
-
- var item = publish.appendChild(iq.buildNode('item', {
- 'id': hash,
- 'xmlns': NS_PUBSUB
- }));
-
- var entry = item.appendChild(iq.buildNode('entry', {
- 'xmlns': NS_ATOM
- }));
-
- entry.appendChild(iq.buildNode('title', {
- 'xmlns': NS_ATOM
- }));
-
- // Author infos
- var author = entry.appendChild(iq.buildNode('author', {
- 'xmlns': NS_ATOM
- }));
-
- author.appendChild(iq.buildNode('name', {
- 'xmlns': NS_ATOM
- }, Name.get()));
-
- author.appendChild(iq.buildNode('uri', {
- 'xmlns': NS_ATOM
- }, 'xmpp:' + Common.getXID()));
-
- // Create the comment
- entry.appendChild(iq.buildNode('content', {
- 'type': 'text',
- 'xmlns': NS_ATOM
- }, value));
-
- entry.appendChild(iq.buildNode('published', {
- 'xmlns': NS_ATOM
- }, date));
-
- con.send(iq);
-
- // Handle this comment!
- iq.setFrom(server);
- self.handleComments(iq);
-
- // Notify users
- if(notifiy_arr && notifiy_arr.length) {
- // XMPP link to the item
- var href = 'xmpp:' + server + '?;node=' + encodeURIComponent(node) + ';item=' + encodeURIComponent(hash);
-
- // Loop!
- for(var n in notifiy_arr) {
- Notification.send(notifiy_arr[n], 'comment', href, value, parent_data);
- }
- }
- } catch(e) {
- Console.error('Microblog.sendComment', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Removes a given microblog comment item
- * @public
- * @param {string} server
- * @param {string} node
- * @param {string} id
- * @return {undefined}
- */
- self.removeComment = function(server, node, id) {
-
- /* REF: http://xmpp.org/extensions/xep-0060.html#publisher-delete */
-
- try {
- // Remove the item from our DOM
- $('.one-comment[data-id="' + id + '"]').slideUp('fast', function() {
- var this_sel = $(this);
-
- // Get the parent ID
- var parent_id = this_sel.parents('div.comments').attr('data-id');
-
- // Remove it!
- this_sel.remove();
-
- // Adapt the width
- self.adaptComment(parent_id);
- });
-
- // Send the IQ to remove the item (and get eventual error callback)
- var iq = new JSJaCIQ();
- iq.setType('set');
- iq.setTo(server);
-
- var pubsub = iq.appendNode('pubsub', {
- 'xmlns': NS_PUBSUB
- });
-
- var retract = pubsub.appendChild(iq.buildNode('retract', {
- 'node': node,
- 'xmlns': NS_PUBSUB
- }));
-
- retract.appendChild(iq.buildNode('item', {
- 'id': id,
- 'xmlns': NS_PUBSUB
- }));
-
- con.send(iq);
- } catch(e) {
- Console.error('Microblog.removeComment', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Adapts the comment elements width
- * @public
- * @param {string} id
- * @return {undefined}
- */
- self.adaptComment = function(id) {
-
- try {
- var selector = $('div.comments[data-id="' + id + '"] div.comments-content');
- var selector_width = selector.width();
-
- // Change widths
- selector.find('.one-comment.compose input').css('width', selector_width - 60);
- selector.find('.one-comment .comment-container').css('width', selector_width - 55);
- } catch(e) {
- Console.error('Microblog.adaptComment', e);
- }
-
- };
-
-
- /**
- * Handles the microblog of an user
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handle = function(iq) {
-
- try {
- // Get the from attribute of this IQ
- var from = Common.bareXID(Common.getStanzaFrom(iq));
-
- // Define the selector path
- var selector = '#channel .top.individual input[name=';
-
- // Is this request still alive?
- if(from == $(selector + 'jid]').val()) {
- var hash = hex_md5(from);
-
- // Update the items counter
- var old_count = parseInt($(selector + 'counter]').val());
- $(selector + 'counter]').val(old_count + 20);
-
- // Display the microblog
- self.display(iq, from, hash, 'individual', 'request');
-
- // Hide the waiting icon
- self.wait(
- Features.enabledPEP() ? 'sync' : 'unsync'
- );
-
- // Hide the 'more items' link?
- if($(iq.getNode()).find('item').size() < old_count)
- $('#channel .individual a.more').remove();
-
- // Get the comments?
- var comments_node = $('#channel .top.individual input[name="comments"]').val();
-
- if(comments_node && comments_node.match(/^xmpp:(.+)\?;node=(.+);item=(.+)/)) {
- // Get the values
- var comments_entity = RegExp.$1;
- comments_node = decodeURIComponent(RegExp.$2);
-
- // Selectors
- var file_link = $('#channel .individual .one-update p.file a[data-node="' + comments_node + '"]');
- var entry_link = $('#channel .individual .one-update:has(.comments-container[data-node="' + comments_node + '"])');
-
- // Is it a microblog entry (or a lonely entry file)?
- if(entry_link.size()) {
- self.showComments(entry_link, comments_entity, comments_node);
- entry_link.find('a.one-comment').click();
- }
-
- // Is it a file?
- else if(file_link.size()) {
- file_link.click();
- }
- }
- }
-
- Console.info('Microblog got: ' + from);
- } catch(e) {
- Console.error('Microblog.handle', e);
- }
-
- };
-
-
- /**
- * Handles the microblog of an user (from roster)
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleRoster = function(iq) {
-
- try {
- // Get the from attribute of this IQ
- var from = Common.bareXID(Common.getStanzaFrom(iq));
-
- // Display the microblog
- self.display(iq, from, hex_md5(from), 'mixed', 'push');
- } catch(e) {
- Console.error('Microblog.handleRoster', e);
- }
-
- };
-
-
- /**
- * Resets the microblog elements
- * @public
- * @return {boolean}
- */
- self.reset = function() {
-
- try {
- var channel_sel = $('#channel');
- var individual_sel = channel_sel.find('.individual');
-
- // Reset everything
- individual_sel.find('.one-update div.comments-content').stopTime();
- individual_sel.remove();
- channel_sel.find('.mixed').show();
-
- // Hide the waiting icon
- self.wait(
- Features.enabledPEP() ? 'sync' : 'unsync'
- );
- } catch(e) {
- Console.error('Microblog.reset', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Gets the user's microblog to check it exists
- * @public
- * @return {undefined}
- */
- self.getInit = function() {
-
- try {
- self.get(Common.getXID(), hex_md5(Common.getXID()), true);
- } catch(e) {
- Console.error('Microblog.getInit', e);
- }
-
- };
-
-
- /**
- * Handles the user's microblog to create it in case of error
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleInit = function(iq) {
-
- try {
- // Any error?
- if((iq.getType() == 'error') && $(iq.getNode()).find('item-not-found').size()) {
- // The node may not exist, create it!
- Pubsub.setup('', NS_URN_MBLOG, '1', '1000000', '', '', true);
-
- Console.warn('Error while getting microblog, trying to reconfigure the PubSub node!');
- }
- } catch(e) {
- Console.error('Microblog.handleInit', e);
- }
-
- };
-
-
- /**
- * Requests an user's microblog
- * @public
- * @param {type} name
- * @return {undefined}
- */
- self.request = function(xid, items, get_item, handler) {
-
- try {
- // Ask the server the user's microblog
- var iq = new JSJaCIQ();
- iq.setType('get');
- iq.setTo(xid);
-
- var pubsub = iq.appendNode('pubsub', {
- 'xmlns': NS_PUBSUB
- });
-
- var ps_items = pubsub.appendChild(iq.buildNode('items', {
- 'node': NS_URN_MBLOG,
- 'xmlns': NS_PUBSUB
- }));
-
- // Request a particular item?
- if(get_item) {
- ps_items.appendChild(iq.buildNode('item', {
- 'id': get_item,
- 'xmlns': NS_PUBSUB
- }));
- } else {
- ps_items.setAttribute('max_items', items);
- }
-
- if(handler) {
- con.send(iq, handler);
- } else {
- con.send(iq, self.handle);
- }
- } catch(e) {
- Console.error('Microblog.request', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Gets the microblog of an user
- * @public
- * @param {string} xid
- * @param {string} hash
- * @param {boolean} check
- * @return {boolean}
- */
- self.get = function(xid, hash, check) {
-
- /* REF: http://xmpp.org/extensions/xep-0060.html#subscriber-retrieve */
-
- try {
- Console.info('Get the microblog: ' + xid);
-
- var channel_sel = $('#channel');
-
- // Fire the wait event
- self.wait('fetch');
-
- // XMPP URI?
- var get_item = '';
-
- if(xid.match(/^xmpp:(.+)\?;node=(.+);item=(.+)/)) {
- xid = RegExp.$1;
- get_item = decodeURIComponent(RegExp.$3);
- }
-
- // No hash?
- if(!hash) {
- hash = hex_md5(xid);
- }
-
- // Can display the individual channel?
- if(!check && !Common.exists('#channel .individual')) {
- // Hide the mixed channel
- channel_sel.find('.mixed').hide();
-
- // Get the channel title depending on the XID
- var cTitle;
- var cShortcuts = '';
-
- if(xid == Common.getXID()) {
- cTitle = Common._e("Your channel");
- } else {
- cTitle = Common._e("Channel of") + ' ' + Name.getBuddy(xid).htmlEnc();
- cShortcuts = '' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
';
- }
-
- // Create a new individual channel
- channel_sel.find('.content.mixed').after(
- ''
- )
-
- .before(
- '' +
- '
' +
- '
' +
- '
' +
-
- '
' +
-
- cShortcuts +
-
- '
' +
- '
' +
- '
'
- );
-
- // Microblog navigation
- channel_sel.find('.content.individual').scroll(function() {
- if(channel_sel.find('.footer div.fetch').is(':hidden') &&
- channel_sel.find('.individual a.more:visible').size() &&
- channel_sel.find('.content.individual').scrollTop() >= (channel_sel.find('.content.individual')[0].scrollHeight - channel_sel.find('.content.individual').height() - 200)) {
- channel_sel.find('.individual a.more').click();
- }
- });
-
- // Display the user avatar
- Avatar.get(xid, 'cache', 'true', 'forget');
- }
-
- // Get the number of items to retrieve
- var items = !check ? channel_sel.find('.top.individual input[name="counter"]').val() : '0';
-
- // Request
- self.request(
- xid,
- items,
- get_item,
- (check ? self.handleInit : self.handle)
- );
- } catch(e) {
- Console.error('Microblog.get', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Show a given microblog waiting status
- * @public
- * @param {string} type
- * @return {undefined}
- */
- self.wait = function(type) {
-
- try {
- // First hide all the infos elements
- $('#channel .footer div').hide();
-
- // Display the good one
- $('#channel .footer div.' + type).show();
-
- // Depending on the type, disable/enable certain tools
- var selector = $('#channel .top input[name="microblog_body"]');
-
- if(type == 'unsync') {
- selector.attr('disabled', true);
- } else if(type == 'sync') {
- $(document).oneTime(10, function() {
- selector.removeAttr('disabled').focus();
- });
- }
- } catch(e) {
- Console.error('Microblog.wait', e);
- }
-
- };
-
-
- /**
- * Gets the microblog configuration
- * @public
- * @return {undefined}
- */
- self.getConfig = function() {
-
- try {
- // Lock the microblog options
- $('#persistent, #maxnotices').attr('disabled', true);
-
- // Get the microblog configuration
- var iq = new JSJaCIQ();
- iq.setType('get');
-
- var pubsub = iq.appendNode('pubsub', {
- 'xmlns': NS_PUBSUB_OWNER
- });
-
- pubsub.appendChild(iq.buildNode('configure', {
- 'node': NS_URN_MBLOG,
- 'xmlns': NS_PUBSUB_OWNER
- }));
-
- con.send(iq, self.handleGetConfig);
- } catch(e) {
- Console.error('Microblog.getConfig', e);
- }
-
- };
-
-
- /**
- * Handles the microblog configuration
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleGetConfig = function(iq) {
-
- try {
- // Reset the options stuffs
- Options.wait('microblog');
-
- // Unlock the microblog options
- $('#persistent, #maxnotices').removeAttr('disabled');
-
- // End if not a result
- if(!iq || (iq.getType() != 'result')) {
- return;
- }
-
- // Initialize the values
- var selector = $(iq.getNode());
- var persistent = '0';
- var maxnotices = '1000000';
-
- // Get the values
- var xPersistent = selector.find('field[var="pubsub#persist_items"] value:first').text();
- var xMaxnotices = selector.find('field[var="pubsub#max_items"] value:first').text();
-
- // Any value?
- if(xPersistent) {
- persistent = xPersistent;
- }
-
- if(xMaxnotices) {
- maxnotices = xMaxnotices;
- }
-
- // Change the maxnotices value
- switch(maxnotices) {
- case '1':
- case '100':
- case '1000':
- case '10000':
- case '100000':
- case '1000000':
- break;
-
- default:
- maxnotices = '1000000';
- break;
- }
-
- // Apply persistent value
- $('#persistent').attr(
- 'checked',
- (persistent == '0' ? false : true)
- );
-
- // Apply maxnotices value
- $('#maxnotices').val(maxnotices);
- } catch(e) {
- Console.error('Microblog.handleGetConfig', e);
- }
-
- };
-
-
- /**
- * Handles the user's microblog
- * @public
- * @param {object} packet
- * @return {undefined}
- */
- self.handleMine = function(packet) {
-
- try {
- var input_body_sel = $('#channel .top input[name="microblog_body"]');
-
- // Reset the entire form
- input_body_sel.removeAttr('disabled').val('');
- input_body_sel.placeholder();
-
- self.unattach();
-
- // Check for errors
- Errors.handleReply(packet);
- } catch(e) {
- Console.error('Microblog.handleMy', e);
- }
-
- };
-
-
- /**
- * Performs the microblog sender checks
- * @public
- * @param {type} name
- * @return {boolean}
- */
- self.send = function() {
-
- try {
- // Get the values
- var selector = $('#channel .top input[name="microblog_body"]');
- var body = $.trim(selector.val());
-
- // Sufficient parameters
- if(body) {
- // Disable & blur our input
- selector.attr('disabled', true).blur();
-
- // Files array
- var fName = [];
- var fType = [];
- var fLength = [];
- var fURL = [];
- var fThumb = [];
-
- // Read the files
- $('#attach .one-file').each(function() {
- var this_sel = $(this);
-
- // Push the values!
- fName.push(this_sel.find('a.link').text());
- fType.push(this_sel.attr('data-type'));
- fLength.push(this_sel.attr('data-length'));
- fURL.push(this_sel.find('a.link').attr('href'));
- fThumb.push(this_sel.attr('data-thumb'));
- });
-
- // Containing YouTube videos?
- var yt_matches = body.match(/(\w{3,5})(:)(\S+)((\.youtube\.com\/watch(\?v|\?\S+v|\#\!v|\#\!\S+v)\=)|(youtu\.be\/))([^& ]+)((&\S)|(&\S)|\s|$)/gim);
-
- for(var y in yt_matches) {
- fName.push('');
- fType.push('text/html');
- fLength.push('');
- fURL.push($.trim(yt_matches[y]));
- fThumb.push('https://img.youtube.com/vi/' + $.trim(yt_matches[y].replace(/(\w{3,5})(:)(\S+)((\.youtube\.com\/watch(\?v|\?\S+v|\#\!v|\#\!\S+v)\=)|(youtu\.be\/))([^& ]+)((&\S)|(&\S)|\s|$)/gim, '$8')) + '/0.jpg');
- }
-
- // Send the message on the XMPP network
- self.publish(body, fName, fURL, fType, fLength, fThumb);
- }
- } catch(e) {
- Console.error('Microblog.send', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Publishes a given microblog item
- * @public
- * @param {type} body
- * @param {type} attachedname
- * @param {type} attachedurl
- * @param {type} attachedtype
- * @param {type} attachedlength
- * @param {type} attachedthumb
- * @param {type} repeat
- * @param {type} comments_entity
- * @param {type} comments_node
- * @param {type} comments_entity_file
- * @param {type} comments_node_file
- * @return {boolean}
- */
- self.publish = function(body, attachedname, attachedurl, attachedtype, attachedlength, attachedthumb, repeat, comments_entity, comments_node, comments_entity_file, comments_node_file) {
-
- /* REF: http://xmpp.org/extensions/xep-0277.html */
-
- try {
- // Generate some values
- var time = DateUtils.getXMPPTime('utc');
- var id = hex_md5(body + time);
- var nick = Name.get();
- var xid = Common.getXID();
-
- // Define repeat options
- var author_nick = nick;
- var author_xid = xid;
-
- if(repeat && repeat.length) {
- author_nick = repeat[0];
- author_xid = repeat[1];
- }
-
- // Define comments options
- var node_create = false;
-
- if(!comments_entity || !comments_node) {
- node_create = true;
- comments_entity = HOST_PUBSUB;
- comments_node = NS_URN_MBLOG + ':comments/' + id;
- }
-
- if(!comments_entity_file) {
- comments_entity_file = [];
- }
-
- if(!comments_node_file) {
- comments_node_file = [];
- }
-
- // Don't create another comments node if only 1 file is attached
- if(attachedurl && (attachedurl.length == 1) && (!comments_entity_file[0] || !comments_node_file[0])) {
- comments_entity_file = [comments_entity];
- comments_node_file = [comments_node];
- }
-
- // New IQ
- var iq = new JSJaCIQ();
- iq.setType('set');
- iq.setTo(xid);
-
- // Create the main XML nodes/childs
- var pubsub = iq.appendNode('pubsub', {'xmlns': NS_PUBSUB});
- var publish = pubsub.appendChild(iq.buildNode('publish', {'node': NS_URN_MBLOG, 'xmlns': NS_PUBSUB}));
- var item = publish.appendChild(iq.buildNode('item', {'id': id, 'xmlns': NS_PUBSUB}));
- var entry = item.appendChild(iq.buildNode('entry', {'xmlns': NS_ATOM}));
- entry.appendChild(iq.buildNode('title', {'xmlns': NS_ATOM}));
-
- // Create the XML author childs
- var author = entry.appendChild(iq.buildNode('author', {'xmlns': NS_ATOM}));
- author.appendChild(iq.buildNode('name', {'xmlns': NS_ATOM}, author_nick));
- author.appendChild(iq.buildNode('uri', {'xmlns': NS_ATOM}, 'xmpp:' + author_xid));
-
- // Create the XML entry childs
- entry.appendChild(iq.buildNode('content', {'type': 'text', 'xmlns': NS_ATOM}, body));
- entry.appendChild(iq.buildNode('published', {'xmlns': NS_ATOM}, time));
- entry.appendChild(iq.buildNode('updated', {'xmlns': NS_ATOM}, time));
- entry.appendChild(iq.buildNode('link', {
- 'rel': 'alternate',
- 'href': 'xmpp:' + xid + '?;node=' + encodeURIComponent(NS_URN_MBLOG) + ';item=' + encodeURIComponent(id),
- 'xmlns': NS_ATOM
- }));
-
- // Create the attached files nodes
- for(var i = 0; i < attachedurl.length; i++) {
- // Not enough data?
- if(!attachedurl[i]) {
- continue;
- }
-
- // Append a new file element
- var file = entry.appendChild(iq.buildNode('link', {'xmlns': NS_ATOM, 'rel': 'enclosure', 'href': attachedurl[i]}));
-
- // Add attributes
- if(attachedname[i])
- file.setAttribute('title', attachedname[i]);
- if(attachedtype[i])
- file.setAttribute('type', attachedtype[i]);
- if(attachedlength[i])
- file.setAttribute('length', attachedlength[i]);
-
- // Any thumbnail?
- if(attachedthumb[i]) {
- file.appendChild(iq.buildNode('link', {'xmlns': NS_URN_MBLOG, 'rel': 'self', 'title': 'thumb', 'type': attachedtype[i], 'href': attachedthumb[i]}));
- }
-
- // Any comments node?
- if(!comments_entity_file[i] || !comments_node_file[i]) {
- // Generate values
- comments_entity_file[i] = HOST_PUBSUB;
- comments_node_file[i] = NS_URN_MBLOG + ':comments/' + hex_md5(attachedurl[i] + attachedname[i] + attachedtype[i] + attachedlength[i] + time);
-
- // Create the node
- Pubsub.setup(comments_entity_file[i], comments_node_file[i], '1', '1000000', 'open', 'open', true);
- }
-
- file.appendChild(iq.buildNode('link', {'xmlns': NS_URN_MBLOG, 'rel': 'replies', 'title': 'comments_file', 'href': 'xmpp:' + comments_entity_file[i] + '?;node=' + encodeURIComponent(comments_node_file[i])}));
- }
-
- // Create the comments child
- entry.appendChild(iq.buildNode('link', {'xmlns': NS_ATOM, 'rel': 'replies', 'title': 'comments', 'href': 'xmpp:' + comments_entity + '?;node=' + encodeURIComponent(comments_node)}));
-
- // Create the geoloc child
- var geoloc_xml = DataStore.getDB(Connection.desktop_hash, 'geolocation', 'now');
-
- if(geoloc_xml) {
- // Create two position arrays
- var geo_names = ['lat', 'lon', 'country', 'countrycode', 'region', 'postalcode', 'locality', 'street', 'building', 'text', 'uri', 'timestamp'];
- var geo_values = PEP.parsePosition(Common.XMLFromString(geoloc_xml));
-
- // New geoloc child
- var geoloc = entry.appendChild(iq.buildNode('geoloc', {
- 'xmlns': NS_GEOLOC
- }));
-
- // Append the geoloc content
- for(var g = 0; g < geo_names.length; g++) {
- if(geo_names[g] && geo_values[g]) {
- geoloc.appendChild(iq.buildNode(geo_names[g], {
- 'xmlns': NS_GEOLOC
- }, geo_values[g]));
- }
- }
- }
-
- // Send the IQ
- con.send(iq, self.handleMine);
-
- // Create the XML comments PubSub nodes
- if(node_create) {
- Pubsub.setup(comments_entity, comments_node, '1', '1000000', 'open', 'open', true);
- }
- } catch(e) {
- Console.error('Microblog.publish', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Attaches a file to a microblog post
- * @public
- * @return {undefined}
- */
- self.attach = function() {
-
- try {
- // File upload vars
- var attach_options = {
- dataType: 'xml',
- beforeSubmit: self.waitAttach,
- success: self.handleAttach
- };
-
- // Upload form submit event
- $('#attach').submit(function() {
- if(!Common.exists('#attach .wait') && $('#attach input[type="file"]').val()) {
- $(this).ajaxSubmit(attach_options);
- }
-
- return false;
- });
-
- // Upload input change event
- $('#attach input[type="file"]').change(function() {
- if(!Common.exists('#attach .wait') && $(this).val())
- $('#attach').ajaxSubmit(attach_options);
-
- return false;
- });
- } catch(e) {
- Console.error('Microblog.attach', e);
- }
-
- };
-
-
- /**
- * Unattaches a microblog file
- * @public
- * @param {string} id
- * @return {boolean}
- */
- self.unattach = function(id) {
-
- try {
- // Individual removal?
- if(id) {
- $('#attach .one-file[data-id="' + id + '"]').remove();
- } else {
- $('#attach .one-file').remove();
- }
-
- // Must enable the popup again?
- if(!Common.exists('#attach .one-file')) {
- // Restore the bubble class
- $('#attach').addClass('bubble');
-
- // Enable the bubble click events
- if(id) {
- $('#attach').hide();
- Bubble.show('#attach');
- } else {
- Bubble.close();
- }
- }
- } catch(e) {
- Console.error('Microblog.unattach', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Wait event for file attaching
- * @public
- * @return {undefined}
- */
- self.waitAttach = function() {
-
- try {
- // Append the wait icon
- $('#attach input[type="submit"]').after('
');
-
- // Lock the bubble
- $('#attach').removeClass('bubble');
- } catch(e) {
- Console.error('Microblog.waitAttach', e);
- }
-
- };
-
-
- /**
- * Success event for file attaching
- * @public
- * @param {string} responseXML
- * @return {undefined}
- */
- self.handleAttach = function(responseXML) {
-
- try {
- // Data selector
- var dData = $(responseXML).find('jappix');
-
- // Process the returned data
- if(!dData.find('error').size()) {
- // Do not allow this bubble to be hidden
- $('#attach').removeClass('bubble');
-
- // Get the file values
- var fName = dData.find('title').text();
- var fType = dData.find('type').text();
- var fLength = dData.find('length').text();
- var fURL = dData.find('href').text();
- var fThumb = dData.find('thumb').text();
-
- // Generate a file ID
- var fID = hex_md5(fURL);
-
- // Add this file
- $('#attach .attach-subitem').append(
- ''
- );
-
- // Click event
- $('#attach .one-file[data-id="' + fID + '"] a.remove').click(function() {
- return self.unattach(fID);
- });
-
- Console.info('File attached.');
- }
-
- // Any error?
- else {
- Board.openThisError(4);
-
- // Unlock the bubble?
- if(!Common.exists('#attach .one-file')) {
- $('#attach').addClass('bubble').hide();
-
- // Show the bubble again!
- Bubble.show('#attach');
- }
-
- Console.error('Error while attaching the file', dData.find('error').text());
- }
-
- // Reset the attach bubble
- $('#attach input[type="file"]').val('');
- $('#attach .wait').remove();
-
- // Focus on the text input
- $(document).oneTime(10, function() {
- $('#channel .top input[name="microblog_body"]').focus();
- });
- } catch(e) {
- Console.error('Microblog.handleAttach', e);
- }
-
- };
-
-
- /**
- * Shows the microblog of an user from his infos
- * @public
- * @param {string} xid
- * @param {string} hash
- * @return {undefined}
- */
- self.fromInfos = function(xid, hash) {
-
- try {
- // Renitialize the channel
- self.reset();
-
- // Switch to the channel
- Interface.switchChan('channel');
-
- // Get the microblog
- self.get(xid, hash);
- } catch(e) {
- Console.error('Microblog.fromInfos', e);
- }
-
- };
-
-
- /**
- * Plugin launcher
- * @public
- * @return {undefined}
- */
- self.instance = function() {
-
- try {
- var microblog_body_sel = $('#channel .top input[name="microblog_body"]');
-
- // Keyboard event
- microblog_body_sel.keyup(function(e) {
- // Enter pressed: send the microblog notice
- if((e.keyCode == 13) && !Common.exists('#attach .wait')) {
- return self.send();
- }
- });
-
- // Placeholder
- microblog_body_sel.placeholder();
-
- // Microblog file attacher
- self.attach();
- } catch(e) {
- Console.error('Microblog.instance', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/mini.js b/source/app/javascripts/mini.js
deleted file mode 100644
index 6f7b986..0000000
--- a/source/app/javascripts/mini.js
+++ /dev/null
@@ -1,4408 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the Jappix Mini JS scripts for Jappix
-
--------------------------------------------------
-
-License: dual-licensed under AGPL and MPLv2
-Authors: Valérian Saliou, hunterjm, Camaran, regilero, Kloadut, Maranda
-
-*/
-
-// Jappix Mini globals
-var MINI_DISCONNECT = false;
-var MINI_AUTOCONNECT = false;
-var MINI_SHOWPANE = false;
-var MINI_INITIALIZED = false;
-var MINI_ROSTER_INIT = false;
-var MINI_ROSTER_NOGROUP = 'jm_nogroup';
-var MINI_ANONYMOUS = false;
-var MINI_ANIMATE = false;
-var MINI_RANDNICK = false;
-var MINI_GROUPCHAT_PRESENCE = false;
-var MINI_DISABLE_MOBILE = false;
-var MINI_NICKNAME = '';
-var MINI_TITLE = null;
-var MINI_DOMAIN = null;
-var MINI_USER = null;
-var MINI_PASSWORD = null;
-var MINI_HASH = null;
-var MINI_ACTIVE = null;
-var MINI_RECONNECT = 0;
-var MINI_RECONNECT_MAX = 100;
-var MINI_RECONNECT_INTERVAL = 1;
-var MINI_PIXEL_STREAM_DURATION = 300;
-var MINI_PIXEL_STREAM_INTERVAL = 7200;
-var MINI_QUEUE = [];
-var MINI_CHATS = [];
-var MINI_GROUPCHATS = [];
-var MINI_SUGGEST_CHATS = [];
-var MINI_SUGGEST_GROUPCHATS = [];
-var MINI_SUGGEST_PASSWORDS = [];
-var MINI_PASSWORDS = [];
-var MINI_PRIORITY = 1;
-var MINI_RESOURCE = JAPPIX_RESOURCE + ' Mini';
-var MINI_ERROR_LINK = 'https://mini.jappix.com/issues';
-
-
-// Bundle
-var JappixMini = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Setups connection handlers
- * @public
- * @param {object} con
- * @return {undefined}
- */
- self.setupCon = function(con) {
-
- try {
- con.registerHandler('message', self.handleMessage);
- con.registerHandler('presence', self.handlePresence);
- con.registerHandler('iq', self.handleIQ);
- con.registerHandler('onerror', self.handleError);
- con.registerHandler('onconnect', self.connected);
- } catch(e) {
- JappixConsole.error('JappixMini.setupCon', e);
- }
-
- };
-
-
- /**
- * Connects the user with the given logins
- * @public
- * @param {type} domain
- * @param {type} user
- * @param {type} password
- * @return {boolean}
- */
- self.connect = function(domain, user, password) {
-
- try {
- oArgs = {};
-
- // Check BOSH origin
- BOSH_SAME_ORIGIN = Origin.isSame(oArgs.httpbase);
-
- // We create the new http-binding connection
- con = new JSJaCHttpBindingConnection({
- httpbase: (HOST_BOSH_MINI || HOST_BOSH)
- });
-
- // And we handle everything that happen
- self.setupCon(con);
-
- // fixes #339
- var store_resource = (BrowserDetect.browser != 'Explorer');
- var random_resource = null;
-
- if(store_resource) {
- // Randomize resource?
- random_resource = JappixDataStore.getDB(MINI_HASH, 'jappix-mini', 'resource');
- }
-
- if(!random_resource) {
- random_resource = MINI_RESOURCE + ' (' + (new Date()).getTime() + ')';
- }
-
- // We retrieve what the user typed in the login inputs
- oArgs = {};
- oArgs.secure = true;
- oArgs.xmllang = XML_LANG;
- oArgs.resource = random_resource;
- oArgs.domain = domain;
-
- // Store the resource (for reconnection)
- if(store_resource) {
- JappixDataStore.setDB(MINI_HASH, 'jappix-mini', 'resource', random_resource);
- }
-
- // Anonymous login?
- if(MINI_ANONYMOUS) {
- // Anonymous mode disabled?
- if(!JappixCommon.allowedAnonymous()) {
- JappixConsole.warn('Not allowed to use anonymous mode.');
-
- // Notify this error
- self.notifyError();
-
- return false;
- }
-
- // Bad domain?
- else if(JappixCommon.lockHost() && (domain != HOST_ANONYMOUS)) {
- JappixConsole.warn('Not allowed to connect to this anonymous domain: ' + domain);
-
- // Notify this error
- self.notifyError();
-
- return false;
- }
-
- oArgs.authtype = 'saslanon';
- }
-
- // Normal login
- else {
- // Bad domain?
- if(JappixCommon.lockHost() && (domain != HOST_MAIN)) {
- JappixConsole.warn('Not allowed to connect to this main domain: ' + domain);
-
- // Notify this error
- self.notifyError();
-
- return false;
- }
-
- // No nickname?
- if(!MINI_NICKNAME) {
- MINI_NICKNAME = user;
- }
-
- oArgs.username = user;
- oArgs.pass = password;
- }
-
- // We connect !
- con.connect(oArgs);
-
- JappixConsole.info('Jappix Mini is connecting...');
- } catch(e) {
- JappixConsole.error('JappixMini.connect', e);
-
- // Reset Jappix Mini
- self.disconnected();
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * When the user is connected
- * @public
- * @return {undefined}
- */
- self.connected = function() {
-
- try {
- // Do not get the roster if anonymous
- if(!MINI_RECONNECT) {
- // Update the roster
- jQuery('#jappix_mini a.jm_pane.jm_button span.jm_counter').text('0');
-
- if(MINI_ANONYMOUS) {
- self.initialize();
- } else {
- self.getRoster();
- }
-
- JappixConsole.info('Jappix Mini is now connected.');
- } else {
- self.reconnected();
-
- JappixConsole.info('Jappix Mini is now reconnected.');
- }
-
- // Reset reconnect var
- MINI_RECONNECT = 0;
- JappixDataStore.removeDB(MINI_HASH, 'jappix-mini', 'reconnect');
-
- // Execute enqueued events
- self.dequeue();
- } catch(e) {
- JappixConsole.error('JappixMini.connected', e);
- }
-
- };
-
-
- /**
- * When the user is reconnected
- * @public
- * @return {undefined}
- */
- self.reconnected = function() {
-
- try {
- var last_presence = JappixDataStore.getDB(MINI_HASH, 'jappix-mini', 'presence-last') || 'available';
-
- // Flush presence storage
- self.flushStorage('presence');
-
- // Empty groupchat messages
- jQuery('#jappix_mini div.jm_conversation.jm_type_groupchat div.jm_received-messages div.jm_group').remove();
-
- // Re-send all presences
- jQuery('#jappix_mini div.jm_status_picker a[data-status="' + JappixCommon.encodeQuotes(last_presence) + '"]').click();
- } catch(e) {
- JappixConsole.error('JappixMini.reconnected', e);
- }
-
- };
-
-
- /**
- * When the user disconnects
- * @public
- * @return {undefined}
- */
- self.saveSession = function() {
-
- try {
- // Not initialized?
- if(!MINI_INITIALIZED) {
- return;
- }
-
- // Reset Jappix Mini DOM before saving it
- self.resetPixStream();
-
- // Save the actual Jappix Mini DOM
- JappixDataStore.setDB(MINI_HASH, 'jappix-mini', 'dom', jQuery('#jappix_mini').html());
- JappixDataStore.setDB(MINI_HASH, 'jappix-mini', 'nickname', MINI_NICKNAME);
-
- // Save the scrollbar position
- var scroll_position = '';
- var scroll_hash = jQuery('#jappix_mini div.jm_conversation:has(a.jm_pane.jm_clicked)').attr('data-hash');
-
- if(scroll_hash) {
- scroll_position = document.getElementById('received-' + scroll_hash).scrollTop + '';
- }
-
- JappixDataStore.setDB(MINI_HASH, 'jappix-mini', 'scroll', scroll_position);
-
- // Suspend connection
- if(JappixCommon.isConnected()) {
- con.suspend(false);
- } else {
- JappixDataStore.setDB(MINI_HASH, 'jappix-mini', 'reconnect', ((MINI_RECONNECT === 0) ? 0 : (MINI_RECONNECT - 1)));
- self.serializeQueue();
- }
-
- JappixConsole.info('Jappix Mini session save tool launched.');
- } catch(e) {
- JappixConsole.error('JappixMini.saveSession', e);
- }
-
- };
-
-
- /**
- * Flushes Jappix Mini storage database
- * @public
- * @param {string} r_override
- * @return {undefined}
- */
- self.flushStorage = function(r_override) {
-
- try {
- var i,
- db_regex, db_current;
-
- db_regex = new RegExp(('^' + MINI_HASH + '_') + 'jappix-mini' + (r_override ? ('_' + r_override) : ''));
-
- for(i = 0; i < JappixDataStore.storageDB.length; i++) {
- db_current = JappixDataStore.storageDB.key(i);
-
- if(db_regex.exec(db_current)) {
- JappixDataStore.storageDB.removeItem(db_current);
- }
- }
-
- JappixConsole.log('Jappix Mini DB has been successfully flushed (' + (r_override ? 'partly' : 'completely') + ').');
- } catch(e) {
- JappixConsole.error('JappixMini.flushStorage', e);
- }
-
- };
-
-
- /**
- * Disconnects the connected user
- * @public
- * @return {boolean}
- */
- self.disconnect = function() {
-
- try {
- // No connection?
- if(!JappixCommon.isConnected()) {
- return false;
- }
-
- JappixConsole.info('Jappix Mini is disconnecting...');
-
- // Change markers
- MINI_DISCONNECT = true;
- MINI_INITIALIZED = false;
-
- // Flush storage
- self.flushStorage();
-
- // Add disconnection handler
- con.registerHandler('ondisconnect', function() {
- self.disconnected();
- });
-
- // Disconnect the user
- con.disconnect();
-
- return false;
- } catch(e) {
- JappixConsole.error('JappixMini.disconnect', e);
- }
-
- };
-
-
- /**
- * When the user is disconnected
- * @public
- * @return {boolean}
- */
- self.disconnected = function() {
-
- try {
- // Connection error?
- if(!MINI_DISCONNECT || MINI_INITIALIZED) {
- // Reset reconnect timer
- jQuery('#jappix_mini').stopTime();
-
- // Try to reconnect after a while
- if(MINI_INITIALIZED && (MINI_RECONNECT++ < MINI_RECONNECT_MAX)) {
- // Set timer
- jQuery('#jappix_mini').oneTime(MINI_RECONNECT_INTERVAL * 1000, function() {
- JappixConsole.debug('Trying to reconnect... (attempt: ' + MINI_RECONNECT + ' / ' + MINI_RECONNECT_MAX + ')');
-
- // Silently reconnect user
- self.connect(MINI_DOMAIN, MINI_USER, MINI_PASSWORD);
- });
-
- JappixConsole.info('Jappix Mini is encountering connectivity issues.');
- } else {
- // Remove the stored items
- self.flushStorage();
-
- // Notify this error
- self.notifyError();
-
- // Reset markers
- MINI_DISCONNECT = false;
- MINI_INITIALIZED = false;
-
- JappixConsole.info('Jappix Mini is giving up. Server seems to be down.');
- }
- }
-
- // Normal disconnection?
- else {
- launchMini(false, MINI_SHOWPANE, MINI_DOMAIN, MINI_USER, MINI_PASSWORD);
-
- // Reset markers
- MINI_DISCONNECT = false;
- MINI_INITIALIZED = false;
-
- JappixConsole.info('Jappix Mini is now disconnected.');
- }
- } catch(e) {
- JappixConsole.error('JappixMini.disconnected', e);
- }
-
- };
-
-
- /**
- * Handles the incoming errors
- * @public
- * @param {object} err
- * @return {undefined}
- */
- self.handleError = function(err) {
-
- try {
- // First level error (connection error)
- if(jQuery(err).is('error')) {
- // Notify this error
- self.disconnected();
-
- JappixConsole.error('First level error received.');
- }
- } catch(e) {
- JappixConsole.error('JappixMini.handleError', e);
- }
-
- };
-
-
- /**
- * Handles the incoming messages
- * @public
- * @param {object} msg
- * @return {undefined}
- */
- self.handleMessage = function(msg) {
-
- try {
- var type = msg.getType();
-
- // This is a message Jappix can handle
- if((type == 'chat') || (type == 'normal') || (type == 'groupchat') || !type) {
- // Get the packet data
- var node = msg.getNode();
- var subject = jQuery.trim(msg.getSubject());
- var body = subject ? subject : jQuery.trim(msg.getBody());
-
- // Get the sender data
- var from = JappixCommon.fullXID(JappixCommon.getStanzaFrom(msg));
- var xid = JappixCommon.bareXID(from);
- var hash = hex_md5(xid);
-
- // Any attached message body?
- if(body) {
- // Get more sender data
- var use_xid = xid;
- var nick = JappixCommon.thisResource(from);
-
- // Read the delay
- var delay = JappixDateUtils.readMessageDelay(node);
- var d_stamp;
-
- // Manage this delay
- if(delay) {
- time = JappixDateUtils.relative(delay);
- d_stamp = Date.jab2date(delay);
- }
-
- else {
- time = JappixDateUtils.getCompleteTime();
- d_stamp = new Date();
- }
-
- // Get the stamp
- var stamp = JappixDateUtils.extractStamp(d_stamp);
-
- // Is this a groupchat private message?
- if(JappixCommon.exists('#jappix_mini #chat-' + hash + '[data-type="groupchat"]')) {
- // Regenerate some stuffs
- if((type == 'chat') || (type == 'normal') || !type) {
- xid = from;
- hash = hex_md5(xid);
- }
-
- // XID to use for a groupchat
- else {
- use_xid = from;
- }
- }
-
- // Message type
- var message_type = 'user-message';
-
- // Grouphat values
- if(type == 'groupchat') {
- // Old message
- if(msg.getChild('delay', NS_URN_DELAY) || msg.getChild('x', NS_DELAY)) {
- message_type = 'old-message';
- }
-
- // System message?
- if(!nick || subject) {
- nick = '';
- message_type = 'system-message';
- }
- }
-
- // Chat values
- else {
- nick = jQuery('#jappix_mini a#friend-' + hash).text().revertHtmlEnc();
-
- // No nickname?
- if(!nick) {
- // If the roster does not give us any nick the user may have send us a nickname to use with his first message
- // @see http://xmpp.org/extensions/xep-0172.html
- var unknown_entry = jQuery('#jappix_mini a.jm_unknown[data-xid="' + xid + '"]');
-
- if(unknown_entry.size() > 0) {
- nick = unknown_entry.attr('data-nick');
- } else {
- var msgnick = msg.getNick();
- nick = JappixCommon.getXIDNick(xid);
-
- if(msgnick) {
- // If there is a nickname in the message which differs from the jid-extracted nick then tell it to the user
- if(nick != msgnick)
- nick = msgnick + ' (' + nick + ')';
- }
-
- // Push that unknown guy in a temporary roster entry
- unknown_entry = jQuery(' ').attr('data-nick', nick).attr('data-xid', xid);
- unknown_entry.appendTo('#jappix_mini div.jm_roster div.jm_buddies');
- }
- }
- }
-
- // Define the target div
- var target = '#jappix_mini #chat-' + hash;
-
- // Create the chat if it does not exist
- if(!JappixCommon.exists(target) && (type != 'groupchat')) {
- self.chat(type, xid, nick, hash);
- }
-
- // Display the message
- self.displayMessage(type, body, use_xid, nick, hash, time, stamp, message_type);
-
- // Notify the user if not focused & the message is not a groupchat old one
- if((!jQuery(target + ' a.jm_chat-tab').hasClass('jm_clicked') || !JappixCommon.isFocused() || (MINI_ACTIVE != hash)) && (message_type == 'user-message')) {
- // Play a sound
- if(type != 'groupchat') {
- self.soundPlay();
- }
-
- // Show a notification bubble
- self.notifyMessage(hash);
- }
-
- JappixConsole.log('Message received from: ' + from);
- }
-
- // Chatstate groupchat filter
- if(JappixCommon.exists('#jappix_mini #chat-' + hash + '[data-type="groupchat"]')) {
- xid = from;
- hash = hex_md5(xid);
- }
-
- // Reset current chatstate
- self.resetChatstate(xid, hash, type);
-
- // Apply new chatstate (if supported)
- if(jQuery(node).find('active[xmlns="' + NS_CHATSTATES + '"]').size() || jQuery(node).find('composing[xmlns="' + NS_CHATSTATES + '"]').size()) {
- // Set marker to tell other user supports chatstates
- jQuery('#jappix_mini #chat-' + hash + ' input.jm_send-messages').attr('data-chatstates', 'true');
-
- // Composing?
- if(jQuery(node).find('composing[xmlns="' + NS_CHATSTATES + '"]').size()) {
- self.displayChatstate('composing', xid, hash, type);
- }
- }
- }
- } catch(e) {
- JappixConsole.error('JappixMini.handleMessage', e);
- }
-
- };
-
-
- /**
- * Handles the incoming IQs
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleIQ = function(iq) {
-
- try {
- // Define some variables
- var iqFrom = JappixCommon.fullXID(JappixCommon.getStanzaFrom(iq));
- var iqID = iq.getID();
- var iqQueryXMLNS = iq.getQueryXMLNS();
- var iqType = iq.getType();
- var iqNode = iq.getNode();
- var iqQuery;
-
- // Build the response
- var iqResponse = new JSJaCIQ();
-
- iqResponse.setID(iqID);
- iqResponse.setTo(iqFrom);
- iqResponse.setType('result');
-
- // Software version query
- if((iqQueryXMLNS == NS_VERSION) && (iqType == 'get')) {
- /* REF: http://xmpp.org/extensions/xep-0092.html */
-
- iqQuery = iqResponse.setQuery(NS_VERSION);
-
- iqQuery.appendChild(iq.buildNode('name', {'xmlns': NS_VERSION}, 'Jappix Mini'));
- iqQuery.appendChild(iq.buildNode('version', {'xmlns': NS_VERSION}, JAPPIX_VERSION));
- iqQuery.appendChild(iq.buildNode('os', {'xmlns': NS_VERSION}, navigator.platform));
-
- con.send(iqResponse);
-
- JappixConsole.log('Received software version query: ' + iqFrom);
- }
-
- // Roster push
- else if((iqQueryXMLNS == NS_ROSTER) && (iqType == 'set')) {
- // Display the friend
- self.handleRoster(iq);
-
- con.send(iqResponse);
-
- JappixConsole.log('Received a roster push.');
- }
-
- // Disco info query
- else if((iqQueryXMLNS == NS_DISCO_INFO) && (iqType == 'get')) {
- /* REF: http://xmpp.org/extensions/xep-0030.html */
-
- iqQuery = iqResponse.setQuery(NS_DISCO_INFO);
-
- // We set the name of the client
- iqQuery.appendChild(iq.appendNode('identity', {
- 'category': 'client',
- 'type': 'web',
- 'name': 'Jappix Mini',
- 'xmlns': NS_DISCO_INFO
- }));
-
- // We set all the supported features
- var fArray = [
- NS_DISCO_INFO,
- NS_VERSION,
- NS_ROSTER,
- NS_MUC,
- NS_VERSION,
- NS_URN_TIME
- ];
-
- for(var i in fArray) {
- iqQuery.appendChild(iq.buildNode('feature', {'var': fArray[i], 'xmlns': NS_DISCO_INFO}));
- }
-
- con.send(iqResponse);
-
- JappixConsole.log('Received a disco#infos query.');
- }
-
- // User time query
- else if(jQuery(iqNode).find('time').size() && (iqType == 'get')) {
- /* REF: http://xmpp.org/extensions/xep-0202.html */
-
- var iqTime = iqResponse.appendNode('time', {'xmlns': NS_URN_TIME});
- iqTime.appendChild(iq.buildNode('tzo', {'xmlns': NS_URN_TIME}, JappixDateUtils.getTZO()));
- iqTime.appendChild(iq.buildNode('utc', {'xmlns': NS_URN_TIME}, JappixDateUtils.getXMPPTime('utc')));
-
- con.send(iqResponse);
-
- JappixConsole.log('Received local time query: ' + iqFrom);
- }
-
- // Ping
- else if(jQuery(iqNode).find('ping').size() && (iqType == 'get')) {
- /* REF: http://xmpp.org/extensions/xep-0199.html */
-
- con.send(iqResponse);
-
- JappixConsole.log('Received a ping: ' + iqFrom);
- }
-
- // Not implemented
- else if(!jQuery(iqNode).find('error').size() && ((iqType == 'get') || (iqType == 'set'))) {
- // Append stanza content
- for(var c = 0; c < iqNode.childNodes.length; c++) {
- iqResponse.getNode().appendChild(iqNode.childNodes.item(c).cloneNode(true));
- }
-
- // Append error content
- var iqError = iqResponse.appendNode('error', {'xmlns': NS_CLIENT, 'code': '501', 'type': 'cancel'});
- iqError.appendChild(iq.buildNode('feature-not-implemented', {'xmlns': NS_STANZAS}));
- iqError.appendChild(iq.buildNode('text', {'xmlns': NS_STANZAS}, JappixCommon._e("The feature requested is not implemented by the recipient or server and therefore cannot be processed.")));
-
- con.send(iqResponse);
-
- JappixConsole.log('Received an unsupported IQ query from: ' + iqFrom);
- }
- } catch(e) {
- JappixConsole.error('JappixMini.handleIQ', e);
- }
-
- };
-
-
- /**
- * Handles the incoming presences
- * @public
- * @param {object} pr
- * @return {undefined}
- */
- self.handlePresence = function(pr) {
-
- try {
- // Get the values
- var xml = pr.getNode();
- var from = JappixCommon.fullXID(JappixCommon.getStanzaFrom(pr));
- var xid = JappixCommon.bareXID(from);
- var resource = JappixCommon.thisResource(from);
- var resources_obj = {};
-
- // Is this a groupchat?
- if(JappixCommon.exists('#jappix_mini div.jm_conversation[data-type="groupchat"][data-xid="' + JappixCommon.escapeQuotes(xid) + '"]')) {
- xid = from;
- }
-
- // Store presence stanza
- JappixDataStore.setDB(MINI_HASH, 'jappix-mini', 'presence-stanza-' + from, pr.xml());
- resources_obj = self.addResourcePresence(xid, resource);
-
- // Re-process presence storage for this buddy
- self.processPresence(xid, resource, resources_obj);
-
- // Display that presence
- self.displayPresence(xid);
-
- JappixConsole.log('Presence received from: ' + from);
- } catch(e) {
- JappixConsole.error('JappixMini.handlePresence', e);
- }
-
- };
-
-
- /**
- * Reads a stored presence
- * @public
- * @param {string} from
- * @return {undefined}
- */
- self.readPresence = function(from) {
-
- try {
- var pr = JappixDataStore.getDB(MINI_HASH, 'jappix-mini', 'presence-stanza-' + from);
-
- if(!pr) {
- pr = ' ';
- }
-
- return JappixCommon.XMLFromString(pr);
- } catch(e) {
- JappixConsole.error('JappixMini.readPresence', e);
- }
-
- };
-
-
- /**
- * Lists presence resources for an user
- * @public
- * @param {string} xid
- * @return {object}
- */
- self.resourcesPresence = function(xid) {
-
- var resources_obj = {};
-
- try {
- var resources_db = JappixDataStore.getDB(MINI_HASH, 'jappix-mini', 'presence-resources-' + xid);
-
- if(resources_db) {
- resources_obj = jQuery.evalJSON(resources_db);
- }
- } catch(e) {
- JappixConsole.error('JappixMini.resourcesPresence', e);
- } finally {
- return resources_obj;
- }
-
- };
-
-
- /**
- * Adds a given presence resource for an user
- * @public
- * @param {string} xid
- * @param {string} resource
- * @return {object}
- */
- self.addResourcePresence = function(xid, resource) {
-
- try {
- var resources_obj = self.resourcesPresence(xid);
-
- resources_obj[resource] = 1;
- JappixDataStore.setDB(MINI_HASH, 'jappix-mini', 'presence-resources-' + xid, jQuery.toJSON(resources_obj));
-
- return resources_obj;
- } catch(e) {
- JappixConsole.error('JappixMini.addResourcePresence', e);
-
- return null;
- }
-
- };
-
-
- /**
- * Removes a given presence resource for an user
- * @public
- * @param {string} xid
- * @param {string} resource
- * @return {object}
- */
- self.removeResourcePresence = function(xid, resource) {
-
- try {
- var resources_obj = self.resourcesPresence(xid);
-
- delete resources_obj[resource];
- JappixDataStore.setDB(MINI_HASH, 'jappix-mini', 'presence-resources-' + xid, jQuery.toJSON(resources_obj));
-
- return resources_obj;
- } catch(e) {
- JappixConsole.error('JappixMini.removeResourcePresence', e);
-
- return null;
- }
-
- };
-
-
- /**
- * Process presence storage for a given contact
- * @public
- * @param {string} xid
- * @param {string} resource
- * @param {object} resources_obj
- * @return {undefined}
- */
- self.processPresence = function(xid, resource, resources_obj) {
-
- try {
- if(!xid) {
- JappixConsole.warn('No XID value for precense processing.');
- return;
- }
-
- // Initialize vars
- var cur_resource, cur_from, cur_pr,
- cur_xml, cur_priority,
- from_highest;
-
- from_highest = null;
- max_priority = null;
-
- // Groupchat presence? (no priority here)
- if(xid.indexOf('/') !== -1) {
- from_highest = xid;
-
- JappixConsole.log('Processed presence for groupchat user: ' + xid);
- } else {
- if(!self.priorityPresence(xid)) {
- from_highest = xid + '/' + resource;
-
- JappixConsole.log('Processed initial presence for regular user: ' + xid + ' (highest priority for: ' + (from_highest || 'none') + ')');
- } else {
- for(cur_resource in resources_obj) {
- // Read presence data
- cur_from = xid + '/' + cur_resource;
- cur_pr = JappixDataStore.getDB(MINI_HASH, 'jappix-mini', 'presence-stanza-' + cur_from);
-
- if(cur_pr) {
- // Parse presence data
- cur_xml = JappixCommon.XMLFromString(cur_pr);
- cur_priority = jQuery(cur_xml).find('priority').text();
- cur_priority = !isNaN(cur_priority) ? parseInt(cur_priority) : 0;
-
- // Higher priority?
- if((cur_priority >= max_priority) || (max_priority === null)) {
- max_priority = cur_priority;
- from_highest = cur_from;
- }
- }
- }
-
- JappixConsole.log('Processed presence for regular user: ' + xid + ' (highest priority for: ' + (from_highest || 'none') + ')');
- }
- }
-
- if(from_highest) {
- JappixDataStore.setDB(MINI_HASH, 'jappix-mini', 'presence-priority-' + xid, from_highest);
- } else {
- JappixDataStore.removeDB(MINI_HASH, 'jappix-mini', 'presence-priority-' + xid);
- }
- } catch(e) {
- JappixConsole.error('JappixMini.processPresence', e);
- }
-
- };
-
-
- /**
- * Returns highest presence priority
- * @public
- * @param {string} xid
- * @return {string}
- */
- self.priorityPresence = function(xid) {
-
- try {
- return JappixDataStore.getDB(MINI_HASH, 'jappix-mini', 'presence-priority-' + xid) || '';
- } catch(e) {
- JappixConsole.error('JappixMini.priorityPresence', e);
-
- return null;
- }
-
- };
-
-
- /**
- * Displays a Jappix Mini presence
- * @public
- * @param {string} xid
- * @return {undefined}
- */
- self.displayPresence = function(xid) {
-
- try {
- // Get the values
- var from = self.priorityPresence(xid);
- var xml = self.readPresence(from);
- var pr = jQuery(xml).find('presence');
- var resource = JappixCommon.thisResource(from);
- var bare_xid = JappixCommon.bareXID(xid);
- var hash = hex_md5(bare_xid);
- var type = pr.attr('type');
- var show = pr.find('show').text();
-
- // Manage the received presence values
- if((type == 'error') || (type == 'unavailable')) {
- show = 'unavailable';
- } else {
- switch(show) {
- case 'chat':
- case 'away':
- case 'xa':
- case 'dnd':
- break;
-
- default:
- show = 'available';
-
- break;
- }
- }
-
- // Is this a groupchat presence?
- var groupchat_path = '#jappix_mini #chat-' + hash + '[data-type="groupchat"]';
- var is_groupchat = false;
-
- if(JappixCommon.exists(groupchat_path)) {
- // Groupchat exists
- is_groupchat = true;
-
- // Groupchat buddy presence (not me)
- if(resource != JappixCommon.unescapeQuotes(jQuery(groupchat_path).attr('data-nick'))) {
- // Regenerate some stuffs
- var groupchat = xid;
- var groupchat_hash = hash;
- xid = from;
- hash = hex_md5(xid);
-
- // Process this groupchat user presence
- var log_message;
-
- if(show == 'unavailable') {
- // Remove from roster view
- self.removeBuddy(hash, groupchat);
-
- // Generate log message
- log_message = JappixCommon.printf(JappixCommon._e("%s left"), resource.htmlEnc());
- } else {
- // Add to roster view
- self.addBuddy(xid, hash, resource, groupchat);
-
- // Generate log message
- log_message = JappixCommon.printf(JappixCommon._e("%s joined"), resource.htmlEnc());
- }
-
- // Log message in chat view
- if(MINI_GROUPCHAT_PRESENCE && log_message && (jQuery(groupchat_path).attr('data-init') == 'true')) {
- self.displayMessage('groupchat', log_message, xid, '', groupchat_hash, JappixDateUtils.getCompleteTime(), JappixDateUtils.getTimeStamp(), 'system-message');
- }
- }
- }
-
- // Friend path
- var chat = '#jappix_mini #chat-' + hash;
- var friend = '#jappix_mini a#friend-' + hash;
- var send_input = chat + ' input.jm_send-messages';
-
- // Is this friend online?
- if(show == 'unavailable') {
- // Offline marker
- jQuery(friend).addClass('jm_offline').removeClass('jm_online jm_hover');
-
- // Hide the friend just to be safe since the search uses .hide() and .show() which can override the CSS display attribute
- jQuery(friend).hide();
-
- // Disable the chat tools
- if(is_groupchat) {
- jQuery(chat).addClass('jm_disabled').attr('data-init', 'false');
- jQuery(send_input).blur().attr('disabled', true).attr('data-value', JappixCommon._e("Unavailable")).val(JappixCommon._e("Unavailable"));
- }
- } else {
- // Online marker
- jQuery(friend).removeClass('jm_offline').addClass('jm_online');
-
- // Check against search string
- var search = jQuery('#jappix_mini div.jm_roster div.jm_search input.jm_searchbox').val();
- var regex = new RegExp('((^)|( ))' + JappixCommon.escapeRegex(search), 'gi');
- var nick = JappixCommon.unescapeQuotes(jQuery(friend).data('nick'));
-
- if(search && !nick.match(regex)) {
- jQuery(friend).hide();
- } else {
- jQuery(friend).show();
- }
-
- // Enable the chat input
- if(is_groupchat) {
- jQuery(chat).removeClass('jm_disabled');
- jQuery(send_input).removeAttr('disabled').val('');
- }
- }
-
- // Change the show presence of this buddy
- jQuery(friend + ' span.jm_presence, ' + chat + ' span.jm_presence').attr('class', 'jm_presence jm_images jm_' + show);
-
- // Update the presence counter
- self.updateRoster();
-
- // Update groups visibility
- self.updateGroups();
-
- JappixConsole.log('Presence displayed for user: ' + xid);
- } catch(e) {
- JappixConsole.error('JappixMini.displayPresence', e);
- }
-
- };
-
-
- /**
- * Handles the MUC main elements
- * @public
- * @param {object} pr
- * @return {undefined}
- */
- self.handleMUC = function(pr) {
-
- try {
- // We get the xml content
- var xml = pr.getNode();
- var from = JappixCommon.fullXID(JappixCommon.getStanzaFrom(pr));
- var room = JappixCommon.bareXID(from);
- var hash = hex_md5(room);
- var resource = JappixCommon.thisResource(from);
-
- // Is it a valid server presence?
- var valid = false;
-
- if(!resource || (resource == JappixCommon.unescapeQuotes(jQuery('#jappix_mini #chat-' + hash + '[data-type="groupchat"]').attr('data-nick')))) {
- valid = true;
- }
-
- // Password required?
- if(valid && jQuery(xml).find('error[type="auth"] not-authorized').size()) {
- // Create a new prompt
- self.openPrompt(JappixCommon.printf(JappixCommon._e("This room (%s) is protected with a password."), room));
-
- // When prompt submitted
- jQuery('#jappix_popup div.jm_prompt form').submit(function() {
- try {
- // Read the value
- var password = self.closePrompt();
-
- // Any submitted chat to join?
- if(password) {
- // Send the password
- self.presence('', '', '', '', from, password, true, self.handleMUC);
-
- // Focus on the pane again
- self.switchPane('chat-' + hash, hash);
- }
- }
-
- catch(e) {}
-
- finally {
- return false;
- }
- });
-
- return;
- }
-
- // Nickname conflict?
- else if(valid && jQuery(xml).find('error[type="cancel"] conflict').size()) {
- // New nickname
- var nickname = resource + '_';
-
- // Send the new presence
- self.presence('', '', '', '', room + '/' + nickname, '', true, self.handleMUC);
-
- // Update the nickname marker
- jQuery('#jappix_mini #chat-' + hash).attr('data-nick', JappixCommon.escapeQuotes(nickname));
- }
-
- // Handle normal presence
- else {
- // Start the initial timer
- jQuery('#jappix_mini #chat-' + hash).oneTime('10s', function() {
- jQuery(this).attr('data-init', 'true');
- });
-
- // Trigger presence handler
- self.handlePresence(pr);
- }
- } catch(e) {
- JappixConsole.error('JappixMini.handleMUC', e);
- }
-
- };
-
-
- /**
- * Updates the user presence
- * @public
- * @param {string} type
- * @param {string} show
- * @param {number} priority
- * @param {string} status
- * @param {string} to
- * @param {string} password
- * @param {boolean} limit_history
- * @param {function} handler
- * @return {undefined}
- */
- self.presence = function(type, show, priority, status, to, password, limit_history, handler) {
-
- try {
- var pr = new JSJaCPresence();
-
- // Add the attributes
- if(to)
- pr.setTo(to);
- if(type)
- pr.setType(type);
- if(show)
- pr.setShow(show);
- if(status)
- pr.setStatus(status);
-
- if(priority) {
- pr.setPriority(priority);
- } else if(MINI_PRIORITY && !to) {
- pr.setPriority(MINI_PRIORITY);
- }
-
- // Special presence elements
- if(password || limit_history) {
- var x = pr.appendNode('x', {'xmlns': NS_MUC});
-
- // Any password?
- if(password) {
- x.appendChild(pr.buildNode('password', {'xmlns': NS_MUC}, password));
- }
-
- // Any history limit?
- if(limit_history) {
- x.appendChild(pr.buildNode('history', {'maxstanzas': 10, 'seconds': 86400, 'xmlns': NS_MUC}));
- }
- }
-
- // Send the packet
- if(handler) {
- con.send(pr, handler);
- } else {
- con.send(pr);
- }
-
- JappixConsole.info('Presence sent (to: ' + (to || 'none') + ', show: ' + (show || 'none') + ', type: ' + (type || 'none') + ')');
- } catch(e) {
- JappixConsole.error('JappixMini.presence', e);
- }
-
- };
-
-
- /**
- * Sends a given message
- * @public
- * @param {object} aForm
- * @return {boolean}
- */
- self.sendMessage = function(aForm) {
-
- try {
- var body = jQuery.trim(aForm.body.value);
- var xid = aForm.xid.value;
- var type = aForm.type.value;
- var hash = hex_md5(xid);
-
- if(body && xid) {
- // Send the message
- var aMsg = new JSJaCMessage();
-
- // If the roster does not give us any nick the user may have send us a nickname to use with his first message
- // @see http://xmpp.org/extensions/xep-0172.html
- var known_roster_entry = jQuery('#jappix_mini a.jm_friend[data-xid="' + JappixCommon.escapeQuotes(xid) + '"]');
-
- if(known_roster_entry.size() === 0) {
- var subscription = known_roster_entry.attr('data-sub');
-
- // The other may not know my nickname if we do not have both a roster entry, or if he doesn't have one
- if(('both' != subscription) && ('from' != subscription)) {
- aMsg.setNick(MINI_NICKNAME);
- }
- }
-
- // Message data
- aMsg.setTo(xid);
- aMsg.setType(type);
- aMsg.setBody(body);
-
- // Chatstate
- aMsg.appendNode('active', {'xmlns': NS_CHATSTATES});
-
- // Send it!
- self.enqueue(aMsg);
-
- // Clear the input
- aForm.body.value = '';
-
- // Display the message we sent
- if(type != 'groupchat') {
- self.displayMessage(type, body, JappixCommon.getXID(), 'me', hash, JappixDateUtils.getCompleteTime(), JappixDateUtils.getTimeStamp(), 'user-message');
- }
-
- JappixConsole.log('Message (' + type + ') sent to: ' + xid);
- }
- } catch(e) {
- JappixConsole.error('JappixMini.sendMessage', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Enqueues a stanza (to be sent over the network)
- * @public
- * @param {object} stanza
- * @return {undefined}
- */
- self.enqueue = function(stanza) {
-
- try {
- // Send stanza over the network or enqueue it?
- if(JappixCommon.isConnected()) {
- con.send(stanza);
- } else {
- MINI_QUEUE.push(
- stanza.xml()
- );
-
- JappixConsole.log('Enqueued an event (to be sent when connectivity is back).');
- }
- } catch(e) {
- JappixConsole.error('JappixMini.enqueue', e);
- }
-
- };
-
-
- /**
- * Dequeues stanzas and send them over the network
- * @public
- * @return {undefined}
- */
- self.dequeue = function() {
-
- try {
- var stanza_str, stanza_childs,
- stanza;
-
- // Execute deferred tasks
- while(MINI_QUEUE.length) {
- stanza_str = MINI_QUEUE.shift();
- stanza_childs = JappixCommon.XMLFromString(stanza_str).childNodes;
-
- if(stanza_childs && stanza_childs[0]) {
- stanza = JSJaCPacket.wrapNode(stanza_childs[0]);
- con.send(stanza);
- }
-
- JappixConsole.log('Dequeued a stanza.');
- }
- } catch(e) {
- JappixConsole.error('JappixMini.dequeue', e);
- }
-
- };
-
-
- /**
- * Serializes and store the queue storage
- * @public
- * @return {undefined}
- */
- self.serializeQueue = function() {
-
- try {
- JappixDataStore.setDB(MINI_HASH, 'jappix-mini', 'queue', jQuery.toJSON(MINI_QUEUE));
- } catch(e) {
- JappixConsole.error('JappixMini.serializeQueue', e);
- }
-
- };
-
-
- /**
- * Unserializes and update the queue storage
- * @public
- * @return {undefined}
- */
- self.unserializeQueue = function() {
-
- try {
- var start_body, end_body,
- start_args, end_args;
-
- var s_queue = JappixDataStore.getDB(MINI_HASH, 'jappix-mini', 'queue');
- JappixDataStore.removeDB(MINI_HASH, 'jappix-mini', 'queue');
-
- if(s_queue) {
- MINI_QUEUE = jQuery.evalJSON(s_queue);
- }
- } catch(e) {
- JappixConsole.error('JappixMini.unserialize', e);
- }
-
- };
-
-
- /**
- * Generates the asked smiley image
- * @public
- * @param {string} image
- * @param {string} text
- * @return {string}
- */
- self.smiley = function(image, text) {
-
- try {
- return ' ';
- } catch(e) {
- JappixConsole.error('JappixMini.smiley', e);
-
- return null;
- }
-
- };
-
-
- /**
- * Notifies incoming chat messages
- * @public
- * @param {string} hash
- * @return {undefined}
- */
- self.notifyMessage = function(hash) {
-
- try {
- // Define the paths
- var tab = '#jappix_mini #chat-' + hash + ' a.jm_chat-tab';
- var notify = tab + ' span.jm_notify';
- var notify_middle = notify + ' span.jm_notify_middle';
-
- // Notification box not yet added?
- if(!JappixCommon.exists(notify)) {
- jQuery(tab).append(
- '' +
- ' ' +
- '0 ' +
- ' ' +
- ' '
- );
- }
-
- // Increment the notification number
- var number = parseInt(jQuery(notify_middle).text());
- jQuery(notify_middle).text(number + 1);
-
- // Update the notification counters
- self.notifyCounters();
- } catch(e) {
- JappixConsole.error('JappixMini.notifyMessage', e);
- }
-
- };
-
-
- /**
- * Notifies the user from a session error
- * @public
- * @return {undefined}
- */
- self.notifyError = function() {
-
- try {
- // Replace the Jappix Mini DOM content
- jQuery('#jappix_mini').html(
- ''
- );
- } catch(e) {
- JappixConsole.error('JappixMini.notifyError', e);
- }
-
- };
-
-
- /**
- * Updates the global counter with the new notifications
- * @public
- * @return {undefined}
- */
- self.notifyCounters = function() {
-
- try {
- // Count the number of notifications
- var number = 0;
-
- jQuery('#jappix_mini span.jm_notify span.jm_notify_middle').each(function() {
- number = number + parseInt(jQuery(this).text());
- });
-
- // Update the notification link counters
- jQuery('#jappix_mini a.jm_switch').removeClass('jm_notifnav');
-
- if(number) {
- // Left?
- if(jQuery('#jappix_mini div.jm_conversation:visible:first').prevAll().find('span.jm_notify').size())
- jQuery('#jappix_mini a.jm_switch.jm_left').addClass('jm_notifnav');
-
- // Right?
- if(jQuery('#jappix_mini div.jm_conversation:visible:last').nextAll().find('span.jm_notify').size())
- jQuery('#jappix_mini a.jm_switch.jm_right').addClass('jm_notifnav');
- }
-
- // No saved title? Abort!
- if(MINI_TITLE === null) {
- return;
- }
-
- // Page title code
- var title = MINI_TITLE;
-
- // No new stuffs? Reset the title!
- if(number) {
- title = '[' + number + '] ' + title;
- }
-
- // Apply the title
- document.title = title;
- } catch(e) {
- JappixConsole.error('JappixMini.notifyCounters', e);
- }
-
- };
-
-
- /**
- * Clears the notifications
- * @public
- * @param {string} hash
- * @return {boolean}
- */
- self.clearNotifications = function(hash) {
-
- try {
- // Not focused?
- if(!JappixCommon.isFocused()) {
- return false;
- }
-
- // Remove the notifications counter
- jQuery('#jappix_mini #chat-' + hash + ' span.jm_notify').remove();
-
- // Update the global counters
- self.notifyCounters();
-
- return true;
- } catch(e) {
- JappixConsole.error('JappixMini.clearNotifications', e);
-
- return false;
- }
-
- };
-
-
- /**
- * Updates the roster counter
- * @public
- * @return {undefined}
- */
- self.updateRoster = function() {
-
- try {
- // Update online counter
- jQuery('#jappix_mini a.jm_button span.jm_counter').text(jQuery('#jappix_mini a.jm_online').size());
- } catch(e) {
- JappixConsole.error('JappixMini.updateRoster', e);
- }
-
- };
-
-
- /**
- * Updates the visibility of roster groups
- * @public
- * @return {undefined}
- */
- self.updateGroups = function() {
-
- try {
- jQuery('.jm_grouped_roster').filter(':not(:has(.jm_friend.jm_online:visible))').hide();
- } catch(e) {
- JappixConsole.error('JappixMini.updateGroups', e);
- }
-
- };
-
-
- /**
- * Updates the chat overflow
- * @public
- * @return {undefined}
- */
- self.updateOverflow = function() {
-
- try {
- // Process overflow
- var number_visible = parseInt((jQuery(window).width() - 380) / 140);
- var number_visible_dom = jQuery('#jappix_mini div.jm_conversation:visible').size();
-
- if(number_visible <= 0) {
- number_visible = 1;
- }
-
- // Need to reprocess?
- if(number_visible != number_visible_dom) {
- // Show hidden chats
- jQuery('#jappix_mini div.jm_conversation:hidden').show();
-
- // Get total number of chats
- var number_total = jQuery('#jappix_mini div.jm_conversation').size();
-
- // Must add the overflow switcher?
- if(number_visible < number_total) {
- // Create the overflow handler?
- if(!jQuery('#jappix_mini a.jm_switch').size()) {
- // Add the navigation links
- jQuery('#jappix_mini div.jm_conversations').before(
- '' +
- ' ' +
- ' '
- );
-
- jQuery('#jappix_mini div.jm_conversations').after(
- '' +
- ' ' +
- ' '
- );
-
- // Add the click events
- self.overflowEvents();
- }
-
- // Show first visible chats
- var first_visible = jQuery('#jappix_mini div.jm_conversation:visible:first').index();
- var index_visible = number_visible - first_visible - 1;
-
- jQuery('#jappix_mini div.jm_conversation:visible:gt(' + index_visible + ')').hide();
-
- // Close the opened chat
- if(jQuery('#jappix_mini div.jm_conversation:hidden a.jm_pane.jm_clicked').size()) {
- self.switchPane();
- }
-
- // Update navigation buttons
- jQuery('#jappix_mini a.jm_switch').removeClass('jm_nonav');
-
- if(!jQuery('#jappix_mini div.jm_conversation:visible:first').prev().size()) {
- jQuery('#jappix_mini a.jm_switch.jm_left').addClass('jm_nonav');
- }
-
- if(!jQuery('#jappix_mini div.jm_conversation:visible:last').next().size()) {
- jQuery('#jappix_mini a.jm_switch.jm_right').addClass('jm_nonav');
- }
- }
-
- // Must remove the overflow switcher?
- else {
- jQuery('#jappix_mini a.jm_switch').remove();
- jQuery('#jappix_mini div.jm_conversation:hidden').show();
- }
- }
- } catch(e) {
- JappixConsole.error('JappixMini.updateOverflow', e);
- }
-
- };
-
-
- /**
- * Click events on the chat overflow
- * @public
- * @return {undefined}
- */
- self.overflowEvents = function() {
-
- try {
- jQuery('#jappix_mini a.jm_switch').click(function() {
- var this_sel = jQuery(this);
-
- // Nothing to do?
- if(this_sel.hasClass('jm_nonav')) {
- return false;
- }
-
- var hide_this = '';
- var show_this = '';
-
- // Go left?
- if(this_sel.is('.jm_left')) {
- show_this = jQuery('#jappix_mini div.jm_conversation:visible:first').prev();
-
- if(show_this.size()) {
- hide_this = jQuery('#jappix_mini div.jm_conversation:visible:last');
- }
- }
-
- // Go right?
- else {
- show_this = jQuery('#jappix_mini div.jm_conversation:visible:last').next();
-
- if(show_this.size()) {
- hide_this = jQuery('#jappix_mini div.jm_conversation:visible:first');
- }
- }
-
- // Update overflow content
- if(show_this && show_this.size()) {
- // Hide
- if(hide_this && hide_this.size()) {
- hide_this.hide();
-
- // Close the opened chat
- if(hide_this.find('a.jm_pane').hasClass('jm_clicked')) {
- self.switchPane();
- }
- }
-
- // Show
- show_this.show();
-
- // Update navigation buttons
- jQuery('#jappix_mini a.jm_switch').removeClass('jm_nonav');
-
- if((this_sel.is('.jm_right') && !show_this.next().size()) || (this_sel.is('.jm_left') && !show_this.prev().size())) {
- this_sel.addClass('jm_nonav');
- }
-
- // Update notification counters
- self.notifyCounters();
- }
-
- return false;
- });
- } catch(e) {
- JappixConsole.error('JappixMini.overflowEvents', e);
- }
-
- };
-
-
- /**
- * Creates the Jappix Mini DOM content
- * @public
- * @param {string} domain
- * @param {string} user
- * @param {string} password
- * @return {undefined}
- */
- self.create = function(domain, user, password) {
-
- try {
- // Try to restore the DOM
- var dom = JappixDataStore.getDB(MINI_HASH, 'jappix-mini', 'dom');
- var suspended = false;
- var resumed = false;
-
- // Reset DOM storage (free memory)
- JappixDataStore.removeDB(MINI_HASH, 'jappix-mini', 'dom');
-
- // Invalid stored DOM?
- if(dom && isNaN(jQuery(dom).find('a.jm_pane.jm_button span.jm_counter').text())) {
- dom = null;
- }
-
- // Old DOM? (saved session)
- if(dom) {
- // Attempt to resume connection
- con = new JSJaCHttpBindingConnection();
-
- self.setupCon(con);
- resumed = con.resume();
-
- // Read the old nickname
- MINI_NICKNAME = JappixDataStore.getDB(MINI_HASH, 'jappix-mini', 'nickname');
-
- // Marker
- suspended = true;
- MINI_ROSTER_INIT = true;
- }
-
- // New DOM?
- else {
- dom = '';
- }
-
- // Create the DOM
- jQuery('body').append('' + dom + '
');
-
- // Hide the roster picker panels
- jQuery('#jappix_mini a.jm_status.active, #jappix_mini a.jm_join.active').removeClass('active');
- jQuery('#jappix_mini div.jm_status_picker').hide();
- jQuery('#jappix_mini div.jm_chan_suggest').remove();
-
- // Chat navigation overflow events
- self.overflowEvents();
-
- // Delay to fix DOM lag bug (CSS file not yet loaded)
- jQuery('#jappix_mini').everyTime(100, function() {
- var this_sel = jQuery(this);
-
- if(this_sel.is(':visible')) {
- JappixConsole.info('CSS loaded asynchronously.');
-
- this_sel.stopTime();
-
- // Re-process chat overflow
- self.updateOverflow();
-
- // Adapt roster height
- self.adaptRoster();
-
- // Update current pixel streams
- self.updatePixStream();
- }
- });
-
- // Auto-check if ads should be added
- if(ADS_ENABLE === 'on' && GADS_CLIENT && GADS_SLOT) {
- jQuery('#jappix_mini div.jm_conversations').everyTime('60s', function() {
- JappixConsole.debug('JappixMini.create[timer]', 'Auto-updating ads...');
-
- self.updatePixStream();
-
- JappixConsole.debug('JappixMini.create[timer]', 'Done auto-updating ads.');
- });
- }
-
- // CSS refresh (Safari display bug when restoring old DOM)
- jQuery('#jappix_mini div.jm_starter').css('float', 'right');
- jQuery('#jappix_mini div.jm_conversations, #jappix_mini div.jm_conversation, #jappix_mini a.jm_switch').css('float', 'left');
-
- // The click events
- jQuery('#jappix_mini a.jm_button').click(function() {
- // Using a try/catch override IE issues
- try {
- // Presence counter
- var counter = '#jappix_mini a.jm_pane.jm_button span.jm_counter';
-
- // Cannot open the roster?
- if(jQuery(counter).text() == JappixCommon._e("Please wait...")) {
- return false;
- }
-
- // Not yet connected?
- if(jQuery(counter).text() == JappixCommon._e("Chat")) {
- // Remove the animated bubble
- jQuery('#jappix_mini div.jm_starter span.jm_animate').remove();
-
- // Add a waiting marker
- jQuery(counter).text(JappixCommon._e("Please wait..."));
-
- // Launch the connection!
- self.connect(domain, user, password);
-
- return false;
- }
-
- // Normal actions
- if(!jQuery(this).hasClass('jm_clicked')) {
- self.showRoster();
- } else {
- self.hideRoster();
- }
- }
-
- catch(e) {}
-
- finally {
- return false;
- }
- });
-
- jQuery('#jappix_mini a.jm_status').click(function() {
- // Using a try/catch override IE issues
- try {
- var this_sel = jQuery(this);
- var is_active = this_sel.hasClass('active');
-
- jQuery('#jappix_mini div.jm_actions a').blur().removeClass('active');
-
- if(is_active) {
- jQuery('#jappix_mini div.jm_status_picker').hide();
- } else {
- jQuery('#jappix_mini div.jm_chan_suggest').remove();
- jQuery('#jappix_mini div.jm_status_picker').show();
- this_sel.addClass('active');
- }
- }
-
- catch(e) {}
-
- finally {
- return false;
- }
- });
-
- jQuery('#jappix_mini div.jm_status_picker a').click(function() {
- // Using a try/catch override IE issues
- try {
- var this_sel = jQuery(this);
-
- // Generate an array of presence change XIDs
- var pr_xid = [''];
-
- jQuery('#jappix_mini div.jm_conversation[data-type="groupchat"]').each(function() {
- var this_sub_sel = jQuery(this);
- pr_xid.push(JappixCommon.unescapeQuotes(this_sub_sel.attr('data-xid')) + '/' + JappixCommon.unescapeQuotes(this_sub_sel.attr('data-nick')));
- });
-
- // Loop on XIDs
- var new_status = this_sel.data('status');
-
- jQuery.each(pr_xid, function(key, value) {
- switch(new_status) {
- case 'available':
- self.presence('', '', '', '', value);
- break;
-
- case 'away':
- self.presence('', 'away', '', '', value);
- break;
-
- case 'dnd':
- self.presence('', 'dnd', '', '', value);
- break;
-
- case 'unavailable':
- self.disconnect();
- break;
-
- default:
- self.presence('', '', '', '', value);
- break;
- }
- });
-
- // Switch the status
- if(new_status != 'unavailable') {
- jQuery('#jappix_mini a.jm_status span').removeClass('jm_available jm_away jm_dnd jm_unavailable')
- .addClass('jm_' + this_sel.data('status'));
-
- jQuery('#jappix_mini div.jm_status_picker').hide();
- jQuery('#jappix_mini a.jm_status').blur().removeClass('active');
- }
- }
-
- catch(e) {}
-
- finally {
- return false;
- }
- });
-
- jQuery('#jappix_mini div.jm_actions a.jm_join').click(function() {
- // Using a try/catch override IE issues
- try {
- var this_sel = jQuery(this);
-
- // Any suggested chat/groupchat?
- if((MINI_SUGGEST_CHATS && MINI_SUGGEST_CHATS.length) || (MINI_SUGGEST_GROUPCHATS && MINI_SUGGEST_GROUPCHATS.length)) {
- var is_active = this_sel.hasClass('active');
- jQuery('#jappix_mini div.jm_actions a').blur().removeClass('active');
-
- if(is_active) {
- jQuery('#jappix_mini div.jm_chan_suggest').remove();
- } else {
- // Button style
- jQuery('#jappix_mini div.jm_status_picker').hide();
- this_sel.addClass('active');
-
- // Generate selector code
- var chans_html = '';
-
- // Generate the groupchat links HTML
- for(var i = 0; i < MINI_SUGGEST_GROUPCHATS.length; i++) {
- // Empty value?
- if(!MINI_SUGGEST_GROUPCHATS[i]) {
- continue;
- }
-
- // Using a try/catch override IE issues
- try {
- var chat_room = JappixCommon.bareXID(JappixCommon.generateXID(MINI_SUGGEST_GROUPCHATS[i], 'groupchat'));
- var chat_pwd = MINI_SUGGEST_PASSWORDS[i] || '';
-
- chans_html +=
- '' +
- ' ' +
- '' + JappixCommon.getXIDNick(chat_room).htmlEnc() + ' ' +
- ' ';
- }
-
- catch(e) {}
- }
-
- // Any separation space to add?
- if(chans_html) {
- chans_html += '
';
- }
-
- // Generate the chat links HTML
- for(var j = 0; j < MINI_SUGGEST_CHATS.length; j++) {
- // Empty value?
- if(!MINI_SUGGEST_CHATS[j]) {
- continue;
- }
-
- // Using a try/catch override IE issues
- try {
- // Read current chat values
- var chat_xid = JappixCommon.bareXID(JappixCommon.generateXID(MINI_SUGGEST_CHATS[j], 'chat'));
- var chat_hash = hex_md5(chat_xid);
- var chat_nick = jQuery('#jappix_mini a#friend-' + chat_hash).attr('data-nick');
-
- // Get current chat nickname
- if(!chat_nick) {
- chat_nick = JappixCommon.getXIDNick(chat_xid);
- } else {
- chat_nick = JappixCommon.unescapeQuotes(chat_nick);
- }
-
- // Generate HTML for current chat
- chans_html +=
- '' +
- ' ' +
- '' + JappixCommon.getXIDNick(chat_nick).htmlEnc() + ' ' +
- ' ';
- }
-
- catch(e) {}
- }
-
- // Any separation space to add?
- if(chans_html) {
- chans_html += '
';
- }
-
- // Append selector code
- jQuery('#jappix_mini div.jm_actions').append(
- ''
- );
-
- // Click events
- jQuery('#jappix_mini div.jm_chan_suggest a').click(function() {
- // Using a try/catch override IE issues
- try {
- var this_sub_sel = jQuery(this);
-
- // Chat?
- if(this_sub_sel.is('.jm_suggest_chat')) {
- var current_chat = JappixCommon.unescapeQuotes(this_sub_sel.attr('data-xid'));
-
- self.chat('chat', current_chat, this_sub_sel.find('span.jm_chan_name').text(), hex_md5(current_chat));
- }
-
- // Groupchat?
- else if(this_sub_sel.is('.jm_suggest_groupchat')) {
- var current_groupchat = JappixCommon.unescapeQuotes(this_sub_sel.attr('data-xid'));
- var current_password = this_sub_sel.attr('data-pwd') || null;
-
- if(current_password)
- current_password = JappixCommon.unescapeQuotes(current_password);
-
- self.chat('groupchat', current_groupchat, this_sub_sel.find('span.jm_chan_name').text(), hex_md5(current_groupchat), current_password);
- }
-
- // Default prompt?
- else {
- self.groupchatPrompt();
- }
- }
-
- catch(e) {}
-
- finally {
- return false;
- }
- });
-
- // Adapt chan suggest height
- self.adaptRoster();
- }
- }
-
- // Default action
- else {
- self.groupchatPrompt();
- }
- }
-
- catch(e) {}
-
- finally {
- return false;
- }
- });
-
- // Updates the roster with only searched terms
- jQuery('#jappix_mini div.jm_roster div.jm_search input.jm_searchbox').keyup(function(e) {
- var this_sel = jQuery(this);
-
- // Avoid buddy navigation to be reseted
- if((e.keyCode == 38) || (e.keyCode == 40)) {
- return;
- }
-
- // Escape key pressed?
- if(e.keyCode == 27) {
- this_sel.val('');
- }
-
- // Save current value
- this_sel.attr('data-value', this_sel.val());
-
- // Don't filter at each key up (faster for computer)
- var _this = this;
-
- JappixCommon.typewatch()(function() {
- // Using a try/catch to override IE issues
- try {
- // Get values
- var search = jQuery(_this).val();
- var regex = new RegExp('((^)|( ))' + JappixCommon.escapeRegex(search), 'gi');
-
- // Reset results
- jQuery('#jappix_mini a.jm_friend.jm_hover').removeClass('jm_hover');
- jQuery('#jappix_mini div.jm_roster div.jm_grouped').show();
-
- // If there is no search, we don't need to loop over buddies
- if(!search) {
- jQuery('#jappix_mini div.jm_roster div.jm_buddies a.jm_online').show();
-
- // Update groups visibility
- self.updateGroups();
-
- return;
- }
-
- // Filter buddies
- jQuery('#jappix_mini div.jm_roster div.jm_buddies a.jm_online').each(function() {
- var this_sub_sel = jQuery(this);
- var nick = JappixCommon.unescapeQuotes(this_sub_sel.data('nick'));
-
- if(nick.match(regex)) {
- this_sub_sel.show();
- } else {
- this_sub_sel.hide();
- }
- });
-
- // Filter groups
- jQuery('#jappix_mini div.jm_roster div.jm_grouped').each(function() {
- var this_sub_sel = jQuery(this);
-
- if(!this_sub_sel.find('a.jm_online:visible').size()) {
- this_sub_sel.hide();
- }
- });
-
- // Focus on the first buddy
- jQuery('#jappix_mini div.jm_roster div.jm_buddies a.jm_online:visible:first').addClass('jm_hover');
- }
-
- catch(e) {}
-
- finally {
- return false;
- }
- }, 500);
- });
-
- // Roster navigation
- jQuery(document).keydown(function(e) {
- // Cannot work if roster is not opened
- if(jQuery('#jappix_mini div.jm_roster').is(':hidden')) {
- return;
- }
-
- // Up/Down keys
- if((e.keyCode == 38) || (e.keyCode == 40)) {
- // Hover the last/first buddy
- if(!jQuery('#jappix_mini a.jm_online.jm_hover').size()) {
- if(e.keyCode == 38) {
- jQuery('#jappix_mini a.jm_online:visible:last').addClass('jm_hover');
- } else {
- jQuery('#jappix_mini a.jm_online:visible:first').addClass('jm_hover');
- }
- }
-
- // Hover the previous/next buddy
- else if(jQuery('#jappix_mini a.jm_online:visible').size() > 1) {
- var hover_index = jQuery('#jappix_mini a.jm_online:visible').index(jQuery('a.jm_hover'));
-
- // Up (decrement) or down (increment)?
- if(e.keyCode == 38) {
- hover_index--;
- } else {
- hover_index++;
- }
-
- if(!hover_index) {
- hover_index = 0;
- }
-
- // No buddy before/after?
- if(!jQuery('#jappix_mini a.jm_online:visible').eq(hover_index).size()) {
- if(e.keyCode == 38) {
- hover_index = jQuery('#jappix_mini a.jm_online:visible:last').index();
- } else {
- hover_index = 0;
- }
- }
-
- // Hover the previous/next buddy
- jQuery('#jappix_mini a.jm_friend.jm_hover').removeClass('jm_hover');
- jQuery('#jappix_mini a.jm_online:visible').eq(hover_index).addClass('jm_hover');
- }
-
- // Scroll to the hovered buddy (if out of limits)
- jQuery('#jappix_mini div.jm_roster div.jm_buddies').scrollTo(jQuery('#jappix_mini a.jm_online.jm_hover'), 0, {margin: true});
-
- return false;
- }
-
- // Enter key
- if((e.keyCode == 13) && jQuery('#jappix_mini a.jm_friend.jm_hover').size()) {
- jQuery('#jappix_mini a.jm_friend.jm_hover').click();
-
- return false;
- }
- });
-
- // Chat type re-focus
- jQuery(document).keypress(function(evt) {
- // Cannot work if an input/textarea is already focused or chat is not opened
- var path = '#jappix_mini div.jm_conversation div.jm_chat-content';
-
- if(jQuery('input, textarea').is(':focus') || !jQuery(path).is(':visible')) {
- return;
- }
-
- // May cause some compatibility issues
- try {
- // Get key value
- var key_value = jQuery.trim(String.fromCharCode(evt.which));
-
- // Re-focus on opened chat?
- if(key_value) {
- // Path to chat input
- var path_input = path + ' input.jm_send-messages';
-
- // Use a timer to override the DOM lag issue
- jQuery(document).oneTime(10, function() {
- // Get input values
- select_input = jQuery(path_input);
- value_input = select_input.val();
-
- // Append pressed key value
- select_input.val(value_input + key_value);
- select_input.focus();
-
- // Put cursor at the end of input
- select_input[0].selectionStart = select_input[0].selectionEnd = value_input.length + 1;
- });
- }
- } catch(e) {}
- });
-
- // Hides the roster when clicking away of Jappix Mini
- jQuery(document).click(function(evt) {
- if(!jQuery(evt.target).parents('#jappix_mini').size() && !JappixCommon.exists('#jappix_popup')) {
- self.hideRoster();
- }
- });
-
- // Hides all panes double clicking away of Jappix Mini
- jQuery(document).dblclick(function(evt) {
- if(!jQuery(evt.target).parents('#jappix_mini').size() && !JappixCommon.exists('#jappix_popup')) {
- self.switchPane();
- }
- });
-
- // Suspended session resumed?
- if(suspended) {
- // Initialized marker
- MINI_INITIALIZED = true;
-
- // Not resumed? (need to reconnect)
- if(!resumed) {
- // Restore previous reconnect counter
- var reconnect = JappixDataStore.getDB(MINI_HASH, 'jappix-mini', 'reconnect');
-
- if(!isNaN(reconnect)) {
- MINI_RECONNECT = parseInt(reconnect);
- }
-
- // Restore queued functions
- self.unserializeQueue();
-
- // Simulate a network error to get the same silent reconnect effect
- self.disconnected();
- }
-
- // Restore chat input values
- jQuery('#jappix_mini div.jm_conversation input.jm_send-messages').each(function() {
- var this_sub_sel = jQuery(this);
- var chat_value = this_sub_sel.attr('data-value');
-
- if(chat_value) {
- this_sub_sel.val(chat_value);
- }
- });
-
- // Restore roster filter value
- var search_box = jQuery('#jappix_mini div.jm_roster div.jm_search input.jm_searchbox');
- var filter_value = search_box.attr('data-value');
-
- if(filter_value) {
- search_box.val(filter_value).keyup();
- }
-
- // Restore buddy events
- self.eventsBuddy('#jappix_mini a.jm_friend');
-
- // Restore chat click events
- jQuery('#jappix_mini div.jm_conversation').each(function() {
- var this_sub_sel = jQuery(this);
- self.chatEvents(this_sub_sel.attr('data-type'), JappixCommon.unescapeQuotes(this_sub_sel.attr('data-xid')), this_sub_sel.attr('data-hash'));
- });
-
- // Restore init marker on all groupchats
- jQuery('#jappix_mini div.jm_conversation[data-type="groupchat"]').attr('data-init', 'true');
-
- // Scroll down to the last message
- var scroll_hash = jQuery('#jappix_mini div.jm_conversation:has(a.jm_pane.jm_clicked)').attr('data-hash');
- var scroll_position = JappixDataStore.getDB(MINI_HASH, 'jappix-mini', 'scroll');
-
- // Any scroll position?
- if(scroll_position) {
- scroll_position = parseInt(scroll_position);
- }
-
- if(scroll_hash) {
- // Use a timer to override the DOM lag issue
- jQuery(document).oneTime(200, function() {
- self.messageScroll(scroll_hash, scroll_position);
- });
- }
-
- // Update notification counters
- self.notifyCounters();
- }
-
- // Can auto-connect?
- else if(MINI_AUTOCONNECT) {
- self.connect(domain, user, password);
- }
-
- // Cannot auto-connect?
- else {
- // Chat text
- jQuery('#jappix_mini a.jm_pane.jm_button span.jm_counter').text(JappixCommon._e("Chat"));
-
- // Must animate?
- if(MINI_ANIMATE) {
- // Add content
- jQuery('#jappix_mini div.jm_starter').prepend(
- ' '
- );
- }
- }
- } catch(e) {
- JappixConsole.error('JappixMini.create', e);
- }
-
- };
-
-
- /**
- * Buddy events
- * @public
- * @param {string} path
- * @return {undefined}
- */
- self.eventsBuddy = function(path) {
-
- try {
- var selector = jQuery(path);
-
- // Restore buddy click events
- selector.click(function() {
- // Using a try/catch override IE issues
- try {
- var this_sel = jQuery(this);
- self.chat('chat', JappixCommon.unescapeQuotes(this_sel.attr('data-xid')), JappixCommon.unescapeQuotes(this_sel.attr('data-nick')), this_sel.attr('data-hash'));
- }
-
- catch(e) {}
-
- finally {
- return false;
- }
- });
-
- // Restore buddy hover events
- selector.hover(function() {
- jQuery('#jappix_mini a.jm_friend.jm_hover').removeClass('jm_hover');
- jQuery(this).addClass('jm_hover');
- }, function() {
- jQuery(this).removeClass('jm_hover');
- });
-
- // Restore buddy mousedown events
- selector.mousedown(function() {
- jQuery('#jappix_mini a.jm_friend.jm_hover').removeClass('jm_hover');
- jQuery(this).addClass('jm_hover');
- });
-
- // Restore buddy focus events
- selector.focus(function() {
- jQuery('#jappix_mini a.jm_friend.jm_hover').removeClass('jm_hover');
- jQuery(this).addClass('jm_hover');
- });
-
- // Restore buddy blur events
- selector.blur(function() {
- jQuery(this).removeClass('jm_hover');
- });
- } catch(e) {
- JappixConsole.error('JappixMini.eventsBuddy', e);
- }
-
- };
-
-
- /**
- * Displays a given message
- * @public
- * @param {string} type
- * @param {string} body
- * @param {string} xid
- * @param {string} nick
- * @param {string} hash
- * @param {string} time
- * @param {string} stamp
- * @param {string} message_type
- * @return {undefined}
- */
- self.displayMessage = function(type, body, xid, nick, hash, time, stamp, message_type) {
-
- try {
- // Generate path
- var path = '#chat-' + hash;
-
- // Can scroll?
- var cont_scroll = document.getElementById('received-' + hash);
- var can_scroll = false;
-
- if(!cont_scroll.scrollTop || ((cont_scroll.clientHeight + cont_scroll.scrollTop) == cont_scroll.scrollHeight)) {
- can_scroll = true;
- }
-
- // Remove the previous message border if needed
- var last = jQuery(path + ' div.jm_group:last');
- var last_stamp = parseInt(last.attr('data-stamp'));
- var last_b = jQuery(path + ' b:last');
- var last_xid = last_b.attr('data-xid');
- var last_type = last.attr('data-type');
- var grouped = false;
- var header = '';
-
- if((last_xid == xid) && (message_type == last_type) && ((stamp - last_stamp) <= 1800)) {
- grouped = true;
- } else {
- // Write the message date
- if(nick)
- header += '' + time + ' ';
-
- // Write the buddy name at the top of the message group
- if(type == 'groupchat')
- header += '' + nick.htmlEnc() + ' ';
- else if(nick == 'me')
- header += '' + JappixCommon._e("You") + ' ';
- else
- header += '' + nick.htmlEnc() + ' ';
- }
-
- // Apply the /me command
- var me_command = false;
-
- if(body.match(/^\/me /i)) {
- body = body.replace(/^\/me /i, nick + ' ');
-
- // Marker
- me_command = true;
- }
-
- // HTML-encode the message
- body = body.htmlEnc();
-
- // Apply the smileys
- body = body.replace(/(;-?\))(\s|$)/gi, self.smiley('wink', '$1'))
- .replace(/(:-?3)(\s|$)/gi, self.smiley('waii', '$1'))
- .replace(/(:-?\()(\s|$)/gi, self.smiley('unhappy', '$1'))
- .replace(/(:-?P)(\s|$)/gi, self.smiley('tongue', '$1'))
- .replace(/(:-?O)(\s|$)/gi, self.smiley('surprised', '$1'))
- .replace(/(:-?\))(\s|$)/gi, self.smiley('smile', '$1'))
- .replace(/(\^_?\^)(\s|$)/gi, self.smiley('happy', '$1'))
- .replace(/(:-?D)(\s|$)/gi, self.smiley('grin', '$1'));
-
- // Format the text
- body = body.replace(/(^|\s|>|\()((\*)([^<>'"\*]+)(\*))($|\s|<|\))/gi, '$1$2 $6')
- .replace(/(^|\s|>|\()((\/)([^<>'"\/]+)(\/))($|\s|<|\))/gi, '$1$2 $6')
- .replace(/(^|\s|>|\()((_)([^<>'"_]+)(_))($|\s|<|\))/gi, '$1$2 $6');
-
- // Filter the links
- body = JappixLinks.apply(body, 'mini');
-
- // Generate the message code
- if(me_command) {
- body = '' + body + ' ';
- }
-
- body = '' + body + '
';
-
- // Create the message
- if(grouped) {
- jQuery('#jappix_mini #chat-' + hash + ' div.jm_received-messages div.jm_group:last').append(body);
- } else {
- jQuery('#jappix_mini #chat-' + hash + ' div.jm_chatstate_typing').before('' + header + body + '
');
- }
-
- // Scroll to this message
- if(can_scroll) {
- self.messageScroll(hash);
- }
- } catch(e) {
- JappixConsole.error('JappixMini.displayMessage', e);
- }
-
- };
-
-
- /**
- * Switches to a given point
- * @public
- * @param {string} element
- * @param {string} hash
- * @return {undefined}
- */
- self.switchPane = function(element, hash) {
-
- try {
- // Hide every item
- self.hideRoster();
- jQuery('#jappix_mini a.jm_pane').removeClass('jm_clicked');
- jQuery('#jappix_mini div.jm_chat-content').hide();
-
- // Show the asked element
- if(element && (element != 'roster')) {
- var current = '#jappix_mini #' + element;
-
- // Navigate to this chat
- if(jQuery(current).size() && jQuery(current).is(':hidden')) {
- var click_nav = '';
-
- // Before or after?
- if(jQuery('#jappix_mini div.jm_conversation:visible:first').prevAll().is('#' + element))
- click_nav = jQuery('#jappix_mini a.jm_switch.jm_left');
- else
- click_nav = jQuery('#jappix_mini a.jm_switch.jm_right');
-
- // Click previous or next
- if(click_nav) {
- while(jQuery(current).is(':hidden') && !click_nav.hasClass('jm_nonav'))
- click_nav.click();
- }
- }
-
- // Show it
- jQuery(current + ' a.jm_pane').addClass('jm_clicked');
- jQuery(current + ' div.jm_chat-content').show();
-
- // Use a timer to override the DOM lag issue
- jQuery(document).oneTime(10, function() {
- jQuery(current + ' input.jm_send-messages').focus();
- });
-
- // Scroll to the last message & adapt chat
- if(hash) {
- self.messageScroll(hash);
- self.updatePixStream(hash);
- }
- }
- } catch(e) {
- JappixConsole.error('JappixMini.switchPane', e);
- }
-
- };
-
-
- /**
- * Scrolls to the last chat message
- * @public
- * @param {string} hash
- * @param {string} position
- * @return {undefined}
- */
- self.messageScroll = function(hash, position) {
-
- try {
- var id = document.getElementById('received-' + hash);
-
- // No defined position?
- if(!position) {
- position = id.scrollHeight;
- }
-
- id.scrollTop = position;
- } catch(e) {
- JappixConsole.error('JappixMini.messageScroll', e);
- }
-
- };
-
-
- /**
- * Prompts the user with a given text
- * @public
- * @param {string} text
- * @param {string} value
- * @return {undefined}
- */
- self.openPrompt = function(text, value) {
-
- try {
- // Initialize
- var prompt = '#jappix_popup div.jm_prompt';
- var input = prompt + ' form input';
- var value_input = input + '[type="text"]';
-
- // Remove the existing prompt
- self.closePrompt();
-
- // Add the prompt
- jQuery('body').append(
- ''
- );
-
- // Vertical center
- var vert_pos = '-' + ((jQuery(prompt).height() / 2) + 10) + 'px';
- jQuery(prompt).css('margin-top', vert_pos);
-
- // Apply the value?
- if(value) {
- jQuery(value_input).val(value);
- }
-
- // Focus on the input
- jQuery(document).oneTime(10, function() {
- jQuery(value_input).focus();
- });
-
- // Cancel event
- jQuery(input + '[type="reset"]').click(function() {
- try {
- self.closePrompt();
- }
-
- catch(e) {}
-
- finally {
- return false;
- }
- });
- } catch(e) {
- JappixConsole.error('JappixMini.openPrompt', e);
- }
-
- };
-
-
- /**
- * Returns the prompt value
- * @public
- * @return {string}
- */
- self.closePrompt = function() {
-
- try {
- // Read the value
- var value = jQuery('#jappix_popup div.jm_prompt form input').val();
-
- // Remove the popup
- jQuery('#jappix_popup').remove();
-
- return value;
- } catch(e) {
- JappixConsole.error('JappixMini.closePrompt', e);
- }
-
- };
-
-
- /**
- * Opens the new groupchat prompt
- * @public
- * @return {undefined}
- */
- self.groupchatPrompt = function() {
-
- try {
- // Create a new prompt
- self.openPrompt(JappixCommon._e("Please enter the group chat address to join."));
-
- // When prompt submitted
- jQuery('#jappix_popup div.jm_prompt form').submit(function() {
- try {
- // Read the value
- var join_this = self.closePrompt();
-
- // Any submitted chat to join?
- if(join_this) {
- // Get the chat room to join
- chat_room = JappixCommon.bareXID(JappixCommon.generateXID(join_this, 'groupchat'));
-
- // Create a new groupchat
- self.chat('groupchat', chat_room, JappixCommon.getXIDNick(chat_room), hex_md5(chat_room));
- }
- }
-
- catch(e) {}
-
- finally {
- return false;
- }
- });
- } catch(e) {
- JappixConsole.error('JappixMini.groupchatPrompt', e);
- }
-
- };
-
-
- /**
- * Manages and creates a chat
- * @public
- * @param {string} type
- * @param {string} xid
- * @param {string} nick
- * @param {string} hash
- * @param {string} pwd
- * @param {boolean} show_pane
- * @return {boolean}
- */
- self.chat = function(type, xid, nick, hash, pwd, show_pane) {
-
- try {
- var current = '#jappix_mini #chat-' + hash;
- var nickname = null;
-
- // Not yet added?
- if(!JappixCommon.exists(current)) {
- // Groupchat nickname
- if(type == 'groupchat') {
- // Random nickname?
- if(!MINI_NICKNAME && MINI_RANDNICK)
- MINI_NICKNAME = self.randomNick();
-
- nickname = MINI_NICKNAME;
-
- // No nickname?
- if(!nickname) {
- // Create a new prompt
- self.openPrompt(JappixCommon.printf(JappixCommon._e("Please enter your nickname to join %s."), xid));
-
- // When prompt submitted
- jQuery('#jappix_popup div.jm_prompt form').submit(function() {
- try {
- // Read the value
- var nickname = self.closePrompt();
-
- // Update the stored one
- if(nickname) {
- MINI_NICKNAME = nickname;
- }
-
- // Launch it again!
- self.chat(type, xid, nick, hash, pwd);
- }
-
- catch(e) {}
-
- finally {
- return false;
- }
- });
-
- return;
- }
- }
-
- // Create the HTML markup
- var html = '' +
- '
' +
- '
' +
- '
' + nick + ' ';
-
- // Check if the chat/groupchat exists
- var groupchat_exists = false;
- var chat_exists = false;
-
- if((type == 'groupchat') && MINI_GROUPCHATS && MINI_GROUPCHATS.length) {
- for(var g in MINI_GROUPCHATS) {
- if(xid == JappixCommon.bareXID(JappixCommon.generateXID(MINI_GROUPCHATS[g], 'groupchat'))) {
- groupchat_exists = true;
-
- break;
- }
- }
- }
-
- if((type == 'chat') && MINI_CHATS && MINI_CHATS.length) {
- for(var c in MINI_CHATS) {
- if(xid == JappixCommon.bareXID(JappixCommon.generateXID(MINI_CHATS[c], 'chat'))) {
- chat_exists = true;
-
- break;
- }
- }
- }
-
- // Any close button to display?
- if(((type == 'groupchat') && !groupchat_exists) || ((type == 'chat') && !chat_exists) || ((type != 'groupchat') && (type != 'chat'))) {
- html += '
';
- }
-
- html +=
- '
' +
- '
' +
-
- '
' +
- '
' + JappixCommon.printf(JappixCommon._e("%s is typing..."), nick.htmlEnc()) + '
' +
- '
' +
-
- '
' +
- '
' +
-
- '
' +
- '' + nick.htmlEnc() + ' ' +
- ' ' +
- '
';
-
- jQuery('#jappix_mini div.jm_conversations').prepend(html);
-
- // Get the presence of this friend
- if(type != 'groupchat') {
- var selector = jQuery('#jappix_mini a#friend-' + hash + ' span.jm_presence');
-
- // Default presence
- var show = 'available';
-
- // Read the presence
- if(selector.hasClass('jm_unavailable') || !selector.size()) {
- show = 'unavailable';
- } else if(selector.hasClass('jm_chat')) {
- show = 'chat';
- } else if(selector.hasClass('jm_away')) {
- show = 'away';
- } else if(selector.hasClass('jm_xa')) {
- show = 'xa';
- } else if(selector.hasClass('jm_dnd')) {
- show = 'dnd';
- }
-
- // Create the presence marker
- jQuery(current + ' a.jm_chat-tab').prepend(' ');
- }
-
- // The chat events
- self.chatEvents(type, xid, hash);
-
- // Join the groupchat
- if(type == 'groupchat') {
- // Add nickname & init values
- jQuery(current).attr('data-nick', JappixCommon.escapeQuotes(nickname))
- .attr('data-init', 'false');
-
- // Send the first groupchat presence
- self.presence('', '', '', '', xid + '/' + nickname, pwd, true, self.handleMUC);
- }
- }
-
- // Focus on our pane
- if(show_pane !== false) {
- jQuery(document).oneTime(10, function() {
- self.switchPane('chat-' + hash, hash);
- });
- }
-
- // Update chat overflow
- self.updateOverflow();
- } catch(e) {
- JappixConsole.error('JappixMini.chat', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Events on the chat tool
- * @public
- * @param {string} type
- * @param {string} xid
- * @param {string} hash
- * @return {undefined}
- */
- self.chatEvents = function(type, xid, hash) {
-
- try {
- var current_sel = jQuery('#jappix_mini #chat-' + hash);
-
- // Submit the form
- current_sel.find('form').submit(function() {
- return self.sendMessage(this);
- });
-
- // Click on the tab
- current_sel.find('a.jm_chat-tab').click(function() {
- // Using a try/catch override IE issues
- try {
- // Not yet opened: open it!
- if(!jQuery(this).hasClass('jm_clicked')) {
- // Show it!
- self.switchPane('chat-' + hash, hash);
-
- // Clear the eventual notifications
- self.clearNotifications(hash);
- } else {
- self.switchPane();
- }
- }
-
- catch(e) {}
-
- finally {
- return false;
- }
- });
-
- // Click on the close button
- current_sel.find('div.jm_actions').click(function(evt) {
- // Using a try/catch override IE issues
- try {
- // Close button?
- if(jQuery(evt.target).is('a.jm_close')) {
- // Gone chatstate
- if(type != 'groupchat') {
- self.sendChatstate('gone', xid, hash);
- }
-
- current_sel.stopTime().remove();
-
- // Quit the groupchat?
- if(type == 'groupchat') {
- // Send an unavailable presence
- self.presence('unavailable', '', '', '', xid + '/' + JappixCommon.unescapeQuotes(current_sel.attr('data-nick')));
-
- // Remove this groupchat!
- self.removeGroupchat(xid);
- }
-
- // Update chat overflow
- self.updateOverflow();
- } else {
- // Minimize current chat
- current_sel.find('a.jm_chat-tab.jm_clicked').click();
- }
- }
-
- catch(e) {}
-
- finally {
- return false;
- }
- });
-
- // Focus on the chat input
- current_sel.find('input.jm_send-messages').focus(function() {
- self.clearNotifications(hash);
- })
-
- // Change on the chat input
- .keyup(function() {
- var this_sel = jQuery(this);
- this_sel.attr('data-value', this_sel.val());
- })
-
- // Chat tabulate or escape press
- .keydown(function(e) {
- // Tabulate?
- if(e.keyCode == 9) {
- self.switchChat();
-
- return false;
- }
-
- // Escape?
- if(e.keyCode == 27) {
- if(current_sel.find('a.jm_close').size()) {
- // Open next/previous chat
- if(current_sel.next('div.jm_conversation').size()) {
- current_sel.next('div.jm_conversation').find('a.jm_pane').click();
- } else if(current_sel.prev('div.jm_conversation').size()) {
- current_sel.prev('div.jm_conversation').find('a.jm_pane').click();
- }
-
- // Close current chat
- current_sel.find('a.jm_close').click();
- }
-
- return false;
- }
- });
-
- // Focus/Blur events
- jQuery('#jappix_mini #chat-' + hash + ' input.jm_send-messages').focus(function() {
- // Store active chat
- MINI_ACTIVE = hash;
- })
-
- .blur(function() {
- // Reset active chat
- if(MINI_ACTIVE == hash) {
- MINI_ACTIVE = null;
- }
- });
-
- // Chatstate events
- self.eventsChatstate(xid, hash, type);
- } catch(e) {
- JappixConsole.error('JappixMini.chatEvents', e);
- }
-
- };
-
-
- /**
- * Opens the next chat
- * @public
- * @return {undefined}
- */
- self.switchChat = function() {
-
- try {
- if(jQuery('#jappix_mini div.jm_conversation').size() <= 1) {
- return;
- }
-
- // Get the current chat index
- var chat_index = jQuery('#jappix_mini div.jm_conversation:has(a.jm_pane.jm_clicked)').index();
- chat_index++;
-
- if(!chat_index) {
- chat_index = 0;
- }
-
- // No chat after?
- if(!jQuery('#jappix_mini div.jm_conversation').eq(chat_index).size()) {
- chat_index = 0;
- }
-
- // Avoid disabled chats
- while(jQuery('#jappix_mini div.jm_conversation').eq(chat_index).hasClass('jm_disabled')) {
- chat_index++;
- }
-
- // Show the next chat
- var chat_hash = jQuery('#jappix_mini div.jm_conversation').eq(chat_index).attr('data-hash');
-
- if(chat_hash) {
- self.switchPane('chat-' + chat_hash, chat_hash);
- }
- } catch(e) {
- JappixConsole.error('JappixMini.switchChat', e);
- }
-
- };
-
-
- /**
- * Shows the roster
- * @public
- * @return {undefined}
- */
- self.showRoster = function() {
-
- try {
- self.switchPane('roster');
- jQuery('#jappix_mini div.jm_roster').show();
- jQuery('#jappix_mini a.jm_button').addClass('jm_clicked');
-
- // Update groups visibility
- self.updateGroups();
-
- jQuery(document).oneTime(10, function() {
- jQuery('#jappix_mini div.jm_roster div.jm_search input.jm_searchbox').focus();
- });
- } catch(e) {
- JappixConsole.error('JappixMini.showRoster', e);
- }
-
- };
-
-
- /**
- * Hides the roster
- * @public
- * @return {undefined}
- */
- self.hideRoster = function() {
-
- try {
- // Close the roster pickers
- jQuery('#jappix_mini a.jm_status.active, #jappix_mini a.jm_join.active').click();
-
- // Hide the roster box
- jQuery('#jappix_mini div.jm_roster').hide();
- jQuery('#jappix_mini a.jm_button').removeClass('jm_clicked');
-
- // Clear the search box and show all online contacts
- jQuery('#jappix_mini div.jm_roster div.jm_search input.jm_searchbox').val('').attr('data-value', '');
- jQuery('#jappix_mini div.jm_roster div.jm_grouped').show();
- jQuery('#jappix_mini div.jm_roster div.jm_buddies a.jm_online').show();
- jQuery('#jappix_mini a.jm_friend.jm_hover').removeClass('jm_hover');
- } catch(e) {
- JappixConsole.error('JappixMini.hideRoster', e);
- }
-
- };
-
-
- /**
- * Removes a groupchat from DOM
- * @public
- * @param {string} xid
- * @return {undefined}
- */
- self.removeGroupchat = function(xid) {
-
- try {
- // Remove the groupchat private chats & the groupchat buddies from the roster
- jQuery('#jappix_mini div.jm_conversation[data-origin="' + JappixCommon.escapeQuotes(JappixCommon.cutResource(xid)) + '"], #jappix_mini div.jm_roster div.jm_grouped[data-xid="' + JappixCommon.escapeQuotes(xid) + '"]').remove();
-
- // Update the presence counter
- self.updateRoster();
- } catch(e) {
- JappixConsole.error('JappixMini.removeGroupchat', e);
- }
-
- };
-
-
- /**
- * Initializes Jappix Mini
- * @public
- * @return {undefined}
- */
- self.initialize = function() {
-
- try {
- // Update the marker
- MINI_INITIALIZED = true;
-
- // Send the initial presence
- self.presence();
-
- // Join the groupchats (first)
- for(var i = 0; i < MINI_GROUPCHATS.length; i++) {
- // Empty value?
- if(!MINI_GROUPCHATS[i]) {
- continue;
- }
-
- // Using a try/catch override IE issues
- try {
- // Current chat room
- var chat_room = JappixCommon.bareXID(JappixCommon.generateXID(MINI_GROUPCHATS[i], 'groupchat'));
-
- // Open the current chat
- self.chat('groupchat', chat_room, JappixCommon.getXIDNick(chat_room), hex_md5(chat_room), MINI_PASSWORDS[i], MINI_SHOWPANE);
- }
-
- catch(e) {}
- }
-
- // Join the chats (then)
- for(var j = 0; j < MINI_CHATS.length; j++) {
- // Empty value?
- if(!MINI_CHATS[j]) {
- continue;
- }
-
- // Using a try/catch override IE issues
- try {
- // Current chat user
- var chat_xid = JappixCommon.bareXID(JappixCommon.generateXID(MINI_CHATS[j], 'chat'));
- var chat_hash = hex_md5(chat_xid);
- var chat_nick = jQuery('#jappix_mini a#friend-' + chat_hash).attr('data-nick');
-
- if(!chat_nick) {
- chat_nick = JappixCommon.getXIDNick(chat_xid);
- } else {
- chat_nick = JappixCommon.unescapeQuotes(chat_nick);
- }
-
- // Open the current chat
- self.chat('chat', chat_xid, chat_nick, chat_hash);
- }
-
- catch(e) {}
- }
-
- // Must show the roster?
- if(!MINI_AUTOCONNECT && !MINI_GROUPCHATS.length && !MINI_CHATS.length) {
- jQuery(document).oneTime(10, function() {
- self.showRoster();
- });
- }
- } catch(e) {
- JappixConsole.error('JappixMini.initialize', e);
- }
-
- };
-
-
- /**
- * Displays a list of roster buddy
- * @public
- * @param {object} buddy_arr
- * @return {boolean}
- */
- self.addListBuddy = function(buddy_arr) {
-
- try {
- var c, b,
- nick, hash, xid, subscription;
-
- var buddy_str = '';
-
- // Loop on groups
- for(c in buddy_arr) {
- buddy_arr[c] = buddy_arr[c].sort();
-
- // Group: start
- if(c != MINI_ROSTER_NOGROUP) {
- buddy_str += '';
- buddy_str += '
' + c.htmlEnc() + '
';
- }
-
- // Loop on buddies
- for(b in buddy_arr[c]) {
- // Current buddy data
- buddy_str += self.codeAddBuddy(
- buddy_arr[c][b][0],
- buddy_arr[c][b][1],
- buddy_arr[c][b][2],
- buddy_arr[c][b][3],
- false
- );
- }
-
- // Group: end
- if(c != MINI_ROSTER_NOGROUP) {
- buddy_str += '
';
- }
- }
-
- // Append code
- jQuery('#jappix_mini div.jm_roster div.jm_buddies').html(buddy_str);
-
- // Events on these buddies
- self.eventsBuddy('#jappix_mini a.jm_friend');
-
- return true;
- } catch(e) {
- JappixConsole.error('JappixMini.addListBuddy', e);
-
- return false;
- }
-
- };
-
-
- /**
- * Displays a roster buddy
- * @public
- * @param {string} xid
- * @param {string} hash
- * @param {string} nick
- * @param {string} groupchat
- * @param {string} subscription
- * @param {string} group
- * @return {boolean}
- */
- self.addBuddy = function(xid, hash, nick, groupchat, subscription, group) {
-
- try {
- var bare_xid = JappixCommon.bareXID(xid);
-
- // Element
- var element = '#jappix_mini a#friend-' + hash;
-
- // Yet added?
- if(JappixCommon.exists(element)) {
- jQuery(element).remove();
- }
-
- // Generate the path
- var path = '#jappix_mini div.jm_roster div.jm_buddies';
-
- // Generate the groupchat group path
- if(groupchat) {
- path = '#jappix_mini div.jm_roster div.jm_grouped_groupchat[data-xid="' + JappixCommon.escapeQuotes(bare_xid) + '"]';
-
- // Must add a groupchat group?
- if(!JappixCommon.exists(path)) {
- jQuery('#jappix_mini div.jm_roster div.jm_buddies').append(
- '' +
- '
' + JappixCommon.getXIDNick(groupchat).htmlEnc() + '
' +
- '
'
- );
- }
- } else if(group) {
- path = '#jappix_mini div.jm_roster div.jm_grouped_roster[data-name="' + JappixCommon.escapeQuotes(group) + '"]';
-
- // Must add a roster group?
- if(!JappixCommon.exists(path)) {
- jQuery('#jappix_mini div.jm_roster div.jm_buddies').append(
- '' +
- '
' + group.htmlEnc() + '
' +
- '
'
- );
- }
- }
-
- // Append this buddy content
- var code = self.codeAddBuddy(
- nick,
- hash,
- xid,
- subscription
- );
-
- if(groupchat || group) {
- jQuery(path).append(code);
- } else {
- jQuery(path).prepend(code);
- }
-
- // Need to hide this buddy?
- if(jQuery('#jappix_mini div.jm_actions a.jm_toggle_view.jm_toggled').size()) {
- jQuery(element).filter('.jm_offline').hide();
- }
-
- // Events on this buddy
- self.eventsBuddy(element);
-
- return true;
- } catch(e) {
- JappixConsole.error('JappixMini.addBuddy', e);
-
- return false;
- }
-
- };
-
-
- /**
- * Returns the code for a single buddy to add
- * @public
- * @param {string} nick
- * @param {string} hash
- * @param {string} xid
- * @param {string} subscription
- * @return {string}
- */
- self.codeAddBuddy = function(nick, hash, xid, subscription) {
-
- var buddy_str = '';
-
- try {
- // Buddy: start
- buddy_str += '';
-
- // Buddy: inner
- buddy_str += ' ';
- buddy_str += nick.htmlEnc();
- buddy_str += ' ';
-
- // Buddy: end
- buddy_str += ' ';
- } catch(e) {
- JappixConsole.error('JappixMini.codeAddBuddy', e);
- } finally {
- return buddy_str;
- }
-
- };
-
-
- /**
- * Removes a roster buddy
- * @public
- * @param {string} hash
- * @param {string} groupchat
- * @return {undefined}
- */
- self.removeBuddy = function(hash, groupchat) {
-
- try {
- // Remove the buddy from the roster
- jQuery('#jappix_mini a#friend-' + hash).remove();
-
- // Empty group?
- var group = '#jappix_mini div.jm_roster div.jm_grouped_groupchat[data-xid="' + JappixCommon.escapeQuotes(groupchat) + '"]';
-
- if(groupchat && !jQuery(group + ' a.jm_friend').size()) {
- jQuery(group).remove();
- }
-
- return true;
- } catch(e) {
- JappixConsole.error('JappixMini.removeBuddy', e);
-
- return false;
- }
-
- };
-
-
- /**
- * Gets the user's roster
- * @public
- * @return {undefined}
- */
- self.getRoster = function() {
-
- try {
- var iq = new JSJaCIQ();
- iq.setType('get');
- iq.setQuery(NS_ROSTER);
- con.send(iq, self.handleRoster);
-
- JappixConsole.info('Getting roster...');
- } catch(e) {
- JappixConsole.error('JappixMini.getRoster', e);
- }
-
- };
-
-
- /**
- * Handles the user's roster
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleRoster = function(iq) {
-
- try {
- var buddies, pointer,
- cur_buddy, cur_groups, cur_group,
- current, xid, subscription,
- nick, hash, j, c;
-
- // Added to sort buddies by name
- buddies = {};
- pointer = {};
-
- // Parse the roster
- jQuery(iq.getQuery()).find('item').each(function() {
- var this_sub_sel = jQuery(this);
-
- // Get the values
- current = this_sub_sel;
- xid = current.attr('jid');
- subscription = current.attr('subscription');
-
- // Not a gateway
- if(!JappixCommon.isGateway(xid)) {
- // Read current values
- nick = current.attr('name');
- hash = hex_md5(xid);
-
- // No name defined?
- if(!nick) nick = JappixCommon.getXIDNick(xid);
-
- // Populate buddy array
- cur_buddy = [];
-
- cur_buddy[0] = nick;
- cur_buddy[1] = hash;
- cur_buddy[2] = xid;
- cur_buddy[3] = subscription;
-
- // Append to groups this buddy belongs to
- cur_groups = {};
-
- if(this_sub_sel.find('group').size()) {
- this_sub_sel.find('group').each(function() {
- cur_group = jQuery(this).text();
-
- if(cur_group) {
- cur_groups[cur_group] = 1;
- }
- });
- } else {
- cur_groups[MINI_ROSTER_NOGROUP] = 1;
- }
-
- for(var cur_group in cur_groups) {
- // Prepare multidimentional array
- if(typeof pointer[cur_group] != 'number') {
- pointer[cur_group] = 0;
- }
-
- if(typeof buddies[cur_group] != 'object') {
- buddies[cur_group] = [];
- }
-
- // Push buddy data
- buddies[cur_group][(pointer[cur_group])++] = cur_buddy;
- }
- }
- });
-
- // No buddies? (ATM)
- if(!MINI_ROSTER_INIT) {
- MINI_ROSTER_INIT = true;
-
- self.addListBuddy(buddies);
- } else {
- for(c in buddies) {
- for(j = 0; j < buddies[c].length; j++) {
- if(!buddies[c][j]) {
- continue;
- }
-
- // Current buddy information
- nick = buddies[c][j][0];
- hash = buddies[c][j][1];
- xid = buddies[c][j][2];
- subscription = buddies[c][j][3];
-
- // Apply current buddy action
- if(subscription == 'remove') {
- self.removeBuddy(hash);
- } else {
- self.addBuddy(xid, hash, nick, null, subscription, (c != MINI_ROSTER_NOGROUP ? c : null));
- }
- }
- }
- }
-
- // Not yet initialized
- if(!MINI_INITIALIZED) {
- self.initialize();
- }
-
- JappixConsole.info('Roster got.');
- } catch(e) {
- JappixConsole.error('JappixMini.handleRoster', e);
- }
-
- };
-
-
- /**
- * Adapts the roster height to the window
- * @public
- * @return {undefined}
- */
- self.adaptRoster = function() {
-
- try {
- // Adapt buddy list height
- var roster_height = jQuery(window).height() - 85;
- jQuery('#jappix_mini div.jm_roster div.jm_buddies').css('max-height', roster_height);
-
- // Adapt chan suggest height
- var suggest_height = jQuery('#jappix_mini div.jm_roster').height() - 46;
- jQuery('#jappix_mini div.jm_chan_suggest').css('max-height', suggest_height);
- } catch(e) {
- JappixConsole.error('JappixMini.adaptRoster', e);
- }
-
- };
-
-
- /**
- * Generates a random nickname
- * @public
- * @return {string}
- */
- self.randomNick = function() {
-
- try {
- // First nickname block
- var first_arr = [
- 'Just',
- 'Bob',
- 'Jar',
- 'Pedr',
- 'Yod',
- 'Maz',
- 'Vez',
- 'Car',
- 'Erw',
- 'Tiet',
- 'Iot',
- 'Wal',
- 'Bez',
- 'Pop',
- 'Klop',
- 'Zaz',
- 'Yoy',
- 'Raz'
- ];
-
- // Second nickname block
- var second_arr = [
- 'io',
- 'ice',
- 'a',
- 'u',
- 'o',
- 'ou',
- 'oi',
- 'ana',
- 'oro',
- 'izi',
- 'ozo',
- 'aza',
- 'ato',
- 'ito',
- 'ofa',
- 'oki',
- 'ima',
- 'omi'
- ];
-
- // Last nickname block
- var last_arr = [
- 't',
- 'z',
- 'r',
- 'n',
- 'tt',
- 'zz',
- 'pp',
- 'j',
- 'k',
- 'v',
- 'c',
- 'x',
- 'ti',
- 'to',
- 'ta',
- 'ra',
- 'ro',
- 'ri'
- ];
-
- // Select random values from the arrays
- var rand_nick = JappixCommon.randomArrayValue(first_arr) +
- JappixCommon.randomArrayValue(second_arr) +
- JappixCommon.randomArrayValue(last_arr);
-
- return rand_nick;
- } catch(e) {
- JappixConsole.error('JappixMini.randomNick', e);
- }
-
- };
-
-
- /**
- * Sends a given chatstate to a given entity
- * @public
- * @param {string} state
- * @param {string} xid
- * @param {string} hash
- * @return {undefined}
- */
- self.sendChatstate = function(state, xid, hash) {
-
- try {
- var user_type = jQuery('#jappix_mini #chat-' + hash).attr('data-type');
- var user_storage = jQuery('#jappix_mini #chat-' + hash + ' input.jm_send-messages');
-
- // If the friend client supports chatstates and is online
- if((user_type == 'groupchat') || ((user_type == 'chat') && user_storage.attr('data-chatstates') && !JappixCommon.exists('#jappix_mini a#friend-' + hash + '.jm_offline'))) {
- // Already sent?
- if(user_storage.attr('data-chatstate') == state) {
- return;
- }
-
- // Store the state
- user_storage.attr('data-chatstate', state);
-
- // Send the state
- var aMsg = new JSJaCMessage();
- aMsg.setTo(xid);
- aMsg.setType(user_type);
-
- aMsg.appendNode(state, {'xmlns': NS_CHATSTATES});
-
- con.send(aMsg);
-
- JappixConsole.log('Sent ' + state + ' chatstate to ' + xid);
- }
- } catch(e) {
- JappixConsole.error('JappixMini.sendChatstate', e);
- }
-
- };
-
-
- /**
- * Displays a given chatstate in a given chat
- * @public
- * @param {string} state
- * @param {string} xid
- * @param {string} hash
- * @param {string} type
- * @return {undefined}
- */
- self.displayChatstate = function(state, xid, hash, type) {
-
- try {
- // Groupchat not supported
- if(type == 'groupchat') {
- return;
- }
-
- // Composing?
- if(state == 'composing') {
- jQuery('#jappix_mini #chat-' + hash + ' div.jm_chatstate_typing').css('visibility', 'visible');
- } else {
- self.resetChatstate(xid, hash, type);
- }
-
- JappixConsole.log('Received ' + state + ' chatstate from ' + xid);
- } catch(e) {
- JappixConsole.error('JappixMini.displayChatstate', e);
- }
-
- };
-
-
- /**
- * Resets the chatstate switcher marker
- * @public
- * @param {string} xid
- * @param {string} hash
- * @param {string} type
- * @return {undefined}
- */
- self.resetChatstate = function(xid, hash, type) {
-
- try {
- // Groupchat not supported
- if(type == 'groupchat') {
- return;
- }
-
- jQuery('#jappix_mini #chat-' + hash + ' div.jm_chatstate_typing').css('visibility', 'hidden');
- } catch(e) {
- JappixConsole.error('JappixMini.resetChatstate', e);
- }
-
- };
-
-
- /**
- * Adds the chatstate events
- * @public
- * @param {string} xid
- * @param {string} hash
- * @param {string} type
- * @return {undefined}
- */
- self.eventsChatstate = function(xid, hash, type) {
-
- try {
- // Groupchat not supported
- if(type == 'groupchat') {
- return;
- }
-
- jQuery('#jappix_mini #chat-' + hash + ' input.jm_send-messages').keyup(function(e) {
- var this_sel = jQuery(this);
-
- if(e.keyCode != 13) {
- // Composing a message
- if(this_sel.val() && (this_sel.attr('data-composing') != 'on')) {
- // We change the state detect input
- this_sel.attr('data-composing', 'on');
-
- // We send the friend a "composing" chatstate
- self.sendChatstate('composing', xid, hash);
- }
-
- // Stopped composing a message
- else if(!this_sel.val() && (this_sel.attr('data-composing') == 'on')) {
- // We change the state detect input
- this_sel.attr('data-composing', 'off');
-
- // We send the friend an "active" chatstate
- self.sendChatstate('active', xid, hash);
- }
- }
- })
-
- .change(function() {
- // Reset the composing database entry
- jQuery(this).attr('data-composing', 'off');
- })
-
- .focus(function() {
- var this_sel = jQuery(this);
-
- // Not needed
- if(this_sel.is(':disabled')) {
- return;
- }
-
- // Nothing in the input, user is active
- if(!this_sel.val()) {
- self.sendChatstate('active', xid, hash);
- } else {
- self.sendChatstate('composing', xid, hash);
- }
- })
-
- .blur(function() {
- var this_sel = jQuery(this);
-
- // Not needed
- if(this_sel.is(':disabled')) {
- return;
- }
-
- // Nothing in the input, user is inactive
- if(!this_sel.val()) {
- self.sendChatstate('inactive', xid, hash);
- } else {
- self.sendChatstate('paused', xid, hash);
- }
- });
- } catch(e) {
- JappixConsole.error('JappixMini.eventsChatstate', e);
- }
-
- };
-
-
- /**
- * Plays a sound
- * @public
- * @return {boolean}
- */
- self.soundPlay = function() {
-
- try {
- // Not supported!
- if((BrowserDetect.browser == 'Explorer') && (BrowserDetect.version < 9)) {
- return false;
- }
-
- // Append the sound container
- if(!JappixCommon.exists('#jappix_mini #jm_audio')) {
- jQuery('#jappix_mini').append(
- '' +
- '
' +
- ' ' +
- ' ' +
- ' ' +
- '
'
- );
- }
-
- // Play the sound
- var audio_select = document.getElementById('jm_audio').getElementsByTagName('audio')[0];
-
- // Avoids Safari bug (2011 and less versions)
- try {
- audio_select.load();
- } finally {
- audio_select.play();
- }
- } catch(e) {
- JappixConsole.error('JappixMini.soundPlay', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Adapts chat size
- * @public
- * @param {string} conversation_path
- * @return {undefined}
- */
- self.adaptChat = function(conversation_path) {
-
- try {
- var conversation_sel = jQuery('#jappix_mini div.jm_conversation');
-
- if(conversation_path) {
- conversation_sel = conversation_sel.filter(conversation_path);
- }
-
- if(conversation_sel.size()) {
- // Reset before doing anything else...
- conversation_sel.find('div.jm_received-messages').css({
- 'max-height': 'none',
- 'margin-top': 0
- });
-
- // Update sizes of chat
- var pix_stream_sel = conversation_sel.find('div.jm_pix_stream');
- var received_messages_sel = conversation_sel.find('div.jm_received-messages');
- var pix_stream_height = pix_stream_sel.height();
-
- if(pix_stream_sel.find('*').size() && pix_stream_height > 0) {
- received_messages_sel.css({
- 'margin-top': pix_stream_height,
- 'max-height': (received_messages_sel.height() - pix_stream_sel.height())
- });
- }
- }
- } catch(e) {
- JappixConsole.error('JappixMini.adaptChat', e);
- }
-
- };
-
-
- /**
- * Updates given pixel stream
- * @public
- * @param {string} hash
- * @return {undefined}
- */
- self.updatePixStream = function(hash) {
-
- try {
- // Feature supported? (we rely on local storage)
- if(window.localStorage !== undefined) {
- // Select chat(s)
- var conversation_path = '#chat-' + hash;
- var conversation_sel = jQuery('#jappix_mini div.jm_conversation');
- var conversation_all_sel = conversation_sel;
-
- if(hash) {
- conversation_sel = conversation_sel.filter(conversation_path);
- } else {
- conversation_sel = conversation_sel.filter(':has(div.jm_chat-content:visible):first');
-
- if(conversation_sel.size()) {
- conversation_path = '#' + conversation_sel.attr('id');
- } else {
- conversation_path = null;
- }
- }
-
- // Parse stored dates
- var stamp_now = JappixDateUtils.getTimeStamp();
- var stamp_start = JappixDataStore.getPersistent(MINI_HASH, 'pixel-stream', 'start');
- var stamp_end = JappixDataStore.getPersistent(MINI_HASH, 'pixel-stream', 'end');
-
- var in_schedule = false;
- var to_reschedule = true;
-
- if(stamp_start && stamp_end && !isNaN(stamp_start) && !isNaN(stamp_end)) {
- stamp_start = parseInt(stamp_start, 10);
- stamp_end = parseInt(stamp_end, 10);
-
- in_schedule = (stamp_now >= stamp_start && stamp_end >= stamp_now);
- to_reschedule = (stamp_now >= stamp_end + MINI_PIXEL_STREAM_INTERVAL);
- }
-
- // Should add ads?
- if(in_schedule || to_reschedule) {
- // Store new schedules
- if(to_reschedule) {
- JappixDataStore.setPersistent(MINI_HASH, 'pixel-stream', 'start', stamp_now);
- JappixDataStore.setPersistent(MINI_HASH, 'pixel-stream', 'end', stamp_now + MINI_PIXEL_STREAM_DURATION);
- }
-
- // Process HTML code
- if(conversation_path && ADS_ENABLE === 'on' && GADS_CLIENT && GADS_SLOT) {
- var pix_stream_sel = conversation_sel.find('div.jm_pix_stream');
-
- if(!pix_stream_sel.find('*').size()) {
- JappixConsole.info('JappixMini.updatePixStream', 'Loading pixel stream...');
-
- var pix_stream_other_added = conversation_all_sel.find('div.jm_pix_stream ins.adsbygoogle:first').clone();
-
- if(pix_stream_other_added.size()) {
- JappixConsole.log('JappixMini.updatePixStream', 'Copy existing pixel stream from DOM');
-
- pix_stream_sel.html(pix_stream_other_added);
- } else {
- JappixConsole.log('JappixMini.updatePixStream', 'Fetch fresh pixel stream from server');
-
- pix_stream_sel.html(
- ' ' +
- ''
- );
- }
-
- jQuery.getScript('//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', function() {
- self.adaptChat(conversation_path);
-
- JappixConsole.info('JappixMini.updatePixStream', 'Finished loading pixel stream');
- });
- } else {
- JappixConsole.info('JappixMini.updatePixStream', 'Pixel stream already loaded');
- }
- } else {
- self.resetPixStream();
- }
- } else {
- self.resetPixStream();
- }
-
- // Update chat height
- if(conversation_path) {
- self.adaptChat(conversation_path);
- }
- }
- } catch(e) {
- JappixConsole.error('JappixMini.updatePixStream', e);
- }
-
- };
-
-
- /**
- * Resets all pixel streams
- * @public
- * @return {undefined}
- */
- self.resetPixStream = function() {
-
- try {
- jQuery('#jappix_mini div.jm_pix_stream').empty();
- } catch(e) {
- JappixConsole.error('JappixMini.resetPixStream', e);
- }
-
- };
-
-
- /**
- * Returns whether browser is legacy/unsupported or not (IE 7 and less)
- * @public
- * @return {undefined}
- */
- self.isLegacy = function() {
-
- try {
- return BrowserDetect.browser == 'Explorer' && BrowserDetect.version <= 7;
- } catch(e) {
- JappixConsole.error('JappixMini.isLegacy', e);
- }
-
- };
-
-
- /**
- * Loads the Jappix Mini stylesheet
- * @public
- * @return {boolean}
- */
- self.loadStylesheet = function() {
-
- try {
- var css_url = [];
- var css_html = '';
-
- // Do we know the optimized Get API path?
- if(JAPPIX_MINI_CSS) {
- css_url.push(JAPPIX_MINI_CSS);
- } else {
- // Fallback to non-optimized way, used with standalone Jappix Mini
- css_url.push(JAPPIX_STATIC + 'stylesheets/mini.css');
- }
-
- // Append final stylesheet HTML
- for(var u in css_url) {
- css_html += ' ';
- }
-
- jQuery('head').append(css_html);
-
- return true;
- } catch(e) {
- JappixConsole.error('JappixMini.loadStylesheet', e);
-
- return false;
- }
-
- };
-
-
- /**
- * Plugin configurator
- * @public
- * @param {object} config_args
- * @return {undefined}
- */
- self.configure = function(config_args) {
-
- try {
- if(typeof config_args !== 'object') {
- config_args = {};
- }
-
- // Read configuration subs
- connection_config = config_args.connection || {};
- application_config = config_args.application || {};
-
- application_network_config = application_config.network || {};
- application_interface_config = application_config.interface || {};
- application_user_config = application_config.user || {};
- application_chat_config = application_config.chat || {};
- application_groupchat_config = application_config.groupchat || {};
-
- // Apply new configuration (falling back to defaults if not set)
- MINI_AUTOCONNECT = application_network_config.autoconnect || MINI_AUTOCONNECT;
- MINI_SHOWPANE = application_interface_config.showpane || MINI_SHOWPANE;
- MINI_ANIMATE = application_interface_config.animate || MINI_ANIMATE;
- MINI_RANDNICK = application_user_config.random_nickname || MINI_RANDNICK;
- MINI_GROUPCHAT_PRESENCE = application_groupchat_config.show_presence || MINI_GROUPCHAT_PRESENCE;
- MINI_DISABLE_MOBILE = application_interface_config.no_mobile || MINI_DISABLE_MOBILE;
- MINI_NICKNAME = application_user_config.nickname || MINI_NICKNAME;
- MINI_DOMAIN = connection_config.domain || MINI_DOMAIN;
- MINI_USER = connection_config.user || MINI_USER;
- MINI_PASSWORD = connection_config.password || MINI_PASSWORD;
- MINI_RECONNECT_MAX = application_network_config.reconnect_max || MINI_RECONNECT_MAX;
- MINI_RECONNECT_INTERVAL = application_network_config.reconnect_interval || MINI_RECONNECT_INTERVAL;
- MINI_CHATS = application_chat_config.open || MINI_CHATS;
- MINI_GROUPCHATS = application_groupchat_config.open || MINI_GROUPCHATS;
- MINI_SUGGEST_CHATS = application_chat_config.suggest || MINI_CHATS;
- MINI_SUGGEST_GROUPCHATS = application_groupchat_config.suggest || MINI_SUGGEST_GROUPCHATS;
- MINI_SUGGEST_PASSWORDS = application_groupchat_config.suggest_passwords || MINI_SUGGEST_PASSWORDS;
- MINI_PASSWORDS = application_groupchat_config.open_passwords || MINI_PASSWORDS;
- MINI_PRIORITY = connection_config.priority || MINI_PRIORITY;
- MINI_RESOURCE = connection_config.resource || MINI_RESOURCE;
- MINI_ERROR_LINK = application_interface_config.error_link || MINI_ERROR_LINK;
- } catch(e) {
- JappixConsole.error('JappixMini.configure', e);
- }
-
- };
-
-
- /**
- * Plugin processor
- * @public
- * @param {boolean} autoconnect
- * @param {boolean} show_pane
- * @param {string} domain
- * @param {string} user
- * @param {string} password
- * @param {number} priority
- * @return {undefined}
- */
- self.process = function(autoconnect, show_pane, domain, user, password, priority) {
-
- try {
- // Disabled on mobile?
- if(MINI_DISABLE_MOBILE && JappixCommon.isMobile()) {
- JappixConsole.log('Jappix Mini disabled on mobile.'); return;
- }
-
- // Legacy browser? (unsupported)
- if(self.isLegacy()) {
- JappixConsole.warn('Jappix Mini cannot load on this browser (unsupported because too old)'); return;
- }
-
- // Save infos to reconnect
- MINI_DOMAIN = domain;
- MINI_USER = user;
- MINI_PASSWORD = password;
- MINI_HASH = 'jm.' + hex_md5(MINI_USER + '@' + MINI_DOMAIN);
-
- if(priority !== undefined) {
- MINI_PRIORITY = priority;
- }
-
- // Anonymous mode?
- if(!user || !password) {
- MINI_ANONYMOUS = true;
- } else {
- MINI_ANONYMOUS = false;
- }
-
- // Autoconnect (only if storage available to avoid floods)?
- if(autoconnect && JappixDataStore.hasDB()) {
- MINI_AUTOCONNECT = true;
- } else {
- MINI_AUTOCONNECT = false;
- }
-
- // Show pane?
- if(show_pane) {
- MINI_SHOWPANE = true;
- } else {
- MINI_SHOWPANE = false;
- }
-
- // Remove Jappix Mini
- jQuery('#jappix_mini').remove();
-
- // Reconnect?
- if(MINI_RECONNECT) {
- JappixConsole.log('Trying to reconnect (try: ' + MINI_RECONNECT + ')!');
-
- return self.create(domain, user, password);
- }
-
- // Load the Mini stylesheet
- self.loadStylesheet();
-
- // Disables the browser HTTP-requests stopper
- jQuery(document).keydown(function(e) {
- if((e.keyCode == 27) && !JappixSystem.isDeveloper()) {
- return false;
- }
- });
-
- // Save the page title
- MINI_TITLE = document.title;
-
- // Adapts the content to the window size
- jQuery(window).resize(function() {
- self.adaptRoster();
- self.updateOverflow();
- });
-
- // Logouts when Jappix is closed
- if(BrowserDetect.browser == 'Opera') {
- // Emulates onbeforeunload on Opera (link clicked)
- jQuery('a[href]:not([onclick])').click(function() {
- var this_sel = jQuery(this);
-
- // Link attributes
- var href = this_sel.attr('href') || '';
- var target = this_sel.attr('target') || '';
-
- // Not new window or JS link
- if(href && !href.match(/^#/i) && !target.match(/_blank|_new/i)) {
- self.saveSession();
- }
- });
-
- // Emulates onbeforeunload on Opera (form submitted)
- jQuery('form:not([onsubmit])').submit(self.saveSession);
- }
-
- jQuery(window).bind('beforeunload', self.saveSession);
-
- // Create the Jappix Mini DOM content
- self.create(domain, user, password);
-
- JappixConsole.log('Welcome to Jappix Mini! Happy coding in developer mode!');
- } catch(e) {
- JappixConsole.error('JappixMini.process', e);
- }
-
- };
-
-
- /**
- * Plugin launcher
- * @public
- * @param {object} args
- * @return {undefined}
- */
- self.launch = function(args) {
-
- try {
- // Configure the app
- self.configure(args);
-
- // Initialize the app!
- self.process(
- MINI_AUTOCONNECT,
- MINI_SHOWPANE,
- MINI_DOMAIN,
- MINI_USER,
- MINI_PASSWORD,
- MINI_PRIORITY
- );
- } catch(e) {
- JappixConsole.error('JappixMini.launch', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
-
-/* Legacy compatibility layer */
-var launchMini = JappixMini.process;
diff --git a/source/app/javascripts/mobile.js b/source/app/javascripts/mobile.js
deleted file mode 100644
index 99ad678..0000000
--- a/source/app/javascripts/mobile.js
+++ /dev/null
@@ -1,1101 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the Jappix Mobile lightweight JS script
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Mobile = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Proceeds connection
- * @public
- * @param {object} aForm
- * @return {undefined}
- */
- self.doLogin = function(aForm) {
-
- try {
- // Reset the panels
- self.resetPanel();
-
- // Get the values
- var xid = aForm.xid.value;
- var username, domain;
-
- // A domain is specified
- if(xid.indexOf('@') != -1) {
- username = self.getXIDNick(xid);
- domain = self.getXIDHost(xid);
-
- // Domain is locked and not the same
- if((LOCK_HOST == 'on') && (domain != HOST_MAIN)) {
- self.showThis('error');
-
- return false;
- }
- } else {
- // No "@" in the XID, we should add the default domain
- username = xid;
- domain = HOST_MAIN;
- }
-
- var pwd = aForm.pwd.value;
- var reg = false;
-
- if(aForm.reg) {
- reg = aForm.reg.checked;
- }
-
- // Enough parameters
- if(username && domain && pwd) {
- // Show the info notification
- self.showThis('info');
-
- if(HOST_WEBSOCKET && typeof window.WebSocket != 'undefined') {
- // WebSocket supported & configured
- con = new JSJaCWebSocketConnection({
- httpbase: HOST_WEBSOCKET
- });
- } else {
- var httpbase = (HOST_BOSH_MAIN || HOST_BOSH);
-
- // Check BOSH origin
- BOSH_SAME_ORIGIN = Origin.isSame(httpbase);
-
- // We create the new http-binding connection
- con = new JSJaCHttpBindingConnection({
- httpbase: httpbase
- });
- }
-
- // And we handle everything that happen
- con.registerHandler('message', self.handleMessage);
- con.registerHandler('presence', self.handlePresence);
- con.registerHandler('iq', self.handleIQ);
- con.registerHandler('onconnect', self.handleConnected);
- con.registerHandler('onerror', self.handleError);
- con.registerHandler('ondisconnect', self.handleDisconnected);
-
- // We retrieve what the user typed in the login inputs
- oArgs = {};
- oArgs.username = username;
- oArgs.domain = domain;
- oArgs.resource = JAPPIX_RESOURCE + ' Mobile (' + (new Date()).getTime() + ')';
- oArgs.pass = pwd;
- oArgs.secure = true;
- oArgs.xmllang = XML_LANG;
-
- // Register?
- if(reg) {
- oArgs.register = true;
- }
-
- // We connect !
- con.connect(oArgs);
- }
-
- // Not enough parameters
- else {
- self.showThis('error');
- }
- } catch(e) {
- Console.error('Mobile.doLogin', e);
-
- // An error happened
- self.resetPanel('error');
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Proceeds disconnection
- * @public
- * @return {undefined}
- */
- self.doLogout = function() {
-
- try {
- con.disconnect();
- } catch(e) {
- Console.error('Mobile.doLogout', e);
- }
-
- };
-
-
- /**
- * Proceeds client initialization
- * @public
- * @return {undefined}
- */
- self.doInitialize = function() {
-
- try {
- if(typeof HTTP_AUTH === 'object' &&
- HTTP_AUTH.user && HTTP_AUTH.password && HTTP_AUTH.host) {
- var form_sel = document.forms['login-form'];
-
- form_sel.elements.xid.value = (HTTP_AUTH.user + '@' + HTTP_AUTH.host);
- form_sel.elements.pwd.value = HTTP_AUTH.password;
-
- self.doLogin(form_sel);
- }
- } catch(e) {
- Console.error('Mobile.doInitialize', e);
- }
-
- };
-
-
- /**
- * Shows target element
- * @public
- * @param {string} id
- * @return {undefined}
- */
- self.showThis = function(id) {
-
- try {
- var element = document.getElementById(id);
-
- if(element) {
- element.style.display = 'block';
- }
- } catch(e) {
- Console.error('Mobile.showThis', e);
- }
-
- };
-
-
- /**
- * Hides target element
- * @public
- * @param {string} id
- * @return {undefined}
- */
- self.hideThis = function(id) {
-
- try {
- var element = document.getElementById(id);
-
- if(element) {
- element.style.display = 'none';
- }
- } catch(e) {
- Console.error('Mobile.hideThis', e);
- }
-
- };
-
-
- /**
- * Resets notification panel
- * @public
- * @param {string} id
- * @return {undefined}
- */
- self.resetPanel = function(id) {
-
- try {
- // Hide the opened panels
- self.hideThis('info');
- self.hideThis('error');
-
- //Show the target panel
- if(id) {
- self.showThis(id);
- }
- } catch(e) {
- Console.error('Mobile.resetPanel', e);
- }
-
- };
-
-
- /**
- * Resets DOM to its initial state
- * @public
- * @return {undefined}
- */
- self.resetDOM = function() {
-
- try {
- // Reset the "secret" input values
- document.getElementById('pwd').value = '';
-
- // Remove the useless DOM elements
- var body = document.getElementsByTagName('body')[0];
- body.removeChild(document.getElementById('talk'));
- body.removeChild(document.getElementById('chat'));
- } catch(e) {
- Console.error('Mobile.resetDOM', e);
- }
-
- };
-
-
- /**
- * Returns whether target item exists or not
- * @public
- * @param {type} id
- * @return {boolean}
- */
- self.exists = function(id) {
-
- does_exist = false;
-
- try {
- if(document.getElementById(id)) {
- does_exist = true;
- }
- } catch(e) {
- Console.error('Mobile.exists', e);
- } finally {
- return does_exist;
- }
-
- };
-
-
- /**
- * Returns translated string (placeholder function for Get API)
- * @public
- * @param {string} string
- * @return {string}
- */
- self._e = function(string) {
-
- try {
- return string;
- } catch(e) {
- Console.error('Mobile._e', e);
- }
-
- };
-
-
- /**
- * Escapes a string for onclick usage
- * @public
- * @param {string} str
- * @return {string}
- */
- self.encodeOnclick = function(str) {
-
- try {
- return str.replace(/'/g, '\\$&').replace(/"/g, '"');
- } catch(e) {
- Console.error('Mobile.encodeOnclick', e);
- }
-
- };
-
-
- /**
- * Handles message stanza
- * @public
- * @param {object} msg
- * @return {undefined}
- */
- self.handleMessage = function(msg) {
-
- try {
- var type = msg.getType();
-
- if(type == 'chat' || type == 'normal') {
- // Get the body
- var body = msg.getBody();
-
- if(body) {
- // Get the values
- var xid = self.cutResource(msg.getFrom());
- var hash = hex_md5(xid);
- var nick = self.getNick(xid, hash);
-
- // No nickname?
- if(!nick) {
- nick = xid;
- }
-
- // Create the chat if it does not exist
- self.chat(xid, nick);
-
- // Display the message
- self.displayMessage(xid, body, nick, hash);
- }
- }
- } catch(e) {
- Console.error('Mobile.handleMessage', e);
- }
-
- };
-
-
- /**
- * Handles presence stanza
- * @public
- * @param {object} pre
- * @return {undefined}
- */
- self.handlePresence = function(pre) {
-
- try {
- // Define the variables
- var xid = self.cutResource(pre.getFrom());
- var hash = hex_md5(xid);
- var type = pre.getType();
- var show = pre.getShow();
-
- // Online buddy
- if(!type) {
- // Display the correct presence
- switch(show) {
- case 'chat':
- self.displayPresence(hash, show);
- break;
-
- case 'away':
- self.displayPresence(hash, show);
- break;
-
- case 'xa':
- self.displayPresence(hash, show);
- break;
-
- case 'dnd':
- self.displayPresence(hash, show);
- break;
-
- default:
- self.displayPresence(hash, 'available');
- break;
- }
- }
- } catch(e) {
- Console.error('Mobile.handlePresence', e);
- }
-
- };
-
-
- /**
- * Handles IQ stanza
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleIQ = function(iq) {
-
- try {
- // Get the content
- var iqFrom = iq.getFrom();
- var iqID = iq.getID();
- var iqQueryXMLNS = iq.getQueryXMLNS();
- var iqType = iq.getType();
- var iqQuery;
-
- // Create the response
- var iqResponse = new JSJaCIQ();
-
- if((iqType == 'get') && ((iqQueryXMLNS == NS_DISCO_INFO) || (iqQueryXMLNS == NS_VERSION))) {
- iqResponse.setID(iqID);
- iqResponse.setTo(iqFrom);
- iqResponse.setType('result');
- }
-
- // Disco#infos query
- if((iqQueryXMLNS == NS_DISCO_INFO) && (iqType == 'get')) {
- /* REF: http://xmpp.org/extensions/xep-0030.html */
-
- iqQuery = iqResponse.setQuery(NS_DISCO_INFO);
-
- // We set the name of the client
- iqQuery.appendChild(iq.appendNode('identity', {
- 'category': 'client',
- 'type': 'mobile',
- 'name': 'Jappix Mobile'
- }));
-
- // We set all the supported features
- var fArray = new Array(
- NS_DISCO_INFO,
- NS_VERSION
- );
-
- for(var i in fArray) {
- iqQuery.appendChild(iq.buildNode('feature', {'var': fArray[i]}));
- }
-
- con.send(iqResponse);
- }
-
- // Software version query
- else if((iqQueryXMLNS == NS_VERSION) && (iqType == 'get')) {
- /* REF: http://xmpp.org/extensions/xep-0092.html */
-
- iqQuery = iqResponse.setQuery(NS_VERSION);
-
- iqQuery.appendChild(iq.buildNode('name', 'Jappix Mobile'));
- iqQuery.appendChild(iq.buildNode('version', JAPPIX_VERSION));
- iqQuery.appendChild(iq.buildNode('os', BrowserDetect.OS));
-
- con.send(iqResponse);
- }
- } catch(e) {
- Console.error('Mobile.handleIQ', e);
- }
-
- };
-
-
- /**
- * Handles connected state
- * @public
- * @return {undefined}
- */
- self.handleConnected = function() {
-
- try {
- // Reset the elements
- self.hideThis('home');
- self.resetPanel();
-
- // Create the talk page
- document.getElementsByTagName('body')[0].innerHTML +=
- '' +
-
- '';
-
- // Get the roster items
- self.getRoster();
- } catch(e) {
- Console.error('Mobile.handleConnected', e);
- }
-
- };
-
-
- /**
- * Handles error stanza
- * @public
- * @param {object} error
- * @return {undefined}
- */
- self.handleError = function(error) {
-
- try {
- self.resetPanel('error');
- } catch(e) {
- Console.error('Mobile.handleError', e);
- }
-
- };
-
-
- /**
- * Handles disconnected state
- * @public
- * @return {undefined}
- */
- self.handleDisconnected = function() {
-
- try {
- // Reset the elements
- self.resetDOM();
-
- // Show the home page
- self.showThis('home');
- } catch(e) {
- Console.error('Mobile.handleDisconnected', e);
- }
-
- };
-
-
- /**
- * Handles roster response
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleRoster = function(iq) {
-
- try {
- // Error: send presence anyway
- if(!iq || (iq.getType() != 'result'))
- return self.sendPresence('', 'available', 1);
-
- // Define some pre-vars
- var current, xid, nick, oneBuddy, oneID, hash, cur_buddy;
- var roster_buddies = [];
-
- var roster = document.getElementById('roster');
-
- // Get roster items
- var iqNode = iq.getNode();
- var bItems = iqNode.getElementsByTagName('item');
-
- // Display each elements from the roster
- for(var i = 0; i < bItems.length; i++) {
- // Get the values
- current = iqNode.getElementsByTagName('item').item(i);
- xid = current.getAttribute('jid').htmlEnc();
- nick = current.getAttribute('name');
- hash = hex_md5(xid);
-
- // No defined nick?
- if(!nick) {
- nick = self.getDirectNick(xid);
- }
-
- roster_buddies.push({
- 'xid': xid,
- 'hash': hash,
- 'nick': nick
- });
- }
-
- // Sort the values
- self.sortRoster(roster_buddies);
-
- // Display the values
- for(var j = 0; j < roster_buddies.length; j++) {
- cur_buddy = roster_buddies[j];
-
- self.displayRoster(
- roster,
- cur_buddy.xid,
- cur_buddy.hash,
- cur_buddy.nick
- );
- }
-
- // Start handling buddies presence
- self.sendPresence('', 'available', 1);
- } catch(e) {
- Console.error('Mobile.handleRoster', e);
- }
-
- };
-
-
- /**
- * Sends message w/ provided data
- * @public
- * @param {object} aForm
- * @return {boolean}
- */
- self.sendMessage = function(aForm) {
-
- try {
- var body = aForm.body.value;
- var xid = aForm.xid.value;
- var hash = hex_md5(xid);
-
- if(body && xid) {
- // Send the message
- var aMsg = new JSJaCMessage();
- aMsg.setTo(xid);
- aMsg.setType('chat');
- aMsg.setBody(body);
- con.send(aMsg);
-
- // Clear our input
- aForm.body.value = '';
-
- // Display the message we sent
- self.displayMessage(xid, body, 'me', hash);
- }
- } catch(e) {
- Console.error('Mobile.sendMessage', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Sends presence w/ provided data
- * @public
- * @param {string} type
- * @param {string} show
- * @param {number} priority
- * @param {string} status
- * @return {undefined}
- */
- self.sendPresence = function(type, show, priority, status) {
-
- try {
- var presence = new JSJaCPresence();
-
- if(type)
- presence.setType(type);
- if(show)
- presence.setShow(show);
- if(priority)
- presence.setPriority(priority);
- if(status)
- presence.setStatus(status);
-
- con.send(presence);
- } catch(e) {
- Console.error('Mobile.sendPresence', e);
- }
-
- };
-
-
- /**
- * Requests the user roster
- * @public
- * @return {undefined}
- */
- self.getRoster = function() {
-
- try {
- iq = new JSJaCIQ();
- iq.setType('get');
- iq.setQuery(NS_ROSTER);
-
- con.send(iq, self.handleRoster);
- } catch(e) {
- Console.error('Mobile.getRoster', e);
- }
-
- };
-
-
- /**
- * Gets user nick (the dumb way)
- * @public
- * @param {string} xid
- * @return {string}
- */
- self.getDirectNick = function(xid) {
-
- try {
- return self.explodeThis('@', xid, 0);
- } catch(e) {
- Console.error('Mobile.getDirectNick', e);
- }
-
- };
-
-
- /**
- * Gets user nick (the smarter way)
- * @public
- * @param {string} xid
- * @param {string} hash
- * @return {string}
- */
- self.getNick = function(xid, hash) {
-
- try {
- var path = 'buddy-' + hash;
-
- if(self.exists(path)) {
- return document.getElementById(path).innerHTML;
- } else {
- self.getDirectNick(xid);
- }
- } catch(e) {
- Console.error('Mobile.getNick', e);
- }
-
- };
-
-
- /**
- * Explodes a string w/ given character
- * @public
- * @param {string} toEx
- * @param {string} toStr
- * @param {number} i
- * @return {string}
- */
- self.explodeThis = function(toEx, toStr, i) {
-
- try {
- // Get the index of our char to explode
- var index = toStr.indexOf(toEx);
-
- // We split if necessary the string
- if(index !== -1) {
- if(i === 0) {
- toStr = toStr.substr(0, index);
- } else {
- toStr = toStr.substr(index + 1);
- }
- }
-
- // We return the value
- return toStr;
- } catch(e) {
- Console.error('Mobile.explodeThis', e);
- }
-
- };
-
-
- /**
- * Removes the resource part from a XID
- * @public
- * @param {string} aXID
- * @return {string}
- */
- self.cutResource = function(aXID) {
-
- try {
- return self.explodeThis('/', aXID, 0);
- } catch(e) {
- Console.error('Mobile.cutResource', e);
- }
-
- };
-
-
- /**
- * Gets the nick part of a XID
- * @public
- * @param {string} aXID
- * @return {string}
- */
- self.getXIDNick = function(aXID) {
-
- try {
- return self.explodeThis('@', aXID, 0);
- } catch(e) {
- Console.error('Mobile.getXIDNick', e);
- }
-
- };
-
-
- /**
- * Gets the host part of a XID
- * @public
- * @param {string} aXID
- * @return {string}
- */
- self.getXIDHost = function(aXID) {
-
- try {
- return self.explodeThis('@', aXID, 1);
- } catch(e) {
- Console.error('Mobile.getXIDHost', e);
- }
-
- };
-
-
- /**
- * Filters message for display
- * @public
- * @param {string} msg
- * @return {string}
- */
- self.filter = function(msg) {
-
- try {
- // Encode in HTML
- msg = msg.htmlEnc();
-
- // Highlighted text
- msg = msg.replace(/(\s|^)\*(.+)\*(\s|$)/gi,'$1$2 $3');
-
- // Links
- msg = Links.apply(msg, 'mini');
-
- return msg;
- } catch(e) {
- Console.error('Mobile.filter', e);
- }
-
- };
-
-
- /**
- * Displays message into chat view
- * @public
- * @param {string} xid
- * @param {string} body
- * @param {string} nick
- * @param {string} hash
- * @return {undefined}
- */
- self.displayMessage = function(xid, body, nick, hash) {
-
- try {
- // Get the path
- var path = 'content-' + hash;
-
- // Display the message
- html = '' + self._e("You");
- } else {
- html += ' class="him">' + nick;
- }
-
- html += ' ' + self.filter(body) + ' ';
-
- document.getElementById(path).innerHTML += html;
-
- // Scroll to the last element
- document.getElementById(path).lastChild.scrollIntoView();
- } catch(e) {
- Console.error('Mobile.displayMessage', e);
- }
-
- };
-
-
- /**
- * Displays a roster buddy
- * @public
- * @param {object} roster
- * @param {string} xid
- * @param {string} hash
- * @param {string} nick
- * @return {undefined}
- */
- self.displayRoster = function(roster, xid, hash, nick) {
-
- try {
- oneBuddy = document.createElement('a');
- oneID = 'buddy-' + hash;
-
- oneBuddy.setAttribute('href', '#');
- oneBuddy.setAttribute('id', oneID);
- oneBuddy.setAttribute('class', 'one-buddy');
- oneBuddy.setAttribute('onclick', 'return Mobile.chat(\'' + self.encodeOnclick(xid) + '\', \'' + self.encodeOnclick(nick) + '\');');
- oneBuddy.innerHTML = nick.htmlEnc();
-
- roster.appendChild(oneBuddy);
- } catch(e) {
- Console.error('Mobile.displayRoster', e);
- }
-
- };
-
-
- /**
- * Sorts the roster buddies by nickname
- * @public
- * @param {object} roster_buddies
- * @return {object}
- */
- self.sortRoster = function(roster_buddies) {
-
- try {
- var one_nick, two_nick;
-
- roster_buddies.sort(function(one, two) {
- one_nick = (one.nick + '').toLowerCase();
- two_nick = (two.nick + '').toLowerCase();
-
- return one_nick < two_nick ? -1 : (one_nick > two_nick ? 1 : 0);
- });
- } catch(e) {
- Console.error('Mobile.sortRoster', e);
- } finally {
- return roster_buddies;
- }
-
- };
-
-
- /**
- * Goes back to roster view
- * @public
- * @return {undefined}
- */
- self.returnToRoster = function() {
-
- try {
- // Hide the chats
- self.hideThis('chat');
-
- // Show the roster
- self.showThis('talk');
- } catch(e) {
- Console.error('Mobile.returnToRoster', e);
- }
-
- };
-
-
- /**
- * Switches view to target chat
- * @public
- * @param {string} hash
- * @return {undefined}
- */
- self.chatSwitch = function(hash) {
-
- try {
- // Hide the roster page
- self.hideThis('talk');
-
- // Hide the other chats
- var divs = document.getElementsByTagName('div');
-
- for(var i = 0; i < divs.length; i++) {
- if(divs.item(i).getAttribute('class') == 'one-chat') {
- divs.item(i).style.display = 'none';
- }
- }
-
- // Show the chat
- self.showThis('chat');
- self.showThis(hash);
- } catch(e) {
- Console.error('Mobile.chatSwitch', e);
- }
-
- };
-
-
- /**
- * Creates given chat
- * @public
- * @param {string} xid
- * @param {string} nick
- * @param {string} hash
- * @return {undefined}
- */
- self.createChat = function(xid, nick, hash) {
-
- try {
- // Define the variables
- var chat = document.getElementById('chans');
- var oneChat = document.createElement('div');
-
- // Apply the DOM modification
- oneChat.setAttribute('id', 'chat-' + hash);
- oneChat.setAttribute('class', 'one-chat');
- oneChat.innerHTML = '' + nick + '
';
- chat.appendChild(oneChat);
- } catch(e) {
- Console.error('Mobile.createChat', e);
- }
-
- };
-
-
- /**
- * Launches a chat
- * @public
- * @param {string} xid
- * @param {string} nick
- * @return {boolean}
- */
- self.chat = function(xid, nick) {
-
- try {
- var hash = hex_md5(xid);
-
- // If the chat was not yet opened
- if(!self.exists('chat-' + hash)) {
- // No nick?
- if(!nick) {
- nick = self.getNick(xid, hash);
- }
-
- // Create the chat
- self.createChat(xid, nick, hash);
- }
-
- // Switch to the chat
- self.chatSwitch('chat-' + hash);
- } catch(e) {
- Console.error('Mobile.chat', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Displays given presence
- * @public
- * @param {string} hash
- * @param {string} show
- * @return {undefined}
- */
- self.displayPresence = function(hash, show) {
-
- try {
- var element = document.getElementById('buddy-' + hash);
-
- if(element) {
- element.setAttribute('class', 'one-buddy ' + show);
- }
- } catch(e) {
- Console.error('Mobile.displayPresence', e);
- }
-
- };
-
-
- /**
- * Plugin launcher
- * @public
- * @return {undefined}
- */
- self.launch = function() {
-
- try {
- onbeforeunload = self.doLogout;
- onload = self.doInitialize;
- } catch(e) {
- Console.error('Mobile.launch', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
-
-Mobile.launch();
\ No newline at end of file
diff --git a/source/app/javascripts/mucadmin.js b/source/app/javascripts/mucadmin.js
deleted file mode 100644
index 1c034e8..0000000
--- a/source/app/javascripts/mucadmin.js
+++ /dev/null
@@ -1,580 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the mucadmin JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Authors: Valérian Saliou, Maranda
-
-*/
-
-// Bundle
-var MUCAdmin = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Opens the MUC admin popup
- * @public
- * @param {string} xid
- * @param {string} aff
- * @return {undefined}
- */
- self.open = function(xid, aff) {
-
- try {
- // Popup HTML content
- var html_full =
- '' + Common._e("MUC administration") + '
' +
-
- '' +
- '
' +
- '
' + Common._e("You administrate this room") + '
' +
-
- '
' + xid + '
' +
- '
' +
-
- '
' +
- '
' +
-
- '';
-
- var html_partial =
- '' + Common._e("MUC administration") + '
' +
-
- '' +
- '
' +
- '
' + Common._e("You administrate this room") + '
' +
-
- '
' + xid + '
' +
- '
' +
-
- '
' +
- '
' +
-
- '';
-
- // Create the popup
- if(aff == 'owner')
- Popup.create('mucadmin', html_full);
- if(aff == 'admin')
- Popup.create('mucadmin', html_partial);
-
- // Associate the events
- self.instance();
-
- // We get the affiliated user's privileges
- if(aff == 'owner') {
- self.query(xid, 'member');
- self.query(xid, 'owner');
- self.query(xid, 'admin');
- self.query(xid, 'outcast');
-
- // We query the room to edit
- DataForm.go(xid, 'muc', '', '', 'mucadmin');
- } else if(aff == 'admin') {
- self.query(xid, 'member');
- self.query(xid, 'outcast');
- }
- } catch(e) {
- Console.error('MUCAdmin.open', e);
- }
-
- };
-
-
- /**
- * Closes the MUC admin popup
- * @public
- * @return {boolean}
- */
- self.close = function() {
-
- try {
- // Destroy the popup
- Popup.destroy('mucadmin');
- } catch(e) {
- Console.error('MUCAdmin.close', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Removes a MUC admin input
- * @public
- * @param {string} element
- * @return {boolean}
- */
- self.removeInput = function(element) {
-
- try {
- var path = $(element).parent();
-
- // We first hide the container of the input
- path.hide();
-
- // Then, we add a special class to the input
- path.find('input').addClass('aut-dustbin');
- } catch(e) {
- Console.error('MUCAdmin.removeInput', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Adds a MUC admin input
- * @public
- * @param {type} xid
- * @param {type} affiliation
- * @return {boolean}
- */
- self.addInput = function(xid, affiliation) {
-
- try {
- var hash = hex_md5(xid + affiliation);
-
- // Add the HTML code
- $('#mucadmin .aut-' + affiliation + ' .aut-add').after(
- ''
- );
-
- // Click event
- $('#mucadmin .' + hash + ' .aut-remove').click(function() {
- return self.removeInput(this);
- });
-
- // Focus on the input we added
- if(!xid) {
- $(document).oneTime(10, function() {
- $('#mucadmin .' + hash + ' input').focus();
- });
- }
- } catch(e) {
- Console.error('MUCAdmin.addInput', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Handles the MUC admin form
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleAuth = function(iq) {
-
- try {
- // We got the authorizations results
- $(iq.getQuery()).find('item').each(function() {
- // We parse the received xml
- var xid = $(this).attr('jid');
- var affiliation = $(this).attr('affiliation');
-
- // We create one input for one XID
- self.addInput(xid, affiliation);
- });
-
- // Hide the wait icon
- $('#mucadmin .wait').hide();
-
- Console.log('MUC admin items received: ' + Common.fullXID(Common.getStanzaFrom(iq)));
- } catch(e) {
- Console.error('MUCAdmin.handleAuth', e);
- }
-
- };
-
-
- /**
- * Queries the MUC admin form
- * @public
- * @param {string} xid
- * @param {string} type
- * @return {undefined}
- */
- self.query = function(xid, type) {
-
- try {
- // Show the wait icon
- $('#mucadmin .wait').show();
-
- // New IQ
- var iq = new JSJaCIQ();
-
- iq.setTo(xid);
- iq.setType('get');
-
- var iqQuery = iq.setQuery(NS_MUC_ADMIN);
- iqQuery.appendChild(iq.buildNode('item', {'affiliation': type, 'xmlns': NS_MUC_ADMIN}));
-
- con.send(iq, self.handleAuth);
- } catch(e) {
- Console.error('MUCAdmin.query', e);
- }
-
- };
-
-
- /**
- * Sends the new chat-room topic
- * @public
- * @param {string} xid
- * @return {undefined}
- */
- self.sendTopic = function(xid) {
-
- try {
- // We get the new topic
- var topic = $('.mucadmin-topic textarea').val();
-
- // We send the new topic if not blank
- if(topic) {
- var m = new JSJaCMessage();
- m.setTo(xid);
- m.setType('groupchat');
- m.setSubject(topic);
- con.send(m);
-
- Console.info('MUC admin topic sent: ' + topic);
- }
- } catch(e) {
- Console.error('MUCAdmin.sendTopic', e);
- }
-
- };
-
-
- /**
- * Sends the MUC admin auth form
- * @public
- * @param {string} xid
- * @return {undefined}
- */
- self.sendAuth = function(xid) {
-
- try {
- // We define the values array
- var types = new Array('member', 'owner', 'admin', 'outcast');
-
- $.each(types, function(i) {
- // We get the current type
- var tType = types[i];
-
- // We loop for all the elements
- $('.mucadmin-aut .aut-' + tType + ' input').each(function() {
- // We get the needed values
- var value = $(this).val();
- var affiliation = ($(this).hasClass('aut-dustbin') && value) ? 'none' : tType;
-
- // Submit affiliation
- if(value && affiliation) {
- self.setAffiliation(xid, value, affiliation);
- }
- });
- });
-
- Console.info('MUC admin authorizations form sent: ' + xid);
- } catch(e) {
- Console.error('MUCAdmin.sendAuth', e);
- }
-
- };
-
-
- /**
- * Sets the affiliation for a given user
- * @public
- * @param {string} muc_xid
- * @param {string} user_xid
- * @param {string} affiliation
- * @return {undefined}
- */
- self.setAffiliation = function(muc_xid, user_xid, affiliation) {
-
- try {
- // If no affiliation set, assume it's 'none'
- affiliation = affiliation || 'none';
-
- // Go Go Go!!
- var iq = new JSJaCIQ();
- iq.setTo(muc_xid);
- iq.setType('set');
-
- var iqQuery = iq.setQuery(NS_MUC_ADMIN);
-
- var item = iqQuery.appendChild(iq.buildNode('item', {
- 'jid': user_xid,
- 'affiliation': affiliation,
- 'xmlns': NS_MUC_ADMIN
- }));
-
- con.send(iq, Errors.handleReply);
- } catch(e) {
- Console.error('MUCAdmin.setAffiliation', e);
- }
-
- };
-
-
- /**
- * Checks if the MUC room was destroyed
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleDestroyIQ = function(iq) {
-
- try {
- if(!Errors.handleReply(iq)) {
- // We close the groupchat
- var room = Common.fullXID(Common.getStanzaFrom(iq));
- var hash = hex_md5(room);
- Interface.quitThisChat(room, hash, 'groupchat');
-
- // We close the muc admin popup
- self.close();
-
- // We tell the user that all is okay
- Board.openThisInfo(5);
-
- // We remove the user's favorite
- if(DataStore.existDB(Connection.desktop_hash, 'favorites', room)) {
- Favorites.removeThis(room, Common.explodeThis('@', room, 0));
- }
-
- Console.info('MUC admin destroyed: ' + room);
- }
-
- // We hide the wait icon
- $('#mucadmin .wait').hide();
- } catch(e) {
- Console.error('MUCAdmin.handleDestroyIQ', e);
- }
-
- };
-
-
- /**
- * Destroys a MUC room
- * @public
- * @param {string} xid
- * @return {boolean}
- */
- self.destroyIQ = function(xid) {
-
- try {
- // We ask the server to delete the room
- var iq = new JSJaCIQ();
-
- iq.setTo(xid);
- iq.setType('set');
- var iqQuery = iq.setQuery(NS_MUC_OWNER);
- iqQuery.appendChild(iq.buildNode('destroy', {'xmlns': NS_MUC_OWNER}));
-
- con.send(iq, self.handleDestroyIQ);
-
- Console.info('MUC admin destroy sent: ' + xid);
- } catch(e) {
- Console.error('MUCAdmin.destroyIQ', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Performs the MUC room destroy functions
- * @public
- * @return {undefined}
- */
- self.destroy = function() {
-
- try {
- // We get the XID of the current room
- var xid = $('#mucadmin .mucadmin-head-jid').text();
-
- // We show the wait icon
- $('#mucadmin .wait').show();
-
- // We send the iq
- self.destroyIQ(xid);
- } catch(e) {
- Console.error('MUCAdmin.destroy', e);
- }
-
- };
-
-
- /**
- * Sends all the MUC admin stuffs
- * @public
- * @return {undefined}
- */
- self.send = function() {
-
- try {
- // We get the XID of the current room
- var xid = $('#mucadmin .mucadmin-head-jid').text();
-
- // We change the room topic
- self.sendTopic(xid);
-
- // We send the needed queries
- DataForm.send('x', 'submit', 'submit', $('#mucadmin .mucadmin-results').attr('data-session'), xid, '', '', 'mucadmin');
- self.sendAuth(xid);
- } catch(e) {
- Console.error('MUCAdmin.send', e);
- }
-
- };
-
-
- /**
- * Saves the MUC admin elements
- * @public
- * @return {boolean}
- */
- self.save = function() {
-
- try {
- // We send the new options
- self.send();
-
- // And we quit the popup
- return self.close();
- } catch(e) {
- Console.error('MUCAdmin.save', e);
- }
-
- };
-
-
- /**
- * Plugin launcher
- * @public
- * @return {undefined}
- */
- self.instance = function() {
-
- try {
- // Click events
- $('#mucadmin .bottom .finish').click(function() {
- if($(this).is('.cancel')) {
- return self.close();
- }
-
- if($(this).is('.save')) {
- return self.save();
- }
- });
- } catch(e) {
- Console.error('MUCAdmin.instance', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/muji.js b/source/app/javascripts/muji.js
deleted file mode 100644
index 2f9a0da..0000000
--- a/source/app/javascripts/muji.js
+++ /dev/null
@@ -1,1845 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the Muji helpers & launchers
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Muji = (function() {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /* Constants */
- self.INVITE_MAX_DELAY = 60;
-
-
- /* Variables */
- self._session = null;
- self._caller_xid = null;
-
-
- /**
- * Opens the Muji interface (depending on the state)
- * @public
- * @return {boolean}
- */
- self.open = function() {
-
- try {
- var call_tool_sel = $('#top-content .tools.call');
-
- if(call_tool_sel.is('.active')) {
- Console.info('Opened call notification drawer');
- } else if(call_tool_sel.is('.streaming')) {
- self._show_interface();
-
- Console.info('Opened Muji box');
- } else {
- Console.warn('Could not open any Muji tool (race condition on state)');
- }
- } catch(e) {
- Console.error('Muji.open', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Returns the Muji session arguments (used to configure it)
- * @private
- * @param connection
- * @param xid
- * @param hash
- * @param local_view
- * @return {object}
- */
- self._args = function(connection, xid, hash, media, local_view) {
-
- args = {};
-
- try {
- // Network configuration
- var ice_servers = Call.generate_ice_servers();
-
- // Muji arguments
- args = {
- // Configuration (required)
- connection: connection,
- to: xid,
- media: media,
- local_view: local_view,
- stun: ice_servers.stun,
- turn: ice_servers.turn,
- resolution: 'sd',
- debug: Call._consoleAdapter,
-
- // Safety options (optional)
- password_protect: true,
-
- // Custom handlers (optional)
- room_message_in: function(muji, stanza) {
- var from = muji.utils.stanza_from(stanza);
- var username = muji.utils.extract_username(from);
- var body = stanza.getBody();
- var muji_sel = $('#muji');
-
- var mode = (username === $('#muji').attr('data-username')) ? 'me' : 'him';
-
- if(username && body && muji_sel.size()) {
- var avatar_html = '';
-
- if(mode === 'him') {
- avatar_html =
- '' +
- '
' +
- '
';
- }
-
- muji_sel.find('.chatroom .chatroom_view').append(
- '' +
- avatar_html +
-
- '
' +
- '' + body.htmlEnc() + ' ' +
- '' + username.htmlEnc() + ' ' +
- '
' +
-
- '
' +
- '
'
- );
-
- if($('#muji').is(':visible')) {
- self._message_scroll();
- } else {
- self._message_notify();
- }
-
- Console.log('Muji._args > room_message_in', 'Displayed Muji message from: ' + username);
- }
-
- Console.log('Muji._args', 'room_message_in');
- },
-
- room_message_out: function(muji, stanza) {
- Console.log('Muji._args', 'room_message_out');
- },
-
- room_presence_in: function(muji, stanza) {
- Console.log('Muji._args', 'room_presence_in');
- },
-
- room_presence_out: function(muji, stanza) {
- Console.log('Muji._args', 'room_presence_out');
- },
-
- session_prepare_pending: function(muji, stanza) {
- // Temporary username
- $('#muji').attr('data-username', muji.get_username());
-
- // Notify user about preparing call
- Call.notify(
- JSJAC_JINGLE_SESSION_MUJI,
- muji.get_to(),
- 'preparing',
- muji.get_media(),
- self.get_caller_xid()
- );
-
- Console.log('Muji._args', 'session_prepare_pending');
- },
-
- session_prepare_success: function(muji, stanza) {
- // Final username
- $('#muji').attr('data-username', muji.get_username());
-
- Console.log('Muji._args', 'session_prepare_success');
- },
-
- session_prepare_error: function(muji, stanza) {
- self._reset();
-
- Call.notify(
- JSJAC_JINGLE_SESSION_MUJI,
- muji.get_to(),
- 'error',
- muji.get_media(),
- self.get_caller_xid()
- );
-
- Console.log('Muji._args', 'session_prepare_error');
- },
-
- session_initiate_pending: function(muji) {
- Call.notify(
- JSJAC_JINGLE_SESSION_MUJI,
- muji.get_to(),
- 'waiting',
- muji.get_media(),
- self.get_caller_xid()
- );
-
- Console.log('Muji._args', 'session_initiate_pending');
- },
-
- session_initiate_success: function(muji, stanza) {
- Call._unnotify();
-
- // Start call! Go Go Go!
- Call.start_session(muji.get_media());
- self._show_interface();
- Call.start_counter();
-
- Console.log('Muji._args', 'session_initiate_success');
- },
-
- session_initiate_error: function(muji, stanza) {
- self._reset();
-
- Call.notify(
- JSJAC_JINGLE_SESSION_MUJI,
- muji.get_to(),
- 'error',
- muji.get_media(),
- self.get_caller_xid()
- );
-
- Console.log('Muji._args', 'session_initiate_error');
- },
-
- session_leave_pending: function(muji) {
- self._reset();
-
- Call.notify(
- JSJAC_JINGLE_SESSION_MUJI,
- muji.get_to(),
- 'ending',
- muji.get_media(),
- self.get_caller_xid()
- );
-
- Console.log('Muji._args', 'session_leave_pending');
- },
-
- session_leave_success: function(muji, stanza) {
- self._reset();
-
- Call.notify(
- JSJAC_JINGLE_SESSION_MUJI,
- muji.get_to(),
- 'ended',
- muji.get_media(),
- self.get_caller_xid()
- );
-
- Console.log('Muji._args', 'session_leave_success');
- },
-
- session_leave_error: function(muji, stanza) {
- self._reset();
-
- if(typeof muji.parent != 'undefined') {
- muji = muji.parent;
- }
-
- Call.notify(
- JSJAC_JINGLE_SESSION_MUJI,
- muji.get_to(),
- 'ended',
- muji.get_media(),
- self.get_caller_xid()
- );
-
- Console.log('Muji._args', 'session_leave_error');
- },
-
- participant_prepare: function(muji, stanza) {
- Console.log('Muji._args', 'participant_prepare');
- },
-
- participant_initiate: function(muji, stanza) {
- Console.log('Muji._args', 'participant_initiate');
- },
-
- participant_leave: function(muji, stanza) {
- Console.log('Muji._args', 'participant_leave');
- },
-
- participant_session_initiate_pending: function(muji, session) {
- Console.log('Muji._args', 'participant_session_initiate_pending');
- },
-
- participant_session_initiate_success: function(muji, session, stanza) {
- Console.log('Muji._args', 'participant_session_initiate_success');
- },
-
- participant_session_initiate_error: function(muji, session, stanza) {
- Console.log('Muji._args', 'participant_session_initiate_error');
- },
-
- participant_session_initiate_request: function(muji, session, stanza) {
- Console.log('Muji._args', 'participant_session_initiate_request');
- },
-
- participant_session_accept_pending: function(muji, session) {
- Console.log('Muji._args', 'participant_session_accept_pending');
- },
-
- participant_session_accept_success: function(muji, session, stanza) {
- Console.log('Muji._args', 'participant_session_accept_success');
- },
-
- participant_session_accept_error: function(muji, session, stanza) {
- Console.log('Muji._args', 'participant_session_accept_error');
- },
-
- participant_session_accept_request: function(muji, session, stanza) {
- Console.log('Muji._args', 'participant_session_accept_request');
- },
-
- participant_session_info_pending: function(muji, session) {
- Console.log('Muji._args', 'participant_session_info_pending');
- },
-
- participant_session_info_success: function(muji, session, stanza) {
- Console.log('Muji._args', 'participant_session_info_success');
- },
-
- participant_session_info_error: function(muji, session, stanza) {
- Console.log('Muji._args', 'participant_session_info_error');
- },
-
- participant_session_info_request: function(muji, session, stanza) {
- Console.log('Muji._args', 'participant_session_info_request');
- },
-
- participant_session_terminate_pending: function(muji, session) {
- Console.log('Muji._args', 'participant_session_terminate_pending');
- },
-
- participant_session_terminate_success: function(muji, session, stanza) {
- Console.log('Muji._args', 'participant_session_terminate_success');
- },
-
- participant_session_terminate_error: function(muji, session, stanza) {
- Console.log('Muji._args', 'participant_session_terminate_error');
- },
-
- participant_session_terminate_request: function(muji, session, stanza) {
- Console.log('Muji._args', 'participant_session_terminate_request');
- },
-
- add_remote_view: function(muji, username, media) {
- Console.log('Muji._args', 'add_remote_view');
-
- var muji_sel = $('#muji');
- var nobody_sel = muji_sel.find('.empty_message');
- var remote_container_sel = $('#muji .remote_container');
- var remote_video_shaper_sel = remote_container_sel.find('.remote_video_shaper');
-
- var view_sel = null;
- var container_sel = remote_video_shaper_sel.filter(function() {
- return ($(this).attr('data-username') + '') === (username + '');
- });
-
- var count_participants = remote_video_shaper_sel.filter(':has(video)').size();
-
- // Not already in view?
- if(!container_sel.size()) {
- // Select first empty view
- var first_empty_view_sel = remote_video_shaper_sel.filter(':not(:has(video)):first');
-
- if(first_empty_view_sel.size()) {
- container_sel = first_empty_view_sel;
-
- // Remote poster
- var remote_poster = './images/placeholders/jingle_video_remote.png';
-
- if(media === 'audio') {
- remote_poster = './images/placeholders/jingle_audio_remote.png';
- }
-
- // Append view
- view_sel = $(' ');
-
- container_sel.attr('data-username', username);
- view_sel.appendTo(container_sel);
-
- // Append username label
- container_sel.append(
- '' + username.htmlEnc() + ' '
- );
-
- // Update counter
- muji_sel.attr(
- 'data-count',
- ++count_participants
- );
- } else {
- // Room is full...
- muji_sel.find('.chatroom_participants .participants_full:hidden').show();
- }
- }
-
- nobody_sel.hide();
- Muji._update_count_participants(count_participants);
- Muji._update_invite_participants();
-
- // IMPORTANT: return view selector
- return (view_sel !== null) ? view_sel[0] : view_sel;
- },
-
- remove_remote_view: function(muji, username) {
- Console.log('Muji._args', 'remove_remote_view');
-
- var muji_sel = $('#muji');
- var nobody_sel = muji_sel.find('.empty_message');
- var remote_container_sel = $('#muji .remote_container');
- var remote_video_shaper_sel = remote_container_sel.find('.remote_video_shaper');
-
- var container_sel = remote_video_shaper_sel.filter(function() {
- return ($(this).attr('data-username') + '') === (username + '');
- });
-
- var count_participants = remote_video_shaper_sel.filter(':has(video)').size();
-
- // Exists in view?
- if(container_sel.size()) {
- var view_sel = container_sel.find('video');
-
- // Remove video
- view_sel.stop(true).fadeOut(250, function() {
- container_sel.empty();
-
- // Update counter
- muji_sel.attr(
- 'data-count',
- --count_participants
- );
-
- // Nobody left in the room?
- if(!remote_video_shaper_sel.find('video').size()) {
- nobody_sel.show();
- muji_sel.removeAttr('data-count');
- }
-
- // Update participants counter
- muji_sel.find('.chatroom_participants .participants_full:visible').hide();
- Muji._update_count_participants(count_participants);
- Muji._update_invite_participants();
- });
-
- // IMPORTANT: return view selector
- if(view_sel.size()) {
- return view_sel[0];
- }
- }
-
- return null;
- }
- };
- } catch(e) {
- Console.error('Muji._args', e);
- } finally {
- return args;
- }
-
- };
-
-
- /**
- * Launch a new Muji session with given buddy
- * @private
- * @param room
- * @param mode
- * @param args_invite
- * @return {boolean}
- */
- self._new = function(room, mode, stanza, args_invite) {
-
- var status = false;
-
- try {
- if(!room) {
- throw 'No room to be joined given!';
- }
-
- var hash = hex_md5(room);
-
- // Create interface for video containers
- $('body').addClass('in_muji_call');
- var muji_sel = self._create_interface(room, mode);
-
- // Filter media
- var media = null;
-
- switch(mode) {
- case 'audio':
- media = JSJAC_JINGLE_MEDIA_AUDIO; break;
- case 'video':
- media = JSJAC_JINGLE_MEDIA_VIDEO; break;
- }
-
- // Start the Jingle negotiation
- var args = self._args(
- con,
- room,
- hash,
- media,
- muji_sel.find('.local_video video')[0]
- );
-
- if(typeof args_invite == 'object') {
- if(args_invite.password) {
- args.password = args_invite.password;
- }
-
- args.media = (args_invite.media == JSJAC_JINGLE_MEDIA_VIDEO) ? JSJAC_JINGLE_MEDIA_VIDEO
- : JSJAC_JINGLE_MEDIA_AUDIO;
-
- self._session = new JSJaCJingle.session(JSJAC_JINGLE_SESSION_MUJI, args);
- self._caller_xid = Common.bareXID(args_invite.from);
-
- Console.debug('Receive Muji call: ' + room);
- } else {
- self._session = new JSJaCJingle.session(JSJAC_JINGLE_SESSION_MUJI, args);
- self._caller_xid = Common.getXID();
-
- self._session.join();
-
- Console.debug('Create Muji call: ' + room);
- }
-
- Console.debug('Join Muji conference: ' + room);
-
- status = true;
- } catch(e) {
- Console.error('Muji._new', e);
- } finally {
- return status;
- }
-
- };
-
-
- /**
- * Updates the participants counter value
- * @private
- * @param {number} count_participants
- * @return {undefined}
- */
- self._update_count_participants = function(count_participants) {
-
- try {
- count_participants = (count_participants || 0);
-
- var participants_counter_sel = $('#muji .chatroom_participants .participants_counter');
-
- if(count_participants === 1) {
- participants_counter_sel.text(
- Common.printf(Common._e("%s participant"), count_participants)
- );
- } else {
- participants_counter_sel.text(
- Common.printf(Common._e("%s participants"), count_participants)
- );
- }
- } catch(e) {
- Console.error('Muji._update_count_participants', e);
- }
-
- };
-
-
- /**
- * Updates the participants invite tool
- * @private
- * @return {undefined}
- */
- self._update_invite_participants = function() {
-
- try {
- var chatroom_participants_sel = $('#muji .chatroom_participants');
-
- var participants_invite_sel = chatroom_participants_sel.find('.participants_invite');
- var participants_invite_box_sel = chatroom_participants_sel.find('.participants_invite_box');
-
- if(self.is_full()) {
- if(participants_invite_box_sel.is(':visible')) {
- participants_invite_box_sel.stop(true);
- participants_invite_sel.click();
- }
-
- participants_invite_sel.filter(':visible').hide();
- } else {
- participants_invite_sel.filter(':hidden').show();
- }
- } catch(e) {
- Console.error('Muji._update_invite_participants', e);
- }
-
- };
-
-
- /**
- * Resets the participants invite filter
- * @private
- * @return {undefined}
- */
- self._reset_participants_invite_filter = function() {
-
- try {
- // Selectors
- var chatroom_sel = $('#muji .chatroom');
- var invite_form_sel = chatroom_sel.find('form.participants_invite_form');
- var invite_search_sel = chatroom_sel.find('.participants_invite_search');
-
- // Apply
- invite_form_sel.find('input.invite_xid').val('');
-
- invite_search_sel.empty();
- } catch(e) {
- Console.error('Muji._reset_participants_invite_filter', e);
- }
-
- };
-
-
- /**
- * Engages the participants invite filter
- * @private
- * @param {string} value
- * @return {undefined}
- */
- self._engage_participants_invite_filter = function(value) {
-
- try {
- // Selectors
- var chatroom_sel = $('#muji .chatroom');
- var invite_input_sel = chatroom_sel.find('form.participants_invite_form input.invite_xid');
- var invite_search_sel = chatroom_sel.find('.participants_invite_search');
-
- // Reset UI
- invite_search_sel.empty();
-
- // Proceed search
- var results_arr = Search.processBuddy(value);
- var results_html = '';
- var bold_regex = new RegExp('((^)|( ))' + value, 'gi');
-
- // Exclude already selected buddies
- var exclude_obj = self._list_participants_invite_list();
-
- if(results_arr && results_arr.length) {
- var i, j,
- cur_xid, cur_full_xid, cur_hash, cur_support, cur_name, cur_title,
- cur_name_bolded, cur_support_class;
-
- for(i = 0; i < results_arr.length; i++) {
- // Generate result data
- cur_xid = results_arr[i];
-
- if(exclude_obj[cur_xid] !== 1) {
- cur_hash = hex_md5(cur_xid);
- cur_name = Name.getBuddy(cur_xid);
-
- // Get target's full XID
- cur_full_xid = Caps.getFeatureResource(cur_xid, NS_MUJI);
- cur_support = null;
-
- if(cur_full_xid) {
- if(Caps.getFeatureResource(cur_xid, NS_JINGLE_APPS_RTP_VIDEO)) {
- cur_support = 'video';
- } else {
- cur_support = 'audio';
- }
- }
-
- // Generate a hint title & a class
- if(cur_support) {
- cur_title = Common.printf(Common._e("%s is able to receive group calls."), cur_name);
- cur_support_class = 'participant_search_has_' + cur_support;
- } else {
- cur_title = Common.printf(Common._e("%s may not support group calls."), cur_name);
- cur_support_class = 'participant_search_unsupported';
- }
-
- // Bold matches in name
- cur_name_bolded = cur_name.htmlEnc().replace(bold_regex, '$& ');
-
- // Generate result HTML
- results_html +=
- '' +
- '' +
- ' ' +
- ' ' +
-
- '' +
- '' + cur_name_bolded + ' ' +
- ' ' +
- ' ' +
- ' ';
- }
- }
-
- // Add to DOM
- invite_search_sel.append(results_html);
-
- var search_one_sel = invite_search_sel.find('a.participant_search_one');
- search_one_sel.filter(':first').addClass('hover');
-
- // Apply avatars
- for(j = 0; j < results_arr.length; j++) {
- Avatar.get(results_arr[j], 'cache', 'true', 'forget');
- }
-
- // Apply events
- search_one_sel.click(function() {
- var this_sel = $(this);
-
- self._add_participants_invite_list(
- this_sel.attr('data-xid'),
- this_sel.text(),
- this_sel.attr('data-support')
- );
-
- self._reset_participants_invite_filter();
- invite_input_sel.focus();
- });
-
- search_one_sel.hover(function() {
- search_one_sel.filter('.hover').removeClass('hover');
- $(this).addClass('hover');
- }, function() {
- $(this).removeClass('hover');
- });
- }
- } catch(e) {
- Console.error('Muji._engage_participants_invite_filter', e);
- }
-
- };
-
-
- /**
- * Sends participant actual Muji invite
- * @private
- * @param {string|object} xid
- * @return {undefined}
- */
- self._send_participants_invite_list = function(xid) {
-
- try {
- if(self.in_call()) {
- self._session.invite(xid);
- }
- } catch(e) {
- Console.error('Muji._send_participants_invite_list', e);
- }
-
- };
-
-
- /**
- * Adds a participant to the invite list
- * @private
- * @param {string} xid
- * @param {string} name
- * @param {string} support
- * @return {undefined}
- */
- self._add_participants_invite_list = function(xid, name, support) {
-
- try {
- // Selectors
- var chatroom_sel = $('#muji .chatroom');
- var invite_form_sel = chatroom_sel.find('form.participants_invite_form');
- var invite_list_sel = chatroom_sel.find('.participants_invite_list');
-
- var pre_invite_one_sel = invite_list_sel.find('.invite_one').filter(function() {
- return (xid === $(this).attr('data-xid')) && true;
- });
-
- if(pre_invite_one_sel.size()) {
- throw 'Already existing for: ' + xid;
- }
-
- var title;
- var _class = [];
-
- switch(support) {
- case 'audio':
- case 'video':
- title = Common.printf(Common._e("%s is able to receive group calls."), name); break;
-
- default:
- title = Common.printf(Common._e("%s may not support group calls."), name);
- _class.push('invite_unsupported');
- }
-
- // Append element
- var invite_one_sel = $('' + name.htmlEnc() + ' ');
- invite_one_sel.appendTo(invite_list_sel);
-
- // Events
- invite_one_sel.find('a.invite_one_remove').click(function() {
- self._remove_participants_invite_list(invite_one_sel);
- });
-
- if(invite_list_sel.find('.invite_one').size() >= 1) {
- invite_form_sel.find('.invite_validate').show();
- invite_list_sel.filter(':hidden').show();
- }
- } catch(e) {
- Console.error('Muji._add_participants_invite_list', e);
- }
-
- };
-
-
- /**
- * Removes a participant from the invite list
- * @private
- * @param {object} participant_sel
- * @return {undefined}
- */
- self._remove_participants_invite_list = function(participant_sel) {
-
- try {
- // Selectors
- var chatroom_sel = $('#muji .chatroom');
- var invite_form_sel = chatroom_sel.find('form.participants_invite_form');
- var invite_list_sel = chatroom_sel.find('.participants_invite_list');
-
- participant_sel.remove();
-
- if(invite_list_sel.find('.invite_one').size() === 0) {
- invite_form_sel.find('.invite_validate').hide();
- invite_list_sel.filter(':visible').hide();
- }
-
- invite_form_sel.find('input.invite_xid').focus();
- } catch(e) {
- Console.error('Muji._remove_participants_invite_list', e);
- }
-
- };
-
-
- /**
- * Hovers either the next or previous participant
- * @private
- * @param {string} direction
- * @return {undefined}
- */
- self._hover_participants_invite_list = function(direction) {
-
- try {
- // Up/down: navigate through results
- var chatroom_sel = $('#muji .chatroom');
- var participants_invite_search_sel = chatroom_sel.find('.participants_invite_search');
- var participant_search_one_sel = chatroom_sel.find('.participant_search_one');
-
- if(participant_search_one_sel.size()) {
- var hover_index = participant_search_one_sel.index($('.hover'));
-
- // Up (decrement) or down (increment)?
- if(direction === 'up') {
- hover_index--;
- } else {
- hover_index++;
- }
-
- if(!hover_index) {
- hover_index = 0;
- }
-
- // Nobody before/after?
- if(participant_search_one_sel.eq(hover_index).size() === 0) {
- if(direction === 'up') {
- hover_index = participant_search_one_sel.filter(':last').index();
- } else {
- hover_index = 0;
- }
- }
-
- // Hover the previous/next user
- participant_search_one_sel.removeClass('hover');
- participant_search_one_sel.eq(hover_index).addClass('hover');
-
- // Scroll to the hovered user (if out of limits)
- participants_invite_search_sel.scrollTo(
- participant_search_one_sel.filter('.hover:first'), 0, { margin: true }
- );
- }
- } catch(e) {
- Console.error('Muji._hover_participants_invite_list', e);
- }
-
- };
-
-
- /**
- * Lists the participants in the invite list
- * @private
- * @return {object}
- */
- self._list_participants_invite_list = function() {
-
- var participants_obj = {};
-
- try {
- $('#muji .chatroom .participants_invite_list .invite_one').each(function() {
- participants_obj[$(this).attr('data-xid')] = 1;
- });
- } catch(e) {
- Console.error('Muji._list_participants_invite_list', e);
- } finally {
- return participants_obj;
- }
-
- };
-
-
- /**
- * Adapts the Muji view to the window size
- * @private
- * @return {undefined}
- */
- self._adapt = function() {
-
- try {
- if(self.in_call() && Common.exists('#muji')) {
- Call.adapt_local(
- $('#muji .local_video')
- );
-
- Call.adapt_remote(
- $('#muji .videoroom')
- );
- }
- } catch(e) {
- Console.error('Muji._adapt', e);
- }
-
- };
-
-
- /**
- * Scrolls down to last received message
- * @private
- * @return {undefined}
- */
- self._message_scroll = function() {
-
- try {
- var chatroom_view_sel = $('#muji .chatroom .chatroom_view');
-
- // Scroll down to message
- if(chatroom_view_sel.size() && chatroom_view_sel.is(':visible')) {
- chatroom_view_sel[0].scrollTop = chatroom_view_sel[0].scrollHeight;
- }
- } catch(e) {
- Console.error('Muji._message_scroll', e);
- }
-
- };
-
-
- /**
- * Notifies that a new message has been received
- * @private
- * @return {undefined}
- */
- self._message_notify = function() {
-
- try {
- // Selectors
- var tools_call_sel = $('#top-content .tools.call');
- var notify_sel = tools_call_sel.find('.notify');
-
- if(!notify_sel.size()) {
- notify_sel = $(
- '0
'
- );
-
- notify_sel.appendTo(tools_call_sel);
- }
-
- // Count & update
- var count_notifications = parseInt((notify_sel.attr('data-counter') || 0), 10);
- count_notifications++;
-
- notify_sel.text(count_notifications);
- notify_sel.attr('data-counter', count_notifications);
-
- // Update general interface
- Interface.updateTitle();
- } catch(e) {
- Console.error('Muji._message_notify', e);
- }
-
- };
-
-
- /**
- * Removes displayed message notifications
- * @private
- * @return {undefined}
- */
- self._message_unnotify = function() {
-
- try {
- $('#top-content .tools.call .notify').remove();
-
- // Update general interface
- Interface.updateTitle();
- } catch(e) {
- Console.error('Muji._message_unnotify', e);
- }
-
- };
-
-
- /**
- * Receive a Muji call
- * @public
- * @param {object} args
- * @param {object} stanza
- * @return {boolean}
- */
- self.receive = function(args, stanza) {
-
- try {
- if(!Call.is_ongoing()) {
- // Outdated invite?
- var invite_delay = DateUtils.readMessageDelay(stanza.getNode(), true);
- var date_now = DateUtils.getTimeStamp();
-
- if(invite_delay &&
- (date_now - DateUtils.extractStamp(invite_delay)) >= self.INVITE_MAX_DELAY) {
- Console.warn('Muji.receive', 'Discarded outdated invite from: ' + Common.getStanzaFrom(stanza));
- return;
- }
-
- // Create call session
- self._new(
- args.jid,
- (args.media || JSJAC_JINGLE_MEDIA_VIDEO),
- stanza,
- args
- );
-
- // Notify user
- Call.notify(
- JSJAC_JINGLE_SESSION_MUJI,
- args.jid,
- ('call_' + (args.media || 'video')),
- args.media,
- Common.bareXID(args.from)
- );
-
- Audio.play('incoming-call', true);
- }
- } catch(e) {
- Console.error('Muji.receive', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Start a Muji call
- * @public
- * @param {string} room
- * @param {string} mode
- * @return {boolean}
- */
- self.start = function(room, mode) {
-
- try {
- if(!Call.is_ongoing()) {
- self._new(room, mode);
- }
- } catch(e) {
- Console.error('Muji.start', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Reset current Muji call
- * @public
- * @return {boolean}
- */
- self._reset = function() {
-
- try {
- // Trash interface
- Call.stop_counter();
- Call.stop_session();
- self._destroy_interface();
- $('body').removeClass('in_muji_call');
-
- // Clean notifications
- self._message_unnotify();
-
- // Hack: stop audio in case it is still ringing
- Audio.stop('incoming-call');
- Audio.stop('outgoing-call');
- } catch(e) {
- Console.error('Muji._reset', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Stops current Muji call
- * @public
- * @param {boolean} abort
- * @return {boolean}
- */
- self.stop = function(abort) {
-
- try {
- // Reset interface
- self._reset();
-
- // Stop Muji session
- if(self._session !== null) {
- if(abort === true) {
- self._session.abort();
- self._session.get_session_leave_error(self._session, null);
- } else {
- self._session.leave();
- }
-
- Console.debug('Stopping current Muji call...');
- } else {
- Console.warn('No Muji call to be terminated!');
- }
- } catch(e) {
- Console.error('Muji.stop', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Mutes current Muji call
- * @public
- * @return {undefined}
- */
- self.mute = function() {
-
- try {
- Call.mute(
- $('#muji .videoroom .topbar .controls a')
- );
- } catch(e) {
- Console.error('Muji.mute', e);
- }
-
- };
-
-
- /**
- * Unmutes current Muji call
- * @public
- * @return {undefined}
- */
- self.unmute = function() {
-
- try {
- Call.unmute(
- $('#muji .videoroom .topbar .controls a')
- );
- } catch(e) {
- Console.error('Muji.mute', e);
- }
-
- };
-
-
- /**
- * Checks whether room given is Muji room or not
- * @public
- * @param {string} room
- * @return {boolean}
- */
- self.is_room = function(room) {
-
- is_room = false;
-
- try {
- if(self.in_call() && self._session.get_to()) {
- is_room = (room === self._session.get_to());
- }
- } catch(e) {
- Console.error('Muji.is_room', e);
- } finally {
- return is_room;
- }
-
- };
-
-
- /**
- * Checks whether room is full or not (over-capacity)
- * @public
- * @return {boolean}
- */
- self.is_full = function() {
-
- is_full = false;
-
- try {
- if($('#muji .chatroom_participants .participants_full').is(':visible')) {
- is_full = true;
- }
- } catch(e) {
- Console.error('Muji.is_full', e);
- } finally {
- return is_full;
- }
-
- };
-
-
- /**
- * Checks whether user is in call or not
- * @public
- * @return {boolean}
- */
- self.in_call = function() {
-
- in_call = false;
-
- try {
- if(self._session &&
- (self._session.get_status() === JSJAC_JINGLE_MUJI_STATUS_PREPARING ||
- self._session.get_status() === JSJAC_JINGLE_MUJI_STATUS_PREPARED ||
- self._session.get_status() === JSJAC_JINGLE_MUJI_STATUS_INITIATING ||
- self._session.get_status() === JSJAC_JINGLE_MUJI_STATUS_INITIATED ||
- self._session.get_status() === JSJAC_JINGLE_MUJI_STATUS_LEAVING)) {
- in_call = true;
- }
- } catch(e) {
- Console.error('Muji.in_call', e);
- } finally {
- return in_call;
- }
-
- };
-
-
- /**
- * Checks if the given call SID is the same as the current call's one
- * @public
- * @param {object}
- * @return {boolean}
- */
- self.is_same_sid = function(muji) {
-
- try {
- return Call.is_same_sid(self._session, muji);
- } catch(e) {
- Console.error('Muji.is_same_sid', e);
- }
-
- };
-
-
- /**
- * Returns if current Muji call is audio
- * @public
- * @return {boolean}
- */
- self.is_audio = function() {
-
- try {
- return Call.is_audio(self._session);
- } catch(e) {
- Console.error('Muji.is_audio', e);
- }
-
- };
-
-
- /**
- * Returns if current Muji call is video
- * @public
- * @return {boolean}
- */
- self.is_video = function() {
-
- try {
- return Call.is_video(self._session);
- } catch(e) {
- Console.error('Muji.is_video', e);
- }
-
- };
-
-
- /**
- * Returns the caller XID
- * @public
- * @return {string}
- */
- self.get_caller_xid = function() {
-
- try {
- return self._caller_xid || Common.getXID();
- } catch(e) {
- Console.error('Muji.get_caller_xid', e);
- }
-
- };
-
-
- /**
- * Get the notification map
- * @private
- * @return {object}
- */
- self._notify_map = function() {
-
- try {
- return {
- 'call_audio': {
- 'text': Common._e("Incoming group call"),
-
- 'buttons': {
- 'accept': {
- 'text': Common._e("Accept"),
- 'color': 'green',
- 'cb': function(xid, mode) {
- self._session.join();
- Audio.stop('incoming-call');
- }
- },
-
- 'decline': {
- 'text': Common._e("Decline"),
- 'color': 'red',
- 'cb': function(xid, mode) {
- self.stop(true);
- Audio.stop('incoming-call');
- }
- }
- }
- },
-
- 'call_video': {
- 'text': Common._e("Incoming group call"),
-
- 'buttons': {
- 'accept': {
- 'text': Common._e("Accept"),
- 'color': 'green',
- 'cb': function(xid, mode) {
- self._session.join();
- Audio.stop('incoming-call');
- }
- },
-
- 'decline': {
- 'text': Common._e("Decline"),
- 'color': 'red',
- 'cb': function(xid, mode) {
- self.stop(true);
- Audio.stop('incoming-call');
- }
- }
- }
- },
-
- 'preparing': {
- 'text': Common._e("Preparing group call..."),
-
- 'buttons': {
- 'cancel': {
- 'text': Common._e("Cancel"),
- 'color': 'red',
- 'cb': function(xid, mode) {
- self.stop(true);
- }
- }
- }
- },
-
- 'waiting': {
- 'text': Common._e("Preparing group call..."),
-
- 'buttons': {
- 'cancel': {
- 'text': Common._e("Cancel"),
- 'color': 'red',
- 'cb': function(xid, mode) {
- self._session.leave();
- }
- }
- }
- },
-
- 'connecting': {
- 'text': Common._e("Connecting to group call..."),
-
- 'buttons': {
- 'cancel': {
- 'text': Common._e("Cancel"),
- 'color': 'red',
- 'cb': function(xid, mode) {
- self._session.leave();
- }
- }
- }
- },
-
- 'error': {
- 'text': Common._e("Group call error"),
-
- 'buttons': {
- 'retry': {
- 'text': Common._e("Retry"),
- 'color': 'blue',
- 'cb': function(xid, mode) {
- self.start(xid, mode);
- }
- },
-
- 'cancel': {
- 'text': Common._e("Cancel"),
- 'color': 'red',
- 'cb': function(xid, mode) {
- self._reset();
- }
- }
- }
- },
-
- 'ending': {
- 'text': Common._e("Ending group call...")
- },
-
- 'ended': {
- 'text': Common._e("Group call ended"),
-
- 'buttons': {
- 'okay': {
- 'text': Common._e("Okay"),
- 'color': 'blue',
- 'cb': function(xid, mode) {
- self._reset();
- }
- }
- }
- }
- };
- } catch(e) {
- Console.error('Muji._notify_map', e);
-
- return {};
- }
-
- };
-
-
- /**
- * Create the Muji interface
- * @public
- * @param {string} room
- * @param {string} mode
- * @return {object}
- */
- self._create_interface = function(room, mode) {
-
- try {
- // Jingle interface already exists?
- if(Common.exists('#muji')) {
- throw 'Muji interface already exist!';
- }
-
- // Local poster
- var local_poster = './images/placeholders/jingle_video_local.png';
-
- if(mode === 'audio') {
- local_poster = './images/placeholders/jingle_audio_local.png';
- }
-
- // Create DOM
- $('body').append(
- '' +
- '
' +
- '
' +
- '
' +
- '
' +
-
- '
00:00:00
' +
-
- '
' +
- '
' +
-
- '
' +
- ' ' +
- '
' +
-
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
-
- '
' +
- '' + Common._e("Nobody there. Invite some people!") + ' ' +
- '
' +
- '
' +
-
- '
' +
- '
' +
- '
' +
- '
' +
- '' + Common.printf(Common._e("%s participants"), 0) + ' ' +
- '' + Common._e("(full)") + ' ' +
- '
' +
-
- '
' +
- '
' +
-
- '
' +
- '
' +
-
- '
' +
-
- '
' +
- '
' +
- '
' +
-
- '
' +
-
- '
' +
- '
' +
- '
' +
- '
'
- );
-
- // Apply events
- self._events_interface();
-
- // Apply user avatar
- Avatar.get(xid, 'cache', 'true', 'forget');
- } catch(e) {
- Console.error('Muji._create_interface', e);
- } finally {
- return $('#muji');
- }
-
- };
-
-
- /**
- * Destroy the Muji interface
- * @public
- * @return {undefined}
- */
- self._destroy_interface = function() {
-
- try {
- Call.destroy_interface(
- $('#muji')
- );
- } catch(e) {
- Console.error('Muji._destroy_interface', e);
- }
-
- };
-
-
- /**
- * Show the Muji interface
- * @private
- * @return {boolean}
- */
- self._show_interface = function() {
-
- try {
- Call.show_interface(
- self,
- $('#muji'),
- $('#muji .videoroom')
- );
-
- self._message_scroll();
- self._message_unnotify();
- } catch(e) {
- Console.error('Muji._show_interface', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Hide the Muji interface
- * @private
- * @return {boolean}
- */
- self._hide_interface = function() {
-
- try {
- Call.hide_interface(
- $('#muji'),
- $('#muji .videoroom')
- );
- } catch(e) {
- Console.error('Muji._hide_interface', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Attaches interface events
- * @private
- * @return {boolean}
- */
- self._events_interface = function() {
-
- try {
- // Common selectors
- var muji_chatroom = $('#muji .chatroom');
- var chatroom_form = muji_chatroom.find('form.chatroom_form');
- var chatroom_participants = muji_chatroom.find('.chatroom_participants');
- var participants_invite = chatroom_participants.find('.participants_default_view .participants_invite');
- var participants_invite_box = chatroom_participants.find('.participants_invite_box');
- var participants_invite_list = participants_invite_box.find('.participants_invite_list');
- var participants_invite_form = participants_invite_box.find('.participants_invite_form');
- var participants_invite_input = participants_invite_form.find('input[name="xid"]');
- var participants_invite_validate = participants_invite_form.find('.invite_validate');
- var participants_invite_search = participants_invite_box.find('.participants_invite_search');
-
- // Apply events
- Call.events_interface(
- self,
- $('#muji'),
- $('#muji .videoroom')
- );
-
- // People invite event
- participants_invite.click(function() {
- try {
- if(!participants_invite_box.is(':animated')) {
- if(participants_invite_box.is(':hidden')) {
- participants_invite_box.stop(true).slideDown(250, function() {
- participants_invite_input.focus();
- });
- } else {
- participants_invite_input.blur();
- participants_invite_box.stop(true).slideUp(250, function() {
- // Reset everything
- participants_invite_list.empty().hide();
- participants_invite_validate.hide();
- participants_invite_input.val('');
- self._reset_participants_invite_filter();
- });
- }
- }
- } catch(_e) {
- Console.error('Muji._show_interface[event]', _e);
- } finally {
- return false;
- }
- });
-
- // Invite input key events
- participants_invite_input.keydown(function(e) {
- try {
- if(e.keyCode == 9) {
- self._hover_participants_invite_list('down');
-
- return false;
- }
- } catch(_e) {
- Console.error('Muji._show_interface[event]', _e);
- }
- });
-
- participants_invite_input.keyup(function(e) {
- try {
- var this_sel = $(this);
-
- if(e.keyCode == 27) {
- // Escape: close interface
- if(!this_sel.val().trim()) {
- participants_invite.click();
- } else {
- self._reset_participants_invite_filter();
- }
-
- return false;
- } else if(e.keyCode == 9) {
- // Tabulate: skip there (see keydown above)
- return false;
- } else if(e.keyCode == 38 || e.keyCode == 40) {
- var direction = (e.keyCode == 38) ? 'up' : 'down';
- self._hover_participants_invite_list(direction);
-
- return false;
- } else {
- // Other keys: assume something has been typed
- self._engage_participants_invite_filter(
- this_sel.val()
- );
- }
- } catch(_e) {
- Console.error('Muji._show_interface[event]', _e);
- }
- });
-
- // Input auto-focus
- chatroom_form.click(function() {
- chatroom_form.find('input[name="message"]').focus();
- });
-
- // Invite form send event
- participants_invite_form.submit(function() {
- try {
- if(participants_invite_search.find('.participant_search_one.hover').size()) {
- // Add the hovered user
- var participant_search_one_hover_sel = participants_invite_search.find('.participant_search_one.hover:first');
-
- if(participant_search_one_hover_sel.size() >= 1) {
- participant_search_one_hover_sel.click();
-
- return false;
- }
- } else {
- var invite_arr = Object.keys(self._list_participants_invite_list());
-
- if(invite_arr && invite_arr.length) {
- self._send_participants_invite_list(invite_arr);
- }
-
- participants_invite.click();
- }
- } catch(_e) {
- Console.error('Muji._show_interface[event]', _e);
- } finally {
- return false;
- }
- });
-
- // Invite form validate event
- participants_invite_validate.click(function() {
- try {
- participants_invite_form.submit();
- } catch(_e) {
- Console.error('Muji._show_interface[event]', _e);
- } finally {
- return false;
- }
- });
-
- // Message send event
- chatroom_form.submit(function() {
- try {
- if(self._session === null) {
- throw 'Muji session unavailable';
- }
-
- var input_sel = $(this).find('input[name="message"]');
- var body = input_sel.val();
-
- if(body) {
- self._session.send_message(body);
- input_sel.val('');
- }
- } catch(_e) {
- Console.error('Muji._show_interface[event]', _e);
- } finally {
- return false;
- }
- });
- } catch(e) {
- Console.error('Muji._events_interface', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Plugin launcher
- * @public
- * @return {undefined}
- */
- self.launch = function() {
-
- try {
- $(window).resize(self._adapt());
- } catch(e) {
- Console.error('Muji.launch', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
-
-Muji.launch();
\ No newline at end of file
diff --git a/source/app/javascripts/music.js b/source/app/javascripts/music.js
deleted file mode 100644
index 0f2d91d..0000000
--- a/source/app/javascripts/music.js
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the music JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Music = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Opens the music bubble
- * @public
- * @return {boolean}
- */
- self.open = function() {
-
- try {
- var path = '.music-content';
-
- // Show the music bubble
- Bubble.show(path);
-
- $(document).oneTime(10, function() {
- $(path + ' input').focus();
- });
- } catch(e) {
- Console.error('Music.open', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Parses the music search XML
- * @public
- * @param {string} xml
- * @param {string} type
- * @return {undefined}
- */
- self.parse = function(xml, type) {
-
- try {
- var path = '.music-content ';
- var content = path + '.list';
- var path_type = content + ' .' + type;
-
- // Create the result container
- if(!Common.exists(path_type)) {
- var code = '
';
-
- if(type == 'local') {
- $(content).prepend(code);
- } else {
- $(content).append(code);
- }
- }
-
- // Fill the results
- $(xml).find('track').each(function() {
- // Parse the XML
- var this_sel = $(this);
-
- var id = this_sel.find('id').text() || hex_md5(uri);
- var title = this_sel.find('name').text();
- var artist = this_sel.find('artist').text();
- var source = this_sel.find('source').text();
- var duration = this_sel.find('duration').text();
- var uri = this_sel.find('url').text();
- var mime = this_sel.find('type').text() || 'audio/ogg';
-
- // Local URL?
- if(type == 'local') {
- uri = Utils.generateURL(uri);
- }
-
- // Append the HTML code
- $(path_type).append('' + title + ' ');
-
- // Current playing song?
- var current_song = $(path_type + ' a[data-id="' + id + '"]');
-
- if(Common.exists('.music-audio[data-id="' + id + '"]')) {
- current_song.addClass('playing');
- }
-
- // Click event
- current_song.click(function() {
- return self.add(id, title, artist, source, duration, uri, mime, type);
- });
- });
-
- // The search is finished
- if(Common.exists(content + ' .jamendo') && Common.exists(content + ' .local')) {
- // Get the result values
- var jamendo = $(content + ' .jamendo').text();
- var local = $(content + ' .local').text();
-
- // Enable the input
- $(path + 'input').val('').removeAttr('disabled');
-
- // No result
- if(!jamendo && !local) {
- $(path + '.no-results').show();
- }
-
- // We must put a separator between the categories
- if(jamendo && local) {
- $(content + ' .local').addClass('special');
- }
- }
- } catch(e) {
- Console.error('Music.parse', e);
- }
-
- };
-
-
- /**
- * Sends the music search requests
- * @public
- * @return {undefined}
- */
- self.search = function() {
-
- try {
- var path = '.music-content ';
-
- // We get the input string
- var string = $(path + 'input').val();
-
- // We lock the search input
- $(path + 'input').attr('disabled', true);
-
- // We reset the results
- $(path + '.list div').remove();
- $(path + '.no-results').hide();
-
- // Get the Jamendo results
- $.get('./server/music-search.php', {searchquery: string, location: 'jamendo'}, function(data) {
- self.parse(data, 'jamendo');
- });
-
- // Get the local results
- $.get('./server/music-search.php', {
- searchquery: string,
- location: JAPPIX_LOCATION
- }, function(data) {
- self.parse(data, 'local');
- });
- } catch(e) {
- Console.error('Music.search', e);
- }
-
- };
-
-
- /**
- * Performs an action on the music player
- * @public
- * @param {string} action
- * @return {boolean}
- */
- self.action = function(action) {
-
- try {
- // Initialize
- var audio_sel = document.getElementById('top-content').getElementsByTagName('audio')[0];
-
- // Nothing to play, exit
- if(!audio_sel) {
- return false;
- }
-
- var stopButton = $('#top-content a.stop');
-
- // User play a song
- if(action == 'play') {
- stopButton.show();
- audio_sel.load();
- audio_sel.play();
-
- audio_sel.addEventListener('ended', function() {
- self.action('stop');
- }, true);
-
- Console.log('Music is now playing.');
- } else if(action == 'stop') {
- // User stop the song / end of song
- stopButton.hide();
- audio_sel.pause();
-
- $('#top-content .music').removeClass('actived');
- $('.music-content .list a').removeClass('playing');
- $('.music-audio').remove();
-
- self.publish();
-
- Console.log('Music is now stopped.');
- }
- } catch(e) {
- Console.error('Music.action', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Publishes the current title over PEP
- * @public
- * @param {string} title
- * @param {string} artist
- * @param {string} source
- * @param {string} duration
- * @param {string} uri
- * @return {undefined}
- */
- self.publish = function(title, artist, source, duration, uri) {
-
- /* REF: http://xmpp.org/extensions/xep-0118.html */
-
- try {
- // We share the tune on PEP if enabled
- if(Features.enabledPEP()) {
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- // Create the main PubSub nodes
- var pubsub = iq.appendNode('pubsub', {'xmlns': NS_PUBSUB});
- var publish = pubsub.appendChild(iq.buildNode('publish', {'node': NS_TUNE, 'xmlns': NS_PUBSUB}));
- var item = publish.appendChild(iq.buildNode('item', {'xmlns': NS_PUBSUB}));
- var tune = item.appendChild(iq.buildNode('tune', {'xmlns': NS_TUNE}));
-
- // Enough data?
- if(title || artist || source || uri) {
- var music_data = {
- 'title': title,
- 'artist': artist,
- 'source': source,
- 'length': length,
- 'uri': uri
- };
-
- // Create the children nodes
- var cur_value;
-
- for(var cur_name in music_data) {
- cur_value = music_data[cur_name];
-
- if(cur_value) {
- tune.appendChild(iq.buildNode(cur_name, {
- 'xmlns': NS_TUNE
- }, cur_value));
- }
- }
- }
-
- con.send(iq);
-
- Console.info('New tune sent: ' + title);
- }
- } catch(e) {
- Console.error('Music.publish', e);
- }
-
- };
-
-
- /**
- * Adds a music title to the results
- * @public
- * @param {string} id
- * @param {string} title
- * @param {string} artist
- * @param {string} source
- * @param {string} duration
- * @param {string} uri
- * @param {string} mime
- * @param {string} type
- * @return {boolean}
- */
- self.add = function(id, title, artist, source, duration, uri, mime, type) {
-
- try {
- var path = '.music-content ';
- var music_audio_sel = $('.music-audio');
-
- // We remove & create a new audio tag
- music_audio_sel.remove();
- $(path + '.player').prepend(' ');
-
- // We apply the new source to the player
- if(type == 'jamendo') {
- music_audio_sel.attr('src', 'http://api.jamendo.com/get2/stream/track/redirect/?id=' + id + '&streamencoding=ogg2');
- } else {
- music_audio_sel.attr('src', uri);
- }
-
- // We play the target sound
- self.action('play');
-
- // We set the actived class
- $('#top-content .music').addClass('actived');
-
- // We set a current played track indicator
- $(path + '.list a').removeClass('playing');
- $(path + 'a[data-id="' + id + '"]').addClass('playing');
-
- // We publish what we listen
- self.publish(title, artist, source, duration, uri);
- } catch(e) {
- Console.error('Music.add', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Plugin launcher
- * @public
- * @param {type} name
- * @return {undefined}
- */
- self.instance = function() {
-
- try {
- // When music search string submitted
- $('.music-content input').keyup(function(e) {
- // Enter : send
- if(e.keyCode == 13 && $(this).val()) {
- self.search();
- }
-
- // Escape : quit
- if(e.keyCode == 27) {
- Bubble.close();
- }
- });
- } catch(e) {
- Console.error('Music.instance', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/name.js b/source/app/javascripts/name.js
deleted file mode 100644
index 0feacfe..0000000
--- a/source/app/javascripts/name.js
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the buddy name related JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Name = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Gets an user name for buddy add tool
- * @public
- * @param {string} xid
- * @return {undefined}
- */
- self.getAddUser = function(xid) {
-
- try {
- var iq = new JSJaCIQ();
- iq.setType('get');
- iq.setTo(xid);
-
- iq.appendNode('vCard', {'xmlns': NS_VCARD});
-
- con.send(iq, self.handleAddUser);
- } catch(e) {
- Console.error('Name.getAddUser', e);
- }
-
- };
-
-
- /**
- * Handles an user name for buddy add tool
- * @public
- * @param {object} iq
- * @return {boolean}
- */
- self.handleAddUser = function(iq) {
-
- try {
- // Was it an obsolete request?
- if(!Common.exists('.add-contact-name-get[data-for="' + escape(Common.bareXID(Common.getStanzaFrom(iq))) + '"]')) {
- return false;
- }
-
- // Reset the waiting item
- $('.add-contact-name-get').hide().removeAttr('data-for');
-
- // Get the names
- if(iq.getType() == 'result') {
- var full_name = self.generateBuddy(iq)[0];
-
- if(full_name) {
- $('.add-contact-name').val(full_name);
- }
- }
- } catch(e) {
- Console.error('Name.handleAddUser', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Generates the good buddy name from a vCard IQ reply
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.generateBuddy = function(iq) {
-
- try {
- // Get the IQ content
- var vcard_sel = $(iq.getNode()).find('vCard');
-
- // Get the full name & the nickname
- var pFull = vcard_sel.find('FN:first').text();
- var pNick = vcard_sel.find('NICKNAME:first').text();
-
- // No full name?
- if(!pFull) {
- // Get the given name
- var pN = vcard_sel.find('N:first');
- var pGiven = pN.find('GIVEN:first').text();
-
- if(pGiven) {
- pFull = pGiven;
-
- // Get the family name (optional)
- var pFamily = pN.find('FAMILY:first').text();
-
- if(pFamily) {
- pFull += ' ' + pFamily;
- }
- }
- }
-
- return [pFull, pNick];
- } catch(e) {
- Console.error('Name.generateBuddy', e);
- }
-
- };
-
-
- /**
- * Returns the given XID buddy name
- * @public
- * @param {string} xid
- * @return {string}
- */
- self.getBuddy = function(xid) {
-
- try {
- // Initialize
- var cname, bname;
-
- // Cut the XID resource
- xid = Common.bareXID(xid);
-
- // This is me?
- if(Utils.isAnonymous() && !xid) {
- bname = Common._e("You");
- } else if(xid == Common.getXID()) {
- bname = self.get();
- }
-
- // Not me!
- else {
- cname = $('#roster .buddy[data-xid="' + escape(xid) + '"]:first .buddy-name').html();
-
- // Complete name exists?
- if(cname) {
- bname = cname.revertHtmlEnc();
- } else {
- bname = Common.getXIDNick(xid);
- }
- }
-
- return bname;
- } catch(e) {
- Console.error('Name.getBuddy', e);
- }
-
- };
-
-
- /**
- * Gets the nickname of the user
- * @public
- * @return {string}
- */
- self.getNick = function() {
-
- try {
- // Try to read the user nickname
- var nick = DataStore.getDB(Connection.desktop_hash, 'profile', 'nick');
-
- // No nick?
- if(!nick) {
- nick = con.username;
- }
-
- return nick;
- } catch(e) {
- Console.error('Name.getNick', e);
- }
-
- };
-
-
- /**
- * Gets the full name of the user
- * @public
- * @return {string}
- */
- self.get = function() {
-
- try {
- // Try to read the user name
- var name = DataStore.getDB(Connection.desktop_hash, 'profile', 'name');
-
- // No name? Use the nickname instead
- if(!name) {
- name = self.getNick();
- }
-
- return name;
- } catch(e) {
- Console.error('Name.get', e);
- }
-
- };
-
-
- /**
- * Gets the MUC nickname of the user
- * @public
- * @param {string} id
- * @return {string}
- */
- self.getMUCNick = function(id) {
-
- try {
- return unescape($('#' + id).attr('data-nick'));
- } catch(e) {
- Console.error('Name.getMUCNick', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/notification.js b/source/app/javascripts/notification.js
deleted file mode 100644
index 4310d1a..0000000
--- a/source/app/javascripts/notification.js
+++ /dev/null
@@ -1,658 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the notification JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Notification = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Resets the notifications alert if no one remaining
- * @public
- * @return {undefined}
- */
- self.closeEmpty = function() {
-
- try {
- if(!$('.one-notification').size()) {
- Bubble.close();
- }
- } catch(e) {
- Console.error('Notification.closeEmpty', e);
- }
-
- };
-
-
- /**
- * Checks if there are pending notifications
- * @public
- * @return {undefined}
- */
- self.check = function() {
-
- try {
- // Define the selectors
- var notif = '#top-content .notifications';
- var nothing = '.notifications-content .nothing';
- var empty = '.notifications-content .empty';
-
- // Get the notifications number
- var number = $('.one-notification').size();
-
- // Remove the red notify bubble
- $(notif + ' .notify').remove();
-
- // Any notification?
- if(number) {
- $(notif).prepend('' + number + '
');
- $(nothing).hide();
- $(empty).show();
- } else {
- $(empty).hide();
- $(nothing).show();
-
- // Purge the social inbox node
- self.purge();
- }
-
- // Update the page title
- Interface.updateTitle();
- } catch(e) {
- Console.error('Notification.check', e);
- }
-
- };
-
-
- /**
- * Creates a new notification
- * @public
- * @param {string} type
- * @param {string} from
- * @param {string} data
- * @param {string} body
- * @param {string} id
- * @param {boolean} inverse
- * @return {undefined}
- */
- self.create = function(type, from, data, body, id, inverse) {
-
- try {
- if(!type || !from) {
- return;
- }
-
- // Generate an ID hash
- if(!id) {
- id = hex_md5(type + from);
- }
-
- // Generate the text to be displayed
- var text, action, code;
- var yes_path = 'href="#"';
-
- // User things
- from = Common.bareXID(from);
- var hash = hex_md5(from);
-
- switch(type) {
- case 'subscribe':
- // Get the name to display
- var display_name = data[1];
-
- if(!display_name)
- display_name = data[0];
-
- text = '' + display_name.htmlEnc() + ' ' + Common._e("would like to add you as a friend.") + ' ' + Common._e("Do you accept?");
-
- break;
-
- case 'invite_room':
- text = '' + Name.getBuddy(from).htmlEnc() + ' ' + Common._e("would like you to join this chatroom:") + ' ' + data[0].htmlEnc() + ' ' + Common._e("Do you accept?");
-
- break;
-
- case 'request':
- text = '' + from.htmlEnc() + ' ' + Common._e("would like to get authorization.") + ' ' + Common._e("Do you accept?");
-
- break;
-
- case 'send':
- yes_path = 'href="' + Common.encodeQuotes(data[1]) + '" target="_blank"';
-
- text = '' + Name.getBuddy(from).htmlEnc() + ' ' + Common.printf(Common._e("would like to send you a file: “%s”.").htmlEnc(), '' + Utils.truncate(body, 25).htmlEnc() + ' ') + ' ' + Common._e("Do you accept?");
-
- break;
-
- case 'send_pending':
- text = '' + Name.getBuddy(from).htmlEnc() + ' ' + Common.printf(Common._e("has received a file exchange request: “%s”.").htmlEnc(), '' + Utils.truncate(body, 25).htmlEnc() + ' ');
-
- break;
-
- case 'send_accept':
- text = '' + Name.getBuddy(from).htmlEnc() + ' ' + Common.printf(Common._e("has accepted to receive your file: “%s”.").htmlEnc(), '' + Utils.truncate(body, 25).htmlEnc() + ' ');
-
- break;
-
- case 'send_reject':
- text = '' + Name.getBuddy(from).htmlEnc() + ' ' + Common.printf(Common._e("has rejected to receive your file: “%s”.").htmlEnc(), '' + Utils.truncate(body, 25).htmlEnc() + ' ');
-
- break;
-
- case 'send_fail':
- text = '' + Name.getBuddy(from).htmlEnc() + ' ' + Common.printf(Common._e("could not receive your file: “%s”.").htmlEnc(), '' + Utils.truncate(body, 25).htmlEnc() + ' ');
-
- break;
-
- case 'rosterx':
- text = Common.printf(Common._e("Do you want to see the friends %s suggests you?").htmlEnc(), '' + Name.getBuddy(from).htmlEnc() + ' ');
-
- break;
-
- case 'comment':
- text = '' + data[0].htmlEnc() + ' ' + Common.printf(Common._e("commented an item you follow: “%s”.").htmlEnc(), '' + Utils.truncate(body, 25).htmlEnc() + ' ');
-
- break;
-
- case 'like':
- text = '' + data[0].htmlEnc() + ' ' + Common.printf(Common._e("liked your post: “%s”.").htmlEnc(), '' + Utils.truncate(body, 25).htmlEnc() + ' ');
-
- break;
-
- case 'quote':
- text = '' + data[0].htmlEnc() + ' ' + Common.printf(Common._e("quoted you somewhere: “%s”.").htmlEnc(), '' + Utils.truncate(body, 25).htmlEnc() + ' ');
-
- break;
-
- case 'wall':
- text = '' + data[0].htmlEnc() + ' ' + Common.printf(Common._e("published on your wall: “%s”.").htmlEnc(), '' + Utils.truncate(body, 25).htmlEnc() + ' ');
-
- break;
-
- case 'photo':
- text = '' + data[0].htmlEnc() + ' ' + Common.printf(Common._e("tagged you in a photo (%s).").htmlEnc(), '' + Utils.truncate(body, 25).htmlEnc() + ' ');
-
- break;
-
- case 'video':
- text = '' + data[0].htmlEnc() + ' ' + Common.printf(Common._e("tagged you in a video (%s).").htmlEnc(), '' + Utils.truncate(body, 25).htmlEnc() + ' ');
-
- break;
-
- case 'me_profile_new_success':
- yes_path = 'href="' + Common.encodeQuotes(data[1]) + '" target="_blank"';
-
- text = '' + data[0].htmlEnc() + ' ' + Common._e("validated your account. Your public profile will be available in a few moments.").htmlEnc();
-
- break;
-
- case 'me_profile_remove_success':
- yes_path = 'href="' + Common.encodeQuotes(data[1]) + '" target="_blank"';
-
- text = '' + data[0].htmlEnc() + ' ' + Common._e("has removed your public profile after your request. We will miss you!").htmlEnc();
-
- break;
-
- case 'me_profile_update_success':
- yes_path = 'href="' + Common.encodeQuotes(data[1]) + '" target="_blank"';
-
- text = '' + data[0].htmlEnc() + ' ' + Common._e("has saved your new public profile settings. They will be applied in a few moments.").htmlEnc();
-
- break;
-
- case 'me_profile_check_error':
- yes_path = 'href="' + Common.encodeQuotes(data[1]) + '" target="_blank"';
-
- text = '' + data[0].htmlEnc() + ' ' + Common._e("could not validate your account to create or update your public profile. Check your credentials.").htmlEnc();
-
- break;
-
- default:
- break;
- }
-
- // No text?
- if(!text) {
- return;
- }
-
- // Action links?
- switch(type) {
- // Hide/Show actions
- case 'send_pending':
- case 'send_accept':
- case 'send_reject':
- case 'send_fail':
- case 'comment':
- case 'like':
- case 'quote':
- case 'wall':
- case 'photo':
- case 'video':
- action = '' + Common._e("Hide") + ' ';
-
- // Any parent link?
- if((type == 'comment') && data[2]) {
- action = '' + Common._e("Show") + ' ' + action;
- }
-
- break;
-
- // Jappix Me actions
- case 'me_profile_new_success':
- case 'me_profile_remove_success':
- case 'me_profile_update_success':
- case 'me_profile_check_error':
- action = '' + Common._e("Open") + ' ' + Common._e("Hide") + ' ';
-
- break;
-
- // Default actions
- default:
- action = '' + Common._e("Yes") + ' ' + Common._e("No") + ' ';
- }
-
- if(text) {
- // We display the notification
- if(!Common.exists('.notifications-content .' + id)) {
- // We create the html markup depending of the notification type
- code = '' +
- '
' +
- '
' +
- '
' +
-
- '
' + text + '
' +
- '
' +
- ' ' +
- action +
- '
' +
- '
';
-
- // Add the HTML code
- if(inverse) {
- $('.notifications-content .nothing').before(code);
- } else {
- $('.notifications-content .empty').after(code);
- }
-
- // Play a sound to alert the user
- Audio.play('notification');
-
- // The yes click function
- $('.' + id + ' a.yes').click(function() {
- self.action(type, data, 'yes', id);
-
- if(($(this).attr('href') == '#') && ($(this).attr('target') != '_blank')) {
- return false;
- }
- });
-
- // The no click function
- $('.' + id + ' a.no').click(function() {
- return self.action(type, data, 'no', id);
- });
-
- // Get the user avatar
- Avatar.get(from, 'cache', 'true', 'forget');
- }
- }
-
- // We tell the user he has a new pending notification
- self.check();
-
- Console.info('New notification: ' + from);
- } catch(e) {
- Console.error('Notification.new', e);
- }
-
- };
-
-
- /**
- * Performs an action on a given notification
- * @public
- * @param {string} type
- * @param {string} data
- * @param {string} value
- * @param {string} id
- * @return {boolean}
- */
- self.action = function(type, data, value, id) {
-
- try {
- // We launch a function depending of the type
- if((type == 'subscribe') && (value == 'yes')) {
- Presence.acceptSubscribe(data[0], data[1]);
- } else if((type == 'subscribe') && (value == 'no')) {
- Presence.sendSubscribe(data[0], 'unsubscribed');
- } else if((type == 'invite_room') && (value == 'yes')) {
- Chat.checkCreate(data[0], 'groupchat');
- } else if(type == 'request') {
- HTTPReply.go(value, data[0]);
- }
-
- if((type == 'send') && (value == 'yes')) {
- OOB.reply(data[0], data[3], 'accept', data[2], data[4]);
- } else if((type == 'send') && (value == 'no')) {
- OOB.reply(data[0], data[3], 'reject', data[2], data[4]);
- } else if((type == 'rosterx') && (value == 'yes')) {
- RosterX.open(data[0]);
- } else if((type == 'comment') || (type == 'like') || (type == 'quote') || (type == 'wall') || (type == 'photo') || (type == 'video')) {
- if(value == 'yes') {
- // Get the microblog item
- Microblog.fromInfos(data[2]);
-
- // Append the marker
- $('#channel .top.individual').append(' ');
- }
-
- self.remove(data[3]);
- }
-
- // We remove the notification
- $('.notifications-content .' + id).remove();
-
- // We check if there's any other pending notification
- self.closeEmpty();
- self.check();
- } catch(e) {
- Console.error('Notification.action', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Clear the social notifications
- * @public
- * @return {undefined}
- */
- self.clear = function() {
-
- try {
- // Remove notifications
- $('.one-notification').remove();
-
- // Refresh
- self.closeEmpty();
- self.check();
- } catch(e) {
- Console.error('Notification.clear', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Gets the pending social notifications
- * @public
- * @return {undefined}
- */
- self.get = function() {
-
- try {
- var iq = new JSJaCIQ();
- iq.setType('get');
-
- var pubsub = iq.appendNode('pubsub', {'xmlns': NS_PUBSUB});
- pubsub.appendChild(iq.buildNode('items', {'node': NS_URN_INBOX, 'xmlns': NS_PUBSUB}));
-
- con.send(iq, self.handle);
-
- Console.log('Getting social notifications...');
- } catch(e) {
- Console.error('Notification.get', e);
- }
-
- };
-
-
- /**
- * Handles the social notifications
- * @public
- * @param {object} stanza
- * @return {undefined}
- */
- self.handle = function(stanza) {
-
- try {
- // Any error?
- if((stanza.getType() == 'error') && $(stanza.getNode()).find('item-not-found').size()) {
- // The node may not exist, create it!
- Pubsub.setup('', NS_URN_INBOX, '1', '1000000', 'whitelist', 'open', true);
-
- Console.warn('Error while getting social notifications, trying to reconfigure the Pubsub node!');
- }
-
- // Selector
- var items = $(stanza.getNode()).find('item');
-
- // Should we inverse?
- var inverse = true;
-
- if(items.size() == 1) {
- inverse = false;
- }
-
- // Parse notifications
- items.each(function() {
- var this_sel = $(this);
-
- // Parse the current item
- var current_item = this_sel.attr('id');
- var current_type = this_sel.find('link[rel="via"]:first').attr('title');
- var current_href = this_sel.find('link[rel="via"]:first').attr('href');
- var current_parent_href = this_sel.find('link[rel="related"]:first').attr('href');
- var current_xid = Common.explodeThis(':', this_sel.find('author uri').text(), 1);
- var current_name = this_sel.find('author name').text();
- var current_text = this_sel.find('content[type="text"]:first').text();
- var current_bname = Name.getBuddy(current_xid);
- var current_id = hex_md5(current_type + current_xid + current_href + current_text);
-
- // Choose the good name!
- if(!current_name || (current_bname != Common.getXIDNick(current_xid))) {
- current_name = current_bname;
- }
-
- // Create it!
- self.create(current_type, current_xid, [current_name, current_href, current_parent_href, current_item], current_text, current_id, inverse);
- });
-
- Console.info(items.size() + ' social notification(s) got!');
- } catch(e) {
- Console.error('Notification.handle', e);
- }
-
- };
-
-
- /**
- * Sends a social notification
- * @public
- * @param {string} xid
- * @param {string} type
- * @param {string} href
- * @param {string} text
- * @param {object} parent
- * @return {undefined}
- */
- self.send = function(xid, type, href, text, parent) {
-
- try {
- // Notification ID
- var id = hex_md5(xid + text + DateUtils.getTimeStamp());
-
- // IQ
- var iq = new JSJaCIQ();
- iq.setType('set');
- iq.setTo(xid);
-
- // ATOM content
- var pubsub = iq.appendNode('pubsub', {'xmlns': NS_PUBSUB});
- var publish = pubsub.appendChild(iq.buildNode('publish', {'node': NS_URN_INBOX, 'xmlns': NS_PUBSUB}));
- var item = publish.appendChild(iq.buildNode('item', {'id': id, 'xmlns': NS_PUBSUB}));
- var entry = item.appendChild(iq.buildNode('entry', {'xmlns': NS_ATOM}));
-
- // Notification author (us)
- var author = entry.appendChild(iq.buildNode('author', {'xmlns': NS_ATOM}));
- author.appendChild(iq.buildNode('name', {'xmlns': NS_ATOM}, Name.get()));
- author.appendChild(iq.buildNode('uri', {'xmlns': NS_ATOM}, 'xmpp:' + Common.getXID()));
-
- // Notification content
- entry.appendChild(iq.buildNode('published', {'xmlns': NS_ATOM}, DateUtils.getXMPPTime('utc')));
- entry.appendChild(iq.buildNode('content', {'type': 'text', 'xmlns': NS_ATOM}, text));
- entry.appendChild(iq.buildNode('link', {'rel': 'via', 'title': type, 'href': href, 'xmlns': NS_ATOM}));
-
- // Any parent item?
- if(parent && parent[0] && parent[1] && parent[2]) {
- // Generate the parent XMPP URI
- var parent_href = 'xmpp:' + parent[0] + '?;node=' + encodeURIComponent(parent[1]) + ';item=' + encodeURIComponent(parent[2]);
-
- entry.appendChild(iq.buildNode('link', {'rel': 'related', 'href': parent_href, 'xmlns': NS_ATOM}));
- }
-
- con.send(iq);
-
- Console.log('Sending a social notification to ' + xid + ' (type: ' + type + ')...');
- } catch(e) {
- Console.error('Notification.send', e);
- }
-
- };
-
-
- /**
- * Removes a social notification
- * @public
- * @param {string} id
- * @return {undefined}
- */
- self.remove = function(id) {
-
- try {
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- var pubsub = iq.appendNode('pubsub', {'xmlns': NS_PUBSUB});
- var retract = pubsub.appendChild(iq.buildNode('retract', {'node': NS_URN_INBOX, 'xmlns': NS_PUBSUB}));
- retract.appendChild(iq.buildNode('item', {'id': id, 'xmlns': NS_PUBSUB}));
-
- con.send(iq);
- } catch(e) {
- Console.error('Notification.remove', e);
- }
-
- };
-
-
- /**
- * Purge the social notifications
- * @public
- * @param {type} name
- * @return {boolean}
- */
- self.purge = function() {
-
- try {
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- var pubsub = iq.appendNode('pubsub', {'xmlns': NS_PUBSUB_OWNER});
- pubsub.appendChild(iq.buildNode('purge', {'node': NS_URN_INBOX, 'xmlns': NS_PUBSUB_OWNER}));
-
- con.send(iq);
- } catch(e) {
- Console.error('Notification.purge', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Adapt the notifications bubble max-height
- * @public
- * @return {undefined}
- */
- self.adapt = function() {
-
- try {
- // Process the new height
- var max_height = $('#right-content').height() - 22;
-
- // New height too small
- if(max_height < 250) {
- max_height = 250;
- }
-
- // Apply the new height
- $('.notifications-content .tools-content-subitem').css('max-height', max_height);
- } catch(e) {
- Console.error('Notification.adapt', e);
- }
-
- };
-
-
- /**
- * Plugin instance launcher
- * @public
- * @return {undefined}
- */
- self.instance = function() {
-
- try {
- // Adapt the notifications height
- self.adapt();
- } catch(e) {
- Console.error('Notification.instance', e);
- }
-
- };
-
-
- /**
- * Plugin launcher
- * @public
- * @return {undefined}
- */
- self.launch = function() {
-
- try {
- // Adapt the notifications height
- $(window).resize(self.adapt);
- } catch(e) {
- Console.error('Notification.launch', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
-
-Notification.launch();
\ No newline at end of file
diff --git a/source/app/javascripts/oob.js b/source/app/javascripts/oob.js
deleted file mode 100644
index 4df6990..0000000
--- a/source/app/javascripts/oob.js
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the Out of Band Data JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var OOB = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Sends an OOB request to someone
- * @public
- * @param {string} to
- * @param {string} type
- * @param {string} url
- * @param {string} desc
- * @return {undefined}
- */
- self.send = function(to, type, url, desc) {
-
- try {
- // IQ stanza?
- if(type == 'iq') {
- // Get some values
- var id = hex_md5(genID() + to + url + desc);
- to = Caps.getFeatureResource(to, NS_IQOOB);
-
- // IQs cannot be sent to offline users
- if(!to) {
- return;
- }
-
- // Register the ID
- DataStore.setDB(Connection.desktop_hash, 'send/url', id, url);
- DataStore.setDB(Connection.desktop_hash, 'send/desc', id, desc);
-
- var aIQ = new JSJaCIQ();
- aIQ.setTo(Common.fullXID(to));
- aIQ.setType('set');
- aIQ.setID(id);
-
- // Append the query content
- var aQuery = aIQ.setQuery(NS_IQOOB);
- aQuery.appendChild(aIQ.buildNode('url', {'xmlns': NS_IQOOB}, url));
- aQuery.appendChild(aIQ.buildNode('desc', {'xmlns': NS_IQOOB}, desc));
-
- con.send(aIQ);
- }
-
- // Message stanza?
- else {
- var aMsg = new JSJaCMessage();
- aMsg.setTo(Common.bareXID(to));
-
- // Append the content
- aMsg.setBody(desc);
- var aX = aMsg.appendNode('x', {'xmlns': NS_XOOB});
- aX.appendChild(aMsg.buildNode('url', {'xmlns': NS_XOOB}, url));
-
- con.send(aMsg);
- }
-
- Console.log('Sent OOB request to: ' + to + ' (' + desc + ')');
- } catch(e) {
- Console.error('OOB.send', e);
- }
-
- };
-
-
- /**
- * Handles an OOB request
- * @public
- * @param {string} from
- * @param {string} id
- * @param {string} type
- * @param {string} node
- * @return {undefined}
- */
- self.handle = function(from, id, type, node) {
-
- try {
- var xid = '', url = '', desc = '';
-
- if(type == 'iq') {
- // IQ stanza
- xid = Common.fullXID(from);
- url = $(node).find('url').text();
- desc = $(node).find('desc').text();
- } else {
- // Message stanza
- xid = Common.bareXID(from);
- url = $(node).find('url').text();
- desc = $(node).find('body').text();
- }
-
- // No desc?
- if(!desc) {
- desc = url;
- }
-
- // Open a new notification
- if(type && xid && url && desc) {
- Notification.create('send', xid, [xid, url, type, id, node], desc, hex_md5(xid + url + desc + id));
- }
- } catch(e) {
- Console.error('OOB.handle', e);
- }
-
- };
-
-
- /**
- * Replies to an OOB request
- * @public
- * @param {string} to
- * @param {string} id
- * @param {string} choice
- * @param {string} type
- * @param {object} node
- * @return {undefined}
- */
- self.reply = function(to, id, choice, type, node) {
-
- try {
- // Not IQ type?
- if(type != 'iq') {
- return;
- }
-
- // New IQ
- var aIQ = new JSJaCIQ();
- aIQ.setTo(to);
- aIQ.setID(id);
-
- // OOB request accepted
- if(choice == 'accept') {
- aIQ.setType('result');
-
- Console.info('Accepted file request from: ' + to);
- }
-
- // OOB request rejected
- else {
- aIQ.setType('error');
-
- // Append stanza content
- for(var i = 0; i < node.childNodes.length; i++) {
- aIQ.getNode().appendChild(node.childNodes.item(i).cloneNode(true));
- }
-
- // Append error content
- var aError = aIQ.appendNode('error', {
- 'xmlns': NS_CLIENT,
- 'code': '406',
- 'type': 'modify'
- });
-
- aError.appendChild(aIQ.buildNode('not-acceptable', {'xmlns': NS_STANZAS}));
-
- Console.info('Rejected file request from: ' + to);
- }
-
- con.send(aIQ);
- } catch(e) {
- Console.error('OOB.reply', e);
- }
-
- };
-
-
- /**
- * Wait event for OOB upload
- * @public
- * @return {undefined}
- */
- self.waitUpload = function() {
-
- try {
- // Append the wait icon
- var chat_tools_file_sel = page_engine_sel.find('.chat-tools-file:not(.mini)');
- var subitem_sel = chat_tools_file_sel.find('.tooltip-subitem');
-
- subitem_sel.find('*').hide();
- subitem_sel.append(
- '
'
- );
-
- // Lock the bubble
- chat_tools_file_sel.addClass('mini');
- } catch(e) {
- Console.error('OOB.waitUpload', e);
- }
-
- };
-
-
- /**
- * Success event for OOB upload
- * @public
- * @param {string} responseXML
- * @return {undefined}
- */
- self.handleUpload = function(responseXML) {
-
- try {
- var page_engine_sel = $('#page-engine');
-
- // Data selector
- var dData = $(responseXML).find('jappix');
-
- // Get the values
- var fID = dData.find('id').text();
- var fURL = dData.find('url').text();
- var fDesc = dData.find('desc').text();
-
- // Get the OOB values
- var oob_has;
-
- // No ID provided?
- if(!fID) {
- oob_has = ':has(.wait)';
- } else {
- oob_has = ':has(#oob-upload input[value="' + fID + '"])';
- }
-
- var xid = page_engine_sel.find('.page-engine-chan' + oob_has).attr('data-xid');
- var oob_type = page_engine_sel.find('.chat-tools-file' + oob_has).attr('data-oob');
-
- // Reset the file send tool
- page_engine_sel.find('.chat-tools-file' + oob_has).removeClass('mini');
- page_engine_sel.find('.bubble-file' + oob_has).remove();
-
- // Not available?
- if(page_engine_sel.find('.chat-tools-file' + oob_has).is(':hidden') && (oob_type == 'iq')) {
- Board.openThisError(4);
-
- // Remove the file we sent
- if(fURL) {
- $.get(fURL + '&action=remove');
- }
- }
-
- // Everything okay?
- else if(fURL && fDesc && !dData.find('error').size()) {
- // Send the OOB request
- self.send(xid, oob_type, fURL, fDesc);
-
- // Notify the sender
- Notification.create('send_pending', xid, [xid, fURL, oob_type, '', ''], fDesc, hex_md5(fURL + fDesc + fID));
-
- Console.info('File request sent.');
- } else {
- Board.openThisError(4);
-
- Console.error('Error while sending the file', dData.find('error').text());
- }
- } catch(e) {
- Console.error('OOB.handleUpload', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/options.js b/source/app/javascripts/options.js
deleted file mode 100644
index 190c5b6..0000000
--- a/source/app/javascripts/options.js
+++ /dev/null
@@ -1,1008 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the options JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou, Maranda
-
-*/
-
-// Bundle
-var Options = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Opens the options popup
- * @public
- * @return {boolean}
- */
- self.open = function() {
-
- try {
- // Popup HTML content
- var html =
- '' + Common._e("Edit options") + '
' +
-
- '' +
-
- '' +
- '
' +
-
- '
' +
-
- '
' +
- '
' +
-
- '';
-
- // Create the popup
- Popup.create('options', html);
-
- // Apply the features
- Features.apply('options');
-
- // Associate the events
- self.instance();
- } catch(e) {
- Console.error('Options.open', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Closes the options popup
- * @public
- * @return {boolean}
- */
- self.close = function() {
-
- try {
- // Destroy the popup
- Popup.destroy('options');
- } catch(e) {
- Console.error('Options.close', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Checks whether the options are loaded or not
- * @public
- * @return {boolean}
- */
- self.loaded = function() {
-
- is_loaded = false;
-
- try {
- if($('.options-hidable').is(':visible')) {
- is_loaded = true;
- }
- } catch(e) {
- Console.error('Options.loaded', e);
- } finally {
- return is_loaded;
- }
-
- };
-
-
- /**
- * Switches between the options tabs
- * @public
- * @param {string} id
- * @return {boolean}
- */
- self.switchTab = function(id) {
-
- try {
- var options_sel = $('#options');
-
- options_sel.find('.one-lap').hide();
- options_sel.find('#conf' + id).show();
- options_sel.find('.tab a').removeClass('tab-active');
- options_sel.find('.tab a[data-key="' + id + '"]').addClass('tab-active');
- options_sel.find('.sub-ask .sub-ask-close').click();
- } catch(e) {
- Console.error('Options.switchTab', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Manages the options wait item
- * @public
- * @param {string} id
- * @return {undefined}
- */
- self.wait = function(id) {
-
- try {
- var options_sel = $('#options');
- var content_sel = options_sel.find('.content');
-
- // Remove the current item class
- content_sel.removeClass(id);
-
- // Hide the waiting items if all was received
- if(!content_sel.hasClass('microblog') && !content_sel.hasClass('mam')) {
- options_sel.find('.wait').hide();
- options_sel.find('.finish:first').removeClass('disabled');
- }
- } catch(e) {
- Console.error('Options.wait', e);
- }
-
- };
-
-
- /**
- * Sends the options to the XMPP server
- * @public
- * @return {undefined}
- */
- self.store = function() {
-
- try {
- // Get the values
- var sounds = DataStore.getDB(Connection.desktop_hash, 'options', 'sounds');
- var geolocation = DataStore.getDB(Connection.desktop_hash, 'options', 'geolocation');
- var showall = DataStore.getDB(Connection.desktop_hash, 'options', 'roster-showall');
- var noxhtmlimg = DataStore.getDB(Connection.desktop_hash, 'options', 'no-xhtml-images');
- var groupchatpresence = DataStore.getDB(Connection.desktop_hash, 'options', 'groupchatpresence');
- var integratemedias = DataStore.getDB(Connection.desktop_hash, 'options', 'integratemedias');
- var localarchives = DataStore.getDB(Connection.desktop_hash, 'options', 'localarchives');
- var status = DataStore.getDB(Connection.desktop_hash, 'options', 'presence-status');
-
- // Create an array to be looped
- var oType = ['sounds', 'geolocation', 'roster-showall', 'no-xhtml-images', 'groupchatpresence', 'integratemedias', 'localarchives', 'presence-status'];
- var oContent = [sounds, geolocation, showall, noxhtmlimg, groupchatpresence, integratemedias, localarchives, status];
-
- // New IQ
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- var query = iq.setQuery(NS_PRIVATE);
- var storage = query.appendChild(iq.buildNode('storage', {'xmlns': NS_OPTIONS}));
-
- // Loop the array
- for(var i in oType) {
- storage.appendChild(iq.buildNode('option', {'type': oType[i], 'xmlns': NS_OPTIONS}, oContent[i]));
- }
-
- con.send(iq, self.handleStore);
-
- Console.info('Storing options...');
- } catch(e) {
- Console.error('Options.store', e);
- }
-
- };
-
-
- /**
- * Handles the option storing
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleStore = function(iq) {
-
- try {
- if(!iq || (iq.getType() != 'result')) {
- Console.warn('Options not stored.');
- } else {
- Console.info('Options stored.');
- }
- } catch(e) {
- Console.error('Options.handleStore', e);
- }
-
- };
-
-
- /**
- * Saves the user options
- * @public
- * @return {boolean}
- */
- self.save = function() {
-
- try {
- // We apply the sounds
- var sounds = '0';
-
- if($('#sounds').filter(':checked').size()) {
- sounds = '1';
- }
-
- DataStore.setDB(Connection.desktop_hash, 'options', 'sounds', sounds);
-
- // We apply the geolocation
- if($('#geolocation').filter(':checked').size()) {
- DataStore.setDB(Connection.desktop_hash, 'options', 'geolocation', '1');
-
- // We geolocate the user on the go
- PEP.geolocate();
- } else {
- DataStore.setDB(Connection.desktop_hash, 'options', 'geolocation', '0');
-
- // We delete the geolocation informations
- PEP.sendPosition();
- DataStore.removeDB(Connection.desktop_hash, 'geolocation', 'now');
- }
-
- // We apply the roster show all
- if($('#showall').filter(':checked').size()) {
- DataStore.setDB(Connection.desktop_hash, 'options', 'roster-showall', '1');
- Interface.showAllBuddies('options');
- } else {
- DataStore.setDB(Connection.desktop_hash, 'options', 'roster-showall', '0');
- Interface.showOnlineBuddies('options');
- }
-
- // We apply the XHTML-IM images filter
- var noxhtmlimg = '1' ? $('#noxhtmlimg').filter(':checked').size() : '0';
- DataStore.setDB(Connection.desktop_hash, 'options', 'no-xhtml-images', noxhtmlimg);
-
- // We apply the groupchat presence messages configuration
- var groupchatpresence = '1' ? $('#groupchatpresence').filter(':checked').size() : '0';
- DataStore.setDB(Connection.desktop_hash, 'options', 'groupchatpresence', groupchatpresence);
-
- // We apply the media integration
- var integratemedias = '1' ? $('#integratemedias').filter(':checked').size() : '0';
- DataStore.setDB(Connection.desktop_hash, 'options', 'integratemedias', integratemedias);
-
- // We apply the local archiving
- var localarchives = '1' ? $('#localarchives').filter(':checked').size() : '0';
- DataStore.setDB(Connection.desktop_hash, 'options', 'localarchives', localarchives);
-
- // Flush local archives?
- if(localarchives === '0') {
- Message.flushLocalArchive();
- }
-
- // We apply the message archiving
- if(Features.enabledMAM()) {
- MAM.setConfig($('#archiving').val() || 'never');
- }
-
- // We apply the microblog configuration
- var persist = '1' ? $('#persist').filter(':checked').size() : '0';
- var maximum = $('#maxnotices').val();
-
- if(Features.enabledPEP() && (Features.enabledPubSub() || Features.enabledPubSubCN())) {
- Pubsub.setup('', NS_URN_MBLOG, persist, maximum, '', '', false);
- }
-
- // We send the options to the database
- self.store();
-
- // Close the options
- self.close();
- } catch(e) {
- Console.error('Options.save', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Handles the password changing
- * @public
- * @param {string} iq
- * @return {undefined}
- */
- self.handlePwdChange = function(iq) {
-
- try {
- // Remove the general wait item
- Interface.removeGeneralWait();
-
- // If no errors
- if(!Errors.handleReply(iq)) {
- Connection.clearLastSession();
- Connection.quit();
- Board.openThisInfo(1);
-
- Console.info('Password changed.');
- } else {
- Console.warn('Password not changed.');
- }
- } catch(e) {
- Console.error('Options.handlePwdChange', e);
- }
-
- };
-
-
- /**
- * Sends the new account password
- * @public
- * @return {boolean}
- */
- self.sendNewPassword = function() {
-
- /* REF: http://xmpp.org/extensions/xep-0077.html#usecases-changepw */
-
- try {
- var password0 = $('#options .old').val();
- var password1 = $('#options .new1').val();
- var password2 = $('#options .new2').val();
-
- if ((password1 == password2) && (password0 == Utils.getPassword())) {
- // We show the waiting image
- Interface.showGeneralWait();
-
- // We send the IQ
- var iq = new JSJaCIQ();
-
- iq.setTo(Utils.getServer());
- iq.setType('set');
-
- var iqQuery = iq.setQuery(NS_REGISTER);
-
- iqQuery.appendChild(iq.buildNode('username', {'xmlns': NS_REGISTER}, con.username));
- iqQuery.appendChild(iq.buildNode('password', {'xmlns': NS_REGISTER}, password1));
-
- con.send(iq, self.handlePwdChange);
-
- Console.info('Password change sent.');
- } else {
- $('.sub-ask-pass input').each(function() {
- var select = $(this);
-
- if(!select.val()) {
- $(document).oneTime(10, function() {
- select.addClass('please-complete').focus();
- });
- } else {
- select.removeClass('please-complete');
- }
- });
-
- if(password0 != Utils.getPassword()) {
- $(document).oneTime(10, function() {
- $('#options .old').addClass('please-complete').focus();
- });
- }
-
- if(password1 != password2) {
- $(document).oneTime(10, function() {
- $('#options .new1, #options .new2').addClass('please-complete').focus();
- });
- }
- }
- } catch(e) {
- Console.error('Options.sendNewPassword', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Handles the account deletion request
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleAccDeletion = function(iq) {
-
- try {
- // Remove the general wait item
- Interface.removeGeneralWait();
-
- // If no errors
- if(!Errors.handleReply(iq)) {
- Connection.clearLastSession();
- Talk.destroy();
- Board.openThisInfo(2);
- Connection.logout();
-
- Console.info('Account deleted.');
- } else {
- Console.warn('Account not deleted.');
- }
- } catch(e) {
- Console.error('Options.handleAccDeletion', e);
- }
-
- };
-
-
- /**
- * Purge the user's archives (MAM)
- * @public
- * @return {boolean}
- */
- self.purgeMyArchives = function() {
-
- try {
- var pwd_input_sel = $('#options .check-mam');
- var password = pwd_input_sel.val();
-
- if(password == Utils.getPassword()) {
- MAM.purgeArchives();
-
- // Clear archives in UI
- $('.page-engine-chan[data-type="chat"] .tools-clear').click();
-
- // Hide the tool
- pwd_input_sel.val('');
- $('#options .sub-ask-mam .sub-ask-close').click();
- } else {
- var selector = $('#options .check-mam');
-
- if(password != Utils.getPassword()) {
- $(document).oneTime(10, function() {
- selector.addClass('please-complete').focus();
- });
- } else {
- selector.removeClass('please-complete');
- }
- }
- } catch(e) {
- Console.error('Options.purgeMyArchives', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Purge the user's microblog items
- * @public
- * @return {boolean}
- */
- self.purgeMyMicroblog = function() {
-
- /* REF: http://xmpp.org/extensions/xep-0060.html#owner-purge */
-
- try {
- var pwd_input_sel = $('#options .check-empty');
- var password = pwd_input_sel.val();
-
- if(password == Utils.getPassword()) {
- // Send the IQ to remove the item (and get eventual error callback)
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- var pubsub = iq.appendNode('pubsub', {'xmlns': NS_PUBSUB_OWNER});
- pubsub.appendChild(iq.buildNode('purge', {'node': NS_URN_MBLOG, 'xmlns': NS_PUBSUB_OWNER}));
-
- con.send(iq, self.handleMicroblogPurge);
-
- // Hide the tool
- pwd_input_sel.val('');
- $('#options .sub-ask-empty .sub-ask-close').click();
-
- Console.info('Microblog purge sent.');
- } else {
- var selector = $('#options .check-empty');
-
- if(password != Utils.getPassword()) {
- $(document).oneTime(10, function() {
- selector.addClass('please-complete').focus();
- });
- } else {
- selector.removeClass('please-complete');
- }
- }
- } catch(e) {
- Console.error('Options.purgeMyMicroblog', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Handles the microblog purge
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleMicroblogPurge = function(iq) {
-
- try {
- // If no errors
- if(!Errors.handleReply(iq)) {
- // Remove the microblog items
- $('.one-update.update_' + hex_md5(Common.getXID())).remove();
-
- Console.info('Microblog purged.');
- } else {
- Console.warn('Microblog not purged.');
- }
- } catch(e) {
- Console.error('Options.handleMicroblogPurge', e);
- }
-
- };
-
-
- /**
- * Deletes the user's account
- * @public
- * @return {boolean}
- */
- self.deleteMyAccount = function() {
-
- /* REF: http://xmpp.org/extensions/xep-0077.html#usecases-cancel */
-
- try {
- var password = $('#options .check-password').val();
-
- if(password == Utils.getPassword()) {
- // We show the waiting image
- Interface.showGeneralWait();
-
- // We send the IQ
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- var iqQuery = iq.setQuery(NS_REGISTER);
- iqQuery.appendChild(iq.buildNode('remove', {'xmlns': NS_REGISTER}));
-
- con.send(iq, self.handleAccDeletion);
-
- Console.info('Delete account sent.');
- } else {
- var selector = $('#options .check-password');
-
- if(password != Utils.getPassword()) {
- $(document).oneTime(10, function() {
- selector.addClass('please-complete').focus();
- });
- } else {
- selector.removeClass('please-complete');
- }
- }
- } catch(e) {
- Console.error('Options.deleteMyAccount', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Loads the user options
- * @public
- * @return {undefined}
- */
- self.load = function() {
-
- try {
- // Process the good stuffs, depending of the server features
- var enabled_mam = Features.enabledMAM();
- var enabled_pubsub = Features.enabledPubSub();
- var enabled_pubsub_cn = Features.enabledPubSubCN();
- var enabled_pep = Features.enabledPEP();
- var sWait = $('#options .content');
-
- // Show the waiting items if necessary
- if(enabled_mam || (enabled_pep && (enabled_pubsub || enabled_pubsub_cn))) {
- $('#options .wait').show();
- $('#options .finish:first').addClass('disabled');
- }
-
- // We get the archiving configuration
- if(enabled_mam) {
- sWait.addClass('mam');
- MAM.getConfig();
- }
-
- // We get the microblog configuration
- if((enabled_pubsub || enabled_pubsub_cn) && enabled_pep) {
- sWait.addClass('microblog');
- Microblog.getConfig();
- }
-
- // We show the "privacy" form if something is visible into it
- if(enabled_mam || enabled_pep) {
- $('#options fieldset.privacy').show();
- }
-
- // We get the values of the forms for the sounds
- if(DataStore.getDB(Connection.desktop_hash, 'options', 'sounds') == '0') {
- $('#sounds').attr('checked', false);
- } else {
- $('#sounds').attr('checked', true);
- }
-
- // We get the values of the forms for the geolocation
- if(DataStore.getDB(Connection.desktop_hash, 'options', 'geolocation') == '1') {
- $('#geolocation').attr('checked', true);
- } else {
- $('#geolocation').attr('checked', false);
- }
-
- // We get the values of the forms for the roster show all
- if(DataStore.getDB(Connection.desktop_hash, 'options', 'roster-showall') == '1') {
- $('#showall').attr('checked', true);
- } else {
- $('#showall').attr('checked', false);
- }
-
- // We get the values of the forms for the XHTML-IM images filter
- if(DataStore.getDB(Connection.desktop_hash, 'options', 'no-xhtml-images') == '1') {
- $('#noxhtmlimg').attr('checked', true);
- } else {
- $('#noxhtmlimg').attr('checked', false);
- }
-
- // We get the values of the forms for the integratemedias
- if(DataStore.getDB(Connection.desktop_hash, 'options', 'integratemedias') == '0') {
- $('#integratemedias').attr('checked', false);
- } else {
- $('#integratemedias').attr('checked', true);
- }
-
- // We get the values of the forms for the groupchatpresence
- if(DataStore.getDB(Connection.desktop_hash, 'options', 'groupchatpresence') == '0') {
- $('#groupchatpresence').attr('checked', false);
- } else {
- $('#groupchatpresence').attr('checked', true);
- }
-
- // We get the values of the forms for the localarchives
- if(DataStore.getDB(Connection.desktop_hash, 'options', 'localarchives') == '0') {
- $('#localarchives').attr('checked', false);
- } else {
- $('#localarchives').attr('checked', true);
- }
- } catch(e) {
- Console.error('Options.load', e);
- }
-
- };
-
-
- /**
- * Plugin launcher
- * @public
- * @return {undefined}
- */
- self.instance = function() {
-
- try {
- // Click events
- $('#options .tab a').click(function() {
- // Yet active?
- if($(this).hasClass('tab-active'))
- return false;
-
- // Switch to the good tab
- var key = parseInt($(this).attr('data-key'));
-
- return self.switchTab(key);
- });
-
- $('#options .linked').click(function() {
- $('#options .sub-ask').hide();
- $('#options .forms').removeClass('in_background');
- });
-
- $('#options .xmpp-links').click(function() {
- Utils.xmppLinksHandler();
-
- return false;
- });
-
- $('#options .empty-archives').click(function() {
- var selector = '#options .sub-ask-mam';
-
- $(selector).show();
- $('#options .forms').addClass('in_background');
-
- $(document).oneTime(10, function() {
- $(selector + ' input').focus();
- });
-
- return false;
- });
-
- $('#options .empty-channel').click(function() {
- var selector = '#options .sub-ask-empty';
-
- $(selector).show();
- $('#options .forms').addClass('in_background');
-
- $(document).oneTime(10, function() {
- $(selector + ' input').focus();
- });
-
- return false;
- });
-
- $('#options .change-password').click(function() {
- var selector = '#options .sub-ask-pass';
-
- $(selector).show();
- $('#options .forms').addClass('in_background');
-
- $(document).oneTime(10, function() {
- $(selector + ' input:first').focus();
- });
-
- return false;
- });
-
- $('#options .delete-account').click(function() {
- var selector = '#options .sub-ask-delete';
-
- $(selector).show();
- $('#options .forms').addClass('in_background');
-
- $(document).oneTime(10, function() {
- $(selector + ' input').focus();
- });
-
- return false;
- });
-
- $('#options .sub-ask-pass .sub-ask-bottom').click(function() {
- return self.sendNewPassword();
- });
-
- $('#options .sub-ask-mam .sub-ask-bottom').click(function() {
- return self.purgeMyArchives();
- });
-
- $('#options .sub-ask-empty .sub-ask-bottom').click(function() {
- return self.purgeMyMicroblog();
- });
-
- $('#options .sub-ask-delete .sub-ask-bottom').click(function() {
- return self.deleteMyAccount();
- });
-
- $('#options .sub-ask-close').click(function() {
- $('#options .sub-ask').hide();
- $('#options .forms').removeClass('in_background');
-
- return false;
- });
-
- $('#options .bottom .finish').click(function() {
- if($(this).is('.save') && !$(this).hasClass('disabled')) {
- return self.save();
- }
-
- if($(this).is('.cancel')) {
- return self.close();
- }
-
- return false;
- });
-
- // The keyup events
- $('#options .sub-ask input').keyup(function(e) {
- if(e.keyCode == 13) {
- // Archives purge
- if($(this).is('.purge-archives')) {
- return self.purgeMyArchives();
- }
-
- // Microblog purge
- else if($(this).is('.purge-microblog')) {
- return self.purgeMyMicroblog();
- }
-
- // Password change
- else if($(this).is('.password-change')) {
- return self.sendNewPassword();
- }
-
- // Account deletion
- else if($(this).is('.delete-account')) {
- return self.deleteMyAccount();
- }
- }
- });
-
- // Load the options
- self.load();
- } catch(e) {
- Console.error('Options.instance', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/origin.js b/source/app/javascripts/origin.js
deleted file mode 100644
index c84b89d..0000000
--- a/source/app/javascripts/origin.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the origin JS script for Jappix
-
--------------------------------------------------
-
-License: dual-licensed under AGPL and MPLv2
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Origin = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Checks if the URL passed has the same origin than Jappix itself
- * @public
- * @param {string} url
- * @return {undefined}
- */
- self.isSame = function(url) {
-
- /* Source: http://stackoverflow.com/questions/9404793/check-if-same-origin-policy-applies */
-
- try {
- var loc = window.location,
- a = document.createElement('a');
-
- a.href = url;
-
- return (!a.hostname || (a.hostname == loc.hostname)) &&
- (!a.port || (a.port == loc.port)) &&
- (!a.protocol || (a.protocol == loc.protocol));
- } catch(e) {
- Console.error('Origin.isSame', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
-
-var JappixOrigin = Origin;
\ No newline at end of file
diff --git a/source/app/javascripts/pep.js b/source/app/javascripts/pep.js
deleted file mode 100644
index 432455f..0000000
--- a/source/app/javascripts/pep.js
+++ /dev/null
@@ -1,1413 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the PEP JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var PEP = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Generates display object
- * @private
- * @return {object}
- */
- self._generateDisplayObject = function() {
-
- var display_object = {
- 'pep_value': '',
- 'pep_text': '',
- 'style_value': '',
- 'style_text': '',
- 'display_text': '',
- 'final_link': '',
- 'final_uri': ''
- };
-
- try {
- // Nothing to do there
- } catch(e) {
- Console.error('PEP._generateDisplayObject', e);
- } finally {
- return display_object;
- }
-
- };
-
-
- /**
- * Abstracts mood and activity display helpers
- * @private
- * @param {object} node_sel
- * @param {function} icon_fn
- * @return {object}
- */
- self._abstractDisplayMoodActivity = function(node_sel, icon_fn) {
-
- var display_args = self._generateDisplayObject();
-
- try {
- if(node_sel) {
- display_args.pep_value = node_sel.find('value').text() || 'none';
- display_args.pep_text = node_sel.find('text').text();
-
- display_args.style_value = icon_fn(display_args.pep_value);
- display_args.style_text = display_args.pep_text ? display_args.pep_text : Common._e("unknown");
- } else {
- display_args.style_value = icon_fn('undefined');
- display_args.style_text = Common._e("unknown");
- }
-
- display_args.display_text = display_args.style_text;
- display_args.style_text = display_args.style_text.htmlEnc();
- } catch(e) {
- Console.error('PEP._abstractDisplayMoodActivity', e);
- } finally {
- return display_args;
- }
-
- };
-
-
- /**
- * Displays PEP mood
- * @private
- * @param {object} node_sel
- * @return {object}
- */
- self._displayMood = function(node_sel) {
-
- var mood_args = self._abstractDisplayMoodActivity(
- node_sel,
- self.moodIcon
- );
-
- try {
- // Nothing to do there
- } catch(e) {
- Console.error('PEP._displayMood', e);
- } finally {
- return mood_args;
- }
-
- };
-
-
- /**
- * Displays PEP activity
- * @private
- * @param {object} node_sel
- * @return {object}
- */
- self._displayActivity = function(node_sel) {
-
- var activity_args = self._abstractDisplayMoodActivity(
- node_sel,
- self.activityIcon
- );
-
- try {
- // Nothing to do there
- } catch(e) {
- Console.error('PEP._displayActivity', e);
- } finally {
- return activity_args;
- }
-
- };
-
-
- /**
- * Displays PEP tune
- * @private
- * @param {object} node_sel
- * @return {object}
- */
- self._displayTune = function(node_sel) {
-
- var tune_args = self._generateDisplayObject();
-
- try {
- tune_args.style_value = 'tune-note';
-
- if(node_sel) {
- // Parse the tune XML
- var tune_artist = node_sel.find('artist').text();
- var tune_title = node_sel.find('title').text();
- var tune_album = node_sel.find('album').text();
- var tune_uri = node_sel.find('uri').text();
-
- // Apply the good values
- if(!tune_artist && !tune_album && !tune_title) {
- tune_args.style_text = Common._e("unknown");
- tune_args.display_text = tune_args.style_text;
- } else {
- tune_args.final_uri = tune_uri ||
- 'http://grooveshark.com/search?q=' + encodeURIComponent(tune_artist + ' ' + tune_title + ' ' + tune_album);
-
- var final_artist = tune_artist || Common._e("unknown");
- var final_title = tune_title || Common._e("unknown");
- var final_album = tune_album || Common._e("unknown");
-
- tune_args.final_link = ' href="' + tune_args.final_uri + '" target="_blank"';
-
- // Generate the text to be displayed
- tune_args.display_text = final_artist + ' - ' + final_title + ' (' + final_album + ')';
- tune_args.style_text = '' + tune_args.display_text + ' ';
- }
- } else {
- tune_args.style_text = Common._e("unknown");
- tune_args.display_text = tune_args.style_text;
- }
- } catch(e) {
- Console.error('PEP._displayTune', e);
- } finally {
- return tune_args;
- }
-
- };
-
-
- /**
- * Displays PEP geolocation
- * @private
- * @param {object} node_sel
- * @return {object}
- */
- self._displayGeolocation = function(node_sel) {
-
- var geolocation_args = self._generateDisplayObject();
-
- try {
- geolocation_args.style_value = 'location-world';
-
- if(node_sel) {
- geolocation_args.geoloc_lat = node_sel.find('lat').text();
- geolocation_args.geoloc_lon = node_sel.find('lon').text();
- geolocation_args.geoloc_human = node_sel.find('human').text() ||
- Common._e("See his/her position on the globe");
- geolocation_args.geoloc_real = geolocation_args.geoloc_human;
-
- // Text to be displayed
- if(geolocation_args.geoloc_lat && geolocation_args.geoloc_lon) {
- geolocation_args.final_uri = 'http://maps.google.com/?q=' + Common.encodeQuotes(geolocation_args.geoloc_lat) + ',' + Common.encodeQuotes(geolocation_args.geoloc_lon);
- geolocation_args.final_link = ' href="' + geolocation_args.final_uri + '" target="_blank"';
-
- geolocation_args.style_text = '' +
- geolocation_args.geoloc_human.htmlEnc() +
- ' ';
- geolocation_args.display_text = geolocation_args.geoloc_real ||
- (geolocation_args.geoloc_lat + '; ' + geolocation_args.geoloc_lon);
- } else {
- geolocation_args.style_text = Common._e("unknown");
- geolocation_args.display_text = geolocation_args.style_text;
- }
- } else {
- geolocation_args.style_text = Common._e("unknown");
- geolocation_args.display_text = geolocation_args.style_text;
- }
- } catch(e) {
- Console.error('PEP._displayGeolocation', e);
- } finally {
- return geolocation_args;
- }
-
- };
-
-
- /**
- * Add foreign display object to DOM
- * @private
- * @param {string} xid
- * @param {string} hash
- * @param {string} type
- * @param {object} display_args
- * @return {undefined}
- */
- self._appendForeignDisplayObject = function(xid, hash, type, display_args) {
-
- try {
- var this_buddy = '#roster .buddy[data-xid="' + escape(xid) + '"]';
-
- if(Common.exists(this_buddy)) {
- $(this_buddy + ' .bi-' + type).replaceWith(
- '' + display_args.style_text + '
'
- );
- }
-
- // Apply the text to the buddy chat
- if(Common.exists('#' + hash)) {
- // Selector
- var bc_pep = $('#' + hash + ' .bc-pep');
-
- // We remove the old PEP item
- bc_pep.find('a.bi-' + type).remove();
-
- // If the new PEP item is not null, create a new one
- if(display_args.style_text != Common._e("unknown")) {
- bc_pep.prepend(
- ' '
- );
- }
-
- // Process the new status position
- Presence.adaptChat(hash);
- }
- } catch(e) {
- Console.error('PEP._appendOwnDisplayObject', e);
- }
-
- };
-
-
- /**
- * Add own display object to DOM
- * @private
- * @param {string} type
- * @param {object} display_args
- * @return {undefined}
- */
- self._appendOwnDisplayObject = function(type, display_args) {
-
- try {
- // Change the icon/value of the target element
- if((type == 'mood') || (type == 'activity')) {
- // Change the input value
- var display_value = '';
- var display_attribute = display_args.pep_value;
-
- // Must apply default values?
- if(display_args.pep_value == 'none') {
- if(type == 'mood') {
- display_attribute = 'happy';
- } else {
- display_attribute = 'exercising';
- }
- }
-
- // No text?
- if(display_args.display_text != Common._e("unknown")) {
- display_value = display_args.display_text;
- }
-
- // Store this user event in our database
- DataStore.setDB(Connection.desktop_hash, type + '-value', 1, display_attribute);
- DataStore.setDB(Connection.desktop_hash, type + '-text', 1, display_value);
-
- // Apply this PEP event
- $('#my-infos .f-' + type + ' a.picker').attr('data-value', display_attribute);
- $('#my-infos .f-' + type + ' input').val(display_value);
- $('#my-infos .f-' + type + ' input').placeholder();
- } else if((type == 'tune') || (type == 'geoloc')) {
- // Reset the values
- $('#my-infos .f-others a.' + type).remove();
-
- // Not empty?
- if(display_args.display_text != Common._e("unknown")) {
- // Specific stuffs
- var href, title, icon_class;
-
- if(type == 'tune') {
- href = display_args.final_uri;
- title = display_args.display_text;
- icon_class = 'tune-note';
- } else {
- href = 'http://maps.google.com/?q=' + Common.encodeQuotes(display_args.geoloc_lat) + ',' + Common.encodeQuotes(display_args.geoloc_lon);
- title = Common._e("Where are you?") + ' (' + display_args.display_text + ')';
- icon_class = 'location-world';
- }
-
- // Must create the container?
- if(!Common.exists('#my-infos .f-others')) {
- $('#my-infos .content').append('
');
- }
-
- // Create the element
- $('#my-infos .f-others').prepend(
- '' +
- ' ' +
- ' '
- );
- }
-
- // Empty?
- else if(!Common.exists('#my-infos .f-others a.icon')) {
- $('#my-infos .f-others').remove();
- }
-
- // Process the roster height again
- Roster.adapt();
- }
- } catch(e) {
- Console.error('PEP._appendOwnDisplayObject', e);
- }
-
- };
-
-
- /**
- * Generates storage data
- * @private
- * @param {object} args
- * @return {string}
- */
- self._generateStore = function(args) {
-
- var storage_data = '';
-
- try {
- var cur_value;
-
- for(var cur_arg in args) {
- storage_data += '<' + cur_arg + '>' +
- (args[cur_arg] || '').htmlEnc() +
- '' + cur_arg + '>';
- }
- } catch(e) {
- Console.error('PEP._generateStore', e);
- } finally {
- return storage_data;
- }
-
- };
-
-
- /**
- * Proceeds mood picker event callback
- * @private
- * @param {object} picker_sel
- * @return {boolean}
- */
- self._callbackMoodPicker = function(picker_sel) {
-
- try {
- // Initialize some vars
- var path = '#my-infos .f-mood div.bubble';
- var mood_val = picker_sel.attr('data-value');
-
- var moods_obj = {
- 'crazy': Common._e("Crazy"),
- 'excited': Common._e("Excited"),
- 'playful': Common._e("Playful"),
- 'happy': Common._e("Happy"),
- 'shocked': Common._e("Shocked"),
- 'hot': Common._e("Hot"),
- 'sad': Common._e("Sad"),
- 'amorous': Common._e("Amorous"),
- 'confident': Common._e("Confident")
- };
-
- // Yet displayed?
- var can_append = !Common.exists(path);
-
- // Add this bubble!
- Bubble.show(path);
-
- if(!can_append) {
- return false;
- }
-
- // Generate the HTML code
- var html = '';
-
- for(var cur_mood_name in moods_obj) {
- // Yet in use: no need to display it!
- if(cur_mood_name == mood_val) {
- continue;
- }
-
- html += '
';
- }
-
- html += '
';
-
- // Append the HTML code
- $('#my-infos .f-mood').append(html);
-
- // Click event
- $(path + ' a').click(function() {
- // Update the mood marker
- picker_sel.attr(
- 'data-value',
- $(this).attr('data-value')
- );
-
- // Close the bubble
- Bubble.close();
-
- // Focus on the status input
- $(document).oneTime(10, function() {
- $('#mood-text').focus();
- });
-
- return;
- });
- } catch(e) {
- Console.error('PEP._callbackMoodPicker', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Proceeds activity picker event callback
- * @private
- * @param {object} picker_sel
- * @return {boolean}
- */
- self._callbackActivityPicker = function(picker_sel) {
-
- try {
- // Initialize some vars
- var path = '#my-infos .f-activity div.bubble';
- var activity_val = picker_sel.attr('data-value');
-
- var activities_obj = {
- 'doing_chores': Common._e("Chores"),
- 'drinking': Common._e("Drinking"),
- 'eating': Common._e("Eating"),
- 'exercising': Common._e("Exercising"),
- 'grooming': Common._e("Grooming"),
- 'having_appointment': Common._e("Appointment"),
- 'inactive': Common._e("Inactive"),
- 'relaxing': Common._e("Relaxing"),
- 'talking': Common._e("Talking"),
- 'traveling': Common._e("Traveling"),
- 'working': Common._e("Working")
- };
-
- var can_append = !Common.exists(path);
-
- // Add this bubble!
- Bubble.show(path);
-
- if(!can_append) {
- return false;
- }
-
- // Generate the HTML code
- var html = '';
-
- for(var cur_activity_name in activities_obj) {
- // Yet in use: no need to display it!
- if(cur_activity_name == activity_val) {
- continue;
- }
-
- html += '
';
- }
-
- html += '
';
-
- // Append the HTML code
- $('#my-infos .f-activity').append(html);
-
- // Click event
- $(path + ' a').click(function() {
- // Update the activity marker
- picker_sel.attr('data-value', $(this).attr('data-value'));
-
- // Close the bubble
- Bubble.close();
-
- // Focus on the status input
- $(document).oneTime(10, function() {
- $('#activity-text').focus();
- });
-
- return false;
- });
- } catch(e) {
- Console.error('PEP._callbackActivityPicker', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Attaches common text events
- * @private
- * @param {string} name
- * @param {object} element_text_sel
- * @param {function} send_fn
- * @return {undefined}
- */
- self._eventsCommonText = function(name, element_text_sel, send_fn) {
-
- try {
- // Submit events
- element_text_sel.placeholder();
- element_text_sel.keyup(function(e) {
- if(e.keyCode == 13) {
- $(this).blur();
-
- return false;
- }
- });
-
- // Input blur handler
- element_text_sel.blur(function() {
- // Read the parameters
- var value = $('#my-infos .f-' + name + ' a.picker').attr('data-value');
- var text = $(this).val();
-
- // Must send?
- if((value != DataStore.getDB(Connection.desktop_hash, name + '-value', 1)) || (text != DataStore.getDB(Connection.desktop_hash, name + '-text', 1))) {
- // Update the local stored values
- DataStore.setDB(Connection.desktop_hash, name + '-value', 1, value);
- DataStore.setDB(Connection.desktop_hash, name + '-text', 1, text);
-
- // Send it!
- send_fn(value, undefined, text);
- }
- });
-
- // Input focus handler
- element_text_sel.focus(function() {
- Bubble.close();
- });
- } catch(e) {
- Console.error('PEP._eventsCommonText', e);
- }
-
- };
-
-
- /**
- * Attaches mood text events
- * @private
- * @param {object} mood_text_sel
- * @return {undefined}
- */
- self._eventsMoodText = function(mood_text_sel) {
-
- try {
- self._eventsCommonText(
- 'mood',
- mood_text_sel,
- self.sendMood
- );
- } catch(e) {
- Console.error('PEP._eventsMoodText', e);
- }
-
- };
-
-
- /**
- * Attaches activity text events
- * @private
- * @param {object} activity_text_sel
- * @return {undefined}
- */
- self._eventsActivityText = function(activity_text_sel) {
-
- try {
- self._eventsCommonText(
- 'activity',
- activity_text_sel,
- self.sendActivity
- );
- } catch(e) {
- Console.error('PEP._eventsActivityText', e);
- }
-
- };
-
-
- /**
- * Stores the PEP items
- * @public
- * @param {string} xid
- * @param {string} type
- * @param {string} value1
- * @param {string} value2
- * @param {string} value3
- * @param {string} value4
- * @return {undefined}
- */
- self.store = function(xid, type, value1, value2, value3, value4) {
-
- try {
- if(value1 || value2 || value3 || value4) {
- var xml = '';
-
- // Generate the subnodes
- switch(type) {
- case 'tune':
- xml += self._generateStore({
- 'artist': value1,
- 'title': value2,
- 'album': value3,
- 'uri': value4
- });
- break;
-
- case 'geoloc':
- xml += self._generateStore({
- 'lat': value1,
- 'lon': value2,
- 'human': value3
- });
- break;
-
- default:
- xml += self._generateStore({
- 'value': value1,
- 'text': value2
- });
- }
-
- // End the XML node
- xml += ' ';
-
- // Update the input with the new value
- DataStore.setDB(Connection.desktop_hash, 'pep-' + type, xid, xml);
- } else {
- DataStore.removeDB(Connection.desktop_hash, 'pep-' + type, xid);
- }
-
- // Display the PEP event
- self.display(xid, type);
- } catch(e) {
- Console.error('PEP.store', e);
- }
-
- };
-
-
- /**
- * Displays a PEP item
- * @public
- * @param {string} xid
- * @param {string} type
- * @return {undefined}
- */
- self.display = function(xid, type) {
-
- try {
- // Read the target input for values
- var value = $(Common.XMLFromString(
- DataStore.getDB(Connection.desktop_hash, 'pep-' + type, xid))
- );
-
- // If the PEP element exists
- if(type) {
- // Get the user hash
- var hash = hex_md5(xid);
- var display_args = {};
-
- // Parse the XML for mood and activity
- switch(type) {
- case 'mood':
- display_args = self._displayMood(value);
- break;
-
- case 'activity':
- display_args = self._displayActivity(value);
- break;
-
- case 'tune':
- display_args = self._displayTune(value);
- break;
-
- case 'geoloc':
- display_args = self._displayGeolocation(value);
- break;
- }
-
- // Append foreign PEP user values
- self._appendForeignDisplayObject(xid, hash, type, display_args);
-
- // PEP values of the logged in user?
- if(xid == Common.getXID()) {
- self._appendOwnDisplayObject(type, display_args);
- }
- }
- } catch(e) {
- Console.error('PEP.display', e);
- }
-
- };
-
-
- /**
- * Changes the mood icon
- * @public
- * @param {string} value
- * @return {string}
- */
- self.moodIcon = function(value) {
-
- try {
- // The main var
- var icon;
-
- // Switch the values
- switch(value) {
- case 'angry':
- case 'cranky':
- case 'hot':
- case 'invincible':
- case 'mean':
- case 'restless':
- case 'serious':
- case 'strong':
- icon = 'mood-one';
- break;
-
- case 'contemplative':
- case 'happy':
- case 'playful':
- icon = 'mood-two';
- break;
-
- case 'aroused':
- case 'envious':
- case 'excited':
- case 'interested':
- case 'lucky':
- case 'proud':
- case 'relieved':
- case 'satisfied':
- case 'shy':
- icon = 'mood-three';
- break;
-
- case 'calm':
- case 'cautious':
- case 'contented':
- case 'creative':
- case 'humbled':
- case 'lonely':
- case 'undefined':
- case 'none':
- icon = 'mood-four';
- break;
-
- case 'afraid':
- case 'amazed':
- case 'confused':
- case 'dismayed':
- case 'hungry':
- case 'in_awe':
- case 'indignant':
- case 'jealous':
- case 'lost':
- case 'offended':
- case 'outraged':
- case 'shocked':
- case 'surprised':
- case 'embarrassed':
- case 'impressed':
- icon = 'mood-five';
- break;
-
- case 'crazy':
- case 'distracted':
- case 'neutral':
- case 'relaxed':
- case 'thirsty':
- icon = 'mood-six';
- break;
-
- case 'amorous':
- case 'curious':
- case 'in_love':
- case 'nervous':
- case 'sarcastic':
- icon = 'mood-eight';
- break;
-
- case 'brave':
- case 'confident':
- case 'hopeful':
- case 'grateful':
- case 'spontaneous':
- case 'thankful':
- icon = 'mood-nine';
- break;
-
- default:
- icon = 'mood-seven';
- break;
- }
-
- // Return the good icon name
- return icon;
- } catch(e) {
- Console.error('PEP.moodIcon', e);
- }
-
- };
-
-
- /**
- * Changes the activity icon
- * @public
- * @param {string} value
- * @return {string}
- */
- self.activityIcon = function(value) {
-
- try {
- // The main var
- var icon;
-
- // Switch the values
- switch(value) {
- case 'doing_chores':
- icon = 'activity-doing_chores';
- break;
-
- case 'drinking':
- icon = 'activity-drinking';
- break;
-
- case 'eating':
- icon = 'activity-eating';
- break;
-
- case 'grooming':
- icon = 'activity-grooming';
- break;
-
- case 'having_appointment':
- icon = 'activity-having_appointment';
- break;
-
- case 'inactive':
- icon = 'activity-inactive';
- break;
-
- case 'relaxing':
- icon = 'activity-relaxing';
- break;
-
- case 'talking':
- icon = 'activity-talking';
- break;
-
- case 'traveling':
- icon = 'activity-traveling';
- break;
-
- case 'working':
- icon = 'activity-working';
- break;
- default:
- icon = 'activity-exercising';
- break;
- }
-
- // Return the good icon name
- return icon;
- } catch(e) {
- Console.error('PEP.activityIcon', e);
- }
-
- };
-
-
- /**
- * Sends the user's mood
- * @public
- * @param {string} value
- * @param {string} text
- * @return {undefined}
- */
- self.sendMood = function(value, _, text) {
-
- /* REF: http://xmpp.org/extensions/xep-0107.html */
-
- try {
- // We propagate the mood on the xmpp network
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- // We create the XML document
- var pubsub = iq.appendNode('pubsub', {'xmlns': NS_PUBSUB});
- var publish = pubsub.appendChild(iq.buildNode('publish', {'node': NS_MOOD, 'xmlns': NS_PUBSUB}));
- var item = publish.appendChild(iq.buildNode('item', {'xmlns': NS_PUBSUB}));
- var mood = item.appendChild(iq.buildNode('mood', {'xmlns': NS_MOOD}));
-
- if(value != 'none') {
- mood.appendChild(iq.buildNode(value, {'xmlns': NS_MOOD}));
- mood.appendChild(iq.buildNode('text', {'xmlns': NS_MOOD}, text));
- }
-
- // And finally we send the mood that is set
- con.send(iq);
-
- Console.info('New mood sent: ' + value + ' (' + text + ')');
- } catch(e) {
- Console.error('PEP.sendMood', e);
- }
-
- };
-
-
- /**
- * Sends the user's activity
- * @public
- * @param {string} main
- * @param {string} sub
- * @param {string} text
- * @return {undefined}
- */
- self.sendActivity = function(main, sub, text) {
-
- try {
- // We propagate the mood on the xmpp network
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- // We create the XML document
- var pubsub = iq.appendNode('pubsub', {
- 'xmlns': NS_PUBSUB
- });
-
- var publish = pubsub.appendChild(iq.buildNode('publish', {
- 'node': NS_ACTIVITY,
- 'xmlns': NS_PUBSUB
- }));
-
- var item = publish.appendChild(iq.buildNode('item', {
- 'xmlns': NS_PUBSUB
- }));
-
- var activity = item.appendChild(iq.buildNode('activity', {
- 'xmlns': NS_ACTIVITY
- }));
-
- if(main != 'none') {
- var mainType = activity.appendChild(iq.buildNode(main, {
- 'xmlns': NS_ACTIVITY
- }));
-
- // Child nodes
- if(sub) {
- mainType.appendChild(iq.buildNode(sub, {
- 'xmlns': NS_ACTIVITY
- }));
- }
-
- if(text) {
- activity.appendChild(iq.buildNode('text', {
- 'xmlns': NS_ACTIVITY
- }, text));
- }
- }
-
- // And finally we send the mood that is set
- con.send(iq);
-
- Console.info('New activity sent: ' + main + ' (' + text + ')');
- } catch(e) {
- Console.error('PEP.sendActivity', e);
- }
-
- };
-
-
- /**
- * Sends the user's geographic position
- * @public
- * @param {string} lat
- * @param {string} lon
- * @param {string} vAlt
- * @param {string} country
- * @param {string} countrycode
- * @param {string} region
- * @param {string} postalcode
- * @param {string} locality
- * @param {string} street
- * @param {string} building
- * @param {string} text
- * @param {string} uri
- * @return {undefined}
- */
- self.sendPosition = function(lat, lon, alt, country, countrycode, region, postalcode, locality, street, building, text, uri) {
-
- /* REF: http://xmpp.org/extensions/xep-0080.html */
-
- try {
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- // Create XML nodes
- var pubsub = iq.appendNode('pubsub', {
- 'xmlns': NS_PUBSUB
- });
-
- var publish = pubsub.appendChild(iq.buildNode('publish', {
- 'node': NS_GEOLOC,
- 'xmlns': NS_PUBSUB
- }));
-
- var item = publish.appendChild(iq.buildNode('item', {
- 'xmlns': NS_PUBSUB
- }));
-
- var geoloc = item.appendChild(iq.buildNode('geoloc', {
- 'xmlns': NS_GEOLOC
- }));
-
- // Position object
- var position_obj = {
- 'lat': lat,
- 'lon': lon,
- 'alt': alt,
- 'country': country,
- 'countrycode': countrycode,
- 'region': region,
- 'postalcode': postalcode,
- 'locality': locality,
- 'street': street,
- 'building': building,
- 'text': text,
- 'uri': uri,
- 'timestamp': DateUtils.getXMPPTime('utc'),
- 'tzo': DateUtils.getTZO()
- };
-
- var cur_position_val;
-
- for(var cur_position_type in position_obj) {
- cur_position_val = position_obj[cur_position_type];
-
- if(cur_position_val) {
- geoloc.appendChild(
- iq.buildNode(cur_position_type, {
- 'xmlns': NS_GEOLOC
- }, cur_position_val)
- );
- }
- }
-
- // And finally we send the XML
- con.send(iq);
-
- // For logger
- if(lat && lon) {
- Console.info('Geolocated.');
- } else {
- Console.warn('Not geolocated.');
- }
- } catch(e) {
- Console.error('PEP.sendPosition', e);
- }
-
- };
-
-
- /**
- * Parses the user's geographic position
- * @public
- * @param {string} data
- * @return {object}
- */
- self.parsePosition = function(data) {
-
- try {
- var result = $(data).find('result:first');
-
- // Get latitude and longitude
- var geometry_sel = result.find('geometry:first location:first');
-
- var lat = geometry_sel.find('lat').text();
- var lng = geometry_sel.find('lng').text();
-
- var addr_comp_sel = result.find('address_component');
-
- var array = [
- lat,
- lng,
- addr_comp_sel.filter(':has(type:contains("country")):first').find('long_name').text(),
- addr_comp_sel.filter(':has(type:contains("country")):first').find('short_name').text(),
- addr_comp_sel.filter(':has(type:contains("administrative_area_level_1")):first').find('long_name').text(),
- addr_comp_sel.filter(':has(type:contains("postal_code")):first').find('long_name').text(),
- addr_comp_sel.filter(':has(type:contains("locality")):first').find('long_name').text(),
- addr_comp_sel.filter(':has(type:contains("route")):first').find('long_name').text(),
- addr_comp_sel.filter(':has(type:contains("street_number")):first').find('long_name').text(),
- result.find('formatted_address:first').text(),
- 'http://maps.google.com/?q=' + Common.encodeQuotes(lat) + ',' + Common.encodeQuotes(lng)
- ];
-
- return array;
- } catch(e) {
- Console.error('PEP.parsePosition', e);
- }
-
- };
-
-
- /**
- * Converts a position into an human-readable one
- * @public
- * @param {string} locality
- * @param {string} region
- * @param {string} country
- * @return {string}
- */
- self.humanPosition = function(locality, region, country) {
-
- var human_value = '';
-
- try {
- if(locality) {
- // Any locality
- human_value += locality;
-
- if(region) {
- human_value += ', ' + region;
- }
-
- if(country) {
- human_value += ', ' + country;
- }
- } else if(region) {
- // Any region
- human_value += region;
-
- if(country) {
- human_value += ', ' + country;
- }
- } else if(country) {
- // Any country
- human_value += country;
- }
- } catch(e) {
- Console.error('PEP.humanPosition', e);
- } finally {
- return human_value;
- }
-
- };
-
-
- /**
- * Gets the user's geographic position
- * @public
- * @param {object} position
- * @return {undefined}
- */
- self.getPosition = function(position) {
-
- try {
- // Convert integers to strings
- var lat = '' + position.coords.latitude;
- var lon = '' + position.coords.longitude;
- var alt = '' + position.coords.altitude;
-
- // Get full position (from Google Maps API)
- $.get('./server/geolocation.php', {
- latitude: lat,
- longitude: lon,
- language: XML_LANG
- }, function(data) {
- // Still connected?
- if(Common.isConnected()) {
- var results = self.parsePosition(data);
-
- self.sendPosition(
- (Utils.isNumber(lat) ? lat : null),
- (Utils.isNumber(lon) ? lon : null),
- (Utils.isNumber(alt) ? alt : null),
- results[2],
- results[3],
- results[4],
- results[5],
- results[6],
- results[7],
- results[8],
- results[9],
- results[10]
- );
-
- // Store data
- DataStore.setDB(Connection.desktop_hash, 'geolocation', 'now', Common.xmlToString(data));
-
- Console.log('Position details got from Google Maps API.');
- }
- });
-
- Console.log('Position got: latitude > ' + lat + ' / longitude > ' + lon + ' / altitude > ' + alt);
- } catch(e) {
- Console.error('PEP.getPosition', e);
- }
-
- };
-
-
- /**
- * Geolocates the user
- * @public
- * @return {undefined}
- */
- self.geolocate = function() {
-
- try {
- // Don't fire it until options & features are not retrieved!
- if(!DataStore.getDB(Connection.desktop_hash, 'options', 'geolocation') ||
- (DataStore.getDB(Connection.desktop_hash, 'options', 'geolocation') == '0') ||
- !Features.enabledPEP()) {
- return;
- }
-
- // We publish the user location if allowed
- if(navigator.geolocation) {
- // Wait a bit... (to fix a bug)
- $('#my-infos').stopTime().oneTime('1s', function() {
- navigator.geolocation.getCurrentPosition(self.getPosition);
- });
-
- Console.info('Geolocating...');
- } else {
- Console.error('Not geolocated: browser does not support it.');
- }
- } catch(e) {
- Console.error('PEP.geolocate', e);
- }
-
- };
-
-
- /**
- * Gets the user's geolocation to check it exists
- * @public
- * @return {undefined}
- */
- self.getInitGeoloc = function() {
-
- try {
- var iq = new JSJaCIQ();
- iq.setType('get');
-
- var pubsub = iq.appendNode('pubsub', {
- 'xmlns': NS_PUBSUB
- });
-
- var ps_items = pubsub.appendChild(iq.buildNode('items', {
- 'node': NS_GEOLOC,
- 'xmlns': NS_PUBSUB
- }));
-
- ps_items.setAttribute('max_items', '0');
-
- con.send(iq, self.handleInitGeoloc);
- } catch(e) {
- Console.error('PEP.getInitGeoloc', e);
- }
-
- };
-
-
- /**
- * Handles the user's geolocation to create note in case of error
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleInitGeoloc = function(iq) {
-
- try {
- // Any error?
- if((iq.getType() == 'error') && $(iq.getNode()).find('item-not-found').size()) {
- // The node may not exist, create it!
- Pubsub.setup('', NS_GEOLOC, '1', '1', '', '', true);
-
- Console.warn('Error while getting geoloc, trying to reconfigure the PubSub node!');
- }
- } catch(e) {
- Console.error('PEP.handleInitGeoloc', e);
- }
-
- };
-
-
- /**
- * Displays all the supported PEP events for a given XID
- * @public
- * @return {undefined}
- */
- self.displayAll = function() {
-
- try {
- self.display(xid, 'mood');
- self.display(xid, 'activity');
- self.display(xid, 'tune');
- self.display(xid, 'geoloc');
- } catch(e) {
- Console.error('PEP.displayAll', e);
- }
-
- };
-
-
- /**
- * Plugin launcher
- * @public
- * @return {undefined}
- */
- self.instance = function() {
-
- try {
- // Apply empty values to the PEP database
- DataStore.setDB(Connection.desktop_hash, 'mood-value', 1, '');
- DataStore.setDB(Connection.desktop_hash, 'mood-text', 1, '');
- DataStore.setDB(Connection.desktop_hash, 'activity-value', 1, '');
- DataStore.setDB(Connection.desktop_hash, 'activity-text', 1, '');
-
- // Click event for user mood
- $('#my-infos .f-mood a.picker').click(function() {
- return PEP._callbackMoodPicker(
- $(this)
- );
- });
-
- // Click event for user activity
- $('#my-infos .f-activity a.picker').click(function() {
- return PEP._callbackActivityPicker(
- $(this)
- );
- });
-
- // Attach events
- self._eventsMoodText(
- $('#mood-text')
- );
-
- self._eventsActivityText(
- $('#activity-text')
- );
- } catch(e) {
- Console.error('PEP.instance', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/popup.js b/source/app/javascripts/popup.js
deleted file mode 100644
index f3825fd..0000000
--- a/source/app/javascripts/popup.js
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the popup JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Popup = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Creates a popup code
- * @public
- * @param {string} id
- * @param {string} content
- * @return {boolean}
- */
- self.create = function(id, content) {
-
- try {
- // Popup exists?
- if(Common.exists('#' + id)) {
- return false;
- }
-
- // Popop on top of another one?
- var top_of = Common.exists('div.lock:has(div.popup)');
-
- // Append the popup code
- $('body').append(
- '' +
- '' +
- '
'
- );
-
- // Avoids darker popup background (if on top of another popup)
- if(top_of) {
- $('#' + id).css('background', 'transparent');
- }
-
- // Attach popup events
- self.instance(id);
-
- return true;
- } catch(e) {
- Console.error('Popup.create', e);
- }
-
- };
-
-
- /**
- * Destroys a popup code
- * @public
- * @param {string} id
- * @return {undefined}
- */
- self.destroy = function(id) {
-
- try {
- // Stop the popup timers
- $('#' + id + ' *').stopTime();
-
- // Remove the popup
- $('#' + id).remove();
-
- // Manage input focus
- Interface.inputFocus();
- } catch(e) {
- Console.error('Popup.destroy', e);
- }
-
- };
-
-
- /**
- * Attaches popup events
- * @public
- * @param {string} id
- * @return {undefined}
- */
- self.instance = function(id) {
-
- try {
- // Click events
- $('#' + id).click(function(evt) {
- // Click on lock background?
- if($(evt.target).is('.lock:not(.unavoidable)')) {
- // Destroy the popup
- self.destroy(id);
-
- return false;
- }
- });
- } catch(e) {
- Console.error('Popup.instance', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/presence.js b/source/app/javascripts/presence.js
deleted file mode 100644
index c86ded1..0000000
--- a/source/app/javascripts/presence.js
+++ /dev/null
@@ -1,1946 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the presence JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Presence = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /* Variables */
- self.first_sent = false;
- self.auto_idle = false;
-
-
- /**
- * Handles groupchat presence
- * @private
- * @param {string} from
- * @param {string} xid
- * @param {string} hash
- * @param {string} type
- * @param {string} show
- * @param {string} status
- * @param {string} xid_hash
- * @param {string} resource
- * @param {object} node_sel
- * @param {object} presence
- * @param {number} priority
- * @param {boolean} has_photo
- * @param {string} checksum
- * @param {string} caps
- * @return {undefined}
- */
- self._handleGroupchat = function(from, xid, hash, type, show, status, xid_hash, resource, node_sel, presence, priority, has_photo, checksum, caps) {
-
- try {
- var resources_obj, xml;
-
- var x_muc = node_sel.find('x[xmlns="' + NS_MUC_USER + '"]:first');
- var item_sel = x_muc.find('item');
-
- var affiliation = item_sel.attr('affiliation');
- var role = item_sel.attr('role');
- var reason = item_sel.find('reason').text();
- var iXID = item_sel.attr('jid');
- var iNick = item_sel.attr('nick');
-
- var nick = resource;
- var message_time = DateUtils.getCompleteTime();
- var not_initial = !Common.exists('#' + xid_hash + '[data-initial="true"]');
-
- // Read the status code
- var status_code = [];
-
- x_muc.find('status').each(function() {
- status_code.push(parseInt($(this).attr('code')));
- });
-
- if(type && (type == 'unavailable')) {
- // User quitting
- self.displayMUC(
- from,
- xid_hash,
- hash,
- type,
- show,
- status,
- affiliation,
- role,
- reason,
- status_code,
- iXID,
- iNick,
- message_time,
- nick,
- not_initial
- );
-
- DataStore.removeDB(Connection.desktop_hash, 'presence-stanza', from);
- resources_obj = self.removeResource(xid, resource);
- } else {
- // User joining
-
- // Fixes M-Link first presence bug (missing ID!)
- if(nick == Name.getMUCNick(xid_hash) &&
- presence.getID() === null &&
- !Common.exists('#page-engine #' + xid_hash + ' .list .' + hash)) {
- Groupchat.handleMUC(presence);
-
- Console.warn('Passed M-Link MUC first presence handling.');
- } else {
- self.displayMUC(
- from,
- xid_hash,
- hash,
- type,
- show,
- status,
- affiliation,
- role,
- reason,
- status_code,
- iXID,
- iNick,
- message_time,
- nick,
- not_initial
- );
-
- xml = '' +
- '' + priority.htmlEnc() + ' ' +
- '' + show.htmlEnc() + ' ' +
- '' + type.htmlEnc() + ' ' +
- '' + status.htmlEnc() + ' ' +
- '' + has_photo.htmlEnc() + ' ' +
- '' + checksum.htmlEnc() + ' ' +
- '' + caps.htmlEnc() + ' ' +
- ' ';
-
- DataStore.setDB(Connection.desktop_hash, 'presence-stanza', from, xml);
- resources_obj = self.addResource(xid, resource);
- }
- }
-
- // Manage the presence
- self.processPriority(from, resource, resources_obj);
- self.funnel(from, hash);
- } catch(e) {
- Console.error('Groupchat._handleGroupchat', e);
- }
-
- };
-
-
- /**
- * Handles user presence
- * @private
- * @param {string} from
- * @param {string} xid
- * @param {string} type
- * @param {string} show
- * @param {string} status
- * @param {string} xid_hash
- * @param {string} resource
- * @param {object} node_sel
- * @param {number} priority
- * @param {boolean} has_photo
- * @param {string} checksum
- * @param {string} caps
- * @return {undefined}
- */
- self._handleUser = function(from, xid, type, show, status, xid_hash, resource, node_sel, priority, has_photo, checksum, caps) {
-
- try {
- var resources_obj, xml;
-
- // Subscribed/Unsubscribed stanzas
- if((type == 'subscribed') || (type == 'unsubscribed')) {
- return;
- }
-
- // Subscribe stanza
- else if(type == 'subscribe') {
- // This is a buddy we can safely authorize, because we added him to our roster
- if(Common.exists('#roster .buddy[data-xid="' + escape(xid) + '"]')) {
- self.acceptSubscribe(xid);
- }
-
- // We do not know this entity, we'd be better ask the user
- else {
- // Get the nickname
- var nickname = node_sel.find('nick[xmlns="' + NS_NICK + '"]:first').text();
-
- // New notification
- Notification.create('subscribe', xid, [xid, nickname], status);
- }
- }
-
- // Unsubscribe stanza
- else if(type == 'unsubscribe') {
- Roster.send(xid, 'remove');
- }
-
- // Other stanzas
- else {
- // Unavailable/error presence
- if(type == 'unavailable') {
- DataStore.removeDB(Connection.desktop_hash, 'presence-stanza', from);
- resources_obj = self.removeResource(xid, resource);
- } else {
- xml = '' +
- '' + priority.htmlEnc() + ' ' +
- '' + show.htmlEnc() + ' ' +
- '' + type.htmlEnc() + ' ' +
- '' + status.htmlEnc() + ' ' +
- '' + has_photo.htmlEnc() + ' ' +
- '' + checksum.htmlEnc() + ' ' +
- '' + caps.htmlEnc() + ' ' +
- ' ';
-
- DataStore.setDB(Connection.desktop_hash, 'presence-stanza', from, xml);
- resources_obj = self.addResource(xid, resource);
- }
-
- // We manage the presence
- self.processPriority(xid, resource, resources_obj);
- self.funnel(xid, xid_hash);
-
- // We display the presence in the current chat
- if(Common.exists('#' + xid_hash)) {
- var dStatus = self.filterStatus(xid, status, false);
-
- if(dStatus) {
- dStatus = ' (' + dStatus + ')';
- }
-
- // Generate the presence-in-chat code
- var dName = Name.getBuddy(from).htmlEnc();
- var dBody = dName + ' (' + from + ') ' + Common._e("is now") + ' ' + self.humanShow(show, type) + dStatus;
-
- // Check whether it has been previously displayed
- var can_display = ($('#' + xid_hash + ' .one-line.system-message:last').html() != dBody);
-
- if(can_display) {
- Message.display(
- 'chat',
- xid,
- xid_hash,
- dName,
- dBody,
- DateUtils.getCompleteTime(),
- DateUtils.getTimeStamp(),
- 'system-message',
- false
- );
- }
- }
- }
-
- // Get disco#infos for this presence (related to Caps)
- Caps.getDiscoInfos(from, caps);
- } catch(e) {
- Console.error('Groupchat._handleUser', e);
- }
-
- };
-
-
- /**
- * Attaches picker events
- * @private
- * @param {string} name
- * @param {object} element_text_sel
- * @param {function} send_fn
- * @return {boolean}
- */
- self._eventsPicker = function(element_picker_sel) {
-
- try {
- // Disabled?
- if(element_picker_sel.hasClass('disabled')) {
- return false;
- }
-
- // Initialize some vars
- var path = '#my-infos .f-presence div.bubble';
- var show_val = self.getUserShow();
-
- var shows_obj = {
- 'xa': Common._e("Not available"),
- 'away': Common._e("Away"),
- 'available': Common._e("Available")
- };
-
- var can_append = !Common.exists(path);
-
- // Add this bubble!
- Bubble.show(path);
-
- if(!can_append) {
- return false;
- }
-
- // Generate the HTML code
- var html = '';
-
- for(var cur_show_name in shows_obj) {
- // Yet in use: no need to display it!
- if(cur_show_name == show_val) {
- continue;
- }
-
- html += '
';
- }
-
- html += '
';
-
- // Append the HTML code
- $('#my-infos .f-presence').append(html);
-
- // Click event
- $(path + ' a').click(function() {
- // Update the presence show marker
- $('#my-infos .f-presence a.picker').attr(
- 'data-value',
- $(this).attr('data-value')
- );
-
- // Close the bubble
- Bubble.close();
-
- // Focus on the status input
- $(document).oneTime(10, function() {
- $('#presence-status').focus();
- });
-
- return false;
- });
- } catch(e) {
- Console.error('Groupchat._eventsPicker', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Sends the user first presence
- * @public
- * @param {string} checksum
- * @return {undefined}
- */
- self.sendFirst = function(checksum) {
-
- try {
- Console.info('First presence sent.');
-
- var presence_status_sel = $('#presence-status');
-
- // Jappix is now ready: change the title
- Interface.title('talk');
-
- // Anonymous check
- var is_anonymous = Utils.isAnonymous();
-
- // Update our marker
- self.first_sent = true;
-
- // Try to use the last status message
- var status = DataStore.getDB(Connection.desktop_hash, 'options', 'presence-status') || '';
-
- // We tell the world that we are online
- if(!is_anonymous) {
- self.send('', '', '', status, checksum);
- }
-
- // Any status to apply?
- if(status) {
- presence_status_sel.val(status);
- }
-
- // Enable the presence picker
- presence_status_sel.removeAttr('disabled');
- $('#my-infos .f-presence a.picker').removeClass('disabled');
-
- // We set the last activity stamp
- DateUtils.presence_last_activity = DateUtils.getTimeStamp();
-
- // We store our presence
- DataStore.setDB(Connection.desktop_hash, 'presence-show', 1, 'available');
-
- // Not anonymous
- if(!is_anonymous) {
- // We get the stored bookmarks (because of the photo hash and some other stuffs, we must get it later)
- Storage.get(NS_BOOKMARKS);
-
- // We open a new chat if a XMPP link was submitted
- if((parent.location.hash != '#OK') && XMPPLinks.links_var.x) {
- // A link is submitted in the URL
- XMPPLinks.go(XMPPLinks.links_var.x);
-
- // Set a OK status
- parent.location.hash = 'OK';
- }
- }
- } catch(e) {
- Console.error('Presence.sendFirst', e);
- }
-
- };
-
-
- /**
- * Handles incoming presence packets
- * @public
- * @param {object} presence
- * @return {undefined}
- */
- self.handle = function(presence) {
-
- try {
- // We define everything needed here
- var from = Common.fullXID(Common.getStanzaFrom(presence));
- var hash = hex_md5(from);
- var node_sel = $(presence.getNode());
- var xid = Common.bareXID(from);
- var xid_hash = hex_md5(xid);
- var resource = Common.thisResource(from);
-
- // We get the type content
- var type = presence.getType() || '';
-
- // We get the priority content
- var priority = presence.getPriority() + '';
- if(!priority || (type == 'error')) {
- priority = '0';
- }
-
- // We get the show content
- var show = presence.getShow();
- if(!show || (type == 'error')) {
- show = '';
- }
-
- // We get the status content
- var status = presence.getStatus();
- if(!status || (type == 'error')) {
- status = '';
- }
-
- // We get the photo content
- var photo = node_sel.find('x[xmlns="' + NS_VCARD_P + '"]:first photo');
- var checksum = photo.text();
- var has_photo = (photo.size() && (type != 'error')) ? 'true' : 'false';
-
- // We get the CAPS content
- var caps = node_sel.find('c[xmlns="' + NS_CAPS + '"]:first').attr('ver');
- if(!caps || (type == 'error')) {
- caps = '';
- }
-
- // This presence comes from another resource of my account with a difference avatar checksum
- if(xid == Common.getXID() &&
- has_photo == 'true' &&
- checksum != DataStore.getDB(Connection.desktop_hash, 'checksum', 1)) {
- Avatar.get(Common.getXID(), 'force', 'true', 'forget');
- }
-
- if(Utils.isPrivate(xid)) {
- // Groupchat presence
- self._handleGroupchat(
- from,
- xid,
- hash,
- type,
- show,
- status,
- xid_hash,
- resource,
- node_sel,
- presence,
- priority,
- has_photo,
- checksum,
- caps
- );
- } else {
- // User or gateway presence
- self._handleUser(
- from,
- xid,
- type,
- show,
- status,
- xid_hash,
- resource,
- node_sel,
- priority,
- has_photo,
- checksum,
- caps
- );
- }
-
- Console.log('Presence received (type: ' + (type || 'available') + ', show: ' + (show || 'none') + ') from ' + from);
- } catch(e) {
- Console.error('Presence.handle', e);
- }
-
- };
-
-
- /**
- * Displays a MUC presence
- * @public
- * @param {string} from
- * @param {string} roomHash
- * @param {string} hash
- * @param {string} type
- * @param {string} show
- * @param {string} status
- * @param {string} affiliation
- * @param {string} role
- * @param {string} reason
- * @param {string} status_code
- * @param {string} iXID
- * @param {string} iNick
- * @param {string} message_time
- * @param {string} nick
- * @param {boolean} initial
- * @return {undefined}
- */
- self.displayMUC = function(from, roomHash, hash, type, show, status, affiliation, role, reason, status_code, iXID, iNick, message_time, nick, initial) {
-
- try {
- // Generate the values
- var room_xid = Common.bareXID(from);
- var thisUser = '#page-engine #' + roomHash + ' .list .' + hash;
- var thisPrivate = $('#' + hash + ' .message-area');
- var nick_html = nick.htmlEnc();
- var real_xid = '';
- var write = nick_html + ' ';
- var notify = false;
-
- // Reset data?
- if(!role) {
- role = 'participant';
- }
- if(!affiliation) {
- affiliation = 'none';
- }
-
- // Must update the role?
- if(Common.exists(thisUser) && (($(thisUser).attr('data-role') != role) || ($(thisUser).attr('data-affiliation') != affiliation))) {
- $(thisUser).remove();
- }
-
- // Any XID submitted?
- if(iXID) {
- real_xid = ' data-realxid="' + iXID + '"';
- iXID = Common.bareXID(iXID);
- write += ' (' + iXID + ' ) ';
- }
-
- // User does not exists yet
- if(!Common.exists(thisUser) && (!type || (type == 'available'))) {
- var myself = '';
-
- // Is it me?
- if(nick == Name.getMUCNick(roomHash)) {
- // Enable the room
- $('#' + roomHash + ' .message-area').removeAttr('disabled');
-
- // Marker
- myself = ' myself';
- }
-
- // Set the user in the MUC list
- $('#' + roomHash + ' .list .' + role + ' .title').after(
- '' +
- '
' +
- '
' + nick_html + '
' +
-
- '
' +
- '
' +
- '
' +
-
- '
' +
- '
' +
-
- '
' +
- '
' +
- ' ' +
- ' ' +
-
- '
' +
- ' ' +
- ' ' +
-
- '
' +
- ' ' +
- ' ' +
-
- '
' +
- ' ' +
- ' ' +
-
- '
' +
- '
' +
- '
'
- );
-
- // Click event
- if(nick != Name.getMUCNick(roomHash)) {
- $(thisUser).hover(function() {
- if(iXID && Groupchat.affiliationMe(room_xid).code >= 2) {
- var user_actions_sel = $(this).find('.user-actions');
- var user_actions_btn_sel = user_actions_sel.find('.action');
-
- // Update buttons
- var i;
- var hide_btns = [];
-
- var user_affiliation = Groupchat.affiliationUser(room_xid, nick);
-
- if(user_affiliation.name == 'owner') {
- hide_btns.push(
- 'promote',
- 'demote',
- 'kick'
- );
- } else if(user_affiliation.name === 'admin') {
- hide_btns.push(
- 'promote',
- 'kick'
- );
- } else {
- hide_btns.push(
- 'demote'
- );
- }
-
- if(Roster.isFriend(iXID)) {
- hide_btns.push(
- 'add'
- );
- }
-
- // Go Go Go!!
- for(i in hide_btns) {
- user_actions_btn_sel.filter('.' + hide_btns[i]).hide();
- }
-
- // Slide down?
- if(hide_btns.length < user_actions_btn_sel.size()) {
- user_actions_sel.stop(true).slideDown(250);
- }
- }
- }, function() {
- var user_actions_sel = $(this).find('.user-actions');
-
- if(user_actions_sel.is(':visible')) {
- user_actions_sel.stop(true).slideUp(200, function() {
- user_actions_sel.find('.action').show();
- });
- }
- });
-
- $(thisUser).find('.user-details').on('click', function() {
- Chat.checkCreate(from, 'private');
- });
-
- $(thisUser).find('.user-actions .action a').on('click', function() {
- var this_parent_sel = $(this).parent();
-
- if(this_parent_sel.is('.promote')) {
- Groupchat.promoteModerator(room_xid, iXID);
- } else if(this_parent_sel.is('.demote')) {
- Groupchat.demoteModerator(room_xid, iXID);
- } else if(this_parent_sel.is('.add')) {
- this_parent_sel.hide();
- Roster.addThisContact(iXID, nick);
- } else if(this_parent_sel.is('.kick')) {
- Groupchat.kickUser(room_xid, (iXID || from), nick);
- }
-
- return false;
- });
- }
-
- // We tell the user that someone entered the room
- if(!initial && DataStore.getDB(Connection.desktop_hash, 'options', 'groupchatpresence') !== '0') {
- notify = true;
- write += Common._e("joined the chat room");
-
- // Any status?
- if(status) {
- write += ' (' + Filter.message(status, nick_html, true) + ')';
- } else {
- write += ' (' + Common._e("no status") + ')';
- }
- }
-
- // Enable the private chat input
- thisPrivate.removeAttr('disabled');
- }
-
- else if((type == 'unavailable') || (type == 'error')) {
- // Is it me?
- if(nick == Name.getMUCNick(roomHash)) {
- $(thisUser).remove();
-
- // Disable the groupchat input
- $('#' + roomHash + ' .message-area').attr('disabled', true);
-
- // Remove all the groupchat users
- $('#' + roomHash + ' .list .user').remove();
- }
-
- // Someone has been kicked or banned?
- if(Utils.existArrayValue(status_code, 301) || Utils.existArrayValue(status_code, 307)) {
- $(thisUser).remove();
- notify = true;
-
- // Kicked?
- if(Utils.existArrayValue(status_code, 307)) {
- write += Common._e("has been kicked");
- }
-
- // Banned?
- if(Utils.existArrayValue(status_code, 301)) {
- write += Common._e("has been banned");
- }
-
- // Any reason?
- if(reason) {
- write += ' (' + Filter.message(reason, nick_html, true) + ')';
- } else {
- write += ' (' + Common._e("no reason") + ')';
- }
- }
-
- // Nickname change?
- else if(Utils.existArrayValue(status_code, 303) && iNick) {
- notify = true;
- write += Common.printf(Common._e("changed his/her nickname to %s"), iNick.htmlEnc());
-
- // New values
- var new_xid = Common.cutResource(from) + '/' + iNick;
- var new_hash = hex_md5(new_xid);
- var new_class = 'user ' + new_hash;
-
- if($(thisUser).hasClass('myself')) {
- new_class += ' myself';
- }
-
- // Die the click event
- $(thisUser).off('click');
-
- // Change to the new nickname
- $(thisUser).attr('data-nick', escape(iNick))
- .attr('data-xid', new_xid)
- .find('.name').text(iNick);
-
- // Change the user class
- $(thisUser).attr('class', new_class);
-
- // New click event
- $('#page-engine #' + roomHash + ' .list .' + new_hash).on('click', function() {
- Chat.checkCreate(new_xid, 'private');
- });
- }
-
- // We tell the user that someone left the room
- else if(!initial && DataStore.getDB(Connection.desktop_hash, 'options', 'groupchatpresence') !== '0') {
- $(thisUser).remove();
- notify = true;
- write += Common._e("left the chat room");
-
- // Any status?
- if(status) {
- write += ' (' + Filter.message(status, nick_html, true) + ')';
- } else {
- write += ' (' + Common._e("no status") + ')';
- }
- }
-
- // Disable the private chat input
- thisPrivate.attr('disabled', true);
- }
-
- // Must notify something
- if(notify) {
- Message.display('groupchat', from, roomHash, nick_html, write, message_time, DateUtils.getTimeStamp(), 'system-message', false);
- }
-
- // Set the good status show icon
- switch(show) {
- case 'chat':
- case 'away':
- case 'xa':
- case 'dnd':
- break;
-
- default:
- show = 'available';
- break;
- }
-
- $(thisUser + ' .name').attr('class', 'name talk-images ' + show);
-
- // Set the good status text
- var uTitle = nick;
-
- // Any XID to add?
- if(iXID) {
- uTitle += ' (' + iXID + ')';
- }
-
- // Any status to add?
- if(status) {
- uTitle += ' - ' + status;
- }
-
- $(thisUser).attr('title', uTitle);
-
- // Show or hide the role category, depending of its content
- $('#' + roomHash + ' .list .role').each(function() {
- var this_sel = $(this);
-
- if(this_sel.find('.user').size()) {
- this_sel.show();
- } else {
- this_sel.hide();
- }
- });
- } catch(e) {
- Console.error('Presence.displayMUC', e);
- }
-
- };
-
-
- /**
- * Filters a given status
- * @public
- * @param {string} xid
- * @param {string} status
- * @param {boolean} cut
- * @return {string}
- */
- self.filterStatus = function(xid, status, cut) {
-
- try {
- var dStatus = '';
-
- if(!status) {
- status = '';
- } else {
- if(cut) {
- dStatus = Utils.truncate(status, 50);
- } else {
- dStatus = status;
- }
-
- dStatus = Filter.message(dStatus, Name.getBuddy(xid).htmlEnc(), true);
- }
-
- return dStatus;
- } catch(e) {
- Console.error('Presence.filterStatus', e);
- }
-
- };
-
-
- /**
- * Displays a user's presence
- * @public
- * @param {string} value
- * @param {string} type
- * @param {string} show
- * @param {string} status
- * @param {string} hash
- * @param {string} xid
- * @param {string} avatar
- * @param {string} checksum
- * @param {string} caps
- * @return {undefined}
- */
- self.display = function(value, type, show, status, hash, xid, avatar, checksum, caps) {
-
- try {
- // Display the presence in the roster
- var path = '#roster .' + hash;
- var buddy = $('#roster .content .' + hash);
- var dStatus = self.filterStatus(xid, status, false);
- var tStatus = Common.encodeQuotes(status);
- var biStatus;
-
- // The buddy presence behind his name
- $(path + ' .name .buddy-presence').replaceWith('' + value + '
');
-
- // The buddy presence in the buddy infos
- if(dStatus) {
- biStatus = dStatus;
- } else {
- biStatus = value;
- }
-
- $(path + ' .bi-status').replaceWith('' + biStatus + '
');
-
- // When the buddy disconnect himself, we hide him
- if((type == 'unavailable') || (type == 'error')) {
- // Set a special class to the buddy
- buddy.addClass('hidden-buddy');
-
- // No filtering is launched?
- if(!Search.search_filtered) {
- buddy.hide();
- }
-
- // All the buddies are shown?
- if(Roster.blist_all) {
- buddy.show();
- }
-
- // Chat stuffs
- if(Common.exists('#' + hash)) {
- // Remove the chatstate stuffs
- ChatState.reset(hash);
- $('#' + hash + ' .chatstate').remove();
- $('#' + hash + ' .message-area').removeAttr('data-chatstates');
-
- // Get the buddy avatar (only if a chat is opened)
- Avatar.get(xid, 'cache', 'true', 'forget');
- }
- }
-
- // If the buddy is online
- else {
- // When the buddy is online, we show it
- buddy.removeClass('hidden-buddy');
-
- // No filtering is launched?
- if(!Search.search_filtered) {
- buddy.show();
- }
-
- // Get the online buddy avatar if not a gateway
- Avatar.get(xid, 'cache', avatar, checksum);
- }
-
- // Display the presence in the chat
- if(Common.exists('#' + hash)) {
- // We generate a well formed status message
- if(dStatus) {
- // No need to write the same status two times
- if(dStatus == value) {
- dStatus = '';
- } else {
- dStatus = ' (' + dStatus + ')';
- }
- }
-
- // We show the presence value
- $('#' + hash + ' .bc-infos').replaceWith('' + value + ' ' + dStatus + '
');
-
- // Process the new status position
- self.adaptChat(hash);
- }
-
- // Display the presence in the switcher
- if(Common.exists('#page-switch .' + hash)) {
- $('#page-switch .' + hash + ' .icon').removeClass('available unavailable error away busy').addClass(type);
- }
-
- // Update roster groups
- if(!Search.search_filtered) {
- Roster.updateGroups();
- } else {
- Search.funnelFilterBuddy();
- }
-
- // Get the disco#infos for this user
- var highest = self.highestPriority(xid);
-
- if(highest) {
- Caps.getDiscoInfos(highest, caps);
- } else {
- Caps.displayDiscoInfos(xid, '');
- }
- } catch(e) {
- Console.error('Presence.display', e);
- }
-
- };
-
-
- /**
- * Process the chat presence position
- * @public
- * @param {string} hash
- * @return {undefined}
- */
- self.adaptChat = function(hash) {
-
- try {
- // Get values
- var pep_numb = $('#' + hash + ' .bc-pep').find('a').size();
-
- // Process the left/right position
- var presence_h = 12;
-
- if(pep_numb) {
- presence_h = (pep_numb * 20) + 18;
- }
-
- // Apply the left/right position
- var presence_h_tag = ($('html').attr('dir') == 'rtl') ? 'left' : 'right';
- $('#' + hash + ' p.bc-infos').css(presence_h_tag, presence_h);
- } catch(e) {
- Console.error('Presence.adaptChat', e);
- }
-
- };
-
-
- /**
- * Convert the presence "show" element into a human-readable output
- * @public
- * @param {string} show
- * @param {string} type
- * @return {undefined}
- */
- self.humanShow = function(show, type) {
-
- try {
- if(type == 'unavailable') {
- show = Common._e("Unavailable");
- } else if(type == 'error') {
- show = Common._e("Error");
- } else {
- switch(show) {
- case 'chat':
- show = Common._e("Talkative");
- break;
-
- case 'away':
- show = Common._e("Away");
- break;
-
- case 'xa':
- show = Common._e("Not available");
- break;
-
- case 'dnd':
- show = Common._e("Busy");
- break;
-
- default:
- show = Common._e("Available");
- break;
- }
- }
-
- return show;
- } catch(e) {
- Console.error('Presence.humanShow', e);
- }
-
- };
-
-
- /**
- * Makes the presence data go in the right way
- * @public
- * @param {string} type
- * @param {string} show
- * @param {string} status
- * @param {string} hash
- * @param {string} xid
- * @param {string} avatar
- * @param {string} checksum
- * @param {string} caps
- * @return {undefined}
- */
- self.IA = function(type, show, status, hash, xid, avatar, checksum, caps) {
-
- try {
- // Any status defined?
- status = status || self.humanShow(show, type);
-
- // Handle events
- if(type == 'error') {
- self.display(Common._e("Error"), 'error', show, status, hash, xid, avatar, checksum, caps);
- } else if(type == 'unavailable') {
- self.display(Common._e("Unavailable"), 'unavailable', show, status, hash, xid, avatar, checksum, caps);
- } else {
- switch(show) {
- case 'chat':
- self.display(Common._e("Talkative"), 'available', show, status, hash, xid, avatar, checksum, caps);
- break;
-
- case 'away':
- self.display(Common._e("Away"), 'away', show, status, hash, xid, avatar, checksum, caps);
- break;
-
- case 'xa':
- self.display(Common._e("Not available"), 'busy', show, status, hash, xid, avatar, checksum, caps);
- break;
-
- case 'dnd':
- self.display(Common._e("Busy"), 'busy', show, status, hash, xid, avatar, checksum, caps);
- break;
-
- default:
- self.display(Common._e("Available"), 'available', show, status, hash, xid, avatar, checksum, caps);
- break;
- }
- }
- } catch(e) {
- Console.error('Presence.IA', e);
- }
-
- };
-
-
- /**
- * Flush the presence data for a given user
- * @public
- * @param {string} xid
- * @return {boolean}
- */
- self.flush = function(xid) {
-
- try {
- var flushed_marker = false;
- var db_regex = new RegExp(('^' + Connection.desktop_hash + '_') + 'presence' + ('_(.+)'));
-
- for(var i = 0; i < DataStore.storageDB.length; i++) {
- // Get the pointer values
- var current = DataStore.storageDB.key(i);
-
- // If the pointer is on a stored presence
- if(current.match(db_regex)) {
- // Get the current XID
- var now_full = RegExp.$1;
- var now_bare = Common.bareXID(now_full);
-
- // If the current XID equals the asked XID
- if(now_bare == xid) {
- if(DataStore.removeDB(Connection.desktop_hash, 'presence-stanza', now_full)) {
- Console.info('Presence data flushed for: ' + now_full);
-
- flushed_marker = true;
- i--;
- }
- }
- }
- }
-
- return flushed_marker;
- } catch(e) {
- Console.error('Presence.flush', e);
- }
-
- };
-
-
- /**
- * Process the highest resource priority for an user
- * @public
- * @param {string} xid
- * @param {string} resource
- * @param {object} resources_obj
- * @return {undefined}
- */
- self.processPriority = function(xid, resource, resources_obj) {
-
- try {
- if(!xid) {
- Console.warn('No XID value');
- return;
- }
-
- // Initialize vars
- var cur_resource, cur_from, cur_pr,
- cur_xml, cur_priority,
- from_highest;
-
- from_highest = null;
- max_priority = null;
-
- // Groupchat or gateway presence? (no priority here)
- if(xid.indexOf('/') !== -1 || Common.isGateway(xid)) {
- from_highest = xid;
-
- Console.log('Processed presence for groupchat user: ' + xid);
- } else {
- if(!self.highestPriority(xid)) {
- from_highest = xid;
-
- if(resource) {
- from_highest += '/' + resource;
- }
-
- Console.log('Processed initial presence for regular user: ' + xid + ' (highest priority for: ' + (from_highest || 'none') + ')');
- } else {
- var fn_parse_resource = function(cur_resource) {
- // Read presence data
- cur_from = xid;
-
- if(cur_resource) {
- cur_from += '/' + cur_resource;
- }
-
- cur_pr = DataStore.getDB(Connection.desktop_hash, 'presence-stanza', cur_from);
-
- if(cur_pr) {
- // Parse presence data
- cur_xml = Common.XMLFromString(cur_pr);
- cur_priority = $(cur_xml).find('priority').text();
- cur_priority = !isNaN(cur_priority) ? parseInt(cur_priority) : 0;
-
- // Higher priority?
- if((cur_priority >= max_priority) || (max_priority === null)) {
- max_priority = cur_priority;
- from_highest = cur_from;
- }
- }
- };
-
- // Parse bare presences (used by gateway contacts, mostly)
- if(resources_obj.bare === 1) {
- fn_parse_resource(null);
- }
-
- // Parse resources
- for(cur_resource in resources_obj.list) {
- fn_parse_resource(cur_resource);
- }
-
- Console.log('Processed presence for regular user: ' + xid + ' (highest priority for: ' + (from_highest || 'none') + ')');
- }
- }
-
- if(from_highest) {
- DataStore.setDB(Connection.desktop_hash, 'presence-priority', xid, from_highest);
- } else {
- DataStore.removeDB(Connection.desktop_hash, 'presence-priority', xid);
- }
- } catch(e) {
- Console.error('Presence.processPriority', e);
- }
-
- };
-
-
- /**
- * Returns the highest presence priority XID for an user
- * @public
- * @param {string} xid
- * @return {string}
- */
- self.highestPriority = function(xid) {
-
- try {
- return DataStore.getDB(Connection.desktop_hash, 'presence-priority', xid) || '';
- } catch(e) {
- Console.error('Presence.highestPriority', e);
- }
-
- };
-
-
- /**
- * Gets the presence stanza for given full XID
- * @public
- * @param {string} xid_full
- * @return {object}
- */
- self.readStanza = function(xid_full) {
-
- try {
- var pr = DataStore.getDB(Connection.desktop_hash, 'presence-stanza', xid_full);
-
- if(!pr) {
- pr = 'unavailable ';
- }
-
- return Common.XMLFromString(pr);
- } catch(e) {
- Console.error('Presence.readStanza', e);
- }
-
- };
-
-
- /**
- * Gets the resource from a XID which has the highest priority
- * @public
- * @param {string} xid
- * @return {object}
- */
- self.highestPriorityStanza = function(xid) {
-
- try {
- return self.readStanza(
- self.highestPriority(xid)
- );
- } catch(e) {
- Console.error('Presence.highestPriorityStanza', e);
- }
-
- };
-
-
- /**
- * Lists presence resources for an user
- * @public
- * @param {string} xid
- * @return {object}
- */
- self.resources = function(xid) {
-
- try {
- var resources_obj = {
- 'bare': 0,
- 'list': {}
- };
-
- var resources_db = DataStore.getDB(Connection.desktop_hash, 'presence-resources', xid);
-
- if(resources_db) {
- resources_obj = $.evalJSON(resources_db);
- }
-
- return resources_obj;
- } catch(e) {
- Console.error('Presence.resources', e);
- }
-
- };
-
-
- /**
- * Adds a given presence resource for an user
- * @public
- * @param {string} xid
- * @param {string} resource
- * @return {object}
- */
- self.addResource = function(xid, resource) {
-
- var resources_obj = null;
-
- try {
- resources_obj = self.resources(xid);
-
- if(resource) {
- resources_obj.list[resource] = 1;
- } else {
- resources_obj.bare = 1;
- }
-
- DataStore.setDB(Connection.desktop_hash, 'presence-resources', xid, $.toJSON(resources_obj));
- } catch(e) {
- Console.error('Presence.addResource', e);
- } finally {
- return resources_obj;
- }
-
- };
-
-
- /**
- * Removes a given presence resource for an user
- * @public
- * @param {string} xid
- * @param {string} resource
- * @return {object}
- */
- self.removeResource = function(xid, resource) {
-
- var resources_obj = null;
-
- try {
- resources_obj = self.resources(xid);
-
- if(resource) {
- delete resources_obj.list[resource];
- } else {
- resources_obj.bare = 0;
- }
-
- DataStore.setDB(Connection.desktop_hash, 'presence-resources', xid, $.toJSON(resources_obj));
- } catch(e) {
- Console.error('Presence.removeResource', e);
- } finally {
- return resources_obj;
- }
-
- };
-
-
- /**
- * Makes something easy to process for the presence IA
- * @public
- * @param {string} xid
- * @param {string} hash
- * @return {undefined}
- */
- self.funnel = function(xid, hash) {
-
- try {
- // Get the highest priority presence value
- var presence_node = $(self.highestPriorityStanza(xid));
-
- var type = presence_node.find('type').text();
- var show = presence_node.find('show').text();
- var status = presence_node.find('status').text();
- var avatar = presence_node.find('avatar').text();
- var checksum = presence_node.find('checksum').text();
- var caps = presence_node.find('caps').text();
-
- // Display the presence with that stored value
- if(!type && !show) {
- self.IA('', 'available', status, hash, xid, avatar, checksum, caps);
- } else {
- self.IA(type, show, status, hash, xid, avatar, checksum, caps);
- }
- } catch(e) {
- Console.error('Presence.funnel', e);
- }
-
- };
-
-
- /**
- * Sends a defined presence packet
- * @public
- * @param {string} to
- * @param {string} type
- * @param {string} show
- * @param {string} status
- * @param {string} checksum
- * @param {number} limit_history
- * @param {string} password
- * @param {function} handle
- * @return {undefined}
- */
- self.send = function(to, type, show, status, checksum, limit_history, password, handle) {
-
- try {
- // Get some stuffs
- var priority = DataStore.getDB(Connection.desktop_hash, 'priority', 1) || '1';
-
- checksum = checksum || DataStore.getDB(Connection.desktop_hash, 'checksum', 1);
-
- if(show == 'available') {
- show = '';
- }
-
- if(type == 'available') {
- type = '';
- }
-
- // New presence
- var presence = new JSJaCPresence();
-
- // Avoid "null" or "none" if nothing stored
- if(!checksum || (checksum == 'none')) {
- checksum = '';
- }
-
- // Presence headers
- if(to)
- presence.setTo(to);
- if(type)
- presence.setType(type);
- if(show)
- presence.setShow(show);
- if(status)
- presence.setStatus(status);
-
- presence.setPriority(priority);
-
- // CAPS (entity capabilities)
- presence.appendNode('c', {
- 'xmlns': NS_CAPS,
- 'hash': 'sha-1',
- 'node': 'https://jappix.org/',
- 'ver': Caps.mine()
- });
-
- // Nickname
- var nickname = Name.get();
-
- if(nickname && !limit_history) {
- presence.appendNode('nick', {
- 'xmlns': NS_NICK
- }, nickname);
- }
-
- // vcard-temp:x:update node
- var x = presence.appendNode('x', {
- 'xmlns': NS_VCARD_P
- });
-
- x.appendChild(presence.buildNode('photo', {
- 'xmlns': NS_VCARD_P
- }, checksum));
-
- // MUC X data
- if(limit_history || password) {
- var xMUC = presence.appendNode('x', {
- 'xmlns': NS_MUC
- });
-
- // Max messages age (for MUC)
- if(limit_history) {
- xMUC.appendChild(presence.buildNode('history', {
- 'maxstanzas': 20,
- 'seconds': 86400,
- 'xmlns': NS_MUC
- }));
- }
-
- // Room password
- if(password) {
- xMUC.appendChild(presence.buildNode('password', {
- 'xmlns': NS_MUC
- }, password));
- }
- }
-
- // Reachability details
- if(type != 'unavailable') {
- var reach_regex = new RegExp('[^+0-9]', 'g');
- var reach_phone = DataStore.getDB(Connection.desktop_hash, 'profile', 'phone') || '';
- reach_phone = reach_phone.replace(reach_regex, '');
-
- if(reach_phone) {
- /* REF: http://www.xmpp.org/extensions/xep-0152.html */
- var reach_node = presence.appendNode(presence.buildNode('reach', {
- 'xmlns': NS_URN_REACH
- }));
-
- reach_node.appendChild(
- presence.buildNode('addr', {
- 'uri': 'tel:' + reach_phone,
- 'xmlns': NS_URN_REACH
- })
- );
- }
- }
-
- // If away, send a last activity time
- if((show == 'away') || (show == 'xa')) {
- /* REF: http://xmpp.org/extensions/xep-0256.html */
- presence.appendNode(presence.buildNode('query', {
- 'xmlns': NS_LAST,
- 'seconds': DateUtils.getPresenceLast()
- }));
-
- /* REF: http://xmpp.org/extensions/xep-0319.html */
- presence.appendNode(presence.buildNode('idle', {
- 'xmlns': NS_URN_IDLE,
- 'since': DateUtils.getLastActivityDate()
- }));
- } else {
- DateUtils.presence_last_activity = DateUtils.getTimeStamp();
- }
-
- // Send presence packet
- if(typeof handle == 'function') {
- con.send(presence, handle);
- } else {
- con.send(presence);
- }
-
- Console.info('Presence sent: ' + (type || 'available'));
- } catch(e) {
- Console.error('Presence.send', e);
- }
-
- };
-
-
- /**
- * Performs all the actions to get the presence data
- * @public
- * @param {string} checksum
- * @param {boolean} autoidle
- * @return {undefined}
- */
- self.sendActions = function(checksum, autoidle) {
-
- try {
- // We get the values of the inputs
- var show = self.getUserShow();
- var status = self.getUserStatus();
-
- // Send the presence
- if(!Utils.isAnonymous()) {
- self.send('', '', show, status, checksum);
- }
-
- // We set the good icon
- self.icon(show);
-
- // We store our presence
- if(!autoidle)
- DataStore.setDB(Connection.desktop_hash, 'presence-show', 1, show);
-
- // We send the presence to our active MUC
- $('.page-engine-chan[data-type="groupchat"]').each(function() {
- var tmp_nick = $(this).attr('data-nick');
-
- if(!tmp_nick) {
- return;
- }
-
- var room = unescape($(this).attr('data-xid'));
- var nick = unescape(tmp_nick);
-
- // Must re-initialize?
- if(Connection.resume) {
- Groupchat.getMUC(room, nick);
- }
-
- // Not disabled?
- else if(!$(this).find('.message-area').attr('disabled')) {
- self.send(room + '/' + nick, '', show, status, '', true);
- }
- });
- } catch(e) {
- Console.error('Presence.quickSend', e);
- }
-
- };
-
-
- /**
- * Changes the presence icon
- * @public
- * @param {string} value
- * @return {undefined}
- */
- self.icon = function(value) {
-
- try {
- $('#my-infos .f-presence a.picker').attr('data-value', value);
- } catch(e) {
- Console.error('Presence.icon', e);
- }
-
- };
-
-
- /**
- * Sends a subscribe stanza
- * @public
- * @param {string} to
- * @param {string} type
- * @return {undefined}
- */
- self.sendSubscribe = function(to, type) {
-
- try {
- var status = '';
-
- // Subscribe request?
- if(type == 'subscribe') {
- status = Common.printf(Common._e("Hi, I am %s, I would like to add you as my friend."), Name.get());
- }
-
- self.send(to, type, '', status);
- } catch(e) {
- Console.error('Presence.sendSubscribe', e);
- }
-
- };
-
-
- /**
- * Accepts the subscription from another entity
- * @public
- * @param {string} xid
- * @param {string} name
- * @return {undefined}
- */
- self.acceptSubscribe = function(xid, name) {
-
- try {
- // We update our chat
- $('#' + hex_md5(xid) + ' .tools-add').hide();
-
- // We send a subsribed presence (to confirm)
- self.sendSubscribe(xid, 'subscribed');
-
- // We send a subscription request (subscribe both sides)
- self.sendSubscribe(xid, 'subscribe');
-
- // Specify the buddy name (if any)
- if(name) {
- Roster.send(xid, '', name);
- }
- } catch(e) {
- Console.error('Presence.acceptSubscribe', e);
- }
-
- };
-
-
- /**
- * Sends automatic away presence
- * @public
- * @return {undefined}
- */
- self.autoIdle = function() {
-
- try {
- // Not connected?
- if(!Common.isConnected()) {
- return;
- }
-
- // Stop if an xa presence was set manually
- var last_presence = self.getUserShow();
-
- if(!self.auto_idle && ((last_presence == 'away') || (last_presence == 'xa'))) {
- return;
- }
-
- var idle_presence;
- var activity_limit;
-
- // Can we extend to auto extended away mode (20 minutes)?
- if(self.auto_idle && (last_presence == 'away')) {
- idle_presence = 'xa';
- activity_limit = 1200;
- } else {
- idle_presence = 'away';
- activity_limit = 600;
- }
-
- // The user is really inactive and has set another presence than extended away
- if(((!self.auto_idle && (last_presence != 'away')) || (self.auto_idle && (last_presence == 'away'))) && (DateUtils.getLastActivity() >= activity_limit)) {
- // Then tell we use an auto presence
- self.auto_idle = true;
-
- // Get the old status message
- var status = DataStore.getDB(Connection.desktop_hash, 'options', 'presence-status') || '';
-
- // Change the presence input
- $('#my-infos .f-presence a.picker').attr('data-value', idle_presence);
- $('#presence-status').val(status);
-
- // Then send the xa presence
- self.sendActions('', true);
-
- Console.info('Auto-idle presence sent: ' + idle_presence);
- }
- } catch(e) {
- Console.error('Presence.autoIdle', e);
- }
-
- };
-
-
- /**
- * Restores the old presence on a document bind
- * @public
- * @return {undefined}
- */
- self.eventIdle = function() {
-
- try {
- // If we were idle, restore our old presence
- if(self.auto_idle) {
- var presence_status_sel = $('#presence-status');
-
- // Get the values
- var show = DataStore.getDB(Connection.desktop_hash, 'presence-show', 1);
- var status = DataStore.getDB(Connection.desktop_hash, 'options', 'presence-status');
-
- // Change the presence input
- $('#my-infos .f-presence a.picker').attr('data-value', show);
- presence_status_sel.val(status);
- presence_status_sel.placeholder();
-
- // Then restore the old presence
- self.sendActions('', true);
-
- Console.info('Presence restored: ' + (show || 'available'));
- }
-
- // Apply some values
- self.auto_idle = false;
- DateUtils.last_activity = DateUtils.getTimeStamp();
- } catch(e) {
- Console.error('Presence.eventIdle', e);
- }
-
- };
-
-
- /**
- * Lives the auto idle functions
- * @public
- * @return {undefined}
- */
- self.liveIdle = function() {
-
- try {
- // Apply the autoIdle function every minute
- self.auto_idle = false;
- $('#my-infos .f-presence').everyTime('30s', self.autoIdle);
-
- // On body bind (click & key event)
- $('body').on('mousedown', self.eventIdle)
- .on('mousemove', self.eventIdle)
- .on('keydown', self.eventIdle);
- } catch(e) {
- Console.error('Presence.liveIdle', e);
- }
-
- };
-
-
- /**
- * Kills the auto idle functions
- * @public
- * @return {undefined}
- */
- self.dieIdle = function() {
-
- try {
- // Remove the event detector
- $('body').off('mousedown', self.eventIdle)
- .off('mousemove', self.eventIdle)
- .off('keydown', self.eventIdle);
- } catch(e) {
- Console.error('Presence.dieIdle', e);
- }
-
- };
-
-
- /**
- * Gets the user presence show
- * @public
- * @return {string}
- */
- self.getUserShow = function() {
-
- try {
- return $('#my-infos .f-presence a.picker').attr('data-value');
- } catch(e) {
- Console.error('Presence.getUserShow', e);
- }
-
- };
-
-
- /**
- * Gets the user presence status
- * @public
- * @return {string}
- */
- self.getUserStatus = function() {
-
- try {
- return $('#presence-status').val();
- } catch(e) {
- Console.error('Presence.getUserStatus', e);
- }
-
- };
-
-
- /**
- * Plugin launcher
- * @public
- * @return {undefined}
- */
- self.instance = function() {
-
- try {
- // Click event for user presence show
- $('#my-infos .f-presence a.picker').click(function() {
- return self._eventsPicker(
- $(this)
- );
- });
-
- // Submit events for user presence status
- var presence_status_sel = $('#presence-status');
-
- presence_status_sel.placeholder();
-
- presence_status_sel.keyup(function(e) {
- if(e.keyCode == 13) {
- $(this).blur();
-
- return false;
- }
- });
-
- presence_status_sel.blur(function() {
- // Read the parameters
- var show = self.getUserShow();
- var status = self.getUserStatus();
-
- // Read the old parameters
- var old_show = DataStore.getDB(Connection.desktop_hash, 'presence-show', 1);
- var old_status = DataStore.getDB(Connection.desktop_hash, 'options', 'presence-status');
-
- // Must send the presence?
- if((show != old_show) || (status != old_status)) {
- // Update the local stored status
- DataStore.setDB(Connection.desktop_hash, 'options', 'presence-status', status);
-
- // Update the server stored status
- if(status != old_status) {
- Options.store();
- }
-
- // Send the presence
- self.sendActions();
- }
- });
-
- // Input focus handler
- presence_status_sel.focus(function() {
- Bubble.close();
- });
- } catch(e) {
- Console.error('Presence.instance', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/privacy.js b/source/app/javascripts/privacy.js
deleted file mode 100644
index 617e498..0000000
--- a/source/app/javascripts/privacy.js
+++ /dev/null
@@ -1,1271 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the privacy JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Privacy = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Opens the privacy popup
- * @public
- * @return {boolean}
- */
- self.open = function() {
-
- try {
- // Popup HTML content
- var html =
- '' + Common._e("Privacy") + '
' +
-
- '' +
- '
' +
- '
' +
- '
' + Common._e("Choose") + ' ' +
- '
' +
- '
' +
- '
' +
-
- '
' +
-
- '
' +
- '' + Common._e("Add") + ' ' +
- ' ' +
- '
' +
- '
' +
-
- '
' +
-
- '
' +
-
- '
' +
- '
' +
-
- '';
-
- // Create the popup
- Popup.create('privacy', html);
-
- // Associate the events
- self.instance();
-
- // Display the available privacy lists
- self.displayLists();
-
- // Get the first list items
- self.displayItems();
- } catch(e) {
- Console.error('Privacy.open', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Quits the privacy popup
- * @public
- * @return {boolean}
- */
- self.close = function() {
-
- try {
- // Destroy the popup
- Popup.destroy('privacy');
- } catch(e) {
- Console.error('Privacy.close', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Sets the received state for privacy block list
- * @public
- * @return {undefined}
- */
- self.received = function() {
-
- try {
- // Store marker
- DataStore.setDB(Connection.desktop_hash, 'privacy-marker', 'available', 'true');
-
- // Show privacy elements
- $('.privacy-hidable').show();
- } catch(e) {
- Console.error('Privacy.received', e);
- }
-
- };
-
-
- /**
- * Gets available privacy lists
- * @public
- * @return {undefined}
- */
- self.list = function() {
-
- try {
- // Build query
- var iq = new JSJaCIQ();
- iq.setType('get');
-
- iq.setQuery(NS_PRIVACY);
-
- con.send(iq, self.handleList);
-
- Console.log('Getting available privacy list(s)...');
- } catch(e) {
- Console.error('Privacy.list', e);
- }
-
- };
-
-
- /**
- * Handles available privacy lists
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleList = function(iq) {
-
- try {
- // Error?
- if(iq.getType() == 'error') {
- return Console.warn('Privacy lists not supported!');
- }
-
- // Get IQ query content
- var iqQuery = iq.getQuery();
-
- // Save the content
- DataStore.setDB(Connection.desktop_hash, 'privacy-lists', 'available', Common.xmlToString(iqQuery));
-
- // Any block list?
- if($(iqQuery).find('list[name="block"]').size()) {
- // Not the default one?
- if(!$(iqQuery).find('default[name="block"]').size()) {
- self.change('block', 'default');
- } else {
- DataStore.setDB(Connection.desktop_hash, 'privacy-marker', 'default', 'block');
- }
-
- // Not the active one?
- if(!$(iqQuery).find('active[name="block"]').size()) {
- self.change('block', 'active');
- } else {
- DataStore.setDB(Connection.desktop_hash, 'privacy-marker', 'active', 'block');
- }
-
- // Get the block list rules
- self.get('block');
- }
-
- // Apply the received marker here
- else {
- Privacy.received();
- }
-
- Console.info('Got available privacy list(s).');
- } catch(e) {
- Console.error('Privacy.handleList', e);
- }
-
- };
-
-
- /**
- * Gets privacy lists
- * @public
- * @param {object} list
- * @return {undefined}
- */
- self.get = function(list) {
-
- try {
- // Build query
- var iq = new JSJaCIQ();
- iq.setType('get');
-
- // Privacy query
- var iqQuery = iq.setQuery(NS_PRIVACY);
- iqQuery.appendChild(iq.buildNode('list', {'xmlns': NS_PRIVACY, 'name': list}));
-
- con.send(iq, self.handleGet);
-
- // Must show the wait item?
- if(Common.exists('#privacy')) {
- $('#privacy .wait').show();
- }
-
- Console.log('Getting privacy list(s): ' + list);
- } catch(e) {
- Console.error('Privacy.get', e);
- }
-
- };
-
-
- /**
- * Handles privacy lists
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleGet = function(iq) {
-
- try {
- // Apply a "received" marker
- Privacy.received();
-
- // Store the data for each list
- $(iq.getQuery()).find('list').each(function() {
- // Read list name
- var list_name = $(this).attr('name');
-
- // Store list content
- DataStore.setDB(Connection.desktop_hash, 'privacy', list_name, Common.xmlToString(this));
-
- // Is this a block list?
- if(list_name == 'block') {
- // Reset buddies
- $('#roster .buddy').removeClass('blocked');
-
- // XID types
- $(this).find('item[action="deny"][type="jid"]').each(function() {
- $('#roster .buddy[data-xid="' + escape($(this).attr('value')) + '"]').addClass('blocked');
- });
-
- // Group types
- $(this).find('item[action="deny"][type="group"]').each(function() {
- $('#roster .group' + hex_md5($(this).attr('value')) + ' .buddy').addClass('blocked');
- });
- }
- });
-
- // Must display it to the popup?
- if(Common.exists('#privacy')) {
- self.displayItems();
-
- $('#privacy .wait').hide();
- }
-
- Console.info('Got privacy list(s).');
- } catch(e) {
- Console.error('Privacy.handleGet', e);
- }
-
- };
-
-
- /**
- * Sets a privacy list
- * @public
- * @param {string} list
- * @param {object} types
- * @param {object} values
- * @param {object} actions
- * @param {object} orders
- * @param {object} presence_in
- * @param {object} presence_out
- * @param {object} msg
- * @param {object} iq_p
- * @return {undefined}
- */
- self.set = function(list, types, values, actions, orders, presence_in, presence_out, msg, iq_p) {
-
- try {
- // Build query
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- // Privacy query
- var iqQuery = iq.setQuery(NS_PRIVACY);
- var iqList = iqQuery.appendChild(iq.buildNode('list', {'xmlns': NS_PRIVACY, 'name': list}));
-
- // Build the item elements
- if(types && types.length) {
- for(var i = 0; i < types.length; i++) {
- // Item element
- var iqItem = iqList.appendChild(iq.buildNode('item', {'xmlns': NS_PRIVACY}));
-
- // Item attributes
- if(types[i])
- iqItem.setAttribute('type', types[i]);
- if(values[i])
- iqItem.setAttribute('value', values[i]);
- if(actions[i])
- iqItem.setAttribute('action', actions[i]);
- if(orders[i])
- iqItem.setAttribute('order', orders[i]);
-
- // Child elements
- if(presence_in[i])
- iqItem.appendChild(iq.buildNode('presence-in', {'xmlns': NS_PRIVACY}));
- if(presence_out[i])
- iqItem.appendChild(iq.buildNode('presence-out', {'xmlns': NS_PRIVACY}));
- if(msg[i])
- iqItem.appendChild(iq.buildNode('message', {'xmlns': NS_PRIVACY}));
- if(iq_p[i])
- iqItem.appendChild(iq.buildNode('iq', {'xmlns': NS_PRIVACY}));
- }
- }
-
- con.send(iq, function(iq) {
- if(iq.getType() == 'result') {
- Console.log('Sent privacy list.');
- } else {
- Console.error('Error sending privacy list.');
- }
- });
-
- Console.log('Sending privacy list: ' + list);
- } catch(e) {
- Console.error('Privacy.set', e);
- }
-
- };
-
-
- /**
- * Push a privacy list item to a list
- * @public
- * @param {string} list
- * @param {string} type
- * @param {string} value
- * @param {string} action
- * @param {boolean} presence_in
- * @param {boolean} presence_out
- * @param {boolean} msg
- * @param {boolean} iq_p
- * @param {string} hash
- * @param {string} special_action
- * @return {undefined}
- */
- self.push = function(list, type, value, action, presence_in, presence_out, msg, iq_p, hash, special_action) {
-
- try {
- // Read the stored elements (to add them)
- var stored = Common.XMLFromString(DataStore.getDB(Connection.desktop_hash, 'privacy', list));
-
- // Read the first value
- var first_val = value[0];
-
- // Order generation flow
- var order = [];
- var highest_order = 0;
-
- // Must remove the given value?
- if(special_action == 'remove') {
- type = [];
- value = [];
- action = [];
- presence_in = [];
- presence_out = [];
- iq_p = [];
- }
-
- // Serialize them to an array
- $(stored).find('item').each(function() {
- // Attributes
- var c_type = $(this).attr('type');
- var c_value = $(this).attr('value');
- var c_action = $(this).attr('action');
- var c_order = $(this).attr('order');
-
- // Generate hash
- var c_hash = hex_md5(c_type + c_value);
-
- // Do not push it twice!
- if(((c_hash != hash) && (special_action != 'roster')) || ((first_val != c_value) && (special_action == 'roster'))) {
- if(!c_type)
- c_type = '';
- if(!c_value)
- c_value = '';
- if(!c_action)
- c_action = '';
- if(!c_order)
- c_order = '';
-
- if(!isNaN(c_order) && parseInt(c_order) > highest_order) {
- highest_order = parseInt(c_order);
- }
-
- type.push(c_type);
- value.push(c_value);
- action.push(c_action);
- order.push(c_order);
-
- // Child elements
- if($(this).find('presence-in').size()) {
- presence_in.push(true);
- } else {
- presence_in.push(false);
- }
-
- if($(this).find('presence-out').size()) {
- presence_out.push(true);
- } else {
- presence_out.push(false);
- }
-
- if($(this).find('message').size()) {
- msg.push(true);
- } else {
- msg.push(false);
- }
-
- if($(this).find('iq').size()) {
- iq_p.push(true);
- } else {
- iq_p.push(false);
- }
- }
- });
-
- order.unshift((++highest_order) + '');
-
- // Send it!
- self.set(list, type, value, action, order, presence_in, presence_out, msg, iq_p);
- } catch(e) {
- Console.error('Privacy.push', e);
- }
-
- };
-
-
- /**
- * Change a privacy list status
- * @public
- * @param {string} list
- * @param {string} status
- * @return {undefined}
- */
- self.change = function(list, status) {
-
- try {
- // Yet sent?
- if(DataStore.getDB(Connection.desktop_hash, 'privacy-marker', status) == list) {
- return;
- }
-
- // Write a marker
- DataStore.setDB(Connection.desktop_hash, 'privacy-marker', status, list);
-
- // Build query
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- // Privacy query
- var iqQuery = iq.setQuery(NS_PRIVACY);
- var iqStatus = iqQuery.appendChild(iq.buildNode(status, {'xmlns': NS_PRIVACY}));
-
- // Can add a "name" attribute?
- if(list) {
- iqStatus.setAttribute('name', list);
- }
-
- con.send(iq);
-
- Console.log('Changing privacy list status: ' + list + ' to: ' + status);
- } catch(e) {
- Console.error('Privacy.change', e);
- }
-
- };
-
-
- /**
- * Checks the privacy status (action) of a value
- * @public
- * @param {string} list
- * @param {string} value
- * @return {undefined}
- */
- self.status = function(list, value) {
-
- try {
- return $(Common.XMLFromString(DataStore.getDB(Connection.desktop_hash, 'privacy', list))).find('item[value="' + value + '"]').attr('action');
- } catch(e) {
- Console.error('Privacy.status', e);
- }
-
- };
-
-
- /**
- * Converts the groups array into a string
- * @public
- * @return {string}
- */
- self.groupsToHTML = function() {
-
- var html = '';
-
- try {
- var groups = Roster.getAllGroups();
-
- // Generate HTML
- for(var i in groups) {
- html += '' + groups[i].htmlEnc() + ' ';
- }
- } catch(e) {
- Console.error('Privacy.groupsToHTML', e);
- } finally {
- return html;
- }
-
- };
-
-
- /**
- * Displays the privacy lists
- * @public
- * @return {boolean}
- */
- self.displayLists = function() {
-
- try {
- // Initialize
- var code = '';
- var select = $('#privacy .privacy-head .list-left select');
- var data = Common.XMLFromString(DataStore.getDB(Connection.desktop_hash, 'privacy-lists', 'available'));
-
- // Parse the XML data!
- $(data).find('list').each(function() {
- var list_name = $(this).attr('name');
-
- if(list_name) {
- code += '' + list_name.htmlEnc() + ' ';
- }
- });
-
- // Apply HTML code
- select.html(code);
-
- // Not empty?
- if(code) {
- select.removeAttr('disabled');
- } else {
- select.attr('disabled', true);
- }
- } catch(e) {
- Console.error('Privacy.displayLists', e);
- } finally {
- return true;
- }
-
- };
-
-
- /**
- * Displays the privacy items for a list
- * @public
- * @return {boolean}
- */
- self.displayItems = function() {
-
- try {
- // Reset the form
- self.clearForm();
- self.disableForm();
-
- // Initialize
- var code = '';
- var select = $('#privacy .privacy-item select');
- var list = $('#privacy .privacy-head .list-left select').val();
-
- // Reset the item select
- select.html('');
-
- // No list?
- if(!list) {
- return false;
- }
-
- // Reset the list status
- $('#privacy .privacy-active input[type="checkbox"]').removeAttr('checked');
-
- // Display the list status
- var status = ['active', 'default'];
-
- for(var s in status) {
- if(DataStore.getDB(Connection.desktop_hash, 'privacy-marker', status[s]) == list) {
- $('#privacy .privacy-active input[name=' + status[s] + ']').attr('checked', true);
- }
- }
-
- // Try to read the stored items
- var items = Common.XMLFromString(DataStore.getDB(Connection.desktop_hash, 'privacy', list));
-
- // Must retrieve the data?
- if(!items) {
- select.attr('disabled', true);
-
- return self.get(list);
- } else {
- select.removeAttr('disabled');
- }
-
- // Parse the XML data!
- $(items).find('item').each(function() {
- // Read attributes
- var item_type = $(this).attr('type');
- var item_value = $(this).attr('value');
- var item_action = $(this).attr('action');
- var item_order = $(this).attr('order');
-
- // Generate hash
- var item_hash = hex_md5(item_type + item_value + item_action + item_order);
-
- // Read sub-elements
- var item_presencein = $(this).find('presence-in').size();
- var item_presenceout = $(this).find('presence-out').size();
- var item_message = $(this).find('message').size();
- var item_iq = $(this).find('iq').size();
-
- // Apply default values (if missing)
- if(!item_type)
- item_type = '';
- if(!item_value)
- item_value = '';
- if(!item_action)
- item_action = 'allow';
- if(!item_order)
- item_order = '1';
-
- // Apply sub-elements values
- if(item_presencein)
- item_presencein = 'true';
- else
- item_presencein = 'false';
-
- if(item_presenceout)
- item_presenceout = 'true';
- else
- item_presenceout = 'false';
-
- if(item_message)
- item_message = 'true';
- else
- item_message = 'false';
-
- if(item_iq)
- item_iq = 'true';
- else
- item_iq = 'false';
-
- // Generate item description
- var desc = '';
- var desc_arr = [item_type, item_value, item_action, item_order];
-
- for(var d in desc_arr) {
- // Nothing to display?
- if(!desc_arr[d])
- continue;
-
- if(desc)
- desc += ' - ';
-
- desc += desc_arr[d];
- }
-
- // Add the select option
- code += '' +
- desc +
- ' ';
- });
-
- // Append the code
- select.append(code);
-
- // Display the first item form
- var first_item = select.find('option:first');
- self.displayForm(
- first_item.attr('data-type'),
- first_item.attr('data-value'),
- first_item.attr('data-action'),
- first_item.attr('data-order'),
- first_item.attr('data-presence_in'),
- first_item.attr('data-presence_out'),
- first_item.attr('data-message'),
- first_item.attr('data-iq')
- );
-
- return true;
- } catch(e) {
- Console.error('Privacy.displayItems', e);
- }
-
- };
-
-
- /**
- * Displays the privacy form for an item
- * @public
- * @param {string} type
- * @param {string} value
- * @param {string} action
- * @param {string} order
- * @param {string} presence_in
- * @param {string} presence_out
- * @param {string} message
- * @param {string} iq
- * @return {undefined}
- */
- self.displayForm = function(type, value, action, order, presence_in, presence_out, message, iq) {
-
- try {
- // Reset the form
- self.clearForm();
-
- // Apply the action
- $('#privacy .privacy-first input[name="action"][value="' + action + '"]').attr('checked', true);
-
- // Apply the type & value
- var privacy_second = '#privacy .privacy-second';
- var privacy_type = privacy_second + ' input[name="type"]';
- var type_check, value_input;
-
- switch(type) {
- case 'jid':
- type_check = privacy_type + '[value="jid"]';
- value_input = privacy_second + ' input[type="text"][name="jid"]';
-
- break;
-
- case 'group':
- type_check = privacy_type + '[value="group"]';
- value_input = privacy_second + ' select[name="group"]';
-
- break;
-
- case 'subscription':
- type_check = privacy_type + '[value="subscription"]';
- value_input = privacy_second + ' select[name="subscription"]';
-
- break;
-
- default:
- type_check = privacy_type + '[value="everybody"]';
-
- break;
- }
-
- // Check the target
- $(type_check).attr('checked', true);
-
- // Can apply a value?
- if(value_input) {
- $(value_input).val(value);
- }
-
- // Apply the things to do
- var privacy_do = '#privacy .privacy-third input[type="checkbox"]';
-
- if(presence_in == 'true')
- $(privacy_do + '[name="send-status"]').attr('checked', true);
- if(presence_out == 'true')
- $(privacy_do + '[name="see-status"]').attr('checked', true);
- if(message == 'true')
- $(privacy_do + '[name="send-messages"]').attr('checked', true);
- if(iq == 'true')
- $(privacy_do + '[name="send-queries"]').attr('checked', true);
-
- if(!$(privacy_do).filter(':checked').size())
- $(privacy_do + '[name="everything"]').attr('checked', true);
-
- // Apply the order
- $('#privacy .privacy-active input[name="order"]').val(order);
-
- // Enable the forms
- $('#privacy .privacy-form input, #privacy .privacy-form select, #privacy .privacy-active input').removeAttr('disabled');
- } catch(e) {
- Console.error('Privacy.displayForm', e);
- }
-
- };
-
-
- /**
- * Clears the privacy list form
- * @public
- * @return {undefined}
- */
- self.clearForm = function() {
-
- try {
- // Uncheck checkboxes & radio inputs
- $('#privacy .privacy-form input[type="checkbox"], #privacy .privacy-form input[type="radio"]').removeAttr('checked');
-
- // Reset select
- $('#privacy .privacy-form select option').removeAttr('selected');
- $('#privacy .privacy-form select option:first').attr('selected', true);
-
- // Reset text input
- $('#privacy .privacy-form input[type="text"]').val('');
-
- // Reset order input
- $('#privacy .privacy-active input[name="order"]').val('1');
- } catch(e) {
- Console.error('Privacy.clearForm', e);
- }
-
- };
-
-
- /**
- * Disables the privacy list form
- * @public
- * @return {undefined}
- */
- self.disableForm = function() {
-
- try {
- $('#privacy .privacy-form input, #privacy .privacy-form select, #privacy .privacy-active input').attr('disabled', true);
- } catch(e) {
- Console.error('Privacy.disableForm', e);
- }
-
- };
-
-
- /**
- * Enables the privacy list form
- * @public
- * @param {string} rank
- * @return {undefined}
- */
- self.enableForm = function(rank) {
-
- try {
- $('#privacy .privacy-' + rank + ' input, #privacy .privacy-' + rank + ' select').removeAttr('disabled');
- } catch(e) {
- Console.error('Privacy.enableForm', e);
- }
-
- };
-
-
- /**
- * Plugin launcher
- * @public
- * @return {undefined}
- */
- self.instance = function() {
-
- try {
- // Click events
- $('#privacy .bottom .finish').click(Privacy.close);
-
- // Placeholder events
- $('#privacy input[placeholder]').placeholder();
-
- // Form events
- $('#privacy .privacy-head a.list-remove').click(function() {
- // Get list name
- var list = $('#privacy .privacy-head .list-left select').val();
-
- // No value?
- if(!list) {
- return false;
- }
-
- // Remove it from popup
- $('#privacy .privacy-head .list-left select option[value="' + list + '"]').remove();
-
- // Nothing remaining?
- if(!Common.exists('#privacy .privacy-head .list-left select option'))
- $('#privacy .privacy-head .list-left select option').attr('disabled', true);
-
- // Empty the item select
- $('#privacy .privacy-item select').attr('disabled', true).html('');
-
- // Disable this list before removing it
- var status = ['active', 'default'];
-
- for(var s in status) {
- if(DataStore.getDB(Connection.desktop_hash, 'privacy-marker', status[s]) == list) {
- self.change('', status[s]);
- }
- }
-
- // Remove from server
- self.set(list);
-
- // Reset the form
- self.clearForm();
- self.disableForm();
-
- return false;
- });
-
- $('#privacy .privacy-head .list-right input').keyup(function(e) {
- // Not enter?
- if(e.keyCode != 13) {
- return;
- }
-
- // Get list name
- var list = $('#privacy .privacy-head .list-right input').val();
- var select = '#privacy .privacy-head .list-left select';
- var existed = true;
-
- // Create the new element
- if(!Common.exists(select + ' option[value="' + list + '"]')) {
- // Marker
- existed = false;
-
- // Create a new option
- $(select).append('' + list.htmlEnc() + ' ');
-
- // Reset the item select
- $('#privacy .privacy-item select').attr('disabled', true).html('');
- }
-
- // Change the select value & enable it
- $(select).val(list).removeAttr('disabled');
-
- // Reset its value
- $(this).val('');
-
- // Reset the form
- self.clearForm();
- self.disableForm();
-
- // Must reload the list items?
- if(existed) {
- self.displayItems();
- $('#privacy .privacy-item select').removeAttr('disabled');
- }
- });
-
- $('#privacy .privacy-head .list-left select').change(self.displayItems);
-
- $('#privacy .privacy-item select').change(function() {
- // Get the selected item
- var item = $(this).find('option:selected');
-
- // Display the data!
- self.displayForm(
- item.attr('data-type'),
- item.attr('data-value'),
- item.attr('data-action'),
- item.attr('data-order'),
- item.attr('data-presence_in'),
- item.attr('data-presence_out'),
- item.attr('data-message'),
- item.attr('data-iq')
- );
- });
-
- $('#privacy .privacy-item a.item-add').click(function() {
- // Cannot add anything?
- if(!Common.exists('#privacy .privacy-head .list-left select option:selected')) {
- return false;
- }
-
- // Disable item select
- $('#privacy .privacy-item select').attr('disabled', true);
-
- // Reset the form
- self.clearForm();
- self.disableForm();
-
- // Enable first form item
- self.enableForm('first');
- self.enableForm('active');
-
- return false;
- });
-
- $('#privacy .privacy-item a.item-remove').click(function() {
- // Cannot add anything?
- if(!Common.exists('#privacy .privacy-head .list-left select option:selected')) {
- return false;
- }
-
- // Get values
- var list = $('#privacy .privacy-head .list-left select').val();
- var selected = $('#privacy .privacy-item select option:selected');
- var item = selected.attr('data-value');
- var hash = selected.attr('data-hash');
-
- // Remove it from popup
- $('#privacy .privacy-item select option:selected').remove();
-
- // No more items in this list?
- if(!Common.exists('#privacy .privacy-item select option')) {
- // Disable this select
- $('#privacy .privacy-item select').attr('disabled', true);
-
- // Remove the privacy list select item
- $('#privacy .privacy-head .list-left select option[value="' + list + '"]').remove();
-
- // No more privacy lists?
- if(!Common.exists('#privacy .privacy-head .list-left select option')) {
- $('#privacy .privacy-head .list-left select').attr('disabled', true);
- }
-
- // Disable this list before removing it
- var status = ['active', 'default'];
-
- for(var s in status) {
- if(DataStore.getDB(Connection.desktop_hash, 'privacy-marker', status[s]) == list) {
- self.change('', status[s]);
- }
- }
- }
-
- // Synchronize it with server
- self.push(list, [], [item], [], [], [], [], [], [], hash, 'remove');
-
- // Reset the form
- self.clearForm();
- self.disableForm();
-
- return false;
- });
-
- $('#privacy .privacy-item a.item-save').click(function() {
- // Canot push item?
- if(Common.exists('#privacy .privacy-form input:disabled')) {
- return false;
- }
-
- // Get the hash
- var item_hash = '';
-
- if(!$('#privacy .privacy-item select').is(':disabled')) {
- item_hash = $('#privacy .privacy-item select option:selected').attr('data-hash');
- }
-
- // Read the form
- var privacy_second = '#privacy .privacy-second';
- var item_list = $('#privacy .privacy-head .list-left select').val();
- var item_action = $('#privacy .privacy-first input[name="action"]').filter(':checked').val();
- var item_type = $(privacy_second + ' input[name="type"]').filter(':checked').val();
- var item_order = $('#privacy .privacy-active input[name="order"]').val();
- var item_value = '';
-
- // Switch the type to get the value
- switch(item_type) {
- case 'jid':
- item_value = $(privacy_second + ' input[type="text"][name="jid"]').val();
-
- break;
-
- case 'group':
- item_value = $(privacy_second + ' select[name="group"]').val();
-
- break;
-
- case 'subscription':
- item_value = $(privacy_second + ' select[name="subscription"]').val();
-
- break;
-
- default:
- item_type = '';
-
- break;
- }
-
- // Get the selected things to do
- var privacy_third_cb = '#privacy .privacy-third input[type="checkbox"]';
- var item_prin = false;
- var item_prout = false;
- var item_msg = false;
- var item_iq = false;
-
- // Individual select?
- if(!$(privacy_third_cb + '[name="everything"]').filter(':checked').size()) {
- if($(privacy_third_cb + '[name="send-messages"]').filter(':checked').size())
- item_msg = true;
- if($(privacy_third_cb + '[name="send-queries"]').filter(':checked').size())
- item_iq = true;
- if($(privacy_third_cb + '[name="send-queries"]').filter(':checked').size())
- item_iq = true;
- if($(privacy_third_cb + '[name="see-status"]').filter(':checked').size())
- item_prout = true;
- if($(privacy_third_cb + '[name="send-status"]').filter(':checked').size())
- item_prin = true;
- }
-
- // Push item to the server!
- self.push(
- item_list,
- [item_type],
- [item_value],
- [item_action],
- [item_order],
- [item_prin],
- [item_prout],
- [item_msg],
- [item_iq],
- item_hash
- );
-
- return false;
- });
-
- $('#privacy .privacy-first input').change(function() {
- self.enableForm('second');
- });
-
- $('#privacy .privacy-second input').change(function() {
- self.enableForm('third');
- });
-
- $('#privacy .privacy-third input[type="checkbox"]').change(function() {
- // Target
- var target = '#privacy .privacy-third input[type="checkbox"]';
-
- // Must tick "everything" checkbox?
- if(!$(target).filter(':checked').size()) {
- $(target + '[name="everything"]').attr('checked', true);
- }
-
- // Must untick the other checkboxes?
- else if($(this).is('[name="everything"]')) {
- $(target + ':not([name="everything"])').removeAttr('checked');
- }
-
- // Must untick "everything" checkbox?
- else {
- $(target + '[name="everything"]').removeAttr('checked');
- }
- });
-
- $('#privacy .privacy-active input[name="order"]').keyup(function() {
- // Get the value
- var value = $(this).val();
-
- // No value?
- if(!value) {
- return;
- }
-
- // Not a number?
- if(isNaN(value)) {
- value = 1;
- } else {
- value = parseInt(value);
- }
-
- // Negative?
- if(value < 0)
- value = value * -1;
-
- // Apply the filtered value
- $(this).val(value);
- })
-
- .blur(function() {
- // No value?
- if(!$(this).val()) {
- $(this).val('1');
- }
- });
-
- $('#privacy .privacy-active .privacy-active-elements input').change(function() {
- // Get the values
- var list_name = $('#privacy .privacy-head .list-left select').val();
- var state_name = $(this).attr('name');
-
- // Cannot continue?
- if(!list_name || !state_name) {
- return;
- }
-
- // Change the current list status
- if($(this).filter(':checked').size()) {
- self.change(list_name, state_name);
- } else {
- self.change('', state_name);
- }
- });
- } catch(e) {
- Console.error('Privacy.instance', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/pubsub.js b/source/app/javascripts/pubsub.js
deleted file mode 100644
index f80fc2d..0000000
--- a/source/app/javascripts/pubsub.js
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the Pubsub JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Pubsub = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Setups a Pubsub node
- * @public
- * @param {string} entity
- * @param {object} node
- * @param {boolean} persist
- * @param {number} maximum
- * @param {string} access
- * @param {string} publish
- * @param {boolean} create
- * @return {undefined}
- */
- self.setup = function(entity, node, persist, maximum, access, publish, create) {
-
- /* REF: http://xmpp.org/extensions/xep-0060.html#owner-create-and-configure */
-
- try {
- // Create the PubSub node
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- // Any external entity?
- if(entity) {
- iq.setTo(entity);
- }
-
- // Create it?
- var pubsub;
-
- if(create) {
- pubsub = iq.appendNode('pubsub', {'xmlns': NS_PUBSUB});
- pubsub.appendChild(iq.buildNode('create', {'xmlns': NS_PUBSUB, 'node': node}));
- } else {
- pubsub = iq.appendNode('pubsub', {'xmlns': NS_PUBSUB_OWNER});
- }
-
- // Configure it!
- var configure = pubsub.appendChild(iq.buildNode('configure', {'node': node, 'xmlns': NS_PUBSUB}));
- var x = configure.appendChild(iq.buildNode('x', {'xmlns': NS_XDATA, 'type': 'submit'}));
-
- var field1 = x.appendChild(iq.buildNode('field', {'var': 'FORM_TYPE', 'type': 'hidden', 'xmlns': NS_XDATA}));
- field1.appendChild(iq.buildNode('value', {'xmlns': NS_XDATA}, NS_PUBSUB_NC));
-
- // Persist items?
- if(persist) {
- var field2 = x.appendChild(iq.buildNode('field', {'var': 'pubsub#persist_items', 'xmlns': NS_XDATA}));
- field2.appendChild(iq.buildNode('value', {'xmlns': NS_XDATA}, persist));
- }
-
- // Maximum items?
- if(maximum) {
- var field3 = x.appendChild(iq.buildNode('field', {'var': 'pubsub#max_items', 'xmlns': NS_XDATA}));
- field3.appendChild(iq.buildNode('value', {'xmlns': NS_XDATA}, maximum));
- }
-
- // Access rights?
- if(access) {
- var field4 = x.appendChild(iq.buildNode('field', {'var': 'pubsub#access_model', 'xmlns': NS_XDATA}));
- field4.appendChild(iq.buildNode('value', {'xmlns': NS_XDATA}, access));
- }
-
- // Publish rights?
- if(publish) {
- var field5 = x.appendChild(iq.buildNode('field', {'var': 'pubsub#publish_model', 'xmlns': NS_XDATA}));
- field5.appendChild(iq.buildNode('value', {'xmlns': NS_XDATA}, publish));
- }
-
- con.send(iq);
- } catch(e) {
- Console.error('Pubsub.setup', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/receipts.js b/source/app/javascripts/receipts.js
deleted file mode 100644
index 834ef23..0000000
--- a/source/app/javascripts/receipts.js
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the receipts JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Receipts = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Checks if we can send a receipt request
- * @public
- * @param {string} hash
- * @return {boolean}
- */
- self.request = function(hash) {
-
- has_support = false;
-
- try {
- // Entity have support for receipt?
- if($('#' + hash + ' .message-area').attr('data-receipts') == 'true') {
- has_support = true;
- }
- } catch(e) {
- Console.error('Receipts.request', e);
- } finally {
- return has_support;
- }
-
- };
-
-
- /**
- * Checks if there is a receipt request
- * @public
- * @param {object} packet
- * @return {boolean}
- */
- self.has = function(packet) {
-
- has_receipt = false;
-
- try {
- // Any receipt request?
- if(packet.getChild('request', NS_URN_RECEIPTS)) {
- has_receipt = true;
- }
- } catch(e) {
- Console.error('Receipts.has', e);
- } finally {
- return has_receipt;
- }
-
- };
-
-
- /**
- * Checks if there is a received reply
- * @public
- * @param {object} packet
- * @return {boolean}
- */
- self.hasReceived = function(packet) {
-
- has_received = false;
-
- try {
- // Any received reply?
- if(packet.getChild('received', NS_URN_RECEIPTS)) {
- has_received = true;
- }
- } catch(e) {
- Console.error('Receipts.received', e);
- } finally {
- return has_received;
- }
-
- };
-
-
- /**
- * Sends a received notification
- * @public
- * @param {string} type
- * @param {string} to
- * @param {string} id
- * @return {undefined}
- */
- self.sendReceived = function(type, to, id) {
-
- try {
- var aMsg = new JSJaCMessage();
- aMsg.setTo(to);
- aMsg.setID(id);
-
- // Any type?
- if(type) {
- aMsg.setType(type);
- }
-
- // Append the received node
- aMsg.appendNode('received', {'xmlns': NS_URN_RECEIPTS, 'id': id});
-
- con.send(aMsg);
-
- Console.log('Sent received to: ' + to);
- } catch(e) {
- Console.error('Receipts.sendReceived', e);
- }
-
- };
-
-
- /**
- * Tells the message has been received
- * @public
- * @param {string} hash
- * @param {string} id
- * @return {boolean}
- */
- self.messageReceived = function(hash, id) {
-
- try {
- // Line selector
- var path = $('#' + hash + ' .one-line[data-id="' + id + '"]');
-
- // Add a received marker
- path.attr('data-received', 'true')
- .removeAttr('data-lost');
-
- // Group selector
- var group = path.parent();
-
- // Remove the group marker
- if(!group.find('.one-line[data-lost]').size()) {
- group.find('b.name').removeClass('talk-images')
- .removeAttr('title');
- }
- } catch(e) {
- Console.error('Receipts.messageReceived', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Checks if the message has been received
- * @public
- * @param {string} hash
- * @param {string} id
- * @return {undefined}
- */
- self.checkReceived = function(hash, id) {
-
- try {
- // Fire a check 10 seconds later
- $('#' + hash + ' .one-line[data-id="' + id + '"]').oneTime('10s', function() {
- var this_sel = $(this);
-
- // Not received?
- if(this_sel.attr('data-received') != 'true') {
- // Add a "lost" marker
- this_sel.attr('data-lost', 'true');
-
- // Add a warn on the buddy-name
- this_sel.parent().find('b.name').addClass('talk-images')
- .attr(
- 'title',
- Common._e("Your friend seems not to have received your message(s)!")
- );
- }
- });
- } catch(e) {
- Console.error('Receipts.checkReceived', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/roster.js b/source/app/javascripts/roster.js
deleted file mode 100644
index b763117..0000000
--- a/source/app/javascripts/roster.js
+++ /dev/null
@@ -1,1555 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the roster JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Roster = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /* Variables */
- self.blist_all = false;
-
-
- /**
- * Gets the roster items
- * @public
- * @return {undefined}
- */
- self.get = function() {
-
- try {
- var iq = new JSJaCIQ();
-
- iq.setType('get');
- iq.setQuery(NS_ROSTER);
-
- con.send(iq, self.handle);
- } catch(e) {
- Console.error('Roster.get', e);
- }
-
- };
-
-
- /**
- * Handles the roster items
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handle = function(iq) {
-
- try {
- // Parse the roster xml
- $(iq.getQuery()).find('item').each(function() {
- // Get user data
- var this_sel = $(this);
- var user_xid = this_sel.attr('jid');
- var user_subscription = this_sel.attr('subscription');
-
- // Parse roster data & display user
- self.parse(this_sel, 'load');
-
- // Request user microblog (populates channel)
- if(user_xid && ((user_subscription == 'both') || (user_subscription == 'to'))) {
- // Openfire has an issue, forget about it!
- if(Features.getServerName() != 'openfire') {
- Microblog.request(user_xid, 1, null, Microblog.handleRoster);
- }
- }
- });
-
- // Update our avatar (if changed), and send our presence
- Avatar.get(Common.getXID(), 'force', 'true', 'forget');
-
- Console.log('Roster received.');
- } catch(e) {
- Console.error('Roster.handle', e);
- }
-
- };
-
-
- /**
- * Parses the group XML and display the roster
- * @public
- * @param {string} current
- * @param {string} mode
- * @return {undefined}
- */
- self.parse = function(current, mode) {
-
- try {
- // Get the values
- xid = current.attr('jid');
- dName = current.attr('name');
- subscription = current.attr('subscription');
- xidHash = hex_md5(xid);
-
- // Create an array containing the groups
- var groups = [];
-
- current.find('group').each(function() {
- var group_text = $(this).text();
-
- if(group_text) {
- groups.push(group_text);
- }
- });
-
- // No group?
- if(!groups.length) {
- groups.push(Common._e("Unclassified"));
- }
-
- // If no name is defined, we get the default nick of the buddy
- if(!dName) {
- dName = Common.getXIDNick(xid);
- }
-
- self.display(xid, xidHash, dName, subscription, groups, mode);
- } catch(e) {
- Console.error('Roster.parse', e);
- }
-
- };
-
-
- /**
- * Updates the roster groups
- * @public
- * @return {undefined}
- */
- self.updateGroups = function() {
-
- try {
- $('#roster .one-group').each(function() {
- var this_sel = $(this);
-
- // Current values
- var check = this_sel.find('.buddy').size();
- var hidden = this_sel.find('.buddy:not(.hidden-buddy:hidden)').size();
-
- // Special case: the filtering tool
- if(Search.search_filtered) {
- hidden = this_sel.find('.buddy:visible').size();
- }
-
- // If the group is empty
- if(!check) {
- this_sel.remove();
- }
-
- // If the group contains no online buddy (and is not just hidden)
- if(!hidden && this_sel.find('a.group').hasClass('minus')) {
- this_sel.hide();
- } else {
- this_sel.show();
- }
- });
- } catch(e) {
- Console.error('Roster.updateGroups', e);
- }
-
- };
-
-
- /**
- * Displays a defined roster item
- * @public
- * @param {string} dXID
- * @param {string} dXIDHash
- * @param {string} dName
- * @param {string} dSubscription
- * @param {string} dGroup
- * @param {string} dMode
- * @return {undefined}
- */
- self.display = function(dXID, dXIDHash, dName, dSubscription, dGroup, dMode) {
-
- try {
- // First remove the buddy
- $('#roster .' + dXIDHash).remove();
-
- // Define some things around the groups
- var is_gateway = Common.isGateway(dXID);
- var gateway = '';
-
- if(is_gateway) {
- gateway = ' gateway';
- dGroup = new Array(Common._e("Gateways"));
- }
-
- // Remove request
- if(dSubscription == 'remove') {
- // Flush presence
- Presence.flush(dXID);
- Presence.funnel(dXID, dXIDHash);
-
- // Empty social channel
- $('#channel .mixed .one-update.update_' + dXIDHash).remove();
- }
-
- // Other request
- else {
- // Is this buddy blocked?
- var privacy_class = '';
- var privacy_state = Privacy.status('block', dXID);
-
- if(privacy_state == 'deny') {
- privacy_class = ' blocked';
- }
-
- // For each group this buddy has
- $.each(dGroup, function(i, cGroup) {
- if(cGroup) {
- // Process some vars
- var groupHash = 'group' + hex_md5(cGroup);
- var groupContent = '#roster .' + groupHash;
- var groupBuddies = groupContent + ' .group-buddies';
-
- // Is this group blocked?
- if((Privacy.status('block', cGroup) == 'deny') && (privacy_state != 'allow')) {
- privacy_class = ' blocked';
- }
-
- // Group not yet displayed
- if(!Common.exists(groupContent)) {
- // Define some things
- var groupCont = '#roster .content';
- var groupToggle = groupCont + ' .' + groupHash + ' a.group';
-
- // Create the HTML markup of the group
- $(groupCont).prepend(
- ''
- );
-
- // Create the click event which will hide and show the content
- $(groupToggle).click(function() {
- var group = $(groupBuddies);
- var group_toggle = $(groupContent + ' a.group');
-
- // We must hide the buddies
- if(group_toggle.hasClass('minus')) {
- group.hide();
- group_toggle.removeClass('minus').addClass('plus');
-
- // Remove the group opened buddy-info
- Bubble.close();
- }
-
- // We must show the buddies
- else {
- group_toggle.removeClass('plus').addClass('minus');
- group.show();
- }
-
- return false;
- });
- }
-
- // Initialize the HTML code
- var name_code = '' + dName.htmlEnc() + '
';
- var presence_code = '' + Common._e("Unavailable") + '
';
-
- var html = '' +
- '
';
-
- // Display avatar if not gateway
- if(!is_gateway) {
- html += '
' +
- '
' +
- '
';
- }
-
- html += '
';
-
- // Special gateway code
- if(is_gateway) {
- html += presence_code +
- name_code;
- } else {
- html += name_code +
- presence_code;
- }
-
- html += '
';
-
- // Create the DOM element for this buddy
- $(groupBuddies).append(html);
-
- // Apply the hover event
- self.applyBuddyHover(dXID, dXIDHash, dName, dSubscription, dGroup, groupHash);
- }
- });
-
- // Click event on this buddy
- $('#roster .' + dXIDHash + ' .buddy-click').click(function() {
- return Chat.checkCreate(dXID, 'chat');
- });
-
- // We get the user presence if necessary
- if(dMode == 'presence') {
- Presence.funnel(dXID, dXIDHash);
- }
-
- // If the buddy must be shown
- if(self.blist_all) {
- $('#roster .' + dXIDHash).show();
- }
- }
-
- // We update our groups
- if(!Search.search_filtered) {
- self.updateGroups();
- } else {
- Search.funnelFilterBuddy();
- }
- } catch(e) {
- Console.error('Roster.display', e);
- }
-
- };
-
-
- /**
- * Applies the buddy editing input events
- * @public
- * @param {string} xid
- * @return {undefined}
- */
- self.applyBuddyInput = function(xid) {
-
- try {
- // Initialize
- var path = '#roster .buddy[data-xid="' + escape(xid) + '"]';
- var rename = path + ' .bm-rename input';
- var group = path + ' .bm-group input';
- var manage_infos = path + ' .manage-infos';
- var bm_choose = manage_infos + ' div.bm-choose';
-
- // Keyup events
- $(rename).keyup(function(e) {
- if(e.keyCode == 13) {
- // Send the item
- self.send(xid, '', $.trim($(rename).val()), self.thisBuddyGroups(xid));
-
- // Remove the buddy editor
- Bubble.close();
-
- return false;
- }
- });
-
- $(group).keyup(function(e) {
- if(e.keyCode == 13) {
- // Empty input?
- if(!$.trim($(this).val())) {
- // Send the item
- self.send(xid, '', $.trim($(rename).val()), self.thisBuddyGroups(xid));
-
- // Remove the buddy editor
- Bubble.close();
-
- return false;
- }
-
- // Get the values
- var this_value = $.trim($(this).val());
- var escaped_value = escape(this_value);
-
- // Check if the group yet exists
- var group_exists = false;
-
- $(bm_choose + ' label span').each(function() {
- if($(this).text() == this_value)
- group_exists = true;
- });
-
- // Create a new checked checkbox
- if(!group_exists) {
- $(bm_choose).prepend('' + this_value.htmlEnc() + ' ');
- }
-
- // Check the checkbox
- $(bm_choose + ' input[data-group="' + escaped_value + '"]').attr('checked', true);
-
- // Reset the value of this input
- $(this).val('');
-
- return false;
- }
- });
-
- // Click events
- $(manage_infos + ' p.bm-authorize a.to').click(function() {
- Bubble.close();
- Presence.sendSubscribe(xid, 'subscribed');
-
- return false;
- });
-
- $(manage_infos + ' p.bm-authorize a.from').click(function() {
- Bubble.close();
- Presence.sendSubscribe(xid, 'subscribe');
-
- return false;
- });
-
- $(manage_infos + ' p.bm-authorize a.unblock').click(function() {
- Bubble.close();
-
- // Update privacy settings
- Privacy.push('block', ['jid'], [xid], ['allow'], [false], [true], [true], [true], '', 'roster');
- $(path).removeClass('blocked');
-
- // Enable the "block" list
- Privacy.change('block', 'active');
- Privacy.change('block', 'default');
-
- // Send an available presence
- Presence.send(xid, 'available', Presence.getUserShow(), getUserStatus());
-
- return false;
- });
-
- $(manage_infos + ' p.bm-remove a.remove').click(function() {
- Bubble.close();
-
- // First unregister if gateway
- if(Common.isGateway(xid)) {
- self.unregisterGateway(xid);
- }
-
- // Then send roster removal query
- self.send(xid, 'remove');
-
- return false;
- });
-
- $(manage_infos + ' p.bm-remove a.prohibit').click(function() {
- Bubble.close();
- Presence.sendSubscribe(xid, 'unsubscribed');
-
- return false;
- });
-
- $(manage_infos + ' p.bm-remove a.block').click(function() {
- Bubble.close();
-
- // Update privacy settings
- Privacy.push('block', ['jid'], [xid], ['deny'], [false], [true], [true], [true], '', 'roster');
- $(path).addClass('blocked');
-
- // Enable the "block" list
- Privacy.change('block', 'active');
- Privacy.change('block', 'default');
-
- // Send an unavailable presence
- Presence.send(xid, 'unavailable');
-
- // Remove the user presence
- var db_regex = new RegExp(('^' + Connection.desktop_hash + '_') + 'presence' + ('_(.+)'));
-
- for(var i = 0; i < DataStore.storageDB.length; i++) {
- // Get the pointer values
- var current = DataStore.storageDB.key(i);
-
- // If the pointer is on a stored presence
- if(current.match(db_regex)) {
- if(Common.bareXID(RegExp.$1) == xid) {
- DataStore.storageDB.removeItem(current);
- }
- }
- }
-
- // Manage his new presence
- Presence.funnel(xid, hex_md5(xid));
-
- return false;
- });
-
- $(manage_infos + ' a.save').click(function() {
- // Send the item
- self.send(xid, '', $.trim($(rename).val()), self.thisBuddyGroups(xid));
-
- // Remove the buddy editor
- Bubble.close();
-
- return false;
- });
- } catch(e) {
- Console.error('Roster.applyBuddyInput', e);
- }
-
- };
-
-
- /**
- * Applies the buddy editing hover events
- * @public
- * @param {string} xid
- * @param {string} hash
- * @param {string} nick
- * @param {string} subscription
- * @param {object} groups
- * @param {string} group_hash
- * @return {undefined}
- */
- self.applyBuddyHover = function(xid, hash, nick, subscription, groups, group_hash) {
-
- try {
- // Generate the values
- var bPath = '#roster .' + group_hash + ' .buddy[data-xid="' + escape(xid) + '"]';
- var iPath = bPath + ' .buddy-infos';
-
- // Apply the hover event
- $(bPath).hover(function() {
- // Another bubble exist
- if(Common.exists('#roster .buddy-infos')) {
- return false;
- }
-
- $(bPath).oneTime(200, function() {
- // Another bubble exist
- if(Common.exists('#roster .buddy-infos')) {
- return false;
- }
-
- // Add this bubble!
- Bubble.show(iPath);
-
- // Create the buddy infos DOM element
- $(bPath).append(
- ''
- );
-
- // Sets the good position
- self.buddyInfosPosition(xid, group_hash);
-
- // Get the presence
- Presence.funnel(xid, hash);
-
- // Get the PEP infos
- PEP.displayAll(xid);
-
- // Click events
- $(bPath + ' .bi-view a').click(function() {
- var this_sel = $(this);
-
- // Renitialize the buddy infos
- Bubble.close();
-
- // Profile
- if(this_sel.is('.profile')) {
- UserInfos.open(xid);
- }
-
- // Channel
- else if(this_sel.is('.channel')) {
- Microblog.fromInfos(xid, hash);
- }
-
- // Command
- else if(this_sel.is('.commands')) {
- AdHoc.retrieve(xid);
- }
-
- return false;
- });
-
- // Jingle events
- $(bPath + ' .bi-jingle a').click(function() {
- var this_sel = $(this);
-
- // Renitialize the buddy infos
- Bubble.close();
-
- // Audio call?
- if(this_sel.is('.audio')) {
- Jingle.start(xid, 'audio');
- }
-
- // Video call?
- else if(this_sel.is('.video')) {
- Jingle.start(xid, 'video');
- }
-
- return false;
- });
-
- $(bPath + ' .bi-edit a').click(function() {
- self.buddyEdit(xid, nick, subscription, groups);
-
- return false;
- });
- });
- }, function() {
- if(!Common.exists(iPath + ' .manage-infos')) {
- Bubble.close();
- }
-
- $(bPath).stopTime();
- });
- } catch(e) {
- Console.error('Roster.applyBuddyHover', e);
- }
-
- };
-
-
- /**
- * Sets the good buddy-infos position
- * @public
- * @param {string} xid
- * @param {string} group_hash
- * @return {undefined}
- */
- self.buddyInfosPosition = function(xid, group_hash) {
-
- try {
- // Paths
- var group = '#roster .' + group_hash;
- var buddy = group + ' .buddy[data-xid="' + escape(xid) + '"]';
- var buddy_infos = buddy + ' .buddy-infos';
-
- // Get the offset to define
- var offset = 3;
-
- if(Common.isGateway(xid)) {
- offset = -8;
- }
-
- // Process the position
- var v_position = $(buddy).position().top + offset;
- var h_position = $(buddy).width() - 10;
-
- // Apply the top position
- $(buddy_infos).css('top', v_position);
-
- // Apply the left/right position
- if($('html').attr('dir') == 'rtl') {
- $(buddy_infos).css('right', h_position);
- } else {
- $(buddy_infos).css('left', h_position);
- }
- } catch(e) {
- Console.error('Roster.buddyInfosPosition', e);
- }
-
- };
-
-
- /**
- * Generates an array of the current groups of a buddy
- * @public
- * @param {string} xid
- * @return {undefined}
- */
- self.thisBuddyGroups = function(xid) {
-
- try {
- var path = '#roster .buddy[data-xid="' + escape(xid) + '"] ';
- var array = [];
-
- // Each checked checkboxes
- $(path + 'div.bm-choose input[type="checkbox"]').filter(':checked').each(function() {
- array.push(
- unescape($(this).attr('data-group'))
- );
- });
-
- // Entered input value (and not yet in the array)
- var value = $.trim($(path + 'p.bm-group input').val());
-
- if(value && !Utils.existArrayValue(array, value)) {
- array.push(value);
- }
-
- return array;
- } catch(e) {
- Console.error('Roster.thisBuddyGroups', e);
- }
-
- };
-
-
- /**
- * Adds a given contact to our roster
- * @public
- * @param {string} xid
- * @param {string} name
- * @return {undefined}
- */
- self.addThisContact = function(xid, name) {
-
- try {
- Console.info('Add this contact: ' + xid + ', as ' + name);
-
- // Cut the resource of this XID
- xid = Common.bareXID(xid);
-
- // If the form is complete
- if(xid) {
- // We send the subscription
- Presence.sendSubscribe(xid, 'subscribe');
- self.send(xid, '', name);
-
- // We hide the bubble
- Bubble.close();
- }
- } catch(e) {
- Console.error('Roster.addThisContact', e);
- }
-
- };
-
-
- /**
- * Gets an array of all the groups in the roster
- * @public
- * @param {type} name
- * @return {undefined}
- */
- self.getAllGroups = function() {
-
- try {
- var groups = [];
-
- $('#roster .one-group').each(function() {
- var current = unescape(
- $(this).attr('data-group')
- );
-
- if((current != Common._e("Unclassified")) && (current != Common._e("Gateways"))) {
- groups.push(current);
- }
- });
-
- return groups.sort();
- } catch(e) {
- Console.error('Roster.getAllGroups', e);
- }
-
- };
-
-
- /**
- * Edits buddy informations
- * @public
- * @param {string} xid
- * @param {string} nick
- * @param {string} subscription
- * @param {object} groups
- * @return {undefined}
- */
- self.buddyEdit = function(xid, nick, subscription, groups) {
-
- try {
- Console.info('Buddy edit: ' + xid);
-
- // Initialize
- var path = '#roster .buddy[data-xid="' + escape(xid) + '"] .';
- var html = '';
-
- // Get the privacy state
- var privacy_state = Privacy.status('block', xid);
- var privacy_active = DataStore.getDB(Connection.desktop_hash, 'privacy-marker', 'available');
-
- // Get the group privacy state
- for(var g in groups) {
- if((Privacy.status('block', groups[g]) == 'deny') && (privacy_state != 'allow')) {
- privacy_state = 'deny';
- }
- }
-
- // The subscription with this buddy is not full
- if((subscription != 'both') || ((privacy_state == 'deny') && privacy_active)) {
- var authorize_links = '';
- html += '
';
-
- // Link to allow to see our status
- if((subscription == 'to') || (subscription == 'none')) {
- authorize_links += '' + Common._e("Authorize") + ' ';
- }
-
- // Link to ask to see his/her status
- if((subscription == 'from') || (subscription == 'none')) {
- if(authorize_links) {
- authorize_links += ' / ';
- }
-
- authorize_links += '' + Common._e("Ask for authorization") + ' ';
- }
-
- // Link to unblock this buddy
- if((privacy_state == 'deny') && privacy_active) {
- if(authorize_links) {
- authorize_links += ' / ';
- }
-
- html += '' + Common._e("Unblock") + ' ';
- }
-
- html += authorize_links + '
';
- }
-
- // Complete the HTML code
- var remove_links = '';
- html += '
';
- remove_links = '' + Common._e("Remove") + ' ';
-
- // This buddy is allowed to see our presence, we can show a "prohibit" link
- if((subscription == 'both') || (subscription == 'from')) {
- remove_links += ' / ' + Common._e("Prohibit") + ' ';
- }
-
- // Complete the HTML code
- if((privacy_state != 'deny') && privacy_active) {
- if(remove_links) {
- remove_links += ' / ';
- }
-
- remove_links += '' + Common._e("Block") + ' ';
- }
-
- // Complete the HTML code
- html += remove_links +
- '
' +
- '
' + Common._e("Rename") + '
';
-
- // Only show group tool if not a gateway
- if(!Common.isGateway(xid)) {
- html += '
' + Common._e("Groups") + '
' +
- '
';
- }
-
- // Close the DOM element
- html += '
' + Common._e("Save") + ' ' +
- '
';
-
- // We update the DOM elements
- $(path + 'pep-infos').replaceWith(html);
-
- // Gets all the existing groups
- var all_groups = self.getAllGroups();
- var all_groups_dom = '';
-
- for(var a in all_groups) {
- // Current group
- var all_groups_current = all_groups[a];
-
- // Is the current group checked?
- var checked = '';
-
- if(Utils.existArrayValue(groups, all_groups_current)) {
- checked = ' checked="true"';
- }
-
- // Add the current group HTML
- all_groups_dom += '' + all_groups_current.htmlEnc() + ' ';
- }
-
- // Prepend this in the DOM
- var bm_choose = path + 'manage-infos div.bm-choose';
-
- $(bm_choose).prepend(all_groups_dom);
-
- // Apply the editing input events
- self.applyBuddyInput(xid);
- } catch(e) {
- Console.error('Roster.buddyEdit', e);
- }
-
- };
-
-
- /**
- * Unregisters from a given gateway
- * @public
- * @param {string} xid
- * @return {undefined}
- */
- self.unregisterGateway = function(xid) {
-
- try {
- var iq = new JSJaCIQ();
- iq.setType('set');
- iq.setTo(xid);
-
- var query = iq.setQuery(NS_REGISTER);
- query.appendChild(iq.buildNode('remove', {'xmlns': NS_REGISTER}));
-
- con.send(iq);
- } catch(e) {
- Console.error('Roster.unregisterGateway', e);
- }
-
- };
-
-
- /**
- * Updates the roster items
- * @public
- * @param {string} xid
- * @param {string} subscription
- * @param {string} name
- * @param {string} group
- * @return {undefined}
- */
- self.send = function(xid, subscription, name, group) {
-
- try {
- // We send the new buddy name
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- var iqQuery = iq.setQuery(NS_ROSTER);
- var item = iqQuery.appendChild(iq.buildNode('item', {'xmlns': NS_ROSTER, 'jid': xid}));
-
- // Any subscription?
- if(subscription) {
- item.setAttribute('subscription', subscription);
- }
-
- // Any name?
- if(name) {
- item.setAttribute('name', name);
- }
-
- // Any group?
- if(group && group.length) {
- for(var i in group) {
- item.appendChild(iq.buildNode('group', {'xmlns': NS_ROSTER}, group[i]));
- }
- }
-
- con.send(iq);
-
- Console.info('Roster item sent: ' + xid);
- } catch(e) {
- Console.error('Roster.send', e);
- }
-
- };
-
-
- /**
- * Adapts the roster height, depending of the window size
- * @public
- * @return {undefined}
- */
- self.adapt = function() {
-
- try {
- // Process the new height
- var new_height = $('#left-content').height() - $('#my-infos').height() - 97;
-
- // New height too small
- if(new_height < 211) {
- new_height = 211;
- }
-
- // Apply the new height
- $('#roster .content').css('height', new_height);
- } catch(e) {
- Console.error('Roster.adapt', e);
- }
-
- };
-
-
- /**
- * Gets all the buddies in our roster
- * @public
- * @return {object}
- */
- self.getAllBuddies = function() {
-
- try {
- var buddies = [];
-
- $('#roster .buddy').each(function() {
- var xid = unescape($(this).attr('data-xid'));
-
- if(xid) {
- buddies.push(xid);
- }
- });
-
- return buddies;
- } catch(e) {
- Console.error('Roster.getAllBuddies', e);
- }
-
- };
-
-
- /**
- * Returns whether given XID is in buddy list or not
- * @public
- * @param {string} xid
- * @return {boolean}
- */
- self.isFriend = function(xid) {
-
- try {
- return Common.exists('#roster .buddy[data-xid="' + escape(xid) + '"]');
- } catch(e) {
- Console.error('Roster.isFriend', e);
- }
-
- };
-
-
- /**
- * Gets the user gateways
- * @public
- * @return {object}
- */
- self.getGateways = function() {
-
- try {
- // New array
- var gateways = [];
- var buddies = self.getAllBuddies();
-
- // Get the gateways
- for(var c in buddies) {
- if(Common.isGateway(buddies[c])) {
- gateways.push(buddies[c]);
- }
- }
-
- return gateways;
- } catch(e) {
- Console.error('Roster.getGateways', e);
- }
-
- };
-
-
- /**
- * Instanciate the roster
- * @public
- * @return {undefined}
- */
- self.instance = function() {
-
- try {
- // Filtering tool
- var iFilter = $('#roster .filter input');
- var aFilter = $('#roster .filter a');
-
- iFilter.placeholder()
-
- .blur(function() {
- // Nothing is entered, put the placeholder instead
- if(!$.trim($(this).val())) {
- aFilter.hide();
- } else {
- aFilter.show();
- }
- })
-
- .keyup(function(e) {
- Search.funnelFilterBuddy(e.keyCode);
- });
-
- aFilter.click(function() {
- // Reset the input
- $(this).hide();
- iFilter.val('');
- iFilter.placeholder();
-
- // Security: show all the groups, empty or not
- $('#roster .one-group').show();
-
- // Reset the filtering tool
- Search.resetFilterBuddy();
-
- return false;
- });
-
- // When the user click on the add button, show the contact adding tool
- $('#roster .foot .add').click(function() {
- // Yet displayed?
- if(Common.exists('#buddy-conf-add')) {
- return Bubble.close();
- }
-
- // Add the bubble
- Bubble.show('#buddy-conf-add');
-
- // Append the content
- $('#roster .roster-add').append(
- '' +
- '
' +
-
- '
' +
- '
' + Common._e("Add a friend") + '
' +
-
- '
' + Common._e("Address") + ' ' +
- '
' + Common._e("Name") + ' ' +
- '
' +
- '' + Common._e("Gateway") + ' ' +
- '' +
- '' + Common._e("None") + ' ' +
- ' ' +
- ' ' +
- '
' + Common._e("Getting the name...") + ' ' +
-
- '
' +
- '' + Common._e("Search a friend") + ' ' +
- '
' +
- '
' +
- '
'
- );
-
- // Add the gateways
- var gateways = self.getGateways();
-
- // Any gateway?
- if(gateways.length) {
- // Append the gateways
- for(var i in gateways) {
- $('.add-contact-gateway').append('' + gateways[i].htmlEnc() + ' ');
- }
-
- // Show the gateway selector
- $('.add-contact-gateway').parent().show();
- } else {
- $('.add-contact-gateway').parent().hide();
- }
-
- // Blur event on the add contact input
- $('.add-contact-jid').blur(function() {
- // Read the value
- var value = $.trim($(this).val());
-
- // Try to catch the buddy name
- if(value && !$.trim($('.add-contact-name').val()) && ($('.add-contact-gateway').val() == 'none')) {
- // User XID
- var xid = Common.generateXID(value, 'chat');
-
- // Notice for the user
- $('.add-contact-name-get').attr('data-for', escape(xid)).show();
-
- // Request the user vCard
- Name.getAddUser(xid);
- }
- });
-
- // When a key is pressed...
- $('#buddy-conf-add input, #buddy-conf-add select').keyup(function(e) {
- // Enter : continue
- if(e.keyCode == 13) {
- // Get the values
- var xid = $.trim($('.add-contact-jid').val());
- var name = $.trim($('.add-contact-name').val());
- var gateway = unescape($('.add-contact-gateway').val());
-
- // Generate the XID to add
- if((gateway != 'none') && xid) {
- xid = xid.replace(/@/g, '%') + '@' + gateway;
- } else {
- xid = Common.generateXID(xid, 'chat');
- }
-
- // Submit the form
- if(xid && Common.getXIDNick(xid) && (xid != Common.getXID())) {
- self.addThisContact(xid, name);
- } else {
- $(document).oneTime(10, function() {
- $('.add-contact-jid').addClass('please-complete').focus();
- });
- }
-
- return false;
- }
-
- // Escape : quit
- if(e.keyCode == 27) {
- Bubble.close();
- }
- });
-
- // Click event on search link
- $('.buddy-conf-add-search').click(function() {
- Bubble.close();
- return Directory.open();
- });
-
- // Focus on the input
- $(document).oneTime(10, function() {
- $('.add-contact-jid').focus();
- });
-
- return false;
- });
-
- // When the user click on the join button, show the chat joining tool
- $('#roster .foot .join').click(function() {
- // Yet displayed?
- if(Common.exists('#buddy-conf-join')) {
- return Bubble.close();
- }
-
- // Add the bubble
- Bubble.show('#buddy-conf-join');
-
- // Append the content
- $('#roster .roster-join').append(
- '' +
- '
' +
-
- '
' +
- '
' + Common._e("Join a chat") + '
' +
-
- '
' +
- '
' +
- '' + Common._e("Chat") + ' ' +
- '' + Common._e("Groupchat") + ' ' +
- ' ' +
- '
' +
- '
'
- );
-
- // Input vars
- var destination = '#buddy-conf-join .search';
- var dHovered = destination + ' ul li.hovered:first';
-
- // When a key is pressed...
- $('#buddy-conf-join input, #buddy-conf-join select').keyup(function(e) {
- // Enter: continue
- if(e.keyCode == 13) {
- // Select something from the search
- if(Common.exists(dHovered)) {
- Search.addBuddy(destination, $(dHovered).attr('data-xid'));
- } else {
- var xid = $.trim($('.join-jid').val());
- var type = $('.buddy-conf-join-select').val();
-
- if(xid && type) {
- // Generate a correct XID
- xid = Common.generateXID(xid, type);
-
- // Not me
- if(xid != Common.getXID()) {
- // Update some things
- $('.join-jid').removeClass('please-complete');
- Bubble.close();
-
- // Create a new chat
- Chat.checkCreate(xid, type);
- } else {
- $('.join-jid').addClass('please-complete');
- }
- } else {
- $('.join-jid').addClass('please-complete');
- }
- }
-
- return false;
- }
-
- // Escape: quit
- else if(e.keyCode == 27)
- Bubble.close();
-
- // Buddy search?
- else if($('.buddy-conf-join-select').val() == 'chat') {
- // New buddy search
- if((e.keyCode != 40) && (e.keyCode != 38)) {
- Search.createBuddy(destination);
- }
-
- // Navigating with keyboard in the results
- Search.arrowsBuddy(e, destination);
- }
- });
-
- // Buddy search lost focus
- $('#buddy-conf-join input').blur(function() {
- if(!$(destination + ' ul').attr('mouse-hover'))
- Search.resetBuddy(destination);
- });
-
- // Re-focus on the text input
- $('#buddy-conf-join select').change(function() {
- $(document).oneTime(10, function() {
- $('#buddy-conf-join input').focus();
- });
- });
-
- // We focus on the input
- $(document).oneTime(10, function() {
- $('#buddy-conf-join .join-jid').focus();
- });
-
- return false;
- });
-
- // When the user click on the groupchat button, show the groupchat menu
- $('#roster .foot .groupchat').click(function() {
- // Yet displayed?
- if(Common.exists('#buddy-conf-groupchat')) {
- return Bubble.close();
- }
-
- // Add the bubble
- Bubble.show('#buddy-conf-groupchat');
-
- // Append the content
- $('#roster .roster-groupchat').append(
- ''
- );
-
- // When the user wants to edit his groupchat favorites
- $('.buddy-conf-groupchat-edit').click(function() {
- Favorites.open();
- Bubble.close();
-
- return false;
- });
-
- // Change event
- $('.buddy-conf-groupchat-select').change(function() {
- var groupchat = $.trim($(this).val());
-
- if(groupchat != 'none') {
- // We hide the bubble
- Bubble.close();
-
- // Create the chat
- Chat.checkCreate(groupchat, 'groupchat');
-
- // We reset the select value
- $(this).val('none');
- }
- });
-
- // Load the favorites
- Favorites.load();
-
- return false;
- });
-
- // When the user click on the muji button, show the muji menu
- $('#roster .foot .muji').click(function() {
- // Yet displayed?
- if(Common.exists('#buddy-conf-muji') || Call.is_ongoing()) {
- return Bubble.close();
- }
-
- // Add the bubble
- Bubble.show('#buddy-conf-muji');
-
- // Append the content
- $('#roster .roster-muji').append(
- ''
- );
-
- // When the user wants to launch
- $('.buddy-conf-muji-conference').click(function() {
- var media = $(this).attr('data-media');
-
- var room_name = hex_md5(media + DateUtils.getTimeStamp() + Math.random());
- var room = Common.generateXID(room_name, 'groupchat');
-
- if(media && room && room_name) {
- Muji.start(room, media);
- }
-
- Bubble.close();
-
- return false;
- });
-
- return false;
- });
-
- // When the user click on the more button, show the more menu
- $('#roster .foot .more').click(function() {
- // Yet displayed?
- if(Common.exists('#buddy-conf-more')) {
- return Bubble.close();
- }
-
- // Add the bubble
- Bubble.show('#buddy-conf-more');
-
- // Append the content
- $('#roster .roster-more').append(
- ''
- );
-
- // Close bubble when link clicked
- $('#buddy-conf-more a').click(function() {
- Bubble.close();
- });
-
- // When the user wants to display all his buddies
- $('.buddy-conf-more-display-unavailable').click(function() {
- Interface.showAllBuddies('roster');
-
- return false;
- });
-
- // When the user wants to display only online buddies
- $('.buddy-conf-more-display-available').click(function() {
- Interface.showOnlineBuddies('roster');
-
- return false;
- });
-
- // When the user click on the privacy link
- $('.buddy-conf-more-privacy').click(Privacy.open);
-
- // When the user click on the service discovery link
- $('.buddy-conf-more-service-disco').click(Discovery.open);
-
- // When the user click on the command link
- $('.buddy-conf-more-commands').click(function() {
- AdHoc.server(con.domain);
-
- return false;
- });
-
- // Manage the displayed links
- if(self.blist_all) {
- $('.buddy-conf-more-display-unavailable').hide();
- $('.buddy-conf-more-display-available').show();
- }
-
- if(Features.enabledCommands()) {
- $('.buddy-conf-more-commands').parent().show();
- }
-
- if(DataStore.getDB(Connection.desktop_hash, 'privacy-marker', 'available')) {
- $('.buddy-conf-more-privacy').parent().show();
- }
-
- return false;
- });
-
- // When the user scrolls the buddy list
- $('#roster .content').scroll(function() {
- // Close the opened buddy infos bubble
- Bubble.close();
- });
- } catch(e) {
- Console.error('Roster.instance', e);
- }
-
- };
-
-
- /**
- * Plugin launcher
- * @public
- * @return {undefined}
- */
- self.launch = function() {
-
- try {
- // Window resize event handler
- $(window).resize(self.adapt);
- } catch(e) {
- Console.error('Roster.launch', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
-
-Roster.launch();
\ No newline at end of file
diff --git a/source/app/javascripts/rosterx.js b/source/app/javascripts/rosterx.js
deleted file mode 100644
index b746306..0000000
--- a/source/app/javascripts/rosterx.js
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the Roster Item Exchange JS script for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var RosterX = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Opens the rosterx tools
- * @public
- * @param {string} data
- * @return {undefined}
- */
- self.open = function(data) {
-
- try {
- // Popup HTML content
- var html =
- '' + Common._e("Suggested friends") + '
' +
-
- '' +
-
- '';
-
- // Create the popup
- Popup.create('rosterx', html);
-
- // Associate the events
- self.instance();
-
- // Parse the data
- self.parse(data);
-
- Console.log('Roster Item Exchange popup opened.');
- } catch(e) {
- Console.error('RosterX.open', e);
- }
-
- };
-
-
- /**
- * Closes the rosterx tools
- * @public
- * @return {boolean}
- */
- self.close = function() {
-
- try {
- // Destroy the popup
- Popup.destroy('rosterx');
- } catch(e) {
- Console.error('RosterX.close', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Parses a rosterx query
- * @public
- * @param {string} data
- * @return {undefined}
- */
- self.parse = function(data) {
-
- try {
- // Main selector
- var x = $(data).find('x[xmlns="' + NS_ROSTERX + '"]:first');
-
- // Parse data
- x.find('item').each(function() {
- var this_sel = $(this);
-
- // Generate group XML
- var group = '';
-
- this_sel.find('group').each(function() {
- group += '' + this_sel.text().htmlEnc() + ' ';
- });
-
- if(group) {
- group = '' + group + ' ';
- }
-
- // Display it!
- self.display(
- this_sel.attr('jid'),
- this_sel.attr('name'),
- group,
- this_sel.attr('action')
- );
- });
-
- // Click to check/uncheck
- $('#rosterx .oneresult').click(function(evt) {
- // No need to apply when click on input
- if($(evt.target).is('input[type="checkbox"]')) {
- return;
- }
-
- // Input selector
- var checkbox = $(this).find('input[type="checkbox"]');
-
- // Check or uncheck?
- if(checkbox.filter(':checked').size()) {
- checkbox.removeAttr('checked');
- } else {
- checkbox.attr('checked', true);
- }
- });
- } catch(e) {
- Console.error('RosterX.parse', e);
- }
-
- };
-
-
- /**
- * Displays a rosterx item
- * @public
- * @param {string} xid
- * @param {string} nick
- * @param {string} group
- * @param {string} action
- * @return {boolean}
- */
- self.display = function(xid, nick, group, action) {
-
- try {
- // End if no XID
- if(!xid) {
- return false;
- }
-
- // Set up a default action if no one
- if(!action || (action != 'modify') || (action != 'delete')) {
- action = 'add';
- }
-
- // Override "undefined" for nickname
- if(!nick) {
- nick = '';
- }
-
- // Display it
- $('#rosterx .results').append(
- '' +
- ' ' +
- '' + nick.htmlEnc() + ' ' +
- '' + xid.htmlEnc() + ' ' +
- ' ' +
- '
'
- );
-
- return true;
- } catch(e) {
- Console.error('RosterX.display', e);
- }
-
- };
-
-
- /**
- * Saves the rosterx settings
- * @public
- * @return {boolean}
- */
- self.save = function() {
-
- try {
- // Send the requests
- $('#rosterx .results input[type="checkbox"]').filter(':checked').each(function() {
- var this_sel = $(this);
-
- // Read the attributes
- var nick = this_sel.attr('data-name');
- var xid = this_sel.attr('data-xid');
- var action = this_sel.attr('data-action');
- var group = this_sel.attr('data-group');
-
- // Parse groups XML
- var group_arr = [];
-
- if(group) {
- $(group).find('group').each(function() {
- group_arr.push(this_sel.text().revertHtmlEnc());
- });
- }
-
- // Process the asked action
- var roster_item = $('#roster .' + hex_md5(xid));
-
- switch(action) {
- // Buddy add
- case 'add':
- if(!Common.exists(roster_item)) {
- Presence.sendSubscribe(xid, 'subscribe');
- Roster.send(xid, '', nick, group_arr);
- }
-
- break;
-
- // Buddy edit
- case 'modify':
- if(Common.exists(roster_item))
- Roster.send(xid, '', nick, group_arr);
-
- break;
-
- // Buddy delete
- case 'delete':
- if(Common.exists(roster_item))
- Roster.send(xid, 'remove');
-
- break;
- }
- });
-
- // Close the popup
- self.close();
- } catch(e) {
- Console.error('RosterX.save', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Plugin launcher
- * @public
- * @return {undefined}
- */
- self.instance = function() {
-
- try {
- // Click events
- $('#rosterx .bottom .finish').click(function() {
- var this_sel = $(this);
-
- if(this_sel.is('.save')) {
- return self.save();
- }
-
- if(this_sel.is('.cancel')) {
- return self.close();
- }
- });
-
- $('#rosterx .rosterx-head a').click(function() {
- var this_sel = $(this);
-
- if(this_sel.is('.check')) {
- $('#rosterx .results input[type="checkbox"]').attr('checked', true);
- } else if(this_sel.is('.uncheck')) {
- $('#rosterx .results input[type="checkbox"]').removeAttr('checked');
- }
-
- return false;
- });
- } catch(e) {
- Console.error('RosterX.instance', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/search.js b/source/app/javascripts/search.js
deleted file mode 100644
index 6e8a36c..0000000
--- a/source/app/javascripts/search.js
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the seach tools JS script for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Search = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /* Variables */
- self.search_filtered = false;
-
-
- /**
- * Searches in the user's buddy list
- * @public
- * @param {string} query
- * @return {object}
- */
- self.processBuddy = function(query) {
-
- try {
- // No query submitted?
- if(!query) {
- return;
- }
-
- // Wildcard (*) submitted
- if(query == '*') {
- query = '';
- }
-
- // Replace forbidden characters in regex
- query = Common.escapeRegex(query);
-
- // Create an empty array
- var results = [];
-
- // Search regex
- var regex = new RegExp('((^)|( ))' + query, 'gi');
-
- // Search in the roster
- var buddies = Roster.getAllBuddies();
-
- for(var i in buddies) {
- var xid = buddies[i];
- var nick = Name.getBuddy(xid);
-
- // Buddy match our search, and not yet in the array
- if(nick.match(regex) && !Utils.existArrayValue(results, xid)) {
- results.push(xid);
- }
- }
-
- // Return the results array
- return results;
- } catch(e) {
- Console.error('Search.processBuddy', e);
- }
-
- };
-
-
- /**
- * Resets the buddy search tool
- * @public
- * @param {string} destination
- * @return {undefined}
- */
- self.resetBuddy = function(destination) {
-
- try {
- $(destination + ' ul').remove();
- $(destination + ' input').removeClass('suggested');
- } catch(e) {
- Console.error('Search.resetBuddy', e);
- }
-
- };
-
-
- /**
- * Add the clicked XID to the input
- * @public
- * @param {string} destination
- * @param {string} xid
- * @return {boolean}
- */
- self.addBuddy = function(destination, xid) {
-
- try {
- // Remove the search tool
- self.resetBuddy(destination);
-
- // Define a selector
- var input = $(destination + ' input');
- var value = input.val();
-
- // Get the old value (if there's another value)
- var old = '';
-
- if(value.match(/(^(.+)(,)(\s)?)(\w+)$/)) {
- old = RegExp.$1;
- }
-
- // Add the XID to the "to" input and focus on it
- $(document).oneTime(10, function() {
- input.val(old + xid).focus();
- });
- } catch(e) {
- Console.error('Search.addBuddy', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Creates the appropriate markup for the search results
- * @public
- * @param {string} destination
- * @return {undefined}
- */
- self.createBuddy = function(destination) {
-
- try {
- // Reset the search engine
- self.resetBuddy(destination);
-
- // Get the entered value
- var value = $(destination + ' input').val();
-
- // Separation with a comma?
- if(value.match(/^(.+)((,)(\s)?)(\w+)$/)) {
- value = RegExp.$5;
- }
-
- // Get the result array
- var entered = self.processBuddy(value);
-
- // Display each result (if any)
- if(entered && entered.length) {
- // Set a special class to the search input
- $(destination + ' input').addClass('suggested');
-
- // Append each found buddy in the container
- var regex = new RegExp('((^)|( ))' + value, 'gi');
-
- // Initialize the code generation
- var code = '';
-
- for(var b in entered) {
- // Get some values from the XID
- var current = Name.getBuddy(entered[b]).htmlEnc();
- current = current.replace(regex, '$& ');
-
- // Add the current element to the global code
- code += '' + current + ' ';
- }
-
- // Finish the code generation
- code += ' ';
-
- // Creates the code in the DOM
- $(destination).append(code);
-
- // Put the hover on the first element
- $(destination + ' ul li:first').addClass('hovered');
-
- // Hover event, to not to remove this onblur and loose the click event
- $(destination + ' ul li').hover(function() {
- $(destination + ' ul li').removeClass('hovered');
- $(this).addClass('hovered');
-
- // Add a marker for the blur event
- $(destination + ' ul').attr('mouse-hover', 'true');
- }, function() {
- $(this).removeClass('hovered');
-
- // Remove the mouse over marker
- $(destination + ' ul').removeAttr('mouse-hover');
- });
- }
- } catch(e) {
- Console.error('Search.createBuddy', e);
- }
-
- };
-
-
- /**
- * Handles the keyboard arrows press when searching
- * @public
- * @param {object} evt
- * @param {string} destination
- * @return {boolean}
- */
- self.arrowsBuddy = function(evt, destination) {
-
- try {
- // Down arrow: 40
- // Up arrown: 38
-
- // Initialize
- var code = evt.keyCode;
-
- // Not the key we want here
- if((code != 40) && (code != 38)) {
- return;
- }
-
- // Remove the eventual mouse hover marker
- $(destination + ' ul').removeAttr('mouse-hover');
-
- // Create the path & get its size
- var path = destination + ' ul li';
- var pSize = $(path).size();
-
- // Define the i value
- var i = 0;
-
- // Switching yet launched
- if(Common.exists(path + '.hovered')) {
- var index = $(path).attr('data-hovered');
-
- if(index) {
- i = parseInt(index);
- }
-
- if(code == 40) {
- i++;
- } else {
- i--;
- }
- } else if(code == 38) {
- i = pSize - 1;
- }
-
- // We must not override the maximum i limit
- if(i >= pSize) {
- i = 0;
- } else if(i < 0) {
- i = pSize - 1;
- }
-
- // Modify the list
- $(path + '.hovered').removeClass('hovered');
- $(path).eq(i).addClass('hovered');
-
- // Store the i index
- $(path).attr('data-hovered', i);
- } catch(e) {
- Console.error('Search.arrowsBuddy', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Filters the buddies in the roster
- * @public
- * @param {object} vFilter
- * @return {undefined}
- */
- self.goFilterBuddy = function(vFilter) {
-
- try {
- // Put a marker
- self.search_filtered = true;
-
- // Show the buddies that match the search string
- var rFilter = self.processBuddy(vFilter);
-
- // Hide all the buddies
- $('#roster .buddy').hide();
-
- // Only show the buddies which match the search
- if(!Roster.blist_all) {
- for(var i in rFilter) {
- $('#roster .buddy[data-xid="' + escape(rFilter[i]) + '"]:not(.hidden-buddy)').show();
- }
- } else {
- for(var j in rFilter) {
- $('#roster .buddy[data-xid="' + escape(rFilter[j]) + '"]').show();
- }
- }
- } catch(e) {
- Console.error('Search.goFilterBuddy', e);
- }
-
- };
-
-
- /**
- * Resets the buddy filtering in the roster
- * @public
- * @return {undefined}
- */
- self.resetFilterBuddy = function() {
-
- try {
- // Remove the marker
- self.search_filtered = false;
-
- // Show all the buddies
- $('#roster .buddy').show();
-
- // Only show available buddies
- if(!Roster.blist_all) {
- $('#roster .buddy.hidden-buddy').hide();
- }
-
- // Update the groups
- Roster.updateGroups();
- } catch(e) {
- Console.error('Search.resetFilterBuddy', e);
- }
-
- };
-
-
- /**
- * Funnels the buddy filtering
- * @public
- * @param {number} keycode
- * @return {undefined}
- */
- self.funnelFilterBuddy = function(keycode) {
-
- try {
- // Get the input value
- var input = $('#roster .filter input');
- var cancel = $('#roster .filter a');
- var value = input.val();
-
- // Security: reset all the groups, empty or not, deployed or not
- $('#roster .one-group, #roster .group-buddies').show();
- $('#roster .group span').text('-');
-
- // Nothing is entered, or escape pressed
- if(!value || (keycode == 27)) {
- if(keycode == 27) {
- input.val('');
- }
-
- self.resetFilterBuddy();
- cancel.hide();
- } else {
- cancel.show();
- self.goFilterBuddy(value);
- }
-
- // Update the groups
- Roster.updateGroups();
- } catch(e) {
- Console.error('Search.funnelFilterBuddy', e);
- }
-
- };
-
-
- /**
- * Searches for the nearest element (with a lower stamp than the current one)
- * @public
- * @param {number} stamp
- * @param {string} element
- * @return {number}
- */
- self.sortElementByStamp = function(stamp, element) {
-
- try {
- var array = [];
- var i = 0;
- var nearest = 0;
-
- // Add the stamp values to the array
- $(element).each(function() {
- var current_stamp = parseInt($(this).attr('data-stamp'));
-
- // Push it!
- array.push(current_stamp);
- });
-
- // Sort the array
- array.sort();
-
- // Get the nearest stamp value
- while(stamp > array[i]) {
- nearest = array[i];
-
- i++;
- }
-
- return nearest;
- } catch(e) {
- Console.error('Search.sortElementByStamp', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/smileys.js b/source/app/javascripts/smileys.js
deleted file mode 100644
index 6353af8..0000000
--- a/source/app/javascripts/smileys.js
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the smileys JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Smileys = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /* Constants */
- self.emote_list = {
- 'biggrin': ':-D',
- 'devil': ']:->',
- 'coolglasses': '8-)',
- 'tongue': ':-P',
- 'smile': ':-)',
- 'wink': ';-)',
- 'blush': ':-$',
- 'stare': ':-|',
- 'frowning': ':-/',
- 'oh': '=-O',
- 'unhappy': ':-(',
- 'cry': ':\'-(',
- 'angry': ':-@',
- 'puke': ':-!',
- 'hugright': '({)',
- 'hugleft': '(})',
- 'lion': ':3',
- 'pussy': '(@)',
- 'bat': ':-[',
- 'kiss': ':-{}',
- 'heart': '<3',
- 'brheart': '3',
- 'flower': '@}->--',
- 'brflower': '(W)',
- 'thumbup': '(Y)',
- 'thumbdown': '(N)',
- 'lamp': '(I)',
- 'coffee': '(C)',
- 'drink': '(D)',
- 'beer': '(B)',
- 'boy': '(Z)',
- 'girl': '(X)',
- 'photo': '(P)',
- 'phone': '(T)',
- 'music': '(8)',
- 'cuffs': '(%)',
- 'mail': '(E)',
- 'rainbow': '(R)',
- 'star': '(*)',
- 'moon': '(S)'
- };
-
-
- /**
- * Generates the correct HTML code for an emoticon insertion tool
- * @public
- * @param {string} smiley
- * @param {string} image
- * @param {string} hash
- * @return {undefined}
- */
- self.emoteLink = function(smiley, image, hash) {
-
- try {
- return ' ';
- } catch(e) {
- Console.error('Smileys.emoteLink', e);
- }
-
- };
-
-
- /**
- * Emoticon links arrays
- * @public
- * @param {string} hash
- * @return {string}
- */
- self.links = function(hash) {
-
- try {
- var links = '';
-
- for(var cur_emote in self.emote_list) {
- links += self.emoteLink(
- self.emote_list[cur_emote],
- cur_emote,
- hash
- );
- }
-
- return links;
- } catch(e) {
- Console.error('Smileys.links', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/storage.js b/source/app/javascripts/storage.js
deleted file mode 100644
index 3b640be..0000000
--- a/source/app/javascripts/storage.js
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the storage JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Storage = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Gets the storage items of the user
- * @public
- * @param {string} type
- * @return {undefined}
- */
- self.get = function(type) {
-
- /* REF: http://xmpp.org/extensions/xep-0049.html */
-
- try {
- var iq = new JSJaCIQ();
- iq.setType('get');
-
- var iqQuery = iq.setQuery(NS_PRIVATE);
- iqQuery.appendChild(iq.buildNode('storage', {'xmlns': type}));
-
- con.send(iq, self.handle);
- } catch(e) {
- Console.error('Storage.get', e);
- }
-
- };
-
-
- /**
- * Handles the storage items
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handle = function(iq) {
-
- try {
- var handleXML = iq.getQuery();
- var handleFrom = Common.fullXID(Common.getStanzaFrom(iq));
-
- // Define some vars
- var options = $(handleXML).find('storage[xmlns="' + NS_OPTIONS + '"]');
- var inbox = $(handleXML).find('storage[xmlns="' + NS_INBOX + '"]');
- var bookmarks = $(handleXML).find('storage[xmlns="' + NS_BOOKMARKS + '"]');
- var rosternotes = $(handleXML).find('storage[xmlns="' + NS_ROSTERNOTES + '"]');
-
- // No options and node not yet configured
- if(options.size() && !options.find('option').size() && (iq.getType() != 'error')) {
- Welcome.open();
- }
-
- // Parse the options xml
- options.find('option').each(function() {
- var this_sel = $(this);
-
- // We retrieve the informations
- var type = this_sel.attr('type');
- var value = this_sel.text();
-
- // We display the storage
- DataStore.setDB(Connection.desktop_hash, 'options', type, value);
-
- // If this is the buddy list show status
- if((type == 'roster-showall') && (value == '1')) {
- Interface.showAllBuddies('storage');
- }
- });
-
- // Parse the inbox xml
- inbox.find('message').each(function() {
- var this_sel = $(this);
-
- Inbox.storeMessage(
- this_sel.attr('from'),
- this_sel.attr('subject'),
- this_sel.text(),
- this_sel.attr('status'),
- this_sel.attr('id'),
- this_sel.attr('date'),
- [
- this_sel.attr('file_title'),
- this_sel.attr('file_href'),
- this_sel.attr('file_type'),
- this_sel.attr('file_length')
- ]
- );
- });
-
- // Parse the bookmarks xml
- bookmarks.find('conference').each(function() {
- var this_sel = $(this);
-
- // We retrieve the informations
- var xid = this_sel.attr('jid');
- var name = this_sel.attr('name');
- var autojoin = this_sel.attr('autojoin');
- var password = this_sel.find('password').text();
- var nick = this_sel.find('nick').text();
-
- // Filter autojoin (compatibility)
- autojoin = ((autojoin == 'true') || (autojoin == '1')) ? 'true' : 'false';
-
- // We display the storage
- Favorites.display(xid, name, nick, autojoin, password);
-
- // Join the chat if autojoin is enabled
- if(autojoin == 'true') {
- Chat.checkCreate(xid, 'groupchat', nick, password, name);
- }
- });
-
- // Parse the roster notes xml
- rosternotes.find('note').each(function() {
- var this_sel = $(this);
-
- DataStore.setDB(
- Connection.desktop_hash,
- 'rosternotes',
- this_sel.attr('jid'),
- this_sel.text()
- );
- });
-
- // Options received
- if(options.size()) {
- Console.log('Options received.');
-
- // Now, get the inbox
- self.get(NS_INBOX);
-
- // Geolocate the user
- PEP.geolocate();
-
- $('.options-hidable').show();
- }
-
- // Inbox received
- else if(inbox.size()) {
- Console.log('Inbox received.');
-
- // Send the first presence!
- Presence.sendFirst(DataStore.getDB(Connection.desktop_hash, 'checksum', 1));
-
- // Check we have new messages (play a sound if any unread messages)
- if(Inbox.checkMessages()) {
- Audio.play('notification');
- }
-
- $('.inbox-hidable').show();
- }
-
- // Bookmarks received
- else if(bookmarks.size()) {
- // Join the groupchats the admin defined (if any)
- Groupchat.joinConf();
-
- Console.log('Bookmarks received.');
- }
-
- // Roster notes received (for logger)
- else if(rosternotes.size()) {
- Console.log('Roster notes received.');
- }
- } catch(e) {
- Console.error('Storage.handle', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/system.js b/source/app/javascripts/system.js
deleted file mode 100644
index 04b779d..0000000
--- a/source/app/javascripts/system.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the system JS script for Jappix
-
--------------------------------------------------
-
-License: dual-licensed under AGPL and MPLv2
-Authors: Valérian Saliou, olivierm, regilero, Maranda
-
-*/
-
-// Bundle
-var System = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Gets the current app location
- * @public
- * @return {string}
- */
- self.location = function() {
-
- try {
- var url = window.location.href;
-
- // If the URL has variables, remove them
- if(url.indexOf('?') != -1) {
- url = url.split('?')[0];
- }
-
- if(url.indexOf('#') != -1) {
- url = url.split('#')[0];
- }
-
- // No "/" at the end
- if(!url.match(/(.+)\/$/)) {
- url += '/';
- }
-
- return url;
- } catch(e) {
- Console.error('System.location', e);
- }
-
- };
-
-
- /**
- * Checks if we are in developer mode
- * @public
- * @return {boolean}
- */
- self.isDeveloper = function() {
-
- try {
- return (DEVELOPER === 'on');
- } catch(e) {
- Console.error('System.isDeveloper', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
-
-var JappixSystem = System;
\ No newline at end of file
diff --git a/source/app/javascripts/talk.js b/source/app/javascripts/talk.js
deleted file mode 100644
index c157f95..0000000
--- a/source/app/javascripts/talk.js
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the talkpage JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Talk = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Creates the talkpage events
- * @public
- * @return {undefined}
- */
- self.events = function() {
-
- try {
- // Launch all associated bundles
- Microblog.instance();
- Roster.instance();
- Presence.instance();
- PEP.instance();
- Notification.instance();
- Music.instance();
- } catch(e) {
- Console.error('Talk.events', e);
- }
-
- };
-
-
- /**
- * Creates the talkpage code
- * @public
- * @return {boolean}
- */
- self.create = function() {
-
- try {
- // Talkpage exists?
- if(Common.exists('#talk')) {
- return false;
- }
-
- // Anonymous detector
- var anonymous = Utils.isAnonymous();
-
- // Generate the HTML code
- var html =
- '' +
- '
' +
- '
' +
-
- '
';
-
- if(!anonymous && document.createElement('audio').canPlayType) html +=
- '
';
-
- if(!anonymous) html +=
- '
';
-
- if(!anonymous) html +=
- '
';
-
- html +=
- '
' +
-
- '
' +
- '
';
- if(!anonymous) html +=
- '
' +
- '
' +
-
- '
' +
-
- '' +
- '
';
-
- html +=
- '
' +
- '
' +
- '
';
-
- if(!anonymous) html +=
- '
' +
-
- '
';
-
- html +=
- '
' +
- '
' +
- '
' +
-
- '
' +
- '
' +
- '
';
- if(!anonymous) html +=
- '
' +
- '
' +
-
- '
' + Common._e("Channel") + '
' +
- '
';
-
- html +=
- '
';
-
- if(anonymous) html +=
- '
';
-
- html +=
- '
' +
- '
' +
-
- '
';
- if(!anonymous) html +=
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
-
- '
' +
- '
' + Common._e("What\'s up with you?") + '
' +
-
- '
' +
- ' ' +
- '
' +
-
- '
' +
- '
' +
- '
' +
-
- '
' +
-
- '' +
- '
';
-
- html +=
- '
' +
- '
' +
- '
' +
- '
';
-
- // Create the HTML code
- $('body').prepend(html);
-
- // Adapt the roster size
- Roster.adapt();
-
- // Create JS events
- self.events();
-
- // Start the auto idle functions
- Presence.liveIdle();
-
- return true;
- } catch(e) {
- Console.error('Talk.create', e);
- }
-
- };
-
-
- /**
- * Destroys the talkpage code
- * @public
- * @return {undefined}
- */
- self.destroy = function() {
-
- try {
- // Reset our database
- DataStore.resetDB();
-
- // Reset some vars
- STANZA_ID = 1;
- Roster.blist_all = false;
- Presence.first_sent = false;
- Search.search_filtered = false;
- Avatar.pending = [];
- Groupchat.join_suggest = [];
-
- // Kill all timers, exept the board ones
- $('*:not(#board .one-board)').stopTime();
-
- // Kill the auto idle functions
- Presence.dieIdle();
-
- // We renitalise the html markup as its initiale look
- $('.removable').remove();
- Interface.title('home');
-
- // Finally we show the homepage
- $('#home').show();
- } catch(e) {
- Console.error('Talk.destroy', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/tooltip.js b/source/app/javascripts/tooltip.js
deleted file mode 100644
index 97bab6f..0000000
--- a/source/app/javascripts/tooltip.js
+++ /dev/null
@@ -1,629 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the tooltip JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Tooltip = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Creates a tooltip code
- * @public
- * @param {string} xid
- * @param {string} hash
- * @param {string} type
- * @return {boolean}
- */
- self.create = function(xid, hash, type) {
-
- try {
- // Path to the element
- var path = '#' + hash;
- var path_tooltip = path + ' .chat-tools-' + type;
- var path_bubble = path_tooltip + ' .bubble-' + type;
-
- // Yet exists?
- if(Common.exists(path_bubble)) {
- return false;
- }
-
- // Generates special tooltip HTML code
- var title = '';
- var content = '';
-
- switch(type) {
- // Smileys
- case 'smileys':
- title = Common._e("Smiley insertion");
- content = Smileys.links(hash);
-
- break;
-
- // Style
- case 'style':
- title = Common._e("Change style");
-
- // Generate fonts list
- var fonts = {
- 'arial': 'Arial, Helvetica, sans-serif',
- 'arial-black': '\'Arial Black\', Gadget, sans-serif',
- 'bookman-old-style': '\'Bookman Old Style\', serif',
- 'comic-sans-ms': '\'Comic Sans MS\', cursive',
- 'courier': 'Courier, monospace',
- 'courier-new': '\'Courier New\', Courier, monospace',
- 'garamond': 'Garamond, serif',
- 'georgia': 'Georgia, serif',
- 'impact': 'Impact, Charcoal, sans-serif',
- 'lucida-console': '\'Lucida Console\', Monaco, monospace',
- 'lucida-sans-unicode': '\'Lucida Sans Unicode\', \'Lucida Grande\', sans-serif',
- 'ms-sans-serif': '\'MS Sans Serif\', Geneva, sans-serif',
- 'ms-serif': '\'MS Serif\', \'New York\', sans-serif',
- 'palatino-linotype': '\'Palatino Linotype\', \'Book Antiqua\', Palatino, serif',
- 'symbol': 'Symbol, sans-serif',
- 'tahoma': 'Tahoma, Geneva, sans-serif',
- 'times-new-roman': '\'Times New Roman\', Times, serif',
- 'trebuchet-ms': '\'Trebuchet MS\', Helvetica, sans-serif',
- 'verdana': 'Verdana, Geneva, sans-serif',
- 'webdings': 'Webdings, sans-serif',
- 'wingdings': 'Wingdings, \'Zapf Dingbats\', sans-serif'
- };
-
- var fonts_html = '';
-
- // No fonts
- fonts_html += '
' + Common._e("None") + ' ';
-
- // Available fonts
- $.each(fonts, function(id_name, full_name) {
- // Generate short name
- var short_name = full_name;
-
- if(short_name.match(/,/)) {
- var name_split = short_name.split(',');
- short_name = $.trim(name_split[0]);
- }
-
- short_name = short_name.replace(/([^a-z0-9\s]+)/gi, '');
-
- // Add this to the HTML
- fonts_html += '
' + short_name.htmlEnc() + ' ';
- });
- fonts_html += '
';
-
- content =
- '' +
- '
' +
-
- '' +
- '
12 ' +
- '
' +
- '
' +
- '
10 ' +
- '
12 ' +
- '
14 ' +
- '
16 ' +
- '
18 ' +
- '
' +
- '
' +
-
- '' +
- ' ' +
- ' ' + Common._e("Text in bold") + ' ' +
- ' ' + Common._e("Text in italic") + ' ' +
- ' ' + Common._e("Underlined text") + ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- ' ' +
- '' +
- '
' +
- '
' +
- '# ' +
- ' ' +
- '
' +
- '
';
-
- break;
-
- // File send
- case 'file':
- title = Common._e("Send a file");
- content = '' + Common._e("Once uploaded, your friend will be prompted to download the file you sent.") + '
';
- content += '';
-
- break;
-
- // Chat log
- case 'save':
- title = Common._e("Save chat");
- content = '' + Common._e("Click on the following link to get the chat log, and wait. Then click again to get the file.") + '
';
-
- // Possible to generate any log?
- if($(path + ' .one-line').size())
- content += '' + Common._e("Generate file!") + ' ';
- else
- content += '' + Common._e("This chat is empty!") + ' ';
-
- break;
- }
-
- // Generates general tooltip HTML code
- var html =
- '';
-
- // Append the HTML code
- $(path_tooltip).append(html);
-
- // Special events
- switch(type) {
- // Smileys
- case 'smileys':
- // Apply click event on smiley links
- $(path_tooltip + ' a.emoticon').click(function() {
- return Interface.insertSmiley($(this).attr('data-smiley'), hash);
- });
-
- break;
-
- // Style
- case 'style':
- // Paths to items
- var message_area = path + ' .message-area';
- var bubble_style = path_tooltip + ' .bubble-style';
- var style = bubble_style + ' input:checkbox';
- var colors = bubble_style + ' a.color';
- var font_current = bubble_style + ' a.font-current';
- var font_list = bubble_style + ' div.font-list';
- var font_select = font_list + ' a';
- var fontsize_current = bubble_style + ' a.fontsize-current';
- var fontsize_list = bubble_style + ' div.fontsize-list';
- var fontsize_select = fontsize_list + ' a';
- var color = bubble_style + ' div.color-picker';
- var color_more = color + ' a.color-more';
- var color_hex = color + ' div.color-hex';
-
- // Click event on style bubble
- $(bubble_style).click(function() {
- // Hide font selector if opened
- if($(font_list).is(':visible')) {
- $(font_current).click();
- }
-
- // Hide font-size selector if opened
- if($(fontsize_list).is(':visible')) {
- $(fontsize_current).click();
- }
-
- // Hide color selector if opened
- if($(color_hex).is(':visible')) {
- $(color_more).click();
- }
- });
-
- // Click event on font picker
- $(font_current).click(function() {
- var this_sel = $(this);
-
- // The clicked color is yet selected
- if($(font_list).is(':visible')) {
- this_sel.parent().removeClass('listed');
- } else {
- this_sel.parent().addClass('listed');
- }
-
- return false;
- });
-
- // Click event on a new font in the picker
- $(font_select).click(function() {
- var this_sel = $(this);
-
- // No font selected
- if(!this_sel.attr('data-value')) {
- $(font_current).removeAttr('data-font')
- .removeAttr('data-value')
- .text(Common._e("None"));
-
- $(message_area).removeAttr('data-font');
- } else {
- $(font_current).attr('data-font', this_sel.attr('data-font'))
- .attr('data-value', this_sel.attr('data-value'))
- .text($(font_list).find('a[data-value="' + this_sel.attr('data-value') + '"]').text());
-
- $(message_area).attr('data-font', this_sel.attr('data-value'));
- }
-
- return false;
- });
-
- // Click event on font-size picker
- $(fontsize_current).click(function() {
- var this_sel = $(this);
-
- // The clicked color is yet selected
- if($(fontsize_list).is(':visible')) {
- this_sel.parent().removeClass('listed');
- } else {
- this_sel.parent().addClass('listed');
- }
-
- return false;
- });
-
- // Click event on a new font-size in the picker
- $(fontsize_select).click(function() {
- var this_sel = $(this);
-
- // No font-size selected
- if(!this_sel.attr('data-value')) {
- $(fontsize_current).removeAttr('data-value').text(Common._e("16"));
- $(message_area).removeAttr('data-fontsize');
- }
-
- // A font-size is defined
- else {
- $(fontsize_current).attr('data-value', this_sel.attr('data-value'))
- .text(this_sel.attr('data-value'));
- $(message_area).attr('data-fontsize', this_sel.attr('data-value'));
- }
-
- return false;
- });
-
- // Click event on color picker
- $(colors).click(function() {
- var this_sel = $(this);
-
- // Reset the manual picker
- $(color_hex).find('input').val('');
-
- // The clicked color is yet selected
- if(this_sel.hasClass('selected')) {
- $(message_area).removeAttr('data-color');
- this_sel.removeClass('selected');
- }
-
- else {
- $(message_area).attr('data-color', this_sel.attr('data-color'));
- $(colors).removeClass('selected');
- this_sel.addClass('selected');
- }
-
- return false;
- });
-
- // Click event on color picker
- $(color_more).click(function() {
- var this_sel = $(this);
-
- // The clicked color is yet selected
- if($(color_hex).is(':visible')) {
- this_sel.parent().removeClass('opened');
- } else {
- this_sel.parent().addClass('opened');
-
- // Focus
- $(document).oneTime(10, function() {
- $(color_hex).find('input').focus();
- });
- }
-
- return false;
- });
-
- // Click event on color hex
- $(color_hex).click(function() {
- return false;
- });
-
- // Keyup event on color picker
- $(color_hex).find('input').keyup(function(e) {
- var this_sel = $(this);
-
- // Submit
- if(e.keyCode == 13) {
- if($(color_hex).is(':visible')) {
- $(color_more).click();
-
- // Focus again on the message textarea
- $(document).oneTime(10, function() {
- $(message_area).focus();
- });
- }
-
- return false;
- }
-
- // Reset current color
- $(message_area).removeAttr('data-color');
- $(colors).removeClass('selected');
-
- // Change value
- var new_value = this_sel.val().replace(/([^a-z0-9]+)/gi, '');
- this_sel.val(new_value);
-
- if(new_value) {
- $(message_area).attr('data-color', new_value);
- }
-
- // Regenerate style
- var style = Message.generateStyle(hash);
-
- // Any style to apply?
- if(style) {
- $(message_area).attr('style', style);
- } else {
- $(message_area).removeAttr('style');
- }
- }).placeholder();
-
- // Change event on text style checkboxes
- $(style).change(function() {
- var this_sel = $(this);
-
- // Get current type
- var style_data = 'data-' + this_sel.attr('class');
-
- // Checked checkbox?
- if(this_sel.filter(':checked').size()) {
- $(message_area).attr(style_data, true);
- } else {
- $(message_area).removeAttr(style_data);
- }
- });
-
- // Update the textarea style when it is changed
- $(style + ', ' + colors + ', ' + font_select + ', ' + fontsize_select).click(function() {
- var style = Message.generateStyle(hash);
-
- // Any style to apply?
- if(style) {
- $(message_area).attr('style', style);
- } else {
- $(message_area).removeAttr('style');
- }
-
- // Focus again on the message textarea
- $(document).oneTime(10, function() {
- $(message_area).focus();
- });
- });
-
- // Load current style
- self.loadStyleSelector(hash);
-
- break;
-
- // File send
- case 'file':
- // File upload vars
- var oob_upload_options = {
- dataType: 'xml',
- beforeSubmit: OOB.waitUpload,
- success: OOB.handleUpload
- };
-
- // Upload form submit event
- $(path_tooltip + ' #oob-upload').submit(function() {
- var this_sel = $(this);
-
- if($(path_tooltip + ' #oob-upload input[type="file"]').val()) {
- this_sel.ajaxSubmit(oob_upload_options);
- }
-
- return false;
- });
-
- // Upload input change event
- $(path_tooltip + ' #oob-upload input[type="file"]').change(function() {
- var this_sel = $(this);
-
- if(this_sel.val()) {
- $(path_tooltip + ' #oob-upload').ajaxSubmit(oob_upload_options);
- }
-
- return false;
- });
-
- // Input click event
- $(path_tooltip + ' #oob-upload input[type="file"], ' + path_tooltip + ' #oob-upload input[type="submit"]').click(function() {
- if(Common.exists(path_tooltip + ' #oob-upload input[type="reset"]')) {
- return;
- }
-
- // Lock the bubble
- $(path_bubble).addClass('locked');
-
- // Add a cancel button
- $(this).after(' ');
-
- // Cancel button click event
- $(path_tooltip + ' #oob-upload input[type="reset"]').click(function() {
- // Remove the bubble
- $(path_bubble).removeClass('locked');
- self.destroy(hash, 'file');
- });
- });
-
- break;
-
- // Chat log
- case 'save':
- // Chat log generation click event
- $(path_tooltip + ' .tooltip-actionlog').click(function() {
- // Replace it with a waiting notice
- $(this).replaceWith('' + Common._e("Please wait...") + ' ');
-
- Interface.generateChatLog(xid, hash);
-
- return false;
- });
-
- break;
- }
-
- return true;
- } catch(e) {
- Console.error('Tooltip.create', e);
- }
-
- };
-
-
- /**
- * Destroys a tooltip code
- * @public
- * @param {string} hash
- * @param {string} type
- * @return {undefined}
- */
- self.destroy = function(hash, type) {
-
- try {
- $('#' + hash + ' .chat-tools-content:not(.mini) .bubble-' + type + ':not(.locked)').remove();
- } catch(e) {
- Console.error('Tooltip.destroy', e);
- }
-
- };
-
-
- /**
- * Applies the page-engine tooltips hover event
- * @public
- * @param {string} xid
- * @param {string} hash
- * @param {string} type
- * @return {undefined}
- */
- self.hover = function(xid, hash, type) {
-
- try {
- $('#' + hash + ' .chat-tools-' + type).hover(function() {
- self.create(xid, hash, type);
- }, function() {
- self.destroy(hash, type);
- });
- } catch(e) {
- Console.error('Tooltip.hover', e);
- }
-
- };
-
-
- /**
- * Applies the hover function to the needed things
- * @public
- * @param {string} xid
- * @param {string} hash
- * @return {undefined}
- */
- self.icons = function(xid, hash) {
-
- try {
- // Hover events
- self.hover(xid, hash, 'smileys');
- self.hover(xid, hash, 'style');
- self.hover(xid, hash, 'file');
- self.hover(xid, hash, 'save');
-
- // Click events
- $('#' + hash + ' a.chat-tools-content, #' + hash + ' .chat-tools-content a').click(function() {
- return false;
- });
- } catch(e) {
- Console.error('Tooltip.icons', e);
- }
-
- };
-
-
- /**
- * Loads the style selector options
- * @public
- * @param {string} hash
- * @return {undefined}
- */
- self.loadStyleSelector = function(hash) {
-
- try {
- // Define the vars
- var path = '#' + hash;
- var message_area = $(path + ' .message-area');
- var bubble_style = path + ' .bubble-style';
- var font = message_area.attr('data-font');
- var font_select = $(bubble_style + ' div.font-list').find('a[data-value="' + font + '"]');
- var fontsize = message_area.attr('data-fontsize');
- var color = message_area.attr('data-color');
-
- // Apply message font
- if(font) {
- $(bubble_style + ' a.font-current').attr('data-value', font)
- .attr('data-font', font_select.attr('data-font'))
- .text(font_select.text());
- }
-
- // Apply message font-size
- if(fontsize) {
- $(bubble_style + ' a.fontsize-current').attr('data-value', fontsize)
- .text(fontsize);
- }
-
- // Apply the options to the style selector
- $(bubble_style + ' input[type="checkbox"]').each(function() {
- var this_sel = $(this);
-
- // Current input enabled?
- if(message_area.attr('data-' + this_sel.attr('class'))) {
- this_sel.attr('checked', true);
- }
- });
-
- // Apply message color
- if(color) {
- if($(bubble_style + ' a.color[data-color="' + color + '"]').size()) {
- $(bubble_style + ' a.color[data-color="' + color + '"]').addClass('selected');
- } else {
- $(bubble_style + ' div.color-hex input.hex-value').val(color);
- }
- }
- } catch(e) {
- Console.error('Tooltip.loadStyleSelector', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/userinfos.js b/source/app/javascripts/userinfos.js
deleted file mode 100644
index 87262a5..0000000
--- a/source/app/javascripts/userinfos.js
+++ /dev/null
@@ -1,632 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the user-infos JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var UserInfos = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Opens the user-infos popup
- * @public
- * @param {string} xid
- * @return {boolean}
- */
- self.open = function(xid) {
-
- try {
- // Can show shortcuts?
- var shortcuts = '';
-
- if(xid != Common.getXID()) {
- shortcuts = '' +
- '
' +
- '
' +
- '
' +
- '
';
- }
-
- // Popup HTML content
- var html =
- '' + Common._e("User profile") + '
' +
-
- '' +
-
- '' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
-
- '
' + Common._e("unknown") + ' ' +
- '
' + Common._e("unknown") + ' ' +
- '
' + Common._e("unknown") + ' ' +
-
- shortcuts +
- '
' +
-
- '
' +
- '
' + Common._e("Date of birth") + ' ' + Common._e("unknown") + '
' +
-
- '
' + Common._e("E-mail") + ' ' + Common._e("unknown") + '
' +
-
- '
' + Common._e("Phone") + ' ' + Common._e("unknown") + '
' +
-
- '
' + Common._e("Website") + ' ' + Common._e("unknown") + '
' +
- '
' +
-
- '
' +
- '
' + Common._e("Client") + ' ' + Common._e("unknown") + '
' +
-
- '
' + Common._e("System") + ' ' + Common._e("unknown") + '
' +
-
- '
' + Common._e("Local time") + ' ' + Common._e("unknown") + '
' +
- '
' +
- '
' +
-
- '
' +
- '
' +
- '
' + Common._e("Street") + ' ' + Common._e("unknown") + '
' +
-
- '
' + Common._e("City") + ' ' + Common._e("unknown") + '
' +
-
- '
' + Common._e("Postal code") + ' ' + Common._e("unknown") + '
' +
-
- '
' + Common._e("Country") + ' ' + Common._e("unknown") + '
' +
- '
' +
-
- '
' +
- '
' + Common._e("Biography") + ' ' + Common._e("unknown") + '
' +
- '
' +
- '
' +
-
- '
' +
- '' +
- '
' +
- '
' +
-
- '';
-
- // Create the popup
- Popup.create('userinfos', html);
-
- // Associate the events
- UserInfos.instance();
-
- // We retrieve the user's vcard
- self.retrieve(xid);
- } catch(e) {
- Console.error('UserInfos.open', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Closes the user-infos popup
- * @public
- * @return {boolean}
- */
- self.close = function() {
-
- try {
- // Send the buddy comments
- self.sendBuddyComments();
-
- // Destroy the popup
- Popup.destroy('userinfos');
- } catch(e) {
- Console.error('UserInfos.close', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Gets the user-infos
- * @public
- * @param {string} xid
- * @return {undefined}
- */
- self.retrieve = function(xid) {
-
- try {
- // We setup the waiting indicator
- markers = 'vcard last';
-
- // We put the user's XID
- $('#userinfos .buddy-xid').text(xid);
-
- // We get the vCard
- vCard.get(xid, 'buddy');
-
- // Get the highest resource for this XID
- var cXID = Presence.highestPriority(xid);
- var pXID = xid;
-
- // If the user is logged in
- if(cXID) {
- // Change the XID
- pXID = cXID;
-
- // We request the user's system infos
- self.query(cXID, 'version');
-
- // We request the user's local time
- self.query(cXID, 'time');
-
- // Add these to the markers
- markers += ' version time';
- }
-
- // We request the user's last activity
- self.query(pXID, 'last');
-
- // Add the markers
- $('#userinfos .content').addClass(markers);
-
- // We request all the user's comments
- self.displayBuddyComments(xid);
- } catch(e) {
- Console.error('UserInfos.retrieve', e);
- }
-
- };
-
-
- /**
- * Builds the asked user-infos query
- * @public
- * @param {string} xid
- * @param {string} mode
- * @return {undefined}
- */
- self.query = function(xid, mode) {
-
- try {
- // Generate a session ID
- var id = genID();
- $('#userinfos').attr('data-' + mode, id);
-
- // New IQ
- var iq = new JSJaCIQ();
-
- iq.setID(id);
- iq.setType('get');
- iq.setTo(xid);
-
- // Last activity query
- if(mode == 'last') {
- iq.setQuery(NS_LAST);
- con.send(iq, self.lastActivityUserInfos);
- }
-
- // Time query
- else if(mode == 'time') {
- iq.appendNode('time', {'xmlns': NS_URN_TIME});
- con.send(iq, self.localTime);
- }
-
- // Version query
- else if(mode == 'version') {
- iq.setQuery(NS_VERSION);
- con.send(iq, self.version);
- }
- } catch(e) {
- Console.error('UserInfos.query', e);
- }
-
- };
-
-
- /**
- * Checks if the waiting item can be hidden
- * @public
- * @return {undefined}
- */
- self.vCard = function() {
-
- try {
- $('#userinfos .content').removeClass('vcard');
- self.wait();
- } catch(e) {
- Console.error('UserInfos.vCard', e);
- }
-
- };
-
-
- /**
- * Displays the buddy comments
- * @public
- * @param {string} xid
- * @return {undefined}
- */
- self.displayBuddyComments = function(xid) {
-
- try {
- var value = DataStore.getDB(Connection.desktop_hash, 'rosternotes', xid);
-
- if(value) {
- $('#userinfos .rosternotes').val(value);
- }
- } catch(e) {
- Console.error('UserInfos.displayBuddyComments', e);
- }
-
- };
-
-
- /**
- * Displays the user's last activity result
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.lastActivity = function(iq) {
-
- try {
- // Extract the request ID
- var id = iq.getID();
- var path = '#userinfos[data-last="' + id + '"]';
-
- // End if session does not exist
- if(!Common.exists(path)) {
- return;
- }
-
- if(iq && (iq.getType() == 'result')) {
- // Get the values
- var from = Common.fullXID(Common.getStanzaFrom(iq));
- var seconds = $(iq.getNode()).find('query').attr('seconds');
-
- // Any seconds?
- if(seconds !== undefined) {
- // Initialize the parsing
- var last;
- seconds = parseInt(seconds);
-
- // Active user
- if(seconds <= 60) {
- last = Common._e("User currently active");
- }
-
- // Inactive user
- else {
- // Parse the date
- var date_now = new Date();
- var time_now = date_now.getTime();
- var date_last = new Date(date_now - (seconds * 1000));
- var date = date_last.toLocaleString();
-
- // Offline user
- if(from.indexOf('/') == -1) {
- last = Common.printf(Common._e("Last seen: %s"), date);
- }
-
- // Online user
- else {
- last = Common.printf(Common._e("Inactive since: %s"), date);
- }
- }
-
- // Append this text
- $('#userinfos .buddy-last').text(last);
- }
-
- Console.log('Last activity received: ' + from);
- }
-
- $('#userinfos .content').removeClass('last');
- self.wait();
- } catch(e) {
- Console.error('UserInfos.lastActivity', e);
- }
-
- };
-
-
- /**
- * Displays the user's software version result
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.version = function(iq) {
-
- try {
- // Extract the request ID
- var id = iq.getID();
- var path = '#userinfos[data-version="' + id + '"]';
-
- // End if session does not exist
- if(!Common.exists(path)) {
- return;
- }
-
- // Extract the reply data
- if(iq && (iq.getType() == 'result')) {
- // Get the values
- var xml = iq.getQuery();
- var name = $(xml).find('name').text();
- var version = $(xml).find('version').text();
- var os = $(xml).find('os').text();
-
- // Put the values together
- if(name && version) {
- name = name + ' ' + version;
- }
-
- // Display the values
- if(name) {
- $(path + ' #BUDDY-CLIENT').text(name);
- }
-
- if(os) {
- $(path + ' #BUDDY-SYSTEM').text(os);
- }
-
- Console.log('Software version received: ' + Common.fullXID(Common.getStanzaFrom(iq)));
- }
-
- $('#userinfos .content').removeClass('version');
- self.wait();
- } catch(e) {
- Console.error('UserInfos.version', e);
- }
-
- };
-
-
- /**
- * Displays the user's local time result
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.localTime = function(iq) {
-
- try {
- // Extract the request ID
- var id = iq.getID();
- var path = '#userinfos[data-time="' + id + '"]';
-
- // End if session does not exist
- if(!Common.exists(path)) {
- return;
- }
-
- if(iq && (iq.getType() == 'result')) {
- // Get the values
- var xml = iq.getNode();
- var tzo = $(xml).find('tzo').text();
- var utc = $(xml).find('utc').text();
-
- // Any UTC?
- if(utc) {
- // Add the TZO if there's no one
- if(tzo && utc.match(/^(.+)Z$/)) {
- utc = RegExp.$1 + tzo;
- }
-
- // Get the local date string
- var local_string = Date.hrTime(utc);
-
- // Then display it
- $(path + ' #BUDDY-TIME').text(local_string);
- }
-
- Console.log('Local time received: ' + Common.fullXID(Common.getStanzaFrom(iq)));
- }
-
- $('#userinfos .content').removeClass('time');
- self.wait();
- } catch(e) {
- Console.error('UserInfos.localTime', e);
- }
-
- };
-
-
- /**
- * Hides the waiting image if needed
- * @public
- * @return {undefined}
- */
- self.wait = function() {
-
- try {
- var selector = $('#userinfos .content');
-
- if(!selector.hasClass('vcard') && !selector.hasClass('last') && !selector.hasClass('version') && !selector.hasClass('time')) {
- $('#userinfos .wait').hide();
- }
- } catch(e) {
- Console.error('UserInfos.wait', e);
- }
-
- };
-
-
- /**
- * Sends the buddy comments
- * @public
- * @return {boolean}
- */
- self.sendBuddyComments = function() {
-
- try {
- // Update the current value
- var value = $('#userinfos .rosternotes').val();
- var xid = $('#userinfos .buddy-xid').text();
-
- // Necessary to update?
- var old_value = DataStore.getDB(Connection.desktop_hash, 'rosternotes', xid);
-
- if((old_value == value) || (!old_value && !value)) {
- return false;
- }
-
- // Update the database
- DataStore.setDB(Connection.desktop_hash, 'rosternotes', xid, value);
-
- // Send the new buddy storage values
- var iq = new JSJaCIQ();
- iq.setType('set');
- var query = iq.setQuery(NS_PRIVATE);
- var storage = query.appendChild(iq.buildNode('storage', {'xmlns': NS_ROSTERNOTES}));
-
- // We regenerate the XML
- var db_regex = new RegExp(('^' + Connection.desktop_hash + '_') + 'rosternotes' + ('_(.+)'));
-
- for(var i = 0; i < DataStore.storageDB.length; i++) {
- // Get the pointer values
- var current = DataStore.storageDB.key(i);
-
- // If the pointer is on a stored rosternote
- if(current.match(db_regex)) {
- var cur_xid = RegExp.$1;
- var cur_value = DataStore.storageDB.getItem(current);
-
- if(cur_xid && cur_value) {
- storage.appendChild(iq.buildNode('note', {'jid': cur_xid, 'xmlns': NS_ROSTERNOTES}, cur_value));
- }
- }
- }
-
- con.send(iq);
-
- return false;
- } catch(e) {
- Console.error('UserInfos.sendBuddyComments', e);
- }
-
- };
-
-
- /**
- * Switches the user-infos tabs
- * @public
- * @param {string} id
- * @return {boolean}
- */
- self.switchTab = function(id) {
-
- try {
- var userinfos_sel = $('#userinfos');
- var content_sel = userinfos_sel.find('.content');
- var tab_link_sel = userinfos_sel.find('.tab a');
-
- content_sel.find('.one-lap').hide();
- content_sel.find('.info' + id).show();
-
- tab_link_sel.removeClass('tab-active');
- tab_link_sel.filter('[data-key="' + id + '"]').addClass('tab-active');
- } catch(e) {
- Console.error('UserInfos.switchTab', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Gets the user's informations when creating a new chat
- * @public
- * @param {string} hash
- * @param {string} xid
- * @param {string} nick
- * @param {string} type
- * @return {undefined}
- */
- self.get = function(hash, xid, nick, type) {
-
- try {
- // This is a normal chat
- if(type != 'private') {
- // Display the buddy name
- if(nick) {
- $('#' + hash + ' .top .name .bc-name').text(nick);
- $('#page-switch .' + hash + ' .name').text(nick);
- }
-
- // Get the buddy PEP informations
- PEP.displayAll(xid);
- }
-
- // Display the buddy presence
- Presence.funnel(xid, hash);
- } catch(e) {
- Console.error('UserInfos.get', e);
- }
-
- };
-
-
- /**
- * Plugin launcher
- * @public
- * @return {undefined}
- */
- self.instance = function() {
-
- try {
- // Click events
- $('#userinfos .tab a').click(function() {
- var this_sel = $(this);
-
- // Yet active?
- if(this_sel.hasClass('tab-active')) {
- return false;
- }
-
- // Switch to the good tab
- var key = parseInt(this_sel.attr('data-key'));
-
- return self.switchTab(key);
- });
-
- $('#userinfos .bottom .finish').click(function() {
- return self.close();
- });
- } catch(e) {
- Console.error('UserInfos.instance', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/utilities.js b/source/app/javascripts/utilities.js
deleted file mode 100644
index bf375c1..0000000
--- a/source/app/javascripts/utilities.js
+++ /dev/null
@@ -1,719 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the utilities JS script for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Authors: Valérian Saliou, olivierm
-
-*/
-
-// Bundle
-var Utils = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Returns whether using HTTPS or not
- * @public
- * @return {boolean}
- */
- self.isHTTPS = function() {
-
- is_https = false;
-
- try {
- if(window.location.href && (window.location.href).match(/^https/i)) {
- is_https = true;
- }
- } catch(e) {
- Console.error('Utils.isHTTPS', e);
- } finally {
- return is_https;
- }
-
- };
-
-
- /**
- * Generates the good storage URL
- * @public
- * @param {string} url
- * @return {string}
- */
- self.generateURL = function(url) {
-
- try {
- // HTTPS not allowed
- if((HTTPS_STORAGE != 'on') && url.match(/^https(.+)/)) {
- url = 'http' + RegExp.$1;
- }
-
- return url;
- } catch(e) {
- Console.error('Utils.generateURL', e);
- }
-
- };
-
-
- /**
- * Disables an input if needed
- * @public
- * @param {string} value
- * @param {string} condition
- * @return {string}
- */
- self.disableInput = function(value, condition) {
-
- try {
- if(value == condition) {
- return ' disabled=""';
- }
-
- return '';
- } catch(e) {
- Console.error('Utils.disableInput', e);
- }
-
- };
-
-
- /**
- * Truncates a string
- * @public
- * @param {string} string
- * @param {number} limit
- * @return {string}
- */
- self.truncate = function(string, limit) {
-
- try {
- // Must truncate the string
- if(string.length > limit) {
- string = string.substr(0, limit) + '...';
- }
-
- return string;
- } catch(e) {
- Console.error('Utils.truncate', e);
- }
-
- };
-
-
- /**
- * Removes the new lines
- * @public
- * @param {string} string
- * @return {string}
- */
- self.noLines = function(string) {
-
- try {
- return string.replace(/\n/g, ' ');
- } catch(e) {
- Console.error('Utils.noLines', e);
- }
-
- };
-
-
- /**
- * Encodes a string for onclick attribute
- * @public
- * @param {string} str
- * @return {undefined}
- */
- self.encodeOnclick = function(str) {
-
- try {
- return (Common.encodeQuotes(str)).replace(/'/g, '\\$&');
- } catch(e) {
- Console.error('Utils.encodeOnclick', e);
- }
-
- };
-
-
- /**
- * Checks whether the passed parameter is a number or not
- * @public
- * @param {number} n
- * @return {boolean}
- */
- self.isNumber = function(n) {
-
- try {
- return !isNaN(parseFloat(n)) && isFinite(n);
- } catch(e) {
- Console.error('Utils.isNumber', e);
- }
-
- };
-
-
- /**
- * Checks if we are in the anonymous mode
- * @public
- * @return {boolean}
- */
- self.isAnonymous = function() {
-
- var is_anonymous = false;
-
- try {
- if(Common.allowedAnonymous() && XMPPLinks.links_var.r) {
- is_anonymous = true;
- }
- } catch(e) {
- Console.error('Utils.isAnonymous', e);
- } finally {
- return is_anonymous;
- }
-
- };
-
-
- /**
- * Checks if this is a private chat user
- * @public
- * @param {string} xid
- * @return {boolean}
- */
- self.isPrivate = function(xid) {
-
- var is_private = false;
-
- try {
- if(Common.exists('[data-xid="' + escape(xid) + '"][data-type="groupchat"]')) {
- is_private = true;
- }
- } catch(e) {
- Console.error('Utils.isPrivate', e);
- } finally {
- return is_private;
- }
-
- };
-
-
- /**
- * Checks if the user browser is obsolete
- * @public
- * @return {boolean}
- */
- self.isObsolete = function() {
-
- try {
- // Get browser name & version
- var browser_name = BrowserDetect.browser;
- var browser_version = BrowserDetect.version;
-
- // No DOM storage
- if(!DataStore.hasDB() || !DataStore.hasPersistent()) {
- return true;
- }
-
- // Obsolete IE
- if((browser_name == 'Explorer') && (browser_version < 8)) {
- return true;
- }
-
- // Obsolete Chrome
- if((browser_name == 'Chrome') && (browser_version < 7)) {
- return true;
- }
-
- // Obsolete Safari
- if((browser_name == 'Safari') && (browser_version < 4)) {
- return true;
- }
-
- // Obsolete Firefox
- if((browser_name == 'Firefox') && (browser_version < 3.5)) {
- return true;
- }
-
- // Obsolete Opera
- if((browser_name == 'Opera') && (browser_version < 9)) {
- return true;
- }
-
- return false;
- } catch(e) {
- Console.error('Utils.isObsolete', e);
-
- return false;
- }
-
- };
-
-
- /**
- * Gets a MUC user XID
- * @public
- * @param {string} room
- * @param {string} nick
- * @return {string}
- */
- self.getMUCUserXID = function(room, nick) {
-
- try {
- return $('div.chat[data-xid="' + escape(room) + '"] div[data-nick="' + escape(nick) + '"]').attr('data-xid');
- } catch(e) {
- Console.error('Utils.getMUCUserXID', e);
- }
-
- };
-
-
- /**
- * Gets a MUC user read XID
- * @public
- * @param {string} room
- * @param {string} nick
- * @return {string}
- */
- self.getMUCUserRealXID = function(room, nick) {
-
- try {
- return $('div.chat[data-xid="' + escape(room) + '"] div[data-nick="' + escape(nick) + '"]').attr('data-realxid');
- } catch(e) {
- Console.error('Utils.getMUCUserRealXID', e);
- }
-
- };
-
-
- /**
- * Gets the server of the user
- * @public
- * @return {string}
- */
- self.getServer = function() {
-
- try {
- // Return the domain of the user
- return con.domain;
- } catch(e) {
- Console.error('Utils.getServer', e);
- }
-
- };
-
-
- /**
- * Gets the password of the user
- * @public
- * @return {string}
- */
- self.getPassword = function() {
-
- try {
- // Return the password of the user
- return con.pass;
- } catch(e) {
- Console.error('Utils.getPassword', e);
- }
-
- };
-
-
- /**
- * Quotes the nick of an user. If a message is given, the nick is inserted at its end.
- * @public
- * @param {string} hash
- * @param {string} nick
- * @param {string} message
- * @return {undefined}
- */
- self.quoteMyNick = function(hash, nick, message) {
-
- try {
- $(document).oneTime(10, function() {
- if (message === undefined || message.length === 0) {
- $('#page-engine #' + hash + ' .message-area').val(nick + ', ').focus();
- } else {
- $('#page-engine #' + hash + ' .message-area').val(message + nick).focus();
- }
- });
- } catch(e) {
- Console.error('Utils.quoteMyNick', e);
- }
-
- };
-
-
- /**
- * Return the file category
- * @public
- * @param {string} ext
- * @return {string}
- */
- self.fileCategory = function(ext) {
-
- try {
- var cat;
-
- switch(ext) {
- // Images
- case 'jpg':
- case 'jpeg':
- case 'png':
- case 'bmp':
- case 'gif':
- case 'tif':
- case 'svg':
- case 'ico':
- case 'psp':
- case 'psd':
- case 'psb':
- case 'xcf':
- cat = 'image';
-
- break;
-
- // Videos
- case 'ogv':
- case 'ogg':
- case 'mkv':
- case 'avi':
- case 'mov':
- case 'mp4':
- case 'm4v':
- case 'wmv':
- case 'asf':
- case 'mpg':
- case 'mpeg':
- case 'ogm':
- case 'rmvb':
- case 'rmv':
- case 'qt':
- case 'flv':
- case 'ram':
- case '3gp':
- case 'avc':
- cat = 'video';
-
- break;
-
- // Sounds
- case 'oga':
- case 'mka':
- case 'flac':
- case 'mp3':
- case 'wav':
- case 'm4a':
- case 'wma':
- case 'rmab':
- case 'rma':
- case 'bwf':
- case 'aiff':
- case 'caf':
- case 'cda':
- case 'atrac':
- case 'vqf':
- case 'au':
- case 'aac':
- case 'm3u':
- case 'mid':
- case 'mp2':
- case 'snd':
- case 'voc':
- cat = 'audio';
-
- break;
-
- // Documents
- case 'pdf':
- case 'odt':
- case 'ott':
- case 'sxw':
- case 'stw':
- case 'ots':
- case 'sxc':
- case 'stc':
- case 'sxi':
- case 'sti':
- case 'pot':
- case 'odp':
- case 'ods':
- case 'doc':
- case 'docx':
- case 'docm':
- case 'xls':
- case 'xlsx':
- case 'xlsm':
- case 'xlt':
- case 'ppt':
- case 'pptx':
- case 'pptm':
- case 'pps':
- case 'odg':
- case 'otp':
- case 'sxd':
- case 'std':
- case 'std':
- case 'rtf':
- case 'txt':
- case 'htm':
- case 'html':
- case 'shtml':
- case 'dhtml':
- case 'mshtml':
- cat = 'document';
-
- break;
-
- // Packages
- case 'tgz':
- case 'gz':
- case 'tar':
- case 'ar':
- case 'cbz':
- case 'jar':
- case 'tar.7z':
- case 'tar.bz2':
- case 'tar.gz':
- case 'tar.lzma':
- case 'tar.xz':
- case 'zip':
- case 'xz':
- case 'rar':
- case 'bz':
- case 'deb':
- case 'rpm':
- case '7z':
- case 'ace':
- case 'cab':
- case 'arj':
- case 'msi':
- cat = 'package';
-
- break;
-
- // Others
- default:
- cat = 'other';
-
- break;
- }
-
- return cat;
- } catch(e) {
- Console.error('Utils.fileCategory', e);
- }
-
- };
-
-
- /**
- * Registers Jappix as the default XMPP links handler
- * @public
- * @return {boolean}
- */
- self.xmppLinksHandler = function() {
-
- try {
- navigator.registerProtocolHandler('xmpp', JAPPIX_LOCATION + '?x=%s', SERVICE_NAME);
-
- return true;
- } catch(e) {
- Console.error('Utils.xmppLinksHandler', e);
-
- return false;
- }
-
- };
-
-
- /**
- * Checks if a value exists in array
- * @public
- * @param {object} array
- * @param {string} value
- * @return {boolean}
- */
- self.existArrayValue = function(array, value) {
-
- val_exists = false;
-
- try {
- // Loop in the array
- for(var i in array) {
- if(array[i] == value) {
- val_exists = true;
- break;
- }
- }
- } catch(e) {
- Console.error('Utils.existArrayValue', e);
- } finally {
- return val_exists;
- }
-
- };
-
-
- /**
- * Removes a value from an array
- * @public
- * @param {object} array
- * @param {string} value
- * @return {boolean}
- */
- self.removeArrayValue = function(array, value) {
-
- was_removed = false;
-
- try {
- for(var i in array) {
- // It matches, remove it!
- if(array[i] == value) {
- array.splice(i, 1);
-
- was_removed = true;
- }
- }
- } catch(e) {
- Console.error('Utils.removeArrayValue', e);
- } finally {
- return was_removed;
- }
-
- };
-
-
- /**
- * Removes duplicate values from array
- * @public
- * @param {object} arr
- * @return {object}
- */
- self.uniqueArrayValues = function(arr) {
-
- try {
- var a = arr.concat();
-
- for(var i = 0; i < a.length; ++i) {
- for(var j = i + 1; j < a.length; ++j) {
- if(a[i] === a[j]) {
- a.splice(j--, 1);
- }
- }
- }
-
- return a;
- } catch(e) {
- Console.error('Utils.uniqueArrayValues', e);
- }
-
- };
-
-
- /**
- * Converts a string to an array
- * @public
- * @param {string} string
- * @return {object}
- */
- self.stringToArray = function(string) {
-
- try {
- var array = [];
-
- // Any string to convert?
- if(string) {
- // More than one item
- if(string.match(/,/gi)) {
- var string_split = string.split(',');
-
- for(var i in string_split) {
- if(string_split[i]) {
- array.push(string_split[i]);
- } else {
- array.push('');
- }
- }
- }
-
- // Only one item
- else
- array.push(string);
- }
-
- return array;
- } catch(e) {
- Console.error('Utils.stringToArray', e);
- }
-
- };
-
-
- /**
- * Get the index of an array value
- * @public
- * @param {object} array
- * @param {string} value
- * @return {number}
- */
- self.indexArrayValue = function(array, value) {
-
- try {
- // Nothing?
- if(!array || !array.length) {
- return 0;
- }
-
- // Read the index of the value
- var index = 0;
-
- for(var i = 0; i < array.length; i++) {
- if(array[i] == value) {
- index = i;
-
- break;
- }
- }
-
- return index;
- } catch(e) {
- Console.error('Utils.indexArrayValue', e);
- }
-
- };
-
-
- /**
- * Capitalizes the first letter of a string
- * @public
- * @param {string} string
- * @return {string}
- */
- self.capitaliseFirstLetter = function(string) {
-
- try {
- return string.charAt(0).toUpperCase() + string.slice(1);
- } catch(e) {
- Console.error('Utils.capitaliseFirstLetter', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
-
-var JappixUtils = Utils;
\ No newline at end of file
diff --git a/source/app/javascripts/vcard.js b/source/app/javascripts/vcard.js
deleted file mode 100644
index bae77a6..0000000
--- a/source/app/javascripts/vcard.js
+++ /dev/null
@@ -1,962 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the vCard JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou, Maranda
-
-*/
-
-// Bundle
-var vCard = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Opens the vCard popup
- * @public
- * @return {boolean}
- */
- self.open = function() {
-
- try {
- // Popup HTML content
- var html =
- '' + Common._e("Your profile") + '
' +
-
- '' +
-
- '' +
-
- '';
-
- // Create the popup
- Popup.create('vcard', html);
-
- // Associate the events
- self.instance();
-
- // We get the VCard informations
- self.get(Common.getXID(), 'user');
- } catch(e) {
- Console.error('vCard.open', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Closes the vCard popup
- * @public
- * @return {boolean}
- */
- self.close = function() {
-
- try {
- // Destroy the popup
- Popup.destroy('vcard');
-
- // Create the welcome end popup?
- if(Welcome.is_done) {
- // Open popup
- Me.open();
-
- // Unavoidable popup
- $('#me').addClass('unavoidable');
- }
- } catch(e) {
- Console.error('vCard.close', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Switches the vCard popup tabs
- * @public
- * @param {string} id
- * @return {boolean}
- */
- self.switchTab = function(id) {
-
- try {
- $('#vcard .one-lap').removeClass('lap-active');
- $('#vcard #lap' + id).addClass('lap-active');
- $('#vcard .tab a').removeClass('tab-active');
- $('#vcard .tab a[data-key="' + id + '"]').addClass('tab-active');
- } catch(e) {
- Console.error('vCard.switchTab', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Waits for the avatar upload reply
- * @public
- * @return {undefined}
- */
- self.waitAvatarUpload = function() {
-
- try {
- // Reset the avatar info
- $('#vcard .avatar-info').hide().stopTime();
-
- // Show the wait info
- $('#vcard .avatar-wait').show();
- } catch(e) {
- Console.error('vCard.waitAvatarUpload', e);
- }
-
- };
-
-
- /**
- * Handles the avatar upload reply
- * @public
- * @param {object} responseXML
- * @return {undefined}
- */
- self.handleAvatarUpload = function(responseXML) {
-
- try {
- // Data selector
- var dData = $(responseXML).find('jappix');
-
- // Not current upload session?
- if(parseInt(dData.attr('id')) != parseInt($('#vcard-avatar input[name="id"]').val())) {
- return;
- }
-
- // Reset the avatar info
- $('#vcard .avatar-info').hide().stopTime();
-
- // Process the returned data
- if(!dData.find('error').size()) {
- // Read the values
- var aType = dData.find('type').text();
- var aBinval = dData.find('binval').text();
-
- // We remove everything that isn't useful right here
- $('#vcard .no-avatar').hide();
- $('#vcard .avatar').remove();
-
- // We display the delete button
- $('#vcard .avatar-delete').show();
-
- // We tell the user it's okay
- $('#vcard .avatar-ok').show();
-
- // Timer
- $('#vcard .avatar-info').oneTime('10s', function() {
- $(this).hide();
- });
-
- // We put the base64 values in a hidden input to be sent
- $('#USER-PHOTO-TYPE').val(aType);
- $('#USER-PHOTO-BINVAL').val(aBinval);
-
- // We display the avatar!
- $('#vcard .avatar-container').replaceWith('');
- }
-
- // Any error?
- else {
- $('#vcard .avatar-error').show();
-
- // Timer
- $('#vcard .avatar-info').oneTime('10s', function() {
- $(this).hide();
- });
-
- Console.error('Error while uploading the avatar', dData.find('error').text());
- }
- } catch(e) {
- Console.error('vCard.handleAvatarUpload', e);
- }
-
- };
-
-
- /**
- * Deletes the encoded avatar of an user
- * @public
- * @return {boolean}
- */
- self.deleteAvatar = function() {
-
- try {
- // We remove the avatar displayed elements
- $('#vcard .avatar-info').stopTime();
- $('#vcard .avatar-info, #vcard .avatar-wait, #vcard .avatar-error, #vcard .avatar-ok, #vcard .avatar-delete').hide();
- $('#vcard .avatar').remove();
-
- // We reset the input value
- $('#USER-PHOTO-TYPE, #USER-PHOTO-BINVAL').val('');
-
- // We show the avatar-uploading request
- $('#vcard .no-avatar').show();
- } catch(e) {
- Console.error('vCard.deleteAvatar', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Creates a special vCard input
- * @public
- * @param {string} id
- * @param {string} type
- * @return {undefined}
- */
- self.createInput = function(id, type) {
-
- try {
- // Generate the new ID
- id = 'USER-' + id;
-
- // Can append the content
- if((type == 'user') && !Common.exists('#vcard #' + id)) {
- $('#vcard .content').append(' ');
- }
- } catch(e) {
- Console.error('vCard.createInput', e);
- }
-
- };
-
-
- /**
- * Gets the vCard of a XID
- * @public
- * @param {string} to
- * @param {string} type
- * @return {undefined}
- */
- self.get = function(to, type) {
-
- try {
- // Generate a special ID
- var id = genID();
-
- // New IQ
- var iq = new JSJaCIQ();
- iq.setID(id);
- iq.setType('get');
- iq.appendNode('vCard', {'xmlns': NS_VCARD});
-
- // Send the IQ to the good user
- if(type == 'user') {
- // Show the wait icon
- $('#vcard .wait').show();
-
- // Apply the session ID
- $('#vcard').attr('data-vcard', id);
-
- // Send the IQ
- con.send(iq, self.handleUser);
- } else {
- // Show the wait icon
- $('#userinfos .wait').show();
-
- // Apply the session ID
- $('#userinfos').attr('data-vcard', id);
-
- // Send the IQ
- iq.setTo(to);
- con.send(iq, self.handleBuddy);
- }
- } catch(e) {
- Console.error('vCard.get', e);
- }
-
- };
-
-
- /**
- * Handles the current connected user's vCard
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleUser = function(iq) {
-
- try {
- self.handle(iq, 'user');
- } catch(e) {
- Console.error('vCard.handleUser', e);
- }
-
- };
-
-
- /**
- * Handles an external buddy vCard
- * @public
- * @param {object} iq
- * @return {undefined}
- */
- self.handleBuddy = function(iq) {
-
- try {
- self.handle(iq, 'buddy');
- } catch(e) {
- Console.error('vCard.handleBuddy', e);
- }
-
- };
-
-
- /**
- * Handles a vCard stanza
- * @public
- * @param {object} iq
- * @param {string} type
- * @return {undefined}
- */
- self.handle = function(iq, type) {
-
- try {
- // Extract the data
- var iqID = iq.getID();
- var iqFrom = Common.fullXID(Common.getStanzaFrom(iq));
- var iqNode = iq.getNode();
-
- // Define some paths
- var path_vcard = '#vcard[data-vcard="' + iqID + '"]';
- var path_userInfos = '#userinfos[data-vcard="' + iqID + '"]';
-
- // End if the session does not exist
- if(((type == 'user') && !Common.exists(path_vcard)) || ((type == 'buddy') && !Common.exists(path_userInfos))) {
- return;
- }
-
- // We retrieve main values
- var values_yet = [];
-
- $(iqNode).find('vCard').children().each(function() {
- var this_sel = $(this);
-
- // Read the current parent node name
- var tokenname = (this).nodeName.toUpperCase();
-
- // Node with a parent
- if(this_sel.children().size()) {
- this_sel.children().each(function() {
- // Get the node values
- var currentID = tokenname + '-' + (this).nodeName.toUpperCase();
- var currentText = $(this).text();
-
- // Not yet added?
- if(!Utils.existArrayValue(values_yet, currentID)) {
- // Create an input if it does not exist
- self.createInput(values_yet, type);
-
- // Userinfos viewer popup
- if((type == 'buddy') && currentText) {
- if(currentID == 'EMAIL-USERID') {
- $(path_userInfos + ' #BUDDY-' + currentID).html('' + currentText.htmlEnc() + ' ');
- } else {
- $(path_userInfos + ' #BUDDY-' + currentID).text(currentText.htmlEnc());
- }
- }
-
- // Profile editor popup
- else if(type == 'user') {
- $(path_vcard + ' #USER-' + currentID).val(currentText);
- }
-
- // Avoid duplicating the value
- values_yet.push(currentID);
- }
- });
- }
-
- // Node without any parent
- else {
- // Get the node values
- var currentText = $(this).text();
-
- // Not yet added?
- if(!Utils.existArrayValue(values_yet, tokenname)) {
- // Create an input if it does not exist
- self.createInput(tokenname, type);
-
- // Userinfos viewer popup
- if((type == 'buddy') && currentText) {
- // URL modification
- if(tokenname == 'URL') {
- // No http:// or https:// prefix, we should add it
- if(!currentText.match(/^https?:\/\/(.+)/)) {
- currentText = 'http://' + currentText;
- }
-
- currentText = '' + currentText.htmlEnc() + ' ';
- }
-
- // Description modification
- else if(tokenname == 'DESC') {
- currentText = Filter.message(currentText, Name.getBuddy(iqFrom).htmlEnc(), true);
- }
-
- // Other stuffs
- else {
- currentText = currentText.htmlEnc();
- }
-
- $(path_userInfos + ' #BUDDY-' + tokenname).html(currentText);
- }
-
- // Profile editor popup
- else if(type == 'user') {
- $(path_vcard + ' #USER-' + tokenname).val(currentText);
- }
-
- // Avoid duplicating the value
- values_yet.push(tokenname);
- }
- }
- });
-
- // Update the stored avatar
- if(type == 'buddy') {
- // Get the avatar XML
- var xml = DataStore.getPersistent('global', 'avatar', iqFrom);
-
- // If there were no stored avatar previously
- if($(Common.XMLFromString(xml)).find('type').text() == 'none') {
- xml = xml.replace(/false<\/forced>/gi, 'true ');
- DataStore.setPersistent(Common.getXID(), 'avatar', iqFrom, xml);
- }
-
- // Handle the user avatar
- Avatar.handle(iq);
- }
-
- // The avatar values targets
- var aBinval, aType, aContainer;
-
- if(type == 'user') {
- aBinval = $('#USER-PHOTO-BINVAL').val();
- aType = $('#USER-PHOTO-TYPE').val();
- aContainer = path_vcard + ' .avatar-container';
- } else {
- aBinval = $(iqNode).find('BINVAL:first').text();
- aType = $(iqNode).find('TYPE:first').text();
- aContainer = path_userInfos + ' .avatar-container';
- }
-
- // We display the avatar if retrieved
- if(aBinval) {
- // No type?
- if(!aType) {
- aType = 'image/png';
- }
-
- if(type == 'user') {
- // We move all the things that we don't need in that case
- $(path_vcard + ' .no-avatar').hide();
- $(path_vcard + ' .avatar-delete').show();
- $(path_vcard + ' .avatar').remove();
- }
-
- var avatar_src = ('data:' + aType + ';base64,' + aBinval);
-
- // We display the avatar we have just received
- $(aContainer).replaceWith('');
- }
-
- else if(type == 'buddy') {
- $(aContainer).replaceWith('');
- }
-
- // Do someting depending of the type
- if(type == 'user') {
- $(path_vcard + ' .wait').hide();
- $(path_vcard + ' .finish:first').removeClass('disabled');
- } else {
- UserInfos.vCard();
- }
-
- Console.log('vCard received: ' + iqFrom);
- } catch(e) {
- Console.error('vCard.handle', e);
- }
-
- };
-
-
- /**
- * Sends the vCard of the user
- * @public
- * @return {boolean}
- */
- self.send = function() {
-
- try {
- // Send both vcard-temp + vCard4
- self._sendLegacy();
- self._sendForward();
-
- // Send the user nickname & avatar over PEP
- if(Features.enabledPEP()) {
- self._sendPubsub();
- }
-
- // Close the vCard stuffs
- self.close();
-
- // Get our new avatar
- Avatar.get(Common.getXID(), 'force', 'true', 'forget');
-
- Console.log('vCard sent.');
- } catch(e) {
- Console.error('vCard.send', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Generate XML tree
- * @private
- * @return {boolean}
- */
- self._generateTree = function(namespace, stanza, node) {
-
- try {
- var selector = $('#vcard .vcard-item');
- var get_id_fn = function(this_sel) {
- var id = this_sel.attr('id');
- return id ? id.replace(/^USER-(.+)/, '$1') : null;
- };
-
- if(namespace === NS_IETF_VCARD4) {
- selector = selector.filter('[data-vcard4]');
- get_id_fn = function(this_sel) {
- return this_sel.attr('data-vcard4') || null;
- };
- }
-
- // We send the identity part of the form
- selector.each(function() {
- var this_sel = $(this);
-
- var item_id = get_id_fn(this_sel);
- var item_value = this_sel.val();
-
- if(item_value && item_id) {
- if(item_id.indexOf('-') !== -1) {
- var tagname = Common.explodeThis('-', item_id, 0);
- var cur_node;
-
- if(node.getElementsByTagName(tagname).length > 0) {
- cur_node = node.getElementsByTagName(tagname).item(0);
- } else {
- cur_node = node.appendChild(stanza.buildNode(tagname, {'xmlns': namespace}));
- }
-
- cur_node.appendChild(
- stanza.buildNode(
- Common.explodeThis('-', item_id, 1),
- {'xmlns': namespace},
- item_value
- )
- );
- } else {
- node.appendChild(stanza.buildNode(item_id, {'xmlns': namespace}, item_value));
- }
- }
- });
-
- return true;
- } catch(e) {
- Console.error('vCard._generateTree', e);
-
- return false;
- }
-
- };
-
-
- /**
- * Configure given Pubsub node
- * @private
- * @param {string} namespace
- * @return {undefined}
- */
- self._configureNode = function(namespace) {
-
- try {
- Pubsub.setup(null, namespace, '1', '1', 'open', 'whitelist');
- } catch(e) {
- Console.error('vCard._configureNode', e);
- }
-
- };
-
-
- /**
- * Send legacy vCard
- * @private
- * @return {undefined}
- */
- self._sendLegacy = function() {
-
- try {
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- var vCard = iq.appendNode('vCard', {
- 'xmlns': NS_VCARD
- });
-
- self._generateTree(NS_VCARD, iq, vCard);
-
- con.send(iq);
- } catch(e) {
- Console.error('vCard._sendLegacy', e);
- }
-
- };
-
-
- /**
- * Send forward version vCard (vCard 4)
- * @private
- * @return {undefined}
- */
- self._sendForward = function() {
-
- try {
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- // Build Pubsub headers
- var pubsub = iq.appendNode('pubsub', {'xmlns': NS_PUBSUB});
-
- var publish = pubsub.appendChild(iq.buildNode('publish', {
- 'node': NS_XMPP_VCARD4,
- 'xmlns': NS_PUBSUB
- }));
-
- var item = publish.appendChild(iq.buildNode('item', {
- 'xmlns': NS_PUBSUB,
- 'id': 'current'
- }));
-
- // Generate vCard4 tree
- var vcard = item.appendChild(iq.buildNode('vcard', {
- 'xmlns': NS_IETF_VCARD4
- }));
-
- self._generateTree(NS_IETF_VCARD4, iq, vcard);
-
- con.send(iq);
-
- // Make it publicly-viewable
- self._configureNode(NS_XMPP_VCARD4);
- } catch(e) {
- Console.error('vCard._sendForward', e);
- }
-
- };
-
-
- /**
- * Send other Pubsub items
- * @private
- * @return {undefined}
- */
- self._sendPubsub = function() {
-
- try {
- // Generate some values
- var photo_bin = $('#USER-PHOTO-BINVAL').val();
- var photo_data = Base64.decode(photo_bin) || '';
-
- // Data to be sent
- var send_data = {};
- send_data[NS_NICK] = $('#USER-NICKNAME').val();
- send_data[NS_URN_ADATA] = photo_bin;
- send_data[NS_URN_AMETA] = {
- 'type': $('#USER-PHOTO-TYPE').val(),
- 'id': (hex_sha1(photo_data) || ''),
- 'bytes': (photo_data.length || '')
- };
-
- // Generate the XML
- $.each(send_data, function(namespace, data) {
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- var pubsub = iq.appendNode('pubsub', {'xmlns': NS_PUBSUB});
- var publish = pubsub.appendChild(iq.buildNode('publish', {'node': namespace, 'xmlns': NS_PUBSUB}));
-
- if(data) {
- var item;
-
- if(namespace === NS_NICK) {
- item = publish.appendChild(iq.buildNode('item', {'xmlns': NS_PUBSUB}));
-
- // Nickname element
- item.appendChild(iq.buildNode('nick', {'xmlns': NS_NICK}, data));
- } else if(namespace === NS_URN_ADATA || namespace === NS_URN_AMETA) {
- item = publish.appendChild(iq.buildNode('item', {'xmlns': NS_PUBSUB}));
-
- // Apply the SHA-1 hash
- if(send_data[NS_URN_AMETA].id) {
- item.setAttribute('id', send_data[NS_URN_AMETA].id);
- }
-
- // Append XML nodes depending on namespace
- if(namespace === NS_URN_ADATA) {
- item.appendChild(iq.buildNode('data', {'xmlns': NS_URN_ADATA}, data));
- } else if(namespace === NS_URN_AMETA) {
- var metadata = item.appendChild(iq.buildNode('metadata', {'xmlns': NS_URN_AMETA}));
-
- if(data) {
- var meta_info = metadata.appendChild(iq.buildNode('info', {'xmlns': NS_URN_AMETA}));
-
- if(data.type)
- meta_info.setAttribute('type', data.type);
- if(data.id)
- meta_info.setAttribute('id', data.id);
- if(data.bytes)
- meta_info.setAttribute('bytes', data.bytes);
- }
- }
- }
- }
-
- con.send(iq);
-
- // Make node publicly-viewable
- self._configureNode(namespace);
- });
- } catch(e) {
- Console.error('vCard._sendPubsub', e);
- }
-
- };
-
-
- /**
- * Plugin launcher
- * @public
- * @return {undefined}
- */
- self.instance = function() {
-
- try {
- // Focus on the first input
- $(document).oneTime(10, function() {
- $('#vcard input:first').focus();
- });
-
- // Keyboard events
- $('#vcard input[type="text"]').keyup(function(e) {
- // Enter pressed: send the vCard
- if((e.keyCode == 13) && !$('#vcard .finish.save').hasClass('disabled')) {
- return self.send();
- }
- });
-
- // Click events
- $('#vcard .tab a').click(function() {
- var this_sel = $(this);
-
- // Yet active?
- if(this_sel.hasClass('tab-active')) {
- return false;
- }
-
- // Switch to the good tab
- var key = parseInt(this_sel.attr('data-key'));
-
- return self.switchTab(key);
- });
-
- $('#vcard .avatar-delete').click(function() {
- return self.deleteAvatar();
- });
-
- $('#vcard .bottom .finish').click(function() {
- var this_sel = $(this);
-
- if(this_sel.is('.cancel')) {
- return self.close();
- }
-
- if(this_sel.is('.save') && !this_sel.hasClass('disabled')) {
- return self.send();
- }
-
- return false;
- });
-
- // Avatar upload vars
- var avatar_options = {
- dataType: 'xml',
- beforeSubmit: self.waitAvatarUpload,
- success: self.handleAvatarUpload
- };
-
- // Avatar upload form submit event
- $('#vcard-avatar').submit(function() {
- if($('#vcard .wait').is(':hidden') &&
- $('#vcard .avatar-info.avatar-wait').is(':hidden') &&
- $('#vcard-avatar input[type="file"]').val()) {
- $(this).ajaxSubmit(avatar_options);
- }
-
- return false;
- });
-
- // Avatar upload input change event
- $('#vcard-avatar input[type="file"]').change(function() {
- if($('#vcard .wait').is(':hidden') &&
- $('#vcard .avatar-info.avatar-wait').is(':hidden') &&
- $(this).val()) {
- $('#vcard-avatar').ajaxSubmit(avatar_options);
- }
-
- return false;
- });
-
- // Placeholders
- $('#vcard-avatar input[type="text"]').placeholder();
- } catch(e) {
- Console.error('vCard.instance', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/welcome.js b/source/app/javascripts/welcome.js
deleted file mode 100644
index cfdc7a0..0000000
--- a/source/app/javascripts/welcome.js
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the welcome tool functions for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var Welcome = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /* Variables */
- self.is_done = false;
-
-
- /**
- * Opens the welcome tools
- * @public
- * @return {undefined}
- */
- self.open = function() {
-
- try {
- // Share message
- var share_msg = Common.printf(Common._e("Using Jappix, an open social platform. I am %s!"), Common.getXID());
-
- // Popup HTML content
- var html =
- '' + Common._e("Welcome!") + '
' +
-
- '' +
-
- '' +
- '
' +
-
- '
' +
- '
' +
- '
' + Common._e("Friends") + '
' +
- '
' + Common._e("Use this tool to find your friends on the server you are using right now, or add them later.") + '
' +
- '
' +
-
- '
' +
- '
' +
-
- '
' +
- '
' +
-
- '';
-
- // Create the popup
- Popup.create('welcome', html);
-
- // Unavoidable popup
- $('#welcome').addClass('unavoidable');
-
- // Apply the features
- Features.apply('welcome');
-
- // Associate the events
- self.instance();
-
- Console.log('Welcome assistant opened.');
- } catch(e) {
- Console.error('Welcome.open', e);
- }
-
- };
-
-
- /**
- * Closes the welcome tools
- * @public
- * @return {boolean}
- */
- self.close = function() {
-
- try {
- // Destroy the popup
- Popup.destroy('welcome');
- } catch(e) {
- Console.error('Welcome.close', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Switches the welcome tabs
- * @public
- * @param {string} id
- * @return {boolean}
- */
- self.switchTab = function(id) {
-
- try {
- // Path to
- var welcome = '#welcome ';
- var content = welcome + '.content .';
- var tab = welcome + '.tab ';
- var wait = $(welcome + '.wait');
-
- $(content + 'one-lap').hide();
- $(content + 'welcome' + id).show();
- $(tab + 'a').removeClass('tab-active');
- $(tab + 'a[data-step="' + id + '"]').addClass('tab-active').removeClass('tab-missing');
-
- // Update the "save" button if all is okay
- if(!Common.exists(tab + '.tab-missing')) {
- var finish = welcome + '.finish.';
-
- $(finish + 'save').show();
- $(finish + 'next').hide();
- }
-
- // If this is ID 2: vJUD search
- if(id == 2) {
- wait.show();
- DataForm.go(HOST_VJUD, 'search', '', '', 'welcome');
- } else {
- wait.hide();
- }
- } catch(e) {
- Console.error('Welcome.switchTab', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Sends the welcome options
- * @public
- * @param {object} array
- * @return {undefined}
- */
- self.send = function(array) {
-
- try {
- // Sends the options
- var iq = new JSJaCIQ();
- iq.setType('set');
-
- var query = iq.setQuery(NS_PRIVATE);
- var storage = query.appendChild(iq.buildNode('storage', {'xmlns': NS_OPTIONS}));
-
- // Value array
- var tags = ['sounds', 'geolocation', '', '', 'roster-showall'];
-
- // Build the XML with the array
- for(var i in array) {
- var value = array[i];
- var tag = tags[i];
-
- if((i != 2) && (i != 3) && tag && value) {
- storage.appendChild(iq.buildNode('option', {'type': tag, 'xmlns': NS_OPTIONS}, value));
- DataStore.setDB(Connection.desktop_hash, 'options', tag, value);
- }
- }
-
- con.send(iq);
-
- // If geolocation is enabled
- if(array[1] == '1') {
- PEP.geolocate();
- }
- } catch(e) {
- Console.error('Welcome.send', e);
- }
-
- };
-
-
- /**
- * Saves the welcome options
- * @public
- * @return {boolean}
- */
- self.save = function() {
-
- try {
- // Get the new options
- var array = [];
-
- $('#welcome a.box').each(function() {
- var current = '0';
-
- if($(this).hasClass('enabled')) {
- current = '1';
- }
-
- array.push(current);
- });
-
- // If XMPP links is enabled
- if(array[2] == '1') {
- Utils.xmppLinksHandler();
- }
-
- // If offline buddies showing is enabled
- if(array[4] == '1') {
- Interface.showAllBuddies('welcome');
- }
-
- // If archiving is supported by the server
- if(Features.enabledMAM()) {
- // If archiving is enabled
- if(array[3] == '1') {
- MAM.setConfig('roster');
- }
- }
-
- // Send the new options
- self.send(array);
-
- // Close the welcome tool
- self.close();
-
- // Open the profile editor
- vCard.open();
-
- // Unavoidable popup
- $('#vcard').addClass('unavoidable');
-
- self.is_done = true;
- } catch(e) {
- Console.error('Welcome.save', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Goes to the next welcome step
- * @public
- * @return {boolean}
- */
- self.next = function() {
-
- try {
- // Check the next step to go to
- var next = 1;
- var missing = '#welcome .tab a.tab-missing';
-
- if(Common.exists(missing)) {
- next = parseInt($(missing + ':first').attr('data-step'));
- }
-
- // Switch to the next step
- self.switchTab(next);
- } catch(e) {
- Console.error('Welcome.next', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Plugin launcher
- * @public
- * @return {undefined}
- */
- self.instance = function() {
-
- try {
- // Click events
- $('#welcome .tab a').click(function() {
- var this_sel = $(this);
-
- // Switch to the good tab
- var key = parseInt(this_sel.attr('data-step'));
-
- return self.switchTab(key);
- });
-
- $('#welcome a.box:not(.share)').click(function() {
- var this_sel = $(this);
-
- if(this_sel.hasClass('enabled')) {
- this_sel.removeClass('enabled').attr('title', Common._e("Click to enable"));
- } else {
- this_sel.addClass('enabled').attr('title', Common._e("Click to disable"));
- }
-
- return false;
- });
-
- $('#welcome .bottom .finish').click(function() {
- var this_sel = $(this);
-
- if(this_sel.is('.next')) {
- return self.next();
- }
-
- if(this_sel.is('.save')) {
- return self.save();
- }
-
- return false;
- });
- } catch(e) {
- Console.error('Welcome.instance', e);
- }
-
- };
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/javascripts/xmpplinks.js b/source/app/javascripts/xmpplinks.js
deleted file mode 100644
index 50f4d41..0000000
--- a/source/app/javascripts/xmpplinks.js
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are the XMPP links handling JS scripts for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-// Bundle
-var XMPPLinks = (function () {
-
- /**
- * Alias of this
- * @private
- */
- var self = {};
-
-
- /**
- * Does an action with the provided XMPP link
- * @public
- * @param {string} link
- * @return {boolean}
- */
- self.go = function(link) {
-
- /* REF: http://xmpp.org/registrar/querytypes.html */
-
- try {
- // Remove the "xmpp:" string
- link = Common.explodeThis(':', link, 1);
-
- // The XMPP URI has no "?"
- if(link.indexOf('?') == -1) {
- Chat.checkCreate(link, 'chat');
- } else {
- var xid = Common.explodeThis('?', link, 0);
- var action = Common.explodeThis('?', link, 1);
-
- switch(action) {
- // Groupchat
- case 'join':
- Chat.checkCreate(xid, 'groupchat');
-
- break;
-
- // Profile
- case 'vcard':
- UserInfos.open(xid);
-
- break;
-
- // Subscription
- case 'subscribe':
- Roster.addThisContact(xid);
-
- break;
-
- // Unsubscription
- case 'unsubscribe':
- Roster.send(xid, 'remove');
-
- break;
-
- // Private chat
- default:
- Chat.checkCreate(xid, 'chat');
-
- break;
- }
- }
- } catch(e) {
- Console.error('XMPPLinks.do', e);
- } finally {
- return false;
- }
-
- };
-
-
- /**
- * Gets the links vars (get parameters in URL)
- */
- self.links_var = (function() {
- var hash;
- var vars = [];
- var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
-
- for(var i = 0; i < hashes.length; i++) {
- hash = hashes[i].split('=');
-
- vars.push(hash[0]);
- vars[hash[0]] = $.trim(decodeURIComponent(hash[1]));
- }
-
- return vars;
- })();
-
-
- /**
- * Return class scope
- */
- return self;
-
-})();
\ No newline at end of file
diff --git a/source/app/sounds/catch-attention.mp3 b/source/app/sounds/catch-attention.mp3
deleted file mode 100644
index 2f48361..0000000
Binary files a/source/app/sounds/catch-attention.mp3 and /dev/null differ
diff --git a/source/app/sounds/catch-attention.oga b/source/app/sounds/catch-attention.oga
deleted file mode 100644
index a77f205..0000000
Binary files a/source/app/sounds/catch-attention.oga and /dev/null differ
diff --git a/source/app/sounds/incoming-call.mp3 b/source/app/sounds/incoming-call.mp3
deleted file mode 100644
index 48cbe6a..0000000
Binary files a/source/app/sounds/incoming-call.mp3 and /dev/null differ
diff --git a/source/app/sounds/incoming-call.oga b/source/app/sounds/incoming-call.oga
deleted file mode 100644
index 2d13fee..0000000
Binary files a/source/app/sounds/incoming-call.oga and /dev/null differ
diff --git a/source/app/sounds/new-chat.mp3 b/source/app/sounds/new-chat.mp3
deleted file mode 100644
index 6831df5..0000000
Binary files a/source/app/sounds/new-chat.mp3 and /dev/null differ
diff --git a/source/app/sounds/new-chat.oga b/source/app/sounds/new-chat.oga
deleted file mode 100644
index 645be0f..0000000
Binary files a/source/app/sounds/new-chat.oga and /dev/null differ
diff --git a/source/app/sounds/notification.mp3 b/source/app/sounds/notification.mp3
deleted file mode 100644
index 1310e51..0000000
Binary files a/source/app/sounds/notification.mp3 and /dev/null differ
diff --git a/source/app/sounds/notification.oga b/source/app/sounds/notification.oga
deleted file mode 100644
index b6d5580..0000000
Binary files a/source/app/sounds/notification.oga and /dev/null differ
diff --git a/source/app/sounds/outgoing-call.mp3 b/source/app/sounds/outgoing-call.mp3
deleted file mode 100644
index 5af21ce..0000000
Binary files a/source/app/sounds/outgoing-call.mp3 and /dev/null differ
diff --git a/source/app/sounds/outgoing-call.oga b/source/app/sounds/outgoing-call.oga
deleted file mode 100644
index 569d182..0000000
Binary files a/source/app/sounds/outgoing-call.oga and /dev/null differ
diff --git a/source/app/sounds/receive-message.mp3 b/source/app/sounds/receive-message.mp3
deleted file mode 100644
index 673cb24..0000000
Binary files a/source/app/sounds/receive-message.mp3 and /dev/null differ
diff --git a/source/app/sounds/receive-message.oga b/source/app/sounds/receive-message.oga
deleted file mode 100644
index 599600d..0000000
Binary files a/source/app/sounds/receive-message.oga and /dev/null differ
diff --git a/source/app/stylesheets/adhoc.css b/source/app/stylesheets/adhoc.css
deleted file mode 100644
index a86e77e..0000000
--- a/source/app/stylesheets/adhoc.css
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the Ad-Hoc CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#adhoc .content {
- padding: 10px 0 10px 0;
-}
-
-#adhoc .adhoc-head {
- background-color: #f1f6fd;
- border: 1px #9dc4fc solid;
- width: 598px;
- height: 18px;
- font-size: 0.9em;
- margin: 0 10px 12px 10px;
- padding: 6px 10px;
-}
-
-#adhoc .one-actions .one-button {
- float: right;
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/anonymous.css b/source/app/stylesheets/anonymous.css
deleted file mode 100644
index e85ab2f..0000000
--- a/source/app/stylesheets/anonymous.css
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the anonymous mode CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#top-content {
- min-width: 500px !important;
-}
-
-#main-content {
- min-width: 490px !important;
- min-height: 450px !important;
-}
-
-#left-content {
- display: none;
-}
-
-#right-content {
- left: 0 !important;
- right: 0 !important;
-}
diff --git a/source/app/stylesheets/board.css b/source/app/stylesheets/board.css
deleted file mode 100644
index f569ebd..0000000
--- a/source/app/stylesheets/board.css
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the board CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#board .one-board {
- display: none;
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- height: 20px;
- z-index: 10000;
- font-size: 0.92em;
- padding: 6px 8px 5px 8px;
- -moz-box-shadow: 0 0 8px #5c5c5c;
- -webkit-box-shadow: 0 0 8px #5c5c5c;
- box-shadow: 0 0 8px #5c5c5c;
-}
-
-#board .one-board:hover {
- cursor: pointer;
-}
-
-#board .one-board.visible {
- display: block;
-}
-
-#board .one-board.error {
- background-color: rgb(241,160,160);
- background-color: rgba(241,160,160,0.9);
- color: #420c0c;
-}
-
-#board .one-board.info {
- background-color: rgb(248,246,186);
- background-color: rgba(248,246,186,0.9);
- color: #2f2a02;
-}
diff --git a/source/app/stylesheets/call.css b/source/app/stylesheets/call.css
deleted file mode 100644
index 865bfcd..0000000
--- a/source/app/stylesheets/call.css
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the call CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-.videochat_box {
- display: none;
-}
-
-.videochat_box .videochat_items {
- background: #ededed;
- border: 1px solid rgb(0,0,0);
- border: 1px solid rgba(0,0,0,0.8);
- text-shadow: none;
- min-width: 550px;
- min-height: 420px;
- overflow: hidden;
- position: absolute;
- left: 100px;
- right: 100px;
- top: 40px;
- bottom: 40px;
- -moz-box-shadow: 0 0 12px rgba(0,0,0,0.4);
- -webkit-box-shadow: 0 0 12px rgba(0,0,0,0.4);
- box-shadow: 0 0 12px rgba(0,0,0,0.4);
-}
-
-.videochat_box .videochat_items .topbar {
- background: rgb(0,0,0);
- background: rgba(0,0,0,0.5);
- border-bottom: 1px solid rgb(0,0,0);
- border-bottom: 1px solid rgba(0,0,0,0.15);
- color: #ffffff;
- text-shadow: 0 1px 1px rgb(0,0,0);
- text-shadow: 0 1px 1px rgba(0,0,0,0.5);
- height: 40px;
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- z-index: 4;
- -moz-box-shadow: 0 0 5px rgba(0,0,0,0.25);
- -webkit-box-shadow: 0 0 5px rgba(0,0,0,0.25);
- box-shadow: 0 0 5px rgba(0,0,0,0.25);
-}
-
-.videochat_box .videochat_items .topbar .controls,
-.videochat_box .videochat_items .topbar .elapsed {
- float: left;
-}
-
-html[dir="rtl"] .videochat_box .videochat_items .topbar .controls,
-html[dir="rtl"] .videochat_box .videochat_items .topbar .elapsed {
- float: right;
-}
-
-html[dir="rtl"] .videochat_box .videochat_items .topbar .controls {
- margin-left: 0;
- margin-right: 50px;
-}
-
-.videochat_box .videochat_items .topbar .controls a {
- margin-top: 7px;
- float: left;
-}
-
-html[dir="rtl"] .videochat_box .videochat_items .topbar .controls a {
- float: right;
-}
-
-.videochat_box .videochat_items .topbar .controls a,
-.call-content .call-notify .notification-content .reply-buttons a.reply-button {
- border-width: 1px;
- border-style: solid;
- font-size: 10px;
- color: #ffffff;
- text-transform: uppercase;
- text-decoration: none;
- padding: 5px 6px 6px 6px;
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- border-radius: 2px;
-}
-
-.videochat_box .videochat_items .topbar .controls a:active,
-.call-content .call-notify .notification-content .reply-buttons a.reply-button:active {
- padding-top: 6px;
- padding-bottom: 5px;
- -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.25) inset;
- -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.25) inset;
- box-shadow: 0 1px 3px rgba(0,0,0,0.25) inset;
-}
-
-.videochat_box .videochat_items .topbar .controls a .icon {
- width: 14px;
- height: 14px;
- margin: -1px 7px 0 2px;
- float: left;
-}
-
-.videochat_box .videochat_items .topbar .controls a.stop,
-.videochat_box .videochat_items .topbar .controls a.leave,
-.call-content .call-notify .notification-content .reply-buttons a.reply-button.red {
- background: #cc283f;
- border-color: #5e121d;
-}
-
-.videochat_box .videochat_items .topbar .controls a.stop:active,
-.videochat_box .videochat_items .topbar .controls a.leave:active,
-.call-content .call-notify .notification-content .reply-buttons a.reply-button.red:active {
- background: #a92134;
- border-color: #480e16;
-}
-
-.videochat_box .videochat_items .topbar .controls a.stop .icon,
-.videochat_box .videochat_items .topbar .controls a.leave .icon {
- background-position: 0 -62px;
-}
-
-.call-content .call-notify .notification-content .reply-buttons a.reply-button.green {
- background: #5ea45e;
- border-color: #1a2e1a;
-}
-
-.call-content .call-notify .notification-content .reply-buttons a.reply-button.green:active {
- background: #549253;
- border-color: #0f1a0f;
-}
-
-.videochat_box .videochat_items .topbar .controls a.mute,
-.videochat_box .videochat_items .topbar .controls a.unmute,
-.call-content .call-notify .notification-content .reply-buttons a.reply-button.blue {
- background: #6e8dc5;
- border-color: #303d55;
-}
-
-.videochat_box .videochat_items .topbar .controls a.mute,
-.videochat_box .videochat_items .topbar .controls a.unmute {
- margin-left: 6px;
-}
-
-html[dir="rtl"] .videochat_box .videochat_items .topbar .controls a.mute,
-html[dir="rtl"] .videochat_box .videochat_items .topbar .controls a.unmute {
- margin-left: 0;
- margin-right: 6px;
-}
-
-.videochat_box .videochat_items .topbar .controls a.mute:active,
-.videochat_box .videochat_items .topbar .controls a.unmute:active,
-.call-content .call-notify .notification-content .reply-buttons a.reply-button.blue:active {
- background: #6480b1;
- border-color: #222b3b;
-}
-
-.videochat_box .videochat_items .topbar .controls a.mute .icon {
- background-position: 0 -81px;
-}
-
-.videochat_box .videochat_items .topbar .controls a.unmute {
- display: none;
-}
-
-.videochat_box .videochat_items .topbar .controls a.unmute .icon {
- background-position: 0 -100px;
-}
-
-.videochat_box .videochat_items .topbar .elapsed {
- background: rgb(0,0,0);
- background: rgba(0,0,0,0.1);
- border: 1px solid rgb(255,255,255);
- border: 1px solid rgba(255,255,255,0.25);
- outline: 1px solid rgb(0,0,0);
- outline: 1px solid rgba(0,0,0,0.2);
- font-size: 11px;
- font-weight: bold;
- letter-spacing: 2px;
- margin: 10px 0 0 46px;
- padding: 2px 6px;
-}
-
-html[dir="rtl"] .videochat_box .videochat_items .topbar .elapsed {
- margin-left: 0;
- margin-right: 46px;
-}
-
-.videochat_box .videochat_items .topbar .actions {
- margin: 7px 15px 0 0;
- float: right;
-}
-
-html[dir="rtl"] .videochat_box .videochat_items .topbar .actions {
- margin-right: 0;
- margin-left: 15px;
- float: left;
-}
-
-.videochat_box .videochat_items .topbar .actions a {
- float: left;
-}
-
-.videochat_box .videochat_items .topbar .actions a.close {
- background-position: 0 -44px;
- width: 18px;
- height: 12px;
- margin-top: 6px;
-}
-
-.videochat_box .videochat_items .local_video {
- background-position: 0 -56px;
- border: 1px solid rgb(0,0,0);
- border: 1px solid rgba(0,0,0,0.5);
- width: 180px;
- height: 101px;
- opacity: 0.6;
- overflow: hidden;
- position: absolute;
- left: 18px;
- bottom: 18px;
- z-index: 3;
- -moz-box-shadow: 0 0 8px rgba(0,0,0,0.25);
- -webkit-box-shadow: 0 0 8px rgba(0,0,0,0.25);
- box-shadow: 0 0 8px rgba(0,0,0,0.25);
- -webkit-transition: all 0.4s ease-in-out 0.2s;
- -moz-transition: all 0.4s ease-in-out 0.2s;
- -o-transition: all 0.4s ease-in-out 0.2s;
- transition: all 0.4s ease-in-out 0.2s;
-}
-
-html[dir="rtl"] .videochat_box .videochat_items .local_video {
- left: auto;
- right: 18px;
-}
-
-.videochat_box .videochat_items .local_video:disabled {
- opacity: 0.2 !important;
-}
-
-.videochat_box .videochat_items .local_video:hover {
- width: 320px;
- height: 180px;
- opacity: 1;
- cursor: pointer;
-}
-
-.videochat_box .videochat_items .local_video video {
- width: 100%;
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/channel.css b/source/app/stylesheets/channel.css
deleted file mode 100644
index c207dd1..0000000
--- a/source/app/stylesheets/channel.css
+++ /dev/null
@@ -1,646 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the channel CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#channel .top div.update {
- position: absolute;
- top: 12px;
- left: 115px;
- right: 15px;
- bottom: 15px;
- -moz-border-radius: 20px;
- -webkit-border-radius: 20px;
- border-radius: 20px;
-}
-
-html[dir="rtl"] #channel .top div.update {
- right: 115px;
- left: 15px;
-}
-
-#channel .top p {
- font-size: 0.9em;
- margin-bottom: 10px;
-}
-
-#channel .top h2 {
- font-size: 1.5em;
- margin-bottom: 10px;
- color: #232323;
-}
-
-#channel .top a {
- font-size: 0.9em;
- color: #232323;
-}
-
-#channel .top.individual div.update {
- right: 36px;
-}
-
-#channel .top.individual div.shortcuts,
-#userinfos .main-infos div.shortcuts {
- width: 16px;
- float: right;
-}
-
-#channel .top.individual div.shortcuts {
- margin: 2px 5px 0 0;
-}
-
-#channel .top.individual div.shortcuts a,
-#userinfos .main-infos div.shortcuts a {
- height: 16px;
- width: 16px;
- margin-bottom: 4px;
- display: block;
-}
-
-#channel .top.individual div.shortcuts a.message,
-#userinfos .main-infos a.message {
- background-position: 0 -1717px;
-}
-
-#channel .top.individual div.shortcuts a.chat,
-#userinfos .main-infos a.chat {
- background-position: 0 -1737px;
-}
-
-#channel .top.individual div.shortcuts a.command,
-#userinfos .main-infos a.command {
- background-position: 0 -1758px;
-}
-
-#channel .microblog-body {
- height: 20px;
- margin-right: 50px;
-}
-
-html[dir="rtl"] #channel .microblog-body {
- margin-right: auto;
- margin-left: 50px;
-}
-
-#channel .microblog-body input {
- width: 100%;
- height: 100%;
- padding: 8px;
-}
-
-#channel .one-microblog-icon {
- position: absolute;
- top: 38px;
- right: 0;
-}
-
-html[dir="rtl"] #channel .one-microblog-icon {
- left: 0;
- right: auto;
-}
-
-#channel div.update .one-microblog-icon,
-#channel div.update .postit {
- width: 16px;
- height: 16px;
- display: block;
-}
-
-#channel div.update .attach {
- background-position: 0 -79px;
- display: none;
-}
-
-#attach {
- position: absolute;
- width: 263px;
- margin-left: -227px;
- color: white;
- font-size: 0.85em;
- z-index: 9998;
- text-align: left;
- display: none;
-}
-
-#attach p {
- margin-bottom: 6px !important;
-}
-
-#attach input[type="submit"] {
- margin: 8px 0 6px 0;
-}
-
-#attach .wait {
- float: right;
- margin: 7px 5px;
-}
-
-#attach div.one-file {
- height: 16px;
- margin-top: 2px;
-}
-
-#attach div.one-file a.link {
- color: white;
- width: 215px;
- height: 14px;
- margin-left: 2px;
- overflow: hidden;
- float: left;
-}
-
-html[dir="rtl"] #attach div.one-file a.link {
- text-align: right;
- margin-left: auto;
- margin-right: 2px;
- float: right;
-}
-
-#attach div.one-file a.remove {
- width: 16px;
- height: 16px;
- float: left;
-}
-
-html[dir="rtl"] #attach div.one-file a.remove {
- float: right;
-}
-
-.attach-subarrow {
- background-position: 0 -241px;
- opacity: 0.8;
- height: 10px;
- width: 18px;
- margin-left: 226px;
-}
-
-.attach-subitem {
- background-color: rgb(0,0,0);
- background-color: rgba(0,0,0,0.8);
- padding: 10px;
- text-shadow: 0 1px 1px black;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- border-radius: 5px;
-}
-
-html[dir="rtl"] .attach-subitem {
- position: absolute;
- left: 238px;
-}
-
-.attach-p {
- font-weight: bold;
- float: left;
-}
-
-#channel .one-update {
- margin-bottom: 12px;
- padding: 6px 6px 8px 6px;
- border-bottom: 1px dotted #d0d0d0;
- min-height: 50px;
- color: black;
- position: relative;
- display: none;
-}
-
-#channel .one-update .avatar-container {
- text-align: center;
- margin-right: 16px;
- float: left;
- height: 50px;
- width: 50px;
-}
-
-html[dir="rtl"] #channel .one-update .avatar-container {
- margin-right: auto;
- margin-left: 16px;
- float: right;
-}
-
-#channel .one-update .avatar-container:hover {
- cursor: pointer;
-}
-
-#channel .one-update img.avatar {
- max-height: 50px;
- max-width: 50px;
-}
-
-#channel .one-update div.body {
- line-height: 1.4;
- margin-left: 65px;
- opacity: 0.8;
-}
-
-#channel .one-update:hover div.body {
- opacity: 1;
-}
-
-#channel .one-update a.repeat {
- background-position: 0 -1681px;
- height: 16px;
- width: 16px;
- margin-right: 4px;
- float: left;
-}
-
-#channel .one-update span a {
- text-decoration: underline;
-}
-
-#channel .one-update p {
- display: block;
- margin: 0 12px 5px 0;
-}
-
-html[dir="rtl"] #channel .one-update p {
- margin-right: auto;
- margin-left: 12px;
-}
-
-#channel .one-update p b.name:hover {
- cursor: pointer;
- text-decoration: underline;
-}
-
-html[dir="rtl"] #channel .one-update p b.name {
- margin-left: 4px;
- float: right;
-}
-
-#channel .one-update p.infos {
- font-size: 0.9em;
-}
-
-#channel .one-update p.infos a.geoloc {
- background-position: 0 -1778px;
- color: #363636;
- margin-left: 18px;
- padding-left: 14px;
-}
-
-html[dir="rtl"] #channel .one-update p.infos a.geoloc {
- float: right;
-}
-
-#channel .one-update p.infos a.geoloc:hover,
-#channel .one-update p.infos a.geoloc:focus,
-#channel .one-update p.infos a.geoloc:active {
- color: #141414;
-}
-
-#channel .one-update p.file {
- font-size: 0.9em;
- margin: 6px 0 5px 10px;
-}
-
-#channel .one-update p.file a.link,
-#inbox .inbox-new-file a.file {
- min-height: 16px;
- padding-left: 22px;
- text-decoration: underline;
- display: block;
-}
-
-#channel .one-update p.file a.link {
- margin-top: 4px;
-}
-
-#channel p.file a,
-#inbox .inbox-new-file a.file {
- background-position: 0 -988px;
-}
-
-#channel p.file a.audio,
-#inbox .inbox-new-file a.file.audio {
- background-position: 0 -899px;
-}
-
-#channel p.file a.image,
-#inbox .inbox-new-file a.file.image {
- background-position: 0 -917px;
-}
-
-#channel p.file a.video,
-#inbox .inbox-new-file a.file.video {
- background-position: 0 -935px;
-}
-
-#channel p.file a.document,
-#inbox .inbox-new-file a.file.document {
- background-position: 0 -953px;
-}
-
-#channel p.file a.package,
-#inbox .inbox-new-file a.file.package {
- background-position: 0 -971px;
-}
-
-#channel .one-update p.file a.thumb img {
- border: 1px solid #a2a2a2;
- max-width: 140px;
- max-height: 105px;
- margin: 4px 10px 2px 0;
- padding: 1px;
-}
-
-#channel .one-update p.file a.thumb img:hover {
- border-color: #464646;
-}
-
-#channel .one-update div.comments,
-.popup.large div.comments {
- width: 410px;
- margin: 2px 0 2px 76px;
-}
-
-html[dir="rtl"] #channel .one-update div.comments {
- margin-left: auto;
- margin-right: 76px;
-}
-
-#channel .one-update div.comments div.arrow,
-.popup.large div.comments div.arrow {
- background-position: 0 -1702px;
- width: 20px;
- height: 8px;
- margin-left: 20px;
- display: block;
-}
-
-html[dir="rtl"] #channel .one-update div.comments div.arrow,
-html[dir="rtl"] .popup.large div.comments div.arrow {
- margin-left: auto;
- margin-right: 20px;
-}
-
-#channel .one-update div.comments div.comments-content,
-.popup.large div.comments div.comments-content {
- background-color: #e5ebec;
- color: black;
- font-size: 0.9em;
- text-shadow: 0 1px 0 white;
-}
-
-#channel .one-update div.comments input,
-.popup.large div.comments input {
- width: 356px;
- margin: 6px 0;
- padding: 4px 5px;
-}
-
-#channel .one-update div.comments span.icon,
-.popup.large div.comments span.icon {
- background-position: 0 -1082px;
- height: 16px;
- width: 16px;
- margin: 10px;
- float: left;
-}
-
-html[dir="rtl"] #channel .one-update div.comments span.icon,
-html[dir="rtl"] .popup.large div.comments span.icon {
- float: right;
-}
-
-#channel .one-update div.comments .one-comment.loading span.icon,
-.popup.large div.comments .one-comment.loading span.icon {
- margin: 0 10px 0 0;
-}
-
-html[dir="rtl"] #channel .one-update div.comments .one-comment.loading span.icon,
-html[dir="rtl"] .popup.large div.comments .one-comment.loading span.icon {
- margin: 0 0 0 10px;
-}
-
-#channel .one-update div.comments .one-comment,
-.popup.large div.comments .one-comment {
- border-bottom: 1px solid #f4f4f4;
- padding: 4px 8px 0 8px;
- position: relative;
- display: block;
-}
-
-#channel .one-update div.comments .one-comment.compose,
-.popup.large div.comments .one-comment.compose {
- border-bottom: 2px solid #f4f4f4;
- height: 36px;
- padding: 0;
-}
-
-#channel .one-update div.comments .one-comment.new,
-.popup.large div.comments .one-comment.new {
- display: none;
-}
-
-#channel .one-update div.comments a.one-comment,
-.popup.large div.comments a.one-comment {
- text-decoration: none;
-}
-
-#channel .one-update div.comments a.one-comment:hover,
-#channel .one-update div.comments a.one-comment:focus,
-.popup.large div.comments a.one-comment:hover,
-.popup.large div.comments a.one-comment:focus {
- text-decoration: underline;
-}
-
-#channel .one-update div.comments .one-comment.loading,
-.popup.large div.comments .one-comment.loading {
- padding-bottom: 5px;
-}
-
-#channel .one-update div.comments .one-comment div.marker,
-.popup.large div.comments .one-comment div.marker {
- background-color: #6d8387;
- width: 2px;
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
-}
-
-#channel .one-update div.comments .one-comment .avatar-container,
-.popup.large div.comments .one-comment .avatar-container {
- text-align: center;
- width: 30px;
- height: 30px;
- margin: 2px 8px 0 0;
- float: left;
-}
-
-html[dir="rtl"] #channel .one-update div.comments .one-comment .avatar-container,
-html[dir="rtl"] .popup.large div.comments .one-comment .avatar-container {
- margin-right: auto;
- margin-left: 8px;
- float: right;
-}
-
-#channel .one-update div.comments .one-comment .avatar-container:hover,
-.popup.large div.comments .one-comment .avatar-container:hover {
- cursor: pointer;
-}
-
-#channel .one-update div.comments .one-comment img.avatar,
-.popup.large div.comments .one-comment img.avatar {
- max-height: 30px;
- max-width: 30px;
-}
-
-#channel .one-update div.comments .one-comment .comment-container,
-.popup.large div.comments .one-comment .comment-container {
- float: left;
-}
-
-#channel .one-update div.comments .one-comment a.name,
-.popup.large div.comments .one-comment a.name {
- font-weight: bold;
- text-decoration: none;
- font-size: 0.95em;
- padding-bottom: 2px;
- float: left;
-}
-
-html[dir="rtl"] #channel .one-update div.comments .one-comment a.name,
-html[dir="rtl"] .popup.large div.comments .one-comment a.name {
- float: right;
-}
-
-#channel .one-update div.comments .one-comment a.name:hover,
-#channel .one-update div.comments .one-comment a.name:focus,
-.popup.large div.comments .one-comment a.name:hover,
-.popup.large div.comments .one-comment a.name:focus {
- text-decoration: underline;
-}
-
-#channel .one-update div.comments .one-comment span.date,
-#channel .one-update div.comments .one-comment a.remove,
-.popup.large div.comments .one-comment span.date,
-.popup.large div.comments .one-comment a.remove {
- font-size: 0.85em;
- float: right;
-}
-
-html[dir="rtl"] #channel .one-update div.comments .one-comment span.date,
-html[dir="rtl"] #channel .one-update div.comments .one-comment a.remove,
-html[dir="rtl"] .popup.large div.comments .one-comment span.date,
-html[dir="rtl"] .popup.large div.comments .one-comment a.remove {
- margin-left: 2px;
- float: left;
-}
-
-#channel .one-update div.comments .one-comment.me:hover span.date,
-.popup.large div.comments .one-comment.me:hover span.date {
- display: none;
-}
-
-#channel .one-update div.comments .one-comment.me a.remove,
-.popup.large div.comments .one-comment.me a.remove {
- display: none;
-}
-
-#channel .one-update div.comments .one-comment.me:hover a.remove,
-.popup.large div.comments .one-comment.me:hover a.remove {
- display: block;
-}
-
-#channel .one-update div.comments .one-comment p.body,
-.popup.large div.comments .one-comment p.body {
- clear: both;
-}
-
-#channel a.more {
- background-position: 0 -334px;
- color: black;
- height: 16px;
- text-decoration: none;
- margin: -2px 0 14px 4px;
- padding-left: 20px;
- display: block;
- visibility: hidden;
-}
-
-#channel a.more:hover,
-#channel a.more:focus {
- text-decoration: underline;
-}
-
-#channel a.mbtool {
- width: 11px;
- height: 11px;
- display: none;
- position: absolute;
- right: 0;
-}
-
-html[dir="rtl"] #channel a.mbtool {
- right: auto;
- left: 0;
-}
-
-#channel .one-update:hover a.mbtool {
- display: block;
-}
-
-#channel a.mbtool:hover,
-#channel a.mbtool:focus {
- text-decoration: none;
-}
-
-#channel a.mbtool.profile {
- background-position: -1px -1333px;
- top: 24px;
-}
-
-#channel a.mbtool.repost {
- background-position: -1px -1354px;
-}
-
-#channel a.mbtool.remove {
- background-position: -1px -1312px;
-}
-
-#channel a.mbtool.repost,
-#channel a.mbtool.remove {
- top: 6px;
-}
-
-#channel .footer {
- bottom: 0;
- -moz-border-radius-bottomleft: 4px;
- -moz-border-radius-bottomright: 4px;
- -webkit-border-bottom-left-radius: 4px;
- -webkit-border-bottom-right-radius: 4px;
- border-bottom-left-radius: 4px;
- border-bottom-right-radius: 4px;
-}
-
-#channel .footer div {
- margin-left: 5px;
- padding-left: 24px;
- min-height: 16px;
- font-size: 0.85em;
- width: auto !important;
-}
-
-html[dir="rtl"] #channel .footer div {
- float: right;
-}
-
-#channel .footer .sync {
- background-position: 0 -804px;
- display: none;
-}
-
-#channel .footer .unsync {
- background-position: 0 -830px;
- display: none;
-}
diff --git a/source/app/stylesheets/directory.css b/source/app/stylesheets/directory.css
deleted file mode 100644
index 0f6d935..0000000
--- a/source/app/stylesheets/directory.css
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the directory tool CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#directory .content {
- padding: 10px 0 10px 0;
-}
diff --git a/source/app/stylesheets/discovery.css b/source/app/stylesheets/discovery.css
deleted file mode 100644
index ea691e0..0000000
--- a/source/app/stylesheets/discovery.css
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the discovery CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#discovery .content {
- padding: 10px 0 10px 0;
-}
-
-#discovery .content p {
- margin: 5px 10px 5px 10px;
- text-align: justify;
- font-size: 0.85em;
-}
-
-#discovery .discovery-head,
-#directory .directory-head,
-#rosterx .rosterx-head,
-#privacy .privacy-head {
- width: 606px;
- height: 24px;
- margin: 0 10px 10px 10px;
- padding: 6px;
- background: #f1f6fd;
- border: 1px #9dc4fc solid;
-}
-
-#discovery .disco-server-text,
-#directory .directory-server-text {
- float: left;
- font-size: 0.9em;
- margin: 3px;
-}
-
-html[dir="rtl"] #discovery .disco-server-text,
-html[dir="rtl"] #directory .directory-server-text {
- float: right;
-}
-
-#discovery .disco-server-input,
-#directory .directory-server-input {
- width: 200px;
- height: 18px;
- float: right;
- margin-right: 10px;
- padding: 2px;
-}
-
-html[dir="rtl"] #discovery .disco-server-input,
-html[dir="rtl"] #directory .directory-server-input {
- margin-right: 0;
- margin-left: 10px;
- float: left;
-}
-
-#discovery .disco-category {
- display: none;
- margin-bottom: 22px;
-}
-
-#discovery .disco-category-title {
- font-weight: bold;
-}
-
-#discovery .one-actions .one-button {
- float: right;
-}
-
-html[dir="rtl"] #discovery .one-actions .one-button {
- float: left;
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/favorites.css b/source/app/stylesheets/favorites.css
deleted file mode 100644
index 8980260..0000000
--- a/source/app/stylesheets/favorites.css
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the favorites CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#favorites .content {
- padding: 10px 0 10px 0;
-}
-
-#favorites .fedit-head-select {
- min-width: 190px;
- max-width: 210px;
-}
-
-#favorites .switch-fav {
- margin: 0 10px 0 10px;
- width: 200px;
- height: 355px;
- border-right: 1px #c0c0c0 dotted;
- float: left;
-}
-
-#favorites .room-switcher {
- width: 188px;
- height: 18px;
- border-bottom: 1px #9dc4fc solid;
- float: left;
- padding: 10px 6px;
- font-size: 0.9em;
-}
-
-#favorites .room-switcher:hover {
- background-color: #e9f1fd;
- cursor: pointer;
-}
-
-#favorites .room-switcher:active {
- background-color: #f1f6fd;
-}
-
-#favorites .switch-fav .icon {
- float: left;
- height: 16px;
- width: 16px;
- margin: 0 8px 0 0;
-}
-
-#favorites .switch-fav .room-list .list-icon {
- background-position: 0 -855px;
-}
-
-#favorites .switch-fav .room-search .search-icon {
- background-position: 0 -876px;
-}
-
-#favorites .static-fav {
- width: 385px;
- height: 335px;
- margin: 0 10px 0 0;
- padding: 10px;
- float: right;
-}
-
-#favorites .favorites-search {
- display: none;
-}
-
-#favorites .static-fav-head {
- width: 393px;
- margin: -10px;
-}
-
-#favorites .static-fav-results {
- width: 406px;
- height: 314px;
- margin: 10px -10px -10px -10px;
- padding: 6px 0 0 0;
-}
-
-#favorites .fedit-line {
- height: 30px;
- font-size: 0.9em;
- padding: 10px 0 4px 4px;
- border-bottom: 1px #9dc4fc solid;
-}
-
-#favorites .fedit-line:hover {
- background: #e9f1fd;
-}
-
-#favorites label {
- width: 140px;
- margin-top: 3px;
-}
-
-#favorites input {
- height: 18px;
- width: 186px;
- margin-top: 0;
- padding: 2px;
-}
-
-#favorites .fedit-select {
- min-width: 160px;
-}
-
-#favorites .fedit-actions {
- margin: 10px 0 0;
- font-size: 0.9em;
- float: right;
-}
-
-#favorites input[type="checkbox"] {
- margin-top: 5px;
- width: auto;
-}
-
-#favorites .fedit-terminate {
- float: right;
-}
-
-#favorites .fedit-add {
- display: block;
-}
-
-#favorites .fedit-edit {
- background-position: 2px -1240px;
-}
-
-#favorites .fedit-remove {
- margin: 0 8px 0 0;
-}
-
-#favorites .add,
-.popup .results .one-button.one-add {
- background-position: 3px -1177px;
-}
-
-#favorites .remove,
-#inbox .remove {
- background-position: 3px -1196px;
-}
-
-#favorites .join,
-#inbox .reply,
-#inbox .send,
-.popup .results .one-button.one-chat,
-.popup .results a.one-profile {
- background-position: 3px -124px;
-}
-
-#favorites .one-button,
-#inbox .one-button,
-.popup .results .one-button {
- padding-left: 20px !important;
- font-size: 0.98em;
-}
-
-#favorites .fsearch-results {
- overflow: auto;
-}
-
-#favorites .room-name {
- margin: 4px 2px 5px;
- max-width: 210px;
- float: left;
-}
-
-html[dir="rtl"] #favorites .room-name {
- float: right;
-}
-
-#favorites .fsearch-noresults {
- display: none;
- font-size: 0.9em;
- font-weight: bold;
-}
diff --git a/source/app/stylesheets/fonts.css b/source/app/stylesheets/fonts.css
deleted file mode 100644
index 00a2e69..0000000
--- a/source/app/stylesheets/fonts.css
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the fonts CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-@font-face {
- font-family: 'PT Sans';
- src: url('../fonts/eot/ptsans.eot');
- src: url('../fonts/eot/ptsans.eot?#iefix') format('embedded-opentype'),
- url('../fonts/woff/ptsans.woff') format('woff'),
- url('../fonts/ttf/ptsans.ttf') format('truetype'),
- url('../fonts/svg/ptsans.svg#pt_sansregular') format('svg');
-}
-
-@font-face {
- font-family: 'PT Sans';
- font-style: italic;
- src: url('../fonts/eot/ptsansitalic.eot');
- src: url('../fonts/eot/ptsansitalic.eot?#iefix') format('embedded-opentype'),
- url('../fonts/woff/ptsansitalic.woff') format('woff'),
- url('../fonts/ttf/ptsansitalic.ttf') format('truetype'),
- url('../fonts/svg/ptsansitalic.svg#pt_sansitalic') format('svg');
-}
-
-@font-face {
- font-family: 'PT Sans';
- font-weight: bold;
- src: url('../fonts/eot/ptsansbold.eot');
- src: url('../fonts/eot/ptsansbold.eot?#iefix') format('embedded-opentype'),
- url('../fonts/woff/ptsansbold.woff') format('woff'),
- url('../fonts/ttf/ptsansbold.ttf') format('truetype'),
- url('../fonts/svg/ptsansbold.svg#pt_sansbold') format('svg');
-}
-
-@font-face {
- font-family: 'PT Sans';
- font-weight: bold;
- font-style: italic;
- src: url('../fonts/eot/ptsansbolditalic.eot');
- src: url('../fonts/eot/ptsansbolditalic.eot?#iefix') format('embedded-opentype'),
- url('../fonts/woff/ptsansbolditalic.woff') format('woff'),
- url('../fonts/ttf/ptsansbolditalic.ttf') format('truetype'),
- url('../fonts/svg/ptsansbolditalic.svg#pt_sansbold_italic') format('svg');
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/home.css b/source/app/stylesheets/home.css
deleted file mode 100644
index 2b40e90..0000000
--- a/source/app/stylesheets/home.css
+++ /dev/null
@@ -1,998 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the home CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#home {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- min-height: 550px;
- min-width: 875px;
-}
-
-#home .corporation,
-#home .corporation .corp_network,
-#home .aboutus,
-#home .aboutus .aboutus_org,
-#home .locale,
-#home .obsolete {
- background-color: rgb(20,20,20);
- background-color: rgba(20,20,20,0.70);
- color: white;
- position: absolute;
- top: 0;
- text-shadow: 0 0 1px black;
- z-index: 100;
- -moz-border-radius-bottomleft: 3px;
- -moz-border-radius-bottomright: 3px;
- -webkit-border-bottom-left-radius: 3px;
- -webkit-border-bottom-right-radius: 3px;
- border-bottom-left-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-
-#home .corporation,
-#home .aboutus {
- height: 26px;
- width: 34px;
-}
-
-#home .corporation {
- background-position: 9px -120px;
- left: 12px;
-}
-
-html[dir="rtl"] #home .corporation {
- left: auto;
- right: 12px;
-}
-
-#home .aboutus {
- background-position: 9px -351px;
- left: 52px;
-}
-
-html[dir="rtl"] #home .aboutus {
- left: auto;
- right: 52px;
-}
-
-#home .corporation.hovered,
-#home .aboutus.hovered {
- height: 28px;
- -moz-border-radius: 0;
- -webkit-border-radius: 0;
- border-radius: 0;
-}
-
-#home .corporation .corp_network,
-#home .aboutus .aboutus_org {
- width: 180px;
- padding: 10px 12px;
- top: 28px;
- left: 0;
- display: none;
- -moz-border-radius-topright: 3px;
- -webkit-border-top-right-radius: 3px;
- border-top-right-radius: 3px;
-}
-
-html[dir="rtl"] #home .corporation .corp_network,
-html[dir="rtl"] #home .aboutus .aboutus_org {
- left: auto;
- right: 0;
- -moz-border-radius-topright: 0;
- -moz-border-radius-topleft: 3px;
- -webkit-border-top-right-radius: 0;
- -webkit-border-top-left-radius: 3px;
- border-top-right-radius: 0;
- border-top-left-radius: 3px;
-}
-
-#home .corporation.hovered .corp_network,
-#home .aboutus.hovered .aboutus_org {
- display: block;
-}
-
-#home .corporation .corp_network h2,
-#home .aboutus .aboutus_org h2 {
- font-size: 1.1em;
- margin: 12px 0 4px 0;
-}
-
-#home .corporation .corp_network h2.nomargin {
- margin-top: 0;
-}
-
-#home .aboutus.hovered .aboutus_org span.version {
- font-size: 0.8em;
- display: block;
-}
-
-#home .corporation .corp_network a,
-#home .aboutus .aboutus_org span.one {
- margin: 2px 0;
- padding: 2px 6px;
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- border-radius: 2px;
-}
-
-#home .aboutus .aboutus_org span.one {
- display: block;
-}
-
-#home .corporation .corp_network a span,
-#home .aboutus .aboutus_org span.one a.name,
-#home .aboutus .aboutus_org span.one a.desc {
- margin: 2px 0;
- display: block;
-}
-
-#home .corporation .corp_network a span.name,
-#home .aboutus .aboutus_org span.one a.name {
- font-weight: bold;
- font-size: 0.9em;
-}
-
-#home .corporation .corp_network a span.desc,
-#home .aboutus .aboutus_org span.one a.desc {
- font-size: 0.7em;
- margin-left: 2px;
-}
-
-#home .locale {
- left: 92px;
- font-size: 0.85em;
-}
-
-html[dir="rtl"] #home .locale {
- left: auto;
- right: 92px;
-}
-
-#home .locale .current {
- height: 19px;
- padding: 3px 12px 4px 12px;
- font-weight: bold;
-}
-
-#home .locale .current:hover {
- cursor: default;
-}
-
-#home .locale .current .current_align {
- height: 19px;
- vertical-align: middle;
- display: table-cell;
-}
-
-#home .locale .list {
- margin: 2px 0 2px;
-}
-
-#home .locale .list a,
-#home .corporation .corp_network a,
-#home .aboutus .aboutus_org a {
- color: white;
- text-decoration: none;
- display: block;
-}
-
-#home .locale .list a {
- padding: 3px 10px;
-}
-
-#home .locale .list a:hover,
-#home .locale .list a:focus,
-#home .corporation .corp_network a:hover,
-#home .corporation .corp_network a:focus,
-#home .aboutus .aboutus_org span.one:hover {
- background-color: rgb(255,255,255);
- background-color: rgba(255,255,255,0.1);
-}
-
-#home .locale .list a:hover,
-#home .locale .list a:focus,
-#home .corporation .corp_network a:hover,
-#home .corporation .corp_network a:focus {
- cursor: pointer;
-}
-
-#home .locale .list a:active,
-#home .corporation .corp_network a:active,
-#home .aboutus .aboutus_org span.one:active {
- background-color: rgb(255,255,255);
- background-color: rgba(255,255,255,0.14);
-}
-
-#home .obsolete {
- height: 60px;
- padding: 4px 10px;
- right: 12px;
- font-size: 0.9em;
- font-weight: bold;
- display: none;
-}
-
-html[dir="rtl"] #home .obsolete {
- right: auto;
- left: 12px;
-}
-
-#home .obsolete a {
- height: 33px;
- width: 33px;
- margin: 5px 2px 0 0;
- float: left;
-}
-
-html[dir="rtl"] #home .obsolete a {
- margin-right: 0;
- margin-left: 2px;
- float: right;
-}
-
-#home .obsolete a:hover,
-#home .obsolete a:focus {
- opacity: 0.8;
-}
-
-#home .obsolete a:active {
- opacity: 0.6;
-}
-
-#home .obsolete a.firefox {
- background-position: 1px 0;
-}
-
-#home .obsolete a.chrome {
- background-position: -34px 0;
-}
-
-#home .obsolete a.safari {
- background-position: -68px 0;
-}
-
-#home .obsolete a.opera {
- background-position: -101px 0;
-}
-
-#home .obsolete a.ie {
- background-position: -135px 0;
-}
-
-#home .plane {
- background-position: 0 -432px;
- width: 507px;
- height: 328px;
- position: absolute;
- left: 0;
- top: 60px;
-}
-
-#home .main {
- position: absolute;
- top: 50%;
- margin-top: -200px;
- width: 800px;
- height: 400px;
- left: 50%;
- margin-left: -400px;
- z-index: 50;
-}
-
-#home .mainview {
- background-color: rgb(20,20,20);
- background-color: rgba(20,20,20,0.85);
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- right: 0;
- z-index: 2;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- -moz-box-shadow: 0 0 35px #5c5c5c;
- -webkit-box-shadow: 0 0 35px #5c5c5c;
- box-shadow: 0 0 35px #5c5c5c;
-}
-
-#home .left {
- float: left;
- width: 350px;
- height: 370px;
- margin: 15px 0 15px 15px;
- color: white;
- text-align: center;
- text-shadow: 0 1px 1px black;
-}
-
-html[dir="rtl"] #home .left {
- margin-left: 0;
- margin-right: 15px;
- float: right;
-}
-
-#home .left .logo {
- background-position: 0 0;
- float: left;
- margin: 30px 0 35px 30px;
- width: 291px;
- height: 86px;
-}
-
-#home .left p.upper {
- font-weight: bold;
- margin: 12px 0 35px 0;
-}
-
-#home .left p.secondary {
- margin: 8px 0 0 16px;
- font-size: 0.9em;
- width: 320px;
-}
-
-html[dir="rtl"] #home .left p.secondary {
- margin-left: auto;
- margin-right: 16px;
-}
-
-#home .right {
- background: #e4eef9;
- background: -moz-linear-gradient(top, #e4eef9, #c5e1ff);
- background: -webkit-gradient(linear, left top, left bottom, from(#e4eef9), to(#c5e1ff));
- background: -webkit-linear-gradient(top, #e4eef9 0%, #c5e1ff 100%);
- background: -o-linear-gradient(top, #e4eef9 0%, #c5e1ff 100%);
- float: right;
- width: 385px;
- height: 350px;
- margin: 15px 15px 15px 0;
- padding: 10px;
- font-size: 13.4px;
- text-align: justify;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- border-radius: 5px;
- -moz-box-shadow: 0 0 20px black;
- -webkit-box-shadow: 0 0 20px black;
- box-shadow: 0 0 20px black;
-}
-
-html[dir="rtl"] #home .right {
- float: left;
- margin-right: 0;
- margin-left: 15px;
-}
-
-#home .right h1 {
- font-size: 16px;
- padding-bottom: 4px;
- border-bottom: 1px black dotted;
-}
-
-#home .right p {
- margin-bottom: 4px;
-}
-
-#home .right p a {
- border-width: 0 0 1px 0;
- border-style: dotted;
- border-color: black;
-}
-
-#home .right p a:hover,
-#home .right p a:focus {
- border-style: solid;
- text-decoration: none;
-}
-
-#home .right button {
- display: block;
- margin-left: 22px;
- width: 342px;
- height: 64px;
- text-decoration: none;
- font-weight: bold;
- -moz-border-radius: 4px;
- -webkit-border-radius: 4px;
- border-radius: 4px;
-}
-
-#home .right button:focus {
- outline: 0 none;
-}
-
-html[dir="rtl"] #home .right button {
- margin-right: 21px;
- margin-left: auto;
-}
-
-#home .right button:hover {
- cursor: pointer;
-}
-
-#home .right button span {
- float: left;
-}
-
-html[dir="rtl"] #home .right button span {
- float: right;
-}
-
-#home .right button span.home-images {
- height: 16px;
- width: 16px;
- margin: 4px 7px 7px 24px;
-}
-
-html[dir="rtl"] #home .right button span.home-images {
- margin-right: 24px;
- margin-left: 7px;
-}
-
-#home .right button span.text {
- padding-left: 20px;
- font-size: 1.5em;
-}
-
-html[dir="rtl"] #home .right button span.text {
- padding-left: 0;
- padding-right: 20px;
-}
-
-#home .right .login {
- background-color: #72d071;
- background-position: 0 0;
- border: 1px solid #5cb55c;
- margin-top: 22px;
- -moz-box-shadow: 0 0 6px #89e389;
- -webkit-box-shadow: 0 0 6px #89e389;
- box-shadow: 0 0 6px #89e389;
-}
-
-#home .right .login:hover,
-#home .right .login:focus {
- border: 1px solid #419141;
- -moz-box-shadow: 0 0 10px #72d071;
- -webkit-box-shadow: 0 0 10px #72d071;
- box-shadow: 0 0 10px #72d071;
-}
-
-#home .right .login:active {
- background-color: #97e896;
- background-position: 0 -80px;
-}
-
-#home .right .login span.text {
- color: #2d612d;
- text-shadow: 1px 1px 1px #5cb55c;
-}
-
-#home .right .login span.home-images {
- background-position: 0 -230px;
-}
-
-#home .right .register {
- background-color: #f6ef82;
- background-position: 0 -160px;
- border: 1px solid #e3db56;
- margin-top: 15px;
- -moz-box-shadow: 0 0 6px #f1e968;
- -webkit-box-shadow: 0 0 6px #f1e968;
- box-shadow: 0 0 6px #f1e968;
-}
-
-#home .right .register:hover,
-#home .right .register:focus {
- border: 1px solid #d2c93f;
- -moz-box-shadow: 0 0 10px #e0d743;
- -webkit-box-shadow: 0 0 10px #e0d743;
- box-shadow: 0 0 10px #e0d743;
-}
-
-#home .right .register:active {
- background-color: #fdf7af;
- background-position: 0 -240px;
-}
-
-#home .right .register span.text {
- color: #6d6813;
- text-shadow: 1px 1px 1px #dbd56e;
-}
-
-#home .right .register span.home-images {
- background-position: 0 -204px;
-}
-
-#home .right p.notice {
- margin-top: 24px;
- font-size: 0.9em;
- font-weight: bold;
-}
-
-#home .right .navigation {
- clear: both;
- width: 385px;
- border-top: 1px black dotted;
- position: absolute;
- text-align: right;
- bottom: 25px;
- right: 25px;
- padding-top: 6px;
-}
-
-html[dir="rtl"] #home .right .navigation {
- right: auto;
- left: 25px;
-}
-
-#home .right .navigation a {
- margin-left: 10px;
- color: black;
- text-decoration: none;
- font-size: 0.9em;
- height: 16px;
- padding-left: 21px;
- float: right;
-}
-
-html[dir="rtl"] #home .right .navigation a {
- margin-left: 0;
- margin-right: 10px;
- float: left;
-}
-
-#home .right .navigation a:hover,
-#home .right .navigation a:focus {
- text-decoration: underline;
-}
-
-#home .right .navigation a.unencrypted {
- background-position: 0 -256px;
-}
-
-#home .right .navigation a.encrypted {
- background-position: 0 -282px;
-}
-
-#home .right .navigation a.manager {
- background-position: 0 -152px;
-}
-
-#home .right .navigation a.mobile {
- background-position: 0 -178px;
-}
-
-#home .right .navigation a span.vert_center {
- height: 16px;
- vertical-align: middle;
- display: table-cell;
-}
-
-#home .friendsview {
- height: 65px;
- position: absolute;
- bottom: -65px;
- left: 15px;
- right: 15px;
- z-index: 1;
- opacity: 0.8;
-}
-
-#home .friendsview .friends {
- background: #e4eef9;
- background: -moz-linear-gradient(top, #e4eef9, #c5e1ff);
- background: -webkit-gradient(linear, left top, left bottom, from(#e4eef9), to(#c5e1ff));
- background: -webkit-linear-gradient(top, #e4eef9 0%, #c5e1ff 100%);
- background: -o-linear-gradient(top, #e4eef9 0%, #c5e1ff 100%);
- font-size: 11px !important;
- overflow: hidden;
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- -moz-border-radius-bottomleft: 8px;
- -moz-border-radius-bottomright: 8px;
- -webkit-border-bottom-left-radius: 8px;
- -webkit-border-bottom-right-radius: 8px;
- border-bottom-left-radius: 8px;
- border-bottom-right-radius: 8px;
- -moz-box-shadow: 0 0 10px black;
- -webkit-box-shadow: 0 0 10px black;
- box-shadow: 0 0 10px black;
-}
-
-#home .friendsview .friends,
-#home .friendsview .friends a {
- color: black;
-}
-
-#home .friendsview .friends .group {
- display: block;
- position: absolute;
- top: 10px;
- bottom: 10px;
-}
-
-#home .friendsview .friends .group.content {
- width: 340px;
- left: 10px;
-}
-
-#home .friendsview .friends .group.standard {
- width: 289px;
- padding-left: 10px;
- left: 360px;
-}
-
-#home .friendsview .friends .group.content table,
-#home .friendsview .friends .group.standard table {
- margin-top: -4px;
-}
-
-#home .friendsview .friends .group.content table a,
-#home .friendsview .friends .group.standard table a {
- text-decoration: underline;
-}
-
-#home .friendsview .friends .group.content table td {
- padding-top: 3px;
-}
-
-#home .friendsview .friends .group.content a.available_space,
-#home .friendsview .friends .group.standard a.available_space,
-#home .friendsview .friends a.group.refer {
- opacity: 0.75;
- -webkit-transition: 0.3s linear;
- -moz-transition: 0.3s linear;
- -o-transition: 0.3s linear;
- transition: 0.3s linear;
-}
-
-#home .friendsview .friends .group.content a.available_space:hover,
-#home .friendsview .friends .group.content a.available_space:focus,
-#home .friendsview .friends .group.standard a.available_space:hover,
-#home .friendsview .friends .group.standard a.available_space:focus,
-#home .friendsview .friends a.group.refer:hover,
-#home .friendsview .friends a.group.refer:focus {
- opacity: 1;
-}
-
-#home .friendsview .friends .group.content a.available_space,
-#home .friendsview .friends .group.standard a.available_space {
- border: 1px dashed #909090;
- font-size: 11px;
- font-weight: bold;
- letter-spacing: 1px;
- text-transform: uppercase;
- text-align: center;
- padding-top: 14px;
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-
-#home .friendsview .friends .group.standard a.available_space {
- left: 10px;
-}
-
-#home .friendsview .friends .group.standard br {
- display: none;
-}
-
-#home .friendsview .friends .group.standard a {
- text-align: center;
- text-decoration: underline;
- margin-bottom: 1px;
- float: left;
- width: 50%;
-}
-
-#home .friendsview .friends .group.standard a:nth-child(even) {
- float: right;
-}
-
-#home .friendsview .friends a.group.refer {
- width: 81px;
- padding-left: 10px;
- right: 10px;
-}
-
-#home .friendsview .friends a.group.refer span {
- display: block;
-}
-
-#home .friendsview .friends a.group.refer span.icon {
- background-position: 0 -385px;
- width: 25px;
- height: 25px;
- margin: 0 auto;
- -webkit-transition: 0.3s linear;
- -moz-transition: 0.3s linear;
- -o-transition: 0.3s linear;
- transition: 0.3s linear;
-}
-
-#home .friendsview .friends a.group.refer:hover span.icon,
-#home .friendsview .friends a.group.refer:focus span.icon {
- -webkit-transform: rotate(360deg);
- -moz-transform: rotate(360deg);
- -ms-transform: rotate(360deg);
- -o-transform: rotate(360deg);
- transform: rotate(360deg);
-}
-
-#home .friendsview .friends a.group.refer span.label {
- font-size: 10px;
- font-weight: bold;
- text-transform: uppercase;
- text-align: center;
- margin-top: 6px;
-}
-
-#home .friendsview .friends .group .separator,
-#home .friendsview .friends .group .separator .sep_top,
-#home .friendsview .friends .group .separator .sep_bottom {
- position: absolute;
-}
-
-#home .friendsview .friends .group .separator {
- width: 1px;
- top: 0;
- bottom: 0;
- left: -1px;
-}
-
-#home .friendsview .friends .group .separator .sep_top,
-#home .friendsview .friends .group .separator .sep_bottom {
- height: 50%;
- left: 0;
- right: 0;
-}
-
-#home .friendsview .friends .group .separator .sep_top {
- background: #eeeeee;
- background: rgba(0,0,0,0.3);
- background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 100%);
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0,0,0,0)), color-stop(100%, rgba(0,0,0,0.3)));
- background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 100%);
- background: -o-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 100%);
- background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 100%);
- background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 100%);
- top: 0;
-}
-
-#home .friendsview .friends .group .separator .sep_bottom {
- background: #eeeeee;
- background: rgba(0,0,0,0.3);
- background: -moz-linear-gradient(top, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 100%);
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0,0,0,0.3)), color-stop(100%, rgba(0,0,0,0)));
- background: -webkit-linear-gradient(top, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 100%);
- background: -o-linear-gradient(top, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 100%);
- background: -ms-linear-gradient(top, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 100%);
- background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 100%);
- bottom: 0;
-}
-
-#home a.advanced {
- background-position: 0 -334px;
- font-size: 0.9em;
- height: 16px;
- margin-bottom: 10px;
- padding-left: 16px;
- float: left;
-}
-
-html[dir="rtl"] #home a.advanced {
- float: right;
-}
-
-#home fieldset.advanced {
- display: none;
-}
-
-#home .anonymouser input[type="text"] {
- width: 160px;
-}
-
-#home .homediv.registerer .success a {
- font-weight: bold;
- text-decoration: underline;
-}
-
-#home fieldset {
- border: 1px solid black;
- margin: 18px 0 12px 0;
- padding: 5px 0 4px 0;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-
-html[dir="rtl"] #home fieldset {
- padding-left: 6px;
-}
-
-#home legend {
- font-size: 0.9em;
- margin: 0 0 0 15px;
- padding: 0 2px;
- text-transform: uppercase;
-}
-
-#home label {
- width: 110px;
- display: block;
- float: left;
- clear: both;
- margin: 0 0 5px 12px;
-}
-
-html[dir="rtl"] #home label {
- margin-left: auto;
- margin-right: 12px;
- float: right;
-}
-
-#home input,
-#home select {
- float: left;
- margin-bottom: 5px;
-}
-
-html[dir="rtl"] #home input,
-html[dir="rtl"] #home select {
- float: right;
-}
-
-#home input[type="text"],
-#home input[type="password"],
-#home select {
- width: 140px;
- margin-top: -2px;
-}
-
-#home .submit {
- clear: both;
-}
-
-#home input[type="submit"] {
- min-width: 120px;
- float: right;
-}
-
-#home span.jid {
- display: block;
- float: left;
- margin: 0 4px;
-}
-
-html[dir="rtl"] #home span.jid {
- float: right;
-}
-
-#home input.nick,
-#home input.server,
-#home input.password,
-#home input.spassword {
- width: 110px;
-}
-
-#home input.password {
- margin-right: 22px;
-}
-
-html[dir="rtl"] #home input.password {
- margin-right: auto;
-}
-
-html[dir="rtl"] #home input.spassword {
- margin-right: 22px;
-}
-
-html[dir="rtl"] #home .loginer input.remember,
-html[dir="rtl"] #home .loginer input.password,
-html[dir="rtl"] #home .loginer input.resource,
-html[dir="rtl"] #home .loginer select.priority,
-html[dir="rtl"] #home .anonymouser input.room,
-html[dir="rtl"] #home .anonymouser input.nick {
- float: right;
-}
-
-#home img.captcha_img {
- margin: -2px 0 0 20px;
- float: left;
-}
-
-#home .info {
- padding: 6px;
- position: absolute;
- bottom: 62px;
- right: 35px;
- border-width: 1px;
- border-style: dotted;
- clear: both;
- width: 350px;
-}
-
-html[dir="rtl"] #home .info {
- right: auto;
- left: 35px;
-}
-
-#home .info.success {
- background-color: #aee578;
- border-color: #85b05c;
- display: none;
-}
-
-#home .info.fail {
- background-color: #f19d9d;
- border-color: #b34f4f;
-}
-
-#home .info.report {
- background-color: #f3f48b;
- border-color: #c9c66b;
- display: none;
-}
-
-#home .info.report span {
- text-decoration: underline;
-}
-
-#home .notice.simple {
- background-color: rgb(20,20,20);
- background-color: rgba(20,20,20,0.7);
- color: white;
- font-size: 0.9em;
- text-decoration: none;
- text-shadow: 0 1px 0 black;
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- padding: 8px 20px;
- z-index: 100;
- -moz-box-shadow: 0 0 25px #ababab;
- -webkit-box-shadow: 0 0 25px #ababab;
- box-shadow: 0 0 25px #ababab;
-}
-
-#home .notice.simple .title {
- background-color: rgb(20,20,20);
- background-color: rgba(20,20,20,0.4);
- background-position: 8px -299px;
- border-width: 0 1px 1px 1px;
- border-style: solid;
- border-color: #141414;
- font-weight: bold;
- padding: 8px 8px 8px 30px;
-}
-
-#home .notice.simple .text {
- margin-left: 20px;
-}
-
-html[dir="rtl"] #home .notice.simple .text {
- margin-left: 0;
- margin-right: 20px;
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/ie.css b/source/app/stylesheets/ie.css
deleted file mode 100644
index 7e95c8d..0000000
--- a/source/app/stylesheets/ie.css
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
-
-Jappix - An open social platform
-These are all the IE compliant CSS classes
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-/* Fix custom fonts */
-
-@font-face {
- font-family: 'PT Sans';
- src: url(../fonts/eot/ptsans.eot);
-}
-
-@font-face {
- font-family: 'PT Sans';
- font-style: italic;
- src: url(../fonts/eot/ptsansitalic.eot);
-}
-
-@font-face {
- font-family: 'PT Sans';
- font-weight: bold;
- src: url(../fonts/eot/ptsansbold.eot);
-}
-
-@font-face {
- font-family: 'PT Sans';
- font-weight: bold;
- font-style: italic;
- src: url(../fonts/eot/ptsansbolditalic.eot);
-}
-
-/* rgba(255,255,255,0.9) */
-.search ul {
- background: transparent;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#edffffff,endColorstr=#edffffff);
-}
-
-/* rgba(255,255,255,0.3) */
-a.finish:active,
-#manager-buttons input:active,
-#install-buttons input:active {
- background: transparent;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#49ffffff,endColorstr=#49ffffff);
-}
-
-/* rgba(255,255,255,0.2) */
-a.finish:hover,
-a.finish:focus,
-#manager-buttons input:hover,
-#manager-buttons input:focus,
-#install-buttons input:hover,
-#install-buttons input:focus,
-.notifications-content .one-notification:active {
- background: transparent;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#33ffffff,endColorstr=#33ffffff);
-}
-
-/* rgba(255,255,255,0.14) */
-#home .corporation .corp_network a:active,
-#home .locale .list a:active {
- background: transparent;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#2fffffff,endColorstr=#2fffffff);
-}
-
-/* rgba(255,255,255,0.1) */
-#home .corporation .corp_network a:hover,
-#home .corporation .corp_network a:focus,
-#home .locale .list a:hover,
-#home .locale .list a:focus,
-a.finish,
-a.finish.disabled:hover,
-a.finish.disabled:focus,
-a.finish.disabled:active,
-#manager-buttons input,
-#install-buttons input,
-.notifications-content .one-notification:hover,
-.notifications-content .one-notification:focus {
- background: transparent;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#20ffffff,endColorstr=#20ffffff);
-}
-
-/* rgba(255,239,104,0.8) */
-.popup .infos {
- background: transparent;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#deffef68,endColorstr=#deffef68);
-}
-
-/* rgba(225,160,20,0.3) */
-.search ul li.hovered {
- background: transparent;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#46e1a014,endColorstr=#46e1a014);
-}
-
-/* rgba(248,246,186,0.9) */
-#board .one-board.info {
- background: transparent;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#edf8f6ba,endColorstr=#edf8f6ba);
-}
-
-/* rgba(241,160,160,0.9) */
-#board .one-board.error {
- background: transparent;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#edf1a0a0,endColorstr=#edf1a0a0);
-}
-
-/* rgba(234,234,234,0.8) */
-#page-engine .chatstate {
- background: transparent;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#deeaeaea,endColorstr=#deeaeaea);
-}
-
-/* rgba(20,20,20,0.6) */
-#home .notice.simple {
- background: transparent;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#a0141414,endColorstr=#a0141414);
-}
-
-/* rgba(20,20,20,0.8) */
-#reconnect .pane,
-#my-infos,
-#right-content,
-#roster,
-#manager,
-#install {
- background: transparent;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#de141414,endColorstr=#de141414);
-}
-
-#home .main {
- background: #141414;
-}
-
-/* rgba(20,20,20,0.9) */
-.popup {
- background: transparent;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ed141414,endColorstr=#ed141414);
-}
-
-/* rgba(0,0,0,0.2) */
-#install-top .step {
- background: transparent;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#33000000,endColorstr=#33000000);
-}
-
-/* rgba(0,0,0,0.6) */
-.lock {
- background: url(../images/others/lock.png) repeat !important;
-}
-
-/* rgba(0,0,0,0.8) */
-#page-engine .tooltip-subitem,
-.attach-subitem,
-.buddy-infos-subitem,
-.buddy-conf-subitem,
-.tools-content-subitem {
- background: transparent;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#de000000,endColorstr=#de000000);
-}
-
-/* Fix a fieldset padding bug */
-legend {
- margin-bottom: 5px !important;
-}
-
-/* Fix opacity bugs */
-#options .forms.in_background fieldset {
- filter: alpha(opacity = 50) !important;
-}
-
-a.finish.disabled {
- filter: alpha(opacity = 20) !important;
-}
diff --git a/source/app/stylesheets/images.css b/source/app/stylesheets/images.css
deleted file mode 100644
index d5a4104..0000000
--- a/source/app/stylesheets/images.css
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the images CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-.body-images {
- background-image: url(../images/sprites/background.png);
- background-repeat: repeat;
- background-color: #93c5fa;
-}
-
-.install-images {
- background-image: url(../images/sprites/install.png);
- background-repeat: no-repeat;
-}
-
-.home-images {
- background-image: url(../images/sprites/home.png);
- background-repeat: no-repeat;
-}
-
-.browsers-images {
- background-image: url(../images/sprites/browsers.png);
- background-repeat: no-repeat;
-}
-
-.buttons-images {
- background-image: url(../images/sprites/buttons.png);
- background-repeat: repeat-x;
-}
-
-.talk-images {
- background-image: url(../images/sprites/talk.png);
- background-repeat: no-repeat;
-}
-
-.smileys-images {
- background-image: url(../images/sprites/smileys.png);
- background-repeat: no-repeat;
-}
-
-.welcome-images {
- background-image: url(../images/sprites/welcome.png);
- background-repeat: no-repeat;
-}
-
-.me-images {
- background-image: url(../images/sprites/me.png);
- background-repeat: no-repeat;
-}
-
-.call-images {
- background-image: url(../images/sprites/call.png);
- background-repeat: no-repeat;
-}
-
-.manager-images {
- background-image: url(../images/sprites/manager.png);
- background-repeat: no-repeat;
-}
-
-.mobile-images {
- background-image: url(../images/sprites/mobile.png);
- background-repeat: no-repeat;
-}
-
-.wait-small {
- background-image: url(../images/wait/wait-small.gif);
- background-repeat: no-repeat;
- height: 16px;
- width: 16px;
-}
-
-.wait-medium {
- background-image: url(../images/wait/wait-medium.png);
- background-repeat: no-repeat;
- height: 24px;
- width: 24px;
-}
-
-.wait-big {
- background-image: url(../images/wait/wait-big.gif);
- background-repeat: no-repeat;
- height: 30px;
- width: 30px;
-}
-
-.wait-typing {
- background-image: url(../images/wait/wait-typing.gif);
- background-repeat: no-repeat;
- height: 4px;
- width: 16px;
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/inbox.css b/source/app/stylesheets/inbox.css
deleted file mode 100644
index 2635add..0000000
--- a/source/app/stylesheets/inbox.css
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the inbox CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#inbox .content {
- padding: 10px 0 10px 0;
-}
-
-#inbox .content p {
- margin: 3px 10px;
- text-align: justify;
- font-size: 0.9em;
-}
-
-#inbox .inbox-results {
- height: 310px;
- width: 620px;
- margin: -5px 0 0 10px;
- padding: 6px 0 0 0;
- overflow: auto;
-}
-
-html[dir="rtl"] #inbox .inbox-results {
- margin-left: auto;
- margin-right: 10px;
-}
-
-#inbox .message-unread {
- background-color: #E9F1FD;
-}
-
-#inbox .one-message {
- font-size: 0.9em;
- border-bottom: 1px #b2c7cb solid;
-}
-
-#inbox .message-head {
- padding: 6px 0 7px 4px;
- overflow: hidden;
-}
-
-#inbox .message-head:hover {
- background-color: #e9f1fd;
- cursor: pointer;
-}
-
-#inbox .message-head:active {
- background-color: #f1f6fd;
-}
-
-#inbox .one-message.message-reading,
-#inbox .one-message.message-reading .message-head {
- background-color: #f1f6fd;
-}
-
-html[dir="rtl"] #inbox .one-message a.one-button {
- float: right;
-}
-
-#inbox .avatar-container {
- float: left;
- width: 40px;
- height: 40px;
- margin-right: 7px;
- text-align: center;
- background-repeat: no-repeat;
-}
-
-html[dir="rtl"] #inbox .avatar-container {
- margin-left: 7px;
- margin-right: auto;
- float: right;
-}
-
-#inbox .avatar {
- max-width: 40px;
- max-height: 40px;
-}
-
-#inbox .message-jid,
-#inbox .message-subject {
- float: left;
- margin: 0 2px;
- overflow: hidden;
-}
-
-html[dir="rtl"] #inbox .message-jid,
-html[dir="rtl"] #inbox .message-subject {
- float: right;
-}
-
-#inbox .message-jid {
- width: 165px;
- font-weight: bold;
-}
-
-#inbox .message-subject {
- width: 355px;
-}
-
-#inbox .message-truncated {
- color: #42646b;
- font-size: 0.8em;
- margin: 23px 0 0 49px;
-}
-
-#inbox .message-body {
- padding: 8px 5px 5px 5px;
-}
-
-#inbox .message-body a {
- text-decoration: underline;
-}
-
-#inbox .message-meta {
- margin-top: 6px;
- padding: 3px 4px;
- border-top: 1px #b2c7cb dotted;
-}
-
-#inbox .message-meta span.date {
- color: #28474e;
- font-size: 0.8em;
- margin: 10px 0 0 4px;
- float: left;
-}
-
-#inbox .message-meta a {
- font-size: 0.98em;
- margin: 5px;
- float: right;
- display: block;
-}
-
-#inbox .inbox-noresults {
- font-weight: bold;
- display: none;
-}
-
-#inbox .a-show-messages {
- display: none;
-}
-
-#inbox .inbox-new {
- display: none;
- height: 300px;
- width: 620px;
- margin: -5px 0 0 10px;
- padding: 16px 0 0 0;
-}
-
-#inbox .inbox-new-block {
- border-top: 1px #686868 dotted;
- padding-top: 9px;
- min-height: 32px;
- clear: both;
-}
-
-#inbox .inbox-new-text {
- float: left;
- width: 100px;
-}
-
-#inbox .inbox-new-textarea {
- width: 460px;
- height: 109px;
- margin-bottom: 10px;
- float: left;
-}
-
-#inbox .inbox-new input {
- float: left;
-}
-
-html[dir="rtl"] #inbox .inbox-new-text,
-html[dir="rtl"] #inbox .inbox-new-textarea,
-html[dir="rtl"] #inbox .inbox-new input {
- float: right;
-}
-
-html[dir="rtl"] #inbox .inbox-new-text {
- margin-right: 20px;
-}
-
-html[dir="rtl"] #inbox .inbox-new input {
- margin-right: auto;
-}
-
-#inbox .inbox-new-to ul {
- width: 264px;
- max-height: 168px;
- font-size: 0.9em;
- left: 120px;
- top: 31px;
-}
-
-html[dir="rtl"] #inbox .inbox-new-to ul {
- left: auto;
- right: 130px;
-}
-
-#inbox .inbox-new-to-input {
- width: 260px;
-}
-
-#inbox .inbox-new-subject-input {
- width: 380px;
-}
-
-#inbox .inbox-new-file a {
- display: block;
- float: left;
-}
-
-#inbox .inbox-new-file a.file {
- font-size: 0.85em;
- height: 16px;
- max-width: 320px;
- margin: 3px 0 15px 013px;
- overflow: hidden;
-}
-
-#inbox .inbox-new-file a.one-button {
- font-size: 0.85em;
- margin: -2px 0 0 25px;
-}
-
-#inbox .inbox-new-send a {
- font-size: 0.85em;
- float: right;
- display: block;
-}
-
-html[dir="rtl"] #inbox .inbox-new-send a {
- margin-right: 18px;
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/install.css b/source/app/stylesheets/install.css
deleted file mode 100644
index 23abc9c..0000000
--- a/source/app/stylesheets/install.css
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the install CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-body {
- color: white;
-}
-
-#install {
- background-color: rgb(20,20,20);
- background-color: rgba(20,20,20,0.85);
- width: 800px;
- margin: 35px auto;
- padding-bottom: 17px;
- -moz-border-radius: 6px;
- -webkit-border-radius: 6px;
- border-radius: 6px;
- -moz-box-shadow: 0 0 35px #5c5c5c;
- -webkit-box-shadow: 0 0 35px #5c5c5c;
- box-shadow: 0 0 35px #5c5c5c;
-}
-
-#install a {
- color: black;
- text-decoration: underline;
-}
-
-#install .clear {
- clear: both;
-}
-
-#install fieldset {
- border: 1px solid black;
- margin: 22px 0 15px 0;
- padding: 7px 2px 5px 2px;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-
-#install legend {
- font-size: 0.9em;
- margin: 0 0 0 15px;
- padding: 0 2px;
- text-transform: uppercase;
-}
-
-#install label {
- width: 200px;
- display: block;
- float: left;
- clear: both;
- margin: 0 0 9px 12px;
-}
-
-html[dir="rtl"] #install label {
- margin-right: 12px;
- margin-left: 0;
- float: right;
-}
-
-#install input,
-#install select {
- float: left;
- margin-bottom: 5px;
-}
-
-html[dir="rtl"] #install input,
-html[dir="rtl"] #install select {
- float: right;
-}
-
-#install input[type="text"],
-#install input[type="url"],
-#install input[type="password"] {
- margin-top: -2px;
- padding: 3px;
- font-size: 0.95em;
- min-width: 220px;
-}
-
-#install input.icon {
- padding-left: 24px;
- min-width: 199px;
- max-height: 18px;
-}
-
-#install input.icon#user_name {
- background-position: 4px -204px;
-}
-
-#install input.icon#user_password {
- background-position: 4px -226px;
-}
-
-#install input.icon#user_repassword {
- background-position: 4px -248px;
-}
-
-#install-top {
- padding: 30px 45px;
-}
-
-#install-top .logo {
- background-position: 0 0;
- min-width: 88px;
- height: 36px;
- padding: 32px 0 0 66px;
- font-size: 32px;
- color: white;
- text-transform: lowercase;
- float: left;
- text-shadow: 0 1px 1px black;
-}
-
-#install-top .step {
- background-color: rgb(0,0,0);
- background-color: rgba(0,0,0,0.2);
- border: 2px solid white;
- padding: 6px 21px;
- font-size: 2.7em;
- text-shadow: 0 1px 1px black;
- float: right;
- -moz-border-radius: 40px;
- -webkit-border-radius: 40px;
- border-radius: 40px;
- -moz-box-shadow: 0 0 10px #202020;
- -webkit-box-shadow: 0 0 10px #202020;
- box-shadow: 0 0 10px #202020;
-}
-
-#install-top .step span {
- font-size: 0.6em;
-}
-
-#install-content {
- background: #e4eef9;
- background: -moz-linear-gradient(top, #e4eef9, #d0e5fa);
- background: -webkit-gradient(linear, left top, left bottom, from(#e4eef9), to(#d0e5fa));
- background: -webkit-linear-gradient(top, #e4eef9 0%, #d0e5fa 100%);
- background: -o-linear-gradient(top, #e4eef9 0%, #d0e5fa 100%);
- color: black;
- font-size: 0.9em;
- margin: 0 10px;
- padding: 20px 24px;
- min-height: 260px;
- clear: both;
- right: 10px;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- -moz-box-shadow: 0 0 20px #202020;
- -webkit-box-shadow: 0 0 20px #202020;
- box-shadow: 0 0 20px #202020;
-}
-
-#install-content h3 {
- padding-left: 24px;
- margin-bottom: 15px;
- float: left;
-}
-
-html[dir="rtl"] #install-content h3 {
- float: right;
-}
-
-#install-content h3.start {
- background-position: 0 -73px;
-}
-
-#install-content h3.storage {
- background-position: 0 -95px;
-}
-
-#install-content h3.account {
- background-position: 0 -117px;
-}
-
-#install-content h3.main {
- background-position: 0 -139px;
-}
-
-#install-content h3.hosts {
- background-position: 0 -161px;
-}
-
-#install-content h3.services {
- background-position: 0 -183px;
-}
-
-#install-content p {
- margin-bottom: 10px;
- clear: both;
-}
-
-#install-content .info {
- color: black;
- border-width: 1px;
- border-style: dashed;
- padding: 6px 8px;
- display: block;
- text-decoration: none;
-}
-
-#install-content .info.smallspace {
- margin: 14px 0 10px 0;
-}
-
-#install-content .info.bigspace {
- margin: 35px 0 20px 0;
-}
-
-#install-content .info.first {
- margin-top: 28px;
-}
-
-#install-content .info.last {
- margin-bottom: 28px;
-}
-
-#install-content .info.neutral {
- background-color: #f0f19d;
- border-color: #b3ad4f;
-}
-
-#install-content a.info.neutral:hover,
-#install-content a.info.neutral:focus {
- background-color: #eced96;
-}
-
-#install-content a.info.neutral:active {
- background-color: #e9ea93;
-}
-
-#install-content .info.success {
- background-color: #a8dca9;
- border-color: #5e9f5f;
-}
-
-#install-content a.info.success:hover,
-#install-content a.info.success:focus {
- background-color: #a0d5a1;
-}
-
-#install-content a.info.success:active {
- background-color: #9ad09b;
-}
-
-#install-content .info.fail {
- background-color: #f19d9d;
- border-color: #b34f4f;
-}
-
-#install-content ol {
- margin: 20px 30px;
-}
-
-#install-content ol li {
- margin-bottom: 1px;
-}
-
-#install-buttons {
- margin-top: 22px;
-}
-
-#install-buttons input {
- border: 1px solid white;
- background-color: rgb(255,255,255);
- background-color: rgba(255,255,255,0.1);
- color: white;
- padding: 4px 8px;
- margin-right: 20px;
- text-shadow: 0 1px 1px black;
- float: right;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- -moz-box-shadow: 0 0 5px #202020;
- -webkit-box-shadow: 0 0 5px #202020;
- box-shadow: 0 0 5px #202020;
-}
-
-#install-buttons input:hover,
-#install-buttons input:focus {
- cursor: pointer;
- background-color: rgb(255,255,255);
- background-color: rgba(255,255,255,0.2);
- -moz-box-shadow: 0 0 15px #202020;
- -webkit-box-shadow: 0 0 15px #202020;
- box-shadow: 0 0 15px #202020;
-}
-
-#install-buttons input:active {
- background-color: rgb(255,255,255);
- background-color: rgba(255,255,255,0.3);
-}
diff --git a/source/app/stylesheets/integratebox.css b/source/app/stylesheets/integratebox.css
deleted file mode 100644
index 7a73d1a..0000000
--- a/source/app/stylesheets/integratebox.css
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the integratebox CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#integratebox .top {
- height: 40px;
-}
-
-#integratebox .content {
- text-align: center;
- height: 385px;
-}
-
-#integratebox .one-media img {
- max-height: 385px;
- max-width: 640px;
-}
-
-#integratebox .one-media a img {
- border: none;
-}
-
-#integratebox .one-media audio {
- margin-top: 170px;
-}
-
-#integratebox .bottom {
- left: 10px;
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/ios.css b/source/app/stylesheets/ios.css
deleted file mode 100644
index d8c2f0b..0000000
--- a/source/app/stylesheets/ios.css
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the iOS add to home CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Camaran
-
-*/
-
-/**
- *
- * Main container
- *
- */
-#addToHomeScreen {
- z-index:9999;
- -webkit-user-select:none;
- user-select:none;
- -webkit-box-sizing:border-box;
- box-sizing:border-box;
- -webkit-touch-callout:none;
- touch-callout:none;
- width:240px;
- font-size:15px;
- padding:12px 14px;
- text-align:left;
- font-family:helvetica;
- background-image:-webkit-gradient(linear,0 0,0 100%,color-stop(0,#fff),color-stop(0.02,#eee),color-stop(0.98,#ccc),color-stop(1,#a3a3a3));
- border:1px solid #505050;
- -webkit-border-radius:8px;
- -webkit-background-clip:padding-box;
- color:#333;
- text-shadow:0 1px 0 rgba(255,255,255,0.75);
- line-height:130%;
- -webkit-box-shadow:0 0 4px rgba(0,0,0,0.5);
-}
-
-#addToHomeScreen.addToHomeIpad {
- width:268px;
- font-size:18px;
- padding:14px;
-}
-
-/**
- *
- * The 'wide' class is added when the popup contains the touch icon
- *
- */
-#addToHomeScreen.addToHomeWide {
- width:296px;
-}
-
-#addToHomeScreen.addToHomeIpad.addToHomeWide {
- width:320px;
- font-size:18px;
- padding:14px;
-}
-
-/**
- *
- * The balloon arrow
- *
- */
-#addToHomeScreen .addToHomeArrow {
- position:absolute;
- background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(0,rgba(204,204,204,0)),color-stop(0.4,rgba(204,204,204,0)),color-stop(0.4,#ccc));
- border-width:0 1px 1px 0;
- border-style:solid;
- border-color:#505050;
- width:16px; height:16px;
- -webkit-transform:rotateZ(45deg);
- bottom:-9px; left:50%;
- margin-left:-8px;
- -webkit-box-shadow:inset -1px -1px 0 #a9a9a9;
- -webkit-border-bottom-right-radius:2px;
-}
-
-
-/**
- *
- * The balloon arrow for iPad
- *
- */
-#addToHomeScreen.addToHomeIpad .addToHomeArrow {
- -webkit-transform:rotateZ(-135deg);
- background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(0,rgba(238,238,238,0)),color-stop(0.4,rgba(238,238,238,0)),color-stop(0.4,#eee));
- -webkit-box-shadow:inset -1px -1px 0 #fff;
- top:-9px; bottom:auto; left:50%;
-}
-
-
-/**
- *
- * Close button
- *
- */
-#addToHomeScreen .addToHomeClose {
- -webkit-box-sizing:border-box;
- position:absolute;
- right:4px;
- top:4px;
- width:18px;
- height:18px; line-height:14px;
- text-align:center;
- text-indent:1px;
- -webkit-border-radius:9px;
- background:rgba(0,0,0,0.12);
- color:#707070;
- -webkit-box-shadow:0 1px 0 #fff;
- font-size:16px;
-}
-
-
-/**
- *
- * The '+' icon, displayed only on iOS < 4.2
- *
- */
-#addToHomeScreen .addToHomePlus {
- font-weight:bold;
- font-size:1.3em;
-}
-
-
-/**
- *
- * The 'share' icon, displayed only on iOS >= 4.2
- *
- */
-#addToHomeScreen .addToHomeShare {
- display:inline-block;
- width:18px;
- height:15px;
- background-repeat:no-repeat;
- background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAeCAQAAADu6HTYAAADPElEQVR4Xq3TX2gcRRzA8e/M7mVv2+TSNpc/TZtrY6jUGqgaSAmEChKLrYK0YH0RFC2CSCkEfCghiKU04J8qNigq6os+iQV98MHWFwVBrQQRWs21lBw5cw3NNb1/udu72RGG5Y77IzXW77D7sAwf5scyYoL6BGXSDKFZwaGpLvIUaeoCkvX1MmsM0Ny6oRSQYOLuIS+YZOpfQdqslpUxcZrzTVAz4qPwW2O3CeIwC/RSzeY6Ow1QhUrkr+YOWfEKDkEP8Rij7CHKJmrFSDHBdwGEE5wiGChPN+PnT8VdRtEIl1d4gRj/1EVe5ZSBKGh8iqQpo/Fo5+3C/gz0MYg4zgwbqday1/Q4B8BGQ45d/Hi54lakCrU5obOcidJpu1+Lg9whjabyaOYLnrIBFFaRD+xe2ybMDWY66GmP/WA9cGfGp0CWhy0wkMN8inepFiH2rV1j0NQSNQbFLRQnS8/8YSDBBpadfv4CYDub2fmeHDNAsL1MBWUel0iA+Xik6eHcyvD3vAMSU1TGuA/YRS+dD7ovCQN43GKRFCU20Kd3V/avDVVyAZ5niTEuLA5/zBGWg9EEEhfJKN200Tat8CmRAQb9+wv7soPlHt2tQorsz1uPbr0HTY4sJwrH47zJZwABBAKLMBoQXepwgTwdHCo+fXMkQ4lrxEmQ5AaXipPqDY9V2vn09tgvTPI71EEGYxM+/uMJLJ4svpgaWGKOi/xKgmqLSUGSUd5f2vIVJ/CgBaTIUsZ7ZBsn0+NzfMOXLFCXQyTcybN6ep5ZZgUOHn7jpfUpsZshdugPGf+E5zjbyHTSRyQ8xfRPPM/s63RHeuknSoT22mjmmnAOIMkUZ6D1xSfPPAfd1WFKM3sO2CMaHx8M1NjnXKHaAGGkOW0C02WeYHUz4qMtx+w5gUDS8NckYe5lHsMYwCZEPyEEmjLDZFmAS7CDviMdxyTkMNVBKEmYLvbiQQBIBBbCQG04bGQvFWz6CfsCQLWCigILFwcfkGYBiOpbYuOizTAyYyDdCtrGaRG1LCkIgMYEFhI0WqQZoSlbGRyHKe4qOx7iv2bVQW9dp4dlM/x6kmwnWQcd/Q3FCqwTEiT5s+6D5v/pb0SSHyg7uhMWAAAAAElFTkSuQmCC);
- background-size:18px 15px;
- text-indent:-9999em;
- overflow:hidden;
-}
-
-#addToHomeScreen .addToHomeShare.addToHomeShareOS7 {
- width:11px;
- background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAA8CAYAAAAQTCjdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAASCQAAEgkB80sG3AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAKjSURBVGiB7dpPiFVVHMDxz7m9NCtMyI2bEJEC25WrEkzHUXCRraIwdNE8ZxfYIlcis1ZEbGEzT1QCF4XgH1CyWhUoJKIWNRGEiCNKmkSiYTzfcfGuOokx77x3ZlS8382959zfn+/invvn3RdijHIRBrwkOINCYXEcdjpb7VyiYdBsLScwt5y6IloYdzqXo36Ro0gY9IKWo+5JwmzBt2HQnBw9ehYNazyn5TBee8Dh+Vq+CWu92GufnkTDR6ab7gDeBNHouMM/l9tXTXM0fGBmL726Fg1Dam74EsvKqR8VNowL2Yzj5f7rnnE4DHq2235diYYhhTGfC94up35T0y+6di/ITU0rKVd+sEi0P7xr2pSJOu8zvF+OzqEv7vDH/WFxt7/cshy/ticsN8sXYUht0kXDOlsF9XJ4UaEvNoz9X3zc5bKaZThbyr5jzJ4wlNY7KTgM+ES0vhz+KeiPw36fKC/ucAF9uFBOrTZm26SJCtaV27+xIo7cXdkTEhvOoh+XyxprU1qnim7CQdGK2HAyKRexYVShT3RItDElN+mkjiP2Ym+S3f01hv2EVal5WW6hU0ElmptaqJuBpXg6MbeFH2LDpU6CQ93zWIKnEvs0cayGU3glMfkOo1jQYewZzOuyz7FC95Jwo5OgUFfgeg993hh/eTqCTxOSm/iuk8DY0Ap1b2GhtHXxsfZN4j/X0fOx4auEIknEhqv4OiUn1L13Z/+xWfWVaG4q0dxUormpRHNTieamEs1NJZqbJ1Q0jHvdiJo5S2cVjSNOCHZhn3/SnuYnIvl3yomIIz7MXZMn9hydRCrR3FSiualEc1OJ5qYSzU0lmptKNDePjWgwcPePT7/g+4cp8wCW4GXaryK3tL+mLdD5x62ppllgu7bso8q/2HIbzGWdNmWnSJwAAAAASUVORK5CYII=);
- background-size:11px 15px;
-}
-
-/**
- *
- * The touch icon (if available)
- *
- */
-#addToHomeScreen .addToHomeTouchIcon {
- display:block;
- float:left;
- -webkit-border-radius:6px;
- border-radius:6px;
- -webkit-box-shadow:0 1px 3px rgba(0,0,0,0.5),
- inset 0 0 2px rgba(255,255,255,0.9);
- box-shadow:0 1px 3px rgba(0,0,0,0.5),
- inset 0 0 2px rgba(255,255,255,0.9);
- background-repeat:no-repeat;
- width:57px; height:57px;
- -webkit-background-size:57px 57px;
- background-size:57px 57px;
- margin:0 12px 0 0;
- border:1px solid #333;
- -webkit-background-clip:padding-box;
- background-clip:padding-box;
-}
diff --git a/source/app/stylesheets/jingle.css b/source/app/stylesheets/jingle.css
deleted file mode 100644
index 1614317..0000000
--- a/source/app/stylesheets/jingle.css
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the Jingle CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#jingle .videobox .topbar .card {
- margin: 4px 0 0 12px;
-}
-
-html[dir="rtl"] #jingle .videobox .topbar .card {
- margin-left: 0;
- margin-right: 12px;
-}
-
-#jingle .videobox .topbar .card,
-#jingle .videobox .topbar .card .avatar-container,
-#jingle .videobox .topbar .card .identity {
- float: left;
-}
-
-html[dir="rtl"] #jingle .videobox .topbar .card,
-html[dir="rtl"] #jingle .videobox .topbar .card .avatar-container,
-html[dir="rtl"] #jingle .videobox .topbar .card .identity {
- float: right;
-}
-
-#jingle .videobox .topbar .card .avatar-container {
- height: 32px;
- width: 32px;
-}
-
-#jingle .videobox .topbar .card .avatar-container .avatar {
- max-height: 32px;
- max-width: 32px;
-}
-
-#jingle .videobox .topbar .card .identity {
- margin: 1px 0 0 10px;
-}
-
-html[dir="rtl"] #jingle .videobox .topbar .card .identity {
- margin-left: 0;
- margin-right: 10px;
-}
-
-#jingle .videobox .topbar .card .identity .name,
-#jingle .videobox .topbar .card .identity .xid {
- letter-spacing: 1px;
- display: block;
-}
-
-#jingle .videobox .topbar .card .identity .name {
- font-size: 12px;
- font-weight: bold;
- text-transform: uppercase;
-}
-
-#jingle .videobox .topbar .card .identity .xid {
- font-size: 10px;
-}
-
-#jingle .videobox .topbar .controls {
- margin-left: 50px;
-}
-
-#jingle .videobox .remote_video {
- background-color: #000000;
- width: 100%;
- height: 100%;
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- z-index: 1;
-}
-
-#jingle .videobox .remote_video video {
- width: 100%;
- height: 100%;
-}
-
-#jingle .videobox .branding {
- background-position: 0 0;
- width: 39px;
- height: 44px;
- opacity: 0.5;
- position: absolute;
- bottom: 16px;
- right: 24px;
- z-index: 2;
-}
-
-html[dir="rtl"] #jingle .videobox .branding {
- right: auto;
- left: 24px;
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/main.css b/source/app/stylesheets/main.css
deleted file mode 100644
index eec236a..0000000
--- a/source/app/stylesheets/main.css
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the main CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-* {
- margin: 0;
- padding: 0;
-}
-
-body {
- font: normal 14.6px 'PT Sans', sans-serif;
- text-shadow: 0 0 5px white;
-}
-
-h1 {
- margin-bottom: 15px;
-}
-
-a {
- text-decoration: none;
- color: black;
- outline-style: none;
-}
-
-a:hover,
-a:focus {
- cursor: pointer;
- text-decoration: underline;
-}
-
-legend {
- color: black;
-}
-
-input,
-textarea {
- background-color: white;
- border: 1px solid #636363;
- font-size: 0.95em;
- padding: 2px;
- outline-style: none;
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- border-radius: 2px;
- -moz-box-shadow: inset 0 3px 10px #dcdcdc;
- -webkit-box-shadow: inset 0 3px 10px #dcdcdc;
- box-shadow: inset 0 3px 10px #dcdcdc;
-}
-
-textarea {
- font-size: 1.1em;
- resize: none;
-}
-
-input:focus,
-input[type="submit"]:hover,
-input[type="reset"]:hover,
-textarea:focus {
- border: 1px solid #e1a014;
- -moz-box-shadow: inset 0 3px 10px #edd9bc;
- -webkit-box-shadow: inset 0 3px 10px #edd9bc;
- box-shadow: inset 0 3px 10px #edd9bc;
-}
-
-input[type="submit"],
-input[type="reset"] {
- cursor: pointer;
-}
-
-input[type="submit"]:active,
-input[type="reset"]:active {
- -moz-box-shadow: inset 0 3px 15px #e1a753;
- -webkit-box-shadow: inset 0 3px 15px #e1a753;
- box-shadow: inset 0 3px 15px #e1a753;
-}
-
-input[disabled],
-textarea[disabled] {
- background-color: #f3f3f3;
- border: 1px solid #989898;
-}
-
-input:placeholder {
- color: #78868a !important;
-}
-
-input:-moz-placeholder {
- color: #78868a !important;
-}
-
-input::-webkit-input-placeholder {
- color: #78868a !important;
-}
-
-input.placeholder {
- color: #78868a !important;
-}
-
-input[type="checkbox"] {
- margin-top: 2px;
-}
-
-input[type="checkbox"],
-input[type="radio"] {
- background: transparent none !important;
- border: 0 none !important;
-}
-
-input.input-reset {
- background: transparent;
- border: 0 none;
- margin: 0;
- padding: 0;
- -moz-border-radius: 0;
- -webkit-border-radius: 0;
- border-radius: 0;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-
-.please-complete,
-.please-complete:hover,
-.please-complete:focus {
- border: 1px #ac2525 solid !important;
- -moz-box-shadow: inset 0 3px 10px #f39c9c !important;
- -webkit-box-shadow: inset 0 3px 10px #f39c9c !important;
- box-shadow: inset 0 3px 10px #f39c9c !important;
-}
-
-.hidden {
- display: none !important;
-}
-
-.clear {
- clear: both !important;
- display: block !important;
-}
diff --git a/source/app/stylesheets/manager.css b/source/app/stylesheets/manager.css
deleted file mode 100644
index 9fc8b69..0000000
--- a/source/app/stylesheets/manager.css
+++ /dev/null
@@ -1,612 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the manager CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#manager {
- background-color: rgb(20,20,20);
- background-color: rgba(20,20,20,0.85);
- width: 945px;
- margin: 0 auto 25px;
- padding-bottom: 17px;
- -moz-border-radius-bottomleft: 4px;
- -moz-border-radius-bottomright: 4px;
- -webkit-border-bottom-left-radius: 4px;
- -webkit-border-bottom-right-radius: 4px;
- border-bottom-left-radius: 4px;
- border-bottom-right-radius: 4px;
- -moz-box-shadow: 0 0 35px #5c5c5c;
- -webkit-box-shadow: 0 0 35px #5c5c5c;
- box-shadow: 0 0 35px #5c5c5c;
-}
-
-#manager a {
- color: black;
- text-decoration: underline;
-}
-
-#manager .clear {
- clear: both;
-}
-
-#manager fieldset {
- border: 1px solid black;
- margin: 22px 0 15px 0;
- padding: 7px 2px 5px 2px;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-
-#manager legend {
- font-size: 0.9em;
- margin: 0 0 0 15px;
- padding: 0 2px;
- text-transform: uppercase;
-}
-
-#manager label {
- width: 200px;
- display: block;
- float: left;
- clear: both;
- margin: 0 0 9px 12px;
-}
-
-html[dir="rtl"] #manager label {
- margin-left: 0;
- margin-right: 12px;
- float: right;
-}
-
-#manager label.master {
- text-decoration: underline;
-}
-
-#manager input,
-#manager select {
- float: left;
- margin-bottom: 5px;
-}
-
-html[dir="rtl"] #manager input,
-html[dir="rtl"] #manager select {
- float: right;
-}
-
-#manager input[type="radio"] {
- margin: 2px 8px 5px 0;
-}
-
-html[dir="rtl"] #manager input[type="radio"] {
- margin-right: 0;
- margin-left: 8px;
-}
-
-#manager input[type="text"],
-#manager input[type="url"],
-#manager input[type="password"],
-#manager select {
- margin-top: -2px;
- font-size: 0.95em;
-}
-
-#manager input[type="text"],
-#manager input[type="url"],
-#manager input[type="password"] {
- padding: 3px;
- min-width: 220px;
-}
-
-#manager input.icon {
- padding-left: 24px;
- min-width: 199px;
- max-height: 18px;
-}
-
-#manager input.icon#admin_name {
- background-position: 4px -510px;
-}
-
-#manager input.icon#admin_password,
-#manager input.icon#user_repassword {
- background-position: 4px -532px;
-}
-
-#manager input.icon#user_name,
-#manager input.icon#music_artist {
- background-position: 4px -554px;
-}
-
-#manager input.icon#user_password {
- background-position: 4px -576px;
-}
-
-#manager input.icon#music_title {
- background-position: 4px -598px;
-}
-
-#manager input.icon#music_album {
- background-position: 4px -620px;
-}
-
-#manager input.icon#background_image_color,
-#manager input.icon#background_color_color {
- background-position: 4px -641px;
-}
-
-#manager select {
- min-width: 160px;
- max-width: 230px;
-}
-
-#manager-top {
- padding: 25px 45px 30px;
-}
-
-#manager-top .logo {
- background-position: 0 0;
- min-width: 89px;
- height: 40px;
- padding: 28px 0 0 65px;
- font-size: 32px;
- color: white;
- text-transform: lowercase;
- float: left;
- text-shadow: 0 1px 1px black;
-}
-
-#manager-top .meta {
- background-color: #e0eaec;
- font-size: 0.9em;
- padding: 12px 7px 12px 14px;
- float: right;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- -moz-box-shadow: 0 0 10px #202020;
- -webkit-box-shadow: 0 0 10px #202020;
- box-shadow: 0 0 10px #202020;
-}
-
-html[dir="rtl"] #manager-top .meta {
- padding-left: 7px;
- padding-right: 14px;
-}
-
-#manager-top .meta span {
- margin-right: 10px;
- color: black;
-}
-
-html[dir="rtl"] #manager-top .meta span {
- margin-right: 0;
- margin-left: 10px;
-}
-
-#manager-top .meta a {
- background-color: #f1f6fd;
- border: 1px solid #b9cbcf;
- color: #224249;
- padding: 4px 8px 4px 21px;
- margin-left: 2px;
- text-decoration: none;
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- border-radius: 2px;
-}
-
-#manager-top .meta a:hover,
-#manager-top .meta a:focus {
- border: 1px solid #95b1b7;
-}
-
-#manager-top .meta a:active {
- border: 1px solid #77989f;
-}
-
-#manager-top .meta a.logout {
- background-position: 3px -69px;
-}
-
-#manager-top .meta a.close {
- background-position: 3px -90px;
-}
-
-#manager-tabs {
- margin-left: 12px;
-}
-
-html[dir="rtl"] #manager-tabs {
- margin-left: 0;
- margin-right: 12px;
-}
-
-#manager-tabs a {
- background-color: #d9e7ea;
- color: #204249;
- width: 107px;
- height: 17px;
- padding: 4px 4px 4px 16px;
- margin-left: 4px;
- font-size: 0.94em;
- text-decoration: none;
- overflow: hidden;
- float: left;
- -moz-border-radius-topright: 3px;
- -moz-border-radius-topleft: 3px;
- -webkit-border-top-right-radius: 3px;
- -webkit-border-top-left-radius: 3px;
- border-top-right-radius: 3px;
- border-top-left-radius: 3px;
-}
-
-html[dir="rtl"] #manager-tabs a {
- margin-left: 0;
- margin-right: 4px;
- padding-left: 4px;
- padding-right: 16px;
- float: right;
-}
-
-#manager-tabs a:hover,
-#manager-tabs a:focus {
- background-color: #cedee1;
- text-decoration: none;
-}
-
-#manager-tabs a:active {
- background-color: #c3d3d7;
- text-decoration: none;
-}
-
-#manager-tabs a.tab-active {
- background-color: #e4eef9 !important;
-}
-
-#manager-content {
- background: #e4eef9;
- background: -moz-linear-gradient(top, #e4eef9, #d0e5fa);
- background: -webkit-gradient(linear, left top, left bottom, from(#e4eef9), to(#d0e5fa));
- background: -webkit-linear-gradient(top, #e4eef9 0%, #d0e5fa 100%);
- background: -o-linear-gradient(top, #e4eef9 0%, #d0e5fa 100%);
- color: black;
- font-size: 0.9em;
- margin: 0 10px;
- padding: 20px 24px;
- min-height: 260px;
- clear: both;
- right: 10px;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- -moz-box-shadow: 0 0 20px #202020;
- -webkit-box-shadow: 0 0 20px #202020;
- box-shadow: 0 0 20px #202020;
-}
-
-#manager-content h3 {
- padding-left: 24px;
- margin-bottom: 15px;
- float: left;
-}
-
-html[dir="rtl"] #manager-content h3 {
- float: right;
-}
-
-#manager-content h3.login {
- background-position: 0 -466px;
-}
-
-#manager-content h3.statistics {
- background-position: 0 -203px;
-}
-
-#manager-content h3.configuration {
- background-position: 0 -224px;
-}
-
-#manager-content h3.hosts {
- background-position: 0 -246px;
-}
-
-#manager-content h3.storage {
- background-position: 0 -268px;
-}
-
-#manager-content h3.design {
- background-position: 0 -290px;
-}
-
-#manager-content h3.users {
- background-position: 0 -312px;
-}
-
-#manager-content h3.updates {
- background-position: 0 -334px;
-}
-
-#manager-content h4 {
- border-top: 1px dotted black;
- padding-top: 5px;
- margin: 20px 0 14px;
- clear: both;
-}
-
-#manager-content ul,
-#manager-content ol {
- width: 380px;
- margin: 8px 0 20px 18px;
-}
-
-html[dir="rtl"] #manager-content ul,
-html[dir="rtl"] #manager-content ol {
- margin-left: 0;
- margin-right: 18px;
-}
-
-#manager-content li {
- margin-bottom: 3px;
-}
-
-html[dir="rtl"] #manager-content li {
- margin-right: 15px;
-}
-
-#manager-content li.total {
- margin-bottom: 14px;
-}
-
-#manager-content li b {
- width: 190px;
- display: inline-block;
-}
-
-#manager-content li span {
- margin-left: 10px;
- display: inline-block;
-}
-
-#manager-content ul.stats,
-#manager-content ol.stats {
- float: left;
-}
-
-#manager-content object.stats {
- border: 1px dotted #bed4d9;
- width: 450px;
- height: 270px;
- margin-bottom: 20px;
- float: right;
-}
-
-#manager-content p,
-#manager-content div {
- margin-bottom: 10px;
- clear: both;
-}
-
-#manager-content .info {
- color: black;
- border-width: 1px;
- border-style: dashed;
- padding: 6px 8px;
- display: block;
- text-decoration: none;
-}
-
-#manager-content .info.bottomspace {
- margin-bottom: 16px;
-}
-
-#manager-content .info.smallspace {
- margin: 14px 0 10px 0;
-}
-
-#manager-content .info.bigspace {
- margin: 35px 0 20px 0;
-}
-
-#manager-content .info.neutral {
- background-color: #f0f19d;
- border-color: #b3ad4f;
-}
-
-#manager-content a.info.neutral:hover,
-#manager-content a.info.neutral:focus {
- background-color: #eced96;
-}
-
-#manager-content a.info.neutral:active {
- background-color: #e9ea93;
-}
-
-#manager-content .info.success {
- background-color: #a8dca9;
- border-color: #5e9f5f;
-}
-
-#manager-content a.info.success:hover,
-#manager-content a.info.success:focus {
- background-color: #a0d5a1;
-}
-
-#manager-content a.info.success:active {
- background-color: #9ad09b;
-}
-
-#manager-content .info.fail {
- background-color: #f19d9d;
- border-color: #b34f4f;
-}
-
-#manager-content a.info.fail:hover,
-#manager-content a.info.fail:focus {
- background-color: #ea9595;
-}
-
-#manager-content a.info.fail:active {
- background-color: #e59090;
-}
-
-#manager-content .browse {
- margin: 2px 0 6px;
- max-height: 243px;
- overflow: auto;
-}
-
-#manager-content .browse .one-browse {
- padding: 5px 10px 5px 34px;
- height: 17px;
-}
-
-html[dir="rtl"] #manager-content .browse .one-browse a,
-html[dir="rtl"] #manager-content .browse .one-browse span {
- float: left;
-}
-
-#manager-content .browse .user {
- background-position: 9px -111px;
-}
-
-#manager-content .browse .other {
- background-position: 9px -133px;
-}
-
-#manager-content .browse .folder {
- background-position: 9px -178px;
-}
-
-#manager-content .browse .audio {
- background-position: 9px -154px;
-}
-
-#manager-content .browse .alert {
- background-position: 9px -353px;
-}
-
-#manager-content .browse .image {
- background-position: 9px -374px;
-}
-
-#manager-content .browse .video {
- background-position: 9px -397px;
-}
-
-#manager-content .browse .document {
- background-position: 9px -418px;
-}
-
-#manager-content .browse .package {
- background-position: 9px -441px;
-}
-
-#manager-content .browse .previous {
- background-position: 9px -485px;
- margin-bottom: 4px;
-}
-
-#manager-content .browse div {
- margin: 0;
-}
-
-#manager-content .browse input {
- float: right;
- margin: 1px 0;
-}
-
-#manager-content .browse .odd {
- background-color: #e9f1fd;
-}
-
-#manager-content .browse .even {
- background-color: #f1f6fd;
-}
-
-#manager-content .sub {
- border-width: 0 0 0 1px;
- border-style: solid;
- border-color: black;
- margin: 5px 0 20px 22px;
- padding-left: 12px;
- clear: both;
-}
-
-html[dir="rtl"] #manager-content .sub {
- border-width: 0 1px 0 0;
- padding-right: 12px;
- padding-left: 0;
-}
-
-#manager span.logo_links a {
- width: 16px;
- height: 16px;
- margin-right: 6px;
- float: left;
-}
-
-#manager span.logo_links a.remove {
- background-position: 0 -688px;
-}
-
-#manager span.logo_links a.view {
- background-position: 0 -666px;
-}
-
-#manager-content .clear {
- margin: 0;
-}
-
-#manager-content textarea.notice-text {
- height: 70px;
- width: 600px;
- margin-left: 4px;
- padding: 5px;
- font-size: 1.2em;
-}
-
-#manager-buttons {
- margin-top: 22px;
-}
-
-#manager-buttons input {
- border: 1px solid white;
- background-color: rgb(255,255,255);
- background-color: rgba(255,255,255,0.1);
- color: white;
- padding: 4px 8px;
- margin-left: -12px;
- margin-right: 20px;
- font-size: 1em;
- text-shadow: 0 1px 1px black;
- float: right;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- -moz-box-shadow: 0 0 5px #202020;
- -webkit-box-shadow: 0 0 5px #202020;
- box-shadow: 0 0 5px #202020;
-}
-
-#manager-buttons input:hover,
-#manager-buttons input:focus {
- cursor: pointer;
- background-color: rgb(255,255,255);
- background-color: rgba(255,255,255,0.2);
- -moz-box-shadow: 0 0 15px #202020;
- -webkit-box-shadow: 0 0 15px #202020;
- box-shadow: 0 0 15px #202020;
-}
-
-#manager-buttons input:active {
- background-color: rgb(255,255,255);
- background-color: rgba(255,255,255,0.3);
-}
diff --git a/source/app/stylesheets/me.css b/source/app/stylesheets/me.css
deleted file mode 100644
index 60ca8e9..0000000
--- a/source/app/stylesheets/me.css
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the Jappix Me tool CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#me .content {
- padding: 10px 0;
-}
-
-#me .logo {
- background-position: 0 0;
- width: 300px;
- height: 61px;
- margin: 20px auto 0 auto;
- display: block;
-}
-
-#me .infos {
- margin-top: 30px;
-}
-
-#me .infos p {
- margin-top: 8px;
-}
-
-#me .infos p.infos-title {
- margin-top: 0;
-}
-
-#me .infos a {
- text-decoration: underline;
-}
-
-#me a.go {
- text-align: center;
- font-weight: bold;
- width: 300px;
- margin: 30px auto 0 auto;
- padding: 8px 12px;
- display: block;
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/mini.css b/source/app/stylesheets/mini.css
deleted file mode 100644
index 02e871f..0000000
--- a/source/app/stylesheets/mini.css
+++ /dev/null
@@ -1,854 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the Jappix Mini CSS stylesheet
-
--------------------------------------------------
-
-License: dual-licensed under AGPL and MPLv2
-Authors: Valérian Saliou, Julien, hunterjm, Kloadut
-
-*/
-
-#jappix_mini,
-#jappix_popup {
- font: normal 11px helvetica, "Lucida Grande", "Lucida Sans", "Lucida Sans Unicode", Arial, sans-serif;
- min-width: 280px;
-}
-
-#jappix_mini {
- margin-left: 130px;
- position: fixed;
- bottom: 0;
- right: 20px;
- display: block !important;
- z-index: 999;
-}
-
-#jappix_mini *,
-#jappix_popup * {
- border: none;
- color: black;
- width: auto;
- height: auto;
- margin: 0;
- padding: 0;
- overflow: visible;
- font-size: 11px;
- text-align: left;
- text-transform: none;
- text-shadow: none;
- opacity: 1.0;
- -moz-border-radius: 0;
- -webkit-border-radius: 0;
- border-radius: 0;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-
-#jappix_mini[dir="rtl"] *,
-#jappix_popup[dir="rtl"] * {
- text-align: right;
-}
-
-#jappix_mini .jm_images {
- background-image: url(../images/sprites/mini.png);
- background-repeat: no-repeat;
-}
-
-#jappix_mini .jm_images_animate {
- background-image: url(../images/sprites/animate.png);
- background-repeat: no-repeat;
-}
-
-#jappix_mini input.placeholder {
- color: #999999 !important;
-}
-
-#jappix_mini input:-moz-placeholder {
- color: #999999 !important;
-}
-
-#jappix_mini input::-webkit-input-placeholder {
- color: #999999 !important;
-}
-
-#jappix_mini a {
- text-decoration: none;
- cursor: pointer;
-}
-
-#jappix_mini a:hover {
- cursor: pointer;
-}
-
-#jappix_mini div.jm_position {
- float: right;
-}
-
-#jappix_mini a.jm_pane {
- background-color: #f4f4f4;
- background-position: 0 -100px;
- background-repeat: repeat-x;
- border-color: #999999;
- border-style: solid;
- border-width: 1px 1px 0 1px;
- font-weight: bold;
- outline-style: none;
- display: block;
- padding: 6px;
- height: 13px;
-}
-
-#jappix_mini a.jm_pane:hover {
- background: white;
-}
-
-#jappix_mini a.jm_pane:hover,
-#jappix_mini a.jm_pane:focus {
- border-color: #666666;
-}
-
-#jappix_mini div.jm_starter {
- float: right;
- position: relative;
-}
-
-#jappix_mini div.jm_conversations,
-#jappix_mini div.jm_conversation,
-#jappix_mini a.jm_switch {
- float: left;
- position: relative;
-}
-
-#jappix_mini a.jm_switch {
- border-right: none;
-}
-
-#jappix_mini a.jm_switch.jm_notifnav {
- background-position: 0 -432px !important;
-}
-
-#jappix_mini a.jm_switch span.jm_navigation {
- width: 16px;
- height: 16px;
- margin-top: -1px;
- display: block;
-}
-
-#jappix_mini a.jm_switch.jm_right span.jm_navigation {
- background-position: 0 -400px;
-}
-
-#jappix_mini a.jm_switch.jm_left span.jm_navigation {
- background-position: 0 -416px;
-}
-
-#jappix_mini div.jm_conversation {
- width: 153px;
-}
-
-#jappix_mini a.jm_chat-tab {
- border-width: 1px 0 0 1px;
- width: 140px;
- float: right;
- overflow: hidden;
-}
-
-#jappix_mini a.jm_chat-tab.jm_clicked {
- background: white;
- position: relative;
- border-top: none;
- border-left: 1px solid #999999;
- padding-top: 7px;
-}
-
-#jappix_mini a.jm_chat-tab span.jm_notify {
- position: absolute;
- top: 6px;
- right: 9px;
-}
-
-#jappix_mini a.jm_chat-tab span.jm_notify span {
- float: left;
-}
-
-#jappix_mini a.jm_chat-tab span.jm_notify span.jm_notify_left {
- background-position: 0 -360px;
-}
-
-#jappix_mini a.jm_chat-tab span.jm_notify span.jm_notify_right {
- background-position: -7px -360px;
-}
-
-#jappix_mini a.jm_chat-tab span.jm_notify span.jm_notify_left,
-#jappix_mini a.jm_chat-tab span.jm_notify span.jm_notify_right {
- height: 16px;
- width: 7px;
-}
-
-#jappix_mini a.jm_chat-tab span.jm_notify span.jm_notify_middle {
- background-color: #c60505;
- color: white;
- font-size: 0.85em;
- height: 13px;
- padding-top: 3px;
-}
-
-#jappix_mini div.jm_conversation.jm_type_groupchat span.jm_name {
- margin-left: 4px;
-}
-
-#jappix_mini[dir="rtl"] div.jm_conversation.jm_type_groupchat span.jm_name {
- margin-left: 0;
- margin-right: 4px;
-}
-
-#jappix_mini div.jm_chat-content {
- background-color: white;
- border: 1px solid #999999;
- height: 375px;
- width: 320px;
- position: absolute;
- right: -1px;
- bottom: 25px;
- display: none;
-}
-
-#jappix_mini div.jm_actions {
- background-color: #565d5e;
- border-bottom: 1px solid #3a3a3a;
- height: 14px;
- padding: 4px 6px;
- font-weight: bold;
- overflow: hidden;
-}
-
-#jappix_mini div.jm_conversation div.jm_actions {
- cursor: pointer;
-}
-
-#jappix_mini div.jm_actions span.jm_nick {
- color: white;
- height: 16px;
- width: 225px;
- overflow: hidden;
- float: left;
-}
-
-#jappix_mini[dir="rtl"] div.jm_actions span.jm_nick {
- float: right;
-}
-
-#jappix_mini div.jm_actions a.jm_one-action {
- background-color: #727879;
- margin: 0 -2px 0 5px;
- height: 15px;
- width: 15px;
- outline-style: none;
- display: block;
- position: absolute;
- top: 4px;
-}
-
-#jappix_mini div.jm_actions a.jm_one-action:hover,
-#jappix_mini div.jm_actions a.jm_one-action:focus {
- background-color: #7f8788;
-}
-
-#jappix_mini div.jm_actions a.jm_one-action:active {
- background-color: #8c9293;
-}
-
-#jappix_mini div.jm_actions a.jm_logo {
- background-position: 7px 2px;
- width: 81px;
- height: 22px;
- margin: -4px 0 0 -2px;
- outline-style: none;
- float: left;
-}
-
-#jappix_mini[dir="rtl"] div.jm_actions a.jm_logo {
- float: right;
-}
-
-#jappix_mini div.jm_actions a.jm_logo:hover,
-#jappix_mini div.jm_actions a.jm_logo:focus {
- background-color: #636a6b;
-}
-
-#jappix_mini div.jm_actions a.jm_logo:active {
- background-color: #707677;
-}
-
-#jappix_mini div.jm_actions a.jm_close {
- background-position: 1px -341px;
- right: 6px;
-}
-
-#jappix_mini[dir="rtl"] div.jm_actions a.jm_close {
- right: auto;
- left: 0;
-}
-
-#jappix_mini div.jm_actions a.jm_join {
- background-position: 0 -327px;
- right: 6px;
-}
-
-#jappix_mini[dir="rtl"] div.jm_actions a.jm_join {
- right: auto;
- left: 18px;
-}
-
-#jappix_mini div.jm_actions a.jm_status {
- background-color: #727879;
- overflow: hidden;
- right: 24px;
-}
-
-#jappix_mini[dir="rtl"] div.jm_actions a.jm_status {
- right: auto;
- left: 0;
-}
-
-#jappix_mini div.jm_actions a.active,
-#jappix_mini div.jm_actions a.active:hover,
-#jappix_mini div.jm_actions a.active:focus,
-#jappix_mini div.jm_actions a.active:active {
- background-color: #727879;
- border: 1px solid #3a3a3a;
- border-width: 1px 1px 0 1px;
- margin-right: -3px;
- top: 3px;
- z-index: 10;
-}
-
-#jappix_mini div.jm_status_picker,
-#jappix_mini div.jm_chan_suggest {
- background-color: #727879;
- border: 1px solid #3a3a3a;
- color: white;
- list-style: none outside none;
- width: 130px;
- position: absolute;
- top: 18px;
- padding: 3px 0;
- z-index: 9;
-}
-
-#jappix_mini div.jm_status_picker {
- right: 21px;
-}
-
-#jappix_mini div.jm_chan_suggest {
- right: 4px;
-}
-
-#jappix_mini[dir="rtl"] div.jm_status_picker,
-#jappix_mini[dir="rtl"] div.jm_chan_suggest {
- margin-right: 2px;
-}
-
-#jappix_mini div.jm_chan_suggest {
- max-height: 108px;
- overflow: auto;
-}
-
-#jappix_mini div.jm_status_picker a,
-#jappix_mini div.jm_chan_suggest a {
- color: white;
- height: 13px;
- padding: 4px;
- display: block;
-}
-
-#jappix_mini div.jm_status_picker a:hover,
-#jappix_mini div.jm_status_picker a:focus,
-#jappix_mini div.jm_chan_suggest a:hover,
-#jappix_mini div.jm_chan_suggest a:focus {
- background-color: white;
- color: #3a3a3a;
- border-width: 1px 0;
- border-style: solid;
- border-color: #3a3a3a;
- margin: -1px 0;
- display: block;
-}
-
-#jappix_mini div.jm_chan_suggest div.jm_space {
- height: 6px;
-}
-
-#jappix_mini div.jm_status_picker a span.jm_presence {
- margin-top: -1px;
-}
-
-#jappix_mini div.jm_chan_suggest a span.jm_chan_icon {
- height: 16px;
- width: 16px;
- margin: 0 8px 0 4px;
- float: left;
-}
-
-#jappix_mini[dir="rtl"] div.jm_chan_suggest a span.jm_chan_icon {
- margin-right: 4px;
- margin-left: 8px;
- float: right;
-}
-
-#jappix_mini div.jm_chan_suggest a.jm_suggest_groupchat span.jm_chan_icon {
- background-position: 0 -480px;
-}
-
-#jappix_mini div.jm_chan_suggest a.jm_suggest_groupchat:hover span.jm_chan_icon,
-#jappix_mini div.jm_chan_suggest a.jm_suggest_groupchat:focus span.jm_chan_icon {
- background-position: 0 -496px;
-}
-
-#jappix_mini div.jm_chan_suggest a.jm_suggest_chat span.jm_chan_icon {
- background-position: 0 -512px;
-}
-
-#jappix_mini div.jm_chan_suggest a.jm_suggest_chat:hover span.jm_chan_icon,
-#jappix_mini div.jm_chan_suggest a.jm_suggest_chat:focus span.jm_chan_icon {
- background-position: 0 -528px;
-}
-
-#jappix_mini div.jm_chan_suggest a span.jm_chan_name,
-#jappix_mini div.jm_status_picker a span.jm_show_text {
- color: white;
- float: left;
-}
-
-#jappix_mini[dir="rtl"] div.jm_chan_suggest a span.jm_chan_name,
-#jappix_mini[dir="rtl"] div.jm_status_picker a span.jm_show_text {
- float: right;
-}
-
-#jappix_mini div.jm_chan_suggest a span.jm_chan_name {
- height: 15px;
- width: 90px;
- overflow: hidden;
-}
-
-#jappix_mini div.jm_chan_suggest a:hover span.jm_chan_name,
-#jappix_mini div.jm_chan_suggest a:focus span.jm_chan_name,
-#jappix_mini div.jm_status_picker a:hover span.jm_show_text,
-#jappix_mini div.jm_status_picker a:focus span.jm_show_text {
- color: #3a3a3a;
-}
-
-#jappix_mini div.jm_pix_stream {
- line-height: 0;
- max-height: 50px;
- overflow: hidden;
- position: absolute;
- top: 23px;
- left: 0;
- right: 0;
-}
-
-#jappix_mini div.jm_pix_stream iframe {
- width: 320px;
- height: 50px;
- overflow: hidden;
-}
-
-#jappix_mini div.jm_received-messages {
- background-color: white;
- padding: 5px 0 4px;
- height: 317px;
- overflow: auto;
-}
-
-#jappix_mini div.jm_received-messages p {
- margin: 3px 0;
- word-wrap: break-word;
-}
-
-#jappix_mini div.jm_received-messages p,
-#jappix_mini div.jm_received-messages a {
- color: black !important;
-}
-
-#jappix_mini div.jm_received-messages div.jm_group {
- margin: 2px 6px 9px 6px;
- padding-bottom: 8px;
- border-bottom: 1px solid #eaeaea;
-}
-
-#jappix_mini div.jm_received-messages div.jm_system-message p,
-#jappix_mini div.jm_received-messages div.jm_system-message b,
-#jappix_mini div.jm_received-messages div.jm_system-message a {
- color: #053805 !important;
- font-style: italic !important;
-}
-
-#jappix_mini div.jm_received-messages p a {
- text-decoration: underline;
-}
-
-#jappix_mini div.jm_received-messages b.jm_name {
- margin-bottom: 3px;
- display: block;
-}
-
-#jappix_mini div.jm_received-messages b.jm_name.jm_me {
- color: #123a5c;
-}
-
-#jappix_mini div.jm_received-messages b.jm_name.jm_him {
- color: #801e1e;
-}
-
-#jappix_mini div.jm_received-messages span.jm_date {
- font-size: 0.8em;
- float: right;
- display: none;
-}
-
-#jappix_mini[dir="rtl"] div.jm_received-messages span.jm_date {
- float: left;
-}
-
-#jappix_mini div.jm_received-messages div.jm_group:hover span.jm_date {
- display: block;
-}
-
-#jappix_mini div.jm_received-messages div.jm_chatstate_typing {
- background-image: url(../images/wait/wait-typing.gif);
- background-repeat: no-repeat;
- background-position: 0 5px;
- color: #a6a6a6;
- font-size: 10px;
- letter-spacing: 1px;
- margin: 0 0 5px 8px;
- padding-left: 24px;
- visibility: hidden;
-}
-
-#jappix_mini input.jm_send-messages {
- background-color: white;
- border-color: #999999;
- border-style: solid;
- border-width: 1px 0 0 0;
- padding: 5px;
- width: 310px;
- min-height: 14px;
-}
-
-#jappix_mini div.jm_disabled div.jm_chat-content,
-#jappix_mini div.jm_disabled input.jm_send-messages,
-#jappix_mini div.jm_disabled a.jm_pane,
-#jappix_mini a.jm_switch.jm_nonav {
- background: #f3f3f3 !important;
-}
-
-#jappix_mini div.jm_disabled input.jm_send-messages {
- color: #9d9d9d;
-}
-
-#jappix_mini div.jm_roster {
- background-color: white;
- border: 1px solid #999999;
- width: 160px;
- position: absolute;
- right: 0;
- bottom: 25px;
- display: none;
-}
-
-#jappix_mini div.jm_search {
- border-top: 1px solid #999999;
- padding: 2px 0;
-}
-
-#jappix_mini div.jm_search input.jm_searchbox {
- background-color: white;
- background-position: 9px -381px;
- color: black;
- font-size: 0.9em;
- width: 128px;
- padding: 2px 4px 2px 28px;
-}
-
-#jappix_mini input.jm_searchbox:focus {
- border-color: #999999;
-}
-
-#jappix_mini div.jm_roster div.jm_buddies {
- width: 100%;
- max-height: 300px;
- min-height: 100px;
- padding: 5px 0;
- overflow: auto;
-}
-
-#jappix_mini div.jm_roster div.jm_grouped {
- margin: 2px 0;
-}
-
-#jappix_mini div.jm_roster div.jm_grouped div.jm_name {
- margin-bottom: 2px;
- padding: 4px 8px 0;
- font-weight: bold;
-}
-
-#jappix_mini a.jm_friend {
- border-color: white;
- border-style: solid;
- border-width: 1px 0;
- outline-style: none;
- padding: 6px;
- display: block;
-}
-
-#jappix_mini a.jm_friend.jm_offline {
- display: none;
-}
-
-#jappix_mini a.jm_friend.jm_hover {
- background-color: #888888;
- border-color: #494949;
- color: white;
-}
-
-#jappix_mini a.jm_friend.jm_hover span.jm_presence {
- background-position: 0 -84px;
-}
-
-#jappix_mini a.jm_button {
- padding: 6px 10px;
- position: relative;
- z-index: 1;
-}
-
-#jappix_mini a.jm_button.jm_clicked {
- background: white;
- border-top: none;
- border-left: 1px solid #999999;
- border-right: 1px solid #999999;
- padding: 7px 10px 6px 10px;
-}
-
-#jappix_mini span.jm_animate {
- background-position: 0 0;
- width: 80px;
- height: 74px;
- position: absolute;
- top: -76px;
- left: -52px;
- z-index: 1;
- display: block;
- -moz-animation-duration: 1.5s;
- -webkit-animation-duration: 1.5s;
- -o-animation-duration: 1.5s;
- animation-duration: 1.5s;
- -moz-animation-name: jm_animate;
- -webkit-animation-name: jm_animate;
- -o-animation-name: jm_animate;
- animation-name: jm_animate;
- -moz-transition-timing-function: ease-in-out;
- -webkit-transition-timing-function: ease-in-out;
- -o-transition-timing-function: ease-in-out;
- transition-timing-function: ease-in-out;
- -moz-animation-iteration-count: infinite;
- -webkit-animation-iteration-count: infinite;
- -o-animation-iteration-count: infinite;
- animation-iteration-count: infinite;
- -moz-animation-direction: alternate;
- -webkit-animation-direction: alternate;
- -o-animation-direction: alternate;
- animation-direction: alternate;
-}
-
-#jappix_mini span.jm_counter {
- background-position: 0 -288px;
- color: #333333;
- height: 16px;
- padding-left: 25px;
- display: block;
-}
-
-#jappix_mini span.jm_counter.jm_error {
- background-position: 0 -305px;
-}
-
-#jappix_mini span.jm_presence {
- display: block;
- height: 16px;
- width: 16px;
- margin-right: 4px;
- float: left;
-}
-
-#jappix_mini[dir="rtl"] span.jm_presence {
- margin-right: 0;
- margin-left: 4px;
- float: right;
-}
-
-#jappix_mini span.jm_name {
- color: #272727;
- height: 14px;
- width: 105px;
- overflow: hidden;
- float: left;
-}
-
-#jappix_mini[dir="rtl"] span.jm_name {
- float: right;
-}
-
-#jappix_mini .jm_available,
-#jappix_mini .jm_chat {
- background-position: 0 -20px;
-}
-
-#jappix_mini .jm_away {
- background-position: 0 -36px;
-}
-
-#jappix_mini .jm_xa,
-#jappix_mini .jm_dnd {
- background-position: 0 -52px;
-}
-
-#jappix_mini .jm_unavailable {
- background-position: 0 -68px;
-}
-
-#jappix_mini .jm_smiley {
- border: 0 none;
- height: 16px;
- width: 16px;
- vertical-align: bottom;
-}
-
-#jappix_mini .jm_smiley-wink {
- background-position: 0 -148px;
-}
-
-#jappix_mini .jm_smiley-waii {
- background-position: 0 -164px;
-}
-
-#jappix_mini .jm_smiley-unhappy {
- background-position: 0 -180px;
-}
-
-#jappix_mini .jm_smiley-tongue {
- background-position: 0 -196px;
-}
-
-#jappix_mini .jm_smiley-surprised {
- background-position: 0 -212px;
-}
-
-#jappix_mini .jm_smiley-smile {
- background-position: 0 -228px;
-}
-
-#jappix_mini .jm_smiley-happy {
- background-position: 0 -244px;
-}
-
-#jappix_mini .jm_smiley-grin {
- background-position: 0 -260px;
-}
-
-#jappix_popup {
- background: url(../images/others/blank.gif) repeat;
- position: fixed;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- z-index: 999;
-}
-
-#jappix_popup div.jm_prompt {
- background-color: #565d5e;
- border: 1px solid #3a3a3a;
- width: 346px;
- position: fixed;
- top: 50%;
- left: 50%;
- margin-left: -175px;
- padding: 16px 2px 2px 2px;
- -moz-border-radius-topright: 4px;
- -moz-border-radius-topleft: 4px;
- -webkit-border-top-right-radius: 4px;
- -webkit-border-top-left-radius: 4px;
- border-top-right-radius: 4px;
- border-top-left-radius: 4px;
- -moz-box-shadow: 0 0 35px #232323;
- -webkit-box-shadow: 0 0 35px #232323;
- box-shadow: 0 0 35px #232323;
-}
-
-#jappix_popup div.jm_prompt form {
- background-color: white;
- border: 1px solid #3a3a3a;
- width: 332px;
- padding: 6px;
-}
-
-#jappix_popup div.jm_prompt form input {
- background-color: #f9f9f9;
- border: 1px solid #666666;
- font-size: 1.1em;
- padding: 1px 2px;
-}
-
-#jappix_popup div.jm_prompt form input:hover,
-#jappix_popup div.jm_prompt form input:focus {
- border: 1px solid #202020;
-}
-
-#jappix_popup div.jm_prompt form input.jm_text {
- width: 326px;
- margin: 6px 0;
- display: block;
-}
-
-#jappix_popup div.jm_prompt form input.jm_submit {
- text-align: center;
- margin-left: 3px;
- float: right;
-}
-
-#jappix_popup div.jm_prompt form input.jm_submit:hover,
-#jappix_popup div.jm_prompt form input.jm_submit:focus {
- background-color: #f3f3f3;
- cursor: pointer;
-}
-
-#jappix_popup div.jm_prompt form input.jm_submit:active {
- background-color: #e8e8e8;
-}
-
-#jappix_popup div.jm_prompt div.jm_clear {
- clear: both;
-}
-
-@-moz-keyframes jm_animate {
- to {
- margin-top: 4px;
- }
-}
-
-@-webkit-keyframes jm_animate {
- to {
- margin-top: 4px;
- }
-}
-
-@keyframes jm_animate {
- to {
- margin-top: 4px;
- }
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/mobile.css b/source/app/stylesheets/mobile.css
deleted file mode 100644
index 0573af9..0000000
--- a/source/app/stylesheets/mobile.css
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the Jappix Mobile CSS stylesheet
-
--------------------------------------------------
-
-License: AGPL
-Authors: Valérian Saliou, Camaran
-
-*/
-
-/* BEGIN GENERAL STYLE */
-
-* {
- margin: 0;
- padding: 0;
-}
-
-body {
- font: normal 14.4px Helvetica, Verdana, sans-serif;
- background-color: #dcdcdc;
- margin: 0 auto;
- text-align: center;
- min-width: 200px;
- min-height: 260px;
-}
-
-a {
- color: black;
-}
-
-/* END GENERAL STYLE */
-
-/* BEGIN HEADER STYLE */
-
-.header {
- background-color: #2d2d2d;
- border-bottom: 1px solid #6d6d6d;
- color: #405964;
- padding: 6px 0;
- height: 30px;
-}
-
-.header div {
- background-position: 0 0;
- width: 83px;
- height: 30px;
-}
-
-/* END HEADER STYLE */
-
-/* BEGIN HOME STYLE */
-
-#home .header div {
- margin: 0 auto;
-}
-
-#home .notification {
- padding: 2px;
- margin-top: -1px;
-}
-
-#noscript {
- background: #86a2ff;
- border-bottom: 1px solid #5890d6;
- color: #1e4b82;
-}
-
-#error {
- background: #ff8686;
- border-bottom: 1px solid #d65858;
- color: #821e1e;
- display: none;
-}
-
-#info {
- background: #f3eba7;
- border-bottom: 1px solid #d9d085;
- color: #5e5616;
- display: none;
-}
-
-#home .login {
- padding: 8px 0;
- margin-top: 30px;
- margin-bottom: 30px;
-}
-
-#home .login input {
- margin-top: 5px;
- padding: 2px;
-}
-
-#home .login input.xid,
-#home .login input.password {
- display: block;
- margin: 4px auto;
- font-size: 0.85em;
- padding: 4px;
- background-color: white;
- border: 1px solid #636363;
- width: 150px;
- padding-left: 24px;
-}
-
-#home .login input.xid {
- background-position: 4px -30px;
-}
-
-#home .login input.password {
- background-position: 4px -53px;
-}
-
-#home .login label {
- margin-bottom: 12px;
- display: block;
-}
-
-#home .login label input {
- margin-right: 4px;
-}
-
-#home a {
- font-size: 0.8em;
-}
-
-/* END HOME STYLE */
-
-/* BEGIN TALK STYLE */
-
-#talk .header div,
-#chat .header div {
- float: left;
- margin-left: 7px;
-}
-
-#talk .header button,
-#chat .header button {
- float: right;
- margin-right: 7px;
- padding: 2px;
-}
-
-#talk a.one-buddy {
- display: block;
- background-color: #87a5ab;
- border-bottom: 1px solid #5b8088;
- text-shadow: 1px 1px 1px #5b8088;
- text-decoration: none;
- color: white;
- outline-style: none;
- padding: 10px 0;
-}
-
-#talk a.one-buddy:hover {
- background-color: #8fb0b7;
- cursor: pointer;
-}
-
-#talk a.available,
-#talk a.chat {
- background-color: #83b187;
- border-bottom: 1px solid #4d8252;
- text-shadow: 1px 1px 1px #4d8252;
-}
-
-#talk a.available:hover,
-#talk a.chat:hover,
-#talk a.available:focus,
-#talk a.chat:focus {
- background-color: #89c68e;
-}
-
-#talk a.available:active,
-#talk a.chat:active {
- background-color: #90d496;
-}
-
-#talk a.away {
- background-color: #e0be7b;
- border-bottom: 1px solid #ae8941;
- text-shadow: 1px 1px 1px #ae8941;
-}
-
-#talk a.away:hover,
-#talk a.away:focus {
- background-color: #eac784;
-}
-
-#talk a.away:active {
- background-color: #f3d294;
-}
-
-#talk a.xa,
-#talk a.dnd {
- background-color: #db8989;
- border-bottom: 1px solid #a24343;
- text-shadow: 1px 1px 1px #a24343;
-}
-
-#talk a.xa:hover,
-#talk a.dnd:hover,
-#talk a.xa:focus,
-#talk a.dnd:focus {
- background-color: #e89797;
-}
-
-#talk a.xa:active,
-#talk a.dnd:active {
- background-color: #ef9f9f;
-}
-
-/* END TALK STYLE */
-
-/* BEGIN CHAT STYLE */
-
-#chat {
- display: none;
-}
-
-#chat .one-chat,
-#chat .one-chat p,
-#chat .one-chat div,
-#chat .one-chat input {
- position: absolute;
- bottom: 0;
- right: 0;
-}
-
-#chat .one-chat {
- top: 43px;
- left: 0;
-}
-
-#chat .one-chat p {
- background-color: #87a5ab;
- border-bottom: 1px solid #5b8088;
- text-shadow: 1px 1px 1px #5b8088;
- color: white;
- top: 0;
- left: 0;
- height: 18px;
- padding: 2px 0;
- font-size: 0.9em;
-}
-
-#chat .one-chat div {
- border-bottom: 1px solid #cbcbcb;
- top: 23px;
- left: 0;
- bottom: 37px;
- overflow: auto;
- text-align: left;
-}
-
-html[dir="rtl"] #chat .one-chat div {
- text-align: right;
-}
-
-#chat .one-chat span {
- display: block;
- font-size: 0.85em;
- margin: 4px 6px;
- word-wrap: break-word;
-}
-
-#chat .one-chat b {
- margin-right: 3px;
-}
-
-html[dir="rtl"] #chat .one-chat b {
- margin-right: auto;
- margin-left: 3px;
-}
-
-#chat .one-chat b.me {
- color: #123a5c;
-}
-
-#chat .one-chat b.him {
- color: #801e1e;
-}
-
-#chat .one-chat input {
- background-color: white;
- bottom: 0;
- height: 37px;
- width: 100%;
- border: none;
-}
-
-#chat .one-chat input.submit {
- right: 0;
- width: 35px;
-}
-
-html[dir="rtl"] #chat .one-chat input.submit {
- left: 0;
- right: auto;
-}
-
-/* END CHAT STYLE */
diff --git a/source/app/stylesheets/mucadmin.css b/source/app/stylesheets/mucadmin.css
deleted file mode 100644
index 004b026..0000000
--- a/source/app/stylesheets/mucadmin.css
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the mucadmin CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#mucadmin .content {
- padding: 10px 0 10px 0;
-}
-
-#mucadmin .content p {
- margin: 5px 10px 5px 10px;
- text-align: justify;
-}
-
-html[dir="rtl"] #mucadmin .mucadmin-head-text {
- float: right;
-}
-
-#mucadmin .mucadmin-head-jid {
- text-decoration: underline;
- font-size: 0.9em;
- float: right;
- margin: 2px 4px 1px 1px;
-}
-
-html[dir="rtl"] #mucadmin .mucadmin-head-jid {
- margin-left: 4px;
- margin-right: 1px;
- float: left;
-}
-
-#mucadmin .mucadmin-forms {
- height: 310px;
- width: 620px;
- margin: -5px 0 0 10px;
- padding: 6px 0 0 0;
- overflow: auto;
-}
-
-html[dir="rtl"] #mucadmin .mucadmin-forms {
- margin-left: 0;
- margin-right: 10px;
-}
-
-#mucadmin .mucadmin-forms label {
- width: 260px;
-}
-
-#mucadmin .mucadmin-topic label,
-#mucadmin .mucadmin-aut label,
-#mucadmin .mucadmin-others label {
- font-size: 0.9em;
-}
-
-#mucadmin .mucadmin-forms textarea {
- height: 60px;
- width: 300px;
- margin: 5px 12px 10px 0;
-}
-
-html[dir="rtl"] #mucadmin .mucadmin-forms textarea {
- margin-right: 0;
-}
-
-#mucadmin .results {
- height: auto;
- width: auto;
- overflow: visible;
- margin: 5px;
-}
-
-#mucadmin .aut-group {
- float: left;
- padding-bottom: 4px;
-}
-
-html[dir="rtl"] #mucadmin .aut-group {
- float: right;
-}
-
-#mucadmin .one-aut {
- clear: both;
- margin: 0 10px 5px 0;
-}
-
-html[dir="rtl"] #mucadmin .one-aut {
- margin-right: 0;
- margin-left: 10px;
-}
-
-#mucadmin .aut-add {
- clear: both;
- float: left;
- margin-bottom: 5px;
- font-size: 0.9em;
-}
-
-html[dir="rtl"] #mucadmin .aut-add {
- float: right;
-}
-
-#mucadmin .aut-remove {
- float: left;
-}
-
-html[dir="rtl"] #mucadmin .aut-remove {
- float: right;
-}
-
-#mucadmin .aut-remove:hover,
-#mucadmin .aut-remove:focus {
- font-weight: bold;
- text-decoration: none;
-}
-
-#mucadmin .mucadmin-others a {
- float: left;
- font-size: 0.9em;
-}
-
-html[dir="rtl"] #mucadmin .mucadmin-others a {
- float: right;
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/muji.css b/source/app/stylesheets/muji.css
deleted file mode 100644
index 7c0d10a..0000000
--- a/source/app/stylesheets/muji.css
+++ /dev/null
@@ -1,690 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the Muji CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#muji .videochat_items {
- min-width: 600px;
- left: 60px;
- right: 60px;
-}
-
-#muji .remote_container {
- position: absolute;
- left: 0;
- right: 0;
- bottom: 0;
- top: 0;
-}
-
-/* Default video */
-#muji .remote_container .remote_video_shaper {
- overflow: hidden;
- display: none;
- float: left;
- position: relative;
-}
-
-/* 1 video view */
-#muji[data-count="1"] .remote_container .remote_video_shaper:nth-child(1) {
- width: 100%;
- height: 100%;
- display: block;
-}
-
-/* 2 video views */
-#muji[data-count="2"] .remote_container .remote_video_shaper:nth-child(1),
-#muji[data-count="2"] .remote_container .remote_video_shaper:nth-child(2) {
- width: 50%;
- height: 100%;
- display: block;
-}
-
-/* 3 video views */
-#muji[data-count="3"] .remote_container .remote_video_shaper:nth-child(1),
-#muji[data-count="3"] .remote_container .remote_video_shaper:nth-child(2),
-#muji[data-count="3"] .remote_container .remote_video_shaper:nth-child(3) {
- height: 50%;
- display: block;
-}
-
-#muji[data-count="3"] .remote_container .remote_video_shaper:nth-child(1) {
- width: 100%;
- float: none;
-}
-
-#muji[data-count="3"] .remote_container .remote_video_shaper:nth-child(2),
-#muji[data-count="3"] .remote_container .remote_video_shaper:nth-child(3) {
- width: 50%;
-}
-
-/* 4 video views */
-#muji[data-count="4"] .remote_container .remote_video_shaper:nth-child(1),
-#muji[data-count="4"] .remote_container .remote_video_shaper:nth-child(2),
-#muji[data-count="4"] .remote_container .remote_video_shaper:nth-child(3),
-#muji[data-count="4"] .remote_container .remote_video_shaper:nth-child(4) {
- height: 50%;
- width: 50%;
- display: block;
-}
-
-/* 5 video views */
-#muji[data-count="5"] .remote_container .remote_video_shaper:nth-child(1),
-#muji[data-count="5"] .remote_container .remote_video_shaper:nth-child(2),
-#muji[data-count="5"] .remote_container .remote_video_shaper:nth-child(3),
-#muji[data-count="5"] .remote_container .remote_video_shaper:nth-child(4),
-#muji[data-count="5"] .remote_container .remote_video_shaper:nth-child(5) {
- height: 50%;
- display: block;
-}
-
-#muji[data-count="5"] .remote_container .remote_video_shaper:nth-child(1),
-#muji[data-count="5"] .remote_container .remote_video_shaper:nth-child(2) {
- width: 50%;
-}
-
-#muji[data-count="5"] .remote_container .remote_video_shaper:nth-child(3),
-#muji[data-count="5"] .remote_container .remote_video_shaper:nth-child(4),
-#muji[data-count="5"] .remote_container .remote_video_shaper:nth-child(5) {
- width: 33.33333333%;
-}
-
-/* 6 video views */
-#muji[data-count="6"] .remote_container .remote_video_shaper:nth-child(1),
-#muji[data-count="6"] .remote_container .remote_video_shaper:nth-child(2),
-#muji[data-count="6"] .remote_container .remote_video_shaper:nth-child(3),
-#muji[data-count="6"] .remote_container .remote_video_shaper:nth-child(4),
-#muji[data-count="6"] .remote_container .remote_video_shaper:nth-child(5),
-#muji[data-count="6"] .remote_container .remote_video_shaper:nth-child(6) {
- height: 50%;
- width: 33.33333333%;
- display: block;
-}
-
-#muji .remote_container .remote_video_shaper .label_username {
- background: rgb(0,0,0);
- background: rgba(0,0,0,0.6);
- color: #ffffff;
- font-size: 0.75em;
- padding: 3px 6px 4px 10px;
- position: absolute;
- top: 7px;
- left: 0;
- display: none;
-}
-
-html[dir="rtl"] #muji .remote_container .remote_video_shaper .label_username {
- padding-right: 10px;
- padding-left: 6px;
- left: auto;
- right: 0;
-}
-
-#muji[data-count="1"] .remote_container .remote_video_shaper .label_username,
-#muji[data-count="2"] .remote_container .remote_video_shaper .label_username,
-#muji[data-count="3"] .remote_container .remote_video_shaper:nth-child(1) .label_username,
-#muji[data-count="4"] .remote_container .remote_video_shaper:nth-child(n+1):nth-child(-n+2) .label_username,
-#muji[data-count="5"] .remote_container .remote_video_shaper:nth-child(n+1):nth-child(-n+2) .label_username,
-#muji[data-count="6"] .remote_container .remote_video_shaper:nth-child(n+1):nth-child(-n+3) .label_username {
- top: 48px;
-}
-
-#muji .remote_container .remote_video_shaper:hover .label_username {
- display: block;
-}
-
-#muji .empty_message {
- text-align: center;
- margin-top: -11px;
- position: absolute;
- left: 0;
- right: 0;
- top: 50%;
-}
-
-#muji .empty_message .text {
- color: #ffffff;
- letter-spacing: 1px;
- font-size: 1.2em;
-}
-
-#muji .videoroom,
-#muji .chatroom {
- position: absolute;
- top: 0;
- bottom: 0;
-}
-
-#muji .videoroom {
- background-color: #000000;
- left: 0;
- right: 280px;
-}
-
-html[dir="rtl"] #muji .videoroom {
- right: 0;
- left: 280px;
-}
-
-#muji .videoroom .topbar .controls {
- margin-left: 18px;
-}
-
-html[dir="rtl"] #muji .videoroom .topbar .controls {
- margin-right: 18px;
-}
-
-#muji .videoroom .topbar .elapsed {
- margin-left: 80px;
-}
-
-html[dir="rtl"] #muji .videoroom .topbar .elapsed {
- margin-right: 80px;
-}
-
-#muji .chatroom {
- background: #ffffff;
- width: 280px;
- right: 0;
-}
-
-html[dir="rtl"] #muji .chatroom {
- right: auto;
- left: 0;
-}
-
-#muji .videoroom .local_video {
- width: 140px;
- height: 78px;
-}
-
-#muji .videoroom .local_video:hover {
- width: 220px;
- height: 123px;
-}
-
-#muji .chatroom .chatroom_participants {
- background: #fcfcfc;
- border-bottom: 1px solid #e1e1e1;
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- z-index: 1;
-}
-
-#muji .chatroom .chatroom_participants .participants_default_view {
- text-align: center;
- height: 40px;
-}
-
-#muji .chatroom .chatroom_participants .participants_default_view .participants_counter,
-#muji .chatroom .chatroom_participants .participants_default_view .participants_full {
- color: #444444;
- font-size: 0.9em;
- font-weight: bold;
- letter-spacing: 1px;
- margin-top: 11px;
- display: inline-block;
-}
-
-#muji .chatroom .chatroom_participants .participants_default_view .participants_full {
- color: #5a6d7f;
- font-size: 0.8em;
- margin-left: 6px;
- display: none;
-}
-
-html[dir="rtl"] #muji .chatroom .chatroom_participants .participants_default_view .participants_full {
- margin-left: auto;
- margin-right: 6px;
-}
-
-#muji .chatroom .chatroom_participants .participants_default_view .participants_invite {
- background-position: 0 -287px;
- width: 13px;
- height: 13px;
- opacity: 0.6;
- display: block;
- position: absolute;
- top: 14px;
- right: 16px;
-}
-
-html[dir="rtl"] #muji .chatroom .chatroom_participants .participants_default_view .participants_invite {
- right: auto;
- left: 16px;
-}
-
-#muji .chatroom .chatroom_participants .participants_default_view .participants_invite:hover,
-#muji .chatroom .chatroom_participants .participants_default_view .participants_invite:focus {
- opacity: 1;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box {
- border-top: 1px solid #e1e1e1;
- display: none;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_list {
- border-bottom: 1px solid #e1e1e1;
- padding: 4px 2px 2px 6px;
- display: none;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_list .invite_one {
- background: #d7e2f4;
- border: 1px solid #aab9f4;
- font-size: 0.75em;
- margin: 0 4px 3px 0;
- padding: 2px 4px;
- display: inline-block;
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- border-radius: 2px;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_list .invite_one.invite_unsupported {
- background: #f49d90;
- border-color: #de8780;
- color: #95443e;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_list .invite_one .invite_one_remove {
- background-position: 0 -300px;
- width: 9px;
- height: 9px;
- margin-left: 3px;
- margin-top: 1px;
- display: inline-block;
-}
-
-html[dir="rtl"] #muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_list .invite_one .invite_one_remove {
- margin-left: auto;
- margin-right: 3px;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_list .invite_one.invite_unsupported .invite_one_remove {
- background-position: 0 -309px;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_list .invite_one .invite_one_remove:hover,
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_list .invite_one .invite_one_remove:focus,
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_list .invite_one .invite_one_remove:active {
- background-position: 1px -317px;
- margin-left: 2px;
- margin-right: -1px;
- margin-bottom: -1px;
- padding: 1px;
- -moz-border-radius: 1px;
- -webkit-border-radius: 1px;
- border-radius: 1px;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_list .invite_one .invite_one_remove:hover,
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_list .invite_one .invite_one_remove:focus {
- background-color: #8299ad;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_list .invite_one.invite_unsupported .invite_one_remove:hover,
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_list .invite_one.invite_unsupported .invite_one_remove:focus {
- background-color: #ad625f;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_list .invite_one .invite_one_remove:active {
- background-color: #5b6e80;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_list .invite_one.invite_unsupported .invite_one_remove:active {
- background-color: #804847;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box form.participants_invite_form {
- height: 32px;
- margin-left: 8px;
- position: relative;
-}
-
-html[dir="rtl"] #muji .chatroom .chatroom_participants .participants_invite_box form.participants_invite_form {
- margin-left: auto;
- margin-left: 0;
- margin-right: 8px;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box form.participants_invite_form .invite_validate {
- background: #f9f9f9;
- border: 1px solid #e7e7e7;
- color: #94a6aa;
- text-decoration: none;
- padding: 4px 6px 5px 6px;
- display: none;
- position: absolute;
- top: 4px;
- right: 9px;
- -moz-border-radius: 1px;
- -webkit-border-radius: 1px;
- border-radius: 1px;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box form.participants_invite_form .invite_validate:active {
- padding-top: 5px;
- padding-bottom: 4px;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box form.participants_invite_form .invite_validate .invite_validate_icon {
- background-position: 0 -329px;
- width: 14px;
- height: 11px;
- margin-top: 2px;
- display: block;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box form.participants_invite_form .invite_input_container {
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- right: 41px;
-}
-
-html[dir="rtl"] #muji .chatroom .chatroom_participants .participants_invite_box form.participants_invite_form .invite_input_container {
- right: 0;
- left: 41px;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box form.participants_invite_form input.invite_xid {
- font-size: 0.8em;
- width: 100%;
- height: 100%;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search {
- max-height: 220px;
- overflow: auto;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one {
- border-top: 1px solid #e1e1e1;
- height: 28px;
- display: block;
- position: relative;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one.hover,
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one.focus {
- background: #f5f7ff;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one.active {
- background: #eef1f8;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one.participant_search_unsupported {
- background: #f6f6f6;
- color: #969696;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one.participant_search_unsupported.hover,
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one.participant_search_unsupported.focus {
- background: #f1f1f1;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one.participant_search_unsupported.active {
- background: #efefef;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one .avatar-container {
- text-align: center;
- height: 20px;
- width: 20px;
- margin: 4px 0 0 6px;
- float: left;
-}
-
-html[dir="rtl"] #muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one .avatar-container {
- float: right;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one .avatar-container .avatar {
- max-height: 20px;
- max-width: 20px;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one .details {
- position: absolute;
- top: 0;
- left: 40px;
- right: 0;
- bottom: 0;
-}
-
-html[dir="rtl"] #muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one .details {
- right: 40px;
- left: 0;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one .details .name,
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one .details .feature {
- position: absolute;
- display: block;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one .details .name {
- font-size: 0.8em;
- top: 6px;
- left: 0;
- right: 50px;
- bottom: 0;
-}
-
-html[dir="rtl"] #muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one .details .name {
- right: 0;
- left: 50px;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one .details .feature {
- width: 16px;
- height: 16px;
- top: 6px;
- right: 16px;
- opacity: 0.75;
- display: none;
-}
-
-html[dir="rtl"] #muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one .details .feature {
- right: auto;
- left: 7px;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one.participant_search_has_audio .details .feature,
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one.participant_search_has_video .details .feature {
- display: block;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one.participant_search_has_audio .details .feature {
- background-position: 0 -340px;
-}
-
-#muji .chatroom .chatroom_participants .participants_invite_box .participants_invite_search .participant_search_one.participant_search_has_video .details .feature {
- background-position: 0 -356px;
-}
-
-#muji .chatroom .chatroom_view {
- padding: 4px 4px 12px 8px;
- overflow: auto;
- position: absolute;
- top: 41px;
- left: 0;
- right: 0;
- bottom: 41px;
-}
-
-html[dir="rtl"] #muji .chatroom .chatroom_view {
- padding-left: 8px;
-}
-
-#muji .chatroom .chatroom_view .room_message {
- margin-top: 10px;
- position: relative;
-}
-
-#muji .chatroom .chatroom_view .room_message.me .message_content {
- float: left;
-}
-
-html[dir="rtl"] #muji .chatroom .chatroom_view .room_message.me .message_content {
- float: right;
-}
-
-#muji .chatroom .chatroom_view .room_message.him .message_content {
- margin-right: 30px;
- float: right;
-}
-
-html[dir="rtl"] #muji .chatroom .chatroom_view .room_message.him .message_content {
- margin-right: auto;
- margin-left: 30px;
- float: left;
-}
-
-#muji .chatroom .chatroom_view .room_message .message_content .message_bubble {
- font-size: 0.85em;
- padding: 7px 12px 8px 12px;
- display: block;
- -moz-border-radius: 6px;
- -webkit-border-radius: 6px;
- border-radius: 6px;
-}
-
-#muji .chatroom .chatroom_view .room_message.me .message_content .message_bubble {
- background-color: #8dc2ef;
- -moz-border-radius-bottomleft: 0;
- -webkit-border-bottom-left-radius: 0;
- border-bottom-left-radius: 0;
-}
-
-html[dir="rtl"] #muji .chatroom .chatroom_view .room_message.me .message_content .message_bubble {
- -moz-border-radius-bottomleft: 6px;
- -webkit-border-bottom-left-radius: 6px;
- border-bottom-left-radius: 6px;
- -moz-border-radius-bottomright: 0;
- -webkit-border-bottom-right-radius: 0;
- border-bottom-right-radius: 0;
-}
-
-#muji .chatroom .chatroom_view .room_message.him .message_content .message_bubble {
- background-color: #bcdf6a;
- -moz-border-radius-bottomright: 0;
- -webkit-border-bottom-right-radius: 0;
- border-bottom-right-radius: 0;
-}
-
-html[dir="rtl"] #muji .chatroom .chatroom_view .room_message.him .message_content .message_bubble {
- -moz-border-radius-bottomright: 6px;
- -webkit-border-bottom-right-radius: 6px;
- border-bottom-right-radius: 6px;
- -moz-border-radius-bottomleft: 0;
- -webkit-border-bottom-left-radius: 0;
- border-bottom-left-radius: 0;
-}
-
-#muji .chatroom .chatroom_view .room_message .message_content .message_author {
- color: #6c6c6c;
- font-size: 0.75em;
- margin-top: 2px;
- display: block;
-}
-
-#muji .chatroom .chatroom_view .room_message.him .message_content .message_author {
- text-align: right;
-}
-
-html[dir="rtl"] #muji .chatroom .chatroom_view .room_message.him .message_content .message_author {
- text-align: left;
-}
-
-#muji .chatroom .chatroom_view .room_message .message_avatar {
- position: absolute;
- right: 0;
- bottom: 16px;
-}
-
-html[dir="rtl"] #muji .chatroom .chatroom_view .room_message .message_avatar {
- right: auto;
- left: 0;
-}
-
-#muji .chatroom .chatroom_view .room_message .message_avatar.avatar-container {
- text-align: center;
- height: 24px;
- width: 24px;
-}
-
-#muji .chatroom .chatroom_view .room_message .message_avatar.avatar-container .avatar {
- max-height: 24px;
- max-width: 24px;
-}
-
-#muji .chatroom form.chatroom_form {
- background: #fcfcfc;
- border-top: 1px solid #e1e1e1;
- height: 40px;
- position: absolute;
- bottom: 0;
- left: 0;
- right: 0;
-}
-
-#muji .chatroom form.chatroom_form .message_icon {
- background-position: 0 -272px;
- width: 17px;
- height: 15px;
- position: absolute;
- top: 13px;
- left: 12px;
-}
-
-html[dir="rtl"] #muji .chatroom form.chatroom_form .message_icon {
- left: auto;
- right: 12px;
-}
-
-#muji .chatroom form.chatroom_form .message_separator {
- background: #e9e9e9;
- width: 1px;
- position: absolute;
- top: 6px;
- bottom: 6px;
- left: 40px;
-}
-
-html[dir="rtl"] #muji .chatroom form.chatroom_form .message_separator {
- left: auto;
- right: 40px;
-}
-
-#muji .chatroom form.chatroom_form .message_input_container {
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 52px;
-}
-
-html[dir="rtl"] #muji .chatroom form.chatroom_form .message_input_container {
- left: auto;
- right: 52px;
-}
-
-#muji .chatroom form.chatroom_form .message_input_container input.message_input {
- font-size: 0.8em;
- width: 100%;
- height: 100%;
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/myinfos.css b/source/app/stylesheets/myinfos.css
deleted file mode 100644
index f4d2043..0000000
--- a/source/app/stylesheets/myinfos.css
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the my-infos CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#my-infos {
- background-color: rgb(20,20,20);
- background-color: rgba(20,20,20,0.85);
- color: #919191;
- margin-top: 8px;
- padding: 15px 6px 6px 6px;
- -moz-border-radius: 4px;
- -webkit-border-radius: 4px;
- border-radius: 4px;
- -moz-box-shadow: 0 0 6px #5c5c5c;
- -webkit-box-shadow: 0 0 6px #5c5c5c;
- box-shadow: 0 0 6px #5c5c5c;
-}
-
-#my-infos .content {
- background: #e8f1f3;
- background: -moz-linear-gradient(top, #e4edef, #e8f1f3);
- background: -webkit-gradient(linear, left top, left bottom, from(#e4edef), to(#e8f1f3));
- background: -webkit-linear-gradient(top, #e4edef 0%, #e8f1f3 100%);
- background: -o-linear-gradient(top, #e4edef 0%, #e8f1f3 100%);
- color: #919191;
- max-height: 140px;
- padding: 1px 0;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-
-#my-infos .element {
- height: 24px;
- margin: 6px 0;
- position: relative;
-}
-
-#my-infos .element .icon {
- background-color: white;
- border-color: #636363;
- border-width: 1px;
- border-style: solid;
- margin-left: 6px;
- height: 22px;
- width: 25px;
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- border-radius: 2px;
-}
-
-html[dir="rtl"] #my-infos .element .icon {
- margin-left: auto;
- margin-right: 6px;
-}
-
-#my-infos .element div.bubble a {
- width: 100%;
- height: 20px;
-}
-
-#my-infos .element .icon:hover,
-#my-infos .element div.bubble a:hover {
- background-color: #f4f4f4;
-}
-
-#my-infos .element .icon:active,
-#my-infos .element div.bubble a:active {
- background-color: #ededed;
-}
-
-#my-infos .f-presence div.bubble a[data-value="available"] {
- background-position: 4px -167px;
-}
-
-#my-infos .f-presence div.bubble a[data-value="away"] {
- background-position: 4px -183px;
-}
-
-#my-infos .f-presence div.bubble a[data-value="xa"] {
- background-position: 4px -199px;
-}
-
-#my-infos .f-mood div.bubble a[data-value="crazy"] {
- background-position: 4px -296px;
-}
-
-#my-infos .f-mood div.bubble a[data-value="excited"] {
- background-position: 4px -314px;
-}
-
-#my-infos .f-mood div.bubble a[data-value="playful"] {
- background-position: 4px -332px;
-}
-
-#my-infos .f-mood div.bubble a[data-value="happy"] {
- background-position: 4px -350px;
-}
-
-#my-infos .f-mood div.bubble a[data-value="shocked"] {
- background-position: 4px -368px;
-}
-
-#my-infos .f-mood div.bubble a[data-value="hot"] {
- background-position: 4px -386px;
-}
-
-#my-infos .f-mood div.bubble a[data-value="sad"] {
- background-position: 4px -404px;
-}
-
-#my-infos .f-mood div.bubble a[data-value="amorous"] {
- background-position: 4px -422px;
-}
-
-#my-infos .f-mood div.bubble a[data-value="confident"] {
- background-position: 4px -440px;
-}
-
-#my-infos .f-mood a[data-value] span {
- background-position: 0 -352px;
-}
-
-#my-infos .f-mood a[data-value="crazy"] span,
-.mood-one {
- background-position: 0 -298px;
-}
-
-#my-infos .f-mood a[data-value="excited"] span,
-.mood-two {
- background-position: 0 -316px;
-}
-
-#my-infos .f-mood a[data-value="playful"] span,
-.mood-three {
- background-position: 0 -334px;
-}
-
-#my-infos .f-mood a[data-value="happy"] span,
-.mood-four {
- background-position: 0 -352px;
-}
-
-#my-infos .f-mood a[data-value="shocked"] span,
-.mood-five {
- background-position: 0 -370px;
-}
-
-#my-infos .f-mood a[data-value="hot"] span,
-.mood-six {
- background-position: 0 -388px;
-}
-
-#my-infos .f-mood a[data-value="sad"] span,
-.mood-seven {
- background-position: 0 -406px;
-}
-
-#my-infos .f-mood a[data-value="amorous"] span,
-.mood-eight {
- background-position: 0 -424px;
-}
-
-#my-infos .f-mood a[data-value="confident"] span,
-.mood-nine {
- background-position: 0 -442px;
-}
-
-#my-infos .f-activity div.bubble a[data-value="doing_chores"] {
- background-position: 4px -458px;
-}
-
-#my-infos .f-activity div.bubble a[data-value="drinking"] {
- background-position: 4px -476px;
-}
-
-#my-infos .f-activity div.bubble a[data-value="eating"] {
- background-position: 4px -494px;
-}
-
-#my-infos .f-activity div.bubble a[data-value="exercising"] {
- background-position: 4px -512px;
-}
-
-#my-infos .f-activity div.bubble a[data-value="grooming"] {
- background-position: 4px -548px;
-}
-
-#my-infos .f-activity div.bubble a[data-value="having_appointment"] {
- background-position: 4px -566px;
-}
-
-#my-infos .f-activity div.bubble a[data-value="inactive"] {
- background-position: 4px -530px;
-}
-
-#my-infos .f-activity div.bubble a[data-value="relaxing"] {
- background-position: 4px -620px;
-}
-
-#my-infos .f-activity div.bubble a[data-value="talking"] {
- background-position: 4px -602px;
-}
-
-#my-infos .f-activity div.bubble a[data-value="traveling"] {
- background-position: 4px -584px;
-}
-
-#my-infos .f-activity div.bubble a[data-value="working"] {
- background-position: 4px -638px;
-}
-
-#my-infos .f-activity a[data-value] span {
- background-position: 0 -514px;
-}
-
-#my-infos .f-activity a[data-value="doing_chores"] span,
-.activity-doing_chores {
- background-position: 0 -460px;
-}
-
-#my-infos .f-activity a[data-value="drinking"] span,
-.activity-drinking {
- background-position: 0 -478px;
-}
-
-#my-infos .f-activity a[data-value="eating"] span,
-.activity-eating {
- background-position: 0 -496px;
-}
-
-#my-infos .f-activity a[data-value="exercising"] span,
-.activity-exercising {
- background-position: 0 -514px;
-}
-
-#my-infos .f-activity a[data-value="grooming"] span,
-.activity-grooming {
- background-position: 0 -550px;
-}
-
-#my-infos .f-activity a[data-value="having_appointment"] span,
-.activity-having_appointment {
- background-position: 0 -568px;
-}
-
-#my-infos .f-activity a[data-value="inactive"] span,
-.activity-inactive {
- background-position: 0 -532px;
-}
-
-#my-infos .f-activity a[data-value="relaxing"] span,
-.activity-relaxing {
- background-position: 0 -622px;
-}
-
-#my-infos .f-activity a[data-value="talking"] span,
-.activity-talking {
- background-position: 0 -604px;
-}
-
-#my-infos .f-activity a[data-value="traveling"] span,
-.activity-traveling {
- background-position: 0 -586px;
-}
-
-#my-infos .f-activity a[data-value="working"] span,
-.activity-working {
- background-position: 0 -640px;
-}
-
-#my-infos .element .icon.picker {
- border-width: 1px 0 1px 1px;
- float: left;
- -moz-border-radius-topright: 0;
- -moz-border-radius-bottomright: 0;
- -webkit-border-top-right-radius: 0;
- -webkit-border-bottom-right-radius: 0;
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
-}
-
-html[dir="rtl"] #my-infos .element .icon.picker {
- border-width: 1px 1px 1px 0;
- float: right;
- -moz-border-radius-topright: 2px;
- -moz-border-radius-topleft: 0;
- -moz-border-radius-bottomright: 2px;
- -moz-border-radius-bottomleft: 0;
- -webkit-border-top-right-radius: 2px;
- -webkit-border-top-left-radius: 0;
- -webkit-border-bottom-right-radius: 2px;
- -webkit-border-bottom-left-radius: 0;
- border-top-right-radius: 2px;
- border-top-left-radius: 0;
- border-bottom-right-radius: 2px;
- border-bottom-left-radius: 0;
-}
-
-#my-infos .element .icon.disabled {
- background-color: #f3f3f3;
- border-color: #989898;
- cursor: default;
-}
-
-#my-infos .element div.bubble {
- background-color: white;
- border-color: #636363;
- border-width: 1px 1px 0 1px;
- border-style: solid;
- width: 25px;
- padding: 1px 0;
- position: absolute;
- bottom: 21px;
- left: 6px;
- -moz-border-radius-topleft: 2px;
- -moz-border-radius-topright: 2px;
- -webkit-border-top-left-radius: 2px;
- -webkit-border-top-right-radius: 2px;
- border-top-left-radius: 2px;
- border-top-right-radius: 2px;
-}
-
-html[dir="rtl"] #my-infos .element div.bubble {
- left: auto;
- right: 6px;
-}
-
-#my-infos .element a {
- float: left;
-}
-
-html[dir="rtl"] #my-infos .element a {
- float: right;
-}
-
-#my-infos .element .icon span {
- height: 16px;
- width: 16px;
- margin: 3px 4px;
- display: block;
-}
-
-#my-infos .element input {
- height: 18px;
- width: 190px;
- font-size: 0.85em;
- padding-left: 4px;
- float: left;
- -moz-border-radius-topleft: 0;
- -moz-border-radius-bottomleft: 0;
- -webkit-border-top-left-radius: 0;
- -webkit-border-top-bottom-radius: 0;
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
-}
-
-html[dir="rtl"] #my-infos .element input {
- padding-left: 2px;
- padding-right: 4px;
- float: right;
- -moz-border-radius-topright: 0;
- -moz-border-radius-topleft: 2px;
- -moz-border-radius-bottomright: 0;
- -moz-border-radius-bottomleft: 2px;
- -webkit-border-top-right-radius: 0;
- -webkit-border-top-left-radius: 2px;
- -webkit-border-bottom-right-radius: 0;
- -webkit-border-bottom-left-radius: 2px;
- border-top-right-radius: 0;
- border-top-left-radius: 2px;
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 2px;
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/options.css b/source/app/stylesheets/options.css
deleted file mode 100644
index fe07280..0000000
--- a/source/app/stylesheets/options.css
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the options CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#options label {
- width: 190px;
- font-size: 0.94em;
-}
-
-#options .forms {
- width: 610px;
- height: 328px;
- margin: 15px 15px 15px 15px;
- float: left;
-}
-
-#options .forms select {
- margin-top: -3px;
- min-width: 120px;
- float: left;
-}
-
-html[dir="rtl"] #options .forms select {
- float: right;
-}
-
-#options .forms a.linked {
- font-size: 0.9em;
- float: left;
-}
-
-#options .forms a.empty-archives {
- margin-top: -2px;
- margin-left: 5px;
-}
-
-html[dir="rtl"] #options .forms a.linked {
- float: right;
-}
-
-#options .forms.in_background fieldset {
- opacity: 0.5;
-}
-
-#options fieldset.privacy {
- display: none;
-}
-
-#options .sub-ask-delete, #options .sub-ask-pass, #options .sub-ask-pass-success {
- display: none;
-}
-
-#options .sub-ask {
- background: #cbdde1;
- border: 1px #879da2 dotted;
- width: 592px;
- padding: 8px;
- display: none;
- position: absolute;
- bottom: 15px;
-}
-
-#options .sub-ask-top {
- font-size: 0.9em;
- margin-top: -3px;
-}
-
-#options .sub-ask-title {
- margin-bottom: 4px;
- float: left;
-}
-
-#options .sub-ask-close {
- float: right;
-}
-
-#options .sub-ask-close:hover {
- cursor: pointer;
-}
-
-#options .sub-ask-content {
- clear: both;
- height: 25px;
- font-size: 0.9em;
- border-top: 1px #416972 solid;
- padding: 12px 0 0 0;
-}
-
-#options .sub-ask-content label {
- width: 125px;
-}
-
-#options .sub-ask-content input {
- width: 125px;
-}
-
-#options .sub-ask-bottom {
- clear: both;
- font-size: 0.9em;
- float: right;
- text-decoration: underline;
-}
-
-#options .sub-ask-bottom:hover {
- cursor: pointer;
-}
diff --git a/source/app/stylesheets/others.css b/source/app/stylesheets/others.css
deleted file mode 100644
index 215b632..0000000
--- a/source/app/stylesheets/others.css
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the others CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#audio {
- display: none;
-}
-
-#top-content {
- position: absolute;
- right: 5px;
- left: 5px;
- top: 0;
- min-width: 860px;
- z-index: 50;
-}
-
-#main-content {
- position: absolute;
- top: 34px;
- left: 5px;
- right: 5px;
- bottom: 5px;
- min-width: 850px;
- min-height: 450px;
-}
-
-#left-content {
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- width: 248px;
-}
-
-html[dir="rtl"] #left-content {
- left: auto;
- right: 0;
-}
-
-#right-content,
-#suggest {
- background-color: rgb(20,20,20);
- background-color: rgba(20,20,20,0.85);
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 260px;
- z-index: 10;
- -moz-border-radius: 4px;
- -webkit-border-radius: 4px;
- border-radius: 4px;
- -moz-box-shadow: 0 0 6px #5c5c5c;
- -webkit-box-shadow: 0 0 6px #5c5c5c;
- box-shadow: 0 0 6px #5c5c5c;
-}
-
-html[dir="rtl"] #right-content {
- left: 0;
- right: 260px;
-}
-
-#general-wait {
- background: url(../images/others/blank.gif) repeat;
- z-index: 10000;
- position: fixed;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
-}
-
-.general-wait-content {
- background-color: rgb(255,255,255);
- background-color: rgba(255,255,255,0.9);
- background-position: 8px 8px;
- padding: 8px;
- position: absolute;
- right: 5px;
- bottom: 5px;
- -moz-border-radius: 4px;
- -webkit-border-radius: 4px;
- border-radius: 4px;
- -moz-box-shadow: 0 0 2px #000;
- -webkit-box-shadow: 0 0 2px #000;
- box-shadow: 0 0 2px #000;
-}
-
-html[dir="rtl"] .general-wait-content {
- right: auto;
- left: 5px;
-}
-
-.inbox-hidable,
-.options-hidable,
-.pep-hidable,
-.pubsub-hidable,
-.pubsub-hidable-cn,
-.mam-hidable,
-.commands-hidable,
-.privacy-hidable,
-.xmpplinks-hidable,
-.muji-hidable {
- display: none;
-}
-
-#reconnect .pane {
- background-color: rgb(20,20,20);
- background-color: rgba(20,20,20,0.85);
- color: white;
- padding: 25px;
- z-index: 10000;
- text-shadow: 0 1px 1px black;
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- -moz-box-shadow: 0 0 35px #232323;
- -webkit-box-shadow: 0 0 35px #232323;
- box-shadow: 0 0 35px #232323;
-}
-
-#reconnect .pane a {
- margin-top: -4px;
- float: right;
-}
-
-#suggest {
- width: 350px;
- height: 350px;
- margin-top: -175px;
- margin-left: -175px;
- left: 50%;
- right: auto;
- top: 50%;
-}
-
-#suggest .title {
- color: white;
- font-weight: bold;
- text-transform: uppercase;
- text-shadow: 0 2px 2px black;
- position: absolute;
- top: 14px;
- left: 18px;
- right: 18px;
-}
-
-#suggest .content {
- background: #e4eef9;
- padding: 12px 12px 0 12px;
- position: absolute;
- left: 8px;
- right: 8px;
- top: 45px;
- bottom: 52px;
- overflow: auto;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- -moz-box-shadow: 0 0 10px black;
- -webkit-box-shadow: 0 0 10px black;
- box-shadow: 0 0 10px black;
-}
-
-#suggest .content a.one {
- background-color: #e4eef9;
- border: 1px solid #ccdbde;
- margin-bottom: 8px;
- padding: 8px 12px;
- text-decoration: none;
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- border-radius: 2px;
- display: block;
-}
-
-#suggest .content a.one:hover,
-#suggest .content a.one:focus {
- border: 1px solid #93c5fa;
-}
-
-#suggest .content a.one:active {
- border: 1px solid #419afa;
-}
-
-#suggest .content a.one.active {
- background-color: #f1f6fd;
- border: 1px solid #9dc4fc;
-}
-
-#suggest .content a.one span.icon,
-#suggest .content a.one span.state {
- height: 16px;
- width: 16px;
-}
-
-#suggest .content a.one span.icon {
- background-position: 0 -1082px;
- margin: 0 15px 0 0;
- float: left;
-}
-
-#suggest .content a.one span.name {
- font-weight: bold;
- height: 16px;
- width: 250px;
- overflow: hidden;
- float: left;
-}
-
-#suggest .content a.one span.state {
- background-position: 0 -1661px;
- margin: -6px -16px 0 0;
- display: none;
- float: right;
-}
-
-#suggest .content a.one.active span.state {
- display: block;
-}
-
-#suggest .content a.one span.clear {
- display: block;
- clear: both;
-}
-
-#suggest .bottom {
- position: absolute;
- bottom: 13px;
- right: 8px;
- left: 8px;
-}
-
-#suggest .bottom a.next {
- float: right;
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/pageengine.css b/source/app/stylesheets/pageengine.css
deleted file mode 100644
index 37e6f7d..0000000
--- a/source/app/stylesheets/pageengine.css
+++ /dev/null
@@ -1,1140 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the page-engine CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#page-engine {
- background-color: #f4f4f4;
- position: absolute;
- top: 40px;
- bottom: 6px;
- right: 6px;
- left: 6px;
- z-index: 8;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-
-#page-engine .top {
- background: #e8f1f3;
- background: -moz-linear-gradient(top, #e8f1f3, #dee8ea);
- background: -webkit-gradient(linear, left top, left bottom, from(#e8f1f3), to(#dee8ea));
- background: -webkit-linear-gradient(top, #e8f1f3 0%, #dee8ea 100%);
- background: -o-linear-gradient(top, #e8f1f3 0%, #dee8ea 100%);
- border-bottom: 1px solid #d0d0d0;
- color: black;
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- padding: 6px;
- height: 80px;
- -moz-border-radius-topright: 3px;
- -moz-border-radius-topleft: 3px;
- -webkit-border-top-right-radius: 3px;
- -webkit-border-top-left-radius: 3px;
- border-top-right-radius: 3px;
- border-top-left-radius: 3px;
-}
-
-#page-engine .top .avatar-container {
- text-align: center;
- margin: 2px 0 0 10px;
- height: 76px;
- width: 76px;
- float: left;
-}
-
-html[dir="rtl"] #page-engine .top .avatar-container {
- margin-left: 0;
- margin-right: 10px;
- float: right;
-}
-
-#page-engine .top .avatar {
- max-height: 76px;
- max-width: 76px;
-}
-
-#page-engine .top .name {
- text-align: right;
- padding: 7px;
-}
-
-html[dir="rtl"] #page-engine .top .name {
- text-align: left;
-}
-
-#page-engine p.bc-name {
- font-size: 2.3em;
- margin-bottom: 5px;
-}
-
-#page-engine p.bc-infos {
- font-size: 0.85em;
- height: 16px;
- overflow: hidden;
- position: absolute;
- left: 115px;
- right: 12px;
-}
-
-html[dir="rtl"] #page-engine p.bc-infos {
- left: 12px;
- right: 115px;
-}
-
-#page-engine .page-engine-chan[data-type="groupchat"] p.bc-infos {
- left: 12px;
-}
-
-#page-engine p.bc-infos span.show {
- padding-left: 18px;
-}
-
-#page-engine p.bc-infos a {
- text-decoration: underline;
-}
-
-#page-engine div.bc-pep {
- float: right;
-}
-
-html[dir="rtl"] #page-engine div.bc-pep {
- float: left;
-}
-
-#page-engine div.bc-pep a {
- height: 16px;
- width: 16px;
- margin-left: 4px;
- float: left;
-}
-
-html[dir="rtl"] #page-engine div.bc-pep a {
- margin-right: 4px;
- margin-left: 0;
-}
-
-#page-engine div.bc-pep a:hover {
- cursor: default;
-}
-
-#page-engine div.bc-pep a[href]:hover {
- cursor: pointer;
-}
-
-#page-engine .content,
-#page-engine .list {
- font-size: 0.9em;
- position: absolute;
- top: 93px;
- right: 0;
- bottom: 29px;
- overflow: auto;
- -moz-box-shadow: inset 0 3px 10px #e8e8e8;
- -webkit-box-shadow: inset 0 3px 10px #e8e8e8;
- box-shadow: inset 0 3px 10px #e8e8e8;
-}
-
-#page-engine .content {
- left: 0;
- padding: 12px 14px 0;
-}
-
-#page-engine .content a {
- text-decoration: underline;
-}
-
-#page-engine .content .wait-mam {
- margin: 2px auto 14px auto;
- display: none;
-}
-
-#page-engine .page-engine-chan {
- display: none;
-}
-
-#page-engine .chat .content,
-#page-engine .chat .list {
- bottom: 93px;
-}
-
-#page-engine .chat .content {
- padding-bottom: 24px;
-}
-
-#page-engine .groupchat-content {
- padding-bottom: 16px !important;
- right: 191px !important;
-}
-
-html[dir="rtl"] #page-engine .groupchat-content {
- right: 0 !important;
- left: 191px !important;
-}
-
-#page-engine .list {
- border-width: 0 0 0 1px;
- border-style: solid;
- border-color: #c8c8c8;
- padding: 8px 0 0;
- width: 190px;
- right: 0;
-}
-
-html[dir="rtl"] #page-engine .list {
- border-width: 0 1px 0 0;
- right: auto;
- left: 0;
-}
-
-#page-engine .list .role {
- display: none;
- margin-bottom: 10px;
-}
-
-#page-engine .list .title {
- font-weight: bold;
- color: #383838;
- margin-left: 8px;
-}
-
-#page-engine .list .user {
- background: #eff2f2;
- background: -moz-linear-gradient(top, #eff2f2, #ecefef);
- background: -webkit-gradient(linear, left top, left bottom, from(#eff2f2), to(#ecefef));
- background: -webkit-linear-gradient(top, #eff2f2 0%, #ecefef 100%);
- background: -o-linear-gradient(top, #eff2f2 0%, #ecefef 100%);
- border-color: #c8c8c8;
- border-width: 1px 0;
- border-style: solid;
- color: #383838;
- margin-bottom: 3px;
- overflow: hidden;
-}
-
-#page-engine .list .user:hover {
- background: #e9ecec;
- cursor: pointer;
-}
-
-#page-engine .list .user:active {
- background: #e3e7e7;
-}
-
-#page-engine .list .user.myself {
- background-color: #eff2f2;
- cursor: default;
-}
-
-#page-engine .list .user .user-details {
- height: 32px;
-}
-
-#page-engine .list .user .user-details .name {
- float: left;
- height: 18px;
- overflow: hidden;
- margin: 7px 0 7px 3px;
- padding-left: 18px;
-}
-
-html[dir="rtl"] #page-engine .list .user .user-details .name {
- margin-left: auto;
- margin-right: 8px;
- float: right;
-}
-
-#page-engine .list .user .user-details .avatar-container {
- text-align: center;
- float: right;
- height: 32px;
- width: 32px;
-}
-
-html[dir="rtl"] #page-engine .list .user .user-details .avatar-container {
- float: left;
-}
-
-#page-engine .list .user .user-details .avatar {
- max-height: 32px;
- max-width: 32px;
-}
-
-#page-engine .list .user .user-actions {
- margin-top: 2px;
- display: none;
-}
-
-#page-engine .list .user .user-actions .action {
- border-style: solid;
- border-width: 0 1px 0 0;
- border-color: #e1e1e1;
- text-align: center;
- margin: 0 0 0 6px;
- padding: 0 6px 0 0;
- float: left;
-}
-
-#page-engine .list .user .user-actions .action a {
- width: 16px;
- height: 16px;
- margin: 2px 6px 1px 6px;
- display: inline-block;
- opacity: 0.8;
-}
-
-#page-engine .list .user .user-actions .action a:hover,
-#page-engine .list .user .user-actions .action a:focus {
- opacity: 1;
-}
-
-#page-engine .list .user .user-actions .action.promote a {
- background-position: 0 -2156px;
-}
-
-#page-engine .list .user .user-actions .action.demote a {
- background-position: 0 -2172px;
-}
-
-#page-engine .list .user .user-actions .action.kick a {
- background-position: 0 -2188px;
-}
-
-#page-engine .list .user .user-actions .action.add {
- border-width: 0 0 0 1px;
- margin: 0 6px 0 0;
- padding: 0 0 0 6px;
- float: right;
-}
-
-#page-engine .list .user .user-actions .action.add a {
- background-position: 0 -1047px;
-}
-
-#page-engine .one-group {
- border-bottom: 1px dotted #d0d0d0;
- padding-bottom: 8px;
- margin-bottom: 10px;
-}
-
-#page-engine .one-line {
- position: relative;
-}
-
-#page-engine .one-line.is-sending {
- opacity: 0.6;
-}
-
-#page-engine .one-line .correction-edit,
-#page-engine .one-line .correction-label,
-#page-engine .one-line.user-message[data-edited] .corrected-info,
-#page-engine .one-line .message-marker {
- font-size: 0.8em;
- position: absolute;
- right: 0;
- top: 0;
-}
-
-html[dir="rtl"] #page-engine .one-line .correction-edit,
-html[dir="rtl"] #page-engine .one-line .correction-label,
-html[dir="rtl"] #page-engine .one-line.user-message[data-edited] .corrected-info,
-html[dir="rtl"] #page-engine .one-line .message-marker {
- left: 0;
- right: auto;
-}
-
-#page-engine .one-line .correction-edit,
-#page-engine .one-line .correction-label {
- border: 1px solid #7f7f7f;
- color: black;
- font-size: 0.8em;
- text-decoration: none;
- margin-top: -1px;
- padding: 2px 5px;
- position: absolute;
- right: 0;
- top: 0;
-}
-
-#page-engine .one-line .correction-edit {
- opacity: 0.4;
- display: none;
-}
-
-#page-engine .page-engine-chan[data-correction="true"] .one-line .correction-edit:hover,
-#page-engine .page-engine-chan[data-correction="true"] .one-line .correction-edit:focus {
- opacity: 1;
-}
-
-#page-engine .one-line.user-message[data-edited] .corrected-info,
-#page-engine .one-line .message-marker {
- color: #969696;
- margin-top: 2px;
-}
-
-#page-engine .one-line .message-marker {
- display: none;
-}
-
-#page-engine .one-line .message-marker.message-marker-read {
- background-position: 0 -2227px;
- padding-left: 11px;
-}
-
-#page-engine .page-engine-chan[data-correction="true"] .one-line.user-message[data-mode="me"]:last-child:hover .correction-edit {
- display: block;
-}
-
-#page-engine .one-line.correction-active .corrected-info,
-#page-engine .one-line.user-message[data-mode="me"]:last-child:hover .corrected-info {
- display: none;
-}
-
-#page-engine .one-line.correction-active .message-marker,
-#page-engine .one-line.user-message[data-mode="me"]:last-child:hover .message-marker {
- display: none !important;
-}
-
-#page-engine .one-line .message-content {
- margin-right: 80px;
-}
-
-html[dir="rtl"] #page-engine .one-line .message-content {
- margin-right: 0;
- margin-left: 80px;
-}
-
-#page-engine .one-line,
-#page-engine .one-group b.name {
- padding-left: 50px;
- word-wrap: break-word;
-}
-
-html[dir="rtl"] #page-engine .one-line,
-html[dir="rtl"] #page-engine .one-group b.name {
- padding-left: auto;
- padding-right: 50px;
-}
-
-#page-engine .one-line.correction-active {
- opacity: 0.5;
-}
-
-#page-engine .one-group b.name {
- display: block;
- margin-bottom: 4px;
- line-height: 1.4;
-}
-
-#page-engine .one-group b.name.me {
- color: #123a5c;
-}
-
-#page-engine .one-group b.name.him {
- color: #801e1e;
-}
-
-#page-engine .one-group span.date {
- float: right;
- font-size: 0.95em;
-}
-
-html[dir="rtl"] #page-engine .one-group span.date {
- float: left;
-}
-
-#page-engine .one-group .avatar-container {
- text-align: center;
- margin: 4px 0 0 6px;
- height: 30px;
- width: 30px;
- float: left;
-}
-
-html[dir="rtl"] #page-engine .one-group .avatar-container {
- margin-left: auto;
- margin-right: 6px;
- float: right;
-}
-
-#page-engine .one-group .avatar {
- max-height: 30px;
- max-width: 30px;
-}
-
-#page-engine b.name.talk-images {
- background-position: 50px -99px;
- padding-left: 68px;
-}
-
-#page-engine .user-message {
- margin-bottom: 3px;
- line-height: 1.3;
-}
-
-#page-engine .system-message {
- color: #053805 !important;
- margin-bottom: 3px !important;
- padding-left: 0 !important;
-}
-
-html[dir="rtl"] #page-engine .system-message {
- padding-right: 0 !important;
-}
-
-#page-engine .system-message a {
- color: #053805 !important;
-}
-
-#page-engine .system-message p.help b {
- margin-bottom: 5px;
- text-decoration: underline;
- display: block;
-}
-
-#page-engine .system-message p.help em {
- width: 240px;
- text-decoration: underline;
- margin-left: 5px;
- float: left;
-}
-
-#page-engine .my-nick {
- font-weight: bold;
-}
-
-#page-engine .old-message {
- font-size: 11px !important;
- margin-bottom: 1px !important;
-}
-
-#page-engine .chatstate {
- background-color: rgb(234,234,234);
- background-color: rgba(234,234,234,0.8);
- color: #2c2c2c;
- padding: 3px 10px 2px 8px;
- position: absolute;
- bottom: 93px;
- left: 0;
- font-size: 0.75em;
- -moz-border-radius-topright: 3px;
- -webkit-border-top-right-radius: 3px;
- border-top-right-radius: 3px;
-}
-
-html[dir="rtl"] #page-engine .chatstate {
- left: auto;
- right: 0;
- -moz-border-radius-topleft: 3px;
- -moz-border-radius-topright: 0;
- -webkit-border-top-left-radius: 3px;
- -webkit-border-top-right-radius: 0;
- border-top-left-radius: 3px;
- border-top-right-radius: 0;
-}
-
-#page-engine .text {
- height: 93px;
- position: absolute;
- bottom: 0;
- left: 0;
- right: 0;
-}
-
-#page-engine .footer {
- background: #e8f1f3;
- background: -moz-linear-gradient(top, #dee8ea, #e8f1f3);
- background: -webkit-gradient(linear, left top, left bottom, from(#dee8ea), to(#e8f1f3));
- background: -webkit-linear-gradient(top, #dee8ea 0%, #e8f1f3 100%);
- background: -o-linear-gradient(top, #dee8ea 0%, #e8f1f3 100%);
- border-color: #d0d0d0;
- border-width: 1px 0 0;
- border-style: solid;
- color: black;
- position: absolute;
- left: 0;
- right: 0;
- padding: 6px;
- height: 16px;
-}
-
-#page-engine .chat .footer {
- border-width: 1px 0;
- position: static;
-}
-
-#page-engine .chat-tools-content {
- height: 16px;
- width: 16px;
- margin-right: 8px;
- float: left;
-}
-
-html[dir="rtl"] #page-engine .chat-tools-content {
- float: right;
-}
-
-#page-engine .tools-tooltip {
- display: block;
- height: 16px;
- width: 16px;
- overflow: hidden;
- float: left;
-}
-
-#page-engine .text .chat-tools-smileys {
- margin-left: 4px;
-}
-
-html[dir="rtl"] #page-engine .text .chat-tools-smileys {
- margin-left: 0;
-}
-
-#page-engine .text .chat-tools-file.mini .bubble-file {
- z-index: 39;
-}
-
-#page-engine .text .chat-tools-file.mini .tooltip-subitem {
- width: 22px;
- height: 20px;
-}
-
-#page-engine .text .chat-tools-file.mini .wait {
- margin: -2px 0 0 -1px;
-}
-
-#page-engine .text .tools-smileys {
- background-position: 0 -388px;
-}
-
-#page-engine .text .tools-style {
- background-position: 0 -700px;
-}
-
-#page-engine .text .tools-file {
- background-position: 0 -1956px;
-}
-
-#page-engine .text .tools-save {
- background-position: 0 -719px;
-}
-
-#page-engine .text .tools-clear {
- background-position: 0 -739px;
-}
-
-#page-engine .text .tools-infos,
-#channel .top div.shortcuts a.profile {
- background-position: 0 -758px;
-}
-
-#page-engine .text .tools-jingle-video {
- background-position: 0 -2048px;
-}
-
-#page-engine .text .tools-jingle-audio {
- background-position: 0 -2080px;
-}
-
-body.in_jingle_call #page-engine .text .tools-jingle-video,
-body.in_jingle_call #page-engine .text .tools-jingle-audio,
-body.in_muji_call #page-engine .text .tools-jingle-video,
-body.in_muji_call #page-engine .text .tools-jingle-audio {
- opacity: 0.35;
- cursor: default;
-}
-
-#page-engine .text .chat-tools-file,
-#page-engine .text .tools-add,
-#page-engine .text .tools-mucadmin,
-#page-engine .text .tools-jingle-video,
-#page-engine .text .tools-jingle-audio {
- display: none;
-}
-
-#page-engine .text .tools-mucadmin {
- background-position: 0 -777px;
-}
-
-#page-engine .bubble-style label {
- margin: 0 0 3px 0 !important;
-}
-
-#page-engine .bubble-style label.font {
- height: 14px !important;
-}
-
-#page-engine .bubble-style label.font div.font-icon {
- background-position: 0 -1978px;
- width: 14px;
- height: 11px;
- float: left;
-}
-
-#page-engine .bubble-style label.font div.font-change,
-#page-engine .bubble-style label.font div.fontsize-change {
- position: absolute;
-}
-
-#page-engine .bubble-style label.font div.font-change {
- left: 59px;
-}
-
-#page-engine .bubble-style label.font div.fontsize-change {
- left: 28px;
-}
-
-#page-engine .bubble-style label.font div.font-change a.font-current,
-#page-engine .bubble-style label.font div.fontsize-change a.fontsize-current {
- text-decoration: none;
- float: left;
-}
-
-#page-engine .bubble-style label.font div.font-change a.font-current {
- width: 140px;
-}
-
-#page-engine .bubble-style label.font div.fontsize-change a.fontsize-current {
- width: 25px;
-}
-
-#page-engine .bubble-style label.font div.font-change a.font-current:hover,
-#page-engine .bubble-style label.font div.font-change a.font-current:focus,
-#page-engine .bubble-style label.font div.fontsize-change a.fontsize-current:hover,
-#page-engine .bubble-style label.font div.fontsize-change a.fontsize-current:focus {
- text-decoration: underline;
-}
-
-#page-engine .bubble-style label.font div.font-change.listed,
-#page-engine .bubble-style label.font div.fontsize-change.listed {
- margin-bottom: 15px;
-}
-
-#page-engine .bubble-style label.font div.font-change div.font-list,
-#page-engine .bubble-style label.font div.font-change.listed a.font-current,
-#page-engine .bubble-style label.font div.fontsize-change div.fontsize-list,
-#page-engine .bubble-style label.font div.fontsize-change.listed a.fontsize-current,
-#page-engine .bubble-style div.color-picker div.color-hex {
- border-style: solid;
- border-color: black;
- background: white;
- -moz-box-shadow: 0 0 5px #5f5f5f;
- -webkit-box-shadow: 0 0 5px #5f5f5f;
- box-shadow: 0 0 5px #5f5f5f;
-}
-
-#page-engine .bubble-style label.font div.font-change.listed a.font-current,
-#page-engine .bubble-style label.font div.fontsize-change.listed a.fontsize-current {
- background: rgb(255,255,255);
- background: rgba(255,255,255, 0.8);
- border-width: 0 1px 1px 1px;
- color: black;
- text-shadow: none;
- text-decoration: none;
- padding: 2px 6px;
- position: absolute;
- top: -2px;
- left: -7px;
- z-index: 2;
- -moz-border-radius-bottomright: 2px;
- -moz-border-radius-bottomleft: 2px;
- -webkit-border-bottom-right-radius: 2px;
- -webkit-border-bottom-left-radius: 2px;
- border-bottom-right-radius: 2px;
- border-bottom-left-radius: 2px;
-}
-
-#page-engine .bubble-style label.font div.font-change.listed a.font-current {
- width: 133px;
-}
-
-#page-engine .bubble-style label.font div.fontsize-change.listed a.fontsize-current {
- width: 18px;
-}
-
-#page-engine .bubble-style label.font div.font-change div.font-list,
-#page-engine .bubble-style label.font div.fontsize-change div.fontsize-list,
-#page-engine .bubble-style div.color-picker div.color-hex {
- background: rgb(255,255,255);
- background: rgba(255,255,255, 0.9);
- border-width: 1px 1px 0 1px;
- padding: 2px 0;
- overflow: auto;
- position: absolute;
- bottom: 2px;
- left: -7px;
- z-index: 1;
- display: none;
- -moz-border-radius-topright: 2px;
- -moz-border-radius-topleft: 2px;
- -webkit-border-top-right-radius: 2px;
- -webkit-border-top-left-radius: 2px;
- border-top-right-radius: 2px;
- border-top-left-radius: 2px;
-}
-
-#page-engine .bubble-style label.font div.font-change div.font-list {
- width: 145px;
- height: 250px;
-}
-
-#page-engine .bubble-style label.font div.fontsize-change div.fontsize-list {
- width: 30px;
-}
-
-#page-engine .bubble-style label.font div.font-change.listed div.font-list,
-#page-engine .bubble-style label.font div.fontsize-change.listed div.fontsize-list,
-#page-engine .bubble-style div.color-picker.opened div.color-hex {
- display: block;
-}
-
-#page-engine .bubble-style label.font div.font-change div.font-list a,
-#page-engine .bubble-style label.font div.fontsize-change div.fontsize-list a {
- font-size: 1em;
- text-shadow: none;
- font-weight: bold;
- text-decoration: none;
- color: black;
- padding: 3px 6px;
- display: block;
-}
-
-#page-engine .bubble-style label.font div.font-change div.font-list a:hover,
-#page-engine .bubble-style label.font div.font-change div.font-list a:focus,
-#page-engine .bubble-style label.font div.fontsize-change div.fontsize-list a:hover,
-#page-engine .bubble-style label.font div.fontsize-change div.fontsize-list a:focus {
- background-color: rgb(0,0,0);
- background-color: rgba(0,0,0, 0.8);
- color: white;
-}
-
-#page-engine .bubble-style label.font div.fontsize-change div.fontsize-list a.reset {
- background-position: 7px -2006px;
- height: 14px;
-}
-
-#page-engine .bubble-style label.font div.fontsize-change div.fontsize-list a.reset:hover,
-#page-engine .bubble-style label.font div.fontsize-change div.fontsize-list a.reset:focus {
- background-position: 7px -2025px;
-}
-
-#page-engine .bubble-style label.bold {
- font-weight: bold;
-}
-
-#page-engine .bubble-style label.italic {
- font-style: italic;
-}
-
-#page-engine .bubble-style label.underline {
- text-decoration: underline;
-}
-
-#page-engine .bubble-style a.color {
- height: 12px;
- width: 18px;
- border-color: white;
- border-width: 1px;
- border-style: solid;
- margin: 4px 5px 0 0;
- float: left;
- opacity: 0.6;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- -moz-box-shadow: 0 0 5px black;
- -webkit-box-shadow: 0 0 5px black;
- box-shadow: 0 0 5px black;
-}
-
-#page-engine .bubble-style a.color:hover,
-#page-engine .bubble-style a.color:focus {
- opacity: 0.7;
-}
-
-#page-engine .bubble-style a.color.selected {
- opacity: 1;
- border-color: #ffb20d;
-}
-
-#page-engine .bubble-style div.color-picker {
- margin-left: 4px;
- float: left;
- position: relative;
-}
-
-#page-engine .bubble-style div.color-picker a.color-more {
- background-position: 1px -1991px;
- height: 14px;
- width: 14px;
- margin-top: 4px;
- float: left;
-}
-
-#page-engine .bubble-style div.color-picker div.color-hex {
- border-width: 1px;
- width: 80px;
- height: auto;
- padding: 3px 5px;
- text-shadow: none;
- bottom: -5px;
- left: -52px;
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- border-radius: 2px;
-}
-
-#page-engine .bubble-style div.color-picker div.color-hex span.hex-begin,
-#page-engine .bubble-style div.color-picker div.color-hex input.hex-value {
- color: black;
- float: left;
-}
-
-#page-engine .bubble-style div.color-picker div.color-hex span.hex-begin {
- font-weight: bold;
- font-size: 1.2em;
- margin-right: 5px;
-}
-
-#page-engine .bubble-style div.color-picker div.color-hex input.hex-value {
- background: rgb(0,0,0);
- background: rgba(0,0,0,0.1);
- border: none;
- width: 60px;
-}
-
-#page-engine .bubble-file .tooltip-subitem {
- width: 240px;
-}
-
-#page-engine .bubble-file input[type="file"] {
- width: 220px;
-}
-
-#page-engine .bubble-file input[type="submit"],
-#page-engine .bubble-file input[type="reset"] {
- margin: 4px 4px 0 0;
-}
-
-#page-engine .text .compose,
-#page-engine .muc-ask,
-#page-engine .correction-toolbox {
- position: absolute;
- left: 0;
-}
-
-#page-engine .text .compose,
-#page-engine .correction-toolbox {
- top: 29px;
- bottom: 12px;
-}
-
-#page-engine .text .compose {
- right: 12px;
-}
-
-html[dir="rtl"] #page-engine .text .compose {
- right: 0;
- left: 12px;
-}
-
-#page-engine .text.correction-active .compose {
- left: 120px;
-}
-
-html[dir="rtl"] #page-engine .text.correction-active .compose {
- right: 120px;
-}
-
-#page-engine .correction-toolbox {
- width: 120px;
-}
-
-html[dir="rtl"] #page-engine .correction-toolbox {
- right: 0;
- left: auto;
-}
-
-#page-engine .correction-toolbox .correction-editing,
-#page-engine .correction-toolbox .correction-cancel {
- display: block;
- color: black;
- font-size: 0.8em;
- text-decoration: none;
- text-align: center;
- margin: 7px 12px;
- padding: 2px 5px;
-}
-
-#page-engine .correction-toolbox .correction-editing {
- font-weight: bold;
- margin-top: 8px;
-}
-
-#page-engine .correction-toolbox .correction-cancel {
- background: #d15e6b;
- border: 1px solid #cc273f;
- color: white;
- text-shadow: 0 1px 1px rgba(0,0,0,0.5);
-}
-
-#page-engine .muc-ask {
- right: 0;
- bottom: 0;
-}
-
-#page-engine .text textarea {
- border: 1px solid #c8c8c8;
- padding: 5px;
- height: 100%;
- width: 100%;
- font-size: 1.1em;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- -moz-border-radius-topright: 0;
- -moz-border-radius-topleft: 0;
- -webkit-border-top-right-radius: 0;
- -webkit-border-top-left-radius: 0;
- border-top-right-radius: 0;
- border-top-left-radius: 0;
-}
-
-#page-engine .text.correction-active textarea {
- -moz-border-radius-bottomleft: 0;
- -webkit-border-bottom-left-radius: 0;
- border-bottom-left-radius: 0;
-}
-
-html[dir="rtl"] #page-engine .text.correction-active textarea {
- -moz-border-radius-bottomleft: 3px;
- -webkit-border-bottom-left-radius: 3px;
- border-bottom-left-radius: 3px;
- -moz-border-radius-bottomright: 0;
- -webkit-border-bottom-right-radius: 0;
- border-bottom-right-radius: 0;
-}
-
-#page-engine .muc-ask {
- background-color: #e8f1f3;
- height: 64px;
- font-size: 0.9em;
- right: 0;
- z-index: 2;
- -moz-border-radius-bottomleft: 3px;
- -moz-border-radius-bottomright: 3px;
- -webkit-border-bottom-left-radius: 3px;
- -webkit-border-bottom-right-radius: 3px;
- border-bottom-left-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-
-#page-engine .muc-ask label {
- color: #224249;
- margin: 23px 10px 0 16px;
- font-weight: bold;
-}
-
-#page-engine .muc-ask input {
- width: 200px;
- margin: 19px 10px 0 10px;
- padding: 3px;
-}
-
-#page-engine .tooltip {
- position: absolute;
- bottom: 84px;
- margin-left: -13px;
- z-index: 40;
- font-size: 0.8em;
- color: white;
-}
-
-#page-engine .tooltip a {
- color: white;
- text-decoration: underline;
-}
-
-#page-engine .tooltip-subitem {
- background-color: rgb(0,0,0);
- background-color: rgba(0,0,0,0.8);
- padding: 10px;
- width: 200px;
- height: 110px;
- text-shadow: 0 1px 1px black;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- border-radius: 5px;
-}
-
-html[dir="rtl"] #page-engine .tooltip-subitem {
- margin-right: -10px;
-}
-
-#page-engine .tooltip-subarrow {
- background-position: 0 -251px;
- opacity: 0.8;
- height: 10px;
- width: 18px;
- margin-left: 12px;
-}
-
-html[dir="rtl"] #page-engine .tooltip-subarrow {
- margin-right: -1px;
- margin-left: auto;
-}
-
-#page-engine .tooltip .tooltip-top {
- margin-bottom: 8px;
- font-weight: bold;
-}
-
-#page-engine .tooltip label {
- margin-bottom: 4px;
- float: left;
- clear: both;
-}
-
-#page-engine .tooltip label input[type="checkbox"] {
- margin: 0 6px 0 0;
- float: left;
-}
-
-html[dir="rtl"] #page-engine .tooltip label input[type="checkbox"] {
- margin-left: 6px;
- margin-right: 0;
-}
-
-#page-engine .tooltip label.select {
- margin-top: 5px;
-}
-
-#page-engine .tooltip input,
-#page-engine .tooltip select {
- float: left;
-}
-
-html[dir="rtl"] #page-engine .tooltip input,
-html[dir="rtl"] #page-engine .tooltip select {
- float: right;
-}
-
-#page-engine .tooltip select {
- width: 100px;
-}
-
-#page-engine .tooltip .tooltip-actionlog:hover,
-#page-engine .tooltip .tooltip-actionlog:focus {
- cursor: pointer;
- text-decoration: underline;
-}
diff --git a/source/app/stylesheets/pageswitch.css b/source/app/stylesheets/pageswitch.css
deleted file mode 100644
index d4a2f46..0000000
--- a/source/app/stylesheets/pageswitch.css
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the page-switch CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#page-switch {
- position: absolute;
- top: 15px;
- left: 10px;
- right: 10px;
- z-index: 9;
-}
-
-#page-switch .chans {
- position: absolute;
- left: 0;
- right: 50px;
- top: 0;
- height: 25px;
- overflow: hidden;
-}
-
-html[dir="rtl"] #page-switch .chans {
- right: 0;
- left: 40px;
-}
-
-#page-switch .join,
-#page-switch .more {
- position: absolute;
- top: 0;
-}
-
-#page-switch .join {
- right: 25px;
-}
-
-html[dir="rtl"] #page-switch .join {
- left: 25px;
-}
-
-#page-switch .more {
- right: 0;
-}
-
-html[dir="rtl"] #page-switch .more {
- right: auto;
- left: 0;
-}
-
-#page-switch .join-button,
-#page-switch .more-button {
- background-color: #d9e7ea;
- width: 7px;
- height: 16px;
- padding: 1px 6px;
- font-size: 0.9em;
- text-decoration: none;
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- border-radius: 2px;
-}
-
-#page-switch .join-button {
- background-position: 4px -2136px;
-}
-
-#page-switch .more-button {
- background-position: 6px -1372px;
-}
-
-#page-switch .join-content,
-#page-switch .more-content {
- background-color: #d9e7ea;
- width: 200px;
- max-height: 400px;
- overflow: auto;
- position: absolute;
- margin: -2px 0 0 -181px;
- padding: 4px 0;
- font-size: 0.95em;
- -moz-border-radius-topleft: 3px;
- -moz-border-radius-bottomleft: 3px;
- -moz-border-radius-bottomright: 3px;
- -webkit-border-top-left-radius: 3px;
- -webkit-border-bottom-left-radius: 3px;
- -webkit-border-bottom-right-radius: 3px;
- border-top-left-radius: 3px;
- border-bottom-left-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-
-html[dir="rtl"] #page-switch .join-content,
-html[dir="rtl"] #page-switch .more-content {
- margin-left: 0;
- left: 0;
- -moz-border-radius-topright: 3px;
- -moz-border-radius-topleft: 0;
- -webkit-border-top-right-radius: 3px;
- -webkit-border-top-left-radius: 0;
- border-top-right-radius: 3px;
- border-top-left-radius: 0;
-}
-
-#page-switch .join-content input.join-groupchat-xid {
- margin: 0 0 0 6px;
- width: 170px;
-}
-
-#page-switch .switcher {
- background-color: #d9e7ea;
- color: #17353b;
- height: 15px;
- padding: 5px 10px 5px 5px;
- margin: 0 2px;
- font-size: 0.85em;
- float: left;
- -moz-border-radius-topright: 3px;
- -moz-border-radius-topleft: 3px;
- -webkit-border-top-right-radius: 3px;
- -webkit-border-top-left-radius: 3px;
- border-top-right-radius: 3px;
- border-top-left-radius: 3px;
-}
-
-html[dir="rtl"] #page-switch .switcher {
- padding-left: 10px;
- padding-right: 5px;
- float: right;
-}
-
-#page-switch .more-content .switcher {
- background-color: #d9e7ea;
- float: none !important;
- margin: 0;
- font-size: 0.9em;
- -moz-border-radius: 0;
- -webkit-border-radius: 0;
- border-radius: 0;
-}
-
-#page-switch .more-content .switcher .exit {
- display: block;
-}
-
-#page-switch .join-button:hover,
-#page-switch .join-button:focus,
-#page-switch .more-button:hover,
-#page-switch .more-button:focus,
-#page-switch .switcher:hover,
-#page-switch .switcher:focus,
-#page-switch .more-content .switcher:hover,
-#page-switch .more-content .switcher:focus {
- background-color: #cedee1;
- cursor: pointer;
-}
-
-#page-switch .join-button:active,
-#page-switch .more-button:active,
-#page-switch .switcher:active,
-#page-switch .more-content .switcher:active {
- background-color: #c3d3d7;
-}
-
-#page-switch .switcher.activechan {
- background-color: #e8f1f3;
-}
-
-#page-switch .more-content .switcher.activechan {
- background-color: #d1e0e3;
-}
-
-#page-switch .icon {
- height: 16px;
- width: 16px;
- float: left;
-}
-
-html[dir="rtl"] #page-switch .icon {
- float: right;
-}
-
-#page-switch .name {
- float: left;
- margin-left: 4px;
- max-height: 16px;
- max-width: 140px;
- overflow: hidden;
-}
-
-html[dir="rtl"] #page-switch .name {
- float: right;
- margin-left: 0;
- margin-right: 4px;
-}
-
-#page-switch .exit {
- display: none;
- background-color: #bdd9dc;
- border: 1px solid #80aab0;
- color: #355e64;
- height: 14px;
- width: 13px;
- margin-left: 10px;
- font-size: 0.85em;
- text-align: center;
- text-decoration: none;
- float: right;
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- border-radius: 2px;
-}
-
-html[dir="rtl"] #page-switch .exit {
- margin-left: 0;
- margin-right: 10px;
- float: left;
-}
-
-#page-switch .exit:hover,
-#page-switch .exit:focus {
- background-color: #aac7cb;
-}
-
-#page-switch .exit:active {
- background-color: #9bbdc1;
-}
-
-#page-switch .activechan .exit {
- display: block;
- float: right;
-}
-
-html[dir="rtl"] #page-switch .activechan .exit {
- float: left;
-}
-
-#page-switch .chan-newmessage {
- background-color: #f6edc3 !important;
-}
-
-#page-switch .chan-newmessage:hover,
-#page-switch .chan-newmessage:focus {
- background-color: #f1eac0 !important;
-}
-
-#page-switch .chan-newmessage:active {
- background-color: #ede4b8 !important;
-}
-
-#page-switch .composing,
-#page-engine .list .user.composing {
- color: #217021 !important;
-}
-
-#page-switch .paused,
-#page-switch .chan-unread .name,
-#page-engine .list .user.paused {
- color: #2431ac !important;
-}
-
-#page-switch .active,
-#page-engine .list .user.active {
- color: #353535 !important;
-}
-
-#page-switch .inactive,
-#page-engine .list .user.inactive {
- color: #585858 !important;
-}
-
-#page-switch .gone {
- color: #851313 !important;
-}
-
-#page-switch .channel .icon {
- background-position: 0 -55px;
-}
diff --git a/source/app/stylesheets/popup.css b/source/app/stylesheets/popup.css
deleted file mode 100644
index 0a9ecab..0000000
--- a/source/app/stylesheets/popup.css
+++ /dev/null
@@ -1,719 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the popup CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-.lock {
- background-color: rgb(0,0,0);
- background-color: rgba(0,0,0,0.6);
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- position: fixed;
- z-index: 9999;
-}
-
-.popup {
- background-color: rgb(20,20,20);
- background-color: rgba(20,20,20,0.95);
- margin-top: -250px;
- margin-left: -330px;
- width: 640px;
- height: 500px;
- padding: 0 10px;
- position: absolute;
- z-index: 10000;
- left: 50%;
- top: 50%;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- border-radius: 5px;
- -moz-box-shadow: 0 0 35px #232323;
- -webkit-box-shadow: 0 0 35px #232323;
- box-shadow: 0 0 35px #232323;
-}
-
-.popup.large {
- margin-left: -460px;
- width: 920px;
-}
-
-.popup .top {
- width: 600px;
- height: 45px;
- font-size: 1.2em;
- padding-top: 9px;
- color: white;
- margin: 14px 0 0 40px;
- text-transform: uppercase;
- text-decoration: none;
- font-weight: bold;
- text-shadow: 0 2px 2px black;
-}
-
-html[dir="rtl"] .popup .top {
- margin-right: 40px;
- margin-left: auto;
-}
-
-.popup .tab {
- width: 620px;
- height: 25px;
- margin: -5px 10px 0 10px;
- position: relative;
- z-index: 1;
-}
-
-.popup .tab a {
- background-color: #d9e7ea;
- color: #204249;
- width: 180px;
- height: 17px;
- padding: 4px 4px 4px 16px;
- margin-left: 5px;
- font-size: 0.94em;
- overflow: hidden;
- float: left;
- -moz-border-radius-topright: 3px;
- -moz-border-radius-topleft: 3px;
- -webkit-border-top-right-radius: 3px;
- -webkit-border-top-left-radius: 3px;
- border-top-right-radius: 3px;
- border-top-left-radius: 3px;
-}
-
-html[dir="rtl"] .popup .tab a {
- margin-left: 0;
- margin-right: 5px;
- padding-left: 4px;
- padding-right: 16px;
- float: right;
-}
-
-.popup .tab a:hover,
-.popup .tab a:focus {
- background-color: #cedee1;
- text-decoration: none;
-}
-
-.popup .tab a:active {
- background-color: #c3d3d7;
- text-decoration: none;
-}
-
-.popup .tab a.tab-active {
- background-color: #e4eef9 !important;
-}
-
-.popup .one-lap {
- display: none;
-}
-
-.popup .one-lap.lap-active {
- display: block;
-}
-
-.popup .content {
- background: #e4eef9;
- background: -moz-linear-gradient(top, #e4eef9, #d0e5fa);
- background: -webkit-gradient(linear, left top, left bottom, from(#e4eef9), to(#d0e5fa));
- background: -webkit-linear-gradient(top, #e4eef9 0%, #d0e5fa 100%);
- background: -o-linear-gradient(top, #e4eef9 0%, #d0e5fa 100%);
- height: 358px;
- width: 640px;
- position: absolute;
- left: 10px;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- -moz-box-shadow: 0 0 20px black;
- -webkit-box-shadow: 0 0 20px black;
- box-shadow: 0 0 20px black;
-}
-
-.popup .content,
-.popup .content a {
- color: #112a2f;
-}
-
-.popup.large div.comments {
- background-color: #f4f4f4;
- width: 272px;
- margin: 0;
- position: absolute;
- right: 10px;
- top: 63px;
- bottom: 10px;
- overflow-x: hidden;
- overflow-y: auto;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-
-.popup.large div.comments div.comments-content {
- font-size: 0.8em;
-}
-
-.popup.large div.comments input {
- width: 185px;
- min-width: 0;
-}
-
-.popup.large div.comments .one-comment {
- padding-bottom: 4px;
-}
-
-.popup.large div.comments .one-comment a {
- text-decoration: underline;
-}
-
-.popup.large div.comments div.comments-content {
- -moz-border-radius-topright: 3px;
- -moz-border-radius-topleft: 3px;
- -webkit-border-top-right-radius: 3px;
- -webkit-border-top-left-radius: 3px;
- border-top-right-radius: 3px;
- border-top-left-radius: 3px;
-}
-
-.popup .head {
- background: #f1f6fd;
- border: 1px #9dc4fc solid;
- width: 606px;
- height: 24px;
- margin: 0 10px 10px 10px;
- padding: 6px;
-}
-
-.popup .head-text {
- float: left;
- font-size: 0.9em;
- margin: 3px;
-}
-
-html[dir="rtl"] .popup .head-text {
- float: right;
-}
-
-.popup .head-actions {
- float: right;
- margin-top: 2px;
-}
-
-html[dir="rtl"] .popup .head-actions {
- float: left;
-}
-
-.popup .head-actions a {
- font-size: 0.9em;
- margin: 0 4px;
-}
-
-.popup .actions a {
- color: #30575f;
- font-size: 0.9em;
- margin-left: 5px;
-}
-
-.popup .head .head-input {
- float: right;
- width: 200px;
- padding: 2px;
-}
-
-html[dir="rtl"] .popup .head .head-input {
- float: left;
-}
-
-.popup .head .head-select {
- float: right;
- height: 24px;
-}
-
-html[dir="rtl"] .popup .head .head-select {
- float: left;
-}
-
-.popup .forms {
- font-size: 13.4px;
- width: 390px;
- height: 328px;
- margin: 15px;
- float: left;
-}
-
-.popup fieldset {
- border: 1px #547177 solid;
- margin: 0 0 15px 0;
- padding: 8px 2px 3px 2px;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-
-.popup legend {
- font-size: 0.9em;
- margin: 0 0 0 15px;
- padding: 0 2px;
- text-transform: uppercase;
-}
-
-.popup label {
- color: #1b1b1b;
- width: 150px;
- margin: 0 0 10px 12px;
- clear: both;
- float: left;
-}
-
-html[dir="rtl"] .popup label {
- margin-left: auto;
- margin-right: 12px;
- float: right;
-}
-
-.popup input,
-.popup select {
- margin: 0 10px 10px 0;
- float: left;
-}
-
-html[dir="rtl"] .popup input,
-html[dir="rtl"] .popup select {
- margin-right: 0;
- margin-left: 10px;
- float: right;
-}
-
-.popup input[type="text"] {
- min-width: 174px;
-}
-
-.popup select {
- min-height: 20px;
-}
-
-.popup .results {
- height: 310px;
- width: 620px;
- margin: -5px 0 0 10px;
- padding: 6px 0 0 0;
- overflow: auto;
-}
-
-html[dir="rtl"] .popup .results {
- margin-left: auto;
- margin-right: 10px;
-}
-
-.popup .results .no-results {
- margin: 6px 0;
- font-size: 0.85em;
- font-weight: bold;
-}
-
-.popup .results label {
- width: 180px;
- margin: 6px 4px 4px 4px;
-}
-
-.popup .results input,
-.popup .results textarea,
-.popup .results select {
- margin: 4px;
-}
-
-.popup .results input,
-.popup .results select {
- min-width: 180px;
-}
-
-.popup .results input[type="checkbox"],
-.popup .results input[type="radio"] {
- margin-top: 7px;
-}
-
-.popup .results textarea {
- width: 380px;
-}
-
-.popup .results .avatar-container {
- float: left;
- width: 60px;
- height: 60px;
- margin: 5px 12px 5px 9px;
- text-align: center;
- background-repeat: no-repeat;
-}
-
-html[dir="rtl"] .popup .results .avatar-container {
- margin-left: 12px;
- margin-right: 9px;
- float: right;
-}
-
-.popup .results img.avatar {
- max-width: 60px;
- max-height: 60px;
-}
-
-.popup .results .one-icon {
- height: 16px;
- width: 16px;
- margin: 10px 3px 0 8px;
- float: left;
-}
-
-html[dir="rtl"] .popup .results .one-icon {
- margin-left: 3px;
- margin-right: 8px;
- float: right;
-}
-
-.popup .results .one-icon.account,
-.popup .results .one-icon.auth {
- background-position: 0 -777px;
-}
-
-.popup .results .one-icon.automation,
-.popup .results .one-icon.client {
- background-position: 0 -1500px;
-}
-
-.popup .results .one-icon.collaboration {
- background-position: 0 -1520px;
-}
-
-.popup .results .one-icon.proxy,
-.popup .results .one-icon.server,
-.popup .results .one-icon.others {
- background-position: 0 -1540px;
-}
-
-.popup .results .one-icon.component,
-.popup .results .one-icon.gateway {
- background-position: 0 -1560px;
-}
-
-.popup .results .one-icon.conference {
- background-position: 0 -1082px;
-}
-
-.popup .results .one-icon.directory {
- background-position: 0 -876px;
-}
-
-.popup .results .one-icon.headline,
-.popup .results .one-icon.hierarchy {
- background-position: 0 -1580px;
-}
-
-.popup .results .one-icon.pubsub,
-.popup .results .one-icon.store {
- background-position: 0 -1600px;
-}
-
-.popup .results .one-icon.loading {
- background-position: 0 -1620px;
-}
-
-.popup .results .one-icon.down {
- background-position: 0 -1640px;
-}
-
-.popup .results .one-host {
- font-weight: bold;
- width: 170px;
-}
-
-html[dir="rtl"] .popup .results .one-host {
- float: right;
-}
-
-.popup .results .one-type {
- width: 210px;
-}
-
-.popup .results .one-type,
-.popup .results .one-host {
- float: left;
- overflow: hidden;
- margin: 9px 8px;
-}
-
-html[dir="rtl"] .popup .results .one-type,
-html[dir="rtl"] .popup .results .one-host {
- float: right;
-}
-
-.popup .results .one-jid,
-.popup .results .one-ctry,
-.popup .results .one-fn {
- margin: 4px;
- width: 400px;
-}
-
-html[dir="rtl"] .popup .results .one-jid,
-html[dir="rtl"] .popup .results .one-ctry,
-html[dir="rtl"] .popup .results .one-fn {
- float: right;
-}
-
-.popup .results .one-fn {
- font-weight: bold;
-}
-
-.popup .results .one-jid {
- margin-top: 8px;
- font-size: 0.9em;
-}
-
-.popup .results .one-name {
- float: left;
- margin: 4px;
-}
-
-html[dir="rtl"] .popup .results .one-name {
- float: right;
-}
-
-.popup a.one-button {
- display: none;
- background-color: #f1f6fd;
- border: 1px solid #b9cbcf;
- margin-top: 1px;
- padding: 4px 8px;
- text-decoration: none;
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- border-radius: 2px;
-}
-
-.popup a.one-button:hover,
-.popup a.one-button:focus {
- border: 1px solid #95b1b7;
-}
-
-.popup a.one-button:active {
- border: 1px solid #77989f;
-}
-
-.popup .results .oneresult:hover a.one-button {
- display: block;
-}
-
-.popup .results a.one-button,
-#inbox .one-message a.one-button {
- float: right;
- padding: 3px 6px;
- margin-right: 4px;
-}
-
-html[dir="rtl"] .popup .results a.one-button,
-html[dir="rtl"] #inbox .one-message a.one-button {
- float: left;
- margin-left: 4px;
- margin-right: auto;
-}
-
-.popup .results a.one-vjud {
- position: absolute;
- right: 4px;
-}
-
-html[dir="rtl"] .popup .results a.one-vjud {
- left: 4px;
- right: auto;
-}
-
-.popup .results a.one-add {
- top: 8px;
-}
-
-.popup .results a.one-chat,
-.popup .results a.one-profile {
- top: 42px;
-}
-
-.popup .results .one-next {
- float: right;
- margin: 4px 8px 4px 4px;
- font-weight: bold;
-}
-
-html[dir="rtl"] .popup .results .one-next {
- margin-right: 4px;
- margin-left: 8px;
- float: left;
-}
-
-.popup .results .one-actions {
- width: 148px;
- margin: 4px;
- float: left;
-}
-
-.popup .results .one-actions a {
- width: 16px;
- height: 16px;
- padding: 2px 2px 4px 5px !important;
- margin-top: 2px;
-}
-
-.popup .results .one-actions a.browse {
- background-position: 3px -1396px;
-}
-
-.popup .results .one-actions a.command {
- background-position: 3px -1415px;
-}
-
-.popup .results .one-actions a.subscribe {
- background-position: 4px -1435px;
-}
-
-.popup .results .one-actions a.join {
- background-position: 3px -1455px;
-}
-
-.popup .results .one-actions a.search {
- background-position: 4px -1475px;
-}
-
-.popup .results a.submit,
-.popup .results a.cancel,
-.popup .results a.back {
- margin-right: 8px;
- float: right;
-}
-
-.popup .onetitle {
- font-size: 0.9em;
- padding: 4px;
- font-weight: bold;
-}
-
-.popup .oneinstructions {
- font-size: 0.9em;
- padding: 4px;
- margin: 8px 0;
-}
-
-.popup .oneresult {
- font-size: 0.9em;
- padding: 3px 0 4px 4px;
- border-bottom: 1px #9dc4fc solid;
- overflow: hidden;
- position: relative;
-}
-
-.popup .oneresult:hover {
- background: #e9f1fd;
-}
-
-.popup .oneresult[onclick]:hover {
- cursor: pointer;
-}
-
-.popup .oneresult[onclick]:active {
- background: #f1f6fd;
-}
-
-.popup .infos {
- background-color: rgb(255,239,104);
- background-color: rgba(255,239,104,0.8);
- border: 1px #decb2f solid;
- color: #3f3f3f;
- padding: 8px;
- margin: 10px;
- font-size: 0.8em;
-}
-
-.popup .infos p {
- margin-top: 10px;
-}
-
-.popup .infos p.infos-title {
- font-weight: bold;
-}
-
-.popup .bottom {
- width: 640px;
- height: 40px;
- position: absolute;
- bottom: 8px;
-}
-
-.popup .wait {
- display: none;
- margin: 8px 0 0 3px;
- float: left;
-}
-
-a.finish,
-#suggest a.next {
- border: 1px solid white;
- background-color: rgb(255,255,255);
- background-color: rgba(255,255,255,0.1);
- color: white;
- padding: 4px 8px;
- margin-right: 7px;
- font-size: 0.95em;
- text-align: center;
- text-decoration: none;
- text-shadow: 0 1px 1px black;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- -moz-box-shadow: 0 0 5px black;
- -webkit-box-shadow: 0 0 5px black;
- box-shadow: 0 0 5px black;
-}
-
-a.finish:hover,
-a.finish:focus,
-#suggest a.next:hover,
-#suggest a.next:focus {
- cursor: pointer;
- background-color: rgb(255,255,255);
- background-color: rgba(255,255,255,0.2);
- -moz-box-shadow: 0 0 15px black;
- -webkit-box-shadow: 0 0 15px black;
- box-shadow: 0 0 15px black;
-}
-
-a.finish:active,
-#suggest a.next:active {
- background-color: rgb(255,255,255);
- background-color: rgba(255,255,255,0.3);
-}
-
-a.finish.disabled,
-#suggest a.next.disabled {
- opacity: 0.2;
-}
-
-a.finish.disabled:hover,
-a.finish.disabled:focus,
-a.finish.disabled:active,
-#suggest a.next.disabled:hover,
-#suggest a.next.disabled:focus,
-#suggest a.next.disabled:active {
- cursor: default;
- background-color: rgb(255,255,255);
- background-color: rgba(255,255,255,0.1);
-}
-
-.popup a.finish {
- margin-top: 6px;
- float: right;
-}
diff --git a/source/app/stylesheets/privacy.css b/source/app/stylesheets/privacy.css
deleted file mode 100644
index 8de88c8..0000000
--- a/source/app/stylesheets/privacy.css
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the privacy CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#privacy .content {
- padding: 10px 0 10px 0;
-}
-
-#privacy .privacy-head div.list-left,
-#privacy .privacy-head div.list-center,
-#privacy .privacy-head div.list-right,
-#privacy .privacy-first {
- float: left;
-}
-
-html[dir="rtl"] #privacy .privacy-head div.list-left,
-html[dir="rtl"] #privacy .privacy-head div.list-center,
-html[dir="rtl"] #privacy .privacy-head div.list-right {
- float: right;
-}
-
-#privacy .privacy-head div.list-left {
- margin-left: 5px;
-}
-
-#privacy .privacy-head div.list-center {
- border-right: 1px dotted #1b393f;
- height: 24px;
- width: 1px;
- margin-right: 15px;
- padding-left: 18px;
-}
-
-#privacy .privacy-head span,
-#privacy .privacy-head a,
-#privacy .privacy-item span,
-#privacy .privacy-item a {
- float: left;
-}
-
-#privacy .privacy-head span {
- font-size: 0.9em;
- font-weight: bold;
- margin: 3px 10px 0 0;
-}
-
-html[dir="rtl"] #privacy .privacy-head span {
- margin-right: auto;
- margin-left: 10px;
- float: right;
-}
-
-#privacy .privacy-head input,
-#privacy .privacy-head select {
- width: 180px;
-}
-
-#privacy .privacy-head input {
- margin-top: 1px;
-}
-
-#privacy .privacy-head select {
- margin-bottom: 0;
- margin-top: 2px;
-}
-
-html[dir="rtl"] #privacy .privacy-head select {
- margin-right: 0;
- margin-left: 10px;
-}
-
-#privacy .privacy-item select {
- margin-top: -2px;
-}
-
-#privacy .privacy-head span.left-space {
- margin-left: 16px;
-}
-
-#privacy .privacy-head a,
-#privacy .privacy-item a {
- width: 20px;
- height: 20px;
- padding: 0;
- display: block;
-}
-
-#privacy .privacy-item a.item-add {
- background-position: 2px -1178px;
-}
-
-#privacy .privacy-head a.list-remove,
-#privacy .privacy-item a.item-remove {
- background-position: 2px -1197px;
-}
-
-#privacy .privacy-item a.item-save {
- background-position: 3px -126px;
- width: auto;
- height: 19px;
- padding: 1px 7px 0 21px;
-}
-
-#privacy .privacy-item,
-#privacy form,
-#privacy .privacy-active {
- clear: both;
-}
-
-#privacy .privacy-item {
- margin: 17px 12px;
- font-size: 0.9em;
-}
-
-#privacy .privacy-item span {
- font-weight: bold;
-}
-
-html[dir="rtl"] #privacy .privacy-item span {
- margin-top: -5px;
- float: right;
-}
-
-#privacy .privacy-item select {
- width: 300px;
- margin: -4px 30px 0 10px;
-}
-
-html[dir="rtl"] #privacy .privacy-item select {
- margin-right: 10px;
- margin-left: 30px;
-}
-
-#privacy .privacy-item a {
- margin: -2px 6px 0 0;
-}
-
-html[dir="rtl"] #privacy .privacy-form input {
- margin-right: auto;
- margin-left: 10px;
-}
-
-#privacy .privacy-first,
-#privacy .privacy-second,
-#privacy .privacy-third {
- height: 195px;
- font-size: 0.9em;
- margin: 10px 0 0 10px;
- float: left;
-}
-
-html[dir="rtl"] #privacy .privacy-first,
-html[dir="rtl"] #privacy .privacy-second,
-html[dir="rtl"] #privacy .privacy-third {
- margin-right: 10px;
- margin-left: auto;
- float: right;
-}
-
-#privacy .privacy-first,
-#privacy .privacy-second {
- border-width: 0 1px 0 0;
- border-style: dotted;
- border-color: #1b393f;
- padding-right: 14px;
-}
-
-html[dir="rtl"] #privacy .privacy-first,
-html[dir="rtl"] #privacy .privacy-second {
- border-width: 0 0 0 1px;
-}
-
-#privacy .privacy-first {
- width: 125px;
-}
-
-#privacy .privacy-first label {
- margin: 50px 0 0 15px;
-}
-
-#privacy .privacy-first label input {
- margin-top: 2px;
-}
-
-#privacy .privacy-second {
- width: 205px;
-}
-
-#privacy .privacy-second label {
- margin: 2px 0 0 12px;
-}
-
-#privacy .privacy-second input[type="radio"],
-#privacy .privacy-third input[type="checkbox"] {
- margin-top: 2px;
- margin-bottom: 2px;
-}
-
-#privacy .privacy-second input[type="text"],
-#privacy .privacy-second select {
- width: 170px;
- margin: 2px 0 11px 12px;
- float: none;
-}
-
-#privacy .privacy-third label {
- width: auto;
- margin-top: 11px;
-}
-
-#privacy .privacy-third {
- width: 240px;
-}
-
-#privacy .privacy-active {
- margin: 34px 16px 0 16px;
- font-size: 0.9em;
-}
-
-#privacy .privacy-active-elements {
- float: right;
-}
-
-html[dir="rtl"] #privacy .privacy-active-elements {
- float: left;
-}
-
-#privacy .privacy-active input[type="text"] {
- width: 30px;
- margin: 0 0 0 8px;
- float: none;
-}
-
-html[dir="rtl"] #privacy .privacy-active input[type="text"] {
- margin-left: auto;
- margin-right: 8px;
-}
-
-#privacy .privacy-active input[type="checkbox"] {
- margin: 3px 5px 0 0;
- float: left;
-}
-
-html[dir="rtl"] #privacy .privacy-active input[type="checkbox"] {
- margin-left: 5px;
- margin-right: 14px;
- float: right;
-}
-
-#privacy .privacy-active label {
- width: auto;
- margin: 0 15px 0 0;
- clear: none;
-}
-
-html[dir="rtl"] #privacy .privacy-active label {
- margin-right: 0;
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/roster.css b/source/app/stylesheets/roster.css
deleted file mode 100644
index 7bd943f..0000000
--- a/source/app/stylesheets/roster.css
+++ /dev/null
@@ -1,645 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the roster CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#roster {
- background-color: rgb(20,20,20);
- background-color: rgba(20,20,20,0.85);
- color: #919191;
- padding: 15px 6px 4px 6px;
- -moz-border-radius: 4px;
- -webkit-border-radius: 4px;
- border-radius: 4px;
- -moz-box-shadow: 0 0 6px #5c5c5c;
- -webkit-box-shadow: 0 0 6px #5c5c5c;
- box-shadow: 0 0 6px #5c5c5c;
-}
-
-#roster .content {
- background: #e8f1f3;
- background: -moz-linear-gradient(top, #e8f1f3, #e4edef);
- background: -webkit-gradient(linear, left top, left bottom, from(#e8f1f3), to(#e4edef));
- background: -webkit-linear-gradient(top, #e8f1f3 0%, #e4edef 100%);
- background: -o-linear-gradient(top, #e8f1f3 0%, #e4edef 100%);
- color: #666666;
- height: 207px;
- padding: 4px 4px 0 4px;
- overflow-x: hidden;
- overflow-y: auto;
- -moz-border-radius-topleft: 3px;
- -moz-border-radius-topright: 3px;
- -webkit-border-top-left-radius: 3px;
- -webkit-border-top-right-radius: 3px;
- border-top-left-radius: 3px;
- border-top-right-radius: 3px;
-}
-
-#roster .one-group {
- margin-bottom: 10px;
-}
-
-#roster .one-group a.group {
- color: #202c2f;
- font-size: 0.8em;
- margin: 3px 6px;
- padding-left: 12px;
- max-height: 15px;
- text-decoration: none;
- overflow: hidden;
- display: block;
-}
-
-html[dir="rtl"] #roster .one-group a.group {
- float: right;
-}
-
-#roster .one-group a.group.plus {
- background-position: -4px -1143px;
-}
-
-#roster .one-group a.group.minus {
- background-position: -4px -1162px;
-}
-
-#roster .one-group a.group:hover {
- cursor: pointer;
-}
-
-#roster .hidden-buddy,
-#roster .foot-edit-finish,
-.buddy-conf-more-display-available {
- display: none;
-}
-
-#roster .group-buddy {
- clear: both;
-}
-
-#roster .buddy {
- width: 100%;
- height: 50px;
- margin-bottom: 4px;
- clear: both;
-}
-
-#roster .buddy-click {
- background: #d9e7ea;
- width: 100%;
- height: 100%;
- overflow: hidden;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-
-#roster .buddy-click:hover,
-#roster .buddy-click:focus {
- background: #cedee1;
- cursor: pointer;
-}
-
-#roster .buddy-click:active {
- background: #c3d3d7;
-}
-
-#roster .gateway {
- height: 27px;
-}
-
-#roster .gateway .name {
- margin-left: 0;
-}
-
-#roster .gateway .buddy-presence {
- float: left;
- overflow: hidden;
- width: 0;
- margin: 0 4px;
-}
-
-#roster .avatar-container {
- float: left;
- text-align: center;
- margin: 3px;
- width: 46px;
- height: 46px;
-}
-
-html[dir="rtl"] #roster .avatar-container {
- float: right;
-}
-
-#roster .avatar {
- max-width: 44px;
- max-height: 44px;
-}
-
-#roster .name {
- margin: 4px 3px 5px 56px;
-}
-
-html[dir="rtl"] #roster .name {
- margin-left: auto;
- float: right;
-}
-
-#roster .buddy-name {
- height: 17px;
- font-weight: bold;
- font-size: 0.85em;
- color: #264249;
- margin: 5px 0 5px 2px;
- overflow: hidden;
-}
-
-#roster .buddy.blocked p.buddy-name {
- text-decoration: line-through;
-}
-
-#roster .buddy-presence {
- height: 14px;
- font-size: 0.7em;
- color: #3a585e;
- padding: 2px 0 0 16px;
- margin-top: -3px;
-}
-
-html[dir="rtl"] #roster .buddy-presence {
- float: right;
-}
-
-#roster .unavailable,
-#page-switch .unavailable,
-#page-engine p.bc-infos span.show.unavailable {
- background-position: 0 -153px;
-}
-
-#roster .available,
-#page-engine p.bc-infos span.show.available,
-#page-engine .list .available,
-#page-engine .list .chat,
-#page-switch .available,
-#my-infos .f-presence a[data-value="available"] span {
- background-position: 0 -169px;
-}
-
-#roster .away,
-#page-engine p.bc-infos span.show.away,
-#page-engine .list .away,
-#page-switch .away,
-#my-infos .f-presence a[data-value="away"] span {
- background-position: 0 -185px;
-}
-
-#roster .busy,
-#page-engine p.bc-infos span.show.busy,
-#page-engine .list .xa,
-#page-engine .list .dnd,
-#page-switch .busy,
-#my-infos .f-presence a[data-value="xa"] span {
- background-position: 0 -201px;
-}
-
-#roster .error,
-#page-switch .error,
-#page-engine p.bc-infos span.show.error {
- background-position: 0 -217px;
-}
-
-#roster .buddy-infos {
- position: absolute;
- z-index: 100;
- width: 337px;
- color: white;
- font-size: 0.8em;
-}
-
-.buddy-infos-subarrow {
- background-position: 0 -241px;
- opacity: 0.8;
- width: 9px;
- height: 20px;
- margin-top: 12px;
- float: left;
-}
-
-html[dir="rtl"] .buddy-infos-subarrow {
- background-position: -10px -241px;
- float: right;
-}
-
-.buddy-infos-subitem {
- background-color: rgb(0,0,0);
- background-color: rgba(0,0,0,0.8);
- padding: 8px 10px;
- width: 308px;
- text-shadow: 0 1px 1px black;
- float: left;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- border-radius: 5px;
-}
-
-html[dir="rtl"] .buddy-infos-subitem {
- float: right;
-}
-
-.manage-infos p.bm-authorize,
-#rosterx .oneresult span.action.add {
- background-position: 0 -1181px;
-}
-
-.manage-infos p.bm-remove,
-#rosterx .oneresult span.action.delete,
-#attach div.one-file a.remove {
- background-position: 0 -1200px;
-}
-
-.manage-infos p.bm-remove {
- margin-bottom: 18px;
-}
-
-.manage-infos p.bm-rename {
- background-position: 0 -1216px;
-}
-
-.manage-infos p.bm-group {
- background-position: 0 -1241px;
-}
-
-.manage-infos div.bm-choose {
- max-height: 95px;
- margin: 0 0 8px 102px;
- overflow: auto;
-}
-
-.manage-infos div.bm-choose label {
- float: left;
- clear: both;
- margin-bottom: 1px;
-}
-
-.manage-infos div.bm-choose input {
- float: left;
-}
-
-.manage-infos div.bm-choose input[type="checkbox"] {
- margin: 0 6px 0 0;
-}
-
-.manage-infos div.bm-choose div {
- clear: both;
-}
-
-.manage-infos p.bm-rename,
-.manage-infos p.bm-group {
- height: 26px;
-}
-
-.manage-infos p.bm-rename label,
-.manage-infos p.bm-group label {
- width: 80px;
- padding-top: 3px;
- float: left;
-}
-
-html[dir="rtl"] .manage-infos p.bm-rename label,
-html[dir="rtl"] .manage-infos p.bm-group label {
- float: right;
-}
-
-.manage-infos p.bm-rename input,
-.manage-infos p.bm-group input {
- float: left;
- width: 155px;
-}
-
-html[dir="rtl"] .manage-infos p.bm-rename input,
-html[dir="rtl"] .manage-infos p.bm-group input {
- float: right;
-}
-
-.manage-infos a.save {
- float: right;
- margin: 4px;
-}
-
-.buddy-infos-subitem p {
- margin: 6px 0;
- padding-left: 22px;
- height: 16px;
- overflow: hidden;
-}
-
-.buddy-infos-subitem a {
- color: white;
- text-decoration: underline;
-}
-
-.tune-note {
- background-position: 0 -676px;
-}
-
-.location-world {
- background-position: 0 -658px;
-}
-
-.call-jingle {
- background-position: 1px -2047px;
-}
-
-body.in_jingle_call .call-jingle,
-body.in_muji_call .call-jingle,
-body.in_jingle_call .roster-muji,
-body.in_muji_call .roster-muji {
- opacity: 0.35;
-}
-
-.call-jingle,
-.call-jingle a.audio,
-.call-jingle a.video,
-.call-jingle span.separator {
- display: none;
-}
-
-body.in_jingle_call .call-jingle a,
-body.in_muji_call .call-jingle a,
-body.in_jingle_call .roster-muji a,
-body.in_muji_call .roster-muji a {
- cursor: default;
-}
-
-.view-individual {
- background-position: 0 -34px;
-}
-
-.edit-buddy {
- background-position: 0 -1008px;
-}
-
-#roster .filter {
- background-color: white;
- border-top: 1px solid #b8c2c4;
- height: 15px;
- padding: 2px 4px;
- font-size: 0.8em;
- -moz-border-radius-bottomleft: 3px;
- -moz-border-radius-bottomright: 3px;
- -webkit-border-bottom-left-radius: 3px;
- -webkit-border-bottom-right-radius: 3px;
- border-bottom-left-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-
-#roster .filter input {
- border: none;
- color: #273a3f;
- width: 211px;
- padding: 0;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-
-#roster .filter a {
- display: none;
- background-color: #9a2d2d;
- color: white;
- height: 13px;
- width: 13px;
- margin-top: 1px;
- font-size: 0.8em;
- text-align: center;
- text-decoration: none;
- float: right;
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- border-radius: 2px;
-}
-
-html[dir="rtl"] #roster .filter a {
- float: left;
-}
-
-#roster .filter a:hover,
-#roster .filter a:focus {
- background-color: #8c2121;
-}
-
-#roster .filter a:active {
- background-color: #7e1919;
-}
-
-#roster .foot {
- padding: 9px 1px 3px;
-}
-
-#roster .roster-icon {
- height: 16px;
- width: 16px;
- margin: -3px 5px 0 0;
- float: left;
- position: relative;
-}
-
-html[dir="rtl"] #roster .roster-icon {
- margin-right: 0;
- margin-left: 5px;
- float: right;
-}
-
-#roster .roster-icon a.talk-images {
- height: 16px;
- width: 16px;
- display: block;
-}
-
-#roster .add,
-#page-engine .text .tools-add {
- background-position: 0 -1047px;
-}
-
-#roster .join {
- background-position: 0 -1065px;
-}
-
-#roster .groupchat,
-#page-switch .groupchat-default {
- background-position: 0 -1082px;
-}
-
-#roster .muji {
- background-position: 0 -2047px;
-}
-
-#roster .more {
- background-position: 0 -1100px;
-}
-
-#roster .foot-edit-finish a {
- color: white;
- font-size: 0.8em;
- margin: -3px 4px 0 0;
- float: right;
- display: block;
-}
-
-#roster .foot-edit-finish a:hover,
-#roster .foot-edit-finish a:focus {
- text-decoration: underline;
- cursor: pointer;
-}
-
-.buddy-conf-item {
- position: absolute;
- left: -10px;
- width: 263px;
- color: white;
- z-index: 9998;
- font-size: 0.8em;
-}
-
-html[dir="rtl"] .buddy-conf-item {
- left: auto;
- right: -10px;
-}
-
-.buddy-conf-item:hover {
- cursor: default;
-}
-
-.buddy-conf-subarrow {
- background-position: 0 -241px;
- opacity: 0.8;
- height: 10px;
- width: 18px;
- margin-left: 9px;
- float: left;
-}
-
-html[dir="rtl"] .buddy-conf-subarrow {
- margin-left: auto;
- margin-right: 9px;
- float: right;
-}
-
-.buddy-conf-muji .buddy-conf-subarrow {
- margin-left: 8px;
-}
-
-html[dir="rtl"] .buddy-conf-muji .buddy-conf-subarrow {
- margin-right: 8px;
-}
-
-.buddy-conf-subitem {
- background-color: rgb(0,0,0);
- background-color: rgba(0,0,0,0.8);
- margin-top: 10px;
- padding: 10px;
- text-shadow: 0 1px 1px black;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- border-radius: 5px;
-}
-
-.buddy-conf-p {
- margin-bottom: 4px;
- width: 220px;
- font-weight: bold;
- float: left;
-}
-
-html[dir="rtl"] .buddy-conf-p {
- float: right;
-}
-
-.buddy-conf-input {
- padding-top: 2px;
-}
-
-.buddy-conf-text {
- font-size: 11px;
- clear: both;
- margin-bottom: 3px;
-}
-
-.buddy-conf-text a {
- color: white;
-}
-
-.buddy-conf-text a:hover,
-.buddy-conf-text a:focus {
- cursor: pointer;
- text-decoration: underline;
-}
-
-.buddy-conf-text a.buddy-conf-add-search {
- text-decoration: underline;
- margin-top: 6px;
- display: block;
-}
-
-.buddy-conf-select {
- font-size: 1.1em;
- clear: both;
- margin-bottom: 8px;
- width: 180px;
- height: 23px;
-}
-
-.join-jid {
- width: 220px;
- margin-top: 5px;
-}
-
-.add-contact-jid,
-.add-contact-name,
-.add-contact-gateway {
- width: 156px;
- margin-bottom: 4px;
-}
-
-.add-contact-name-get {
- font-size: 0.8em;
- display: none;
-}
-
-.buddy-conf-subitem label {
- clear: both;
-}
-
-.buddy-conf-subitem label span {
- width: 76px;
- height: 14px;
- margin-top: 3px;
- overflow: hidden;
- float: left;
-}
-
-html[dir="rtl"] .buddy-conf-subitem label span {
- float: right;
-}
-
-#buddy-conf-join ul {
- width: 224px;
- max-height: 160px;
- left: 10px;
- top: 50px;
-}
-
-html[dir="rtl"] #buddy-conf-join ul {
- left: auto;
- right: 10px;
-}
-
-.buddy-conf-join-select {
- margin: 8px 0 0 0;
-}
diff --git a/source/app/stylesheets/rosterx.css b/source/app/stylesheets/rosterx.css
deleted file mode 100644
index 26cce54..0000000
--- a/source/app/stylesheets/rosterx.css
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the Roster Item Exchange tool CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#rosterx .content {
- padding: 10px 0 10px 0;
-}
-
-#rosterx .rosterx-head a {
- font-size: 0.9em;
- margin: 3px 4px;
- float: left;
-}
-
-html[dir="rtl"] #rosterx .rosterx-head a {
- float: right;
-}
-
-#rosterx .oneresult:hover {
- cursor: pointer;
-}
-
-#rosterx .oneresult span {
- margin: 4px 5px 0 5px;
- overflow: hidden;
- float: left;
-}
-
-html[dir="rtl"] #rosterx .oneresult span {
- float: right;
-}
-
-#rosterx .oneresult span.name {
- width: 230px;
- font-weight: bold;
-}
-
-#rosterx .oneresult span.xid {
- width: 270px;
- font-size: 0.9em;
-}
-
-#rosterx .oneresult span.action {
- width: 16px;
- height: 16px;
- margin-top: 4px;
- float: right;
-}
-
-html[dir="rtl"] #rosterx .oneresult span.action {
- float: left;
-}
-
-#rosterx .oneresult span.action.modify {
- background-position: 0 -1244px;
-}
-
-html[dir="rtl"] #rosterx .oneresult input {
- margin-right: 10px;
- margin-left: 10px;
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/search.css b/source/app/stylesheets/search.css
deleted file mode 100644
index 497f522..0000000
--- a/source/app/stylesheets/search.css
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the search tool CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-.search {
- position: relative;
-}
-
-.search input.suggested {
- border-bottom: 1px solid white;
- -moz-border-radius-bottomright: 0;
- -moz-border-radius-bottomleft: 0;
- -webkit-border-bottom-right-radius: 0;
- -webkit-border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 0;
-}
-
-.search ul {
- background-color: rgb(255,255,255);
- background-color: rgba(255,255,255,0.9);
- border-color: #e1a014;
- border-style: solid;
- border-width: 0 1px 1px 1px;
- position: absolute;
- z-index: 1;
- padding: 3px 0;
- list-style: none;
- overflow: auto;
- -moz-border-radius-bottomright: 3px;
- -moz-border-radius-bottomleft: 3px;
- -webkit-border-bottom-right-radius: 3px;
- -webkit-border-bottom-left-radius: 3px;
- border-bottom-right-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-
-.search ul li {
- padding: 2px 6px;
- color: #3d3d3d;
- text-shadow: none;
-}
-
-.search ul li:hover {
- cursor: pointer;
-}
-
-.search ul li.hovered {
- background-color: rgb(225,160,20);
- background-color: rgba(225,160,20,0.3);
-}
diff --git a/source/app/stylesheets/smileys.css b/source/app/stylesheets/smileys.css
deleted file mode 100644
index 7dd3250..0000000
--- a/source/app/stylesheets/smileys.css
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the smileys CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-.emoticon {
- width: 16px;
- height: 16px;
-}
-
-a.emoticon {
- margin: 2px;
- float: left;
-}
-
-a.emoticon:hover,
-a.emoticon:focus {
- opacity: 0.8;
-}
-
-a.emoticon:active {
- opacity: 0.7;
-}
-
-img.emoticon {
- border: 0 none;
- vertical-align: bottom;
-}
-
-.emoticon-biggrin {
- background-position: 0 0;
-}
-
-.emoticon-devil {
- background-position: -16px 0;
-}
-
-.emoticon-coolglasses {
- background-position: -32px 0;
-}
-
-.emoticon-tongue {
- background-position: -48px 0;
-}
-
-.emoticon-smile {
- background-position: -64px 0;
-}
-
-.emoticon-wink {
- background-position: -80px 0;
-}
-
-.emoticon-blush {
- background-position: -96px 0;
-}
-
-.emoticon-stare {
- background-position: -112px 0;
-}
-
-.emoticon-frowning {
- background-position: -128px 0;
-}
-
-.emoticon-oh {
- background-position: -144px 0;
-}
-
-.emoticon-unhappy {
- background-position: -160px 0;
-}
-
-.emoticon-cry {
- background-position: -176px 0;
-}
-
-.emoticon-angry {
- background-position: -192px 0;
-}
-
-.emoticon-puke {
- background-position: -208px 0;
-}
-
-.emoticon-hugright {
- background-position: -224px 0;
-}
-
-.emoticon-hugleft {
- background-position: -240px 0;
-}
-
-.emoticon-lion {
- background-position: -256px 0;
-}
-
-.emoticon-pussy {
- background-position: -272px 0;
-}
-
-.emoticon-bat {
- background-position: -288px 0;
-}
-
-.emoticon-kiss {
- background-position: -304px 0;
-}
-
-.emoticon-heart {
- background-position: -320px 0;
-}
-
-.emoticon-brheart {
- background-position: -336px 0;
-}
-
-.emoticon-flower {
- background-position: -352px 0;
-}
-
-.emoticon-brflower {
- background-position: -368px 0;
-}
-
-.emoticon-thumbup {
- background-position: -384px 0;
-}
-
-.emoticon-thumbdown {
- background-position: -400px 0;
-}
-
-.emoticon-lamp {
- background-position: -416px 0;
-}
-
-.emoticon-coffee {
- background-position: -432px 0;
-}
-
-.emoticon-drink {
- background-position: -448px 0;
-}
-
-.emoticon-beer {
- background-position: -464px 0;
-}
-
-.emoticon-boy {
- background-position: -480px 0;
-}
-
-.emoticon-girl {
- background-position: -496px 0;
-}
-
-.emoticon-phone {
- background-position: -512px 0;
-}
-
-.emoticon-photo {
- background-position: -528px 0;
-}
-
-.emoticon-music {
- background-position: -544px 0;
-}
-
-.emoticon-cuffs {
- background-position: -560px 0;
-}
-
-.emoticon-mail {
- background-position: -576px 0;
-}
-
-.emoticon-rainbow {
- background-position: -592px 0;
-}
-
-.emoticon-star {
- background-position: -608px 0;
-}
-
-.emoticon-moon {
- background-position: -624px 0;
-}
diff --git a/source/app/stylesheets/stats-svg.css b/source/app/stylesheets/stats-svg.css
deleted file mode 100644
index ce4571a..0000000
--- a/source/app/stylesheets/stats-svg.css
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the SVG stats CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Erwan Briand, Valérian Saliou
-
-*/
-
-svg {
- background-color: #e8f1f3;
-}
-
-.refline {
- stroke: #596171;
- stroke-width: 2px;
-}
-
-.refleft {
- fill: #000000;
- font-family: "Inconsolata", "DejaVu Serif sans", Verdana, sans-serif;
- font-size: 8px;
-}
-
-.reftext {
- fill: #586070;
- font-family: "Inconsolata", "DejaVu Serif sans", Verdana, sans-serif;
- font-size: 10px;
-}
-
-.bubbletextblue,
-.bubbletextred {
- fill: none;
- font-family: "Inconsolata", "DejaVu Serif sans", Verdana, sans-serif;
- font-size: 8px;
- text-anchor: end;
-}
-
-.bluebar {
- fill: "#6C84C0";
- fill-opacity: "0.6";
-}
-
-.gbar:hover .bluebar {
- fill: #2A3F73;
-}
-
-.gbar:hover .redbar {
- fill: #C70705;
-}
-
-.gbar:hover #bubble {
- fill: white;
- stroke: grey;
-}
-
-.gbar:hover .bubbletextblue {
- fill: #2A3F73;
-}
-
-.gbar:hover .bubbletextred {
- fill: #C70705;
-}
-
-.gbar:hover .reftext {
- fill: #000000;
-}
diff --git a/source/app/stylesheets/tools.css b/source/app/stylesheets/tools.css
deleted file mode 100644
index 3411fae..0000000
--- a/source/app/stylesheets/tools.css
+++ /dev/null
@@ -1,736 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the tools CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#top-content .tools {
- background-color: rgb(232,241,243);
- background-color: rgba(232,241,243,0.6);
- padding: 3px 8px 5px 8px;
- min-width: 10px;
- height: 17px;
- -moz-border-radius-bottomleft: 4px;
- -moz-border-radius-bottomright: 4px;
- -webkit-border-bottom-left-radius: 4px;
- -webkit-border-bottom-right-radius: 4px;
- border-bottom-left-radius: 4px;
- border-bottom-right-radius: 4px;
-}
-
-#top-content .tools a {
- color: black;
- padding: 0 3px;
- margin: 0 1.5px;
-}
-
-#top-content .tools a:hover,
-#top-content .tools a:focus {
- cursor: pointer;
- text-decoration: underline;
-}
-
-#top-content .tools-logo {
- background-position: 9px 2px;
- width: 74px;
- float: left;
-}
-
-html[dir="rtl"] #top-content .tools-logo {
- float: right;
-}
-
-#top-content .tools-all {
- float: right;
- text-align: right;
- margin-left: 8px;
- font-size: 0.9em;
- color: black;
- position: relative;
-}
-
-html[dir="rtl"] #top-content .tools-all {
- margin-left: 0;
- margin-right: 8px;
- float: left;
-}
-
-#top-content .call {
- background-position: 7px -2114px;
- display: none;
-}
-
-#top-content .call .notify {
- margin-left: 0;
- left: -2px;
-}
-
-#top-content .call.video {
- background-position: 7px -2205px;
-}
-
-#top-content .call.active,
-#top-content .call.streaming {
- display: block;
-}
-
-#top-content .call.active {
- -webkit-animation: tool_active 1.5s infinite ease-in-out;
- -moz-animation: tool_active 1.5s infinite ease-in-out;
- -o-animation: tool_active 1.5s infinite ease-in-out;
- animation: tool_active 1.5s infinite ease-in-out;
-}
-
-#top-content .call.streaming {
- padding-left: 30px;
-}
-
-#top-content .call .streaming-items {
- display: none;
-}
-
-#top-content .call.streaming .streaming-items {
- display: block;
-}
-
-#top-content .call.streaming .streaming-items .counter {
- font-size: 11px;
- font-style: italic;
- font-weight: bold;
-}
-
-#top-content .call.streaming .streaming-items a.stop {
- background: #cc283f;
- border-left: 1px solid #a12032;
- color: #ffffff;
- font-size: 10px;
- text-shadow: 0 1px 1px #521019;
- text-transform: uppercase;
- text-decoration: none;
- margin: -3px -8px 0 8px;
- padding: 5px 6px 7px 6px;
- float: right;
- -moz-border-radius-bottomright: 4px;
- -webkit-border-bottom-right-radius: 4px;
- border-bottom-right-radius: 4px;
-}
-
-#top-content .call.streaming .streaming-items a.stop:active {
- background: #a92134;
- padding-top: 6px;
- padding-bottom: 6px;
- -webkit-box-shadow: 0 1px 3px #000000 inset;
- -moz-box-shadow: 0 1px 3px #000000 inset;
- box-shadow: 0 1px 3px #000000 inset;
-}
-
-#top-content .notifications {
- background-position: 7px -1264px;
-}
-
-#top-content .music {
- background-position: 6px -1286px;
-}
-
-#top-content .notifications:hover,
-#top-content .music:hover,
-#top-content .call.streaming.video:hover,
-.in_muji_call #top-content .call.streaming.audio:hover {
- cursor: pointer;
-}
-
-#top-content .music:hover,
-#top-content .notifications:hover,
-#top-content .call.streaming.video:hover,
-.in_muji_call #top-content .call.streaming.audio:hover,
-#top-content .music:focus,
-#top-content .notifications:focus,
-#top-content .call.streaming.video:focus,
-.in_muji_call #top-content .call.streaming.audio:focus {
- background-color: rgb(232,241,243);
- background-color: rgba(232,241,243,0.7);
-}
-
-#top-content .music:active,
-#top-content .notifications:active,
-#top-content .call.streaming.video:active,
-.in_muji_call #top-content .call.streaming.audio:active {
- background-color: rgb(232,241,243);
- background-color: rgba(232,241,243,0.8);
-}
-
-#top-content .actived,
-#top-content .actived:hover,
-#top-content .actived:focus,
-#top-content .actived:active {
- background-color: rgb(232,241,243) !important;
- background-color: rgba(232,241,243,0.9) !important;
-}
-
-#top-content .notify {
- background-color: #c60505;
- color: white;
- font-size: 0.7em;
- font-weight: bold;
- margin-left: -10px;
- padding: 1px 4px;
- position: absolute;
- bottom: -2px;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
-}
-
-html[dir="rtl"] #top-content .notify {
- margin-left: auto;
- margin-right: -10px;
-}
-
-#top-content .tools-content {
- display: none;
- position: absolute;
- top: 25px;
-}
-
-html[dir="rtl"] #top-content .tools-content {
- margin-left: 0;
- right: auto;
-}
-
-.tools-content-subarrow {
- background-position: 0 -241px;
- opacity: 0.8;
- height: 10px;
- width: 18px;
- margin: 0 auto;
- display: block;
-}
-
-.tools-content-subitem {
- background-color: rgb(0,0,0);
- background-color: rgba(0,0,0,0.8);
- padding: 14px 6px 6px 6px;
- clear: both;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- border-radius: 5px;
-}
-
-.notifications-content {
- width: 240px;
- right: -107px;
-}
-
-html[dir="rtl"] .notifications-content {
- left: -107px;
-}
-
-.notifications-content .tools-content-subitem {
- max-height: 250px;
- color: white;
- text-shadow: 0 1px 1px black;
- text-align: left;
- overflow-x: none;
- overflow-y: auto;
-}
-
-html[dir="rtl"] .notifications-content .tools-content-subitem {
- text-align: right;
-}
-
-.notifications-content .empty {
- color: white;
- font-size: 0.9em;
- text-decoration: underline;
- margin: -8px 4px 2px 0;
- display: none;
- float: right;
-}
-
-.notifications-content .nothing {
- font-size: 0.9em;
- margin: 5px;
-}
-
-.notifications-content .one-notification {
- padding: 6px 4px;
- font-size: 0.85em;
- clear: both;
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- border-radius: 2px;
-}
-
-.notifications-content .one-notification:hover,
-.notifications-content .one-notification:focus {
- background-color: rgb(255,255,255);
- background-color: rgba(255,255,255,0.1);
-}
-
-.notifications-content .one-notification:active {
- background-color: rgb(255,255,255);
- background-color: rgba(255,255,255,0.2);
-}
-
-.notifications-content .avatar-container {
- float: left;
- width: 40px;
- height: 40px;
- margin: 0 8px 8px 0;
- text-align: center;
- background-repeat: no-repeat;
-}
-
-html[dir="rtl"] .notifications-content .avatar-container {
- float: right;
- margin-right: auto;
- margin-left: 8px;
-}
-
-.notifications-content .avatar {
- max-width: 40px;
- max-height: 40px;
-}
-
-.notifications-content .notification-text,
-.notifications-content .notification-actions {
- margin-left: 48px;
- overflow: hidden;
-}
-
-html[dir="rtl"] .notifications-content .notification-text,
-html[dir="rtl"] .notifications-content .notification-actions {
- margin-left: auto;
-}
-
-.notifications-content .notification-actions {
- margin-top: 3px;
-}
-
-.notifications-content .notification-actions a {
- color: white;
- font-weight: bold;
- font-size: 0.9em;
- text-decoration: underline;
- margin-right: 8px;
-}
-
-.notifications-content .one-notification .notification-actions span.talk-images {
- background-position: 0 -1828px;
- width: 16px;
- height: 16px;
- margin: -1px 6px 0 0;
- float: left;
-}
-
-html[dir="rtl"] .notifications-content .one-notification .notification-actions span.talk-images {
- margin-right: auto;
- margin-left: 6px;
- float: right;
-}
-
-.notifications-content .one-notification[data-type="subscribe"] .notification-actions span.talk-images {
- background-position: 0 -1796px;
-}
-
-.notifications-content .one-notification[data-type="invite_room"] .notification-actions span.talk-images {
- background-position: 0 -1812px;
-}
-
-.notifications-content .one-notification[data-type="send"] .notification-actions span.talk-images,
-.notifications-content .one-notification[data-type="send_accept"] .notification-actions span.talk-images,
-.notifications-content .one-notification[data-type="send_reject"] .notification-actions span.talk-images,
-.notifications-content .one-notification[data-type="send_fail"] .notification-actions span.talk-images {
- background-position: 0 -1956px;
-}
-
-.notifications-content .one-notification[data-type="rosterx"] .notification-actions span.talk-images {
- background-position: 0 -1844px;
-}
-
-.notifications-content .one-notification[data-type="comment"] .notification-actions span.talk-images {
- background-position: 0 -1860px;
-}
-
-.notifications-content .one-notification[data-type="like"] .notification-actions span.talk-images {
- background-position: 0 -1876px;
-}
-
-.notifications-content .one-notification[data-type="quote"] .notification-actions span.talk-images {
- background-position: 0 -1892px;
-}
-
-.notifications-content .one-notification[data-type="wall"] .notification-actions span.talk-images {
- background-position: 0 -1908px;
-}
-
-.notifications-content .one-notification[data-type="photo"] .notification-actions span.talk-images {
- background-position: 0 -1924px;
-}
-
-.notifications-content .one-notification[data-type="video"] .notification-actions span.talk-images {
- background-position: 0 -1940px;
-}
-
-.notifications-content .one-notification[data-type="me_profile_new_success"] .notification-actions span.talk-images,
-.notifications-content .one-notification[data-type="me_profile_remove_success"] .notification-actions span.talk-images,
-.notifications-content .one-notification[data-type="me_profile_update_success"] .notification-actions span.talk-images {
- background-position: 0 -1660px;
-}
-
-.notifications-content .one-notification[data-type="me_profile_check_error"] .notification-actions span.talk-images {
- background-position: 0 -1640px;
-}
-
-.music-content {
- width: 220px;
- right: -97px;
-}
-
-html[dir="rtl"] .music-content {
- left: -97px;
-}
-
-.music-content .tools-content-subitem {
- height: 247px;
-}
-
-.music-content .player {
- background: #b5d5db;
- background: -moz-linear-gradient(top, #b5d5db, #adced4);
- background: -webkit-gradient(linear, left top, left bottom, from(#b5d5db), to(#adced4));
- background: -webkit-linear-gradient(top, #b5d5db 0%, #adced4 100%);
- background: -o-linear-gradient(top, #b5d5db 0%, #adced4 100%);
- height: 20px;
- padding: 2px 5px;
- -moz-border-radius-topright: 4px;
- -moz-border-radius-topleft: 4px;
- -webkit-border-top-right-radius: 4px;
- -webkit-border-top-left-radius: 4px;
- border-top-right-radius: 4px;
- border-top-left-radius: 4px;
-}
-
-.music-content .player a {
- margin: 2px;
- height: 16px;
- width: 16px;
- float: left;
-}
-
-html[dir="rtl"] .music-content .player a {
- float: right;
-}
-
-.music-content .player a:hover,
-.music-content .player a:focus {
- opacity: 0.8;
-}
-
-.music-content .player a:active {
- opacity: 0.6;
-}
-
-.music-content .stop {
- display: none;
- background-position: 0 -270px;
-}
-
-.music-content .list {
- background-color: #e8f1f3;
- height: 188px;
- padding: 5px;
- text-align: left;
- overflow-y: auto;
- overflow-x: hidden;
-}
-
-html[dir="rtl"] .music-content .list {
- text-align: right;
-}
-
-.music-content p.no-results {
- display: none;
- color: black;
- font-size: 0.9em;
-}
-
-.music-content div.special {
- padding-bottom: 2px;
- margin-bottom: 6px;
- border-bottom: 1px solid #c3d4d7;
-}
-
-.music-content .song {
- display: block;
- margin: 3px 0;
- font-size: 0.8em;
-}
-
-.music-content .playing {
- font-weight: bold;
-}
-
-.music-content .search {
- background-color: #e8f1f3;
- height: 25px;
- -moz-border-radius-bottomleft: 4px;
- -moz-border-radius-bottomright: 4px;
- -webkit-border-bottom-left-radius: 4px;
- -webkit-border-bottom-right-radius: 4px;
- border-bottom-left-radius: 4px;
- border-bottom-right-radius: 4px;
-}
-
-.music-content .search input {
- margin: 2px;
- width: 198px;
- height: 15px;
-}
-
-.call-content {
- text-shadow: none;
- width: 230px;
- right: -102px;
-}
-
-html[dir="rtl"] .call-content {
- left: -102px;
-}
-
-.call-content .tools-content-subitem {
- position: relative;
-}
-
-.call-content .call-notify {
- height: 90px;
-}
-
-.call-content .call-notify .avatar-pane {
- width: 100px;
- position: absolute;
- left: 0;
- top: 0;
- bottom: 0;
- -moz-border-radius-bottomleft: 4px;
- -moz-border-radius-topleft: 4px;
- -webkit-border-bottom-left-radius: 4px;
- -webkit-border-top-left-radius: 4px;
- border-bottom-left-radius: 4px;
- border-top-left-radius: 4px;
-}
-
-html[dir="rtl"] .call-content .call-notify .avatar-pane {
- left: auto;
- right: 0;
-}
-
-.call-content .call-notify .avatar-pane .avatar-container {
- overflow: hidden;
- position: absolute;
- left: 0;
- right: 0;
- bottom: 0;
- top: 0;
-}
-
-.call-content .call-notify .avatar-pane .avatar-container .avatar {
- min-height: 100%;
- max-height: 100%;
- min-width: 100%;
- -moz-border-radius-topleft: 5px;
- -moz-border-radius-bottomleft: 5px;
- -webkit-border-top-left-radius: 5px;
- -webkit-border-bottom-left-radius: 5px;
- border-top-left-radius: 5px;
- border-bottom-left-radius: 5px;
-}
-
-html[dir="rtl"] .call-content .call-notify .avatar-pane .avatar-container .avatar {
- -moz-border-radius: 0;
- -webkit-border-radius: 0;
- border-radius: 0;
- -moz-border-radius-topright: 5px;
- -moz-border-radius-bottomright: 5px;
- -webkit-border-top-right-radius: 5px;
- -webkit-border-bottom-right-radius: 5px;
- border-top-right-radius: 5px;
- border-bottom-right-radius: 5px;
-}
-
-.call-content .call-notify .avatar-pane .icon {
- opacity: 0.75;
- position: absolute;
- left: 8px;
- bottom: 8px;
-}
-
-.call-content .call-notify.notify-call_audio .avatar-pane .icon,
-.call-content .call-notify.notify-broadcast_audio .avatar-pane .icon {
- background-position: 0 -120px;
- width: 33px;
- height: 33px;
-}
-
-.call-content .call-notify.notify-call_video .avatar-pane .icon,
-.call-content .call-notify.notify-broadcast_video .avatar-pane .icon {
- background-position: 0 -154px;
- width: 33px;
- height: 22px;
-}
-
-.call-content .call-notify.notify-connecting .avatar-pane .icon {
- background-position: 0 -175px;
- width: 33px;
- height: 32px;
-}
-
-.call-content .call-notify.notify-error .avatar-pane .icon {
- background-position: 0 -207px;
- width: 33px;
- height: 31px;
-}
-
-.call-content .call-notify.notify-local_ended .avatar-pane .icon,
-.call-content .call-notify.notify-remote_ended .avatar-pane .icon {
- background-position: 0 -238px;
- width: 33px;
- height: 34px;
-}
-
-.call-content .call-notify .notification-content {
- color: #ffffff;
- text-align: left;
- text-shadow: 0 1px 1px rgb(0,0,0);
- text-shadow: 0 1px 1px rgba(0,0,0,0.75);
- padding: 10px 10px 0 10px;
- position: absolute;
- top: 0;
- bottom: 0;
- right: 0;
- left: 100px;
-}
-
-html[dir="rtl"] .call-content .call-notify .notification-content {
- text-align: right;
- right: 100px;
- left: 0;
-}
-
-.call-content .call-notify .notification-content .fullname,
-.call-content .call-notify .notification-content .text {
- display: block;
-}
-
-.call-content .call-notify .notification-content .fullname {
- font-weight: bold;
-}
-
-.call-content .call-notify .notification-content .text {
- font-size: 12px;
- text-transform: lowercase;
- margin-top: 2px;
-}
-
-.call-content .call-notify .notification-content .reply-buttons {
- text-align: center;
- padding-left: 10px;
- position: absolute;
- left: 0;
- right: 0;
- bottom: 20px;
-}
-
-html[dir="rtl"] .call-content .call-notify .notification-content .reply-buttons {
- padding-left: 0;
- padding-right: 10px;
-}
-
-.call-content .call-notify .notification-content .reply-buttons a.reply-button {
- margin-left: 4px;
- float: left;
-}
-
-html[dir="rtl"] .call-content .call-notify .notification-content .reply-buttons a.reply-button {
- margin-left: 0;
- margin-right: 4px;
- float: right;
-}
-
-.call-content .call-notify .notification-content .reply-buttons a.reply-button:active {
- margin-top: 0;
-}
-
-.call-content .call-notify .notification-content .reply-buttons a.reply-button.first {
- margin-left: 0;
-}
-
-html[dir="rtl"] .call-content .call-notify .notification-content .reply-buttons a.reply-button.first {
- margin-right: 0;
-}
-
-@-o-keyframes tool_active {
- 0% {
- background-color: rgb(232,241,243);
- background-color: rgba(232,241,243,0.6);
- }
- 50% {
- background-color: rgb(243,16,0);
- background-color: rgba(243,16,0,0.6);
- }
- 100% {
- background-color: rgb(232,241,243);
- background-color: rgba(232,241,243,0.6);
- }
-}
-
-@-moz-keyframes tool_active {
- 0% {
- background-color: rgb(232,241,243);
- background-color: rgba(232,241,243,0.6);
- }
- 50% {
- background-color: rgb(243,16,0);
- background-color: rgba(243,16,0,0.6);
- }
- 100% {
- background-color: rgb(232,241,243);
- background-color: rgba(232,241,243,0.6);
- }
-}
-
-@-webkit-keyframes tool_active {
- 0% {
- background-color: rgb(232,241,243);
- background-color: rgba(232,241,243,0.6);
- }
- 50% {
- background-color: rgb(243,16,0);
- background-color: rgba(243,16,0,0.6);
- }
- 100% {
- background-color: rgb(232,241,243);
- background-color: rgba(232,241,243,0.6);
- }
-}
-
-@keyframes tool_active {
- 0% {
- background-color: rgb(232,241,243);
- background-color: rgba(232,241,243,0.6);
- }
- 50% {
- background-color: rgb(243,16,0);
- background-color: rgba(243,16,0,0.6);
- }
- 100% {
- background-color: rgb(232,241,243);
- background-color: rgba(232,241,243,0.6);
- }
-}
diff --git a/source/app/stylesheets/userinfos.css b/source/app/stylesheets/userinfos.css
deleted file mode 100644
index 400d81a..0000000
--- a/source/app/stylesheets/userinfos.css
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the user-infos CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#userinfos .content {
- overflow: auto;
-}
-
-#userinfos .one-lap a {
- text-decoration: underline;
-}
-
-#userinfos .main-infos {
- margin: 20px 20px 8px 20px;
- height: 120px;
- background: white;
- position: relative;
- -moz-border-radius: 4px;
- -webkit-border-radius: 4px;
- border-radius: 4px;
-}
-
-#userinfos .avatar-container {
- float: left;
- text-align: center;
- margin: 20px 35px;
- width: 80px;
- height: 80px;
-}
-
-html[dir="rtl"] #userinfos .avatar-container {
- float: right;
-}
-
-#userinfos .avatar {
- max-width: 80px;
- max-height: 80px;
-}
-
-#userinfos h1,
-#userinfos h2,
-#userinfos h3 {
- width: 410px;
- overflow: hidden;
-}
-
-#userinfos h1 {
- font-size: 2em;
- padding-top: 12px;
- margin-bottom: 4px;
-}
-
-#userinfos h2 {
- color: #447079;
- font-size: 1.1em;
- margin-bottom: 10px;
-}
-
-#userinfos h3 {
- color: #6e8388;
- font-size: 0.8em;
-}
-
-#userinfos .main-infos div.shortcuts {
- position: absolute;
- top: 10px;
- right: 12px;
-}
-
-html[dir="rtl"] #userinfos .main-infos div.shortcuts {
- right: auto;
- left: 12px;
-}
-
-#userinfos .block-infos {
- margin: 7px 20px;
- float: left;
-}
-
-#userinfos .one-line {
- margin: 4px 0;
- font-size: 12px;
- float: left;
-}
-
-#userinfos .one-line b.line-label {
- width: 120px;
- float: left;
-}
-
-html[dir="rtl"] #userinfos .one-line b.line-label {
- float: right;
-}
-
-#userinfos .one-line span.reset-info {
- float: left;
- width: 460px;
-}
-
-html[dir="rtl"] #userinfos .one-line span.reset-info {
- float: right;
-}
-
-#userinfos textarea {
- margin: 30px 0 0 30px;
- width: 572px;
- height: 292px;
-}
-
-html[dir="rtl"] #userinfos textarea {
- margin-right: 30px;
- margin-left: auto;
-}
\ No newline at end of file
diff --git a/source/app/stylesheets/vcard.css b/source/app/stylesheets/vcard.css
deleted file mode 100644
index 52c7a08..0000000
--- a/source/app/stylesheets/vcard.css
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the vCard CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#vcard label {
- font-size: 0.94em;
- margin-top: 2px;
-}
-
-#vcard #vcard-avatar input[type="file"] {
- margin-left: 15px;
-}
-
-#vcard .avatar-container {
- float: left;
- text-align: center;
- margin: 20px 0 35px 35px;
- max-width: 96px;
- max-height: 96px;
-}
-
-html[dir="rtl"] #vcard .avatar-container {
- margin-right: 35px;
- margin-left: 0;
- float: right;
-}
-
-#vcard .avatar {
- max-width: 96px;
- max-height: 96px;
-}
-
-#vcard .avatar-delete {
- background-position: 3px -1195px;
- margin: 12px 25px 0 25px;
- padding-left: 20px;
- font-size: 0.9em;
- float: right;
-}
-
-html[dir="rtl"] #vcard .avatar-delete {
- float: left;
-}
-
-#vcard .no-avatar {
- width: 300px;
- color: #7c2222;
- padding: 10px;
- margin: 15px 0 20px 40px;
- background: #f8cece;
- border: 1px #ba6d6d solid;
- font-size: 0.8em;
-}
-
-html[dir="rtl"] #vcard .no-avatar {
- margin-left: auto;
- margin-right: 20px;
-}
-
-#vcard .forms textarea {
- height: 111px;
- width: 358px;
- margin: 5px 12px 10px 12px;
-}
-
-#vcard .forms .avatar-info {
- border-width: 1px;
- border-style: solid;
- display: none;
- width: 370px;
- height: 15px;
- font-size: 0.85em;
- padding: 10px;
-}
-
-#vcard .forms .avatar-wait {
- background-color: #9bcbed;
- color: #0a3858;
- border-color: #306780;
-}
-
-#vcard .forms .avatar-ok {
- background-color: #c4ed9b;
- color: #325213;
- border-color: #578030;
-}
-
-#vcard .forms .avatar-error {
- background-color: #e79595;
- color: #6a0b0b;
- border-color: #7c1010;
-}
-
-#vcard .infos {
- width: 179px;
- height: 328px;
- margin: 15px 15px 15px 0;
- padding: 0 8px;
- float: right;
-}
-
-#vcard .infos a {
- text-decoration: underline;
-}
-
-#vcard .send {
- float: right;
-}
-
-#vcard .send:hover {
- cursor: pointer;
-}
diff --git a/source/app/stylesheets/welcome.css b/source/app/stylesheets/welcome.css
deleted file mode 100644
index e331440..0000000
--- a/source/app/stylesheets/welcome.css
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
-
-Jappix - An open social platform
-This is the welcome tool CSS stylesheet for Jappix
-
--------------------------------------------------
-
-License: AGPL
-Author: Valérian Saliou
-
-*/
-
-#welcome .infos {
- margin: 15px;
-}
-
-#welcome .infos p {
- margin-top: 6px;
-}
-
-#welcome .infos p.infos-title {
- margin-top: 0;
-}
-
-#welcome a.box {
- background-color: #e4eef9;
- border: 1px solid #ccdbde;
- margin: 12px 11px 4px 15px;
- padding: 10px;
- width: 270px;
- text-decoration: none;
- float: left;
- -moz-border-radius: 4px;
- -webkit-border-radius: 4px;
- border-radius: 4px;
-}
-
-#welcome a.box.share {
- width: 350px;
- margin: 4px 130px;
- padding: 4px 10px;
- clear: both;
-}
-
-#welcome a.box.share.first {
- margin-top: 0;
-}
-
-#welcome a.box.share:hover span.go {
- display: block;
-}
-
-#welcome a.box:hover,
-#welcome a.box:focus {
- border: 1px solid #93c5fa;
-}
-
-#welcome a.box:active {
- border: 1px solid #419afa;
-}
-
-#welcome a.box.enabled {
- background-color: #f1f6fd;
- border: 1px solid #9dc4fc;
-}
-
-#welcome a.box span {
- margin: 3px 0;
- display: block;
-}
-
-#welcome a.box span.logo {
- height: 35px;
- width: 35px;
- margin-right: 15px;
- float: left;
-}
-
-#welcome a.box span.logo.facebook {
- background-position: 0 0;
-}
-
-#welcome a.box span.logo.twitter {
- background-position: -35px 0;
-}
-
-#welcome a.box span.logo.plus {
- background-position: -70px 0;
-}
-
-#welcome a.box span.logo.waaave {
- background-position: -105px 0;
-}
-
-#welcome a.box span.option,
-#welcome a.box span.name {
- font-size: 0.9em;
- font-weight: bold;
-}
-
-#welcome a.box span.description {
- font-size: 0.7em;
- margin-top: 7px;
-}
-
-#welcome a.box.share span.description {
- margin-top: 4px;
-}
-
-#welcome a.box span.image {
- height: 16px;
- width: 16px;
- margin: -30px 12px 0 0;
- float: right;
-}
-
-html[dir="rtl"] #welcome a.box span.image {
- margin-right: auto;
- margin-left: 12px;
- float: left;
-}
-
-#welcome a.box span.image.sound {
- background-position: 0 -900px;
-}
-
-#welcome a.box span.image.geolocation {
- background-position: 0 -658px;
-}
-
-#welcome a.box span.image.xmpp {
- background-position: 0 -990px;
-}
-
-#welcome a.box span.image.mam {
- background-position: 0 -1025px;
-}
-
-#welcome a.box span.image.offline {
- background-position: 0 -80px;
-}
-
-#welcome a.box span.tick,
-#welcome a.box span.go {
- height: 16px;
- width: 16px;
- display: none;
- float: right;
-}
-
-#welcome a.box span.tick {
- background-position: 0 -1661px;
- margin: -52px -15px 0 0;
-}
-
-#welcome a.box span.go {
- background-position: 0 -1120px;
- margin: -28px 5px 0 0;
-}
-
-html[dir="rtl"] #welcome a.box span.go {
- margin-right: auto;
- margin-left: 5px;
- float: left;
-}
-
-#welcome a.box.enabled span.tick {
- display: block;
-}
-
-#welcome div.results {
- margin: -7px 15px;
- padding: 0;
- height: 272px;
- overflow: auto;
-}
-
-#welcome .bottom .finish.save {
- display: none;
-}
diff --git a/source/dev/.htaccess b/source/dev/.htaccess
deleted file mode 100644
index a6e0b16..0000000
--- a/source/dev/.htaccess
+++ /dev/null
@@ -1,2 +0,0 @@
-# Security rule
-deny from all
\ No newline at end of file
diff --git a/source/dev/images/icons/accept.png b/source/dev/images/icons/accept.png
deleted file mode 100644
index b3141e1..0000000
Binary files a/source/dev/images/icons/accept.png and /dev/null differ
diff --git a/source/dev/images/icons/add.png b/source/dev/images/icons/add.png
deleted file mode 100644
index 3894544..0000000
Binary files a/source/dev/images/icons/add.png and /dev/null differ
diff --git a/source/dev/images/icons/anchor.png b/source/dev/images/icons/anchor.png
deleted file mode 100644
index 19fa29f..0000000
Binary files a/source/dev/images/icons/anchor.png and /dev/null differ
diff --git a/source/dev/images/icons/application.png b/source/dev/images/icons/application.png
deleted file mode 100644
index 94da091..0000000
Binary files a/source/dev/images/icons/application.png and /dev/null differ
diff --git a/source/dev/images/icons/application_add.png b/source/dev/images/icons/application_add.png
deleted file mode 100644
index 2bb54dd..0000000
Binary files a/source/dev/images/icons/application_add.png and /dev/null differ
diff --git a/source/dev/images/icons/application_cascade.png b/source/dev/images/icons/application_cascade.png
deleted file mode 100644
index 5abb6d9..0000000
Binary files a/source/dev/images/icons/application_cascade.png and /dev/null differ
diff --git a/source/dev/images/icons/application_delete.png b/source/dev/images/icons/application_delete.png
deleted file mode 100644
index c989bfd..0000000
Binary files a/source/dev/images/icons/application_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/application_double.png b/source/dev/images/icons/application_double.png
deleted file mode 100644
index e614249..0000000
Binary files a/source/dev/images/icons/application_double.png and /dev/null differ
diff --git a/source/dev/images/icons/application_edit.png b/source/dev/images/icons/application_edit.png
deleted file mode 100644
index 91bc793..0000000
Binary files a/source/dev/images/icons/application_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/application_error.png b/source/dev/images/icons/application_error.png
deleted file mode 100644
index 6bce361..0000000
Binary files a/source/dev/images/icons/application_error.png and /dev/null differ
diff --git a/source/dev/images/icons/application_form.png b/source/dev/images/icons/application_form.png
deleted file mode 100644
index dc4c4c6..0000000
Binary files a/source/dev/images/icons/application_form.png and /dev/null differ
diff --git a/source/dev/images/icons/application_form_add.png b/source/dev/images/icons/application_form_add.png
deleted file mode 100644
index c58d3a7..0000000
Binary files a/source/dev/images/icons/application_form_add.png and /dev/null differ
diff --git a/source/dev/images/icons/application_form_delete.png b/source/dev/images/icons/application_form_delete.png
deleted file mode 100644
index 1fac561..0000000
Binary files a/source/dev/images/icons/application_form_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/application_form_edit.png b/source/dev/images/icons/application_form_edit.png
deleted file mode 100644
index f9097a2..0000000
Binary files a/source/dev/images/icons/application_form_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/application_form_magnify.png b/source/dev/images/icons/application_form_magnify.png
deleted file mode 100644
index 76e9e12..0000000
Binary files a/source/dev/images/icons/application_form_magnify.png and /dev/null differ
diff --git a/source/dev/images/icons/application_get.png b/source/dev/images/icons/application_get.png
deleted file mode 100644
index d7587ae..0000000
Binary files a/source/dev/images/icons/application_get.png and /dev/null differ
diff --git a/source/dev/images/icons/application_go.png b/source/dev/images/icons/application_go.png
deleted file mode 100644
index 5cc2b0d..0000000
Binary files a/source/dev/images/icons/application_go.png and /dev/null differ
diff --git a/source/dev/images/icons/application_home.png b/source/dev/images/icons/application_home.png
deleted file mode 100644
index 902d8e0..0000000
Binary files a/source/dev/images/icons/application_home.png and /dev/null differ
diff --git a/source/dev/images/icons/application_key.png b/source/dev/images/icons/application_key.png
deleted file mode 100644
index 0df1195..0000000
Binary files a/source/dev/images/icons/application_key.png and /dev/null differ
diff --git a/source/dev/images/icons/application_lightning.png b/source/dev/images/icons/application_lightning.png
deleted file mode 100644
index 7812a11..0000000
Binary files a/source/dev/images/icons/application_lightning.png and /dev/null differ
diff --git a/source/dev/images/icons/application_link.png b/source/dev/images/icons/application_link.png
deleted file mode 100644
index 81b3fbb..0000000
Binary files a/source/dev/images/icons/application_link.png and /dev/null differ
diff --git a/source/dev/images/icons/application_osx.png b/source/dev/images/icons/application_osx.png
deleted file mode 100644
index 9f022ec..0000000
Binary files a/source/dev/images/icons/application_osx.png and /dev/null differ
diff --git a/source/dev/images/icons/application_osx_terminal.png b/source/dev/images/icons/application_osx_terminal.png
deleted file mode 100644
index b3d8ce0..0000000
Binary files a/source/dev/images/icons/application_osx_terminal.png and /dev/null differ
diff --git a/source/dev/images/icons/application_put.png b/source/dev/images/icons/application_put.png
deleted file mode 100644
index 9f48860..0000000
Binary files a/source/dev/images/icons/application_put.png and /dev/null differ
diff --git a/source/dev/images/icons/application_side_boxes.png b/source/dev/images/icons/application_side_boxes.png
deleted file mode 100644
index 222fc02..0000000
Binary files a/source/dev/images/icons/application_side_boxes.png and /dev/null differ
diff --git a/source/dev/images/icons/application_side_contract.png b/source/dev/images/icons/application_side_contract.png
deleted file mode 100644
index 3585f94..0000000
Binary files a/source/dev/images/icons/application_side_contract.png and /dev/null differ
diff --git a/source/dev/images/icons/application_side_expand.png b/source/dev/images/icons/application_side_expand.png
deleted file mode 100644
index 030cf7c..0000000
Binary files a/source/dev/images/icons/application_side_expand.png and /dev/null differ
diff --git a/source/dev/images/icons/application_side_list.png b/source/dev/images/icons/application_side_list.png
deleted file mode 100644
index 1202503..0000000
Binary files a/source/dev/images/icons/application_side_list.png and /dev/null differ
diff --git a/source/dev/images/icons/application_side_tree.png b/source/dev/images/icons/application_side_tree.png
deleted file mode 100644
index 5c1c69a..0000000
Binary files a/source/dev/images/icons/application_side_tree.png and /dev/null differ
diff --git a/source/dev/images/icons/application_split.png b/source/dev/images/icons/application_split.png
deleted file mode 100644
index 8399cb6..0000000
Binary files a/source/dev/images/icons/application_split.png and /dev/null differ
diff --git a/source/dev/images/icons/application_tile_horizontal.png b/source/dev/images/icons/application_tile_horizontal.png
deleted file mode 100644
index 8a1191c..0000000
Binary files a/source/dev/images/icons/application_tile_horizontal.png and /dev/null differ
diff --git a/source/dev/images/icons/application_tile_vertical.png b/source/dev/images/icons/application_tile_vertical.png
deleted file mode 100644
index 1d40383..0000000
Binary files a/source/dev/images/icons/application_tile_vertical.png and /dev/null differ
diff --git a/source/dev/images/icons/application_view_columns.png b/source/dev/images/icons/application_view_columns.png
deleted file mode 100644
index 6703ff2..0000000
Binary files a/source/dev/images/icons/application_view_columns.png and /dev/null differ
diff --git a/source/dev/images/icons/application_view_detail.png b/source/dev/images/icons/application_view_detail.png
deleted file mode 100644
index 00571e2..0000000
Binary files a/source/dev/images/icons/application_view_detail.png and /dev/null differ
diff --git a/source/dev/images/icons/application_view_gallery.png b/source/dev/images/icons/application_view_gallery.png
deleted file mode 100644
index 0a3c80a..0000000
Binary files a/source/dev/images/icons/application_view_gallery.png and /dev/null differ
diff --git a/source/dev/images/icons/application_view_icons.png b/source/dev/images/icons/application_view_icons.png
deleted file mode 100644
index 0554902..0000000
Binary files a/source/dev/images/icons/application_view_icons.png and /dev/null differ
diff --git a/source/dev/images/icons/application_view_list.png b/source/dev/images/icons/application_view_list.png
deleted file mode 100644
index 58bcfc6..0000000
Binary files a/source/dev/images/icons/application_view_list.png and /dev/null differ
diff --git a/source/dev/images/icons/application_view_tile.png b/source/dev/images/icons/application_view_tile.png
deleted file mode 100644
index 7b5d8b2..0000000
Binary files a/source/dev/images/icons/application_view_tile.png and /dev/null differ
diff --git a/source/dev/images/icons/application_xp.png b/source/dev/images/icons/application_xp.png
deleted file mode 100644
index d22860a..0000000
Binary files a/source/dev/images/icons/application_xp.png and /dev/null differ
diff --git a/source/dev/images/icons/application_xp_terminal.png b/source/dev/images/icons/application_xp_terminal.png
deleted file mode 100644
index c28dd63..0000000
Binary files a/source/dev/images/icons/application_xp_terminal.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_branch.png b/source/dev/images/icons/arrow_branch.png
deleted file mode 100644
index 345f9ff..0000000
Binary files a/source/dev/images/icons/arrow_branch.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_divide.png b/source/dev/images/icons/arrow_divide.png
deleted file mode 100644
index c4b7082..0000000
Binary files a/source/dev/images/icons/arrow_divide.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_down.png b/source/dev/images/icons/arrow_down.png
deleted file mode 100644
index 00ba123..0000000
Binary files a/source/dev/images/icons/arrow_down.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_in.png b/source/dev/images/icons/arrow_in.png
deleted file mode 100644
index 7224de0..0000000
Binary files a/source/dev/images/icons/arrow_in.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_inout.png b/source/dev/images/icons/arrow_inout.png
deleted file mode 100644
index 1b76367..0000000
Binary files a/source/dev/images/icons/arrow_inout.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_join.png b/source/dev/images/icons/arrow_join.png
deleted file mode 100644
index ef4e09c..0000000
Binary files a/source/dev/images/icons/arrow_join.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_left.png b/source/dev/images/icons/arrow_left.png
deleted file mode 100644
index 260993e..0000000
Binary files a/source/dev/images/icons/arrow_left.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_merge.png b/source/dev/images/icons/arrow_merge.png
deleted file mode 100644
index d65e3c8..0000000
Binary files a/source/dev/images/icons/arrow_merge.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_out.png b/source/dev/images/icons/arrow_out.png
deleted file mode 100644
index 75c354c..0000000
Binary files a/source/dev/images/icons/arrow_out.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_redo.png b/source/dev/images/icons/arrow_redo.png
deleted file mode 100644
index f621bb3..0000000
Binary files a/source/dev/images/icons/arrow_redo.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_refresh.png b/source/dev/images/icons/arrow_refresh.png
deleted file mode 100644
index 5b8cfda..0000000
Binary files a/source/dev/images/icons/arrow_refresh.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_refresh_small.png b/source/dev/images/icons/arrow_refresh_small.png
deleted file mode 100644
index a799788..0000000
Binary files a/source/dev/images/icons/arrow_refresh_small.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_right.png b/source/dev/images/icons/arrow_right.png
deleted file mode 100644
index 755e365..0000000
Binary files a/source/dev/images/icons/arrow_right.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_rotate_anticlockwise.png b/source/dev/images/icons/arrow_rotate_anticlockwise.png
deleted file mode 100644
index 7f8ffc1..0000000
Binary files a/source/dev/images/icons/arrow_rotate_anticlockwise.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_rotate_clockwise.png b/source/dev/images/icons/arrow_rotate_clockwise.png
deleted file mode 100644
index cf7a779..0000000
Binary files a/source/dev/images/icons/arrow_rotate_clockwise.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_switch.png b/source/dev/images/icons/arrow_switch.png
deleted file mode 100644
index 5c4bfaf..0000000
Binary files a/source/dev/images/icons/arrow_switch.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_turn_left.png b/source/dev/images/icons/arrow_turn_left.png
deleted file mode 100644
index 1db4ce3..0000000
Binary files a/source/dev/images/icons/arrow_turn_left.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_turn_right.png b/source/dev/images/icons/arrow_turn_right.png
deleted file mode 100644
index d4e1e3f..0000000
Binary files a/source/dev/images/icons/arrow_turn_right.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_undo.png b/source/dev/images/icons/arrow_undo.png
deleted file mode 100644
index 1cc2efc..0000000
Binary files a/source/dev/images/icons/arrow_undo.png and /dev/null differ
diff --git a/source/dev/images/icons/arrow_up.png b/source/dev/images/icons/arrow_up.png
deleted file mode 100644
index 7ed49c6..0000000
Binary files a/source/dev/images/icons/arrow_up.png and /dev/null differ
diff --git a/source/dev/images/icons/asterisk_orange.png b/source/dev/images/icons/asterisk_orange.png
deleted file mode 100644
index f631d81..0000000
Binary files a/source/dev/images/icons/asterisk_orange.png and /dev/null differ
diff --git a/source/dev/images/icons/asterisk_yellow.png b/source/dev/images/icons/asterisk_yellow.png
deleted file mode 100644
index b91806b..0000000
Binary files a/source/dev/images/icons/asterisk_yellow.png and /dev/null differ
diff --git a/source/dev/images/icons/attach.png b/source/dev/images/icons/attach.png
deleted file mode 100644
index eb8de4d..0000000
Binary files a/source/dev/images/icons/attach.png and /dev/null differ
diff --git a/source/dev/images/icons/award_star_add.png b/source/dev/images/icons/award_star_add.png
deleted file mode 100644
index 26916bf..0000000
Binary files a/source/dev/images/icons/award_star_add.png and /dev/null differ
diff --git a/source/dev/images/icons/award_star_bronze_1.png b/source/dev/images/icons/award_star_bronze_1.png
deleted file mode 100644
index f423d53..0000000
Binary files a/source/dev/images/icons/award_star_bronze_1.png and /dev/null differ
diff --git a/source/dev/images/icons/award_star_bronze_2.png b/source/dev/images/icons/award_star_bronze_2.png
deleted file mode 100644
index 4cbc79f..0000000
Binary files a/source/dev/images/icons/award_star_bronze_2.png and /dev/null differ
diff --git a/source/dev/images/icons/award_star_bronze_3.png b/source/dev/images/icons/award_star_bronze_3.png
deleted file mode 100644
index 3548bda..0000000
Binary files a/source/dev/images/icons/award_star_bronze_3.png and /dev/null differ
diff --git a/source/dev/images/icons/award_star_delete.png b/source/dev/images/icons/award_star_delete.png
deleted file mode 100644
index 9ace9a7..0000000
Binary files a/source/dev/images/icons/award_star_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/award_star_gold_1.png b/source/dev/images/icons/award_star_gold_1.png
deleted file mode 100644
index c7a1c7b..0000000
Binary files a/source/dev/images/icons/award_star_gold_1.png and /dev/null differ
diff --git a/source/dev/images/icons/award_star_gold_2.png b/source/dev/images/icons/award_star_gold_2.png
deleted file mode 100644
index 568ea1f..0000000
Binary files a/source/dev/images/icons/award_star_gold_2.png and /dev/null differ
diff --git a/source/dev/images/icons/award_star_gold_3.png b/source/dev/images/icons/award_star_gold_3.png
deleted file mode 100644
index 60b67c7..0000000
Binary files a/source/dev/images/icons/award_star_gold_3.png and /dev/null differ
diff --git a/source/dev/images/icons/award_star_silver_1.png b/source/dev/images/icons/award_star_silver_1.png
deleted file mode 100644
index 6c29831..0000000
Binary files a/source/dev/images/icons/award_star_silver_1.png and /dev/null differ
diff --git a/source/dev/images/icons/award_star_silver_2.png b/source/dev/images/icons/award_star_silver_2.png
deleted file mode 100644
index 5c3b8f6..0000000
Binary files a/source/dev/images/icons/award_star_silver_2.png and /dev/null differ
diff --git a/source/dev/images/icons/award_star_silver_3.png b/source/dev/images/icons/award_star_silver_3.png
deleted file mode 100644
index 075396f..0000000
Binary files a/source/dev/images/icons/award_star_silver_3.png and /dev/null differ
diff --git a/source/dev/images/icons/basket.png b/source/dev/images/icons/basket.png
deleted file mode 100644
index b0686d7..0000000
Binary files a/source/dev/images/icons/basket.png and /dev/null differ
diff --git a/source/dev/images/icons/basket_add.png b/source/dev/images/icons/basket_add.png
deleted file mode 100644
index db2f304..0000000
Binary files a/source/dev/images/icons/basket_add.png and /dev/null differ
diff --git a/source/dev/images/icons/basket_delete.png b/source/dev/images/icons/basket_delete.png
deleted file mode 100644
index 89d5459..0000000
Binary files a/source/dev/images/icons/basket_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/basket_edit.png b/source/dev/images/icons/basket_edit.png
deleted file mode 100644
index 1ed5ad7..0000000
Binary files a/source/dev/images/icons/basket_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/basket_error.png b/source/dev/images/icons/basket_error.png
deleted file mode 100644
index d737c6f..0000000
Binary files a/source/dev/images/icons/basket_error.png and /dev/null differ
diff --git a/source/dev/images/icons/basket_go.png b/source/dev/images/icons/basket_go.png
deleted file mode 100644
index ed5d114..0000000
Binary files a/source/dev/images/icons/basket_go.png and /dev/null differ
diff --git a/source/dev/images/icons/basket_put.png b/source/dev/images/icons/basket_put.png
deleted file mode 100644
index be62faa..0000000
Binary files a/source/dev/images/icons/basket_put.png and /dev/null differ
diff --git a/source/dev/images/icons/basket_remove.png b/source/dev/images/icons/basket_remove.png
deleted file mode 100644
index 04dd7fd..0000000
Binary files a/source/dev/images/icons/basket_remove.png and /dev/null differ
diff --git a/source/dev/images/icons/bell.png b/source/dev/images/icons/bell.png
deleted file mode 100644
index f6c56ee..0000000
Binary files a/source/dev/images/icons/bell.png and /dev/null differ
diff --git a/source/dev/images/icons/bell_add.png b/source/dev/images/icons/bell_add.png
deleted file mode 100644
index b76f7b2..0000000
Binary files a/source/dev/images/icons/bell_add.png and /dev/null differ
diff --git a/source/dev/images/icons/bell_delete.png b/source/dev/images/icons/bell_delete.png
deleted file mode 100644
index 31528f0..0000000
Binary files a/source/dev/images/icons/bell_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/bell_error.png b/source/dev/images/icons/bell_error.png
deleted file mode 100644
index d833d74..0000000
Binary files a/source/dev/images/icons/bell_error.png and /dev/null differ
diff --git a/source/dev/images/icons/bell_go.png b/source/dev/images/icons/bell_go.png
deleted file mode 100644
index 6827d6a..0000000
Binary files a/source/dev/images/icons/bell_go.png and /dev/null differ
diff --git a/source/dev/images/icons/bell_link.png b/source/dev/images/icons/bell_link.png
deleted file mode 100644
index 790dc01..0000000
Binary files a/source/dev/images/icons/bell_link.png and /dev/null differ
diff --git a/source/dev/images/icons/bin.png b/source/dev/images/icons/bin.png
deleted file mode 100644
index c131494..0000000
Binary files a/source/dev/images/icons/bin.png and /dev/null differ
diff --git a/source/dev/images/icons/bin_closed.png b/source/dev/images/icons/bin_closed.png
deleted file mode 100644
index e3c0dc7..0000000
Binary files a/source/dev/images/icons/bin_closed.png and /dev/null differ
diff --git a/source/dev/images/icons/bin_empty.png b/source/dev/images/icons/bin_empty.png
deleted file mode 100644
index d572cb8..0000000
Binary files a/source/dev/images/icons/bin_empty.png and /dev/null differ
diff --git a/source/dev/images/icons/bomb.png b/source/dev/images/icons/bomb.png
deleted file mode 100644
index 638a9d4..0000000
Binary files a/source/dev/images/icons/bomb.png and /dev/null differ
diff --git a/source/dev/images/icons/book.png b/source/dev/images/icons/book.png
deleted file mode 100644
index b0f4dd7..0000000
Binary files a/source/dev/images/icons/book.png and /dev/null differ
diff --git a/source/dev/images/icons/book_add.png b/source/dev/images/icons/book_add.png
deleted file mode 100644
index e2f0847..0000000
Binary files a/source/dev/images/icons/book_add.png and /dev/null differ
diff --git a/source/dev/images/icons/book_addresses.png b/source/dev/images/icons/book_addresses.png
deleted file mode 100644
index b73419b..0000000
Binary files a/source/dev/images/icons/book_addresses.png and /dev/null differ
diff --git a/source/dev/images/icons/book_delete.png b/source/dev/images/icons/book_delete.png
deleted file mode 100644
index d9a6340..0000000
Binary files a/source/dev/images/icons/book_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/book_edit.png b/source/dev/images/icons/book_edit.png
deleted file mode 100644
index 6e756cc..0000000
Binary files a/source/dev/images/icons/book_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/book_error.png b/source/dev/images/icons/book_error.png
deleted file mode 100644
index f3fbed0..0000000
Binary files a/source/dev/images/icons/book_error.png and /dev/null differ
diff --git a/source/dev/images/icons/book_go.png b/source/dev/images/icons/book_go.png
deleted file mode 100644
index cd4e196..0000000
Binary files a/source/dev/images/icons/book_go.png and /dev/null differ
diff --git a/source/dev/images/icons/book_key.png b/source/dev/images/icons/book_key.png
deleted file mode 100644
index d8e23ec..0000000
Binary files a/source/dev/images/icons/book_key.png and /dev/null differ
diff --git a/source/dev/images/icons/book_link.png b/source/dev/images/icons/book_link.png
deleted file mode 100644
index dd0820e..0000000
Binary files a/source/dev/images/icons/book_link.png and /dev/null differ
diff --git a/source/dev/images/icons/book_next.png b/source/dev/images/icons/book_next.png
deleted file mode 100644
index 365f54d..0000000
Binary files a/source/dev/images/icons/book_next.png and /dev/null differ
diff --git a/source/dev/images/icons/book_open.png b/source/dev/images/icons/book_open.png
deleted file mode 100644
index 7d863f9..0000000
Binary files a/source/dev/images/icons/book_open.png and /dev/null differ
diff --git a/source/dev/images/icons/book_previous.png b/source/dev/images/icons/book_previous.png
deleted file mode 100644
index 814a646..0000000
Binary files a/source/dev/images/icons/book_previous.png and /dev/null differ
diff --git a/source/dev/images/icons/box.png b/source/dev/images/icons/box.png
deleted file mode 100644
index 8443c23..0000000
Binary files a/source/dev/images/icons/box.png and /dev/null differ
diff --git a/source/dev/images/icons/brick.png b/source/dev/images/icons/brick.png
deleted file mode 100644
index 6fed6ae..0000000
Binary files a/source/dev/images/icons/brick.png and /dev/null differ
diff --git a/source/dev/images/icons/brick_add.png b/source/dev/images/icons/brick_add.png
deleted file mode 100644
index e871849..0000000
Binary files a/source/dev/images/icons/brick_add.png and /dev/null differ
diff --git a/source/dev/images/icons/brick_delete.png b/source/dev/images/icons/brick_delete.png
deleted file mode 100644
index d0f199a..0000000
Binary files a/source/dev/images/icons/brick_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/brick_edit.png b/source/dev/images/icons/brick_edit.png
deleted file mode 100644
index 4f3e7bd..0000000
Binary files a/source/dev/images/icons/brick_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/brick_error.png b/source/dev/images/icons/brick_error.png
deleted file mode 100644
index a500c5b..0000000
Binary files a/source/dev/images/icons/brick_error.png and /dev/null differ
diff --git a/source/dev/images/icons/brick_go.png b/source/dev/images/icons/brick_go.png
deleted file mode 100644
index 28c06ac..0000000
Binary files a/source/dev/images/icons/brick_go.png and /dev/null differ
diff --git a/source/dev/images/icons/brick_link.png b/source/dev/images/icons/brick_link.png
deleted file mode 100644
index 3c97b90..0000000
Binary files a/source/dev/images/icons/brick_link.png and /dev/null differ
diff --git a/source/dev/images/icons/bricks.png b/source/dev/images/icons/bricks.png
deleted file mode 100644
index 1e27edb..0000000
Binary files a/source/dev/images/icons/bricks.png and /dev/null differ
diff --git a/source/dev/images/icons/briefcase.png b/source/dev/images/icons/briefcase.png
deleted file mode 100644
index 05c5649..0000000
Binary files a/source/dev/images/icons/briefcase.png and /dev/null differ
diff --git a/source/dev/images/icons/bug.png b/source/dev/images/icons/bug.png
deleted file mode 100644
index fd20978..0000000
Binary files a/source/dev/images/icons/bug.png and /dev/null differ
diff --git a/source/dev/images/icons/bug_add.png b/source/dev/images/icons/bug_add.png
deleted file mode 100644
index 9cc82ed..0000000
Binary files a/source/dev/images/icons/bug_add.png and /dev/null differ
diff --git a/source/dev/images/icons/bug_delete.png b/source/dev/images/icons/bug_delete.png
deleted file mode 100644
index 477bb85..0000000
Binary files a/source/dev/images/icons/bug_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/bug_edit.png b/source/dev/images/icons/bug_edit.png
deleted file mode 100644
index fb9cca6..0000000
Binary files a/source/dev/images/icons/bug_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/bug_error.png b/source/dev/images/icons/bug_error.png
deleted file mode 100644
index 52c5ec2..0000000
Binary files a/source/dev/images/icons/bug_error.png and /dev/null differ
diff --git a/source/dev/images/icons/bug_go.png b/source/dev/images/icons/bug_go.png
deleted file mode 100644
index 8dc1d35..0000000
Binary files a/source/dev/images/icons/bug_go.png and /dev/null differ
diff --git a/source/dev/images/icons/bug_link.png b/source/dev/images/icons/bug_link.png
deleted file mode 100644
index 0fee96e..0000000
Binary files a/source/dev/images/icons/bug_link.png and /dev/null differ
diff --git a/source/dev/images/icons/building.png b/source/dev/images/icons/building.png
deleted file mode 100644
index 11a017c..0000000
Binary files a/source/dev/images/icons/building.png and /dev/null differ
diff --git a/source/dev/images/icons/building_add.png b/source/dev/images/icons/building_add.png
deleted file mode 100644
index a96d821..0000000
Binary files a/source/dev/images/icons/building_add.png and /dev/null differ
diff --git a/source/dev/images/icons/building_delete.png b/source/dev/images/icons/building_delete.png
deleted file mode 100644
index f96a170..0000000
Binary files a/source/dev/images/icons/building_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/building_edit.png b/source/dev/images/icons/building_edit.png
deleted file mode 100644
index 940f725..0000000
Binary files a/source/dev/images/icons/building_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/building_error.png b/source/dev/images/icons/building_error.png
deleted file mode 100644
index a342eef..0000000
Binary files a/source/dev/images/icons/building_error.png and /dev/null differ
diff --git a/source/dev/images/icons/building_go.png b/source/dev/images/icons/building_go.png
deleted file mode 100644
index 4f2c23c..0000000
Binary files a/source/dev/images/icons/building_go.png and /dev/null differ
diff --git a/source/dev/images/icons/building_key.png b/source/dev/images/icons/building_key.png
deleted file mode 100644
index 2554f61..0000000
Binary files a/source/dev/images/icons/building_key.png and /dev/null differ
diff --git a/source/dev/images/icons/building_link.png b/source/dev/images/icons/building_link.png
deleted file mode 100644
index 581108c..0000000
Binary files a/source/dev/images/icons/building_link.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_add.png b/source/dev/images/icons/bullet_add.png
deleted file mode 100644
index efb6f2a..0000000
Binary files a/source/dev/images/icons/bullet_add.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_arrow_bottom.png b/source/dev/images/icons/bullet_arrow_bottom.png
deleted file mode 100644
index 1a28d82..0000000
Binary files a/source/dev/images/icons/bullet_arrow_bottom.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_arrow_down.png b/source/dev/images/icons/bullet_arrow_down.png
deleted file mode 100644
index 9b23c06..0000000
Binary files a/source/dev/images/icons/bullet_arrow_down.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_arrow_top.png b/source/dev/images/icons/bullet_arrow_top.png
deleted file mode 100644
index 0ce86d2..0000000
Binary files a/source/dev/images/icons/bullet_arrow_top.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_arrow_up.png b/source/dev/images/icons/bullet_arrow_up.png
deleted file mode 100644
index 24df0f4..0000000
Binary files a/source/dev/images/icons/bullet_arrow_up.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_black.png b/source/dev/images/icons/bullet_black.png
deleted file mode 100644
index 5761970..0000000
Binary files a/source/dev/images/icons/bullet_black.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_blue.png b/source/dev/images/icons/bullet_blue.png
deleted file mode 100644
index 3b4dbc8..0000000
Binary files a/source/dev/images/icons/bullet_blue.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_delete.png b/source/dev/images/icons/bullet_delete.png
deleted file mode 100644
index 7e2cbe9..0000000
Binary files a/source/dev/images/icons/bullet_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_disk.png b/source/dev/images/icons/bullet_disk.png
deleted file mode 100644
index 86b38b7..0000000
Binary files a/source/dev/images/icons/bullet_disk.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_error.png b/source/dev/images/icons/bullet_error.png
deleted file mode 100644
index 60ce305..0000000
Binary files a/source/dev/images/icons/bullet_error.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_feed.png b/source/dev/images/icons/bullet_feed.png
deleted file mode 100644
index 93b57d9..0000000
Binary files a/source/dev/images/icons/bullet_feed.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_go.png b/source/dev/images/icons/bullet_go.png
deleted file mode 100644
index 432a19f..0000000
Binary files a/source/dev/images/icons/bullet_go.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_green.png b/source/dev/images/icons/bullet_green.png
deleted file mode 100644
index 9d32832..0000000
Binary files a/source/dev/images/icons/bullet_green.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_key.png b/source/dev/images/icons/bullet_key.png
deleted file mode 100644
index 5cd73e8..0000000
Binary files a/source/dev/images/icons/bullet_key.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_orange.png b/source/dev/images/icons/bullet_orange.png
deleted file mode 100644
index 65251d7..0000000
Binary files a/source/dev/images/icons/bullet_orange.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_picture.png b/source/dev/images/icons/bullet_picture.png
deleted file mode 100644
index 381f515..0000000
Binary files a/source/dev/images/icons/bullet_picture.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_pink.png b/source/dev/images/icons/bullet_pink.png
deleted file mode 100644
index da7d066..0000000
Binary files a/source/dev/images/icons/bullet_pink.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_purple.png b/source/dev/images/icons/bullet_purple.png
deleted file mode 100644
index 57c4ae0..0000000
Binary files a/source/dev/images/icons/bullet_purple.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_red.png b/source/dev/images/icons/bullet_red.png
deleted file mode 100644
index 7fd24c7..0000000
Binary files a/source/dev/images/icons/bullet_red.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_star.png b/source/dev/images/icons/bullet_star.png
deleted file mode 100644
index b148a0f..0000000
Binary files a/source/dev/images/icons/bullet_star.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_toggle_minus.png b/source/dev/images/icons/bullet_toggle_minus.png
deleted file mode 100644
index b47ce55..0000000
Binary files a/source/dev/images/icons/bullet_toggle_minus.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_toggle_plus.png b/source/dev/images/icons/bullet_toggle_plus.png
deleted file mode 100644
index 9ab4a89..0000000
Binary files a/source/dev/images/icons/bullet_toggle_plus.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_white.png b/source/dev/images/icons/bullet_white.png
deleted file mode 100644
index a9af8d4..0000000
Binary files a/source/dev/images/icons/bullet_white.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_wrench.png b/source/dev/images/icons/bullet_wrench.png
deleted file mode 100644
index 9bd20cc..0000000
Binary files a/source/dev/images/icons/bullet_wrench.png and /dev/null differ
diff --git a/source/dev/images/icons/bullet_yellow.png b/source/dev/images/icons/bullet_yellow.png
deleted file mode 100644
index 3100439..0000000
Binary files a/source/dev/images/icons/bullet_yellow.png and /dev/null differ
diff --git a/source/dev/images/icons/cake.png b/source/dev/images/icons/cake.png
deleted file mode 100644
index 49b093f..0000000
Binary files a/source/dev/images/icons/cake.png and /dev/null differ
diff --git a/source/dev/images/icons/calculator.png b/source/dev/images/icons/calculator.png
deleted file mode 100644
index d052d6b..0000000
Binary files a/source/dev/images/icons/calculator.png and /dev/null differ
diff --git a/source/dev/images/icons/calculator_add.png b/source/dev/images/icons/calculator_add.png
deleted file mode 100644
index 12f58fa..0000000
Binary files a/source/dev/images/icons/calculator_add.png and /dev/null differ
diff --git a/source/dev/images/icons/calculator_delete.png b/source/dev/images/icons/calculator_delete.png
deleted file mode 100644
index bc10be3..0000000
Binary files a/source/dev/images/icons/calculator_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/calculator_edit.png b/source/dev/images/icons/calculator_edit.png
deleted file mode 100644
index 6e606b7..0000000
Binary files a/source/dev/images/icons/calculator_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/calculator_error.png b/source/dev/images/icons/calculator_error.png
deleted file mode 100644
index 4ecb00a..0000000
Binary files a/source/dev/images/icons/calculator_error.png and /dev/null differ
diff --git a/source/dev/images/icons/calculator_link.png b/source/dev/images/icons/calculator_link.png
deleted file mode 100644
index 4d1aad6..0000000
Binary files a/source/dev/images/icons/calculator_link.png and /dev/null differ
diff --git a/source/dev/images/icons/calendar.png b/source/dev/images/icons/calendar.png
deleted file mode 100644
index 01adf88..0000000
Binary files a/source/dev/images/icons/calendar.png and /dev/null differ
diff --git a/source/dev/images/icons/calendar_add.png b/source/dev/images/icons/calendar_add.png
deleted file mode 100644
index 1fcafaa..0000000
Binary files a/source/dev/images/icons/calendar_add.png and /dev/null differ
diff --git a/source/dev/images/icons/calendar_delete.png b/source/dev/images/icons/calendar_delete.png
deleted file mode 100644
index 495a6cf..0000000
Binary files a/source/dev/images/icons/calendar_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/calendar_edit.png b/source/dev/images/icons/calendar_edit.png
deleted file mode 100644
index e9d000a..0000000
Binary files a/source/dev/images/icons/calendar_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/calendar_link.png b/source/dev/images/icons/calendar_link.png
deleted file mode 100644
index 7e5d995..0000000
Binary files a/source/dev/images/icons/calendar_link.png and /dev/null differ
diff --git a/source/dev/images/icons/calendar_view_day.png b/source/dev/images/icons/calendar_view_day.png
deleted file mode 100644
index 9740f76..0000000
Binary files a/source/dev/images/icons/calendar_view_day.png and /dev/null differ
diff --git a/source/dev/images/icons/calendar_view_month.png b/source/dev/images/icons/calendar_view_month.png
deleted file mode 100644
index 5f83049..0000000
Binary files a/source/dev/images/icons/calendar_view_month.png and /dev/null differ
diff --git a/source/dev/images/icons/calendar_view_week.png b/source/dev/images/icons/calendar_view_week.png
deleted file mode 100644
index 8fe695f..0000000
Binary files a/source/dev/images/icons/calendar_view_week.png and /dev/null differ
diff --git a/source/dev/images/icons/camera.png b/source/dev/images/icons/camera.png
deleted file mode 100644
index 8536d1a..0000000
Binary files a/source/dev/images/icons/camera.png and /dev/null differ
diff --git a/source/dev/images/icons/camera_add.png b/source/dev/images/icons/camera_add.png
deleted file mode 100644
index 545f0d1..0000000
Binary files a/source/dev/images/icons/camera_add.png and /dev/null differ
diff --git a/source/dev/images/icons/camera_delete.png b/source/dev/images/icons/camera_delete.png
deleted file mode 100644
index 48f4363..0000000
Binary files a/source/dev/images/icons/camera_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/camera_edit.png b/source/dev/images/icons/camera_edit.png
deleted file mode 100644
index d1381f7..0000000
Binary files a/source/dev/images/icons/camera_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/camera_error.png b/source/dev/images/icons/camera_error.png
deleted file mode 100644
index 3c1bc95..0000000
Binary files a/source/dev/images/icons/camera_error.png and /dev/null differ
diff --git a/source/dev/images/icons/camera_go.png b/source/dev/images/icons/camera_go.png
deleted file mode 100644
index 94ce2b2..0000000
Binary files a/source/dev/images/icons/camera_go.png and /dev/null differ
diff --git a/source/dev/images/icons/camera_link.png b/source/dev/images/icons/camera_link.png
deleted file mode 100644
index a8b85fd..0000000
Binary files a/source/dev/images/icons/camera_link.png and /dev/null differ
diff --git a/source/dev/images/icons/camera_small.png b/source/dev/images/icons/camera_small.png
deleted file mode 100644
index e5e6366..0000000
Binary files a/source/dev/images/icons/camera_small.png and /dev/null differ
diff --git a/source/dev/images/icons/cancel.png b/source/dev/images/icons/cancel.png
deleted file mode 100644
index 76a1c72..0000000
Binary files a/source/dev/images/icons/cancel.png and /dev/null differ
diff --git a/source/dev/images/icons/car.png b/source/dev/images/icons/car.png
deleted file mode 100644
index 58d1390..0000000
Binary files a/source/dev/images/icons/car.png and /dev/null differ
diff --git a/source/dev/images/icons/car_add.png b/source/dev/images/icons/car_add.png
deleted file mode 100644
index 8451e6c..0000000
Binary files a/source/dev/images/icons/car_add.png and /dev/null differ
diff --git a/source/dev/images/icons/car_delete.png b/source/dev/images/icons/car_delete.png
deleted file mode 100644
index ff765d8..0000000
Binary files a/source/dev/images/icons/car_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/cart.png b/source/dev/images/icons/cart.png
deleted file mode 100644
index 20a08dd..0000000
Binary files a/source/dev/images/icons/cart.png and /dev/null differ
diff --git a/source/dev/images/icons/cart_add.png b/source/dev/images/icons/cart_add.png
deleted file mode 100644
index 5f629cf..0000000
Binary files a/source/dev/images/icons/cart_add.png and /dev/null differ
diff --git a/source/dev/images/icons/cart_delete.png b/source/dev/images/icons/cart_delete.png
deleted file mode 100644
index dfaf9eb..0000000
Binary files a/source/dev/images/icons/cart_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/cart_edit.png b/source/dev/images/icons/cart_edit.png
deleted file mode 100644
index dc4ac0e..0000000
Binary files a/source/dev/images/icons/cart_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/cart_error.png b/source/dev/images/icons/cart_error.png
deleted file mode 100644
index d703f91..0000000
Binary files a/source/dev/images/icons/cart_error.png and /dev/null differ
diff --git a/source/dev/images/icons/cart_go.png b/source/dev/images/icons/cart_go.png
deleted file mode 100644
index a1b648a..0000000
Binary files a/source/dev/images/icons/cart_go.png and /dev/null differ
diff --git a/source/dev/images/icons/cart_put.png b/source/dev/images/icons/cart_put.png
deleted file mode 100644
index 9796025..0000000
Binary files a/source/dev/images/icons/cart_put.png and /dev/null differ
diff --git a/source/dev/images/icons/cart_remove.png b/source/dev/images/icons/cart_remove.png
deleted file mode 100644
index 479d6fc..0000000
Binary files a/source/dev/images/icons/cart_remove.png and /dev/null differ
diff --git a/source/dev/images/icons/cd.png b/source/dev/images/icons/cd.png
deleted file mode 100644
index 0002ed5..0000000
Binary files a/source/dev/images/icons/cd.png and /dev/null differ
diff --git a/source/dev/images/icons/cd_add.png b/source/dev/images/icons/cd_add.png
deleted file mode 100644
index c7bc69a..0000000
Binary files a/source/dev/images/icons/cd_add.png and /dev/null differ
diff --git a/source/dev/images/icons/cd_burn.png b/source/dev/images/icons/cd_burn.png
deleted file mode 100644
index e61d8ac..0000000
Binary files a/source/dev/images/icons/cd_burn.png and /dev/null differ
diff --git a/source/dev/images/icons/cd_delete.png b/source/dev/images/icons/cd_delete.png
deleted file mode 100644
index 9a8df46..0000000
Binary files a/source/dev/images/icons/cd_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/cd_edit.png b/source/dev/images/icons/cd_edit.png
deleted file mode 100644
index 6726927..0000000
Binary files a/source/dev/images/icons/cd_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/cd_eject.png b/source/dev/images/icons/cd_eject.png
deleted file mode 100644
index 8d862cd..0000000
Binary files a/source/dev/images/icons/cd_eject.png and /dev/null differ
diff --git a/source/dev/images/icons/cd_go.png b/source/dev/images/icons/cd_go.png
deleted file mode 100644
index 4e9c531..0000000
Binary files a/source/dev/images/icons/cd_go.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_bar.png b/source/dev/images/icons/chart_bar.png
deleted file mode 100644
index 9051fbc..0000000
Binary files a/source/dev/images/icons/chart_bar.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_bar_add.png b/source/dev/images/icons/chart_bar_add.png
deleted file mode 100644
index d283e84..0000000
Binary files a/source/dev/images/icons/chart_bar_add.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_bar_delete.png b/source/dev/images/icons/chart_bar_delete.png
deleted file mode 100644
index 259f686..0000000
Binary files a/source/dev/images/icons/chart_bar_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_bar_edit.png b/source/dev/images/icons/chart_bar_edit.png
deleted file mode 100644
index df64d97..0000000
Binary files a/source/dev/images/icons/chart_bar_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_bar_error.png b/source/dev/images/icons/chart_bar_error.png
deleted file mode 100644
index bdacea5..0000000
Binary files a/source/dev/images/icons/chart_bar_error.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_bar_link.png b/source/dev/images/icons/chart_bar_link.png
deleted file mode 100644
index a5ef28d..0000000
Binary files a/source/dev/images/icons/chart_bar_link.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_curve.png b/source/dev/images/icons/chart_curve.png
deleted file mode 100644
index f23aea8..0000000
Binary files a/source/dev/images/icons/chart_curve.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_curve_add.png b/source/dev/images/icons/chart_curve_add.png
deleted file mode 100644
index 1cea83d..0000000
Binary files a/source/dev/images/icons/chart_curve_add.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_curve_delete.png b/source/dev/images/icons/chart_curve_delete.png
deleted file mode 100644
index a99837d..0000000
Binary files a/source/dev/images/icons/chart_curve_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_curve_edit.png b/source/dev/images/icons/chart_curve_edit.png
deleted file mode 100644
index 9d0df3d..0000000
Binary files a/source/dev/images/icons/chart_curve_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_curve_error.png b/source/dev/images/icons/chart_curve_error.png
deleted file mode 100644
index 6612fbd..0000000
Binary files a/source/dev/images/icons/chart_curve_error.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_curve_go.png b/source/dev/images/icons/chart_curve_go.png
deleted file mode 100644
index 7408c97..0000000
Binary files a/source/dev/images/icons/chart_curve_go.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_curve_link.png b/source/dev/images/icons/chart_curve_link.png
deleted file mode 100644
index 399758c..0000000
Binary files a/source/dev/images/icons/chart_curve_link.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_line.png b/source/dev/images/icons/chart_line.png
deleted file mode 100644
index 3ea64df..0000000
Binary files a/source/dev/images/icons/chart_line.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_line_add.png b/source/dev/images/icons/chart_line_add.png
deleted file mode 100644
index 24de46b..0000000
Binary files a/source/dev/images/icons/chart_line_add.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_line_delete.png b/source/dev/images/icons/chart_line_delete.png
deleted file mode 100644
index 3d358e3..0000000
Binary files a/source/dev/images/icons/chart_line_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_line_edit.png b/source/dev/images/icons/chart_line_edit.png
deleted file mode 100644
index c1cd9b3..0000000
Binary files a/source/dev/images/icons/chart_line_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_line_error.png b/source/dev/images/icons/chart_line_error.png
deleted file mode 100644
index b9086ba..0000000
Binary files a/source/dev/images/icons/chart_line_error.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_line_link.png b/source/dev/images/icons/chart_line_link.png
deleted file mode 100644
index 5d3fed8..0000000
Binary files a/source/dev/images/icons/chart_line_link.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_organisation.png b/source/dev/images/icons/chart_organisation.png
deleted file mode 100644
index 626ac6e..0000000
Binary files a/source/dev/images/icons/chart_organisation.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_organisation_add.png b/source/dev/images/icons/chart_organisation_add.png
deleted file mode 100644
index 3e0cdf0..0000000
Binary files a/source/dev/images/icons/chart_organisation_add.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_organisation_delete.png b/source/dev/images/icons/chart_organisation_delete.png
deleted file mode 100644
index b7164d9..0000000
Binary files a/source/dev/images/icons/chart_organisation_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_pie.png b/source/dev/images/icons/chart_pie.png
deleted file mode 100644
index 5dd8d95..0000000
Binary files a/source/dev/images/icons/chart_pie.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_pie_add.png b/source/dev/images/icons/chart_pie_add.png
deleted file mode 100644
index 6febd0b..0000000
Binary files a/source/dev/images/icons/chart_pie_add.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_pie_delete.png b/source/dev/images/icons/chart_pie_delete.png
deleted file mode 100644
index a30f5ef..0000000
Binary files a/source/dev/images/icons/chart_pie_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_pie_edit.png b/source/dev/images/icons/chart_pie_edit.png
deleted file mode 100644
index ee6e6fa..0000000
Binary files a/source/dev/images/icons/chart_pie_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_pie_error.png b/source/dev/images/icons/chart_pie_error.png
deleted file mode 100644
index 6539ebb..0000000
Binary files a/source/dev/images/icons/chart_pie_error.png and /dev/null differ
diff --git a/source/dev/images/icons/chart_pie_link.png b/source/dev/images/icons/chart_pie_link.png
deleted file mode 100644
index 1375bb1..0000000
Binary files a/source/dev/images/icons/chart_pie_link.png and /dev/null differ
diff --git a/source/dev/images/icons/clock.png b/source/dev/images/icons/clock.png
deleted file mode 100644
index 62e7ea7..0000000
Binary files a/source/dev/images/icons/clock.png and /dev/null differ
diff --git a/source/dev/images/icons/clock_add.png b/source/dev/images/icons/clock_add.png
deleted file mode 100644
index e148b6a..0000000
Binary files a/source/dev/images/icons/clock_add.png and /dev/null differ
diff --git a/source/dev/images/icons/clock_delete.png b/source/dev/images/icons/clock_delete.png
deleted file mode 100644
index 8168832..0000000
Binary files a/source/dev/images/icons/clock_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/clock_edit.png b/source/dev/images/icons/clock_edit.png
deleted file mode 100644
index ebc139a..0000000
Binary files a/source/dev/images/icons/clock_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/clock_error.png b/source/dev/images/icons/clock_error.png
deleted file mode 100644
index 68141c6..0000000
Binary files a/source/dev/images/icons/clock_error.png and /dev/null differ
diff --git a/source/dev/images/icons/clock_go.png b/source/dev/images/icons/clock_go.png
deleted file mode 100644
index 3b48287..0000000
Binary files a/source/dev/images/icons/clock_go.png and /dev/null differ
diff --git a/source/dev/images/icons/clock_link.png b/source/dev/images/icons/clock_link.png
deleted file mode 100644
index 5b2a780..0000000
Binary files a/source/dev/images/icons/clock_link.png and /dev/null differ
diff --git a/source/dev/images/icons/clock_pause.png b/source/dev/images/icons/clock_pause.png
deleted file mode 100644
index abdd8b0..0000000
Binary files a/source/dev/images/icons/clock_pause.png and /dev/null differ
diff --git a/source/dev/images/icons/clock_play.png b/source/dev/images/icons/clock_play.png
deleted file mode 100644
index 28708fc..0000000
Binary files a/source/dev/images/icons/clock_play.png and /dev/null differ
diff --git a/source/dev/images/icons/clock_red.png b/source/dev/images/icons/clock_red.png
deleted file mode 100644
index 51e7a06..0000000
Binary files a/source/dev/images/icons/clock_red.png and /dev/null differ
diff --git a/source/dev/images/icons/clock_stop.png b/source/dev/images/icons/clock_stop.png
deleted file mode 100644
index 5aa3bd3..0000000
Binary files a/source/dev/images/icons/clock_stop.png and /dev/null differ
diff --git a/source/dev/images/icons/cog.png b/source/dev/images/icons/cog.png
deleted file mode 100644
index 6e5a5e6..0000000
Binary files a/source/dev/images/icons/cog.png and /dev/null differ
diff --git a/source/dev/images/icons/cog_add.png b/source/dev/images/icons/cog_add.png
deleted file mode 100644
index b39fda8..0000000
Binary files a/source/dev/images/icons/cog_add.png and /dev/null differ
diff --git a/source/dev/images/icons/cog_delete.png b/source/dev/images/icons/cog_delete.png
deleted file mode 100644
index 431249b..0000000
Binary files a/source/dev/images/icons/cog_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/cog_edit.png b/source/dev/images/icons/cog_edit.png
deleted file mode 100644
index 8c30380..0000000
Binary files a/source/dev/images/icons/cog_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/cog_error.png b/source/dev/images/icons/cog_error.png
deleted file mode 100644
index e33ac1e..0000000
Binary files a/source/dev/images/icons/cog_error.png and /dev/null differ
diff --git a/source/dev/images/icons/cog_go.png b/source/dev/images/icons/cog_go.png
deleted file mode 100644
index fa14cef..0000000
Binary files a/source/dev/images/icons/cog_go.png and /dev/null differ
diff --git a/source/dev/images/icons/coins.png b/source/dev/images/icons/coins.png
deleted file mode 100644
index 0ca9074..0000000
Binary files a/source/dev/images/icons/coins.png and /dev/null differ
diff --git a/source/dev/images/icons/coins_add.png b/source/dev/images/icons/coins_add.png
deleted file mode 100644
index f1dd310..0000000
Binary files a/source/dev/images/icons/coins_add.png and /dev/null differ
diff --git a/source/dev/images/icons/coins_delete.png b/source/dev/images/icons/coins_delete.png
deleted file mode 100644
index da78c5a..0000000
Binary files a/source/dev/images/icons/coins_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/color_swatch.png b/source/dev/images/icons/color_swatch.png
deleted file mode 100644
index de486e8..0000000
Binary files a/source/dev/images/icons/color_swatch.png and /dev/null differ
diff --git a/source/dev/images/icons/color_wheel.png b/source/dev/images/icons/color_wheel.png
deleted file mode 100644
index c854930..0000000
Binary files a/source/dev/images/icons/color_wheel.png and /dev/null differ
diff --git a/source/dev/images/icons/comment.png b/source/dev/images/icons/comment.png
deleted file mode 100644
index caa9d7b..0000000
Binary files a/source/dev/images/icons/comment.png and /dev/null differ
diff --git a/source/dev/images/icons/comment_add.png b/source/dev/images/icons/comment_add.png
deleted file mode 100644
index 97735b4..0000000
Binary files a/source/dev/images/icons/comment_add.png and /dev/null differ
diff --git a/source/dev/images/icons/comment_delete.png b/source/dev/images/icons/comment_delete.png
deleted file mode 100644
index 8ef09dd..0000000
Binary files a/source/dev/images/icons/comment_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/comment_edit.png b/source/dev/images/icons/comment_edit.png
deleted file mode 100644
index b6cb619..0000000
Binary files a/source/dev/images/icons/comment_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/comments.png b/source/dev/images/icons/comments.png
deleted file mode 100644
index 3ec6f96..0000000
Binary files a/source/dev/images/icons/comments.png and /dev/null differ
diff --git a/source/dev/images/icons/comments_add.png b/source/dev/images/icons/comments_add.png
deleted file mode 100644
index 578afc2..0000000
Binary files a/source/dev/images/icons/comments_add.png and /dev/null differ
diff --git a/source/dev/images/icons/comments_delete.png b/source/dev/images/icons/comments_delete.png
deleted file mode 100644
index ecea2ed..0000000
Binary files a/source/dev/images/icons/comments_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/compress.png b/source/dev/images/icons/compress.png
deleted file mode 100644
index 8606ff0..0000000
Binary files a/source/dev/images/icons/compress.png and /dev/null differ
diff --git a/source/dev/images/icons/computer.png b/source/dev/images/icons/computer.png
deleted file mode 100644
index 9bc37dc..0000000
Binary files a/source/dev/images/icons/computer.png and /dev/null differ
diff --git a/source/dev/images/icons/computer_add.png b/source/dev/images/icons/computer_add.png
deleted file mode 100644
index db604ee..0000000
Binary files a/source/dev/images/icons/computer_add.png and /dev/null differ
diff --git a/source/dev/images/icons/computer_delete.png b/source/dev/images/icons/computer_delete.png
deleted file mode 100644
index 5e9b268..0000000
Binary files a/source/dev/images/icons/computer_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/computer_edit.png b/source/dev/images/icons/computer_edit.png
deleted file mode 100644
index 34c72fe..0000000
Binary files a/source/dev/images/icons/computer_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/computer_error.png b/source/dev/images/icons/computer_error.png
deleted file mode 100644
index b2c3ed5..0000000
Binary files a/source/dev/images/icons/computer_error.png and /dev/null differ
diff --git a/source/dev/images/icons/computer_go.png b/source/dev/images/icons/computer_go.png
deleted file mode 100644
index 0b26144..0000000
Binary files a/source/dev/images/icons/computer_go.png and /dev/null differ
diff --git a/source/dev/images/icons/computer_key.png b/source/dev/images/icons/computer_key.png
deleted file mode 100644
index eca5430..0000000
Binary files a/source/dev/images/icons/computer_key.png and /dev/null differ
diff --git a/source/dev/images/icons/computer_link.png b/source/dev/images/icons/computer_link.png
deleted file mode 100644
index 3859db2..0000000
Binary files a/source/dev/images/icons/computer_link.png and /dev/null differ
diff --git a/source/dev/images/icons/connect.png b/source/dev/images/icons/connect.png
deleted file mode 100644
index 362b60a..0000000
Binary files a/source/dev/images/icons/connect.png and /dev/null differ
diff --git a/source/dev/images/icons/contrast.png b/source/dev/images/icons/contrast.png
deleted file mode 100644
index 7c3ed9c..0000000
Binary files a/source/dev/images/icons/contrast.png and /dev/null differ
diff --git a/source/dev/images/icons/contrast_decrease.png b/source/dev/images/icons/contrast_decrease.png
deleted file mode 100644
index db0c556..0000000
Binary files a/source/dev/images/icons/contrast_decrease.png and /dev/null differ
diff --git a/source/dev/images/icons/contrast_high.png b/source/dev/images/icons/contrast_high.png
deleted file mode 100644
index 7a1f9bf..0000000
Binary files a/source/dev/images/icons/contrast_high.png and /dev/null differ
diff --git a/source/dev/images/icons/contrast_increase.png b/source/dev/images/icons/contrast_increase.png
deleted file mode 100644
index 5789127..0000000
Binary files a/source/dev/images/icons/contrast_increase.png and /dev/null differ
diff --git a/source/dev/images/icons/contrast_low.png b/source/dev/images/icons/contrast_low.png
deleted file mode 100644
index 472fe29..0000000
Binary files a/source/dev/images/icons/contrast_low.png and /dev/null differ
diff --git a/source/dev/images/icons/control_eject.png b/source/dev/images/icons/control_eject.png
deleted file mode 100644
index 891de89..0000000
Binary files a/source/dev/images/icons/control_eject.png and /dev/null differ
diff --git a/source/dev/images/icons/control_eject_blue.png b/source/dev/images/icons/control_eject_blue.png
deleted file mode 100644
index 9d46fbd..0000000
Binary files a/source/dev/images/icons/control_eject_blue.png and /dev/null differ
diff --git a/source/dev/images/icons/control_end.png b/source/dev/images/icons/control_end.png
deleted file mode 100644
index b5d5da2..0000000
Binary files a/source/dev/images/icons/control_end.png and /dev/null differ
diff --git a/source/dev/images/icons/control_end_blue.png b/source/dev/images/icons/control_end_blue.png
deleted file mode 100644
index dc3dd6e..0000000
Binary files a/source/dev/images/icons/control_end_blue.png and /dev/null differ
diff --git a/source/dev/images/icons/control_equalizer.png b/source/dev/images/icons/control_equalizer.png
deleted file mode 100644
index ba4814a..0000000
Binary files a/source/dev/images/icons/control_equalizer.png and /dev/null differ
diff --git a/source/dev/images/icons/control_equalizer_blue.png b/source/dev/images/icons/control_equalizer_blue.png
deleted file mode 100644
index f7daf7d..0000000
Binary files a/source/dev/images/icons/control_equalizer_blue.png and /dev/null differ
diff --git a/source/dev/images/icons/control_fastforward.png b/source/dev/images/icons/control_fastforward.png
deleted file mode 100644
index c6c9f71..0000000
Binary files a/source/dev/images/icons/control_fastforward.png and /dev/null differ
diff --git a/source/dev/images/icons/control_fastforward_blue.png b/source/dev/images/icons/control_fastforward_blue.png
deleted file mode 100644
index 49edee4..0000000
Binary files a/source/dev/images/icons/control_fastforward_blue.png and /dev/null differ
diff --git a/source/dev/images/icons/control_pause.png b/source/dev/images/icons/control_pause.png
deleted file mode 100644
index 462e2f4..0000000
Binary files a/source/dev/images/icons/control_pause.png and /dev/null differ
diff --git a/source/dev/images/icons/control_pause_blue.png b/source/dev/images/icons/control_pause_blue.png
deleted file mode 100644
index f2c7e14..0000000
Binary files a/source/dev/images/icons/control_pause_blue.png and /dev/null differ
diff --git a/source/dev/images/icons/control_play.png b/source/dev/images/icons/control_play.png
deleted file mode 100644
index c719609..0000000
Binary files a/source/dev/images/icons/control_play.png and /dev/null differ
diff --git a/source/dev/images/icons/control_play_blue.png b/source/dev/images/icons/control_play_blue.png
deleted file mode 100644
index 9a754ea..0000000
Binary files a/source/dev/images/icons/control_play_blue.png and /dev/null differ
diff --git a/source/dev/images/icons/control_repeat.png b/source/dev/images/icons/control_repeat.png
deleted file mode 100644
index 601b41d..0000000
Binary files a/source/dev/images/icons/control_repeat.png and /dev/null differ
diff --git a/source/dev/images/icons/control_repeat_blue.png b/source/dev/images/icons/control_repeat_blue.png
deleted file mode 100644
index f9874ae..0000000
Binary files a/source/dev/images/icons/control_repeat_blue.png and /dev/null differ
diff --git a/source/dev/images/icons/control_rewind.png b/source/dev/images/icons/control_rewind.png
deleted file mode 100644
index c2fc4a3..0000000
Binary files a/source/dev/images/icons/control_rewind.png and /dev/null differ
diff --git a/source/dev/images/icons/control_rewind_blue.png b/source/dev/images/icons/control_rewind_blue.png
deleted file mode 100644
index 0ca473d..0000000
Binary files a/source/dev/images/icons/control_rewind_blue.png and /dev/null differ
diff --git a/source/dev/images/icons/control_start.png b/source/dev/images/icons/control_start.png
deleted file mode 100644
index 9d81ebd..0000000
Binary files a/source/dev/images/icons/control_start.png and /dev/null differ
diff --git a/source/dev/images/icons/control_start_blue.png b/source/dev/images/icons/control_start_blue.png
deleted file mode 100644
index 1cbf040..0000000
Binary files a/source/dev/images/icons/control_start_blue.png and /dev/null differ
diff --git a/source/dev/images/icons/control_stop.png b/source/dev/images/icons/control_stop.png
deleted file mode 100644
index 3a2bced..0000000
Binary files a/source/dev/images/icons/control_stop.png and /dev/null differ
diff --git a/source/dev/images/icons/control_stop_blue.png b/source/dev/images/icons/control_stop_blue.png
deleted file mode 100644
index 9589a2a..0000000
Binary files a/source/dev/images/icons/control_stop_blue.png and /dev/null differ
diff --git a/source/dev/images/icons/controller.png b/source/dev/images/icons/controller.png
deleted file mode 100644
index 93fabda..0000000
Binary files a/source/dev/images/icons/controller.png and /dev/null differ
diff --git a/source/dev/images/icons/controller_add.png b/source/dev/images/icons/controller_add.png
deleted file mode 100644
index fa31e07..0000000
Binary files a/source/dev/images/icons/controller_add.png and /dev/null differ
diff --git a/source/dev/images/icons/controller_delete.png b/source/dev/images/icons/controller_delete.png
deleted file mode 100644
index 931b16d..0000000
Binary files a/source/dev/images/icons/controller_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/controller_error.png b/source/dev/images/icons/controller_error.png
deleted file mode 100644
index ed93b8b..0000000
Binary files a/source/dev/images/icons/controller_error.png and /dev/null differ
diff --git a/source/dev/images/icons/creditcards.png b/source/dev/images/icons/creditcards.png
deleted file mode 100644
index 807b539..0000000
Binary files a/source/dev/images/icons/creditcards.png and /dev/null differ
diff --git a/source/dev/images/icons/cross.png b/source/dev/images/icons/cross.png
deleted file mode 100644
index 9fc6a8c..0000000
Binary files a/source/dev/images/icons/cross.png and /dev/null differ
diff --git a/source/dev/images/icons/css.png b/source/dev/images/icons/css.png
deleted file mode 100644
index 23f3101..0000000
Binary files a/source/dev/images/icons/css.png and /dev/null differ
diff --git a/source/dev/images/icons/css_add.png b/source/dev/images/icons/css_add.png
deleted file mode 100644
index 678e65b..0000000
Binary files a/source/dev/images/icons/css_add.png and /dev/null differ
diff --git a/source/dev/images/icons/css_delete.png b/source/dev/images/icons/css_delete.png
deleted file mode 100644
index 326aba4..0000000
Binary files a/source/dev/images/icons/css_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/css_go.png b/source/dev/images/icons/css_go.png
deleted file mode 100644
index 6cdf38c..0000000
Binary files a/source/dev/images/icons/css_go.png and /dev/null differ
diff --git a/source/dev/images/icons/css_valid.png b/source/dev/images/icons/css_valid.png
deleted file mode 100644
index 4c72ca5..0000000
Binary files a/source/dev/images/icons/css_valid.png and /dev/null differ
diff --git a/source/dev/images/icons/cup.png b/source/dev/images/icons/cup.png
deleted file mode 100644
index 7f189fe..0000000
Binary files a/source/dev/images/icons/cup.png and /dev/null differ
diff --git a/source/dev/images/icons/cup_add.png b/source/dev/images/icons/cup_add.png
deleted file mode 100644
index 5ec23e8..0000000
Binary files a/source/dev/images/icons/cup_add.png and /dev/null differ
diff --git a/source/dev/images/icons/cup_delete.png b/source/dev/images/icons/cup_delete.png
deleted file mode 100644
index 896f5e1..0000000
Binary files a/source/dev/images/icons/cup_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/cup_edit.png b/source/dev/images/icons/cup_edit.png
deleted file mode 100644
index 5eb44b6..0000000
Binary files a/source/dev/images/icons/cup_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/cup_error.png b/source/dev/images/icons/cup_error.png
deleted file mode 100644
index 833133a..0000000
Binary files a/source/dev/images/icons/cup_error.png and /dev/null differ
diff --git a/source/dev/images/icons/cup_go.png b/source/dev/images/icons/cup_go.png
deleted file mode 100644
index ddd6194..0000000
Binary files a/source/dev/images/icons/cup_go.png and /dev/null differ
diff --git a/source/dev/images/icons/cup_key.png b/source/dev/images/icons/cup_key.png
deleted file mode 100644
index eec00a6..0000000
Binary files a/source/dev/images/icons/cup_key.png and /dev/null differ
diff --git a/source/dev/images/icons/cup_link.png b/source/dev/images/icons/cup_link.png
deleted file mode 100644
index 542033a..0000000
Binary files a/source/dev/images/icons/cup_link.png and /dev/null differ
diff --git a/source/dev/images/icons/cursor.png b/source/dev/images/icons/cursor.png
deleted file mode 100644
index 17344a8..0000000
Binary files a/source/dev/images/icons/cursor.png and /dev/null differ
diff --git a/source/dev/images/icons/cut.png b/source/dev/images/icons/cut.png
deleted file mode 100644
index c27c45b..0000000
Binary files a/source/dev/images/icons/cut.png and /dev/null differ
diff --git a/source/dev/images/icons/cut_red.png b/source/dev/images/icons/cut_red.png
deleted file mode 100644
index 36e474a..0000000
Binary files a/source/dev/images/icons/cut_red.png and /dev/null differ
diff --git a/source/dev/images/icons/database.png b/source/dev/images/icons/database.png
deleted file mode 100644
index 1f17080..0000000
Binary files a/source/dev/images/icons/database.png and /dev/null differ
diff --git a/source/dev/images/icons/database_add.png b/source/dev/images/icons/database_add.png
deleted file mode 100644
index 567f7ae..0000000
Binary files a/source/dev/images/icons/database_add.png and /dev/null differ
diff --git a/source/dev/images/icons/database_connect.png b/source/dev/images/icons/database_connect.png
deleted file mode 100644
index 3a11197..0000000
Binary files a/source/dev/images/icons/database_connect.png and /dev/null differ
diff --git a/source/dev/images/icons/database_delete.png b/source/dev/images/icons/database_delete.png
deleted file mode 100644
index cce652e..0000000
Binary files a/source/dev/images/icons/database_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/database_edit.png b/source/dev/images/icons/database_edit.png
deleted file mode 100644
index 2283999..0000000
Binary files a/source/dev/images/icons/database_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/database_error.png b/source/dev/images/icons/database_error.png
deleted file mode 100644
index 578221a..0000000
Binary files a/source/dev/images/icons/database_error.png and /dev/null differ
diff --git a/source/dev/images/icons/database_gear.png b/source/dev/images/icons/database_gear.png
deleted file mode 100644
index 682f845..0000000
Binary files a/source/dev/images/icons/database_gear.png and /dev/null differ
diff --git a/source/dev/images/icons/database_go.png b/source/dev/images/icons/database_go.png
deleted file mode 100644
index 61a8556..0000000
Binary files a/source/dev/images/icons/database_go.png and /dev/null differ
diff --git a/source/dev/images/icons/database_key.png b/source/dev/images/icons/database_key.png
deleted file mode 100644
index a934924..0000000
Binary files a/source/dev/images/icons/database_key.png and /dev/null differ
diff --git a/source/dev/images/icons/database_lightning.png b/source/dev/images/icons/database_lightning.png
deleted file mode 100644
index d9eefc2..0000000
Binary files a/source/dev/images/icons/database_lightning.png and /dev/null differ
diff --git a/source/dev/images/icons/database_link.png b/source/dev/images/icons/database_link.png
deleted file mode 100644
index be4ca6c..0000000
Binary files a/source/dev/images/icons/database_link.png and /dev/null differ
diff --git a/source/dev/images/icons/database_refresh.png b/source/dev/images/icons/database_refresh.png
deleted file mode 100644
index ff803be..0000000
Binary files a/source/dev/images/icons/database_refresh.png and /dev/null differ
diff --git a/source/dev/images/icons/database_save.png b/source/dev/images/icons/database_save.png
deleted file mode 100644
index 44c06dd..0000000
Binary files a/source/dev/images/icons/database_save.png and /dev/null differ
diff --git a/source/dev/images/icons/database_table.png b/source/dev/images/icons/database_table.png
deleted file mode 100644
index 2561438..0000000
Binary files a/source/dev/images/icons/database_table.png and /dev/null differ
diff --git a/source/dev/images/icons/date.png b/source/dev/images/icons/date.png
deleted file mode 100644
index 2a61424..0000000
Binary files a/source/dev/images/icons/date.png and /dev/null differ
diff --git a/source/dev/images/icons/date_add.png b/source/dev/images/icons/date_add.png
deleted file mode 100644
index 846c41a..0000000
Binary files a/source/dev/images/icons/date_add.png and /dev/null differ
diff --git a/source/dev/images/icons/date_delete.png b/source/dev/images/icons/date_delete.png
deleted file mode 100644
index d3a1728..0000000
Binary files a/source/dev/images/icons/date_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/date_edit.png b/source/dev/images/icons/date_edit.png
deleted file mode 100644
index 11cc9c6..0000000
Binary files a/source/dev/images/icons/date_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/date_error.png b/source/dev/images/icons/date_error.png
deleted file mode 100644
index 30264a6..0000000
Binary files a/source/dev/images/icons/date_error.png and /dev/null differ
diff --git a/source/dev/images/icons/date_go.png b/source/dev/images/icons/date_go.png
deleted file mode 100644
index 7d8dfe7..0000000
Binary files a/source/dev/images/icons/date_go.png and /dev/null differ
diff --git a/source/dev/images/icons/date_link.png b/source/dev/images/icons/date_link.png
deleted file mode 100644
index 271961b..0000000
Binary files a/source/dev/images/icons/date_link.png and /dev/null differ
diff --git a/source/dev/images/icons/date_magnify.png b/source/dev/images/icons/date_magnify.png
deleted file mode 100644
index 133151c..0000000
Binary files a/source/dev/images/icons/date_magnify.png and /dev/null differ
diff --git a/source/dev/images/icons/date_next.png b/source/dev/images/icons/date_next.png
deleted file mode 100644
index d34a93c..0000000
Binary files a/source/dev/images/icons/date_next.png and /dev/null differ
diff --git a/source/dev/images/icons/date_previous.png b/source/dev/images/icons/date_previous.png
deleted file mode 100644
index 6945b5f..0000000
Binary files a/source/dev/images/icons/date_previous.png and /dev/null differ
diff --git a/source/dev/images/icons/delete.png b/source/dev/images/icons/delete.png
deleted file mode 100644
index a070cd8..0000000
Binary files a/source/dev/images/icons/delete.png and /dev/null differ
diff --git a/source/dev/images/icons/disconnect.png b/source/dev/images/icons/disconnect.png
deleted file mode 100644
index 80f9e77..0000000
Binary files a/source/dev/images/icons/disconnect.png and /dev/null differ
diff --git a/source/dev/images/icons/disk.png b/source/dev/images/icons/disk.png
deleted file mode 100644
index 99d532e..0000000
Binary files a/source/dev/images/icons/disk.png and /dev/null differ
diff --git a/source/dev/images/icons/disk_multiple.png b/source/dev/images/icons/disk_multiple.png
deleted file mode 100644
index d256081..0000000
Binary files a/source/dev/images/icons/disk_multiple.png and /dev/null differ
diff --git a/source/dev/images/icons/door.png b/source/dev/images/icons/door.png
deleted file mode 100644
index 369fc46..0000000
Binary files a/source/dev/images/icons/door.png and /dev/null differ
diff --git a/source/dev/images/icons/door_in.png b/source/dev/images/icons/door_in.png
deleted file mode 100644
index 41676a0..0000000
Binary files a/source/dev/images/icons/door_in.png and /dev/null differ
diff --git a/source/dev/images/icons/door_open.png b/source/dev/images/icons/door_open.png
deleted file mode 100644
index 64bab57..0000000
Binary files a/source/dev/images/icons/door_open.png and /dev/null differ
diff --git a/source/dev/images/icons/door_out.png b/source/dev/images/icons/door_out.png
deleted file mode 100644
index 2541d2b..0000000
Binary files a/source/dev/images/icons/door_out.png and /dev/null differ
diff --git a/source/dev/images/icons/drink.png b/source/dev/images/icons/drink.png
deleted file mode 100644
index 984ab57..0000000
Binary files a/source/dev/images/icons/drink.png and /dev/null differ
diff --git a/source/dev/images/icons/drink_empty.png b/source/dev/images/icons/drink_empty.png
deleted file mode 100644
index bcbcf43..0000000
Binary files a/source/dev/images/icons/drink_empty.png and /dev/null differ
diff --git a/source/dev/images/icons/drive.png b/source/dev/images/icons/drive.png
deleted file mode 100644
index fc13bb1..0000000
Binary files a/source/dev/images/icons/drive.png and /dev/null differ
diff --git a/source/dev/images/icons/drive_add.png b/source/dev/images/icons/drive_add.png
deleted file mode 100644
index f3e6e17..0000000
Binary files a/source/dev/images/icons/drive_add.png and /dev/null differ
diff --git a/source/dev/images/icons/drive_burn.png b/source/dev/images/icons/drive_burn.png
deleted file mode 100644
index 80fd79f..0000000
Binary files a/source/dev/images/icons/drive_burn.png and /dev/null differ
diff --git a/source/dev/images/icons/drive_cd.png b/source/dev/images/icons/drive_cd.png
deleted file mode 100644
index 36bd3b4..0000000
Binary files a/source/dev/images/icons/drive_cd.png and /dev/null differ
diff --git a/source/dev/images/icons/drive_cd_empty.png b/source/dev/images/icons/drive_cd_empty.png
deleted file mode 100644
index ac61c14..0000000
Binary files a/source/dev/images/icons/drive_cd_empty.png and /dev/null differ
diff --git a/source/dev/images/icons/drive_delete.png b/source/dev/images/icons/drive_delete.png
deleted file mode 100644
index e6eb186..0000000
Binary files a/source/dev/images/icons/drive_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/drive_disk.png b/source/dev/images/icons/drive_disk.png
deleted file mode 100644
index 5a51e81..0000000
Binary files a/source/dev/images/icons/drive_disk.png and /dev/null differ
diff --git a/source/dev/images/icons/drive_edit.png b/source/dev/images/icons/drive_edit.png
deleted file mode 100644
index 0149c70..0000000
Binary files a/source/dev/images/icons/drive_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/drive_error.png b/source/dev/images/icons/drive_error.png
deleted file mode 100644
index 309f639..0000000
Binary files a/source/dev/images/icons/drive_error.png and /dev/null differ
diff --git a/source/dev/images/icons/drive_go.png b/source/dev/images/icons/drive_go.png
deleted file mode 100644
index fc53379..0000000
Binary files a/source/dev/images/icons/drive_go.png and /dev/null differ
diff --git a/source/dev/images/icons/drive_key.png b/source/dev/images/icons/drive_key.png
deleted file mode 100644
index d0b3c67..0000000
Binary files a/source/dev/images/icons/drive_key.png and /dev/null differ
diff --git a/source/dev/images/icons/drive_link.png b/source/dev/images/icons/drive_link.png
deleted file mode 100644
index 3a34e1b..0000000
Binary files a/source/dev/images/icons/drive_link.png and /dev/null differ
diff --git a/source/dev/images/icons/drive_magnify.png b/source/dev/images/icons/drive_magnify.png
deleted file mode 100644
index 0f0f444..0000000
Binary files a/source/dev/images/icons/drive_magnify.png and /dev/null differ
diff --git a/source/dev/images/icons/drive_network.png b/source/dev/images/icons/drive_network.png
deleted file mode 100644
index 63d2d5d..0000000
Binary files a/source/dev/images/icons/drive_network.png and /dev/null differ
diff --git a/source/dev/images/icons/drive_rename.png b/source/dev/images/icons/drive_rename.png
deleted file mode 100644
index e8b8443..0000000
Binary files a/source/dev/images/icons/drive_rename.png and /dev/null differ
diff --git a/source/dev/images/icons/drive_user.png b/source/dev/images/icons/drive_user.png
deleted file mode 100644
index 0b4751c..0000000
Binary files a/source/dev/images/icons/drive_user.png and /dev/null differ
diff --git a/source/dev/images/icons/drive_web.png b/source/dev/images/icons/drive_web.png
deleted file mode 100644
index 8850a83..0000000
Binary files a/source/dev/images/icons/drive_web.png and /dev/null differ
diff --git a/source/dev/images/icons/dvd.png b/source/dev/images/icons/dvd.png
deleted file mode 100644
index 4461dd6..0000000
Binary files a/source/dev/images/icons/dvd.png and /dev/null differ
diff --git a/source/dev/images/icons/dvd_add.png b/source/dev/images/icons/dvd_add.png
deleted file mode 100644
index f76aff9..0000000
Binary files a/source/dev/images/icons/dvd_add.png and /dev/null differ
diff --git a/source/dev/images/icons/dvd_delete.png b/source/dev/images/icons/dvd_delete.png
deleted file mode 100644
index 15a4bd5..0000000
Binary files a/source/dev/images/icons/dvd_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/dvd_edit.png b/source/dev/images/icons/dvd_edit.png
deleted file mode 100644
index 89d5a58..0000000
Binary files a/source/dev/images/icons/dvd_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/dvd_error.png b/source/dev/images/icons/dvd_error.png
deleted file mode 100644
index 924ff01..0000000
Binary files a/source/dev/images/icons/dvd_error.png and /dev/null differ
diff --git a/source/dev/images/icons/dvd_go.png b/source/dev/images/icons/dvd_go.png
deleted file mode 100644
index 7f9b20a..0000000
Binary files a/source/dev/images/icons/dvd_go.png and /dev/null differ
diff --git a/source/dev/images/icons/dvd_key.png b/source/dev/images/icons/dvd_key.png
deleted file mode 100644
index af86bf1..0000000
Binary files a/source/dev/images/icons/dvd_key.png and /dev/null differ
diff --git a/source/dev/images/icons/dvd_link.png b/source/dev/images/icons/dvd_link.png
deleted file mode 100644
index a1c8ba5..0000000
Binary files a/source/dev/images/icons/dvd_link.png and /dev/null differ
diff --git a/source/dev/images/icons/email.png b/source/dev/images/icons/email.png
deleted file mode 100644
index 6c70843..0000000
Binary files a/source/dev/images/icons/email.png and /dev/null differ
diff --git a/source/dev/images/icons/email_add.png b/source/dev/images/icons/email_add.png
deleted file mode 100644
index 787ad0f..0000000
Binary files a/source/dev/images/icons/email_add.png and /dev/null differ
diff --git a/source/dev/images/icons/email_attach.png b/source/dev/images/icons/email_attach.png
deleted file mode 100644
index 71d7318..0000000
Binary files a/source/dev/images/icons/email_attach.png and /dev/null differ
diff --git a/source/dev/images/icons/email_delete.png b/source/dev/images/icons/email_delete.png
deleted file mode 100644
index ef90919..0000000
Binary files a/source/dev/images/icons/email_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/email_edit.png b/source/dev/images/icons/email_edit.png
deleted file mode 100644
index 7f1429e..0000000
Binary files a/source/dev/images/icons/email_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/email_error.png b/source/dev/images/icons/email_error.png
deleted file mode 100644
index 3a0e230..0000000
Binary files a/source/dev/images/icons/email_error.png and /dev/null differ
diff --git a/source/dev/images/icons/email_go.png b/source/dev/images/icons/email_go.png
deleted file mode 100644
index 1d78f05..0000000
Binary files a/source/dev/images/icons/email_go.png and /dev/null differ
diff --git a/source/dev/images/icons/email_link.png b/source/dev/images/icons/email_link.png
deleted file mode 100644
index b18bb97..0000000
Binary files a/source/dev/images/icons/email_link.png and /dev/null differ
diff --git a/source/dev/images/icons/email_open.png b/source/dev/images/icons/email_open.png
deleted file mode 100644
index c5566bb..0000000
Binary files a/source/dev/images/icons/email_open.png and /dev/null differ
diff --git a/source/dev/images/icons/email_open_image.png b/source/dev/images/icons/email_open_image.png
deleted file mode 100644
index 3a8ffd7..0000000
Binary files a/source/dev/images/icons/email_open_image.png and /dev/null differ
diff --git a/source/dev/images/icons/emoticon_evilgrin.png b/source/dev/images/icons/emoticon_evilgrin.png
deleted file mode 100644
index 80a193c..0000000
Binary files a/source/dev/images/icons/emoticon_evilgrin.png and /dev/null differ
diff --git a/source/dev/images/icons/emoticon_grin.png b/source/dev/images/icons/emoticon_grin.png
deleted file mode 100644
index f6efa34..0000000
Binary files a/source/dev/images/icons/emoticon_grin.png and /dev/null differ
diff --git a/source/dev/images/icons/emoticon_happy.png b/source/dev/images/icons/emoticon_happy.png
deleted file mode 100644
index 7c63925..0000000
Binary files a/source/dev/images/icons/emoticon_happy.png and /dev/null differ
diff --git a/source/dev/images/icons/emoticon_smile.png b/source/dev/images/icons/emoticon_smile.png
deleted file mode 100644
index 3b94e4e..0000000
Binary files a/source/dev/images/icons/emoticon_smile.png and /dev/null differ
diff --git a/source/dev/images/icons/emoticon_surprised.png b/source/dev/images/icons/emoticon_surprised.png
deleted file mode 100644
index 3bd1e58..0000000
Binary files a/source/dev/images/icons/emoticon_surprised.png and /dev/null differ
diff --git a/source/dev/images/icons/emoticon_tongue.png b/source/dev/images/icons/emoticon_tongue.png
deleted file mode 100644
index 0f2e069..0000000
Binary files a/source/dev/images/icons/emoticon_tongue.png and /dev/null differ
diff --git a/source/dev/images/icons/emoticon_unhappy.png b/source/dev/images/icons/emoticon_unhappy.png
deleted file mode 100644
index fd5bc07..0000000
Binary files a/source/dev/images/icons/emoticon_unhappy.png and /dev/null differ
diff --git a/source/dev/images/icons/emoticon_waii.png b/source/dev/images/icons/emoticon_waii.png
deleted file mode 100644
index 4f09e46..0000000
Binary files a/source/dev/images/icons/emoticon_waii.png and /dev/null differ
diff --git a/source/dev/images/icons/emoticon_wink.png b/source/dev/images/icons/emoticon_wink.png
deleted file mode 100644
index 6635343..0000000
Binary files a/source/dev/images/icons/emoticon_wink.png and /dev/null differ
diff --git a/source/dev/images/icons/error.png b/source/dev/images/icons/error.png
deleted file mode 100644
index f2e2e99..0000000
Binary files a/source/dev/images/icons/error.png and /dev/null differ
diff --git a/source/dev/images/icons/error_add.png b/source/dev/images/icons/error_add.png
deleted file mode 100644
index 21c486c..0000000
Binary files a/source/dev/images/icons/error_add.png and /dev/null differ
diff --git a/source/dev/images/icons/error_delete.png b/source/dev/images/icons/error_delete.png
deleted file mode 100644
index f77aa99..0000000
Binary files a/source/dev/images/icons/error_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/error_go.png b/source/dev/images/icons/error_go.png
deleted file mode 100644
index 80cd876..0000000
Binary files a/source/dev/images/icons/error_go.png and /dev/null differ
diff --git a/source/dev/images/icons/exclamation.png b/source/dev/images/icons/exclamation.png
deleted file mode 100644
index 84898d9..0000000
Binary files a/source/dev/images/icons/exclamation.png and /dev/null differ
diff --git a/source/dev/images/icons/eye.png b/source/dev/images/icons/eye.png
deleted file mode 100644
index fe5d85a..0000000
Binary files a/source/dev/images/icons/eye.png and /dev/null differ
diff --git a/source/dev/images/icons/feed.png b/source/dev/images/icons/feed.png
deleted file mode 100644
index f8d0f88..0000000
Binary files a/source/dev/images/icons/feed.png and /dev/null differ
diff --git a/source/dev/images/icons/feed_add.png b/source/dev/images/icons/feed_add.png
deleted file mode 100644
index a5a4829..0000000
Binary files a/source/dev/images/icons/feed_add.png and /dev/null differ
diff --git a/source/dev/images/icons/feed_delete.png b/source/dev/images/icons/feed_delete.png
deleted file mode 100644
index f81952c..0000000
Binary files a/source/dev/images/icons/feed_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/feed_disk.png b/source/dev/images/icons/feed_disk.png
deleted file mode 100644
index a158c99..0000000
Binary files a/source/dev/images/icons/feed_disk.png and /dev/null differ
diff --git a/source/dev/images/icons/feed_edit.png b/source/dev/images/icons/feed_edit.png
deleted file mode 100644
index 3752de1..0000000
Binary files a/source/dev/images/icons/feed_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/feed_error.png b/source/dev/images/icons/feed_error.png
deleted file mode 100644
index 8a3fb8e..0000000
Binary files a/source/dev/images/icons/feed_error.png and /dev/null differ
diff --git a/source/dev/images/icons/feed_go.png b/source/dev/images/icons/feed_go.png
deleted file mode 100644
index 6d64ce2..0000000
Binary files a/source/dev/images/icons/feed_go.png and /dev/null differ
diff --git a/source/dev/images/icons/feed_key.png b/source/dev/images/icons/feed_key.png
deleted file mode 100644
index f2fd7c5..0000000
Binary files a/source/dev/images/icons/feed_key.png and /dev/null differ
diff --git a/source/dev/images/icons/feed_link.png b/source/dev/images/icons/feed_link.png
deleted file mode 100644
index 5494602..0000000
Binary files a/source/dev/images/icons/feed_link.png and /dev/null differ
diff --git a/source/dev/images/icons/feed_magnify.png b/source/dev/images/icons/feed_magnify.png
deleted file mode 100644
index 475c016..0000000
Binary files a/source/dev/images/icons/feed_magnify.png and /dev/null differ
diff --git a/source/dev/images/icons/female.png b/source/dev/images/icons/female.png
deleted file mode 100644
index 659f850..0000000
Binary files a/source/dev/images/icons/female.png and /dev/null differ
diff --git a/source/dev/images/icons/film.png b/source/dev/images/icons/film.png
deleted file mode 100644
index ba10917..0000000
Binary files a/source/dev/images/icons/film.png and /dev/null differ
diff --git a/source/dev/images/icons/film_add.png b/source/dev/images/icons/film_add.png
deleted file mode 100644
index e8bd813..0000000
Binary files a/source/dev/images/icons/film_add.png and /dev/null differ
diff --git a/source/dev/images/icons/film_delete.png b/source/dev/images/icons/film_delete.png
deleted file mode 100644
index 9e6c821..0000000
Binary files a/source/dev/images/icons/film_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/film_edit.png b/source/dev/images/icons/film_edit.png
deleted file mode 100644
index f369865..0000000
Binary files a/source/dev/images/icons/film_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/film_error.png b/source/dev/images/icons/film_error.png
deleted file mode 100644
index 4d98eaa..0000000
Binary files a/source/dev/images/icons/film_error.png and /dev/null differ
diff --git a/source/dev/images/icons/film_go.png b/source/dev/images/icons/film_go.png
deleted file mode 100644
index 315a703..0000000
Binary files a/source/dev/images/icons/film_go.png and /dev/null differ
diff --git a/source/dev/images/icons/film_key.png b/source/dev/images/icons/film_key.png
deleted file mode 100644
index 57860b5..0000000
Binary files a/source/dev/images/icons/film_key.png and /dev/null differ
diff --git a/source/dev/images/icons/film_link.png b/source/dev/images/icons/film_link.png
deleted file mode 100644
index 4b17e0e..0000000
Binary files a/source/dev/images/icons/film_link.png and /dev/null differ
diff --git a/source/dev/images/icons/film_save.png b/source/dev/images/icons/film_save.png
deleted file mode 100644
index bc8c0d3..0000000
Binary files a/source/dev/images/icons/film_save.png and /dev/null differ
diff --git a/source/dev/images/icons/find.png b/source/dev/images/icons/find.png
deleted file mode 100644
index b4eeed6..0000000
Binary files a/source/dev/images/icons/find.png and /dev/null differ
diff --git a/source/dev/images/icons/flag_blue.png b/source/dev/images/icons/flag_blue.png
deleted file mode 100644
index bbbd8fa..0000000
Binary files a/source/dev/images/icons/flag_blue.png and /dev/null differ
diff --git a/source/dev/images/icons/flag_green.png b/source/dev/images/icons/flag_green.png
deleted file mode 100644
index 9bf0783..0000000
Binary files a/source/dev/images/icons/flag_green.png and /dev/null differ
diff --git a/source/dev/images/icons/flag_orange.png b/source/dev/images/icons/flag_orange.png
deleted file mode 100644
index 0df74eb..0000000
Binary files a/source/dev/images/icons/flag_orange.png and /dev/null differ
diff --git a/source/dev/images/icons/flag_pink.png b/source/dev/images/icons/flag_pink.png
deleted file mode 100644
index 0980881..0000000
Binary files a/source/dev/images/icons/flag_pink.png and /dev/null differ
diff --git a/source/dev/images/icons/flag_purple.png b/source/dev/images/icons/flag_purple.png
deleted file mode 100644
index c94a015..0000000
Binary files a/source/dev/images/icons/flag_purple.png and /dev/null differ
diff --git a/source/dev/images/icons/flag_red.png b/source/dev/images/icons/flag_red.png
deleted file mode 100644
index 1f0da31..0000000
Binary files a/source/dev/images/icons/flag_red.png and /dev/null differ
diff --git a/source/dev/images/icons/flag_yellow.png b/source/dev/images/icons/flag_yellow.png
deleted file mode 100644
index 4a3cf32..0000000
Binary files a/source/dev/images/icons/flag_yellow.png and /dev/null differ
diff --git a/source/dev/images/icons/folder.png b/source/dev/images/icons/folder.png
deleted file mode 100644
index 784e8fa..0000000
Binary files a/source/dev/images/icons/folder.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_add.png b/source/dev/images/icons/folder_add.png
deleted file mode 100644
index 816e082..0000000
Binary files a/source/dev/images/icons/folder_add.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_bell.png b/source/dev/images/icons/folder_bell.png
deleted file mode 100644
index d3d13f1..0000000
Binary files a/source/dev/images/icons/folder_bell.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_brick.png b/source/dev/images/icons/folder_brick.png
deleted file mode 100644
index b0415dc..0000000
Binary files a/source/dev/images/icons/folder_brick.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_bug.png b/source/dev/images/icons/folder_bug.png
deleted file mode 100644
index 11a3f15..0000000
Binary files a/source/dev/images/icons/folder_bug.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_camera.png b/source/dev/images/icons/folder_camera.png
deleted file mode 100644
index c951941..0000000
Binary files a/source/dev/images/icons/folder_camera.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_database.png b/source/dev/images/icons/folder_database.png
deleted file mode 100644
index 5193e2e..0000000
Binary files a/source/dev/images/icons/folder_database.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_delete.png b/source/dev/images/icons/folder_delete.png
deleted file mode 100644
index da30cbb..0000000
Binary files a/source/dev/images/icons/folder_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_edit.png b/source/dev/images/icons/folder_edit.png
deleted file mode 100644
index e53ac4f..0000000
Binary files a/source/dev/images/icons/folder_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_error.png b/source/dev/images/icons/folder_error.png
deleted file mode 100644
index 5c2d07f..0000000
Binary files a/source/dev/images/icons/folder_error.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_explore.png b/source/dev/images/icons/folder_explore.png
deleted file mode 100644
index b9c7492..0000000
Binary files a/source/dev/images/icons/folder_explore.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_feed.png b/source/dev/images/icons/folder_feed.png
deleted file mode 100644
index d06ee51..0000000
Binary files a/source/dev/images/icons/folder_feed.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_find.png b/source/dev/images/icons/folder_find.png
deleted file mode 100644
index d0b24b2..0000000
Binary files a/source/dev/images/icons/folder_find.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_go.png b/source/dev/images/icons/folder_go.png
deleted file mode 100644
index 34a736f..0000000
Binary files a/source/dev/images/icons/folder_go.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_heart.png b/source/dev/images/icons/folder_heart.png
deleted file mode 100644
index b0d2bc3..0000000
Binary files a/source/dev/images/icons/folder_heart.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_image.png b/source/dev/images/icons/folder_image.png
deleted file mode 100644
index d5df75b..0000000
Binary files a/source/dev/images/icons/folder_image.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_key.png b/source/dev/images/icons/folder_key.png
deleted file mode 100644
index fb9b4c2..0000000
Binary files a/source/dev/images/icons/folder_key.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_lightbulb.png b/source/dev/images/icons/folder_lightbulb.png
deleted file mode 100644
index e0d9a34..0000000
Binary files a/source/dev/images/icons/folder_lightbulb.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_link.png b/source/dev/images/icons/folder_link.png
deleted file mode 100644
index 7e309de..0000000
Binary files a/source/dev/images/icons/folder_link.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_magnify.png b/source/dev/images/icons/folder_magnify.png
deleted file mode 100644
index 0a3e798..0000000
Binary files a/source/dev/images/icons/folder_magnify.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_page.png b/source/dev/images/icons/folder_page.png
deleted file mode 100644
index 1ef6e11..0000000
Binary files a/source/dev/images/icons/folder_page.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_page_white.png b/source/dev/images/icons/folder_page_white.png
deleted file mode 100644
index 6ad4b5d..0000000
Binary files a/source/dev/images/icons/folder_page_white.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_palette.png b/source/dev/images/icons/folder_palette.png
deleted file mode 100644
index 9e50f84..0000000
Binary files a/source/dev/images/icons/folder_palette.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_picture.png b/source/dev/images/icons/folder_picture.png
deleted file mode 100644
index 052b336..0000000
Binary files a/source/dev/images/icons/folder_picture.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_star.png b/source/dev/images/icons/folder_star.png
deleted file mode 100644
index 135a6c1..0000000
Binary files a/source/dev/images/icons/folder_star.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_table.png b/source/dev/images/icons/folder_table.png
deleted file mode 100644
index 473cee3..0000000
Binary files a/source/dev/images/icons/folder_table.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_user.png b/source/dev/images/icons/folder_user.png
deleted file mode 100644
index f021c3e..0000000
Binary files a/source/dev/images/icons/folder_user.png and /dev/null differ
diff --git a/source/dev/images/icons/folder_wrench.png b/source/dev/images/icons/folder_wrench.png
deleted file mode 100644
index 0cfe80a..0000000
Binary files a/source/dev/images/icons/folder_wrench.png and /dev/null differ
diff --git a/source/dev/images/icons/font.png b/source/dev/images/icons/font.png
deleted file mode 100644
index 8067f31..0000000
Binary files a/source/dev/images/icons/font.png and /dev/null differ
diff --git a/source/dev/images/icons/font_add.png b/source/dev/images/icons/font_add.png
deleted file mode 100644
index 166a6d5..0000000
Binary files a/source/dev/images/icons/font_add.png and /dev/null differ
diff --git a/source/dev/images/icons/font_delete.png b/source/dev/images/icons/font_delete.png
deleted file mode 100644
index 8a5e58e..0000000
Binary files a/source/dev/images/icons/font_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/font_go.png b/source/dev/images/icons/font_go.png
deleted file mode 100644
index 6e431b0..0000000
Binary files a/source/dev/images/icons/font_go.png and /dev/null differ
diff --git a/source/dev/images/icons/group.png b/source/dev/images/icons/group.png
deleted file mode 100644
index 348d4e5..0000000
Binary files a/source/dev/images/icons/group.png and /dev/null differ
diff --git a/source/dev/images/icons/group_add.png b/source/dev/images/icons/group_add.png
deleted file mode 100644
index e2b590e..0000000
Binary files a/source/dev/images/icons/group_add.png and /dev/null differ
diff --git a/source/dev/images/icons/group_delete.png b/source/dev/images/icons/group_delete.png
deleted file mode 100644
index e752af7..0000000
Binary files a/source/dev/images/icons/group_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/group_edit.png b/source/dev/images/icons/group_edit.png
deleted file mode 100644
index 8a47db5..0000000
Binary files a/source/dev/images/icons/group_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/group_error.png b/source/dev/images/icons/group_error.png
deleted file mode 100644
index b983cf5..0000000
Binary files a/source/dev/images/icons/group_error.png and /dev/null differ
diff --git a/source/dev/images/icons/group_gear.png b/source/dev/images/icons/group_gear.png
deleted file mode 100644
index fb7b43d..0000000
Binary files a/source/dev/images/icons/group_gear.png and /dev/null differ
diff --git a/source/dev/images/icons/group_go.png b/source/dev/images/icons/group_go.png
deleted file mode 100644
index d6ac590..0000000
Binary files a/source/dev/images/icons/group_go.png and /dev/null differ
diff --git a/source/dev/images/icons/group_key.png b/source/dev/images/icons/group_key.png
deleted file mode 100644
index 2cd5027..0000000
Binary files a/source/dev/images/icons/group_key.png and /dev/null differ
diff --git a/source/dev/images/icons/group_link.png b/source/dev/images/icons/group_link.png
deleted file mode 100644
index 0a25714..0000000
Binary files a/source/dev/images/icons/group_link.png and /dev/null differ
diff --git a/source/dev/images/icons/heart.png b/source/dev/images/icons/heart.png
deleted file mode 100644
index 99ac8bd..0000000
Binary files a/source/dev/images/icons/heart.png and /dev/null differ
diff --git a/source/dev/images/icons/heart_add.png b/source/dev/images/icons/heart_add.png
deleted file mode 100644
index 95b5967..0000000
Binary files a/source/dev/images/icons/heart_add.png and /dev/null differ
diff --git a/source/dev/images/icons/heart_delete.png b/source/dev/images/icons/heart_delete.png
deleted file mode 100644
index f6a8a92..0000000
Binary files a/source/dev/images/icons/heart_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/help.png b/source/dev/images/icons/help.png
deleted file mode 100644
index 4e434bb..0000000
Binary files a/source/dev/images/icons/help.png and /dev/null differ
diff --git a/source/dev/images/icons/hourglass.png b/source/dev/images/icons/hourglass.png
deleted file mode 100644
index f051b86..0000000
Binary files a/source/dev/images/icons/hourglass.png and /dev/null differ
diff --git a/source/dev/images/icons/hourglass_add.png b/source/dev/images/icons/hourglass_add.png
deleted file mode 100644
index 103888e..0000000
Binary files a/source/dev/images/icons/hourglass_add.png and /dev/null differ
diff --git a/source/dev/images/icons/hourglass_delete.png b/source/dev/images/icons/hourglass_delete.png
deleted file mode 100644
index 0944f94..0000000
Binary files a/source/dev/images/icons/hourglass_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/hourglass_go.png b/source/dev/images/icons/hourglass_go.png
deleted file mode 100644
index c7c7d03..0000000
Binary files a/source/dev/images/icons/hourglass_go.png and /dev/null differ
diff --git a/source/dev/images/icons/hourglass_link.png b/source/dev/images/icons/hourglass_link.png
deleted file mode 100644
index 08c1e13..0000000
Binary files a/source/dev/images/icons/hourglass_link.png and /dev/null differ
diff --git a/source/dev/images/icons/house.png b/source/dev/images/icons/house.png
deleted file mode 100644
index 09cf521..0000000
Binary files a/source/dev/images/icons/house.png and /dev/null differ
diff --git a/source/dev/images/icons/house_go.png b/source/dev/images/icons/house_go.png
deleted file mode 100644
index c5cc7b7..0000000
Binary files a/source/dev/images/icons/house_go.png and /dev/null differ
diff --git a/source/dev/images/icons/house_link.png b/source/dev/images/icons/house_link.png
deleted file mode 100644
index 5b7ddfb..0000000
Binary files a/source/dev/images/icons/house_link.png and /dev/null differ
diff --git a/source/dev/images/icons/html.png b/source/dev/images/icons/html.png
deleted file mode 100644
index 55d1072..0000000
Binary files a/source/dev/images/icons/html.png and /dev/null differ
diff --git a/source/dev/images/icons/html_add.png b/source/dev/images/icons/html_add.png
deleted file mode 100644
index 33fd596..0000000
Binary files a/source/dev/images/icons/html_add.png and /dev/null differ
diff --git a/source/dev/images/icons/html_delete.png b/source/dev/images/icons/html_delete.png
deleted file mode 100644
index 1bd2848..0000000
Binary files a/source/dev/images/icons/html_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/html_go.png b/source/dev/images/icons/html_go.png
deleted file mode 100644
index a95cede..0000000
Binary files a/source/dev/images/icons/html_go.png and /dev/null differ
diff --git a/source/dev/images/icons/html_valid.png b/source/dev/images/icons/html_valid.png
deleted file mode 100644
index 71cec92..0000000
Binary files a/source/dev/images/icons/html_valid.png and /dev/null differ
diff --git a/source/dev/images/icons/image.png b/source/dev/images/icons/image.png
deleted file mode 100644
index ba97ec2..0000000
Binary files a/source/dev/images/icons/image.png and /dev/null differ
diff --git a/source/dev/images/icons/image_add.png b/source/dev/images/icons/image_add.png
deleted file mode 100644
index 38d91de..0000000
Binary files a/source/dev/images/icons/image_add.png and /dev/null differ
diff --git a/source/dev/images/icons/image_delete.png b/source/dev/images/icons/image_delete.png
deleted file mode 100644
index 6d4839f..0000000
Binary files a/source/dev/images/icons/image_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/image_edit.png b/source/dev/images/icons/image_edit.png
deleted file mode 100644
index b5c724a..0000000
Binary files a/source/dev/images/icons/image_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/image_link.png b/source/dev/images/icons/image_link.png
deleted file mode 100644
index adee1b7..0000000
Binary files a/source/dev/images/icons/image_link.png and /dev/null differ
diff --git a/source/dev/images/icons/images.png b/source/dev/images/icons/images.png
deleted file mode 100644
index 12027a8..0000000
Binary files a/source/dev/images/icons/images.png and /dev/null differ
diff --git a/source/dev/images/icons/information.png b/source/dev/images/icons/information.png
deleted file mode 100644
index f61dc86..0000000
Binary files a/source/dev/images/icons/information.png and /dev/null differ
diff --git a/source/dev/images/icons/ipod.png b/source/dev/images/icons/ipod.png
deleted file mode 100644
index 3f768da..0000000
Binary files a/source/dev/images/icons/ipod.png and /dev/null differ
diff --git a/source/dev/images/icons/ipod_cast.png b/source/dev/images/icons/ipod_cast.png
deleted file mode 100644
index 0027d18..0000000
Binary files a/source/dev/images/icons/ipod_cast.png and /dev/null differ
diff --git a/source/dev/images/icons/ipod_cast_add.png b/source/dev/images/icons/ipod_cast_add.png
deleted file mode 100644
index 8223c45..0000000
Binary files a/source/dev/images/icons/ipod_cast_add.png and /dev/null differ
diff --git a/source/dev/images/icons/ipod_cast_delete.png b/source/dev/images/icons/ipod_cast_delete.png
deleted file mode 100644
index 4835b99..0000000
Binary files a/source/dev/images/icons/ipod_cast_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/ipod_sound.png b/source/dev/images/icons/ipod_sound.png
deleted file mode 100644
index fef6e8b..0000000
Binary files a/source/dev/images/icons/ipod_sound.png and /dev/null differ
diff --git a/source/dev/images/icons/joystick.png b/source/dev/images/icons/joystick.png
deleted file mode 100644
index 62168f5..0000000
Binary files a/source/dev/images/icons/joystick.png and /dev/null differ
diff --git a/source/dev/images/icons/joystick_add.png b/source/dev/images/icons/joystick_add.png
deleted file mode 100644
index fb06a50..0000000
Binary files a/source/dev/images/icons/joystick_add.png and /dev/null differ
diff --git a/source/dev/images/icons/joystick_delete.png b/source/dev/images/icons/joystick_delete.png
deleted file mode 100644
index 5c0256f..0000000
Binary files a/source/dev/images/icons/joystick_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/joystick_error.png b/source/dev/images/icons/joystick_error.png
deleted file mode 100644
index 1645406..0000000
Binary files a/source/dev/images/icons/joystick_error.png and /dev/null differ
diff --git a/source/dev/images/icons/key.png b/source/dev/images/icons/key.png
deleted file mode 100644
index 35e1fd6..0000000
Binary files a/source/dev/images/icons/key.png and /dev/null differ
diff --git a/source/dev/images/icons/key_add.png b/source/dev/images/icons/key_add.png
deleted file mode 100644
index 5c79cee..0000000
Binary files a/source/dev/images/icons/key_add.png and /dev/null differ
diff --git a/source/dev/images/icons/key_delete.png b/source/dev/images/icons/key_delete.png
deleted file mode 100644
index d28209c..0000000
Binary files a/source/dev/images/icons/key_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/key_go.png b/source/dev/images/icons/key_go.png
deleted file mode 100644
index 64a5a96..0000000
Binary files a/source/dev/images/icons/key_go.png and /dev/null differ
diff --git a/source/dev/images/icons/keyboard.png b/source/dev/images/icons/keyboard.png
deleted file mode 100644
index 0be818a..0000000
Binary files a/source/dev/images/icons/keyboard.png and /dev/null differ
diff --git a/source/dev/images/icons/keyboard_add.png b/source/dev/images/icons/keyboard_add.png
deleted file mode 100644
index 03c739c..0000000
Binary files a/source/dev/images/icons/keyboard_add.png and /dev/null differ
diff --git a/source/dev/images/icons/keyboard_delete.png b/source/dev/images/icons/keyboard_delete.png
deleted file mode 100644
index de188da..0000000
Binary files a/source/dev/images/icons/keyboard_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/keyboard_magnify.png b/source/dev/images/icons/keyboard_magnify.png
deleted file mode 100644
index ad7d197..0000000
Binary files a/source/dev/images/icons/keyboard_magnify.png and /dev/null differ
diff --git a/source/dev/images/icons/layers.png b/source/dev/images/icons/layers.png
deleted file mode 100644
index 00818f6..0000000
Binary files a/source/dev/images/icons/layers.png and /dev/null differ
diff --git a/source/dev/images/icons/layout.png b/source/dev/images/icons/layout.png
deleted file mode 100644
index 70b1451..0000000
Binary files a/source/dev/images/icons/layout.png and /dev/null differ
diff --git a/source/dev/images/icons/layout_add.png b/source/dev/images/icons/layout_add.png
deleted file mode 100644
index 2d15549..0000000
Binary files a/source/dev/images/icons/layout_add.png and /dev/null differ
diff --git a/source/dev/images/icons/layout_content.png b/source/dev/images/icons/layout_content.png
deleted file mode 100644
index b4aaad9..0000000
Binary files a/source/dev/images/icons/layout_content.png and /dev/null differ
diff --git a/source/dev/images/icons/layout_delete.png b/source/dev/images/icons/layout_delete.png
deleted file mode 100644
index c80da29..0000000
Binary files a/source/dev/images/icons/layout_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/layout_edit.png b/source/dev/images/icons/layout_edit.png
deleted file mode 100644
index 7ffa64b..0000000
Binary files a/source/dev/images/icons/layout_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/layout_error.png b/source/dev/images/icons/layout_error.png
deleted file mode 100644
index 5bcbe2b..0000000
Binary files a/source/dev/images/icons/layout_error.png and /dev/null differ
diff --git a/source/dev/images/icons/layout_header.png b/source/dev/images/icons/layout_header.png
deleted file mode 100644
index 5e96f25..0000000
Binary files a/source/dev/images/icons/layout_header.png and /dev/null differ
diff --git a/source/dev/images/icons/layout_link.png b/source/dev/images/icons/layout_link.png
deleted file mode 100644
index c102283..0000000
Binary files a/source/dev/images/icons/layout_link.png and /dev/null differ
diff --git a/source/dev/images/icons/layout_sidebar.png b/source/dev/images/icons/layout_sidebar.png
deleted file mode 100644
index 6dc95e8..0000000
Binary files a/source/dev/images/icons/layout_sidebar.png and /dev/null differ
diff --git a/source/dev/images/icons/lightbulb.png b/source/dev/images/icons/lightbulb.png
deleted file mode 100644
index 7fb193f..0000000
Binary files a/source/dev/images/icons/lightbulb.png and /dev/null differ
diff --git a/source/dev/images/icons/lightbulb_add.png b/source/dev/images/icons/lightbulb_add.png
deleted file mode 100644
index 9efdf33..0000000
Binary files a/source/dev/images/icons/lightbulb_add.png and /dev/null differ
diff --git a/source/dev/images/icons/lightbulb_delete.png b/source/dev/images/icons/lightbulb_delete.png
deleted file mode 100644
index 57216f0..0000000
Binary files a/source/dev/images/icons/lightbulb_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/lightbulb_off.png b/source/dev/images/icons/lightbulb_off.png
deleted file mode 100644
index c85f910..0000000
Binary files a/source/dev/images/icons/lightbulb_off.png and /dev/null differ
diff --git a/source/dev/images/icons/lightning.png b/source/dev/images/icons/lightning.png
deleted file mode 100644
index 495c689..0000000
Binary files a/source/dev/images/icons/lightning.png and /dev/null differ
diff --git a/source/dev/images/icons/lightning_add.png b/source/dev/images/icons/lightning_add.png
deleted file mode 100644
index 958ae96..0000000
Binary files a/source/dev/images/icons/lightning_add.png and /dev/null differ
diff --git a/source/dev/images/icons/lightning_delete.png b/source/dev/images/icons/lightning_delete.png
deleted file mode 100644
index 68dc85b..0000000
Binary files a/source/dev/images/icons/lightning_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/lightning_go.png b/source/dev/images/icons/lightning_go.png
deleted file mode 100644
index 50c6e8a..0000000
Binary files a/source/dev/images/icons/lightning_go.png and /dev/null differ
diff --git a/source/dev/images/icons/link.png b/source/dev/images/icons/link.png
deleted file mode 100644
index 25eacb7..0000000
Binary files a/source/dev/images/icons/link.png and /dev/null differ
diff --git a/source/dev/images/icons/link_add.png b/source/dev/images/icons/link_add.png
deleted file mode 100644
index 67a50f8..0000000
Binary files a/source/dev/images/icons/link_add.png and /dev/null differ
diff --git a/source/dev/images/icons/link_break.png b/source/dev/images/icons/link_break.png
deleted file mode 100644
index 0a7b476..0000000
Binary files a/source/dev/images/icons/link_break.png and /dev/null differ
diff --git a/source/dev/images/icons/link_delete.png b/source/dev/images/icons/link_delete.png
deleted file mode 100644
index f987a73..0000000
Binary files a/source/dev/images/icons/link_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/link_edit.png b/source/dev/images/icons/link_edit.png
deleted file mode 100644
index 3e55167..0000000
Binary files a/source/dev/images/icons/link_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/link_error.png b/source/dev/images/icons/link_error.png
deleted file mode 100644
index c29f97e..0000000
Binary files a/source/dev/images/icons/link_error.png and /dev/null differ
diff --git a/source/dev/images/icons/link_go.png b/source/dev/images/icons/link_go.png
deleted file mode 100644
index 86c2a82..0000000
Binary files a/source/dev/images/icons/link_go.png and /dev/null differ
diff --git a/source/dev/images/icons/lock.png b/source/dev/images/icons/lock.png
deleted file mode 100644
index 2ebc4f6..0000000
Binary files a/source/dev/images/icons/lock.png and /dev/null differ
diff --git a/source/dev/images/icons/lock_add.png b/source/dev/images/icons/lock_add.png
deleted file mode 100644
index 8eb3ba4..0000000
Binary files a/source/dev/images/icons/lock_add.png and /dev/null differ
diff --git a/source/dev/images/icons/lock_break.png b/source/dev/images/icons/lock_break.png
deleted file mode 100644
index 13578ab..0000000
Binary files a/source/dev/images/icons/lock_break.png and /dev/null differ
diff --git a/source/dev/images/icons/lock_delete.png b/source/dev/images/icons/lock_delete.png
deleted file mode 100644
index ecb50a9..0000000
Binary files a/source/dev/images/icons/lock_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/lock_edit.png b/source/dev/images/icons/lock_edit.png
deleted file mode 100644
index 116aa5b..0000000
Binary files a/source/dev/images/icons/lock_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/lock_go.png b/source/dev/images/icons/lock_go.png
deleted file mode 100644
index 8c7c89b..0000000
Binary files a/source/dev/images/icons/lock_go.png and /dev/null differ
diff --git a/source/dev/images/icons/lock_open.png b/source/dev/images/icons/lock_open.png
deleted file mode 100644
index a471765..0000000
Binary files a/source/dev/images/icons/lock_open.png and /dev/null differ
diff --git a/source/dev/images/icons/lorry.png b/source/dev/images/icons/lorry.png
deleted file mode 100644
index 8f95f5a..0000000
Binary files a/source/dev/images/icons/lorry.png and /dev/null differ
diff --git a/source/dev/images/icons/lorry_add.png b/source/dev/images/icons/lorry_add.png
deleted file mode 100644
index 849626c..0000000
Binary files a/source/dev/images/icons/lorry_add.png and /dev/null differ
diff --git a/source/dev/images/icons/lorry_delete.png b/source/dev/images/icons/lorry_delete.png
deleted file mode 100644
index 66217f5..0000000
Binary files a/source/dev/images/icons/lorry_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/lorry_error.png b/source/dev/images/icons/lorry_error.png
deleted file mode 100644
index 3619ead..0000000
Binary files a/source/dev/images/icons/lorry_error.png and /dev/null differ
diff --git a/source/dev/images/icons/lorry_flatbed.png b/source/dev/images/icons/lorry_flatbed.png
deleted file mode 100644
index be5e1d9..0000000
Binary files a/source/dev/images/icons/lorry_flatbed.png and /dev/null differ
diff --git a/source/dev/images/icons/lorry_go.png b/source/dev/images/icons/lorry_go.png
deleted file mode 100644
index 1c296a6..0000000
Binary files a/source/dev/images/icons/lorry_go.png and /dev/null differ
diff --git a/source/dev/images/icons/lorry_link.png b/source/dev/images/icons/lorry_link.png
deleted file mode 100644
index 5ffe27f..0000000
Binary files a/source/dev/images/icons/lorry_link.png and /dev/null differ
diff --git a/source/dev/images/icons/magifier_zoom_out.png b/source/dev/images/icons/magifier_zoom_out.png
deleted file mode 100644
index c3cb92d..0000000
Binary files a/source/dev/images/icons/magifier_zoom_out.png and /dev/null differ
diff --git a/source/dev/images/icons/magnifier.png b/source/dev/images/icons/magnifier.png
deleted file mode 100644
index 52f6ac6..0000000
Binary files a/source/dev/images/icons/magnifier.png and /dev/null differ
diff --git a/source/dev/images/icons/magnifier_zoom_in.png b/source/dev/images/icons/magnifier_zoom_in.png
deleted file mode 100644
index 5b8d299..0000000
Binary files a/source/dev/images/icons/magnifier_zoom_in.png and /dev/null differ
diff --git a/source/dev/images/icons/male.png b/source/dev/images/icons/male.png
deleted file mode 100644
index d339273..0000000
Binary files a/source/dev/images/icons/male.png and /dev/null differ
diff --git a/source/dev/images/icons/map.png b/source/dev/images/icons/map.png
deleted file mode 100644
index f90ef25..0000000
Binary files a/source/dev/images/icons/map.png and /dev/null differ
diff --git a/source/dev/images/icons/map_add.png b/source/dev/images/icons/map_add.png
deleted file mode 100644
index 2b72da0..0000000
Binary files a/source/dev/images/icons/map_add.png and /dev/null differ
diff --git a/source/dev/images/icons/map_delete.png b/source/dev/images/icons/map_delete.png
deleted file mode 100644
index e74402f..0000000
Binary files a/source/dev/images/icons/map_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/map_edit.png b/source/dev/images/icons/map_edit.png
deleted file mode 100644
index 2b9d6ee..0000000
Binary files a/source/dev/images/icons/map_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/map_go.png b/source/dev/images/icons/map_go.png
deleted file mode 100644
index 11eab26..0000000
Binary files a/source/dev/images/icons/map_go.png and /dev/null differ
diff --git a/source/dev/images/icons/map_magnify.png b/source/dev/images/icons/map_magnify.png
deleted file mode 100644
index 7184c9d..0000000
Binary files a/source/dev/images/icons/map_magnify.png and /dev/null differ
diff --git a/source/dev/images/icons/medal_bronze_1.png b/source/dev/images/icons/medal_bronze_1.png
deleted file mode 100644
index 5f8a6d6..0000000
Binary files a/source/dev/images/icons/medal_bronze_1.png and /dev/null differ
diff --git a/source/dev/images/icons/medal_bronze_2.png b/source/dev/images/icons/medal_bronze_2.png
deleted file mode 100644
index 623d68c..0000000
Binary files a/source/dev/images/icons/medal_bronze_2.png and /dev/null differ
diff --git a/source/dev/images/icons/medal_bronze_3.png b/source/dev/images/icons/medal_bronze_3.png
deleted file mode 100644
index ed3f43e..0000000
Binary files a/source/dev/images/icons/medal_bronze_3.png and /dev/null differ
diff --git a/source/dev/images/icons/medal_bronze_add.png b/source/dev/images/icons/medal_bronze_add.png
deleted file mode 100644
index 8487b2c..0000000
Binary files a/source/dev/images/icons/medal_bronze_add.png and /dev/null differ
diff --git a/source/dev/images/icons/medal_bronze_delete.png b/source/dev/images/icons/medal_bronze_delete.png
deleted file mode 100644
index d32aed7..0000000
Binary files a/source/dev/images/icons/medal_bronze_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/medal_gold_1.png b/source/dev/images/icons/medal_gold_1.png
deleted file mode 100644
index 87584dc..0000000
Binary files a/source/dev/images/icons/medal_gold_1.png and /dev/null differ
diff --git a/source/dev/images/icons/medal_gold_2.png b/source/dev/images/icons/medal_gold_2.png
deleted file mode 100644
index fa3a15d..0000000
Binary files a/source/dev/images/icons/medal_gold_2.png and /dev/null differ
diff --git a/source/dev/images/icons/medal_gold_3.png b/source/dev/images/icons/medal_gold_3.png
deleted file mode 100644
index ef1b08b..0000000
Binary files a/source/dev/images/icons/medal_gold_3.png and /dev/null differ
diff --git a/source/dev/images/icons/medal_gold_add.png b/source/dev/images/icons/medal_gold_add.png
deleted file mode 100644
index dcade0d..0000000
Binary files a/source/dev/images/icons/medal_gold_add.png and /dev/null differ
diff --git a/source/dev/images/icons/medal_gold_delete.png b/source/dev/images/icons/medal_gold_delete.png
deleted file mode 100644
index 84b06d5..0000000
Binary files a/source/dev/images/icons/medal_gold_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/medal_silver_1.png b/source/dev/images/icons/medal_silver_1.png
deleted file mode 100644
index 75a64da..0000000
Binary files a/source/dev/images/icons/medal_silver_1.png and /dev/null differ
diff --git a/source/dev/images/icons/medal_silver_2.png b/source/dev/images/icons/medal_silver_2.png
deleted file mode 100644
index 2e0fe75..0000000
Binary files a/source/dev/images/icons/medal_silver_2.png and /dev/null differ
diff --git a/source/dev/images/icons/medal_silver_3.png b/source/dev/images/icons/medal_silver_3.png
deleted file mode 100644
index e385b54..0000000
Binary files a/source/dev/images/icons/medal_silver_3.png and /dev/null differ
diff --git a/source/dev/images/icons/medal_silver_add.png b/source/dev/images/icons/medal_silver_add.png
deleted file mode 100644
index 782d6d3..0000000
Binary files a/source/dev/images/icons/medal_silver_add.png and /dev/null differ
diff --git a/source/dev/images/icons/medal_silver_delete.png b/source/dev/images/icons/medal_silver_delete.png
deleted file mode 100644
index 06cab46..0000000
Binary files a/source/dev/images/icons/medal_silver_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/money.png b/source/dev/images/icons/money.png
deleted file mode 100644
index bbd33b6..0000000
Binary files a/source/dev/images/icons/money.png and /dev/null differ
diff --git a/source/dev/images/icons/money_add.png b/source/dev/images/icons/money_add.png
deleted file mode 100644
index 0fd9e39..0000000
Binary files a/source/dev/images/icons/money_add.png and /dev/null differ
diff --git a/source/dev/images/icons/money_delete.png b/source/dev/images/icons/money_delete.png
deleted file mode 100644
index d07d4c4..0000000
Binary files a/source/dev/images/icons/money_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/money_dollar.png b/source/dev/images/icons/money_dollar.png
deleted file mode 100644
index 712c6cd..0000000
Binary files a/source/dev/images/icons/money_dollar.png and /dev/null differ
diff --git a/source/dev/images/icons/money_euro.png b/source/dev/images/icons/money_euro.png
deleted file mode 100644
index f431454..0000000
Binary files a/source/dev/images/icons/money_euro.png and /dev/null differ
diff --git a/source/dev/images/icons/money_pound.png b/source/dev/images/icons/money_pound.png
deleted file mode 100644
index 46aa7bc..0000000
Binary files a/source/dev/images/icons/money_pound.png and /dev/null differ
diff --git a/source/dev/images/icons/money_yen.png b/source/dev/images/icons/money_yen.png
deleted file mode 100644
index 550628a..0000000
Binary files a/source/dev/images/icons/money_yen.png and /dev/null differ
diff --git a/source/dev/images/icons/monitor.png b/source/dev/images/icons/monitor.png
deleted file mode 100644
index d040bd0..0000000
Binary files a/source/dev/images/icons/monitor.png and /dev/null differ
diff --git a/source/dev/images/icons/monitor_add.png b/source/dev/images/icons/monitor_add.png
deleted file mode 100644
index a818066..0000000
Binary files a/source/dev/images/icons/monitor_add.png and /dev/null differ
diff --git a/source/dev/images/icons/monitor_delete.png b/source/dev/images/icons/monitor_delete.png
deleted file mode 100644
index 3733256..0000000
Binary files a/source/dev/images/icons/monitor_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/monitor_edit.png b/source/dev/images/icons/monitor_edit.png
deleted file mode 100644
index 3694e41..0000000
Binary files a/source/dev/images/icons/monitor_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/monitor_error.png b/source/dev/images/icons/monitor_error.png
deleted file mode 100644
index 270c501..0000000
Binary files a/source/dev/images/icons/monitor_error.png and /dev/null differ
diff --git a/source/dev/images/icons/monitor_go.png b/source/dev/images/icons/monitor_go.png
deleted file mode 100644
index 8af3eda..0000000
Binary files a/source/dev/images/icons/monitor_go.png and /dev/null differ
diff --git a/source/dev/images/icons/monitor_lightning.png b/source/dev/images/icons/monitor_lightning.png
deleted file mode 100644
index 06e53a9..0000000
Binary files a/source/dev/images/icons/monitor_lightning.png and /dev/null differ
diff --git a/source/dev/images/icons/monitor_link.png b/source/dev/images/icons/monitor_link.png
deleted file mode 100644
index a014b02..0000000
Binary files a/source/dev/images/icons/monitor_link.png and /dev/null differ
diff --git a/source/dev/images/icons/mouse.png b/source/dev/images/icons/mouse.png
deleted file mode 100644
index 8d23e9f..0000000
Binary files a/source/dev/images/icons/mouse.png and /dev/null differ
diff --git a/source/dev/images/icons/mouse_add.png b/source/dev/images/icons/mouse_add.png
deleted file mode 100644
index 0043f65..0000000
Binary files a/source/dev/images/icons/mouse_add.png and /dev/null differ
diff --git a/source/dev/images/icons/mouse_delete.png b/source/dev/images/icons/mouse_delete.png
deleted file mode 100644
index 4900b97..0000000
Binary files a/source/dev/images/icons/mouse_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/mouse_error.png b/source/dev/images/icons/mouse_error.png
deleted file mode 100644
index 15609c4..0000000
Binary files a/source/dev/images/icons/mouse_error.png and /dev/null differ
diff --git a/source/dev/images/icons/music.png b/source/dev/images/icons/music.png
deleted file mode 100644
index 8aa9c7d..0000000
Binary files a/source/dev/images/icons/music.png and /dev/null differ
diff --git a/source/dev/images/icons/new.png b/source/dev/images/icons/new.png
deleted file mode 100644
index 213261c..0000000
Binary files a/source/dev/images/icons/new.png and /dev/null differ
diff --git a/source/dev/images/icons/newspaper.png b/source/dev/images/icons/newspaper.png
deleted file mode 100644
index b0675a6..0000000
Binary files a/source/dev/images/icons/newspaper.png and /dev/null differ
diff --git a/source/dev/images/icons/newspaper_add.png b/source/dev/images/icons/newspaper_add.png
deleted file mode 100644
index b3039cd..0000000
Binary files a/source/dev/images/icons/newspaper_add.png and /dev/null differ
diff --git a/source/dev/images/icons/newspaper_delete.png b/source/dev/images/icons/newspaper_delete.png
deleted file mode 100644
index 25ffa76..0000000
Binary files a/source/dev/images/icons/newspaper_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/newspaper_go.png b/source/dev/images/icons/newspaper_go.png
deleted file mode 100644
index cce1088..0000000
Binary files a/source/dev/images/icons/newspaper_go.png and /dev/null differ
diff --git a/source/dev/images/icons/newspaper_link.png b/source/dev/images/icons/newspaper_link.png
deleted file mode 100644
index 872e481..0000000
Binary files a/source/dev/images/icons/newspaper_link.png and /dev/null differ
diff --git a/source/dev/images/icons/note.png b/source/dev/images/icons/note.png
deleted file mode 100644
index 244e6ca..0000000
Binary files a/source/dev/images/icons/note.png and /dev/null differ
diff --git a/source/dev/images/icons/note_add.png b/source/dev/images/icons/note_add.png
deleted file mode 100644
index ff79b5b..0000000
Binary files a/source/dev/images/icons/note_add.png and /dev/null differ
diff --git a/source/dev/images/icons/note_delete.png b/source/dev/images/icons/note_delete.png
deleted file mode 100644
index 3bc7c04..0000000
Binary files a/source/dev/images/icons/note_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/note_edit.png b/source/dev/images/icons/note_edit.png
deleted file mode 100644
index 0522825..0000000
Binary files a/source/dev/images/icons/note_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/note_error.png b/source/dev/images/icons/note_error.png
deleted file mode 100644
index 896dadf..0000000
Binary files a/source/dev/images/icons/note_error.png and /dev/null differ
diff --git a/source/dev/images/icons/note_go.png b/source/dev/images/icons/note_go.png
deleted file mode 100644
index 49e54fd..0000000
Binary files a/source/dev/images/icons/note_go.png and /dev/null differ
diff --git a/source/dev/images/icons/overlays.png b/source/dev/images/icons/overlays.png
deleted file mode 100644
index 7ffa64b..0000000
Binary files a/source/dev/images/icons/overlays.png and /dev/null differ
diff --git a/source/dev/images/icons/package.png b/source/dev/images/icons/package.png
deleted file mode 100644
index 8bafc7a..0000000
Binary files a/source/dev/images/icons/package.png and /dev/null differ
diff --git a/source/dev/images/icons/package_add.png b/source/dev/images/icons/package_add.png
deleted file mode 100644
index 49ece3d..0000000
Binary files a/source/dev/images/icons/package_add.png and /dev/null differ
diff --git a/source/dev/images/icons/package_delete.png b/source/dev/images/icons/package_delete.png
deleted file mode 100644
index 5c941bb..0000000
Binary files a/source/dev/images/icons/package_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/package_go.png b/source/dev/images/icons/package_go.png
deleted file mode 100644
index 4feaf0a..0000000
Binary files a/source/dev/images/icons/package_go.png and /dev/null differ
diff --git a/source/dev/images/icons/package_green.png b/source/dev/images/icons/package_green.png
deleted file mode 100644
index 37560dc..0000000
Binary files a/source/dev/images/icons/package_green.png and /dev/null differ
diff --git a/source/dev/images/icons/package_link.png b/source/dev/images/icons/package_link.png
deleted file mode 100644
index 9e872dc..0000000
Binary files a/source/dev/images/icons/package_link.png and /dev/null differ
diff --git a/source/dev/images/icons/page.png b/source/dev/images/icons/page.png
deleted file mode 100644
index 03ddd79..0000000
Binary files a/source/dev/images/icons/page.png and /dev/null differ
diff --git a/source/dev/images/icons/page_add.png b/source/dev/images/icons/page_add.png
deleted file mode 100644
index d5bfa07..0000000
Binary files a/source/dev/images/icons/page_add.png and /dev/null differ
diff --git a/source/dev/images/icons/page_attach.png b/source/dev/images/icons/page_attach.png
deleted file mode 100644
index 89ee2da..0000000
Binary files a/source/dev/images/icons/page_attach.png and /dev/null differ
diff --git a/source/dev/images/icons/page_code.png b/source/dev/images/icons/page_code.png
deleted file mode 100644
index f7ea904..0000000
Binary files a/source/dev/images/icons/page_code.png and /dev/null differ
diff --git a/source/dev/images/icons/page_copy.png b/source/dev/images/icons/page_copy.png
deleted file mode 100644
index 96f6398..0000000
Binary files a/source/dev/images/icons/page_copy.png and /dev/null differ
diff --git a/source/dev/images/icons/page_delete.png b/source/dev/images/icons/page_delete.png
deleted file mode 100644
index 3141467..0000000
Binary files a/source/dev/images/icons/page_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/page_edit.png b/source/dev/images/icons/page_edit.png
deleted file mode 100644
index 046811e..0000000
Binary files a/source/dev/images/icons/page_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/page_error.png b/source/dev/images/icons/page_error.png
deleted file mode 100644
index f07f449..0000000
Binary files a/source/dev/images/icons/page_error.png and /dev/null differ
diff --git a/source/dev/images/icons/page_excel.png b/source/dev/images/icons/page_excel.png
deleted file mode 100644
index 7fdb643..0000000
Binary files a/source/dev/images/icons/page_excel.png and /dev/null differ
diff --git a/source/dev/images/icons/page_find.png b/source/dev/images/icons/page_find.png
deleted file mode 100644
index 2f19388..0000000
Binary files a/source/dev/images/icons/page_find.png and /dev/null differ
diff --git a/source/dev/images/icons/page_gear.png b/source/dev/images/icons/page_gear.png
deleted file mode 100644
index 8e83281..0000000
Binary files a/source/dev/images/icons/page_gear.png and /dev/null differ
diff --git a/source/dev/images/icons/page_go.png b/source/dev/images/icons/page_go.png
deleted file mode 100644
index 80fe1ed..0000000
Binary files a/source/dev/images/icons/page_go.png and /dev/null differ
diff --git a/source/dev/images/icons/page_green.png b/source/dev/images/icons/page_green.png
deleted file mode 100644
index de8e003..0000000
Binary files a/source/dev/images/icons/page_green.png and /dev/null differ
diff --git a/source/dev/images/icons/page_key.png b/source/dev/images/icons/page_key.png
deleted file mode 100644
index d6626cb..0000000
Binary files a/source/dev/images/icons/page_key.png and /dev/null differ
diff --git a/source/dev/images/icons/page_lightning.png b/source/dev/images/icons/page_lightning.png
deleted file mode 100644
index 7e56870..0000000
Binary files a/source/dev/images/icons/page_lightning.png and /dev/null differ
diff --git a/source/dev/images/icons/page_link.png b/source/dev/images/icons/page_link.png
deleted file mode 100644
index 3fca571..0000000
Binary files a/source/dev/images/icons/page_link.png and /dev/null differ
diff --git a/source/dev/images/icons/page_paintbrush.png b/source/dev/images/icons/page_paintbrush.png
deleted file mode 100644
index 246a2f0..0000000
Binary files a/source/dev/images/icons/page_paintbrush.png and /dev/null differ
diff --git a/source/dev/images/icons/page_paste.png b/source/dev/images/icons/page_paste.png
deleted file mode 100644
index 968f073..0000000
Binary files a/source/dev/images/icons/page_paste.png and /dev/null differ
diff --git a/source/dev/images/icons/page_red.png b/source/dev/images/icons/page_red.png
deleted file mode 100644
index 0b18247..0000000
Binary files a/source/dev/images/icons/page_red.png and /dev/null differ
diff --git a/source/dev/images/icons/page_refresh.png b/source/dev/images/icons/page_refresh.png
deleted file mode 100644
index cf347c7..0000000
Binary files a/source/dev/images/icons/page_refresh.png and /dev/null differ
diff --git a/source/dev/images/icons/page_save.png b/source/dev/images/icons/page_save.png
deleted file mode 100644
index caea546..0000000
Binary files a/source/dev/images/icons/page_save.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white.png b/source/dev/images/icons/page_white.png
deleted file mode 100644
index 8b8b1ca..0000000
Binary files a/source/dev/images/icons/page_white.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_acrobat.png b/source/dev/images/icons/page_white_acrobat.png
deleted file mode 100644
index 09121d9..0000000
Binary files a/source/dev/images/icons/page_white_acrobat.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_actionscript.png b/source/dev/images/icons/page_white_actionscript.png
deleted file mode 100644
index fbc2303..0000000
Binary files a/source/dev/images/icons/page_white_actionscript.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_add.png b/source/dev/images/icons/page_white_add.png
deleted file mode 100644
index c1b2422..0000000
Binary files a/source/dev/images/icons/page_white_add.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_c.png b/source/dev/images/icons/page_white_c.png
deleted file mode 100644
index 928a328..0000000
Binary files a/source/dev/images/icons/page_white_c.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_camera.png b/source/dev/images/icons/page_white_camera.png
deleted file mode 100644
index 3528619..0000000
Binary files a/source/dev/images/icons/page_white_camera.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_cd.png b/source/dev/images/icons/page_white_cd.png
deleted file mode 100644
index cb14e9d..0000000
Binary files a/source/dev/images/icons/page_white_cd.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_code.png b/source/dev/images/icons/page_white_code.png
deleted file mode 100644
index bd566cb..0000000
Binary files a/source/dev/images/icons/page_white_code.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_code_red.png b/source/dev/images/icons/page_white_code_red.png
deleted file mode 100644
index 4ebfda4..0000000
Binary files a/source/dev/images/icons/page_white_code_red.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_coldfusion.png b/source/dev/images/icons/page_white_coldfusion.png
deleted file mode 100644
index 2f4ef33..0000000
Binary files a/source/dev/images/icons/page_white_coldfusion.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_compressed.png b/source/dev/images/icons/page_white_compressed.png
deleted file mode 100644
index 7d33267..0000000
Binary files a/source/dev/images/icons/page_white_compressed.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_copy.png b/source/dev/images/icons/page_white_copy.png
deleted file mode 100644
index a9f31a2..0000000
Binary files a/source/dev/images/icons/page_white_copy.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_cplusplus.png b/source/dev/images/icons/page_white_cplusplus.png
deleted file mode 100644
index 50a118c..0000000
Binary files a/source/dev/images/icons/page_white_cplusplus.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_csharp.png b/source/dev/images/icons/page_white_csharp.png
deleted file mode 100644
index 42f8c62..0000000
Binary files a/source/dev/images/icons/page_white_csharp.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_cup.png b/source/dev/images/icons/page_white_cup.png
deleted file mode 100644
index 6dac21e..0000000
Binary files a/source/dev/images/icons/page_white_cup.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_database.png b/source/dev/images/icons/page_white_database.png
deleted file mode 100644
index 6fa67df..0000000
Binary files a/source/dev/images/icons/page_white_database.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_delete.png b/source/dev/images/icons/page_white_delete.png
deleted file mode 100644
index b81c3e3..0000000
Binary files a/source/dev/images/icons/page_white_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_dvd.png b/source/dev/images/icons/page_white_dvd.png
deleted file mode 100644
index 9527f05..0000000
Binary files a/source/dev/images/icons/page_white_dvd.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_edit.png b/source/dev/images/icons/page_white_edit.png
deleted file mode 100644
index 452cedb..0000000
Binary files a/source/dev/images/icons/page_white_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_error.png b/source/dev/images/icons/page_white_error.png
deleted file mode 100644
index ce3ff87..0000000
Binary files a/source/dev/images/icons/page_white_error.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_excel.png b/source/dev/images/icons/page_white_excel.png
deleted file mode 100644
index c413f66..0000000
Binary files a/source/dev/images/icons/page_white_excel.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_find.png b/source/dev/images/icons/page_white_find.png
deleted file mode 100644
index b61b381..0000000
Binary files a/source/dev/images/icons/page_white_find.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_flash.png b/source/dev/images/icons/page_white_flash.png
deleted file mode 100644
index 5d38981..0000000
Binary files a/source/dev/images/icons/page_white_flash.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_freehand.png b/source/dev/images/icons/page_white_freehand.png
deleted file mode 100644
index 71c0700..0000000
Binary files a/source/dev/images/icons/page_white_freehand.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_gear.png b/source/dev/images/icons/page_white_gear.png
deleted file mode 100644
index 995731f..0000000
Binary files a/source/dev/images/icons/page_white_gear.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_get.png b/source/dev/images/icons/page_white_get.png
deleted file mode 100644
index e592f2c..0000000
Binary files a/source/dev/images/icons/page_white_get.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_go.png b/source/dev/images/icons/page_white_go.png
deleted file mode 100644
index 780801e..0000000
Binary files a/source/dev/images/icons/page_white_go.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_h.png b/source/dev/images/icons/page_white_h.png
deleted file mode 100644
index 748628f..0000000
Binary files a/source/dev/images/icons/page_white_h.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_horizontal.png b/source/dev/images/icons/page_white_horizontal.png
deleted file mode 100644
index 1d2d0a4..0000000
Binary files a/source/dev/images/icons/page_white_horizontal.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_key.png b/source/dev/images/icons/page_white_key.png
deleted file mode 100644
index 8b60fde..0000000
Binary files a/source/dev/images/icons/page_white_key.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_lightning.png b/source/dev/images/icons/page_white_lightning.png
deleted file mode 100644
index 222b944..0000000
Binary files a/source/dev/images/icons/page_white_lightning.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_link.png b/source/dev/images/icons/page_white_link.png
deleted file mode 100644
index 53026a4..0000000
Binary files a/source/dev/images/icons/page_white_link.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_magnify.png b/source/dev/images/icons/page_white_magnify.png
deleted file mode 100644
index 141b99e..0000000
Binary files a/source/dev/images/icons/page_white_magnify.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_medal.png b/source/dev/images/icons/page_white_medal.png
deleted file mode 100644
index dce054d..0000000
Binary files a/source/dev/images/icons/page_white_medal.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_office.png b/source/dev/images/icons/page_white_office.png
deleted file mode 100644
index 5f29221..0000000
Binary files a/source/dev/images/icons/page_white_office.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_paint.png b/source/dev/images/icons/page_white_paint.png
deleted file mode 100644
index b68b6ac..0000000
Binary files a/source/dev/images/icons/page_white_paint.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_paintbrush.png b/source/dev/images/icons/page_white_paintbrush.png
deleted file mode 100644
index f1d7520..0000000
Binary files a/source/dev/images/icons/page_white_paintbrush.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_paste.png b/source/dev/images/icons/page_white_paste.png
deleted file mode 100644
index 07861f3..0000000
Binary files a/source/dev/images/icons/page_white_paste.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_php.png b/source/dev/images/icons/page_white_php.png
deleted file mode 100644
index ed3bfd3..0000000
Binary files a/source/dev/images/icons/page_white_php.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_picture.png b/source/dev/images/icons/page_white_picture.png
deleted file mode 100644
index 14d4371..0000000
Binary files a/source/dev/images/icons/page_white_picture.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_powerpoint.png b/source/dev/images/icons/page_white_powerpoint.png
deleted file mode 100644
index fbc471c..0000000
Binary files a/source/dev/images/icons/page_white_powerpoint.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_put.png b/source/dev/images/icons/page_white_put.png
deleted file mode 100644
index 2a1ea72..0000000
Binary files a/source/dev/images/icons/page_white_put.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_ruby.png b/source/dev/images/icons/page_white_ruby.png
deleted file mode 100644
index 1b42bcd..0000000
Binary files a/source/dev/images/icons/page_white_ruby.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_stack.png b/source/dev/images/icons/page_white_stack.png
deleted file mode 100644
index 44084ad..0000000
Binary files a/source/dev/images/icons/page_white_stack.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_star.png b/source/dev/images/icons/page_white_star.png
deleted file mode 100644
index c19f371..0000000
Binary files a/source/dev/images/icons/page_white_star.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_swoosh.png b/source/dev/images/icons/page_white_swoosh.png
deleted file mode 100644
index e19dfac..0000000
Binary files a/source/dev/images/icons/page_white_swoosh.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_text.png b/source/dev/images/icons/page_white_text.png
deleted file mode 100644
index 813f712..0000000
Binary files a/source/dev/images/icons/page_white_text.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_text_width.png b/source/dev/images/icons/page_white_text_width.png
deleted file mode 100644
index d9cf132..0000000
Binary files a/source/dev/images/icons/page_white_text_width.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_tux.png b/source/dev/images/icons/page_white_tux.png
deleted file mode 100644
index 3c2163d..0000000
Binary files a/source/dev/images/icons/page_white_tux.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_vector.png b/source/dev/images/icons/page_white_vector.png
deleted file mode 100644
index 69d24f7..0000000
Binary files a/source/dev/images/icons/page_white_vector.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_visualstudio.png b/source/dev/images/icons/page_white_visualstudio.png
deleted file mode 100644
index f4f3cb8..0000000
Binary files a/source/dev/images/icons/page_white_visualstudio.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_width.png b/source/dev/images/icons/page_white_width.png
deleted file mode 100644
index 1eb8809..0000000
Binary files a/source/dev/images/icons/page_white_width.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_word.png b/source/dev/images/icons/page_white_word.png
deleted file mode 100644
index 5e9584e..0000000
Binary files a/source/dev/images/icons/page_white_word.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_world.png b/source/dev/images/icons/page_white_world.png
deleted file mode 100644
index a8c052b..0000000
Binary files a/source/dev/images/icons/page_white_world.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_wrench.png b/source/dev/images/icons/page_white_wrench.png
deleted file mode 100644
index fa96706..0000000
Binary files a/source/dev/images/icons/page_white_wrench.png and /dev/null differ
diff --git a/source/dev/images/icons/page_white_zip.png b/source/dev/images/icons/page_white_zip.png
deleted file mode 100644
index e32f950..0000000
Binary files a/source/dev/images/icons/page_white_zip.png and /dev/null differ
diff --git a/source/dev/images/icons/page_word.png b/source/dev/images/icons/page_word.png
deleted file mode 100644
index 834cdfa..0000000
Binary files a/source/dev/images/icons/page_word.png and /dev/null differ
diff --git a/source/dev/images/icons/page_world.png b/source/dev/images/icons/page_world.png
deleted file mode 100644
index b8895dd..0000000
Binary files a/source/dev/images/icons/page_world.png and /dev/null differ
diff --git a/source/dev/images/icons/paintbrush.png b/source/dev/images/icons/paintbrush.png
deleted file mode 100644
index 67177ae..0000000
Binary files a/source/dev/images/icons/paintbrush.png and /dev/null differ
diff --git a/source/dev/images/icons/paintcan.png b/source/dev/images/icons/paintcan.png
deleted file mode 100644
index 7bf47c4..0000000
Binary files a/source/dev/images/icons/paintcan.png and /dev/null differ
diff --git a/source/dev/images/icons/palette.png b/source/dev/images/icons/palette.png
deleted file mode 100644
index 016527a..0000000
Binary files a/source/dev/images/icons/palette.png and /dev/null differ
diff --git a/source/dev/images/icons/paste_plain.png b/source/dev/images/icons/paste_plain.png
deleted file mode 100644
index c0490eb..0000000
Binary files a/source/dev/images/icons/paste_plain.png and /dev/null differ
diff --git a/source/dev/images/icons/paste_word.png b/source/dev/images/icons/paste_word.png
deleted file mode 100644
index f6b87f8..0000000
Binary files a/source/dev/images/icons/paste_word.png and /dev/null differ
diff --git a/source/dev/images/icons/pencil.png b/source/dev/images/icons/pencil.png
deleted file mode 100644
index 578ec73..0000000
Binary files a/source/dev/images/icons/pencil.png and /dev/null differ
diff --git a/source/dev/images/icons/pencil_add.png b/source/dev/images/icons/pencil_add.png
deleted file mode 100644
index e7414ad..0000000
Binary files a/source/dev/images/icons/pencil_add.png and /dev/null differ
diff --git a/source/dev/images/icons/pencil_delete.png b/source/dev/images/icons/pencil_delete.png
deleted file mode 100644
index e98079a..0000000
Binary files a/source/dev/images/icons/pencil_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/pencil_go.png b/source/dev/images/icons/pencil_go.png
deleted file mode 100644
index 49e3ab2..0000000
Binary files a/source/dev/images/icons/pencil_go.png and /dev/null differ
diff --git a/source/dev/images/icons/phone.png b/source/dev/images/icons/phone.png
deleted file mode 100644
index c39f162..0000000
Binary files a/source/dev/images/icons/phone.png and /dev/null differ
diff --git a/source/dev/images/icons/phone_add.png b/source/dev/images/icons/phone_add.png
deleted file mode 100644
index c79eb3d..0000000
Binary files a/source/dev/images/icons/phone_add.png and /dev/null differ
diff --git a/source/dev/images/icons/phone_delete.png b/source/dev/images/icons/phone_delete.png
deleted file mode 100644
index bbe4f8a..0000000
Binary files a/source/dev/images/icons/phone_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/phone_sound.png b/source/dev/images/icons/phone_sound.png
deleted file mode 100644
index f40789b..0000000
Binary files a/source/dev/images/icons/phone_sound.png and /dev/null differ
diff --git a/source/dev/images/icons/photo.png b/source/dev/images/icons/photo.png
deleted file mode 100644
index 6c2aaaa..0000000
Binary files a/source/dev/images/icons/photo.png and /dev/null differ
diff --git a/source/dev/images/icons/photo_add.png b/source/dev/images/icons/photo_add.png
deleted file mode 100644
index 85c019c..0000000
Binary files a/source/dev/images/icons/photo_add.png and /dev/null differ
diff --git a/source/dev/images/icons/photo_delete.png b/source/dev/images/icons/photo_delete.png
deleted file mode 100644
index 18b67df..0000000
Binary files a/source/dev/images/icons/photo_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/photo_link.png b/source/dev/images/icons/photo_link.png
deleted file mode 100644
index 55eb2c3..0000000
Binary files a/source/dev/images/icons/photo_link.png and /dev/null differ
diff --git a/source/dev/images/icons/photos.png b/source/dev/images/icons/photos.png
deleted file mode 100644
index 8836fe6..0000000
Binary files a/source/dev/images/icons/photos.png and /dev/null differ
diff --git a/source/dev/images/icons/picture.png b/source/dev/images/icons/picture.png
deleted file mode 100644
index 4a158fe..0000000
Binary files a/source/dev/images/icons/picture.png and /dev/null differ
diff --git a/source/dev/images/icons/picture_add.png b/source/dev/images/icons/picture_add.png
deleted file mode 100644
index ec51094..0000000
Binary files a/source/dev/images/icons/picture_add.png and /dev/null differ
diff --git a/source/dev/images/icons/picture_delete.png b/source/dev/images/icons/picture_delete.png
deleted file mode 100644
index 93c7977..0000000
Binary files a/source/dev/images/icons/picture_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/picture_edit.png b/source/dev/images/icons/picture_edit.png
deleted file mode 100644
index d9a5c57..0000000
Binary files a/source/dev/images/icons/picture_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/picture_empty.png b/source/dev/images/icons/picture_empty.png
deleted file mode 100644
index abd2b9b..0000000
Binary files a/source/dev/images/icons/picture_empty.png and /dev/null differ
diff --git a/source/dev/images/icons/picture_error.png b/source/dev/images/icons/picture_error.png
deleted file mode 100644
index d41d90d..0000000
Binary files a/source/dev/images/icons/picture_error.png and /dev/null differ
diff --git a/source/dev/images/icons/picture_go.png b/source/dev/images/icons/picture_go.png
deleted file mode 100644
index 27c63c5..0000000
Binary files a/source/dev/images/icons/picture_go.png and /dev/null differ
diff --git a/source/dev/images/icons/picture_key.png b/source/dev/images/icons/picture_key.png
deleted file mode 100644
index f0e600a..0000000
Binary files a/source/dev/images/icons/picture_key.png and /dev/null differ
diff --git a/source/dev/images/icons/picture_link.png b/source/dev/images/icons/picture_link.png
deleted file mode 100644
index e8c9e25..0000000
Binary files a/source/dev/images/icons/picture_link.png and /dev/null differ
diff --git a/source/dev/images/icons/picture_save.png b/source/dev/images/icons/picture_save.png
deleted file mode 100644
index 777fb5d..0000000
Binary files a/source/dev/images/icons/picture_save.png and /dev/null differ
diff --git a/source/dev/images/icons/pictures.png b/source/dev/images/icons/pictures.png
deleted file mode 100644
index 8f27a17..0000000
Binary files a/source/dev/images/icons/pictures.png and /dev/null differ
diff --git a/source/dev/images/icons/pilcrow.png b/source/dev/images/icons/pilcrow.png
deleted file mode 100644
index 58bb996..0000000
Binary files a/source/dev/images/icons/pilcrow.png and /dev/null differ
diff --git a/source/dev/images/icons/pill.png b/source/dev/images/icons/pill.png
deleted file mode 100644
index c091223..0000000
Binary files a/source/dev/images/icons/pill.png and /dev/null differ
diff --git a/source/dev/images/icons/pill_add.png b/source/dev/images/icons/pill_add.png
deleted file mode 100644
index 6dcf3f3..0000000
Binary files a/source/dev/images/icons/pill_add.png and /dev/null differ
diff --git a/source/dev/images/icons/pill_delete.png b/source/dev/images/icons/pill_delete.png
deleted file mode 100644
index 0dfbbcf..0000000
Binary files a/source/dev/images/icons/pill_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/pill_go.png b/source/dev/images/icons/pill_go.png
deleted file mode 100644
index cf91bc9..0000000
Binary files a/source/dev/images/icons/pill_go.png and /dev/null differ
diff --git a/source/dev/images/icons/plugin.png b/source/dev/images/icons/plugin.png
deleted file mode 100644
index 6187b15..0000000
Binary files a/source/dev/images/icons/plugin.png and /dev/null differ
diff --git a/source/dev/images/icons/plugin_add.png b/source/dev/images/icons/plugin_add.png
deleted file mode 100644
index 86fd525..0000000
Binary files a/source/dev/images/icons/plugin_add.png and /dev/null differ
diff --git a/source/dev/images/icons/plugin_delete.png b/source/dev/images/icons/plugin_delete.png
deleted file mode 100644
index 26d11dd..0000000
Binary files a/source/dev/images/icons/plugin_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/plugin_disabled.png b/source/dev/images/icons/plugin_disabled.png
deleted file mode 100644
index f4f6be5..0000000
Binary files a/source/dev/images/icons/plugin_disabled.png and /dev/null differ
diff --git a/source/dev/images/icons/plugin_edit.png b/source/dev/images/icons/plugin_edit.png
deleted file mode 100644
index f13ede0..0000000
Binary files a/source/dev/images/icons/plugin_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/plugin_error.png b/source/dev/images/icons/plugin_error.png
deleted file mode 100644
index cff65d7..0000000
Binary files a/source/dev/images/icons/plugin_error.png and /dev/null differ
diff --git a/source/dev/images/icons/plugin_go.png b/source/dev/images/icons/plugin_go.png
deleted file mode 100644
index 41da991..0000000
Binary files a/source/dev/images/icons/plugin_go.png and /dev/null differ
diff --git a/source/dev/images/icons/plugin_link.png b/source/dev/images/icons/plugin_link.png
deleted file mode 100644
index 3670280..0000000
Binary files a/source/dev/images/icons/plugin_link.png and /dev/null differ
diff --git a/source/dev/images/icons/printer.png b/source/dev/images/icons/printer.png
deleted file mode 100644
index 919c25e..0000000
Binary files a/source/dev/images/icons/printer.png and /dev/null differ
diff --git a/source/dev/images/icons/printer_add.png b/source/dev/images/icons/printer_add.png
deleted file mode 100644
index 7921bf0..0000000
Binary files a/source/dev/images/icons/printer_add.png and /dev/null differ
diff --git a/source/dev/images/icons/printer_delete.png b/source/dev/images/icons/printer_delete.png
deleted file mode 100644
index 683126d..0000000
Binary files a/source/dev/images/icons/printer_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/printer_empty.png b/source/dev/images/icons/printer_empty.png
deleted file mode 100644
index 94e8c16..0000000
Binary files a/source/dev/images/icons/printer_empty.png and /dev/null differ
diff --git a/source/dev/images/icons/printer_error.png b/source/dev/images/icons/printer_error.png
deleted file mode 100644
index 97d2bbf..0000000
Binary files a/source/dev/images/icons/printer_error.png and /dev/null differ
diff --git a/source/dev/images/icons/rainbow.png b/source/dev/images/icons/rainbow.png
deleted file mode 100644
index bd38ec3..0000000
Binary files a/source/dev/images/icons/rainbow.png and /dev/null differ
diff --git a/source/dev/images/icons/report.png b/source/dev/images/icons/report.png
deleted file mode 100644
index 230caba..0000000
Binary files a/source/dev/images/icons/report.png and /dev/null differ
diff --git a/source/dev/images/icons/report_add.png b/source/dev/images/icons/report_add.png
deleted file mode 100644
index 44969aa..0000000
Binary files a/source/dev/images/icons/report_add.png and /dev/null differ
diff --git a/source/dev/images/icons/report_delete.png b/source/dev/images/icons/report_delete.png
deleted file mode 100644
index bb279c3..0000000
Binary files a/source/dev/images/icons/report_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/report_disk.png b/source/dev/images/icons/report_disk.png
deleted file mode 100644
index f9c00ff..0000000
Binary files a/source/dev/images/icons/report_disk.png and /dev/null differ
diff --git a/source/dev/images/icons/report_edit.png b/source/dev/images/icons/report_edit.png
deleted file mode 100644
index f1bef1e..0000000
Binary files a/source/dev/images/icons/report_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/report_go.png b/source/dev/images/icons/report_go.png
deleted file mode 100644
index 3e3f383..0000000
Binary files a/source/dev/images/icons/report_go.png and /dev/null differ
diff --git a/source/dev/images/icons/report_key.png b/source/dev/images/icons/report_key.png
deleted file mode 100644
index 5832b49..0000000
Binary files a/source/dev/images/icons/report_key.png and /dev/null differ
diff --git a/source/dev/images/icons/report_link.png b/source/dev/images/icons/report_link.png
deleted file mode 100644
index 7a411b4..0000000
Binary files a/source/dev/images/icons/report_link.png and /dev/null differ
diff --git a/source/dev/images/icons/report_magnify.png b/source/dev/images/icons/report_magnify.png
deleted file mode 100644
index 3d909c3..0000000
Binary files a/source/dev/images/icons/report_magnify.png and /dev/null differ
diff --git a/source/dev/images/icons/report_picture.png b/source/dev/images/icons/report_picture.png
deleted file mode 100644
index 1c4d4d7..0000000
Binary files a/source/dev/images/icons/report_picture.png and /dev/null differ
diff --git a/source/dev/images/icons/report_user.png b/source/dev/images/icons/report_user.png
deleted file mode 100644
index f03d212..0000000
Binary files a/source/dev/images/icons/report_user.png and /dev/null differ
diff --git a/source/dev/images/icons/report_word.png b/source/dev/images/icons/report_word.png
deleted file mode 100644
index 5f30669..0000000
Binary files a/source/dev/images/icons/report_word.png and /dev/null differ
diff --git a/source/dev/images/icons/resultset_first.png b/source/dev/images/icons/resultset_first.png
deleted file mode 100644
index eeeb4c3..0000000
Binary files a/source/dev/images/icons/resultset_first.png and /dev/null differ
diff --git a/source/dev/images/icons/resultset_last.png b/source/dev/images/icons/resultset_last.png
deleted file mode 100644
index e148a71..0000000
Binary files a/source/dev/images/icons/resultset_last.png and /dev/null differ
diff --git a/source/dev/images/icons/resultset_next.png b/source/dev/images/icons/resultset_next.png
deleted file mode 100644
index e4b6a5f..0000000
Binary files a/source/dev/images/icons/resultset_next.png and /dev/null differ
diff --git a/source/dev/images/icons/resultset_previous.png b/source/dev/images/icons/resultset_previous.png
deleted file mode 100644
index 51d77c7..0000000
Binary files a/source/dev/images/icons/resultset_previous.png and /dev/null differ
diff --git a/source/dev/images/icons/rosette.png b/source/dev/images/icons/rosette.png
deleted file mode 100644
index a932a51..0000000
Binary files a/source/dev/images/icons/rosette.png and /dev/null differ
diff --git a/source/dev/images/icons/rss.png b/source/dev/images/icons/rss.png
deleted file mode 100644
index 1dc6ff3..0000000
Binary files a/source/dev/images/icons/rss.png and /dev/null differ
diff --git a/source/dev/images/icons/rss_add.png b/source/dev/images/icons/rss_add.png
deleted file mode 100644
index e413580..0000000
Binary files a/source/dev/images/icons/rss_add.png and /dev/null differ
diff --git a/source/dev/images/icons/rss_delete.png b/source/dev/images/icons/rss_delete.png
deleted file mode 100644
index 9deb738..0000000
Binary files a/source/dev/images/icons/rss_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/rss_go.png b/source/dev/images/icons/rss_go.png
deleted file mode 100644
index 43a86bf..0000000
Binary files a/source/dev/images/icons/rss_go.png and /dev/null differ
diff --git a/source/dev/images/icons/rss_valid.png b/source/dev/images/icons/rss_valid.png
deleted file mode 100644
index a6d0b0e..0000000
Binary files a/source/dev/images/icons/rss_valid.png and /dev/null differ
diff --git a/source/dev/images/icons/ruby.png b/source/dev/images/icons/ruby.png
deleted file mode 100644
index 0c65010..0000000
Binary files a/source/dev/images/icons/ruby.png and /dev/null differ
diff --git a/source/dev/images/icons/ruby_add.png b/source/dev/images/icons/ruby_add.png
deleted file mode 100644
index dc6d1c7..0000000
Binary files a/source/dev/images/icons/ruby_add.png and /dev/null differ
diff --git a/source/dev/images/icons/ruby_delete.png b/source/dev/images/icons/ruby_delete.png
deleted file mode 100644
index e69203b..0000000
Binary files a/source/dev/images/icons/ruby_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/ruby_gear.png b/source/dev/images/icons/ruby_gear.png
deleted file mode 100644
index ed39aa0..0000000
Binary files a/source/dev/images/icons/ruby_gear.png and /dev/null differ
diff --git a/source/dev/images/icons/ruby_get.png b/source/dev/images/icons/ruby_get.png
deleted file mode 100644
index b6660a3..0000000
Binary files a/source/dev/images/icons/ruby_get.png and /dev/null differ
diff --git a/source/dev/images/icons/ruby_go.png b/source/dev/images/icons/ruby_go.png
deleted file mode 100644
index 6c79f5c..0000000
Binary files a/source/dev/images/icons/ruby_go.png and /dev/null differ
diff --git a/source/dev/images/icons/ruby_key.png b/source/dev/images/icons/ruby_key.png
deleted file mode 100644
index cbbd9a2..0000000
Binary files a/source/dev/images/icons/ruby_key.png and /dev/null differ
diff --git a/source/dev/images/icons/ruby_link.png b/source/dev/images/icons/ruby_link.png
deleted file mode 100644
index a50b2e8..0000000
Binary files a/source/dev/images/icons/ruby_link.png and /dev/null differ
diff --git a/source/dev/images/icons/ruby_put.png b/source/dev/images/icons/ruby_put.png
deleted file mode 100644
index 496f3cd..0000000
Binary files a/source/dev/images/icons/ruby_put.png and /dev/null differ
diff --git a/source/dev/images/icons/script.png b/source/dev/images/icons/script.png
deleted file mode 100644
index 0f9ed4d..0000000
Binary files a/source/dev/images/icons/script.png and /dev/null differ
diff --git a/source/dev/images/icons/script_add.png b/source/dev/images/icons/script_add.png
deleted file mode 100644
index d0feafb..0000000
Binary files a/source/dev/images/icons/script_add.png and /dev/null differ
diff --git a/source/dev/images/icons/script_code.png b/source/dev/images/icons/script_code.png
deleted file mode 100644
index c1baea1..0000000
Binary files a/source/dev/images/icons/script_code.png and /dev/null differ
diff --git a/source/dev/images/icons/script_code_red.png b/source/dev/images/icons/script_code_red.png
deleted file mode 100644
index 5aac38e..0000000
Binary files a/source/dev/images/icons/script_code_red.png and /dev/null differ
diff --git a/source/dev/images/icons/script_delete.png b/source/dev/images/icons/script_delete.png
deleted file mode 100644
index bcad297..0000000
Binary files a/source/dev/images/icons/script_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/script_edit.png b/source/dev/images/icons/script_edit.png
deleted file mode 100644
index c8c38e9..0000000
Binary files a/source/dev/images/icons/script_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/script_error.png b/source/dev/images/icons/script_error.png
deleted file mode 100644
index e0e2000..0000000
Binary files a/source/dev/images/icons/script_error.png and /dev/null differ
diff --git a/source/dev/images/icons/script_gear.png b/source/dev/images/icons/script_gear.png
deleted file mode 100644
index e0c6c5d..0000000
Binary files a/source/dev/images/icons/script_gear.png and /dev/null differ
diff --git a/source/dev/images/icons/script_go.png b/source/dev/images/icons/script_go.png
deleted file mode 100644
index 8e154e2..0000000
Binary files a/source/dev/images/icons/script_go.png and /dev/null differ
diff --git a/source/dev/images/icons/script_key.png b/source/dev/images/icons/script_key.png
deleted file mode 100644
index 27e2af9..0000000
Binary files a/source/dev/images/icons/script_key.png and /dev/null differ
diff --git a/source/dev/images/icons/script_lightning.png b/source/dev/images/icons/script_lightning.png
deleted file mode 100644
index 6c7157b..0000000
Binary files a/source/dev/images/icons/script_lightning.png and /dev/null differ
diff --git a/source/dev/images/icons/script_link.png b/source/dev/images/icons/script_link.png
deleted file mode 100644
index c721205..0000000
Binary files a/source/dev/images/icons/script_link.png and /dev/null differ
diff --git a/source/dev/images/icons/script_palette.png b/source/dev/images/icons/script_palette.png
deleted file mode 100644
index da0e4a5..0000000
Binary files a/source/dev/images/icons/script_palette.png and /dev/null differ
diff --git a/source/dev/images/icons/script_save.png b/source/dev/images/icons/script_save.png
deleted file mode 100644
index 36216d8..0000000
Binary files a/source/dev/images/icons/script_save.png and /dev/null differ
diff --git a/source/dev/images/icons/server.png b/source/dev/images/icons/server.png
deleted file mode 100644
index 720a237..0000000
Binary files a/source/dev/images/icons/server.png and /dev/null differ
diff --git a/source/dev/images/icons/server_add.png b/source/dev/images/icons/server_add.png
deleted file mode 100644
index 62f576c..0000000
Binary files a/source/dev/images/icons/server_add.png and /dev/null differ
diff --git a/source/dev/images/icons/server_chart.png b/source/dev/images/icons/server_chart.png
deleted file mode 100644
index 1128d3f..0000000
Binary files a/source/dev/images/icons/server_chart.png and /dev/null differ
diff --git a/source/dev/images/icons/server_compressed.png b/source/dev/images/icons/server_compressed.png
deleted file mode 100644
index bf49fad..0000000
Binary files a/source/dev/images/icons/server_compressed.png and /dev/null differ
diff --git a/source/dev/images/icons/server_connect.png b/source/dev/images/icons/server_connect.png
deleted file mode 100644
index 49b2691..0000000
Binary files a/source/dev/images/icons/server_connect.png and /dev/null differ
diff --git a/source/dev/images/icons/server_database.png b/source/dev/images/icons/server_database.png
deleted file mode 100644
index b24e826..0000000
Binary files a/source/dev/images/icons/server_database.png and /dev/null differ
diff --git a/source/dev/images/icons/server_delete.png b/source/dev/images/icons/server_delete.png
deleted file mode 100644
index 61e740f..0000000
Binary files a/source/dev/images/icons/server_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/server_edit.png b/source/dev/images/icons/server_edit.png
deleted file mode 100644
index 3eb4c5f..0000000
Binary files a/source/dev/images/icons/server_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/server_error.png b/source/dev/images/icons/server_error.png
deleted file mode 100644
index f640256..0000000
Binary files a/source/dev/images/icons/server_error.png and /dev/null differ
diff --git a/source/dev/images/icons/server_go.png b/source/dev/images/icons/server_go.png
deleted file mode 100644
index 540c8e2..0000000
Binary files a/source/dev/images/icons/server_go.png and /dev/null differ
diff --git a/source/dev/images/icons/server_key.png b/source/dev/images/icons/server_key.png
deleted file mode 100644
index 3624254..0000000
Binary files a/source/dev/images/icons/server_key.png and /dev/null differ
diff --git a/source/dev/images/icons/server_lightning.png b/source/dev/images/icons/server_lightning.png
deleted file mode 100644
index b0f4e46..0000000
Binary files a/source/dev/images/icons/server_lightning.png and /dev/null differ
diff --git a/source/dev/images/icons/server_link.png b/source/dev/images/icons/server_link.png
deleted file mode 100644
index e8821df..0000000
Binary files a/source/dev/images/icons/server_link.png and /dev/null differ
diff --git a/source/dev/images/icons/server_uncompressed.png b/source/dev/images/icons/server_uncompressed.png
deleted file mode 100644
index 86e8325..0000000
Binary files a/source/dev/images/icons/server_uncompressed.png and /dev/null differ
diff --git a/source/dev/images/icons/shading.png b/source/dev/images/icons/shading.png
deleted file mode 100644
index 55c12cb..0000000
Binary files a/source/dev/images/icons/shading.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_align_bottom.png b/source/dev/images/icons/shape_align_bottom.png
deleted file mode 100644
index 55d2694..0000000
Binary files a/source/dev/images/icons/shape_align_bottom.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_align_center.png b/source/dev/images/icons/shape_align_center.png
deleted file mode 100644
index efe9a98..0000000
Binary files a/source/dev/images/icons/shape_align_center.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_align_left.png b/source/dev/images/icons/shape_align_left.png
deleted file mode 100644
index aaedc41..0000000
Binary files a/source/dev/images/icons/shape_align_left.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_align_middle.png b/source/dev/images/icons/shape_align_middle.png
deleted file mode 100644
index d350dd8..0000000
Binary files a/source/dev/images/icons/shape_align_middle.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_align_right.png b/source/dev/images/icons/shape_align_right.png
deleted file mode 100644
index ff556b6..0000000
Binary files a/source/dev/images/icons/shape_align_right.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_align_top.png b/source/dev/images/icons/shape_align_top.png
deleted file mode 100644
index 1181b43..0000000
Binary files a/source/dev/images/icons/shape_align_top.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_flip_horizontal.png b/source/dev/images/icons/shape_flip_horizontal.png
deleted file mode 100644
index ad98b76..0000000
Binary files a/source/dev/images/icons/shape_flip_horizontal.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_flip_vertical.png b/source/dev/images/icons/shape_flip_vertical.png
deleted file mode 100644
index f355529..0000000
Binary files a/source/dev/images/icons/shape_flip_vertical.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_group.png b/source/dev/images/icons/shape_group.png
deleted file mode 100644
index bb2ff51..0000000
Binary files a/source/dev/images/icons/shape_group.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_handles.png b/source/dev/images/icons/shape_handles.png
deleted file mode 100644
index ce27fe3..0000000
Binary files a/source/dev/images/icons/shape_handles.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_move_back.png b/source/dev/images/icons/shape_move_back.png
deleted file mode 100644
index a216ffd..0000000
Binary files a/source/dev/images/icons/shape_move_back.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_move_backwards.png b/source/dev/images/icons/shape_move_backwards.png
deleted file mode 100644
index ee3f9b2..0000000
Binary files a/source/dev/images/icons/shape_move_backwards.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_move_forwards.png b/source/dev/images/icons/shape_move_forwards.png
deleted file mode 100644
index cfe4493..0000000
Binary files a/source/dev/images/icons/shape_move_forwards.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_move_front.png b/source/dev/images/icons/shape_move_front.png
deleted file mode 100644
index b4a4e3b..0000000
Binary files a/source/dev/images/icons/shape_move_front.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_rotate_anticlockwise.png b/source/dev/images/icons/shape_rotate_anticlockwise.png
deleted file mode 100644
index 19f4a1f..0000000
Binary files a/source/dev/images/icons/shape_rotate_anticlockwise.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_rotate_clockwise.png b/source/dev/images/icons/shape_rotate_clockwise.png
deleted file mode 100644
index 3e7992f..0000000
Binary files a/source/dev/images/icons/shape_rotate_clockwise.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_square.png b/source/dev/images/icons/shape_square.png
deleted file mode 100644
index 33af046..0000000
Binary files a/source/dev/images/icons/shape_square.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_square_add.png b/source/dev/images/icons/shape_square_add.png
deleted file mode 100644
index 31edfce..0000000
Binary files a/source/dev/images/icons/shape_square_add.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_square_delete.png b/source/dev/images/icons/shape_square_delete.png
deleted file mode 100644
index ede912d..0000000
Binary files a/source/dev/images/icons/shape_square_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_square_edit.png b/source/dev/images/icons/shape_square_edit.png
deleted file mode 100644
index c1fa7e3..0000000
Binary files a/source/dev/images/icons/shape_square_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_square_error.png b/source/dev/images/icons/shape_square_error.png
deleted file mode 100644
index 0d0dcfa..0000000
Binary files a/source/dev/images/icons/shape_square_error.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_square_go.png b/source/dev/images/icons/shape_square_go.png
deleted file mode 100644
index 5a2ad90..0000000
Binary files a/source/dev/images/icons/shape_square_go.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_square_key.png b/source/dev/images/icons/shape_square_key.png
deleted file mode 100644
index c34b982..0000000
Binary files a/source/dev/images/icons/shape_square_key.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_square_link.png b/source/dev/images/icons/shape_square_link.png
deleted file mode 100644
index 9667287..0000000
Binary files a/source/dev/images/icons/shape_square_link.png and /dev/null differ
diff --git a/source/dev/images/icons/shape_ungroup.png b/source/dev/images/icons/shape_ungroup.png
deleted file mode 100644
index 8fa20ff..0000000
Binary files a/source/dev/images/icons/shape_ungroup.png and /dev/null differ
diff --git a/source/dev/images/icons/shield.png b/source/dev/images/icons/shield.png
deleted file mode 100644
index 575d35d..0000000
Binary files a/source/dev/images/icons/shield.png and /dev/null differ
diff --git a/source/dev/images/icons/shield_add.png b/source/dev/images/icons/shield_add.png
deleted file mode 100644
index cd2e5f9..0000000
Binary files a/source/dev/images/icons/shield_add.png and /dev/null differ
diff --git a/source/dev/images/icons/shield_delete.png b/source/dev/images/icons/shield_delete.png
deleted file mode 100644
index 9c47f38..0000000
Binary files a/source/dev/images/icons/shield_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/shield_go.png b/source/dev/images/icons/shield_go.png
deleted file mode 100644
index 43b843d..0000000
Binary files a/source/dev/images/icons/shield_go.png and /dev/null differ
diff --git a/source/dev/images/icons/sitemap.png b/source/dev/images/icons/sitemap.png
deleted file mode 100644
index ca779f3..0000000
Binary files a/source/dev/images/icons/sitemap.png and /dev/null differ
diff --git a/source/dev/images/icons/sitemap_color.png b/source/dev/images/icons/sitemap_color.png
deleted file mode 100644
index 41e3c8c..0000000
Binary files a/source/dev/images/icons/sitemap_color.png and /dev/null differ
diff --git a/source/dev/images/icons/sound.png b/source/dev/images/icons/sound.png
deleted file mode 100644
index 2f187fd..0000000
Binary files a/source/dev/images/icons/sound.png and /dev/null differ
diff --git a/source/dev/images/icons/sound_add.png b/source/dev/images/icons/sound_add.png
deleted file mode 100644
index c1e6e08..0000000
Binary files a/source/dev/images/icons/sound_add.png and /dev/null differ
diff --git a/source/dev/images/icons/sound_delete.png b/source/dev/images/icons/sound_delete.png
deleted file mode 100644
index eeb5765..0000000
Binary files a/source/dev/images/icons/sound_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/sound_low.png b/source/dev/images/icons/sound_low.png
deleted file mode 100644
index 4cb2c3c..0000000
Binary files a/source/dev/images/icons/sound_low.png and /dev/null differ
diff --git a/source/dev/images/icons/sound_mute.png b/source/dev/images/icons/sound_mute.png
deleted file mode 100644
index 8dd8d62..0000000
Binary files a/source/dev/images/icons/sound_mute.png and /dev/null differ
diff --git a/source/dev/images/icons/sound_none.png b/source/dev/images/icons/sound_none.png
deleted file mode 100644
index 033c936..0000000
Binary files a/source/dev/images/icons/sound_none.png and /dev/null differ
diff --git a/source/dev/images/icons/spellcheck.png b/source/dev/images/icons/spellcheck.png
deleted file mode 100644
index c2ea070..0000000
Binary files a/source/dev/images/icons/spellcheck.png and /dev/null differ
diff --git a/source/dev/images/icons/sport_8ball.png b/source/dev/images/icons/sport_8ball.png
deleted file mode 100644
index 4f627b7..0000000
Binary files a/source/dev/images/icons/sport_8ball.png and /dev/null differ
diff --git a/source/dev/images/icons/sport_basketball.png b/source/dev/images/icons/sport_basketball.png
deleted file mode 100644
index d2f128c..0000000
Binary files a/source/dev/images/icons/sport_basketball.png and /dev/null differ
diff --git a/source/dev/images/icons/sport_football.png b/source/dev/images/icons/sport_football.png
deleted file mode 100644
index 63d824d..0000000
Binary files a/source/dev/images/icons/sport_football.png and /dev/null differ
diff --git a/source/dev/images/icons/sport_golf.png b/source/dev/images/icons/sport_golf.png
deleted file mode 100644
index f482551..0000000
Binary files a/source/dev/images/icons/sport_golf.png and /dev/null differ
diff --git a/source/dev/images/icons/sport_raquet.png b/source/dev/images/icons/sport_raquet.png
deleted file mode 100644
index 395c4e9..0000000
Binary files a/source/dev/images/icons/sport_raquet.png and /dev/null differ
diff --git a/source/dev/images/icons/sport_shuttlecock.png b/source/dev/images/icons/sport_shuttlecock.png
deleted file mode 100644
index bbf60f7..0000000
Binary files a/source/dev/images/icons/sport_shuttlecock.png and /dev/null differ
diff --git a/source/dev/images/icons/sport_soccer.png b/source/dev/images/icons/sport_soccer.png
deleted file mode 100644
index c77de91..0000000
Binary files a/source/dev/images/icons/sport_soccer.png and /dev/null differ
diff --git a/source/dev/images/icons/sport_tennis.png b/source/dev/images/icons/sport_tennis.png
deleted file mode 100644
index 01bc804..0000000
Binary files a/source/dev/images/icons/sport_tennis.png and /dev/null differ
diff --git a/source/dev/images/icons/star.png b/source/dev/images/icons/star.png
deleted file mode 100644
index af37598..0000000
Binary files a/source/dev/images/icons/star.png and /dev/null differ
diff --git a/source/dev/images/icons/status_away.png b/source/dev/images/icons/status_away.png
deleted file mode 100644
index 554ba2c..0000000
Binary files a/source/dev/images/icons/status_away.png and /dev/null differ
diff --git a/source/dev/images/icons/status_busy.png b/source/dev/images/icons/status_busy.png
deleted file mode 100644
index 1e37203..0000000
Binary files a/source/dev/images/icons/status_busy.png and /dev/null differ
diff --git a/source/dev/images/icons/status_offline.png b/source/dev/images/icons/status_offline.png
deleted file mode 100644
index 2beb4c9..0000000
Binary files a/source/dev/images/icons/status_offline.png and /dev/null differ
diff --git a/source/dev/images/icons/status_online.png b/source/dev/images/icons/status_online.png
deleted file mode 100644
index 26a6882..0000000
Binary files a/source/dev/images/icons/status_online.png and /dev/null differ
diff --git a/source/dev/images/icons/stop.png b/source/dev/images/icons/stop.png
deleted file mode 100644
index 7bb22e5..0000000
Binary files a/source/dev/images/icons/stop.png and /dev/null differ
diff --git a/source/dev/images/icons/style.png b/source/dev/images/icons/style.png
deleted file mode 100644
index 1a7adb2..0000000
Binary files a/source/dev/images/icons/style.png and /dev/null differ
diff --git a/source/dev/images/icons/style_add.png b/source/dev/images/icons/style_add.png
deleted file mode 100644
index fa8f008..0000000
Binary files a/source/dev/images/icons/style_add.png and /dev/null differ
diff --git a/source/dev/images/icons/style_delete.png b/source/dev/images/icons/style_delete.png
deleted file mode 100644
index ac7d62a..0000000
Binary files a/source/dev/images/icons/style_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/style_edit.png b/source/dev/images/icons/style_edit.png
deleted file mode 100644
index a12ec67..0000000
Binary files a/source/dev/images/icons/style_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/style_go.png b/source/dev/images/icons/style_go.png
deleted file mode 100644
index aec7400..0000000
Binary files a/source/dev/images/icons/style_go.png and /dev/null differ
diff --git a/source/dev/images/icons/sum.png b/source/dev/images/icons/sum.png
deleted file mode 100644
index fd7b32e..0000000
Binary files a/source/dev/images/icons/sum.png and /dev/null differ
diff --git a/source/dev/images/icons/tab.png b/source/dev/images/icons/tab.png
deleted file mode 100644
index 4e640cc..0000000
Binary files a/source/dev/images/icons/tab.png and /dev/null differ
diff --git a/source/dev/images/icons/tab_add.png b/source/dev/images/icons/tab_add.png
deleted file mode 100644
index 6377075..0000000
Binary files a/source/dev/images/icons/tab_add.png and /dev/null differ
diff --git a/source/dev/images/icons/tab_delete.png b/source/dev/images/icons/tab_delete.png
deleted file mode 100644
index cb1cece..0000000
Binary files a/source/dev/images/icons/tab_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/tab_edit.png b/source/dev/images/icons/tab_edit.png
deleted file mode 100644
index e0b05f0..0000000
Binary files a/source/dev/images/icons/tab_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/tab_go.png b/source/dev/images/icons/tab_go.png
deleted file mode 100644
index ada17eb..0000000
Binary files a/source/dev/images/icons/tab_go.png and /dev/null differ
diff --git a/source/dev/images/icons/table.png b/source/dev/images/icons/table.png
deleted file mode 100644
index 9907a4d..0000000
Binary files a/source/dev/images/icons/table.png and /dev/null differ
diff --git a/source/dev/images/icons/table_add.png b/source/dev/images/icons/table_add.png
deleted file mode 100644
index aa418f7..0000000
Binary files a/source/dev/images/icons/table_add.png and /dev/null differ
diff --git a/source/dev/images/icons/table_delete.png b/source/dev/images/icons/table_delete.png
deleted file mode 100644
index e770509..0000000
Binary files a/source/dev/images/icons/table_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/table_edit.png b/source/dev/images/icons/table_edit.png
deleted file mode 100644
index aa9d37a..0000000
Binary files a/source/dev/images/icons/table_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/table_error.png b/source/dev/images/icons/table_error.png
deleted file mode 100644
index 589e92b..0000000
Binary files a/source/dev/images/icons/table_error.png and /dev/null differ
diff --git a/source/dev/images/icons/table_gear.png b/source/dev/images/icons/table_gear.png
deleted file mode 100644
index b6ef8e9..0000000
Binary files a/source/dev/images/icons/table_gear.png and /dev/null differ
diff --git a/source/dev/images/icons/table_go.png b/source/dev/images/icons/table_go.png
deleted file mode 100644
index 0528dfa..0000000
Binary files a/source/dev/images/icons/table_go.png and /dev/null differ
diff --git a/source/dev/images/icons/table_key.png b/source/dev/images/icons/table_key.png
deleted file mode 100644
index f78e3cc..0000000
Binary files a/source/dev/images/icons/table_key.png and /dev/null differ
diff --git a/source/dev/images/icons/table_lightning.png b/source/dev/images/icons/table_lightning.png
deleted file mode 100644
index 2df0661..0000000
Binary files a/source/dev/images/icons/table_lightning.png and /dev/null differ
diff --git a/source/dev/images/icons/table_link.png b/source/dev/images/icons/table_link.png
deleted file mode 100644
index 45d5170..0000000
Binary files a/source/dev/images/icons/table_link.png and /dev/null differ
diff --git a/source/dev/images/icons/table_multiple.png b/source/dev/images/icons/table_multiple.png
deleted file mode 100644
index e9aae3f..0000000
Binary files a/source/dev/images/icons/table_multiple.png and /dev/null differ
diff --git a/source/dev/images/icons/table_refresh.png b/source/dev/images/icons/table_refresh.png
deleted file mode 100644
index d8ab2f1..0000000
Binary files a/source/dev/images/icons/table_refresh.png and /dev/null differ
diff --git a/source/dev/images/icons/table_relationship.png b/source/dev/images/icons/table_relationship.png
deleted file mode 100644
index dabe2f4..0000000
Binary files a/source/dev/images/icons/table_relationship.png and /dev/null differ
diff --git a/source/dev/images/icons/table_row_delete.png b/source/dev/images/icons/table_row_delete.png
deleted file mode 100644
index 8818d9d..0000000
Binary files a/source/dev/images/icons/table_row_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/table_row_insert.png b/source/dev/images/icons/table_row_insert.png
deleted file mode 100644
index 0fcd34c..0000000
Binary files a/source/dev/images/icons/table_row_insert.png and /dev/null differ
diff --git a/source/dev/images/icons/table_save.png b/source/dev/images/icons/table_save.png
deleted file mode 100644
index 25b74d1..0000000
Binary files a/source/dev/images/icons/table_save.png and /dev/null differ
diff --git a/source/dev/images/icons/table_sort.png b/source/dev/images/icons/table_sort.png
deleted file mode 100644
index ed6785a..0000000
Binary files a/source/dev/images/icons/table_sort.png and /dev/null differ
diff --git a/source/dev/images/icons/tag.png b/source/dev/images/icons/tag.png
deleted file mode 100644
index 1dd909c..0000000
Binary files a/source/dev/images/icons/tag.png and /dev/null differ
diff --git a/source/dev/images/icons/tag_blue.png b/source/dev/images/icons/tag_blue.png
deleted file mode 100644
index 84924c2..0000000
Binary files a/source/dev/images/icons/tag_blue.png and /dev/null differ
diff --git a/source/dev/images/icons/tag_blue_add.png b/source/dev/images/icons/tag_blue_add.png
deleted file mode 100644
index f0dfd30..0000000
Binary files a/source/dev/images/icons/tag_blue_add.png and /dev/null differ
diff --git a/source/dev/images/icons/tag_blue_delete.png b/source/dev/images/icons/tag_blue_delete.png
deleted file mode 100644
index a9b05a5..0000000
Binary files a/source/dev/images/icons/tag_blue_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/tag_blue_edit.png b/source/dev/images/icons/tag_blue_edit.png
deleted file mode 100644
index 7082163..0000000
Binary files a/source/dev/images/icons/tag_blue_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/tag_green.png b/source/dev/images/icons/tag_green.png
deleted file mode 100644
index 885ff16..0000000
Binary files a/source/dev/images/icons/tag_green.png and /dev/null differ
diff --git a/source/dev/images/icons/tag_orange.png b/source/dev/images/icons/tag_orange.png
deleted file mode 100644
index 4d54916..0000000
Binary files a/source/dev/images/icons/tag_orange.png and /dev/null differ
diff --git a/source/dev/images/icons/tag_pink.png b/source/dev/images/icons/tag_pink.png
deleted file mode 100644
index b1d721f..0000000
Binary files a/source/dev/images/icons/tag_pink.png and /dev/null differ
diff --git a/source/dev/images/icons/tag_purple.png b/source/dev/images/icons/tag_purple.png
deleted file mode 100644
index af0e9e2..0000000
Binary files a/source/dev/images/icons/tag_purple.png and /dev/null differ
diff --git a/source/dev/images/icons/tag_red.png b/source/dev/images/icons/tag_red.png
deleted file mode 100644
index 100bf54..0000000
Binary files a/source/dev/images/icons/tag_red.png and /dev/null differ
diff --git a/source/dev/images/icons/tag_yellow.png b/source/dev/images/icons/tag_yellow.png
deleted file mode 100644
index 4f9ea95..0000000
Binary files a/source/dev/images/icons/tag_yellow.png and /dev/null differ
diff --git a/source/dev/images/icons/telephone.png b/source/dev/images/icons/telephone.png
deleted file mode 100644
index cecc436..0000000
Binary files a/source/dev/images/icons/telephone.png and /dev/null differ
diff --git a/source/dev/images/icons/telephone_add.png b/source/dev/images/icons/telephone_add.png
deleted file mode 100644
index 0a0ddf9..0000000
Binary files a/source/dev/images/icons/telephone_add.png and /dev/null differ
diff --git a/source/dev/images/icons/telephone_delete.png b/source/dev/images/icons/telephone_delete.png
deleted file mode 100644
index 0013268..0000000
Binary files a/source/dev/images/icons/telephone_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/telephone_edit.png b/source/dev/images/icons/telephone_edit.png
deleted file mode 100644
index 90c036a..0000000
Binary files a/source/dev/images/icons/telephone_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/telephone_error.png b/source/dev/images/icons/telephone_error.png
deleted file mode 100644
index d3ec3a1..0000000
Binary files a/source/dev/images/icons/telephone_error.png and /dev/null differ
diff --git a/source/dev/images/icons/telephone_go.png b/source/dev/images/icons/telephone_go.png
deleted file mode 100644
index 395c8fb..0000000
Binary files a/source/dev/images/icons/telephone_go.png and /dev/null differ
diff --git a/source/dev/images/icons/telephone_key.png b/source/dev/images/icons/telephone_key.png
deleted file mode 100644
index cef5dec..0000000
Binary files a/source/dev/images/icons/telephone_key.png and /dev/null differ
diff --git a/source/dev/images/icons/telephone_link.png b/source/dev/images/icons/telephone_link.png
deleted file mode 100644
index 9d4898d..0000000
Binary files a/source/dev/images/icons/telephone_link.png and /dev/null differ
diff --git a/source/dev/images/icons/television.png b/source/dev/images/icons/television.png
deleted file mode 100644
index 1738a4f..0000000
Binary files a/source/dev/images/icons/television.png and /dev/null differ
diff --git a/source/dev/images/icons/television_add.png b/source/dev/images/icons/television_add.png
deleted file mode 100644
index 7cc6dfb..0000000
Binary files a/source/dev/images/icons/television_add.png and /dev/null differ
diff --git a/source/dev/images/icons/television_delete.png b/source/dev/images/icons/television_delete.png
deleted file mode 100644
index eeb4114..0000000
Binary files a/source/dev/images/icons/television_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/text_align_center.png b/source/dev/images/icons/text_align_center.png
deleted file mode 100644
index 57beb38..0000000
Binary files a/source/dev/images/icons/text_align_center.png and /dev/null differ
diff --git a/source/dev/images/icons/text_align_justify.png b/source/dev/images/icons/text_align_justify.png
deleted file mode 100644
index 2fbdd69..0000000
Binary files a/source/dev/images/icons/text_align_justify.png and /dev/null differ
diff --git a/source/dev/images/icons/text_align_left.png b/source/dev/images/icons/text_align_left.png
deleted file mode 100644
index 6c8fcc1..0000000
Binary files a/source/dev/images/icons/text_align_left.png and /dev/null differ
diff --git a/source/dev/images/icons/text_align_right.png b/source/dev/images/icons/text_align_right.png
deleted file mode 100644
index a150257..0000000
Binary files a/source/dev/images/icons/text_align_right.png and /dev/null differ
diff --git a/source/dev/images/icons/text_allcaps.png b/source/dev/images/icons/text_allcaps.png
deleted file mode 100644
index 280fd44..0000000
Binary files a/source/dev/images/icons/text_allcaps.png and /dev/null differ
diff --git a/source/dev/images/icons/text_bold.png b/source/dev/images/icons/text_bold.png
deleted file mode 100644
index f04ae46..0000000
Binary files a/source/dev/images/icons/text_bold.png and /dev/null differ
diff --git a/source/dev/images/icons/text_columns.png b/source/dev/images/icons/text_columns.png
deleted file mode 100644
index 97b2e03..0000000
Binary files a/source/dev/images/icons/text_columns.png and /dev/null differ
diff --git a/source/dev/images/icons/text_dropcaps.png b/source/dev/images/icons/text_dropcaps.png
deleted file mode 100644
index dd65786..0000000
Binary files a/source/dev/images/icons/text_dropcaps.png and /dev/null differ
diff --git a/source/dev/images/icons/text_heading_1.png b/source/dev/images/icons/text_heading_1.png
deleted file mode 100644
index 9c122e9..0000000
Binary files a/source/dev/images/icons/text_heading_1.png and /dev/null differ
diff --git a/source/dev/images/icons/text_heading_2.png b/source/dev/images/icons/text_heading_2.png
deleted file mode 100644
index 363f7bc..0000000
Binary files a/source/dev/images/icons/text_heading_2.png and /dev/null differ
diff --git a/source/dev/images/icons/text_heading_3.png b/source/dev/images/icons/text_heading_3.png
deleted file mode 100644
index 6f75387..0000000
Binary files a/source/dev/images/icons/text_heading_3.png and /dev/null differ
diff --git a/source/dev/images/icons/text_heading_4.png b/source/dev/images/icons/text_heading_4.png
deleted file mode 100644
index 4e929ea..0000000
Binary files a/source/dev/images/icons/text_heading_4.png and /dev/null differ
diff --git a/source/dev/images/icons/text_heading_5.png b/source/dev/images/icons/text_heading_5.png
deleted file mode 100644
index 30cabeb..0000000
Binary files a/source/dev/images/icons/text_heading_5.png and /dev/null differ
diff --git a/source/dev/images/icons/text_heading_6.png b/source/dev/images/icons/text_heading_6.png
deleted file mode 100644
index f7db93c..0000000
Binary files a/source/dev/images/icons/text_heading_6.png and /dev/null differ
diff --git a/source/dev/images/icons/text_horizontalrule.png b/source/dev/images/icons/text_horizontalrule.png
deleted file mode 100644
index 40e03fa..0000000
Binary files a/source/dev/images/icons/text_horizontalrule.png and /dev/null differ
diff --git a/source/dev/images/icons/text_indent.png b/source/dev/images/icons/text_indent.png
deleted file mode 100644
index 9364532..0000000
Binary files a/source/dev/images/icons/text_indent.png and /dev/null differ
diff --git a/source/dev/images/icons/text_indent_remove.png b/source/dev/images/icons/text_indent_remove.png
deleted file mode 100644
index 1651b07..0000000
Binary files a/source/dev/images/icons/text_indent_remove.png and /dev/null differ
diff --git a/source/dev/images/icons/text_italic.png b/source/dev/images/icons/text_italic.png
deleted file mode 100644
index 8482ac8..0000000
Binary files a/source/dev/images/icons/text_italic.png and /dev/null differ
diff --git a/source/dev/images/icons/text_kerning.png b/source/dev/images/icons/text_kerning.png
deleted file mode 100644
index c22bd94..0000000
Binary files a/source/dev/images/icons/text_kerning.png and /dev/null differ
diff --git a/source/dev/images/icons/text_letter_omega.png b/source/dev/images/icons/text_letter_omega.png
deleted file mode 100644
index c58f9fe..0000000
Binary files a/source/dev/images/icons/text_letter_omega.png and /dev/null differ
diff --git a/source/dev/images/icons/text_letterspacing.png b/source/dev/images/icons/text_letterspacing.png
deleted file mode 100644
index 4ce23f3..0000000
Binary files a/source/dev/images/icons/text_letterspacing.png and /dev/null differ
diff --git a/source/dev/images/icons/text_linespacing.png b/source/dev/images/icons/text_linespacing.png
deleted file mode 100644
index dd522c9..0000000
Binary files a/source/dev/images/icons/text_linespacing.png and /dev/null differ
diff --git a/source/dev/images/icons/text_list_bullets.png b/source/dev/images/icons/text_list_bullets.png
deleted file mode 100644
index b2afeb2..0000000
Binary files a/source/dev/images/icons/text_list_bullets.png and /dev/null differ
diff --git a/source/dev/images/icons/text_list_numbers.png b/source/dev/images/icons/text_list_numbers.png
deleted file mode 100644
index 8dae944..0000000
Binary files a/source/dev/images/icons/text_list_numbers.png and /dev/null differ
diff --git a/source/dev/images/icons/text_lowercase.png b/source/dev/images/icons/text_lowercase.png
deleted file mode 100644
index 49ddf83..0000000
Binary files a/source/dev/images/icons/text_lowercase.png and /dev/null differ
diff --git a/source/dev/images/icons/text_padding_bottom.png b/source/dev/images/icons/text_padding_bottom.png
deleted file mode 100644
index 4880c43..0000000
Binary files a/source/dev/images/icons/text_padding_bottom.png and /dev/null differ
diff --git a/source/dev/images/icons/text_padding_left.png b/source/dev/images/icons/text_padding_left.png
deleted file mode 100644
index b55482e..0000000
Binary files a/source/dev/images/icons/text_padding_left.png and /dev/null differ
diff --git a/source/dev/images/icons/text_padding_right.png b/source/dev/images/icons/text_padding_right.png
deleted file mode 100644
index 106edae..0000000
Binary files a/source/dev/images/icons/text_padding_right.png and /dev/null differ
diff --git a/source/dev/images/icons/text_padding_top.png b/source/dev/images/icons/text_padding_top.png
deleted file mode 100644
index c5c45b2..0000000
Binary files a/source/dev/images/icons/text_padding_top.png and /dev/null differ
diff --git a/source/dev/images/icons/text_replace.png b/source/dev/images/icons/text_replace.png
deleted file mode 100644
index 41deaea..0000000
Binary files a/source/dev/images/icons/text_replace.png and /dev/null differ
diff --git a/source/dev/images/icons/text_signature.png b/source/dev/images/icons/text_signature.png
deleted file mode 100644
index ad5d3be..0000000
Binary files a/source/dev/images/icons/text_signature.png and /dev/null differ
diff --git a/source/dev/images/icons/text_smallcaps.png b/source/dev/images/icons/text_smallcaps.png
deleted file mode 100644
index 5b98a6e..0000000
Binary files a/source/dev/images/icons/text_smallcaps.png and /dev/null differ
diff --git a/source/dev/images/icons/text_strikethrough.png b/source/dev/images/icons/text_strikethrough.png
deleted file mode 100644
index 612058a..0000000
Binary files a/source/dev/images/icons/text_strikethrough.png and /dev/null differ
diff --git a/source/dev/images/icons/text_subscript.png b/source/dev/images/icons/text_subscript.png
deleted file mode 100644
index ae77ed9..0000000
Binary files a/source/dev/images/icons/text_subscript.png and /dev/null differ
diff --git a/source/dev/images/icons/text_superscript.png b/source/dev/images/icons/text_superscript.png
deleted file mode 100644
index f5bf6f6..0000000
Binary files a/source/dev/images/icons/text_superscript.png and /dev/null differ
diff --git a/source/dev/images/icons/text_underline.png b/source/dev/images/icons/text_underline.png
deleted file mode 100644
index 90d0df2..0000000
Binary files a/source/dev/images/icons/text_underline.png and /dev/null differ
diff --git a/source/dev/images/icons/text_uppercase.png b/source/dev/images/icons/text_uppercase.png
deleted file mode 100644
index 4c72f69..0000000
Binary files a/source/dev/images/icons/text_uppercase.png and /dev/null differ
diff --git a/source/dev/images/icons/textfield.png b/source/dev/images/icons/textfield.png
deleted file mode 100644
index 12000f2..0000000
Binary files a/source/dev/images/icons/textfield.png and /dev/null differ
diff --git a/source/dev/images/icons/textfield_add.png b/source/dev/images/icons/textfield_add.png
deleted file mode 100644
index 45de117..0000000
Binary files a/source/dev/images/icons/textfield_add.png and /dev/null differ
diff --git a/source/dev/images/icons/textfield_delete.png b/source/dev/images/icons/textfield_delete.png
deleted file mode 100644
index d09fed9..0000000
Binary files a/source/dev/images/icons/textfield_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/textfield_key.png b/source/dev/images/icons/textfield_key.png
deleted file mode 100644
index 82ce089..0000000
Binary files a/source/dev/images/icons/textfield_key.png and /dev/null differ
diff --git a/source/dev/images/icons/textfield_rename.png b/source/dev/images/icons/textfield_rename.png
deleted file mode 100644
index 749256b..0000000
Binary files a/source/dev/images/icons/textfield_rename.png and /dev/null differ
diff --git a/source/dev/images/icons/thumb_down.png b/source/dev/images/icons/thumb_down.png
deleted file mode 100644
index 21f289e..0000000
Binary files a/source/dev/images/icons/thumb_down.png and /dev/null differ
diff --git a/source/dev/images/icons/thumb_up.png b/source/dev/images/icons/thumb_up.png
deleted file mode 100644
index c4e3db4..0000000
Binary files a/source/dev/images/icons/thumb_up.png and /dev/null differ
diff --git a/source/dev/images/icons/tick.png b/source/dev/images/icons/tick.png
deleted file mode 100644
index 1988997..0000000
Binary files a/source/dev/images/icons/tick.png and /dev/null differ
diff --git a/source/dev/images/icons/time.png b/source/dev/images/icons/time.png
deleted file mode 100644
index 471cec8..0000000
Binary files a/source/dev/images/icons/time.png and /dev/null differ
diff --git a/source/dev/images/icons/time_add.png b/source/dev/images/icons/time_add.png
deleted file mode 100644
index 29ce70d..0000000
Binary files a/source/dev/images/icons/time_add.png and /dev/null differ
diff --git a/source/dev/images/icons/time_delete.png b/source/dev/images/icons/time_delete.png
deleted file mode 100644
index 215591d..0000000
Binary files a/source/dev/images/icons/time_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/time_go.png b/source/dev/images/icons/time_go.png
deleted file mode 100644
index 869b006..0000000
Binary files a/source/dev/images/icons/time_go.png and /dev/null differ
diff --git a/source/dev/images/icons/timeline_marker.png b/source/dev/images/icons/timeline_marker.png
deleted file mode 100644
index a3fbddf..0000000
Binary files a/source/dev/images/icons/timeline_marker.png and /dev/null differ
diff --git a/source/dev/images/icons/transmit.png b/source/dev/images/icons/transmit.png
deleted file mode 100644
index 3d28f90..0000000
Binary files a/source/dev/images/icons/transmit.png and /dev/null differ
diff --git a/source/dev/images/icons/transmit_add.png b/source/dev/images/icons/transmit_add.png
deleted file mode 100644
index 19df2b0..0000000
Binary files a/source/dev/images/icons/transmit_add.png and /dev/null differ
diff --git a/source/dev/images/icons/transmit_blue.png b/source/dev/images/icons/transmit_blue.png
deleted file mode 100644
index 5e35fc9..0000000
Binary files a/source/dev/images/icons/transmit_blue.png and /dev/null differ
diff --git a/source/dev/images/icons/transmit_delete.png b/source/dev/images/icons/transmit_delete.png
deleted file mode 100644
index e546b65..0000000
Binary files a/source/dev/images/icons/transmit_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/transmit_edit.png b/source/dev/images/icons/transmit_edit.png
deleted file mode 100644
index a9a4c51..0000000
Binary files a/source/dev/images/icons/transmit_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/transmit_error.png b/source/dev/images/icons/transmit_error.png
deleted file mode 100644
index 8e75b05..0000000
Binary files a/source/dev/images/icons/transmit_error.png and /dev/null differ
diff --git a/source/dev/images/icons/transmit_go.png b/source/dev/images/icons/transmit_go.png
deleted file mode 100644
index 17c988f..0000000
Binary files a/source/dev/images/icons/transmit_go.png and /dev/null differ
diff --git a/source/dev/images/icons/tux.png b/source/dev/images/icons/tux.png
deleted file mode 100644
index 4607204..0000000
Binary files a/source/dev/images/icons/tux.png and /dev/null differ
diff --git a/source/dev/images/icons/user.png b/source/dev/images/icons/user.png
deleted file mode 100644
index 43e0a2b..0000000
Binary files a/source/dev/images/icons/user.png and /dev/null differ
diff --git a/source/dev/images/icons/user_add.png b/source/dev/images/icons/user_add.png
deleted file mode 100644
index ffeacb9..0000000
Binary files a/source/dev/images/icons/user_add.png and /dev/null differ
diff --git a/source/dev/images/icons/user_comment.png b/source/dev/images/icons/user_comment.png
deleted file mode 100644
index f80275a..0000000
Binary files a/source/dev/images/icons/user_comment.png and /dev/null differ
diff --git a/source/dev/images/icons/user_delete.png b/source/dev/images/icons/user_delete.png
deleted file mode 100644
index b81bc84..0000000
Binary files a/source/dev/images/icons/user_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/user_edit.png b/source/dev/images/icons/user_edit.png
deleted file mode 100644
index 41c681f..0000000
Binary files a/source/dev/images/icons/user_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/user_female.png b/source/dev/images/icons/user_female.png
deleted file mode 100644
index 4a0cf1c..0000000
Binary files a/source/dev/images/icons/user_female.png and /dev/null differ
diff --git a/source/dev/images/icons/user_go.png b/source/dev/images/icons/user_go.png
deleted file mode 100644
index adc9002..0000000
Binary files a/source/dev/images/icons/user_go.png and /dev/null differ
diff --git a/source/dev/images/icons/user_gray.png b/source/dev/images/icons/user_gray.png
deleted file mode 100644
index 8d5d1c2..0000000
Binary files a/source/dev/images/icons/user_gray.png and /dev/null differ
diff --git a/source/dev/images/icons/user_green.png b/source/dev/images/icons/user_green.png
deleted file mode 100644
index 3ac06a0..0000000
Binary files a/source/dev/images/icons/user_green.png and /dev/null differ
diff --git a/source/dev/images/icons/user_orange.png b/source/dev/images/icons/user_orange.png
deleted file mode 100644
index e7c59d8..0000000
Binary files a/source/dev/images/icons/user_orange.png and /dev/null differ
diff --git a/source/dev/images/icons/user_red.png b/source/dev/images/icons/user_red.png
deleted file mode 100644
index 473f61a..0000000
Binary files a/source/dev/images/icons/user_red.png and /dev/null differ
diff --git a/source/dev/images/icons/user_suit.png b/source/dev/images/icons/user_suit.png
deleted file mode 100644
index d9b1b99..0000000
Binary files a/source/dev/images/icons/user_suit.png and /dev/null differ
diff --git a/source/dev/images/icons/vcard.png b/source/dev/images/icons/vcard.png
deleted file mode 100644
index c02f315..0000000
Binary files a/source/dev/images/icons/vcard.png and /dev/null differ
diff --git a/source/dev/images/icons/vcard_add.png b/source/dev/images/icons/vcard_add.png
deleted file mode 100644
index 2e7f574..0000000
Binary files a/source/dev/images/icons/vcard_add.png and /dev/null differ
diff --git a/source/dev/images/icons/vcard_delete.png b/source/dev/images/icons/vcard_delete.png
deleted file mode 100644
index 2577e03..0000000
Binary files a/source/dev/images/icons/vcard_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/vcard_edit.png b/source/dev/images/icons/vcard_edit.png
deleted file mode 100644
index 91ad966..0000000
Binary files a/source/dev/images/icons/vcard_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/vector.png b/source/dev/images/icons/vector.png
deleted file mode 100644
index cc66b82..0000000
Binary files a/source/dev/images/icons/vector.png and /dev/null differ
diff --git a/source/dev/images/icons/vector_add.png b/source/dev/images/icons/vector_add.png
deleted file mode 100644
index a6efa94..0000000
Binary files a/source/dev/images/icons/vector_add.png and /dev/null differ
diff --git a/source/dev/images/icons/vector_delete.png b/source/dev/images/icons/vector_delete.png
deleted file mode 100644
index 5b27051..0000000
Binary files a/source/dev/images/icons/vector_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/wand.png b/source/dev/images/icons/wand.png
deleted file mode 100644
index 7117745..0000000
Binary files a/source/dev/images/icons/wand.png and /dev/null differ
diff --git a/source/dev/images/icons/weather_clouds.png b/source/dev/images/icons/weather_clouds.png
deleted file mode 100644
index f062336..0000000
Binary files a/source/dev/images/icons/weather_clouds.png and /dev/null differ
diff --git a/source/dev/images/icons/weather_cloudy.png b/source/dev/images/icons/weather_cloudy.png
deleted file mode 100644
index 3d19c34..0000000
Binary files a/source/dev/images/icons/weather_cloudy.png and /dev/null differ
diff --git a/source/dev/images/icons/weather_lightning.png b/source/dev/images/icons/weather_lightning.png
deleted file mode 100644
index ff6a4e9..0000000
Binary files a/source/dev/images/icons/weather_lightning.png and /dev/null differ
diff --git a/source/dev/images/icons/weather_rain.png b/source/dev/images/icons/weather_rain.png
deleted file mode 100644
index 87b1731..0000000
Binary files a/source/dev/images/icons/weather_rain.png and /dev/null differ
diff --git a/source/dev/images/icons/weather_snow.png b/source/dev/images/icons/weather_snow.png
deleted file mode 100644
index 45bbdf1..0000000
Binary files a/source/dev/images/icons/weather_snow.png and /dev/null differ
diff --git a/source/dev/images/icons/weather_sun.png b/source/dev/images/icons/weather_sun.png
deleted file mode 100644
index c1a8836..0000000
Binary files a/source/dev/images/icons/weather_sun.png and /dev/null differ
diff --git a/source/dev/images/icons/webcam.png b/source/dev/images/icons/webcam.png
deleted file mode 100644
index e08234b..0000000
Binary files a/source/dev/images/icons/webcam.png and /dev/null differ
diff --git a/source/dev/images/icons/webcam_add.png b/source/dev/images/icons/webcam_add.png
deleted file mode 100644
index 516a1a2..0000000
Binary files a/source/dev/images/icons/webcam_add.png and /dev/null differ
diff --git a/source/dev/images/icons/webcam_delete.png b/source/dev/images/icons/webcam_delete.png
deleted file mode 100644
index 0379be2..0000000
Binary files a/source/dev/images/icons/webcam_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/webcam_error.png b/source/dev/images/icons/webcam_error.png
deleted file mode 100644
index 9689109..0000000
Binary files a/source/dev/images/icons/webcam_error.png and /dev/null differ
diff --git a/source/dev/images/icons/world.png b/source/dev/images/icons/world.png
deleted file mode 100644
index 0cba358..0000000
Binary files a/source/dev/images/icons/world.png and /dev/null differ
diff --git a/source/dev/images/icons/world_add.png b/source/dev/images/icons/world_add.png
deleted file mode 100644
index ef47ef3..0000000
Binary files a/source/dev/images/icons/world_add.png and /dev/null differ
diff --git a/source/dev/images/icons/world_delete.png b/source/dev/images/icons/world_delete.png
deleted file mode 100644
index 289bcf3..0000000
Binary files a/source/dev/images/icons/world_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/world_edit.png b/source/dev/images/icons/world_edit.png
deleted file mode 100644
index 65fe2fa..0000000
Binary files a/source/dev/images/icons/world_edit.png and /dev/null differ
diff --git a/source/dev/images/icons/world_go.png b/source/dev/images/icons/world_go.png
deleted file mode 100644
index df5f1ad..0000000
Binary files a/source/dev/images/icons/world_go.png and /dev/null differ
diff --git a/source/dev/images/icons/world_link.png b/source/dev/images/icons/world_link.png
deleted file mode 100644
index f3d52ea..0000000
Binary files a/source/dev/images/icons/world_link.png and /dev/null differ
diff --git a/source/dev/images/icons/wrench.png b/source/dev/images/icons/wrench.png
deleted file mode 100644
index 8c84186..0000000
Binary files a/source/dev/images/icons/wrench.png and /dev/null differ
diff --git a/source/dev/images/icons/wrench_orange.png b/source/dev/images/icons/wrench_orange.png
deleted file mode 100644
index 0c0e510..0000000
Binary files a/source/dev/images/icons/wrench_orange.png and /dev/null differ
diff --git a/source/dev/images/icons/xhtml.png b/source/dev/images/icons/xhtml.png
deleted file mode 100644
index da5dbf2..0000000
Binary files a/source/dev/images/icons/xhtml.png and /dev/null differ
diff --git a/source/dev/images/icons/xhtml_add.png b/source/dev/images/icons/xhtml_add.png
deleted file mode 100644
index 015ec58..0000000
Binary files a/source/dev/images/icons/xhtml_add.png and /dev/null differ
diff --git a/source/dev/images/icons/xhtml_delete.png b/source/dev/images/icons/xhtml_delete.png
deleted file mode 100644
index 157b520..0000000
Binary files a/source/dev/images/icons/xhtml_delete.png and /dev/null differ
diff --git a/source/dev/images/icons/xhtml_go.png b/source/dev/images/icons/xhtml_go.png
deleted file mode 100644
index 43cf814..0000000
Binary files a/source/dev/images/icons/xhtml_go.png and /dev/null differ
diff --git a/source/dev/images/icons/xhtml_valid.png b/source/dev/images/icons/xhtml_valid.png
deleted file mode 100644
index d2e1cfb..0000000
Binary files a/source/dev/images/icons/xhtml_valid.png and /dev/null differ
diff --git a/source/dev/images/icons/zoom.png b/source/dev/images/icons/zoom.png
deleted file mode 100644
index a158b99..0000000
Binary files a/source/dev/images/icons/zoom.png and /dev/null differ
diff --git a/source/dev/images/icons/zoom_in.png b/source/dev/images/icons/zoom_in.png
deleted file mode 100644
index 0a457f7..0000000
Binary files a/source/dev/images/icons/zoom_in.png and /dev/null differ
diff --git a/source/dev/images/icons/zoom_out.png b/source/dev/images/icons/zoom_out.png
deleted file mode 100644
index c124cf8..0000000
Binary files a/source/dev/images/icons/zoom_out.png and /dev/null differ
diff --git a/source/dev/images/logo/logo_baseline.psd b/source/dev/images/logo/logo_baseline.psd
deleted file mode 100644
index 654b32a..0000000
Binary files a/source/dev/images/logo/logo_baseline.psd and /dev/null differ
diff --git a/source/dev/images/logo/logo_rendered.png b/source/dev/images/logo/logo_rendered.png
deleted file mode 100644
index bb44399..0000000
Binary files a/source/dev/images/logo/logo_rendered.png and /dev/null differ
diff --git a/source/dev/images/logo/logo_vector.ai b/source/dev/images/logo/logo_vector.ai
deleted file mode 100644
index 2a1ad91..0000000
--- a/source/dev/images/logo/logo_vector.ai
+++ /dev/null
@@ -1,222 +0,0 @@
-%PDF-1.5
%
-1 0 obj
<>/OCGs[5 0 R]>>/Pages 3 0 R/Type/Catalog>>
endobj
2 0 obj
<>stream
-
-
-
-
- Adobe Illustrator CS6 (Macintosh)
- 2013-12-31T16:14:41+01:00
- 2013-12-31T16:14:41+01:00
- 2013-12-31T16:14:41+01:00
-
-
-
- 256
- 76
- JPEG
- /9j/4AAQSkZJRgABAgEASABIAAD/7QAsUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAAAEA
AQBIAAAAAQAB/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoK
DBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8f
Hx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgATAEAAwER
AAIRAQMRAf/EAaIAAAAHAQEBAQEAAAAAAAAAAAQFAwIGAQAHCAkKCwEAAgIDAQEBAQEAAAAAAAAA
AQACAwQFBgcICQoLEAACAQMDAgQCBgcDBAIGAnMBAgMRBAAFIRIxQVEGE2EicYEUMpGhBxWxQiPB
UtHhMxZi8CRygvElQzRTkqKyY3PCNUQnk6OzNhdUZHTD0uIIJoMJChgZhJRFRqS0VtNVKBry4/PE
1OT0ZXWFlaW1xdXl9WZ2hpamtsbW5vY3R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo+Ck5SVlpeYmZ
qbnJ2en5KjpKWmp6ipqqusra6voRAAICAQIDBQUEBQYECAMDbQEAAhEDBCESMUEFURNhIgZxgZEy
obHwFMHR4SNCFVJicvEzJDRDghaSUyWiY7LCB3PSNeJEgxdUkwgJChgZJjZFGidkdFU38qOzwygp
0+PzhJSktMTU5PRldYWVpbXF1eX1RlZmdoaWprbG1ub2R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo
+DlJWWl5iZmpucnZ6fkqOkpaanqKmqq6ytrq+v/aAAwDAQACEQMRAD8A9U4q7FXYq7FWK/mT+ZHl
z8vvLcmua3IxXl6VpaRUM1xMRURxgkDpuxOwGKvib8x/+civzH863cqi/k0bRiSItKsJGiXh29aR
eLynx5fDXooxV5iZZDJ6pdjKW5GSp5cq1rXrWuKvVvyp/wCcjPPPkjUYIr68n1ry5yC3Om3MhldI
+7W0jkmNl6ha8T3HcKvu/RdY07WtJs9X02YXFhfwpcWsy9GjkUMpp2O+47YqjMVYT5h/Ov8AKzy7
r48v6z5it7TVqhZICsrrGWFQJpURootjX42GKs1R0kRZI2Do4DI6moIO4IIxVvFXYq7FXYq7FXYq
7FXYq7FXYq7FXYq7FXYqlHmrzf5a8p6Q+r+YtQi07T0YIZpaks53CIihndjQ/CoJxVCeS/zE8l+d
rOa88r6pHqUNuwScKskckZO684pVjkUNQ0JWh7YqyLFXYq7FXYqwzz/+b/5f+QlRfMWprDdyryhs
IVM1yynbl6aV4rt9pqDFWJeXP+crPyf1vUY7A31xpckzBIpdQh9KEsegMqNIqfNyB74q9fVlZQyk
MrCqsNwQe4xVvFXwh/zlX55uPMf5p3emJITpnl0fULWMdPWoGuXI/mMnwfJRirxrFXYq7FX3l/zi
ZdXU/wCS2mpOSUt7m7itya/3frF6Cv8AlO2KvYsVfCv5nf8AOP35syfmVrDWOi3Gq2urX9xdWeow
lWiZLiUyD1ZGYCJl5Ub1CN+lRvir7M8haDeeX/JOg6Heyie70ywt7WeVSSpeGJUbiTvxBFB7Yqn2
KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV4f/wA5Wflr5s86eVdKl8twte3Gk3Ekk+nIQHkSZAvN
AxAZoyvTrQmmKsZ/5xK/Kjzx5W1LWNe8x2MmlW93bJaWtnPRZZG9QSNI0YNUCcaDkK74q+lsVdir
sVdir8wPNPmTU/M3mLUNe1SQy32ozPPKSaheR+FF8FRaKo7AYqlWKvtz/nEHz9f+YvIV3oeozGe6
8tyxwQSsSW+qTqTArE/yGN1H+SAO2KveCQBU7AdTir8vfMmqNq3mLVNVY8m1C7nuix6kzStJXcD+
bwxVLcVdiqP0LQ9V17WLTR9Jt2utRvpFhtoE6szfqAG5J2A3xV+kP5b+TLfyX5H0jyzCwk/R8AWe
VdhJO5Mkziu9GkdiPbFWSYq8r/Mj/nJD8vfIGv8A6B1RL6+1JEV7mLT44ZPQ5qHRZTLNDRmRgwpX
bFXqFvOk9vFOgISVFdQetGFRWmKsW/ML81PJPkCwS68x34hkmr9VsYh6lzNTr6cY7DuzUX3xV4tP
/wA5v+WFu+MHli9ks/8AfzzxJJT/AIxgOv8Aw+KvVPy1/Pb8vvzBb6to929tqyrybSr1RFcEDqY6
MySAd+DEjuBir0LFXnf5p/nr5K/LW4sbXXEurq8v0aWO1sFhklSJTxEkiyyw8VdqhTvUg+GKo+6/
OPyDY+RtO86alqAsNI1SFZrKKYVuXLCpiWGMyFpFOzcageNN8VeR3n/ObnlBLopZ+Xb+e1BI9aWS
GJyOx9MGQb/62KvRfy4/5yH/AC38+XKWFhdSafrD/Y03UFWKSQ+ETKzxyHwUNyp2xV6ZirCvzR/N
zyn+W2mWt9r/AK8zXspitbKzEb3D8RV3CSSRDglVDGu3IeOKqeifnP5C1P8AL+Pz3NenS9CdpI2+
vhUnWSJ2Ux+nG0vJ248lVCxIxV5Zq3/ObHkm3uzFpmhX99bq1DcStFb1HdkSspPtyp9GKsw/L/8A
5yf/ACy84XcWnNPLomqTEJDbaiFRJXJoFjmRnjJ8AxUnsDir1zFWL/mP+Yei+QPLL+YtZhubiyjl
jgMdmsby8pTRTSR4lptv8WKpZ+VX5yeWPzMt9Rn0G1vbZNMeJJxfRxRljMGK8PSlmr9g1rTFWPeZ
P+cn/wAsvL3nWXynffXHubadLW61GBIHsoZGoH9R/WEn7omklI9iDir1tHSRFkjYOjgMjqagg7gg
jFUh89eeNA8keWrrzFrsrJZW1AI4wGmlkc0SKJSVDO3zA7kgAnFWC/l5/wA5J+T/AD95ki0DQdH1
n606PLLPPDbLBDEg3eVluXYLUhRRTuRir5e/5yA/JXWPIfme71C0tXl8p38zTWF6ilkgMjV+rSkf
YZCaJX7S+9QFXkuKvaf+cWfzL0LyT51vk8wXYstJ1a09FrlgxRLiJw8RfiGopUutfE4q9m/PD/nJ
zyhY+V73RfJuorquu6jE8Au7arQWsbji8nqmis/EngErQ7ntVV8YYqj9G0HW9bvBZaNp9xqV424t
7WJ5np0rxQMae+KvYvJ//OIX5o606SayLfy7ZtQs1y4nuOJ7rDCWFfZ3XFX1F+Vf5H+Sfy5t+elw
m71mVOFzrFzQzsD1VAPhiSv7K9e5OKvQcVdir4A/5yj/APJ7eZv+jH/un2+KvvLTjKNFtjCqtKLZ
PTVyVUt6YoGYBiBXvQ4q+G/MH5X/AJzeevzjn0rzLaPb61fs88l5IGayhsozQPC68lMKAhUANakA
/ETir3Ox/wCcMPyyi0oW15f6nc6gVHqX6SxRUem5SL03VV9mLfPFXzj+a35WeZ/yj822hju3e2kb
6zoetQ1iZjCQSCATwliJFRXuD3xV9pfkn+YZ8/fl3p2vTcRqQ5WuqIgoouoaByB2EilZAOwamKvA
f+c4YIl1zypOF/eyWt2jN4qkkZUfQXOKvHPy68g+c/zR1600GxmZrXToeMl3cFmgsrXmzUA/yndu
KL9pifchV9OWH/OF35ZRWCxXuo6rc3nGkt1HLDCvIjqkZik4jwBLYq8H/Ov8gPMH5Y3EOq2Vy+o+
XZZAINSVfTlt5a1RJgpPE7fC42PsdsVfSH/OMf5v3XnvypNputTer5j0PhHcTMfjuLdxSKdvF6qV
f3oT9rFWIf8AOb6IfLHlhyo5i9nAam4BiBIr70GKvmjyZ5a83+etW0/yho7SXADySwwSO31a2V6e
tO4HIIuy8mpU7Dc0GKvqjQv+cLPy+t9PjTWtU1G/1AgetNA8VvDXwSMpKwHzc4q8j/PD/nGTUfId
g/mHQbqTVfLcZAuhMFF1a8iFVpOAVZELGnJQKdxTfFXq3/OJf5xXvmLTp/JevXBn1TS4vW0u6lYt
JNaAhWjdmNWaEsKeKn/JxVkP/OXv/km7n/mOtP8AiRxVhX/ODn/HK83f8Z7L/iE2KoT/AJy7/Jz/
AMqJodv/ACx+YoIx/sY7ug/4CT/Yn+Y4qnX/ADiX+cq6tpH+BNcnA1HSoi+j3Ejf31mgq0JJ/agH
T/I/1Tirx7/nIn83Ln8xvOSaTorvN5d0yU2+lxRVP1q4Y8GuAo+1zPwx/wCT7scVfUH/ADj7+UUP
5d+TkF3Gp8yaqEn1eXYlDQmO3U+EQbfxap6UxV6bcW9vcwSW9xEk0EqlJYZFDoynYqymoIOKvDfz
u/5xw8kav5S1HVfLWlQ6P5h0+F7q3FkghhnEQLvC8K0jq6g8WABDU7bYq+IcVdirMPyl8gTeffPm
m+W1kaC3uGaW9uFALR28Sl5CK/tGnFfcjFX6E+UfJfljyhpEek+XtPisLRAA3pqPUkYCnOWQ/FI/
+UxxVO8VdirsVdir4A/5yj/8nt5m/wCjH/un2+KvvXSf+OVZf8YIv+IDFXn/AOY3/OQn5beQ7h7H
Ubx7/V02fTNPVZpk/wCMrMyRx/Jm5e2KvH9U/wCc4jzZdK8pfBvxlurzcntWOOLb/g8VeY/m7/zk
Nqf5l+X7XSNQ0S1sTaXS3UN1DJIzghHRk+Lbiwff5DFXsH/OD95K/l3zRZk/uoby3mQf5UsTK34R
DFUj/wCc4/8Ajq+Uf+MF7/xOHFXo/wDziH5astM/KO31aNR9b165uLi4l/a428z20aE+C+kzD/WO
KvbcVSLz15YtfNPk7WPL9zGJI9RtZYUBp8MpWsTiu1UkCsPcYq+Lf+cSdYuLH86NOtIyRHqtrd2k
4HQqkLXQr/srcYq9b/5ze/5Rby1/zHTf8mcVX/8AOE/lm1g8pa35laMfXb29+oxyHdhBbxpJQeAa
SY18eI9sVfSOKofUdPs9S0+506+iWeyvInguYW+y8cilXU/NTir4D/KSWXyj/wA5BaPZRS8vq2sv
pDPX7azSNZmtB3516dcVfTX/ADl7/wCSbuf+Y60/4kcVYV/zg5/xyvN3/Gey/wCITYq+mb2ytL6z
nsryFbi0uY2huIJByR43BVlYHqCDTFX54fnN5Ak/Lj8w73RbK752jp9Z0+SOT96lrc8lEUtDUOBy
Q1+0u/RsVeq/84fflXY6vqdx571MxzRaPN9X0u0qGIu+Adp5F7emrj06/tGv7IxV9gYq7FWHfmz5
70byX5H1TVNRuEjma3li062YjnPcshWONF6t8RHKnQbnFX5uYq7FXvP/ADhjPaxfmzdpMVEk+j3M
dsG6mQT27kL7+mj/AEYq+28VdirsVdirsVfAH/OUf/k9vM3/AEY/90+3xV9dfm35yvPJ35M6jrlg
3DUY7OCCykAqUmuSkKyDYisfPmK+GKvj/wDI/wDJ6+/NXzNeJc3z2umWAW41a+/vJ2aZm4InL9uQ
qx5N0oTv0Kr618v/APONP5M6NCiLoCahMoAe51CR7h3I7sjERD/YoBirzf8A5yt8vflh5Y/Lu3s9
L0XStM16+uohZG0tIIrloYamZvURA/AfCGJO5IxVQ/5wc/45Xm7/AIz2X/EJsVSr/nOP/jq+Uf8A
jBe/8ThxVnn/ADh55ws9U/LM+XfUUX/l+4lVoP2jb3UjTpJ8jI8i/R8sVe8Yqxb80POVl5O8h6xr
91Jwa2t3W0WtGe5kHCBF71LkdOgqe2KvkH/nEPQJ9R/OC31FV/c6LZ3NzK/YGaM2qr8z65P0HFXq
f/Ob3/KLeWv+Y6b/AJM4qhv+cJ/ONm+ja35PmkC3sNx+k7RGO7xSokMoQf8AFbRqT/r4q+ncVS/z
Dr2m+X9Dvtb1OUQ2GnQvcXEh/lQVoB3Y9FHc4q+DvySs73zh+fekXzRVd9Sk1m7oAVjELNcknb/f
gCj3IxV9L/8AOXv/AJJu5/5jrT/iRxVhX/ODn/HK83f8Z7L/AIhNir3X8zfzB0ryD5OvfMWoEOYV
9Oyta0ae5cH0ol+ZFWPZQT2xV8KeWPK/nf8AOb8wL4pKsuq3olvtQvpqiGJVFFBpXivLjGijpt2G
Kpr+TH5j6v8AlN+YktvrEUsGmyymw8xaewPKPgxUShR+3A1T7ryA61xV9+Wtzb3dtFdW0qzW06LL
BMhDI6OOSspGxBBqMVfN/wDzk3/zkD5n8p63H5Q8qOtldi3S41DVCqySr6teEUIcFV+EcmYgncUp
TdV8n635g13Xb5r/AFrULjUr19jcXUrzPTwBcmgHYDbFU+/LD8svMP5i+Zf0HopiieOJri6u5yRF
DCpClm4hmJLMAqgbn2qQqyP81f8AnHnzz+XdoNTvfR1LRCyo2o2fIiJn2UTIwDJyOwO61oK1NMVe
f+XvMGr+Xtas9b0e4a01KxkEttOtCVYbEEHYhgSGB2I2xV9dflz/AM5jeU9UjhsvOls2iaiaK1/C
rTWTt4kDlLFU9qMB3YYq990jWtI1mwj1DSL2DULGX+7ubaRZYz3pyUkV36YqjMVdirsVfAH/ADlH
/wCT28zf9GP/AHT7fFX2D+Znkmbzr+UN/wCXbYgXtzZQyWRbYG4g4TRqT2DsnEntXFXxh+Un5r+Y
vyk803z/AFH6xBP/AKLrOkTEwuWgZgtG4sUkiYsN1PUincKvZ9d/5zfgOnsug+WXXUGBCS304MKH
xKRANJ8uS/PFXz35k1Dz/wCeW1PzrrJuNSgtGjivdRYUgg9VuMUKAURBVtkQe/euKvoj/nByeI2P
m+DkPWEti5TvxKziv3jFUt/5zj/46vlH/jBe/wDE4cVeGeV9Y89/l7e6P5y0pZLKO+SRrG5Ycra6
ijlaGaGQA0ZecRDIdxswp8JxV9CWH/OcNl+jwb/ypIdRVQGEF0ogdu5BeMugPhRvnirxn8yfza8+
fm9rtnYtbEW4l46ToFiGkHqvtyP7UstNuRGwrQCpxV9bf848/lD/AMq68nst+FPmPVik+qutCI+I
PpW4YEgiLk1SOrE9qYq8+/5ze/5Rby1/zHTf8mcVfMWgt508rrp3nnR1ns4Yrl4bPVoxWMTxqC8L
ndfiR90f7S16iuKvojQP+c3lXTlTX/LLS6ii0aeynCRSNTr6cis0f/BNiryz83fz+83/AJoSw6TF
bfo3RPUX0NHtmaZ55SaIZnAUysD9lQoFexO+Kvor/nGH8k7ryNo0+v6/D6fmXV41QW5+1a2lQ4ib
wkdgGcdqKOoOKoj/AJy9/wDJN3P/ADHWn/EjirCP+cIZYotG84yyuscUctm0kjEKqqqTEkk7AAYq
8n/Pz81L38z/AD3FY6OJJtEsZPqeh2sYJa4lkYK0/HqWmagQfy071xV9ZfkT+U9t+XPkyKymVH16
/wCNxrNyu9ZafDCrd0hB4jxNW74q8o/5y6/Jxru2P5h6JBW4tlWPzBCg3eFaLHdUHeMfC/8Ak0PR
ScVWf84ifnGbiEfl3rc49aFWk8vTud3QVaS1qe6Crp/k8h2GKpp/zlH+Q+tebLiHzj5XiN3qltAL
fUdMX+8mijJZJYa/adQ3Ep+0KU3FCq+Q77StU0+7Nnf2c9pdq3FreeN45A3ShRwGrir6+/5xD/Kv
XPLmn6l5q121ksbnVkS30+0mUpMLZG5vK6N8SiRuPEHei16EYq9h/NeyW+/LDzbamNZDJo996atu
PUW3doz9DgEYq/NXFXYqyfyF+Y/m7yLrCan5evnt2qDcWjEtbzqP2ZoqgMPA9R2IxV+hf5eecrTz
p5L0rzPaxGGLUoS7Qk1KSRu0UqVHXjIjAHFWRYqxzzd+Y3kfyhEX8x61a6fJ6ZmjtZJF+sSIKjlH
AKyuKqRsvXFXwb5r1O//ADa/OK5udMt2SfzFfRW9jCQCyQoqQRNIFNBxhjDPvQb74q/RK3hSCCOB
K8IlVFr1oooK4qwbz7+R/wCW3nq4+u67pQ/SXEL+kbZ2gnIAoObIeMlBsOamnbFWI6b/AM4h/k5Z
3SzzW99qCLv9XuboiM/P0Vhb/hsVej6n+Xfk3UfJ0vk6bTIofLkqojWFsPQQem6yqVMfEhuaBq9S
euKqfkL8t/KHkPTbjT/LNmbS3upjcTl3eV2cqqbvIWbiAmy1oN/HFXzl/wA5x/8AHV8o/wDGC9/4
nDir07/nHvy5oPmL/nHby7peuWEOo6fN9e529wgdajULijCu6sOzDcYqpXn/ADiD+TlxeG4ihv7S
Imv1SG6JiG9aVlWSSnb7eKs98jflN+X3kdSfLmjxWty68ZL5+U1yynqPWkLOAf5VIHtirLsVfNf/
ADm9/wAot5a/5jpv+TOKpt/ziRpmnap+St5YalaxXtjcapcpPa3CLJE6+lDsyMCDiqb6t/ziP+Tl
/dNcQ2t5pwYktBaXJ9Op32EyzEfIGmKsu8jfkn+WnkmYXWhaNGmoDpqFwzXFwK7Hg8pb06jrwAxV
nOKpD518keXfOmhtofmCBrnTnkSZokkeI84zVTyQq2KpXpf5Q+RNK8m3nlDTbFrTRtQVkvRDLIlx
KrMWKvcA+qw3K7t9k06YqlPlP/nHj8qPKuu22u6RpLJqVnyNtLNcTTKjMpXkEkZl5AHY0269cVek
Yqp3FvBc28ttcRrNbzI0c0LgMjo4oysp2IINCMVeW2H/ADjD+T+n6jBqNhptza3trKs9tNFe3QaO
RG5Ky/vOxGKvVsVdirsVWXEENxBJbzoJIZlaOWNtwysKMD8wcVfm9+an5c6v5A843uh30Ti2DtJp
l2w+G4tSx9ORT0rTZh2aoxVh+Kr4opZZUiiRpJZGCxxqCzMzGgAA3JJxV+jv5M+VLvyn+V/l7Qbx
PTvbW253UXXhNcO1xIh91eUjFWaYq8J/P7/nH3zF+ZfmjTNV03U7OxtrOzFrKtyJTIW9V5OShFII
o/cjFWQ/k3/zj35X/LYvqAlOreYpU4PqcqBBEh+0lvHVuAb9olix+W2KvVcVdirsVdirsVfJf/Oc
f/HV8o/8YL3/AInDir1//nFz/wAkT5Z/6Pv+6hcYq9VxV2KuxV81/wDOb3/KLeWv+Y6b/kziqf8A
/OG3/ko5v+2rc/8AJqHFXuuKuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KsN/NL/AJVb/h//AJCL9Q/R
VT6P16nPnTf6vx/fc6f76+LFXyvrf/Qnf19/qf8AiD0f2fqVfR/2P1z979+KvUfyJ/6Ff/TEP+FK
/wCKP+PX9N8vrdaf8e/P9xz6/wB18X0Yq+icVdirsVdirsVdirsVdirsVYP+Y/8Ayp317H/lYP6I
9bjJ+j/0r6XLjVfU9P1O1eNaYqn3kz/CP+GrP/CH1T/Dv7z6j9Q4/Vv71/V9Ph8P97yr71xVOsVd
irsVYj+Y3/Kr/qVn/wArA/Rn1P1G+o/pX0+Hq8fi9P1O/HFUV5A/wB+gm/wL9Q/Qvrvy/RnD0PXo
vP8Au9uVONcVZJirsVdirsVdirsVdirsVdir/9k=
-
-
-
-
-
- 1
- False
- False
-
- 242.041016
- 87.355469
- Points
-
-
-
- Cyan
- Magenta
- Yellow
- Black
-
-
-
-
-
- Default Swatch Group
- 0
-
-
-
-
-
- Document
-
-
- application/pdf
-
-
- logos
-
-
-
-
- proof:pdf
- uuid:470f514c-2b1e-2442-b3ab-6f93dc356ece
- uuid:2a782b07-ebfa-d24b-aa9a-5faf78cc1be6
-
-
- Adobe PDF library 10.01
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
endstream
endobj
3 0 obj
<>
endobj
7 0 obj
<>/Resources<>/Properties<>>>/Thumb 11 0 R/TrimBox[0.0 0.0 242.041 87.3555]/Type/Page>>
endobj
8 0 obj
<>stream
-H͎$|eW
` ɇZ"ɪ
-z*XdEd֧||?}_o1~ZC*}?~|1ۯ2cs7_vףޏ,тcon3X?
-ܭqXH_S2khly3[S9zNa7YJâpϙ%X>rdqNcZp?0-6X!գṿVs,Z-bs!( peӥP#38$)#Ҥ2'-v&V|)2& ȖX1IYGnJ=RՎ?wSR0b9F&%dɇl42ߛ::a
-G"{wȜTf%ӓc|`LB :2%QNGI9='eUGUMTj8
NA'HִT$?l6UWiu1 ơ_/#ZSl'K'DrgG?܍VS{p]~I(Ĭ]{QdS
-ql}+tu aܗh,~ 6u@
/>-nVxyMB>x1ۅ_O\Ξ0q`FEd!(O.vܥ&,7Jq]u7%+,f/6]b7˃x;
-QLăXw~V~#UI2 >gwE]GYTx26ӥ0N'I9QP7iJLٕz}!;"]D\A5_1/BƑ>0D%FG bmlYLrLQ(&Dc>( 7Z"T@7mI[RG'
t=Iٛd;j(,$TIl^ؼ*]~IԞy($/
Be:(c&^\CHVtjAGy⻊aɄnFF^Y:мbiFD 9C#H75hNuKc;5T=+{kۯtjLL2҇w0rG=z'y8T:|M[ fpPװmh
-`R4J亄Ht5Q{Nqн(
IJSMC*