Compare commits
320 Commits
08-05-2018
...
25-02-2019
Author | SHA1 | Date | |
---|---|---|---|
650c761c51 | |||
2e07945994 | |||
d9fe86d160 | |||
bbaaf3a5c2 | |||
0f4d3042c3 | |||
be0306b309 | |||
c819aaf716 | |||
b6e818dc00 | |||
a3f8e2f243 | |||
9f3311978d | |||
817ef1069c | |||
faba9b36cb | |||
5276790afe | |||
8d613d4e57 | |||
5a067001e9 | |||
1a3117a603 | |||
cbfe141c32 | |||
35c4597017 | |||
289a66e55b | |||
8c6e04abd0 | |||
79dfa0511b | |||
982c40788c | |||
a46a7154ea | |||
fe2a6c2dfe | |||
c1053b8041 | |||
194b6c60de | |||
0b806d5bb2 | |||
b8865b96f0 | |||
b62fefc258 | |||
590e1d6794 | |||
ece7a97d42 | |||
99fffb839f | |||
154f1b98ef | |||
45a4f552e8 | |||
ca39a08d07 | |||
5eb1c8b274 | |||
29b5499b85 | |||
b08255cd18 | |||
be03249f11 | |||
0a52bd5fe3 | |||
9eab6c7e2e | |||
118cfeee41 | |||
f79ef55e3b | |||
5640580397 | |||
e90c20c262 | |||
cd4e6ddcb1 | |||
feb17e3f13 | |||
e6f4159e53 | |||
2d88a71b80 | |||
6c090b4967 | |||
f67670dc0a | |||
a03fc1a745 | |||
32c484b41a | |||
c89edd3cd6 | |||
4d775494c0 | |||
f9c1f37ac6 | |||
0e3aee13bd | |||
4a24d5249c | |||
64ead89601 | |||
b48b6db028 | |||
59e6eb3c30 | |||
8072d1eb3e | |||
e1dea40167 | |||
f3efb3d390 | |||
2035b85a06 | |||
100032fa86 | |||
3da2455945 | |||
30a96d56ec | |||
a7a36d8665 | |||
a0ef614252 | |||
229b02534e | |||
f2ab71cf3f | |||
497b8f1274 | |||
98765057dd | |||
824de4bcdb | |||
72fe0843c4 | |||
584bb42c93 | |||
f8e8454b86 | |||
41354be949 | |||
457712cd35 | |||
a0d644469d | |||
f76d9ba9cd | |||
dc7fd44b67 | |||
fba7937d02 | |||
f418ee25b0 | |||
c05506a2a5 | |||
5bb4e2ae1f | |||
fc70840c41 | |||
dff9831228 | |||
6d61c0d621 | |||
b16ca0defd | |||
93df9d235d | |||
069922b7da | |||
a7337fa918 | |||
da047a976a | |||
379826f16b | |||
5dc64492cb | |||
5ac5101ced | |||
fdabb3e3fc | |||
2890b03283 | |||
f6e2c83dbd | |||
c2eba7b3be | |||
089739e141 | |||
5c19d9c04c | |||
46bb22b17b | |||
d49b04e6fb | |||
672cbc1409 | |||
34f652d3bf | |||
8f65890f29 | |||
413cc6ddf8 | |||
ccd0fd03a9 | |||
6588b3d13a | |||
4860ee6623 | |||
e8df43351f | |||
1c1dbe8454 | |||
7e09e0f2f9 | |||
c495337aa6 | |||
f91ffba2a4 | |||
affe9a96f5 | |||
44fa0bea24 | |||
e77b509202 | |||
06b43732a9 | |||
ee2689ad84 | |||
8eadb03d59 | |||
6e0b3a4345 | |||
c633ce13b5 | |||
40593e00ed | |||
e214573e4e | |||
0825aba022 | |||
7a65263873 | |||
97f476e416 | |||
3dce138811 | |||
28edb3122f | |||
2cd9338417 | |||
0af31052b4 | |||
81ba811622 | |||
4b7008b5ba | |||
02744d5c72 | |||
52c963cf1b | |||
52d1328f93 | |||
50b40ac5b0 | |||
e1c3b0c002 | |||
f859abcb2f | |||
6e08208fed | |||
391c74df62 | |||
5f2deebfb5 | |||
6fa2123d57 | |||
536570abf1 | |||
ad67f6d852 | |||
ac6539a82c | |||
1e1021fd49 | |||
499aefbc1d | |||
c973b33ac8 | |||
3397ddbf44 | |||
607d2fafca | |||
ec7abaaf14 | |||
a389d731c2 | |||
4d7a99aeea | |||
04b80782dc | |||
837bc35a6b | |||
c98683e573 | |||
f6eea9ebf8 | |||
7e99e8b14b | |||
95b4c5fbc7 | |||
a50cca62d3 | |||
f122da1306 | |||
0692a689f1 | |||
fc8abc6d56 | |||
547daf4741 | |||
476f1b24a7 | |||
693b1fa26c | |||
655432a500 | |||
bd888f0f47 | |||
ede515f7a2 | |||
fa24c2d090 | |||
1522248793 | |||
cc1e4dd22a | |||
61a20e8708 | |||
a5815272c8 | |||
f66aba031c | |||
059fcc72b6 | |||
acb4e1b384 | |||
74e06a2b89 | |||
2032017b0c | |||
500633862e | |||
57306d6872 | |||
31bbc2326c | |||
5c0cdced85 | |||
07af7c961d | |||
ddd54e05e5 | |||
1fb1e62fb6 | |||
80630dae58 | |||
85c117ff81 | |||
a62d2a495e | |||
51c248e463 | |||
665cbb8374 | |||
5cfee77bb2 | |||
a8e686d59b | |||
6111e527e0 | |||
1b9ccfc95b | |||
59c917f599 | |||
b67f3b055f | |||
1d88b8ea69 | |||
d541506820 | |||
c9d0a597f5 | |||
e805dda4fb | |||
0be49b0d35 | |||
0c20b97b2f | |||
d32c1428cf | |||
f90dc5d9ae | |||
89df9f0315 | |||
561a3e9342 | |||
66392491b5 | |||
a100d4a403 | |||
9866298f19 | |||
3bda514879 | |||
7db41a9183 | |||
dfce597139 | |||
24357aeb05 | |||
a438eb81f0 | |||
1d92a5bf1c | |||
eb69734a38 | |||
6239d43f05 | |||
4c3985fc24 | |||
218e9b6fbe | |||
30696174f2 | |||
a3ddd525d0 | |||
2b8a7f08cb | |||
e28b99f40c | |||
b527b3a22d | |||
0b5e50aade | |||
dd53a39c4b | |||
f4e1b47d9d | |||
28cb1e22e7 | |||
7ff7bceca3 | |||
074b724d68 | |||
1ae92eeac8 | |||
30fd40ad72 | |||
972232b370 | |||
2e0b130ac5 | |||
2c07e76684 | |||
9325cdd68b | |||
19797b8731 | |||
4ea1761c72 | |||
e0d5e50357 | |||
f5638c3196 | |||
fa1c1596d5 | |||
bde2b5dde6 | |||
91f8edd2de | |||
9a7c3245c4 | |||
79da14e0bc | |||
683a8eb0e6 | |||
b0c4971838 | |||
d01b9f4803 | |||
f4d019046d | |||
f41ac3b107 | |||
8777832600 | |||
8458c6190d | |||
725871dab1 | |||
d687e9962e | |||
7abe97c1c2 | |||
cfa5be5612 | |||
b679b7e651 | |||
2fc2b0d641 | |||
c2b8177792 | |||
b9cc47f05d | |||
ec13b6902b | |||
19576cebed | |||
ebd2fcf4f5 | |||
73dfc842af | |||
1f636b7a5f | |||
4a20815619 | |||
bf00a52430 | |||
bca2e6449e | |||
46912f47c7 | |||
7a473d1aa8 | |||
92c7c80fbc | |||
701d070efd | |||
4ec6213877 | |||
e06a658422 | |||
d086f9dfab | |||
8f668c1bfa | |||
88308778d7 | |||
7db7ecf69a | |||
f447f30c6c | |||
e9b6df8536 | |||
e32a7c67e1 | |||
e376c789a6 | |||
1d9ae0dadd | |||
1a922704ed | |||
7a3387b550 | |||
5e29916f97 | |||
d0ae8d0620 | |||
4ef2e7f219 | |||
b412214976 | |||
1e299b6d5e | |||
5c5110a7cf | |||
84df7adc89 | |||
7ccfec5845 | |||
b69811105f | |||
925e0b11e8 | |||
9126a08d2f | |||
4383efa32c | |||
688a9de2b1 | |||
2c260c7174 | |||
42c934b723 | |||
cb2a7a5b04 | |||
28097368e1 | |||
877d9b40f5 | |||
aefc20198c | |||
4ac1b15520 | |||
b457786ae9 | |||
d6413887c2 | |||
e55614b4c8 | |||
53edcd8ffc | |||
99f86060a4 | |||
0c68b8dd5d | |||
11d5bdf752 | |||
27401c9070 | |||
beafe2580a |
13
.travis.yml
Normal file
@ -0,0 +1,13 @@
|
||||
sudo: required
|
||||
|
||||
language: php
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
#Target PHP versions
|
||||
php:
|
||||
- 7.2
|
||||
|
||||
script:
|
||||
- docker run -t -v $(pwd):/data pierre42100/docker-comunicwebappscratch /data/builder build offline
|
2
LICENSE
@ -1,5 +1,5 @@
|
||||
MIT License
|
||||
Copyright (c) <year> <copyright holders>
|
||||
Copyright (c) 2017-2019 Pierre HUBERT
|
||||
|
||||
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:
|
||||
|
||||
|
11
README.md
@ -20,4 +20,13 @@ ComunicWeb would not exists without the following technologies developped by the
|
||||
- VideoJS
|
||||
- jquery.hotkeys
|
||||
- bootstrap-wysiwyg (https://github.com/steveathon/bootstrap-wysiwyg/)
|
||||
- wdt-emoji-bundle (http://ned.im/wdt-emoji-bundle)
|
||||
- wdt-emoji-bundle (http://ned.im/wdt-emoji-bundle)
|
||||
- PNGLib (http://www.xarg.org/2010/03/generate-client-side-png-files-using-javascript/) (BSD License)
|
||||
- Identicon (http://github.com/stewartlord/identicon.js) (BSD License)
|
||||
- FileSaver.js (http://eligrey.com) (by Eli Grey) (MIT License)
|
||||
- JSZip (https://github.com/Stuk/jszip.git) (MIT License)
|
||||
- JSZip Utils (https://github.com/Stuk/jszip-utils.git) (MIT License)
|
||||
- SCEditor (BBC WYIWYG editor) (https://github.com/samclarke/SCEditor) (MIT License)
|
||||
- JavaScript BBCode Parser (https://github.com/Frug/js-bbcode-parser) (MIT License)
|
||||
- Pacman (https://github.com/daleharvey/pacman) (WTFPL License)
|
||||
- SimplePeer (https://github.com/feross/simple-peer) (MIT License)
|
247
assets/3rdparty/FileSaver.js
vendored
Normal file
@ -0,0 +1,247 @@
|
||||
/*! FileSaver.js
|
||||
* A saveAs() FileSaver implementation.
|
||||
* 2014-01-24
|
||||
*
|
||||
* By Eli Grey, http://eligrey.com
|
||||
* License: X11/MIT
|
||||
* See LICENSE.md
|
||||
*/
|
||||
|
||||
/*global self */
|
||||
/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */
|
||||
|
||||
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
|
||||
|
||||
var saveAs = saveAs
|
||||
// IE 10+ (native saveAs)
|
||||
|| (typeof navigator !== "undefined" &&
|
||||
navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator))
|
||||
// Everyone else
|
||||
|| (function(view) {
|
||||
"use strict";
|
||||
// IE <10 is explicitly unsupported
|
||||
if (typeof navigator !== "undefined" &&
|
||||
/MSIE [1-9]\./.test(navigator.userAgent)) {
|
||||
return;
|
||||
}
|
||||
var
|
||||
doc = view.document
|
||||
// only get URL when necessary in case BlobBuilder.js hasn't overridden it yet
|
||||
, get_URL = function() {
|
||||
return view.URL || view.webkitURL || view;
|
||||
}
|
||||
, URL = view.URL || view.webkitURL || view
|
||||
, save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a")
|
||||
, can_use_save_link = !view.externalHost && "download" in save_link
|
||||
, click = function(node) {
|
||||
var event = doc.createEvent("MouseEvents");
|
||||
event.initMouseEvent(
|
||||
"click", true, false, view, 0, 0, 0, 0, 0
|
||||
, false, false, false, false, 0, null
|
||||
);
|
||||
node.dispatchEvent(event);
|
||||
}
|
||||
, webkit_req_fs = view.webkitRequestFileSystem
|
||||
, req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem
|
||||
, throw_outside = function(ex) {
|
||||
(view.setImmediate || view.setTimeout)(function() {
|
||||
throw ex;
|
||||
}, 0);
|
||||
}
|
||||
, force_saveable_type = "application/octet-stream"
|
||||
, fs_min_size = 0
|
||||
, deletion_queue = []
|
||||
, process_deletion_queue = function() {
|
||||
var i = deletion_queue.length;
|
||||
while (i--) {
|
||||
var file = deletion_queue[i];
|
||||
if (typeof file === "string") { // file is an object URL
|
||||
URL.revokeObjectURL(file);
|
||||
} else { // file is a File
|
||||
file.remove();
|
||||
}
|
||||
}
|
||||
deletion_queue.length = 0; // clear queue
|
||||
}
|
||||
, dispatch = function(filesaver, event_types, event) {
|
||||
event_types = [].concat(event_types);
|
||||
var i = event_types.length;
|
||||
while (i--) {
|
||||
var listener = filesaver["on" + event_types[i]];
|
||||
if (typeof listener === "function") {
|
||||
try {
|
||||
listener.call(filesaver, event || filesaver);
|
||||
} catch (ex) {
|
||||
throw_outside(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
, FileSaver = function(blob, name) {
|
||||
// First try a.download, then web filesystem, then object URLs
|
||||
var
|
||||
filesaver = this
|
||||
, type = blob.type
|
||||
, blob_changed = false
|
||||
, object_url
|
||||
, target_view
|
||||
, get_object_url = function() {
|
||||
var object_url = get_URL().createObjectURL(blob);
|
||||
deletion_queue.push(object_url);
|
||||
return object_url;
|
||||
}
|
||||
, dispatch_all = function() {
|
||||
dispatch(filesaver, "writestart progress write writeend".split(" "));
|
||||
}
|
||||
// on any filesys errors revert to saving with object URLs
|
||||
, fs_error = function() {
|
||||
// don't create more object URLs than needed
|
||||
if (blob_changed || !object_url) {
|
||||
object_url = get_object_url(blob);
|
||||
}
|
||||
if (target_view) {
|
||||
target_view.location.href = object_url;
|
||||
} else {
|
||||
window.open(object_url, "_blank");
|
||||
}
|
||||
filesaver.readyState = filesaver.DONE;
|
||||
dispatch_all();
|
||||
}
|
||||
, abortable = function(func) {
|
||||
return function() {
|
||||
if (filesaver.readyState !== filesaver.DONE) {
|
||||
return func.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
}
|
||||
, create_if_not_found = {create: true, exclusive: false}
|
||||
, slice
|
||||
;
|
||||
filesaver.readyState = filesaver.INIT;
|
||||
if (!name) {
|
||||
name = "download";
|
||||
}
|
||||
if (can_use_save_link) {
|
||||
object_url = get_object_url(blob);
|
||||
// FF for Android has a nasty garbage collection mechanism
|
||||
// that turns all objects that are not pure javascript into 'deadObject'
|
||||
// this means `doc` and `save_link` are unusable and need to be recreated
|
||||
// `view` is usable though:
|
||||
doc = view.document;
|
||||
save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a");
|
||||
save_link.href = object_url;
|
||||
save_link.download = name;
|
||||
var event = doc.createEvent("MouseEvents");
|
||||
event.initMouseEvent(
|
||||
"click", true, false, view, 0, 0, 0, 0, 0
|
||||
, false, false, false, false, 0, null
|
||||
);
|
||||
save_link.dispatchEvent(event);
|
||||
filesaver.readyState = filesaver.DONE;
|
||||
dispatch_all();
|
||||
return;
|
||||
}
|
||||
// Object and web filesystem URLs have a problem saving in Google Chrome when
|
||||
// viewed in a tab, so I force save with application/octet-stream
|
||||
// http://code.google.com/p/chromium/issues/detail?id=91158
|
||||
if (view.chrome && type && type !== force_saveable_type) {
|
||||
slice = blob.slice || blob.webkitSlice;
|
||||
blob = slice.call(blob, 0, blob.size, force_saveable_type);
|
||||
blob_changed = true;
|
||||
}
|
||||
// Since I can't be sure that the guessed media type will trigger a download
|
||||
// in WebKit, I append .download to the filename.
|
||||
// https://bugs.webkit.org/show_bug.cgi?id=65440
|
||||
if (webkit_req_fs && name !== "download") {
|
||||
name += ".download";
|
||||
}
|
||||
if (type === force_saveable_type || webkit_req_fs) {
|
||||
target_view = view;
|
||||
}
|
||||
if (!req_fs) {
|
||||
fs_error();
|
||||
return;
|
||||
}
|
||||
fs_min_size += blob.size;
|
||||
req_fs(view.TEMPORARY, fs_min_size, abortable(function(fs) {
|
||||
fs.root.getDirectory("saved", create_if_not_found, abortable(function(dir) {
|
||||
var save = function() {
|
||||
dir.getFile(name, create_if_not_found, abortable(function(file) {
|
||||
file.createWriter(abortable(function(writer) {
|
||||
writer.onwriteend = function(event) {
|
||||
target_view.location.href = file.toURL();
|
||||
deletion_queue.push(file);
|
||||
filesaver.readyState = filesaver.DONE;
|
||||
dispatch(filesaver, "writeend", event);
|
||||
};
|
||||
writer.onerror = function() {
|
||||
var error = writer.error;
|
||||
if (error.code !== error.ABORT_ERR) {
|
||||
fs_error();
|
||||
}
|
||||
};
|
||||
"writestart progress write abort".split(" ").forEach(function(event) {
|
||||
writer["on" + event] = filesaver["on" + event];
|
||||
});
|
||||
writer.write(blob);
|
||||
filesaver.abort = function() {
|
||||
writer.abort();
|
||||
filesaver.readyState = filesaver.DONE;
|
||||
};
|
||||
filesaver.readyState = filesaver.WRITING;
|
||||
}), fs_error);
|
||||
}), fs_error);
|
||||
};
|
||||
dir.getFile(name, {create: false}, abortable(function(file) {
|
||||
// delete file if it already exists
|
||||
file.remove();
|
||||
save();
|
||||
}), abortable(function(ex) {
|
||||
if (ex.code === ex.NOT_FOUND_ERR) {
|
||||
save();
|
||||
} else {
|
||||
fs_error();
|
||||
}
|
||||
}));
|
||||
}), fs_error);
|
||||
}), fs_error);
|
||||
}
|
||||
, FS_proto = FileSaver.prototype
|
||||
, saveAs = function(blob, name) {
|
||||
return new FileSaver(blob, name);
|
||||
}
|
||||
;
|
||||
FS_proto.abort = function() {
|
||||
var filesaver = this;
|
||||
filesaver.readyState = filesaver.DONE;
|
||||
dispatch(filesaver, "abort");
|
||||
};
|
||||
FS_proto.readyState = FS_proto.INIT = 0;
|
||||
FS_proto.WRITING = 1;
|
||||
FS_proto.DONE = 2;
|
||||
|
||||
FS_proto.error =
|
||||
FS_proto.onwritestart =
|
||||
FS_proto.onprogress =
|
||||
FS_proto.onwrite =
|
||||
FS_proto.onabort =
|
||||
FS_proto.onerror =
|
||||
FS_proto.onwriteend =
|
||||
null;
|
||||
|
||||
view.addEventListener("unload", process_deletion_queue, false);
|
||||
saveAs.unload = function() {
|
||||
process_deletion_queue();
|
||||
view.removeEventListener("unload", process_deletion_queue, false);
|
||||
};
|
||||
return saveAs;
|
||||
}(
|
||||
typeof self !== "undefined" && self
|
||||
|| typeof window !== "undefined" && window
|
||||
|| this.content
|
||||
));
|
||||
// `self` is undefined in Firefox for Android content script context
|
||||
// while `this` is nsIContentFrameMessageManager
|
||||
// with an attribute `content` that corresponds to the window
|
||||
|
||||
if (typeof module !== "undefined") module.exports = saveAs;
|
262
assets/3rdparty/SignalExchangerClient/SignalExchangerClient.js
vendored
Normal file
@ -0,0 +1,262 @@
|
||||
/**
|
||||
* Signal exchanger web client
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
class SignalExchangerClient {
|
||||
|
||||
/**
|
||||
* Server domain
|
||||
*
|
||||
* @type {String}
|
||||
*/
|
||||
//domain;
|
||||
|
||||
/**
|
||||
* Server port
|
||||
*
|
||||
* @type {Number}
|
||||
*/
|
||||
//port;
|
||||
|
||||
/**
|
||||
* Current client ID
|
||||
*
|
||||
* @type {String}
|
||||
*/
|
||||
//clientID;
|
||||
|
||||
/**
|
||||
* Socket connection to the server
|
||||
*
|
||||
* @type {WebSocket}
|
||||
*/
|
||||
//socket;
|
||||
|
||||
/**
|
||||
* Function called in case of error
|
||||
*
|
||||
* @type {Function}
|
||||
*/
|
||||
//onError = null;
|
||||
|
||||
/**
|
||||
* Function called when the connection is etablished
|
||||
*
|
||||
* @type {Function}
|
||||
*/
|
||||
//onConnected = null;
|
||||
|
||||
/**
|
||||
* Function called when the connection to the socket is closed
|
||||
*
|
||||
* @type {Function}
|
||||
*/
|
||||
//onClosed = null;
|
||||
|
||||
/**
|
||||
* Function called when we get a new signal information
|
||||
*
|
||||
* @type {Function}
|
||||
*/
|
||||
//onSignal = null;
|
||||
|
||||
/**
|
||||
* Function called when we get a ready message notice
|
||||
*
|
||||
* @type {Function}
|
||||
*/
|
||||
//onReadyMessage = null;
|
||||
|
||||
/**
|
||||
* Construct a client instance
|
||||
*
|
||||
* @param {String} domain The name of the signal server
|
||||
* @param {Number} port The port of the server to use
|
||||
* @param {String} clientID The ID of current client
|
||||
* @param {Boolean} secure Specify whether connection to the socket should be secure or not
|
||||
*/
|
||||
constructor(domain, port, clientID, secure) {
|
||||
|
||||
//Save information
|
||||
this.domain = domain,
|
||||
this.port = port;
|
||||
this.clientID = clientID;
|
||||
|
||||
this.socket = new WebSocket((secure ? "wss" : "ws") + "://" + this.domain + ":" + this.port + "/socket");
|
||||
|
||||
//Add a few events listeners
|
||||
this.socket.addEventListener("open", () => {
|
||||
this.serverConnected();
|
||||
|
||||
if(this.onConnected != null)
|
||||
setTimeout(this.onConnected, 10);
|
||||
});
|
||||
|
||||
this.socket.addEventListener("message", message => {
|
||||
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(message.data);
|
||||
} catch(e){
|
||||
console.error("Could not parse message from server!");
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("New message from socket", data);
|
||||
|
||||
this.serverMessage(data);
|
||||
});
|
||||
|
||||
this.socket.addEventListener("error", () => {
|
||||
if(this.onError != null)
|
||||
setTimeout(this.onError, 0);
|
||||
});
|
||||
|
||||
this.socket.addEventListener("close", () => {
|
||||
if(this.onClosed != null)
|
||||
setTimeout(this.onClosed, 0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this method to get the current connection status to the server
|
||||
*
|
||||
* @return {Boolean} TRUE if the client is connected to the server / FALSE else
|
||||
*/
|
||||
isConnected() {
|
||||
return this.socket.readyState == WebSocket.OPEN;
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the connection to the server (if connected)
|
||||
*/
|
||||
close() {
|
||||
if(this.isConnected())
|
||||
this.socket.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called once the client is successfully
|
||||
* connected to the client
|
||||
*/
|
||||
serverConnected(){
|
||||
|
||||
//Send data to the server to identificate client
|
||||
this.sendData({
|
||||
client_id: this.clientID
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Send ready message to a peer
|
||||
*
|
||||
* @param {String} peerID The ID of the target peer for the message
|
||||
*/
|
||||
sendReadyMessage(peerID){
|
||||
|
||||
this.sendData({
|
||||
ready_msg: true,
|
||||
target_id: peerID
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a signal to the server
|
||||
*
|
||||
* @param target_id The ID of the target for the signal
|
||||
* @param content Signal to send to the target
|
||||
*/
|
||||
sendSignal(target_id, content){
|
||||
|
||||
//Send directly the message to the server
|
||||
this.sendData({
|
||||
signal: content,
|
||||
target_id: target_id
|
||||
});
|
||||
|
||||
//Save the current signal being sent to be able to send
|
||||
//it again in case of failure
|
||||
this.pending_signal = content;
|
||||
this.pending_signal_target = target_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop to try to send the current signal message in queue
|
||||
*
|
||||
* This does not cancel the sending of messages already sent through
|
||||
* socket
|
||||
*/
|
||||
cancelCurrentSignal() {
|
||||
this.pending_signal = undefined;
|
||||
this.pending_signal_target = undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send data to the server
|
||||
*
|
||||
* @param {Object} data The data to send to the server
|
||||
*/
|
||||
sendData(data){
|
||||
console.log("Sending data to server", data);
|
||||
this.socket.send(JSON.stringify(data));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called when the server has sent a new message to this client
|
||||
*
|
||||
* @param {Object} message The message sent by the server, as a JSON object
|
||||
*/
|
||||
serverMessage(message){
|
||||
|
||||
//Check if it is a callback for a pending message
|
||||
if(message.signal_sent){
|
||||
if(message.number_of_targets < 1 && this.pending_signal && this.pending_signal_target){
|
||||
|
||||
//We have to send the message again
|
||||
setTimeout(() => {
|
||||
this.sendSignal(this.pending_signal, this.pending_signal_target);
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
//Else we can remove from this class information about the signal being sent
|
||||
this.cancelCurrentSignal();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//Check if message is a callback for a ready notice
|
||||
else if(message.ready_message_sent){
|
||||
|
||||
if(message.number_of_targets < 1){
|
||||
|
||||
//Try to send message again
|
||||
setTimeout(() => {
|
||||
this.sendReadyMessage(message.target_id);
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Check if message is a ready notice
|
||||
else if(message.ready_msg){
|
||||
if(this.onReadyMessage != null)
|
||||
this.onReadyMessage(message.source_id);
|
||||
}
|
||||
|
||||
// Check if the message is a signal
|
||||
else if(message.signal){
|
||||
if(this.onSignal != null)
|
||||
this.onSignal(message.signal, message.source_id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -9,7 +9,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(flat.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/flat.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -49,7 +49,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat,
|
||||
.iradio_flat {
|
||||
background-image: url(flat@2x.png);
|
||||
background-image: url(icheck-flat-imgs/flat@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
@ -65,7 +65,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(red.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/red.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -105,7 +105,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-red,
|
||||
.iradio_flat-red {
|
||||
background-image: url(red@2x.png);
|
||||
background-image: url(icheck-flat-imgs/red@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
@ -121,7 +121,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(green.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/green.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -161,7 +161,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-green,
|
||||
.iradio_flat-green {
|
||||
background-image: url(green@2x.png);
|
||||
background-image: url(icheck-flat-imgs/green@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
@ -177,7 +177,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(blue.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/blue.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -217,7 +217,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-blue,
|
||||
.iradio_flat-blue {
|
||||
background-image: url(blue@2x.png);
|
||||
background-image: url(icheck-flat-imgs/blue@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
@ -233,7 +233,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(aero.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/aero.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -273,7 +273,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-aero,
|
||||
.iradio_flat-aero {
|
||||
background-image: url(aero@2x.png);
|
||||
background-image: url(icheck-flat-imgs/aero@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
@ -289,7 +289,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(grey.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/grey.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -329,7 +329,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-grey,
|
||||
.iradio_flat-grey {
|
||||
background-image: url(grey@2x.png);
|
||||
background-image: url(icheck-flat-imgs/grey@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
@ -345,7 +345,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(orange.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/orange.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -385,7 +385,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-orange,
|
||||
.iradio_flat-orange {
|
||||
background-image: url(orange@2x.png);
|
||||
background-image: url(icheck-flat-imgs/orange@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
@ -401,7 +401,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(yellow.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/yellow.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -441,7 +441,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-yellow,
|
||||
.iradio_flat-yellow {
|
||||
background-image: url(yellow@2x.png);
|
||||
background-image: url(icheck-flat-imgs/yellow@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
@ -457,7 +457,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(pink.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/pink.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -497,7 +497,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-pink,
|
||||
.iradio_flat-pink {
|
||||
background-image: url(pink@2x.png);
|
||||
background-image: url(icheck-flat-imgs/pink@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
@ -513,7 +513,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(purple.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/purple.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -553,7 +553,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-purple,
|
||||
.iradio_flat-purple {
|
||||
background-image: url(purple@2x.png);
|
||||
background-image: url(icheck-flat-imgs/purple@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(aero.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/aero.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -49,7 +49,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-aero,
|
||||
.iradio_flat-aero {
|
||||
background-image: url(aero@2x.png);
|
||||
background-image: url(icheck-flat-imgs/aero@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(blue.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/blue.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -49,7 +49,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-blue,
|
||||
.iradio_flat-blue {
|
||||
background-image: url(blue@2x.png);
|
||||
background-image: url(icheck-flat-imgs/blue@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(flat.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/flat.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -49,7 +49,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat,
|
||||
.iradio_flat {
|
||||
background-image: url(flat@2x.png);
|
||||
background-image: url(icheck-flat-imgs/flat@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(green.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/green.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -49,7 +49,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-green,
|
||||
.iradio_flat-green {
|
||||
background-image: url(green@2x.png);
|
||||
background-image: url(icheck-flat-imgs/green@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(grey.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/grey.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -49,7 +49,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-grey,
|
||||
.iradio_flat-grey {
|
||||
background-image: url(grey@2x.png);
|
||||
background-image: url(icheck-flat-imgs/grey@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
@ -9,7 +9,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(orange.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/orange.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -49,7 +49,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-orange,
|
||||
.iradio_flat-orange {
|
||||
background-image: url(orange@2x.png);
|
||||
background-image: url(icheck-flat-imgs/orange@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(pink.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/pink.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -49,7 +49,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-pink,
|
||||
.iradio_flat-pink {
|
||||
background-image: url(pink@2x.png);
|
||||
background-image: url(icheck-flat-imgs/pink@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(purple.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/purple.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -49,7 +49,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-purple,
|
||||
.iradio_flat-purple {
|
||||
background-image: url(purple@2x.png);
|
||||
background-image: url(icheck-flat-imgs/purple@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(red.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/red.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -49,7 +49,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-red,
|
||||
.iradio_flat-red {
|
||||
background-image: url(red@2x.png);
|
||||
background-image: url(icheck-flat-imgs/red@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: url(yellow.png) no-repeat;
|
||||
background: url(icheck-flat-imgs/yellow.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -49,7 +49,7 @@
|
||||
only screen and (min-device-pixel-ratio: 1.5) {
|
||||
.icheckbox_flat-yellow,
|
||||
.iradio_flat-yellow {
|
||||
background-image: url(yellow@2x.png);
|
||||
background-image: url(icheck-flat-imgs/yellow@2x.png);
|
||||
-webkit-background-size: 176px 22px;
|
||||
background-size: 176px 22px;
|
||||
}
|
||||
|
5
assets/3rdparty/bootstrap-wysiwyg.js
vendored
@ -59,6 +59,11 @@
|
||||
}.bind( this ) );
|
||||
|
||||
$( window ).bind( "touchend", function( e ) {
|
||||
|
||||
//COMUNIC FIX
|
||||
if(!this.getCurrentRange)
|
||||
return;
|
||||
|
||||
var isInside = ( editor.is( e.target ) || editor.has( e.target ).length > 0 ),
|
||||
currentRange = this.getCurrentRange(),
|
||||
clear = currentRange && ( currentRange.startContainer === currentRange.endContainer && currentRange.startOffset === currentRange.endOffset );
|
||||
|
8
assets/3rdparty/identicon.js/LICENSE
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
Copyright (c) 2018, Stewart Lord
|
||||
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.
|
||||
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 HOLDER 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.
|
73
assets/3rdparty/identicon.js/README.md
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
identicon.js
|
||||
============
|
||||
|
||||

|
||||
|
||||
[](https://cdnjs.com/libraries/identicon.js)
|
||||
|
||||
GitHub-style identicons as PNGs or SVGs in JS.
|
||||
|
||||
This little library will produce the same shape and (nearly) the same color as GitHub when given the same hash value. Supports PNG and SVG output formats. Note that GitHub uses an internal database identifier for the hash, so you can't simply md5 the username and get the same result. The creative visual design is borrowed from [Jason Long](http://twitter.com/jasonlong) of Git and GitHub fame.
|
||||
|
||||
Demo
|
||||
----
|
||||
[View Demo](https://rawgithub.com/stewartlord/identicon.js/master/demo.html)
|
||||
|
||||
Installation
|
||||
-----
|
||||
```
|
||||
npm install identicon.js --save
|
||||
```
|
||||
[](https://npmjs.org/package/identicon.js)
|
||||
|
||||
Options
|
||||
----
|
||||
* **hash** - A hexadecimal string of 15+ characters that will be used to generate the image.
|
||||
* **options** - [Optional] An options object used to customize the generated image.
|
||||
* **size** - The size in pixels of the height and width of the generated (square) image. Defaults to 64 pixels.
|
||||
* **margin** - The decimal fraction of the size to use for margin. For example, use 0.2 for a 20% margin. Defaults to 0.08 for an 8% margin.
|
||||
* **foreground** - The foreground color is automatically derived from the hash value. Use this option to override that behavior and provide a rgba value array instead (e.g. [255,0,0,255] for red).
|
||||
* **background** - The background color expressed as an rgba value array to use for the image background. For example, use [255,0,0,255] for red. Defaults to an opaque light gray [240,240,240,255].
|
||||
* **saturation** - The saturation of the derived foreground color as a value from 0-1. Defaults to 0.7.
|
||||
* **brightness** - The brightness of the derived foreground color as a value from 0-1. Defaults to 0.5.
|
||||
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
##### Simple
|
||||
Generate the Identicon by supplying a hash string and size.
|
||||
```js
|
||||
|
||||
// create a base64 encoded PNG
|
||||
var data = new Identicon('d3b07384d113edec49eaa6238ad5ff00', 420).toString();
|
||||
|
||||
// write to a data URI
|
||||
document.write('<img width=420 height=420 src="data:image/png;base64,' + data + '">');
|
||||
```
|
||||
|
||||
##### Advanced
|
||||
To customize additional properties, generate the Identicon by supplying a hexadecimal string and an options object.
|
||||
```js
|
||||
// set up options
|
||||
var hash = "c157a79031e1c40f85931829bc5fc552"; // 15+ hex chars
|
||||
var options = {
|
||||
foreground: [0, 0, 0, 255], // rgba black
|
||||
background: [255, 255, 255, 255], // rgba white
|
||||
margin: 0.2, // 20% margin
|
||||
size: 420, // 420px square
|
||||
format: 'svg' // use SVG instead of PNG
|
||||
};
|
||||
|
||||
// create a base64 encoded SVG
|
||||
var data = new Identicon(hash, options).toString();
|
||||
|
||||
// write to a data URI
|
||||
document.write('<img width=420 height=420 src="data:image/svg+xml;base64,' + data + '">');
|
||||
```
|
||||
|
||||
|
||||
[PNG output requires PNGLib](http://www.xarg.org/download/pnglib.js)
|
||||
|
||||
Copyright 2018, [Stewart Lord](https://github.com/stewartlord)
|
||||
Released under the [BSD license](http://www.opensource.org/licenses/bsd-license.php)
|
205
assets/3rdparty/identicon.js/identicon.js
vendored
Normal file
@ -0,0 +1,205 @@
|
||||
/**
|
||||
* Identicon.js 2.3.2
|
||||
* http://github.com/stewartlord/identicon.js
|
||||
*
|
||||
* PNGLib required for PNG output
|
||||
* http://www.xarg.org/download/pnglib.js
|
||||
*
|
||||
* Copyright 2018, Stewart Lord
|
||||
* Released under the BSD license
|
||||
* http://www.opensource.org/licenses/bsd-license.php
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var PNGlib;
|
||||
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
|
||||
PNGlib = require('./pnglib');
|
||||
} else {
|
||||
PNGlib = window.PNGlib;
|
||||
}
|
||||
|
||||
var Identicon = function(hash, options){
|
||||
if (typeof(hash) !== 'string' || hash.length < 15) {
|
||||
throw 'A hash of at least 15 characters is required.';
|
||||
}
|
||||
|
||||
this.defaults = {
|
||||
background: [240, 240, 240, 255],
|
||||
margin: 0.08,
|
||||
size: 64,
|
||||
saturation: 0.7,
|
||||
brightness: 0.5,
|
||||
format: 'png'
|
||||
};
|
||||
|
||||
this.options = typeof(options) === 'object' ? options : this.defaults;
|
||||
|
||||
// backward compatibility with old constructor (hash, size, margin)
|
||||
if (typeof(arguments[1]) === 'number') { this.options.size = arguments[1]; }
|
||||
if (arguments[2]) { this.options.margin = arguments[2]; }
|
||||
|
||||
this.hash = hash
|
||||
this.background = this.options.background || this.defaults.background;
|
||||
this.size = this.options.size || this.defaults.size;
|
||||
this.format = this.options.format || this.defaults.format;
|
||||
this.margin = this.options.margin !== undefined ? this.options.margin : this.defaults.margin;
|
||||
|
||||
// foreground defaults to last 7 chars as hue at 70% saturation, 50% brightness
|
||||
var hue = parseInt(this.hash.substr(-7), 16) / 0xfffffff;
|
||||
var saturation = this.options.saturation || this.defaults.saturation;
|
||||
var brightness = this.options.brightness || this.defaults.brightness;
|
||||
this.foreground = this.options.foreground || this.hsl2rgb(hue, saturation, brightness);
|
||||
};
|
||||
|
||||
Identicon.prototype = {
|
||||
background: null,
|
||||
foreground: null,
|
||||
hash: null,
|
||||
margin: null,
|
||||
size: null,
|
||||
format: null,
|
||||
|
||||
image: function(){
|
||||
return this.isSvg()
|
||||
? new Svg(this.size, this.foreground, this.background)
|
||||
: new PNGlib(this.size, this.size, 256);
|
||||
},
|
||||
|
||||
render: function(){
|
||||
var image = this.image(),
|
||||
size = this.size,
|
||||
baseMargin = Math.floor(size * this.margin),
|
||||
cell = Math.floor((size - (baseMargin * 2)) / 5),
|
||||
margin = Math.floor((size - cell * 5) / 2),
|
||||
bg = image.color.apply(image, this.background),
|
||||
fg = image.color.apply(image, this.foreground);
|
||||
|
||||
// the first 15 characters of the hash control the pixels (even/odd)
|
||||
// they are drawn down the middle first, then mirrored outwards
|
||||
var i, color;
|
||||
for (i = 0; i < 15; i++) {
|
||||
color = parseInt(this.hash.charAt(i), 16) % 2 ? bg : fg;
|
||||
if (i < 5) {
|
||||
this.rectangle(2 * cell + margin, i * cell + margin, cell, cell, color, image);
|
||||
} else if (i < 10) {
|
||||
this.rectangle(1 * cell + margin, (i - 5) * cell + margin, cell, cell, color, image);
|
||||
this.rectangle(3 * cell + margin, (i - 5) * cell + margin, cell, cell, color, image);
|
||||
} else if (i < 15) {
|
||||
this.rectangle(0 * cell + margin, (i - 10) * cell + margin, cell, cell, color, image);
|
||||
this.rectangle(4 * cell + margin, (i - 10) * cell + margin, cell, cell, color, image);
|
||||
}
|
||||
}
|
||||
|
||||
return image;
|
||||
},
|
||||
|
||||
rectangle: function(x, y, w, h, color, image){
|
||||
if (this.isSvg()) {
|
||||
image.rectangles.push({x: x, y: y, w: w, h: h, color: color});
|
||||
} else {
|
||||
var i, j;
|
||||
for (i = x; i < x + w; i++) {
|
||||
for (j = y; j < y + h; j++) {
|
||||
image.buffer[image.index(i, j)] = color;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// adapted from: https://gist.github.com/aemkei/1325937
|
||||
hsl2rgb: function(h, s, b){
|
||||
h *= 6;
|
||||
s = [
|
||||
b += s *= b < .5 ? b : 1 - b,
|
||||
b - h % 1 * s * 2,
|
||||
b -= s *= 2,
|
||||
b,
|
||||
b + h % 1 * s,
|
||||
b + s
|
||||
];
|
||||
|
||||
return[
|
||||
s[ ~~h % 6 ] * 255, // red
|
||||
s[ (h|16) % 6 ] * 255, // green
|
||||
s[ (h|8) % 6 ] * 255 // blue
|
||||
];
|
||||
},
|
||||
|
||||
toString: function(raw){
|
||||
// backward compatibility with old toString, default to base64
|
||||
if (raw) {
|
||||
return this.render().getDump();
|
||||
} else {
|
||||
return this.render().getBase64();
|
||||
}
|
||||
},
|
||||
|
||||
isSvg: function(){
|
||||
return this.format.match(/svg/i)
|
||||
}
|
||||
};
|
||||
|
||||
var Svg = function(size, foreground, background){
|
||||
this.size = size;
|
||||
this.foreground = this.color.apply(this, foreground);
|
||||
this.background = this.color.apply(this, background);
|
||||
this.rectangles = [];
|
||||
};
|
||||
|
||||
Svg.prototype = {
|
||||
size: null,
|
||||
foreground: null,
|
||||
background: null,
|
||||
rectangles: null,
|
||||
|
||||
color: function(r, g, b, a){
|
||||
var values = [r, g, b].map(Math.round);
|
||||
values.push((a >= 0) && (a <= 255) ? a/255 : 1);
|
||||
return 'rgba(' + values.join(',') + ')';
|
||||
},
|
||||
|
||||
getDump: function(){
|
||||
var i,
|
||||
xml,
|
||||
rect,
|
||||
fg = this.foreground,
|
||||
bg = this.background,
|
||||
stroke = this.size * 0.005;
|
||||
|
||||
xml = "<svg xmlns='http://www.w3.org/2000/svg'"
|
||||
+ " width='" + this.size + "' height='" + this.size + "'"
|
||||
+ " style='background-color:" + bg + ";'>"
|
||||
+ "<g style='fill:" + fg + "; stroke:" + fg + "; stroke-width:" + stroke + ";'>";
|
||||
|
||||
for (i = 0; i < this.rectangles.length; i++) {
|
||||
rect = this.rectangles[i];
|
||||
if (rect.color == bg) continue;
|
||||
xml += "<rect "
|
||||
+ " x='" + rect.x + "'"
|
||||
+ " y='" + rect.y + "'"
|
||||
+ " width='" + rect.w + "'"
|
||||
+ " height='" + rect.h + "'"
|
||||
+ "/>";
|
||||
}
|
||||
xml += "</g></svg>"
|
||||
|
||||
return xml;
|
||||
},
|
||||
|
||||
getBase64: function(){
|
||||
if (btoa) {
|
||||
return btoa(this.getDump());
|
||||
} else if (Buffer) {
|
||||
return new Buffer(this.getDump(), 'binary').toString('base64');
|
||||
} else {
|
||||
throw 'Cannot generate base64 output';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
|
||||
module.exports = Identicon;
|
||||
} else {
|
||||
window.Identicon = Identicon;
|
||||
}
|
||||
})();
|
19
assets/3rdparty/identicon.js/package.json
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "identicon.js",
|
||||
"version": "2.3.2",
|
||||
"description": "GitHub-style identicons as PNGs or SVGs in JS.",
|
||||
"main": "identicon.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/stewartlord/identicon.js"
|
||||
},
|
||||
"keywords": [
|
||||
"identicon"
|
||||
],
|
||||
"author": "stewardlord",
|
||||
"license": "BSD",
|
||||
"bugs": {
|
||||
"url": "https://github.com/stewartlord/identicon.js/issues"
|
||||
},
|
||||
"homepage": "https://github.com/stewartlord/identicon.js"
|
||||
}
|
214
assets/3rdparty/identicon.js/pnglib.js
vendored
Normal file
@ -0,0 +1,214 @@
|
||||
/**
|
||||
* A handy class to calculate color values.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author Robert Eisele <robert@xarg.org>
|
||||
* @copyright Copyright (c) 2010, Robert Eisele
|
||||
* @link http://www.xarg.org/2010/03/generate-client-side-png-files-using-javascript/
|
||||
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
|
||||
*
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
// helper functions for that ctx
|
||||
function write(buffer, offs) {
|
||||
for (var i = 2; i < arguments.length; i++) {
|
||||
for (var j = 0; j < arguments[i].length; j++) {
|
||||
buffer[offs++] = arguments[i].charAt(j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function byte2(w) {
|
||||
return String.fromCharCode((w >> 8) & 255, w & 255);
|
||||
}
|
||||
|
||||
function byte4(w) {
|
||||
return String.fromCharCode((w >> 24) & 255, (w >> 16) & 255, (w >> 8) & 255, w & 255);
|
||||
}
|
||||
|
||||
function byte2lsb(w) {
|
||||
return String.fromCharCode(w & 255, (w >> 8) & 255);
|
||||
}
|
||||
|
||||
// modified from original source to support NPM
|
||||
var PNGlib = function(width,height,depth) {
|
||||
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.depth = depth;
|
||||
|
||||
// pixel data and row filter identifier size
|
||||
this.pix_size = height * (width + 1);
|
||||
|
||||
// deflate header, pix_size, block headers, adler32 checksum
|
||||
this.data_size = 2 + this.pix_size + 5 * Math.floor((0xfffe + this.pix_size) / 0xffff) + 4;
|
||||
|
||||
// offsets and sizes of Png chunks
|
||||
this.ihdr_offs = 0; // IHDR offset and size
|
||||
this.ihdr_size = 4 + 4 + 13 + 4;
|
||||
this.plte_offs = this.ihdr_offs + this.ihdr_size; // PLTE offset and size
|
||||
this.plte_size = 4 + 4 + 3 * depth + 4;
|
||||
this.trns_offs = this.plte_offs + this.plte_size; // tRNS offset and size
|
||||
this.trns_size = 4 + 4 + depth + 4;
|
||||
this.idat_offs = this.trns_offs + this.trns_size; // IDAT offset and size
|
||||
this.idat_size = 4 + 4 + this.data_size + 4;
|
||||
this.iend_offs = this.idat_offs + this.idat_size; // IEND offset and size
|
||||
this.iend_size = 4 + 4 + 4;
|
||||
this.buffer_size = this.iend_offs + this.iend_size; // total PNG size
|
||||
|
||||
this.buffer = new Array();
|
||||
this.palette = new Object();
|
||||
this.pindex = 0;
|
||||
|
||||
var _crc32 = new Array();
|
||||
|
||||
// initialize buffer with zero bytes
|
||||
for (var i = 0; i < this.buffer_size; i++) {
|
||||
this.buffer[i] = "\x00";
|
||||
}
|
||||
|
||||
// initialize non-zero elements
|
||||
write(this.buffer, this.ihdr_offs, byte4(this.ihdr_size - 12), 'IHDR', byte4(width), byte4(height), "\x08\x03");
|
||||
write(this.buffer, this.plte_offs, byte4(this.plte_size - 12), 'PLTE');
|
||||
write(this.buffer, this.trns_offs, byte4(this.trns_size - 12), 'tRNS');
|
||||
write(this.buffer, this.idat_offs, byte4(this.idat_size - 12), 'IDAT');
|
||||
write(this.buffer, this.iend_offs, byte4(this.iend_size - 12), 'IEND');
|
||||
|
||||
// initialize deflate header
|
||||
var header = ((8 + (7 << 4)) << 8) | (3 << 6);
|
||||
header+= 31 - (header % 31);
|
||||
|
||||
write(this.buffer, this.idat_offs + 8, byte2(header));
|
||||
|
||||
// initialize deflate block headers
|
||||
for (var i = 0; (i << 16) - 1 < this.pix_size; i++) {
|
||||
var size, bits;
|
||||
if (i + 0xffff < this.pix_size) {
|
||||
size = 0xffff;
|
||||
bits = "\x00";
|
||||
} else {
|
||||
size = this.pix_size - (i << 16) - i;
|
||||
bits = "\x01";
|
||||
}
|
||||
write(this.buffer, this.idat_offs + 8 + 2 + (i << 16) + (i << 2), bits, byte2lsb(size), byte2lsb(~size));
|
||||
}
|
||||
|
||||
/* Create crc32 lookup table */
|
||||
for (var i = 0; i < 256; i++) {
|
||||
var c = i;
|
||||
for (var j = 0; j < 8; j++) {
|
||||
if (c & 1) {
|
||||
c = -306674912 ^ ((c >> 1) & 0x7fffffff);
|
||||
} else {
|
||||
c = (c >> 1) & 0x7fffffff;
|
||||
}
|
||||
}
|
||||
_crc32[i] = c;
|
||||
}
|
||||
|
||||
// compute the index into a png for a given pixel
|
||||
this.index = function(x,y) {
|
||||
var i = y * (this.width + 1) + x + 1;
|
||||
var j = this.idat_offs + 8 + 2 + 5 * Math.floor((i / 0xffff) + 1) + i;
|
||||
return j;
|
||||
}
|
||||
|
||||
// convert a color and build up the palette
|
||||
this.color = function(red, green, blue, alpha) {
|
||||
|
||||
alpha = alpha >= 0 ? alpha : 255;
|
||||
var color = (((((alpha << 8) | red) << 8) | green) << 8) | blue;
|
||||
|
||||
if (typeof this.palette[color] == "undefined") {
|
||||
if (this.pindex == this.depth) return "\x00";
|
||||
|
||||
var ndx = this.plte_offs + 8 + 3 * this.pindex;
|
||||
|
||||
this.buffer[ndx + 0] = String.fromCharCode(red);
|
||||
this.buffer[ndx + 1] = String.fromCharCode(green);
|
||||
this.buffer[ndx + 2] = String.fromCharCode(blue);
|
||||
this.buffer[this.trns_offs+8+this.pindex] = String.fromCharCode(alpha);
|
||||
|
||||
this.palette[color] = String.fromCharCode(this.pindex++);
|
||||
}
|
||||
return this.palette[color];
|
||||
}
|
||||
|
||||
// output a PNG string, Base64 encoded
|
||||
this.getBase64 = function() {
|
||||
|
||||
var s = this.getDump();
|
||||
|
||||
var ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
var c1, c2, c3, e1, e2, e3, e4;
|
||||
var l = s.length;
|
||||
var i = 0;
|
||||
var r = "";
|
||||
|
||||
do {
|
||||
c1 = s.charCodeAt(i);
|
||||
e1 = c1 >> 2;
|
||||
c2 = s.charCodeAt(i+1);
|
||||
e2 = ((c1 & 3) << 4) | (c2 >> 4);
|
||||
c3 = s.charCodeAt(i+2);
|
||||
if (l < i+2) { e3 = 64; } else { e3 = ((c2 & 0xf) << 2) | (c3 >> 6); }
|
||||
if (l < i+3) { e4 = 64; } else { e4 = c3 & 0x3f; }
|
||||
r+= ch.charAt(e1) + ch.charAt(e2) + ch.charAt(e3) + ch.charAt(e4);
|
||||
} while ((i+= 3) < l);
|
||||
return r;
|
||||
}
|
||||
|
||||
// output a PNG string
|
||||
this.getDump = function() {
|
||||
|
||||
// compute adler32 of output pixels + row filter bytes
|
||||
var BASE = 65521; /* largest prime smaller than 65536 */
|
||||
var NMAX = 5552; /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
|
||||
var s1 = 1;
|
||||
var s2 = 0;
|
||||
var n = NMAX;
|
||||
|
||||
for (var y = 0; y < this.height; y++) {
|
||||
for (var x = -1; x < this.width; x++) {
|
||||
s1+= this.buffer[this.index(x, y)].charCodeAt(0);
|
||||
s2+= s1;
|
||||
if ((n-= 1) == 0) {
|
||||
s1%= BASE;
|
||||
s2%= BASE;
|
||||
n = NMAX;
|
||||
}
|
||||
}
|
||||
}
|
||||
s1%= BASE;
|
||||
s2%= BASE;
|
||||
write(this.buffer, this.idat_offs + this.idat_size - 8, byte4((s2 << 16) | s1));
|
||||
|
||||
// compute crc32 of the PNG chunks
|
||||
function crc32(png, offs, size) {
|
||||
var crc = -1;
|
||||
for (var i = 4; i < size-4; i += 1) {
|
||||
crc = _crc32[(crc ^ png[offs+i].charCodeAt(0)) & 0xff] ^ ((crc >> 8) & 0x00ffffff);
|
||||
}
|
||||
write(png, offs+size-4, byte4(crc ^ -1));
|
||||
}
|
||||
|
||||
crc32(this.buffer, this.ihdr_offs, this.ihdr_size);
|
||||
crc32(this.buffer, this.plte_offs, this.plte_size);
|
||||
crc32(this.buffer, this.trns_offs, this.trns_size);
|
||||
crc32(this.buffer, this.idat_offs, this.idat_size);
|
||||
crc32(this.buffer, this.iend_offs, this.iend_size);
|
||||
|
||||
// convert PNG to string
|
||||
return "\x89PNG\r\n\x1a\n"+this.buffer.join('');
|
||||
}
|
||||
}
|
||||
|
||||
// modified from original source to support NPM
|
||||
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
|
||||
module.exports = PNGlib;
|
||||
} else {
|
||||
window.PNGlib = PNGlib;
|
||||
}
|
||||
})();
|
301
assets/3rdparty/js-bbcode-parser/bbcode-config.js
vendored
Normal file
@ -0,0 +1,301 @@
|
||||
/*
|
||||
* Javascript BBCode Parser Config Options
|
||||
* @author Philip Nicolcev
|
||||
* @license MIT License
|
||||
*/
|
||||
|
||||
var parserColors = [ 'gray', 'silver', 'white', 'yellow', 'orange', 'red', 'fuchsia', 'blue', 'green', 'black', '#cd38d9' ];
|
||||
|
||||
var parserTags = {
|
||||
'b': {
|
||||
openTag: function(params,content) {
|
||||
return '<b>';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</b>';
|
||||
}
|
||||
},
|
||||
'code': {
|
||||
openTag: function(params,content) {
|
||||
return '<code>';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</code>';
|
||||
},
|
||||
noParse: true
|
||||
},
|
||||
'color': {
|
||||
openTag: function(params,content) {
|
||||
var colorCode = params.substr(1) || "inherit";
|
||||
BBCodeParser.regExpAllowedColors.lastIndex = 0;
|
||||
BBCodeParser.regExpValidHexColors.lastIndex = 0;
|
||||
if ( !BBCodeParser.regExpAllowedColors.test( colorCode ) ) {
|
||||
if ( !BBCodeParser.regExpValidHexColors.test( colorCode ) ) {
|
||||
colorCode = "inherit";
|
||||
} else {
|
||||
if (colorCode.substr(0,1) !== "#") {
|
||||
colorCode = "#" + colorCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return '<span style="color:' + colorCode + '">';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</span>';
|
||||
}
|
||||
},
|
||||
'i': {
|
||||
openTag: function(params,content) {
|
||||
return '<i>';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</i>';
|
||||
}
|
||||
},
|
||||
'img': {
|
||||
openTag: function(params,content) {
|
||||
|
||||
var myUrl = content;
|
||||
|
||||
BBCodeParser.urlPattern.lastIndex = 0;
|
||||
if ( !BBCodeParser.urlPattern.test( myUrl ) ) {
|
||||
myUrl = "";
|
||||
}
|
||||
|
||||
return '<img class="bbCodeImage" src="' + myUrl + '">';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '';
|
||||
},
|
||||
content: function(params,content) {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
'list': {
|
||||
openTag: function(params,content) {
|
||||
return '<ul>';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</ul>';
|
||||
},
|
||||
restrictChildrenTo: ["*", "li"]
|
||||
},
|
||||
'noparse': {
|
||||
openTag: function(params,content) {
|
||||
return '';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '';
|
||||
},
|
||||
noParse: true
|
||||
},
|
||||
'quote': {
|
||||
openTag: function(params,content) {
|
||||
return '<blockquote>';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</blockquote>';
|
||||
}
|
||||
},
|
||||
's': {
|
||||
openTag: function(params,content) {
|
||||
return '<s>';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</s>';
|
||||
}
|
||||
},
|
||||
'size': {
|
||||
openTag: function(params,content) {
|
||||
var mySize = parseInt(params.substr(1),10) || 0;
|
||||
if (mySize < 10 || mySize > 20) {
|
||||
mySize = 'inherit';
|
||||
} else {
|
||||
mySize = mySize + 'px';
|
||||
}
|
||||
return '<span style="font-size:' + mySize + '">';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</span>';
|
||||
}
|
||||
},
|
||||
'u': {
|
||||
openTag: function(params,content) {
|
||||
return '<span style="text-decoration:underline">';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</span>';
|
||||
}
|
||||
},
|
||||
'url': {
|
||||
openTag: function(params,content) {
|
||||
|
||||
var myUrl;
|
||||
|
||||
if (!params) {
|
||||
myUrl = content.replace(/<.*?>/g,"");
|
||||
} else {
|
||||
myUrl = params.substr(1);
|
||||
}
|
||||
|
||||
BBCodeParser.urlPattern.lastIndex = 0;
|
||||
if ( !BBCodeParser.urlPattern.test( myUrl ) ) {
|
||||
myUrl = "#";
|
||||
}
|
||||
|
||||
BBCodeParser.urlPattern.lastIndex = 0;
|
||||
if ( !BBCodeParser.urlPattern.test( myUrl ) ) {
|
||||
myUrl = "";
|
||||
}
|
||||
|
||||
return '<a href="' + myUrl + '">';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</a>';
|
||||
}
|
||||
},
|
||||
|
||||
//COMUNIC ADD BEGIN
|
||||
|
||||
'left': {
|
||||
openTag: function(params,content) {
|
||||
return '<p style="text-align: left;">';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</p>';
|
||||
}
|
||||
},
|
||||
|
||||
'center': {
|
||||
openTag: function(params,content) {
|
||||
return '<p style="text-align: center;">';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</p>';
|
||||
}
|
||||
},
|
||||
|
||||
'right': {
|
||||
openTag: function(params,content) {
|
||||
return '<p style="text-align: right;">';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</p>';
|
||||
}
|
||||
},
|
||||
|
||||
'justify': {
|
||||
openTag: function(params,content) {
|
||||
return '<p style="text-align: justify;">';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</p>';
|
||||
}
|
||||
},
|
||||
|
||||
'ul': {
|
||||
openTag: function(params,content) {
|
||||
return '<ul>';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</ul>';
|
||||
}
|
||||
},
|
||||
|
||||
'ol': {
|
||||
openTag: function(params,content) {
|
||||
return '<ol>';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</ol>';
|
||||
}
|
||||
},
|
||||
|
||||
'li': {
|
||||
openTag: function(params,content) {
|
||||
return '<li>';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</li>';
|
||||
}
|
||||
},
|
||||
|
||||
'sup': {
|
||||
openTag: function(params,content) {
|
||||
return '<sup>';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</sup>';
|
||||
}
|
||||
},
|
||||
|
||||
'sub': {
|
||||
openTag: function(params,content) {
|
||||
return '<sub>';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</sub>';
|
||||
}
|
||||
},
|
||||
|
||||
'ltr': {
|
||||
openTag: function(params,content) {
|
||||
return '<div style="text-align: left;">';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</div>';
|
||||
}
|
||||
},
|
||||
|
||||
'rtl': {
|
||||
openTag: function(params,content) {
|
||||
return '<div style="text-align: right;">';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</div>';
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
'table': {
|
||||
openTag: function(params,content) {
|
||||
return '<table border="1" style="margin: auto;">';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</table>';
|
||||
}
|
||||
},
|
||||
|
||||
'tr': {
|
||||
openTag: function(params,content) {
|
||||
return '<tr>';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</tr>';
|
||||
}
|
||||
},
|
||||
|
||||
'td': {
|
||||
openTag: function(params,content) {
|
||||
return '<td>';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '</td>';
|
||||
}
|
||||
},
|
||||
|
||||
'hr': {
|
||||
openTag: function(params,content) {
|
||||
return '<hr />';
|
||||
},
|
||||
closeTag: function(params,content) {
|
||||
return '';
|
||||
},
|
||||
content: function(params, content){
|
||||
return '';
|
||||
}
|
||||
},
|
||||
|
||||
//COMUNIC ADD END
|
||||
};
|
152
assets/3rdparty/js-bbcode-parser/bbcode-parser.js
vendored
Normal file
@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Javascript BBCode Parser
|
||||
* @author Philip Nicolcev
|
||||
* @license MIT License
|
||||
*/
|
||||
|
||||
var BBCodeParser = (function(parserTags, parserColors) {
|
||||
'use strict';
|
||||
|
||||
var me = {},
|
||||
urlPattern = /^(?:https?|file|c):(?:\/{1,3}|\\{1})[-a-zA-Z0-9:;@#%&()~_?\+=\/\\\.]*$/,
|
||||
emailPattern = /[^\s@]+@[^\s@]+\.[^\s@]+/,
|
||||
fontFacePattern = /^([a-z][a-z0-9_]+|"[a-z][a-z0-9_\s]+")$/i,
|
||||
tagNames = [],
|
||||
tagNamesNoParse = [],
|
||||
regExpAllowedColors,
|
||||
regExpValidHexColors = /^#?[a-fA-F0-9]{6}$/,
|
||||
ii, tagName, len;
|
||||
|
||||
// create tag list and lookup fields
|
||||
for (tagName in parserTags) {
|
||||
if (!parserTags.hasOwnProperty(tagName))
|
||||
continue;
|
||||
|
||||
if (tagName === '*') {
|
||||
tagNames.push('\\' + tagName);
|
||||
} else {
|
||||
tagNames.push(tagName);
|
||||
if ( parserTags[tagName].noParse ) {
|
||||
tagNamesNoParse.push(tagName);
|
||||
}
|
||||
}
|
||||
|
||||
parserTags[tagName].validChildLookup = {};
|
||||
parserTags[tagName].validParentLookup = {};
|
||||
parserTags[tagName].restrictParentsTo = parserTags[tagName].restrictParentsTo || [];
|
||||
parserTags[tagName].restrictChildrenTo = parserTags[tagName].restrictChildrenTo || [];
|
||||
|
||||
len = parserTags[tagName].restrictChildrenTo.length;
|
||||
for (ii = 0; ii < len; ii++) {
|
||||
parserTags[tagName].validChildLookup[ parserTags[tagName].restrictChildrenTo[ii] ] = true;
|
||||
}
|
||||
len = parserTags[tagName].restrictParentsTo.length;
|
||||
for (ii = 0; ii < len; ii++) {
|
||||
parserTags[tagName].validParentLookup[ parserTags[tagName].restrictParentsTo[ii] ] = true;
|
||||
}
|
||||
}
|
||||
|
||||
regExpAllowedColors = new RegExp('^(?:' + parserColors.join('|') + ')$');
|
||||
|
||||
/*
|
||||
* Create a regular expression that captures the innermost instance of a tag in an array of tags
|
||||
* The returned RegExp captures the following in order:
|
||||
* 1) the tag from the array that was matched
|
||||
* 2) all (optional) parameters included in the opening tag
|
||||
* 3) the contents surrounded by the tag
|
||||
*
|
||||
* @param {type} tagsArray - the array of tags to capture
|
||||
* @returns {RegExp}
|
||||
*/
|
||||
function createInnermostTagRegExp(tagsArray) {
|
||||
var openingTag = '\\[(' + tagsArray.join('|') + ')\\b(?:[ =]([\\w"#\\-\\:\\/= ]*?))?\\]',
|
||||
notContainingOpeningTag = '((?:(?=([^\\[]+))\\4|\\[(?!\\1\\b(?:[ =](?:[\\w"#\\-\\:\\/= ]*?))?\\]))*?)',
|
||||
closingTag = '\\[\\/\\1\\]';
|
||||
|
||||
return new RegExp( openingTag + notContainingOpeningTag + closingTag, 'i');
|
||||
}
|
||||
|
||||
/*
|
||||
* Escape the contents of a tag and mark the tag with a null unicode character.
|
||||
* To be used in a loop with a regular expression that captures tags.
|
||||
* Marking the tag prevents it from being matched again.
|
||||
*
|
||||
* @param {type} matchStr - the full match, including the opening and closing tags
|
||||
* @param {type} tagName - the tag that was matched
|
||||
* @param {type} tagParams - parameters passed to the tag
|
||||
* @param {type} tagContents - everything between the opening and closing tags
|
||||
* @returns {String} - the full match with the tag contents escaped and the tag marked with \u0000
|
||||
*/
|
||||
function escapeInnerTags(matchStr, tagName, tagParams, tagContents) {
|
||||
tagParams = tagParams || "";
|
||||
tagContents = tagContents || "";
|
||||
tagContents = tagContents.replace(/\[/g, "[").replace(/\]/g, "]");
|
||||
return "[\u0000" + tagName + tagParams + "]" + tagContents + "[/\u0000" + tagName + "]";
|
||||
}
|
||||
|
||||
/*
|
||||
* Escape all BBCodes that are inside the given tags.
|
||||
*
|
||||
* @param {string} text - the text to search through
|
||||
* @param {string[]} tags - the tags to search for
|
||||
* @returns {string} - the full text with the required code escaped
|
||||
*/
|
||||
function escapeBBCodesInsideTags(text, tags) {
|
||||
var innerMostRegExp;
|
||||
if (tags.length === 0 || text.length < 7)
|
||||
return text;
|
||||
innerMostRegExp = createInnermostTagRegExp(tags);
|
||||
while (
|
||||
text !== (text = text.replace(innerMostRegExp, escapeInnerTags))
|
||||
);
|
||||
return text.replace(/\u0000/g,'');
|
||||
}
|
||||
|
||||
/*
|
||||
* Process a tag and its contents according to the rules provided in parserTags.
|
||||
*
|
||||
* @param {type} matchStr - the full match, including the opening and closing tags
|
||||
* @param {type} tagName - the tag that was matched
|
||||
* @param {type} tagParams - parameters passed to the tag
|
||||
* @param {type} tagContents - everything between the opening and closing tags
|
||||
* @returns {string} - the fully processed tag and its contents
|
||||
*/
|
||||
function replaceTagsAndContent(matchStr, tagName, tagParams, tagContents) {
|
||||
tagName = tagName.toLowerCase();
|
||||
tagParams = tagParams || "";
|
||||
tagContents = tagContents || "";
|
||||
return parserTags[tagName].openTag(tagParams, tagContents) + (parserTags[tagName].content ? parserTags[tagName].content(tagParams, tagContents) : tagContents) + parserTags[tagName].closeTag(tagParams, tagContents);
|
||||
}
|
||||
|
||||
function processTags(text, tagNames) {
|
||||
var innerMostRegExp;
|
||||
|
||||
if (tagNames.length === 0 || text.length < 7)
|
||||
return text;
|
||||
|
||||
innerMostRegExp = createInnermostTagRegExp(tagNames);
|
||||
|
||||
while (
|
||||
text !== (text = text.replace(innerMostRegExp, replaceTagsAndContent))
|
||||
);
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
/*
|
||||
* Public Methods and Properties
|
||||
*/
|
||||
me.process = function(text, config) {
|
||||
text = escapeBBCodesInsideTags(text, tagNamesNoParse);
|
||||
|
||||
return processTags(text, tagNames);
|
||||
};
|
||||
|
||||
me.allowedTags = tagNames;
|
||||
me.urlPattern = urlPattern;
|
||||
me.emailPattern = emailPattern;
|
||||
me.regExpAllowedColors = regExpAllowedColors;
|
||||
me.regExpValidHexColors = regExpValidHexColors;
|
||||
|
||||
return me;
|
||||
})(parserTags, parserColors);
|
121
assets/3rdparty/jszip-utils/jszip-utils.js
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
/*!
|
||||
|
||||
JSZipUtils - A collection of cross-browser utilities to go along with JSZip.
|
||||
<http://stuk.github.io/jszip-utils>
|
||||
|
||||
(c) 2014 Stuart Knightley, David Duponchel
|
||||
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown.
|
||||
|
||||
*/
|
||||
!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.JSZipUtils=e():"undefined"!=typeof global?global.JSZipUtils=e():"undefined"!=typeof self&&(self.JSZipUtils=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var JSZipUtils = {};
|
||||
// just use the responseText with xhr1, response with xhr2.
|
||||
// The transformation doesn't throw away high-order byte (with responseText)
|
||||
// because JSZip handles that case. If not used with JSZip, you may need to
|
||||
// do it, see https://developer.mozilla.org/En/Using_XMLHttpRequest#Handling_binary_data
|
||||
JSZipUtils._getBinaryFromXHR = function (xhr) {
|
||||
// for xhr.responseText, the 0xFF mask is applied by JSZip
|
||||
return xhr.response || xhr.responseText;
|
||||
};
|
||||
|
||||
// taken from jQuery
|
||||
function createStandardXHR() {
|
||||
try {
|
||||
return new window.XMLHttpRequest();
|
||||
} catch( e ) {}
|
||||
}
|
||||
|
||||
function createActiveXHR() {
|
||||
try {
|
||||
return new window.ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch( e ) {}
|
||||
}
|
||||
|
||||
// Create the request object
|
||||
var createXHR = window.ActiveXObject ?
|
||||
/* Microsoft failed to properly
|
||||
* implement the XMLHttpRequest in IE7 (can't request local files),
|
||||
* so we use the ActiveXObject when it is available
|
||||
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
|
||||
* we need a fallback.
|
||||
*/
|
||||
function() {
|
||||
return createStandardXHR() || createActiveXHR();
|
||||
} :
|
||||
// For all other browsers, use the standard XMLHttpRequest object
|
||||
createStandardXHR;
|
||||
|
||||
|
||||
|
||||
JSZipUtils.getBinaryContent = function(path, callback) {
|
||||
/*
|
||||
* Here is the tricky part : getting the data.
|
||||
* In firefox/chrome/opera/... setting the mimeType to 'text/plain; charset=x-user-defined'
|
||||
* is enough, the result is in the standard xhr.responseText.
|
||||
* cf https://developer.mozilla.org/En/XMLHttpRequest/Using_XMLHttpRequest#Receiving_binary_data_in_older_browsers
|
||||
* In IE <= 9, we must use (the IE only) attribute responseBody
|
||||
* (for binary data, its content is different from responseText).
|
||||
* In IE 10, the 'charset=x-user-defined' trick doesn't work, only the
|
||||
* responseType will work :
|
||||
* http://msdn.microsoft.com/en-us/library/ie/hh673569%28v=vs.85%29.aspx#Binary_Object_upload_and_download
|
||||
*
|
||||
* I'd like to use jQuery to avoid this XHR madness, but it doesn't support
|
||||
* the responseType attribute : http://bugs.jquery.com/ticket/11461
|
||||
*/
|
||||
try {
|
||||
|
||||
var xhr = createXHR();
|
||||
|
||||
xhr.open('GET', path, true);
|
||||
|
||||
// recent browsers
|
||||
if ("responseType" in xhr) {
|
||||
xhr.responseType = "arraybuffer";
|
||||
}
|
||||
|
||||
// older browser
|
||||
if(xhr.overrideMimeType) {
|
||||
xhr.overrideMimeType("text/plain; charset=x-user-defined");
|
||||
}
|
||||
|
||||
//Allow big files download
|
||||
xhr.setRequestHeader("Range", "bytes=0-9999999999999999999999999999999");
|
||||
|
||||
xhr.onreadystatechange = function(evt) {
|
||||
var file, err;
|
||||
// use `xhr` and not `this`... thanks IE
|
||||
if (xhr.readyState === 4) {
|
||||
if (xhr.status === 200 || xhr.status === 0) {
|
||||
file = null;
|
||||
err = null;
|
||||
try {
|
||||
file = JSZipUtils._getBinaryFromXHR(xhr);
|
||||
} catch(e) {
|
||||
err = new Error(e);
|
||||
}
|
||||
callback(err, file);
|
||||
} else {
|
||||
callback(new Error("Ajax error for " + path + " : " + this.status + " " + this.statusText), null);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
|
||||
} catch (e) {
|
||||
callback(new Error(e), null);
|
||||
}
|
||||
};
|
||||
|
||||
// export
|
||||
module.exports = JSZipUtils;
|
||||
|
||||
// enforcing Stuk's coding style
|
||||
// vim: set shiftwidth=4 softtabstop=4:
|
||||
|
||||
},{}]},{},[1])
|
||||
(1)
|
||||
});
|
||||
;
|
10
assets/3rdparty/jszip-utils/jszip-utils.min.js
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
/*!
|
||||
|
||||
JSZipUtils - A collection of cross-browser utilities to go along with JSZip.
|
||||
<http://stuk.github.io/jszip-utils>
|
||||
|
||||
(c) 2014 Stuart Knightley, David Duponchel
|
||||
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown.
|
||||
|
||||
*/
|
||||
!function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.JSZipUtils=a():"undefined"!=typeof global?global.JSZipUtils=a():"undefined"!=typeof self&&(self.JSZipUtils=a())}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b){"use strict";function c(){try{return new window.XMLHttpRequest}catch(a){}}function d(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}}var e={};e._getBinaryFromXHR=function(a){return a.response||a.responseText};var f=window.ActiveXObject?function(){return c()||d()}:c;e.getBinaryContent=function(a,b){try{var c=f();c.open("GET",a,!0),"responseType"in c&&(c.responseType="arraybuffer"),c.overrideMimeType&&c.overrideMimeType("text/plain; charset=x-user-defined"),c.onreadystatechange=function(){var d,f;if(4===c.readyState)if(200===c.status||0===c.status){d=null,f=null;try{d=e._getBinaryFromXHR(c)}catch(g){f=new Error(g)}b(f,d)}else b(new Error("Ajax error for "+a+" : "+this.status+" "+this.statusText),null)},c.send()}catch(d){b(new Error(d),null)}},b.exports=e},{}]},{},[1])(1)});
|
11623
assets/3rdparty/jszip/jszip.js
vendored
Normal file
15
assets/3rdparty/jszip/jszip.min.js
vendored
Normal file
BIN
assets/3rdparty/pacman/BD_Cartoon_Shout-webfont.ttf
vendored
Normal file
13
assets/3rdparty/pacman/LICENSE
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
BIN
assets/3rdparty/pacman/audio/die.mp3
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/die.ogg
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/eatghost.mp3
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/eatghost.ogg
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/eating.mp3
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/eating.ogg
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/eating.short.mp3
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/eating.short.ogg
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/eatpill.mp3
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/eatpill.ogg
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/extra lives.mp3
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/extra lives.ogg
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/intermission.mp3
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/intermission.ogg
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/opening_song.mp3
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/opening_song.ogg
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/siren.mp3
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/siren.ogg
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/vcs_90.mp3
vendored
Normal file
BIN
assets/3rdparty/pacman/audio/vcs_90.ogg
vendored
Normal file
59
assets/3rdparty/pacman/index.html
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
<!--
|
||||
WTFPL License
|
||||
Origin: https://github.com/daleharvey/pacman
|
||||
--><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>HTML5 Pacman</title>
|
||||
|
||||
<style type="text/css">
|
||||
@font-face {
|
||||
font-family: 'BDCartoonShoutRegular';
|
||||
src: url('BD_Cartoon_Shout-webfont.ttf') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
#pacman {
|
||||
height:450px;
|
||||
width:342px;
|
||||
margin:0px auto;
|
||||
}
|
||||
#shim {
|
||||
font-family: BDCartoonShoutRegular;
|
||||
position:absolute;
|
||||
visibility:hidden
|
||||
}
|
||||
body {
|
||||
width:342px;
|
||||
margin:0px;
|
||||
font-family:sans-serif;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
<div id="pacman"></div>
|
||||
<script src="pacman.js"></script>
|
||||
<script src="modernizr-1.5.min.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
var el = document.getElementById("pacman");
|
||||
|
||||
if (Modernizr.canvas && Modernizr.localstorage &&
|
||||
Modernizr.audio && (Modernizr.audio.ogg || Modernizr.audio.mp3)) {
|
||||
window.setTimeout(function () { PACMAN.init(el, "./"); }, 0);
|
||||
} else {
|
||||
el.innerHTML = "Sorry, needs a decent browser<br /><small>" +
|
||||
"(firefox 3.6+, Chrome 4+, Opera 10+ and Safari 4+)</small>";
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
28
assets/3rdparty/pacman/modernizr-1.5.min.js
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
/*!
|
||||
* Modernizr JavaScript library 1.5
|
||||
* http://www.modernizr.com/
|
||||
*
|
||||
* Copyright (c) 2009-2010 Faruk Ates - http://farukat.es/
|
||||
* Dual-licensed under the BSD and MIT licenses.
|
||||
* http://www.modernizr.com/license/
|
||||
*
|
||||
* Featuring major contributions by
|
||||
* Paul Irish - http://paulirish.com
|
||||
*/
|
||||
window.Modernizr=function(i,e,I){function C(a,b){for(var c in a)if(m[a[c]]!==I&&(!b||b(a[c],D)))return true}function r(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1);return!!C([a,"Webkit"+c,"Moz"+c,"O"+c,"ms"+c,"Khtml"+c],b)}function P(){j[E]=function(a){for(var b=0,c=a.length;b<c;b++)J[a[b]]=!!(a[b]in n);return J}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));j[Q]=function(a){for(var b=0,c,h=a.length;b<h;b++){n.setAttribute("type",a[b]);if(c=n.type!==
|
||||
"text"){n.value=K;/tel|search/.test(n.type)||(c=/url|email/.test(n.type)?n.checkValidity&&n.checkValidity()===false:n.value!=K)}L[a[b]]=!!c}return L}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var j={},s=e.documentElement,D=e.createElement("modernizr"),m=D.style,n=e.createElement("input"),E="input",Q=E+"types",K=":)",M=Object.prototype.toString,y=" -o- -moz- -ms- -webkit- -khtml- ".split(" "),d={},L={},J={},N=[],u=function(){var a={select:"input",
|
||||
change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"},b={};return function(c,h){var t=arguments.length==1;if(t&&b[c])return b[c];h=h||document.createElement(a[c]||"div");c="on"+c;var g=c in h;if(!g&&h.setAttribute){h.setAttribute(c,"return;");g=typeof h[c]=="function"}h=null;return t?(b[c]=g):g}}(),F={}.hasOwnProperty,O;O=typeof F!=="undefined"&&typeof F.call!=="undefined"?function(a,b){return F.call(a,b)}:function(a,b){return b in a&&typeof a.constructor.prototype[b]==="undefined"};
|
||||
d.canvas=function(){return!!e.createElement("canvas").getContext};d.canvastext=function(){return!!(d.canvas()&&typeof e.createElement("canvas").getContext("2d").fillText=="function")};d.geolocation=function(){return!!navigator.geolocation};d.crosswindowmessaging=function(){return!!i.postMessage};d.websqldatabase=function(){var a=!!i.openDatabase;if(a)try{a=!!openDatabase("testdb","1.0","html5 test db",2E5)}catch(b){a=false}return a};d.indexedDB=function(){return!!i.indexedDB};d.hashchange=function(){return u("hashchange",
|
||||
i)&&(document.documentMode===I||document.documentMode>7)};d.historymanagement=function(){return!!(i.history&&history.pushState)};d.draganddrop=function(){return u("drag")&&u("dragstart")&&u("dragenter")&&u("dragover")&&u("dragleave")&&u("dragend")&&u("drop")};d.websockets=function(){return"WebSocket"in i};d.rgba=function(){m.cssText="background-color:rgba(150,255,150,.5)";return(""+m.backgroundColor).indexOf("rgba")!==-1};d.hsla=function(){m.cssText="background-color:hsla(120,40%,100%,.5)";return(""+
|
||||
m.backgroundColor).indexOf("rgba")!==-1};d.multiplebgs=function(){m.cssText="background:url(//:),url(//:),red url(//:)";return/(url\s*\(.*?){3}/.test(m.background)};d.backgroundsize=function(){return r("backgroundSize")};d.borderimage=function(){return r("borderImage")};d.borderradius=function(){return r("borderRadius","",function(a){return(""+a).indexOf("orderRadius")!==-1})};d.boxshadow=function(){return r("boxShadow")};d.opacity=function(){var a=y.join("opacity:.5;")+"";m.cssText=a;return(""+m.opacity).indexOf("0.5")!==
|
||||
-1};d.cssanimations=function(){return r("animationName")};d.csscolumns=function(){return r("columnCount")};d.cssgradients=function(){var a=("background-image:"+y.join("gradient(linear,left top,right bottom,from(#9f9),to(white));background-image:")+y.join("linear-gradient(left top,#9f9, white);background-image:")).slice(0,-17);m.cssText=a;return(""+m.backgroundImage).indexOf("gradient")!==-1};d.cssreflections=function(){return r("boxReflect")};d.csstransforms=function(){return!!C(["transformProperty",
|
||||
"WebkitTransform","MozTransform","OTransform","msTransform"])};d.csstransforms3d=function(){var a=!!C(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);if(a){var b=document.createElement("style"),c=e.createElement("div");b.textContent="@media ("+y.join("transform-3d),(")+"modernizr){#modernizr{height:3px}}";e.getElementsByTagName("head")[0].appendChild(b);c.id="modernizr";s.appendChild(c);a=c.offsetHeight===3;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}return a};
|
||||
d.csstransitions=function(){return r("transitionProperty")};d.fontface=function(){var a;if(/*@cc_on@if(@_jscript_version>=5)!@end@*/0)a=true;else{var b=e.createElement("style"),c=e.createElement("span"),h,t=false,g=e.body,o,w;b.textContent="@font-face{font-family:testfont;src:url('data:font/ttf;base64,AAEAAAAMAIAAAwBAT1MvMliohmwAAADMAAAAVmNtYXCp5qrBAAABJAAAANhjdnQgACICiAAAAfwAAAAEZ2FzcP//AAMAAAIAAAAACGdseWYv5OZoAAACCAAAANxoZWFk69bnvwAAAuQAAAA2aGhlYQUJAt8AAAMcAAAAJGhtdHgGDgC4AAADQAAAABRsb2NhAIQAwgAAA1QAAAAMbWF4cABVANgAAANgAAAAIG5hbWUgXduAAAADgAAABPVwb3N03NkzmgAACHgAAAA4AAECBAEsAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAACAAMDAAAAAAAAgAACbwAAAAoAAAAAAAAAAFBmRWQAAAAgqS8DM/8zAFwDMwDNAAAABQAAAAAAAAAAAAMAAAADAAAAHAABAAAAAABGAAMAAQAAAK4ABAAqAAAABgAEAAEAAgAuqQD//wAAAC6pAP///9ZXAwAAAAAAAAACAAAABgBoAAAAAAAvAAEAAAAAAAAAAAAAAAAAAAABAAIAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEACoAAAAGAAQAAQACAC6pAP//AAAALqkA////1lcDAAAAAAAAAAIAAAAiAogAAAAB//8AAgACACIAAAEyAqoAAwAHAC6xAQAvPLIHBADtMrEGBdw8sgMCAO0yALEDAC88sgUEAO0ysgcGAfw8sgECAO0yMxEhESczESMiARDuzMwCqv1WIgJmAAACAFUAAAIRAc0ADwAfAAATFRQWOwEyNj0BNCYrASIGARQGKwEiJj0BNDY7ATIWFX8aIvAiGhoi8CIaAZIoN/43KCg3/jcoAWD0JB4eJPQkHh7++EY2NkbVRjY2RgAAAAABAEH/+QCdAEEACQAANjQ2MzIWFAYjIkEeEA8fHw8QDxwWFhwWAAAAAQAAAAIAAIuYbWpfDzz1AAsEAAAAAADFn9IuAAAAAMWf0i797/8zA4gDMwAAAAgAAgAAAAAAAAABAAADM/8zAFwDx/3v/98DiAABAAAAAAAAAAAAAAAAAAAABQF2ACIAAAAAAVUAAAJmAFUA3QBBAAAAKgAqACoAWgBuAAEAAAAFAFAABwBUAAQAAgAAAAEAAQAAAEAALgADAAMAAAAQAMYAAQAAAAAAAACLAAAAAQAAAAAAAQAhAIsAAQAAAAAAAgAFAKwAAQAAAAAAAwBDALEAAQAAAAAABAAnAPQAAQAAAAAABQAKARsAAQAAAAAABgAmASUAAQAAAAAADgAaAUsAAwABBAkAAAEWAWUAAwABBAkAAQBCAnsAAwABBAkAAgAKAr0AAwABBAkAAwCGAscAAwABBAkABABOA00AAwABBAkABQAUA5sAAwABBAkABgBMA68AAwABBAkADgA0A/tDb3B5cmlnaHQgMjAwOSBieSBEYW5pZWwgSm9obnNvbi4gIFJlbGVhc2VkIHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgT3BlbiBGb250IExpY2Vuc2UuIEtheWFoIExpIGdseXBocyBhcmUgcmVsZWFzZWQgdW5kZXIgdGhlIEdQTCB2ZXJzaW9uIDMuYmFlYzJhOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhTGlnaHRiYWVjMmE5MmJmZmU1MDMyIC0gc3Vic2V0IG9mIEZvbnRGb3JnZSAyLjAgOiBKdXJhIExpZ2h0IDogMjMtMS0yMDA5YmFlYzJhOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhIExpZ2h0VmVyc2lvbiAyIGJhZWMyYTkyYmZmZTUwMzIgLSBzdWJzZXQgb2YgSnVyYUxpZ2h0aHR0cDovL3NjcmlwdHMuc2lsLm9yZy9PRkwAQwBvAHAAeQByAGkAZwBoAHQAIAAyADAAMAA5ACAAYgB5ACAARABhAG4AaQBlAGwAIABKAG8AaABuAHMAbwBuAC4AIAAgAFIAZQBsAGUAYQBzAGUAZAAgAHUAbgBkAGUAcgAgAHQAaABlACAAdABlAHIAbQBzACAAbwBmACAAdABoAGUAIABPAHAAZQBuACAARgBvAG4AdAAgAEwAaQBjAGUAbgBzAGUALgAgAEsAYQB5AGEAaAAgAEwAaQAgAGcAbAB5AHAAaABzACAAYQByAGUAIAByAGUAbABlAGEAcwBlAGQAIAB1AG4AZABlAHIAIAB0AGgAZQAgAEcAUABMACAAdgBlAHIAcwBpAG8AbgAgADMALgBiAGEAZQBjADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyACAALQAgAHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHIAYQBMAGkAZwBoAHQAYgBhAGUAYwAyAGEAOQAyAGIAZgBmAGUANQAwADMAMgAgAC0AIABzAHUAYgBzAGUAdAAgAG8AZgAgAEYAbwBuAHQARgBvAHIAZwBlACAAMgAuADAAIAA6ACAASgB1AHIAYQAgAEwAaQBnAGgAdAAgADoAIAAyADMALQAxAC0AMgAwADAAOQBiAGEAZQBjADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyACAALQAgAHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHIAYQAgAEwAaQBnAGgAdABWAGUAcgBzAGkAbwBuACAAMgAgAGIAYQBlAGMAMgBhADkAMgBiAGYAZgBlADUAMAAzADIAIAAtACAAcwB1AGIAcwBlAHQAIABvAGYAIABKAHUAcgBhAEwAaQBnAGgAdABoAHQAdABwADoALwAvAHMAYwByAGkAcAB0AHMALgBzAGkAbAAuAG8AcgBnAC8ATwBGAEwAAAAAAgAAAAAAAP+BADMAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAQACAQIAEQt6ZXJva2F5YWhsaQ==')}";
|
||||
e.getElementsByTagName("head")[0].appendChild(b);c.setAttribute("style","font:99px _,arial,helvetica;position:absolute;visibility:hidden");if(!g){g=s.appendChild(e.createElement("fontface"));t=true}c.innerHTML="........";c.id="fonttest";g.appendChild(c);h=c.offsetWidth*c.offsetHeight;c.style.font="99px testfont,_,arial,helvetica";a=h!==c.offsetWidth*c.offsetHeight;var v=function(){if(g.parentNode){a=j.fontface=h!==c.offsetWidth*c.offsetHeight;s.className=s.className.replace(/(no-)?fontface\b/,"")+
|
||||
(a?" ":" no-")+"fontface"}};setTimeout(v,75);setTimeout(v,150);addEventListener("load",function(){v();(w=true)&&o&&o(a);setTimeout(function(){t||(g=c);g.parentNode.removeChild(g);b.parentNode.removeChild(b)},50)},false)}j._fontfaceready=function(p){w||a?p(a):(o=p)};return a||h!==c.offsetWidth};d.video=function(){var a=e.createElement("video"),b=!!a.canPlayType;if(b){b=new Boolean(b);b.ogg=a.canPlayType('video/ogg; codecs="theora"');b.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"');b.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return b};
|
||||
d.audio=function(){var a=e.createElement("audio"),b=!!a.canPlayType;if(b){b=new Boolean(b);b.ogg=a.canPlayType('audio/ogg; codecs="vorbis"');b.mp3=a.canPlayType("audio/mpeg;");b.wav=a.canPlayType('audio/wav; codecs="1"');b.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")}return b};d.localStorage=function(){return"localStorage"in i&&i.localStorage!==null};d.sessionStorage=function(){try{return"sessionStorage"in i&&i.sessionStorage!==null}catch(a){return false}};d.webworkers=function(){return!!i.Worker};
|
||||
d.applicationCache=function(){var a=i.applicationCache;return!!(a&&typeof a.status!="undefined"&&typeof a.update=="function"&&typeof a.swapCache=="function")};d.svg=function(){return!!e.createElementNS&&!!e.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect};d.smil=function(){return!!e.createElementNS&&/SVG/.test(M.call(e.createElementNS("http://www.w3.org/2000/svg","animate")))};d.svgclippaths=function(){return!!e.createElementNS&&/SVG/.test(M.call(e.createElementNS("http://www.w3.org/2000/svg",
|
||||
"clipPath")))};for(var z in d)if(O(d,z))N.push(((j[z.toLowerCase()]=d[z]())?"":"no-")+z.toLowerCase());j[E]||P();j.addTest=function(a,b){a=a.toLowerCase();if(!j[a]){b=!!b();s.className+=" "+(b?"":"no-")+a;j[a]=b;return j}};m.cssText="";D=n=null;(function(){var a=e.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1})()&&function(a,b){function c(f,k){if(o[f])o[f].styleSheet.cssText+=k;else{var l=t[G],q=b[A]("style");q.media=f;l.insertBefore(q,l[G]);o[f]=q;c(f,k)}}function h(f,
|
||||
k){for(var l=new RegExp("\\b("+w+")\\b(?!.*[;}])","gi"),q=function(B){return".iepp_"+B},x=-1;++x<f.length;){k=f[x].media||k;h(f[x].imports,k);c(k,f[x].cssText.replace(l,q))}}for(var t=b.documentElement,g=b.createDocumentFragment(),o={},w="abbr|article|aside|audio|canvas|command|datalist|details|figure|figcaption|footer|header|hgroup|keygen|mark|meter|nav|output|progress|section|source|summary|time|video",v=w.split("|"),p=[],H=-1,G="firstChild",A="createElement";++H<v.length;){b[A](v[H]);g[A](v[H])}g=
|
||||
g.appendChild(b[A]("div"));a.attachEvent("onbeforeprint",function(){for(var f,k=b.getElementsByTagName("*"),l,q,x=new RegExp("^"+w+"$","i"),B=-1;++B<k.length;)if((f=k[B])&&(q=f.nodeName.match(x))){l=new RegExp("^\\s*<"+q+"(.*)\\/"+q+">\\s*$","i");g.innerHTML=f.outerHTML.replace(/\r|\n/g," ").replace(l,f.currentStyle.display=="block"?"<div$1/div>":"<span$1/span>");l=g.childNodes[0];l.className+=" iepp_"+q;l=p[p.length]=[f,l];f.parentNode.replaceChild(l[1],l[0])}h(b.styleSheets,"all")});a.attachEvent("onafterprint",
|
||||
function(){for(var f=-1,k;++f<p.length;)p[f][1].parentNode.replaceChild(p[f][0],p[f][1]);for(k in o)t[G].removeChild(o[k]);o={};p=[]})}(this,e);j._enableHTML5=true;j._version="1.5";s.className=s.className.replace(/\bno-js\b/,"")+" js";s.className+=" "+N.join(" ");return j}(this,this.document);
|
1270
assets/3rdparty/pacman/pacman.js
vendored
Normal file
3
assets/3rdparty/sceditor/formats/bbcode.js
vendored
Normal file
3
assets/3rdparty/sceditor/formats/xhtml.js
vendored
Normal file
3
assets/3rdparty/sceditor/icons/material.js
vendored
Normal file
3
assets/3rdparty/sceditor/icons/monocons.js
vendored
Normal file
3
assets/3rdparty/sceditor/jquery.sceditor.bbcode.min.js
vendored
Normal file
3
assets/3rdparty/sceditor/jquery.sceditor.min.js
vendored
Normal file
3
assets/3rdparty/sceditor/jquery.sceditor.xhtml.min.js
vendored
Normal file
3
assets/3rdparty/sceditor/plugins/autosave.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/* SCEditor v2.1.3 | (C) 2017, Sam Clarke | sceditor.com/license */
|
||||
|
||||
!function(e){"use strict";var t="sce-autodraft-"+location.pathname+location.search;function i(e){localStorage.removeItem(e||t)}e.plugins.autosave=function(){var a,e=this,o=t,r=864e5,n=function(e){localStorage.setItem(o,JSON.stringify(e))},s=function(){return JSON.parse(localStorage.getItem(o))};e.init=function(){var e=(a=this).opts&&a.opts.autosave||{};n=e.save||n,s=e.load||s,o=e.storageKey||o,r=e.expires||r,function(){for(var e=0;e<localStorage.length;e++){var t=localStorage.key(e);if(/^sce\-autodraft\-/.test(t)){var a=JSON.parse(localStorage.getItem(o));a&&a.time<Date.now()-r&&i(t)}}}()},e.signalReady=function(){for(var e=a.getContentAreaContainer();e;){if(/form/i.test(e.nodeName)){e.addEventListener("submit",i.bind(null,o),!0);break}e=e.parentNode}var t=s();t&&(a.sourceMode(t.sourceMode),a.val(t.value,!1),a.focus(),t.sourceMode?a.sourceEditorCaret(t.caret):a.getRangeHelper().restoreRange()),n({caret:this.sourceEditorCaret(),sourceMode:this.sourceMode(),value:a.val(null,!1),time:Date.now()})},e.signalValuechangedEvent=function(e){n({caret:this.sourceEditorCaret(),sourceMode:this.sourceMode(),value:e.detail.rawValue,time:Date.now()})}},e.plugins.autosave.clear=i}(sceditor);
|
3
assets/3rdparty/sceditor/plugins/autoyoutube.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/* SCEditor v2.1.3 | (C) 2017, Sam Clarke | sceditor.com/license */
|
||||
|
||||
!function(u,e){"use strict";var a=e.dom,c=/(^|\s)(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/watch\?v=)([^"&?\/ ]{11})(?:\&[\&_\?0-9a-z\#]+)?(\s|$)/i;e.plugins.autoyoutube=function(){this.signalPasteRaw=function(e){if(!a.closest(this.currentNode(),"code")&&(e.html||e.text)){var t=u.createElement("div");e.html?t.innerHTML=e.html:t.textContent=e.text,function e(t){for(var o,n=t.firstChild;n;){if(3===n.nodeType){var i=n.nodeValue,r=n.parentNode,s=i.match(c);s&&(r.insertBefore(u.createTextNode(i.substr(0,s.index)+s[1]),n),r.insertBefore(a.parseHTML('<iframe width="560" height="315" frameborder="0" src="https://www.youtube-nocookie.com/embed/'+(o=s[2])+'" data-youtube-id="'+o+'" allowfullscreen></iframe>'),n),n.nodeValue=s[3]+i.substr(s.index+s[0].length))}else a.is(n,"code")||e(n);n=n.nextSibling}}(t),e.html=t.innerHTML}}}}(document,sceditor);
|
3
assets/3rdparty/sceditor/plugins/dragdrop.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/* SCEditor v2.1.3 | (C) 2017, Sam Clarke | sceditor.com/license */
|
||||
|
||||
!function(n){"use strict";var v="data:image/gif;base64,R0lGODlhlgBkAPABAH19ffb29iH5BAAKAAAAIf4aQ3JlYXRlZCB3aXRoIGFqYXhsb2FkLmluZm8AIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAlgBkAAAC1YyPqcvtD6OctNqLs968+w+G4kiW5omm6sq27gvH8kzX9o3n+s73/g8MCofEovGITCqXzKbzCY1Kp9Sq9YrNarfcrvcLDovH5LL5jE6r1+y2+w2Py+f0uv2OvwD2fP6iD/gH6Pc2GIhg2JeQSNjGuLf4GMlYKIloefAIUEl52ZmJyaY5mUhqyFnqmQr6KRoaMKp66hbLumpQ69oK+5qrOyg4a6qYV2x8jJysvMzc7PwMHS09TV1tfY2drb3N3e39DR4uPk5ebn6Onq6+zt7u/g4fL99UAAAh+QQACgAAACwAAAAAlgBkAIEAAAB9fX329vYAAAAC3JSPqcvtD6OctNqLs968+w+G4kiW5omm6sq27gvH8kzX9o3n+s73/g8MCofEovGITCqXzKbzCY1Kp9Sq9YrNarfcrvcLDovH5LL5jE6r1+y2+w2Py+f0uv2OvwD2fP4iABgY+CcoCNeHuJdQyLjIaOiWiOj4CEhZ+SbZd/nI2RipqYhQOThKGpAZCuBZyArZprpqSupaCqtaazmLCRqai7rb2av5W5wqSShcm8fc7PwMHS09TV1tfY2drb3N3e39DR4uPk5ebn6Onq6+zt7u/g4fLz9PX29/j5/vVAAAIfkEAAoAAAAsAAAAAJYAZACBAAAAfX199vb2AAAAAuCUj6nL7Q+jnLTai7PevPsPhuJIluaJpurKtu4Lx/JM1/aN5/rO9/4PDAqHxKLxiEwql8ym8wmNSqfUqvWKzWq33K73Cw6Lx+Sy+YxOq9fstvsNj8vn9Lr9jr8E9nz+AgAYGLjQVwhXiJgguAiYgGjo9tinyCjoKLn3hpmJUGmJsBmguUnpCXCJOZraaXoKShoJe9DqehCqKlnqiZobuzrbyvuIO8xqKpxIPKlwrPCbBx0tPU1dbX2Nna29zd3t/Q0eLj5OXm5+jp6uvs7e7v4OHy8/T19vf4+fr7/P379UAAAh+QQACgAAACwAAAAAlgBkAIEAAAB9fX329vYAAAAC4JSPqcvtD6OctNqLs968+w+G4kiW5omm6sq27gvH8kzX9o3n+s73/g8MCofEovGITCqXzKbzCY1Kp9Sq9YrNarfcrvcLDovH5LL5jE6r1+y2+w2Py+f0uv2OvwT2fP6iD7gAMEhICAeImIAYiFDoOPi22KcouZfw6BhZGUBZeYlp6LbJiTD6CQqg6Vm6eQqqKtkZ24iaKtrKunpQa9tmmju7Wwu7KFtMi3oYDMzompkHHS09TV1tfY2drb3N3e39DR4uPk5ebn6Onq6+zt7u/g4fLz9PX29/j5+vv8/f31QAADs=",c=void 0!==window.FileReader,u=/data:[^;]+;base64,/i;function g(e){for(var t=e.substr(5,e.indexOf(";")-5),n=atob(e.substr(e.indexOf(",")+1)),r=new Uint8Array(n.length),i=0;i<n.length;i++)r[i]=n[i].charCodeAt(0);try{return new Blob([r],{type:t})}catch(e){return null}}n.plugins.dragdrop=function(){if(c){var A,r,o,i,a,s=0;this.signalReady=function(){A=(r=this).opts.dragdrop||{},o=A.handleFile,i=r.getContentAreaContainer().parentNode,a=i.appendChild(n.dom.parseHTML('<div class="sceditor-dnd-cover" style="display: none"><p>'+r._("Drop files here")+"</p></div>").firstChild),i.addEventListener("dragover",e),i.addEventListener("dragleave",d),i.addEventListener("dragend",d),i.addEventListener("drop",t),r.getBody().addEventListener("dragover",e),r.getBody().addEventListener("drop",d)},this.signalPasteHtml=function(e){if(!("handlePaste"in A)||A.handlePaste){var t=document.createElement("div");t.innerHTML=e.val;for(var n=t.querySelectorAll("img"),r=0;r<n.length;r++){var i=n[r];if(u.test(i.src)){var a=g(i.src);a&&l(a)?o(a,f(i)):i.parentNode.removeChild(i)}}e.val=t.innerHTML}}}function d(){a.style.display="none",i.className=i.className.replace(/(^| )dnd( |$)/g,"")}function l(e){return!("application/x-moz-file"!==e.type&&A.allowedTypes&&A.allowedTypes.indexOf(e.type)<0)&&(!A.isAllowed||A.isAllowed(e))}function f(e){var n=document.createElement("img");function t(e){var t=r.getBody().ownerDocument.getElementById(n.id);t&&("string"==typeof e&&t.insertAdjacentHTML("afterend",e),t.parentNode.removeChild(t))}return n.src=v,n.className="sceditor-ignore",n.id="sce-dragdrop-"+s++,function(){return e?e.parentNode.replaceChild(n,e):r.wysiwygEditorInsertHtml(n.outerHTML),{insert:function(e){t(e)},cancel:t}}}function e(e){for(var t=e.dataTransfer,n=t.files.length||!t.items?t.files:t.items,r=0;r<n.length;r++)if("string"===n[r].kind)return;"none"===a.style.display&&(a.style.display="block",i.className+=" dnd"),e.preventDefault()}function t(e){var t=e.dataTransfer,n=t.files.length||!t.items?t.files:t.items;d();for(var r=0;r<n.length;r++){if("string"===n[r].kind)return;l(n[r])&&o(n[r],f())}e.preventDefault()}}}(sceditor);
|
3
assets/3rdparty/sceditor/plugins/format.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/* SCEditor v2.1.3 | (C) 2017, Sam Clarke | sceditor.com/license */
|
||||
|
||||
!function(i){"use strict";i.plugins.format=function(){var n,a,c={p:"Paragraph",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",address:"Address",pre:"Preformatted Text"};this.init=function(){var e=this.opts,t=e.paragraphformat;e.format&&"bbcode"===e.format||(t&&(t.tags&&(c=t.tags),t.excludeTags&&t.excludeTags.forEach(function(e){delete c[e]})),this.commands.format||(this.commands.format={exec:a,txtExec:a,tooltip:"Format Paragraph"}),e.toolbar===i.defaultOptions.toolbar&&(e.toolbar=e.toolbar.replace(",color,",",color,format,")))},n=function(e,t){e.sourceMode()?e.insert("<"+t+">","</"+t+">"):e.execCommand("formatblock","<"+t+">")},a=function(e){var o=this,r=document.createElement("div");i.utils.each(c,function(t,a){var e=document.createElement("a");e.className="sceditor-option",e.textContent=a.name||a,e.addEventListener("click",function(e){o.closeDropDown(!0),a.exec?a.exec(o):n(o,t),e.preventDefault()}),r.appendChild(e)}),o.createDropDown(e,"format",r)}}}(sceditor);
|
3
assets/3rdparty/sceditor/plugins/plaintext.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/* SCEditor v2.1.3 | (C) 2017, Sam Clarke | sceditor.com/license */
|
||||
|
||||
!function(t){"use strict";var i=t.utils.extend;t.plugins.plaintext=function(){var e=!0;this.init=function(){var t=this.commands,n=this.opts;n&&n.plaintext&&n.plaintext.addButton&&(e=n.plaintext.enabled,t.pastetext=i(t.pastetext||{},{state:function(){return e?1:0},exec:function(){e=!e}}))},this.signalPasteRaw=function(t){if(e){if(t.html&&!t.text){var n=document.createElement("div");n.innerHTML=t.html,t.text=n.innerText}t.html=null}}}}(sceditor);
|
2
assets/3rdparty/sceditor/plugins/strictbbcode.js
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/* SCEditor v2.1.3 | (C) 2017, Sam Clarke | sceditor.com/license */
|
||||
|
3
assets/3rdparty/sceditor/plugins/undo.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/* SCEditor v2.1.3 | (C) 2017, Sam Clarke | sceditor.com/license */
|
||||
|
||||
!function(e){"use strict";sceditor.plugins.undo=function(){var r,o,e=this,u=0,a=50,n=[],c=[],s=!1,l=function(e){s=!0,o=e.value,r.sourceMode(e.sourceMode),r.val(e.value,!1),r.focus(),e.sourceMode?r.sourceEditorCaret(e.caret):r.getRangeHelper().restoreRange(),s=!1};e.init=function(){a=(r=this).undoLimit||a,r.addShortcut("ctrl+z",e.undo),r.addShortcut("ctrl+shift+z",e.redo),r.addShortcut("ctrl+y",e.redo)},e.undo=function(){var e=c.pop(),t=r.val(null,!1);return e&&!n.length&&t===e.value&&(e=c.pop()),e&&(n.length||n.push({caret:r.sourceEditorCaret(),sourceMode:r.sourceMode(),value:t}),n.push(e),l(e)),!1},e.redo=function(){var e=n.pop();return c.length||(c.push(e),e=n.pop()),e&&(c.push(e),l(e)),!1},e.signalReady=function(){var e=r.val(null,!1);o=e,c.push({caret:this.sourceEditorCaret(),sourceMode:this.sourceMode(),value:e})},e.signalValuechangedEvent=function(e){var t=e.detail.rawValue;0<a&&c.length>a&&c.shift(),!s&&o&&o!==t&&(n.length=0,(u+=function(e,t){var r,o,u,a,n=e.length,c=t.length,s=Math.max(n,c);for(r=0;r<s&&e.charAt(r)===t.charAt(r);r++);for(u=n<c?c-n:0,a=c<n?n-c:0,o=s-1;0<=o&&e.charAt(o-u)===t.charAt(o-a);o--);return o-r+1}(o,t))<20||u<50&&!/\s$/g.test(e.rawValue)||(c.push({caret:r.sourceEditorCaret(),sourceMode:r.sourceMode(),value:t}),u=0,o=t))}}}();
|
3
assets/3rdparty/sceditor/plugins/v1compat.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/* SCEditor v2.1.3 | (C) 2017, Sam Clarke | sceditor.com/license */
|
||||
|
||||
!function(t,r){"use strict";var e=t.plugins;function n(c){if(c._scePatched)return c;var t=function(){for(var t=[],e=0;e<arguments.length;e++){var n=arguments[e];n&&n.nodeType?t.push(r(n)):t.push(n)}return c.apply(this,t)};return t._scePatched=!0,t}function c(t){if(t._scePatched)return t;var e=function(){return r(t.apply(this,arguments))};return e._scePatched=!0,e}var o=t.command.set;if(t.command.set=function(t,e){return e&&"function"==typeof e.exec&&(e.exec=n(e.exec)),e&&"function"==typeof e.txtExec&&(e.txtExec=n(e.txtExec)),o.call(this,t,e)},e.bbcode){var a=e.bbcode.bbcode.set;e.bbcode.bbcode.set=function(t,e){return e&&"function"==typeof e.format&&(e.format=n(e.format)),a.call(this,t,e)}}var i=t.create;t.create=function(t,e){if(i.call(this,t,e),t&&t._sceditor){var n=t._sceditor;n.getBody=c(n.getBody),n.getContentAreaContainer=c(n.getContentAreaContainer)}}}(sceditor,jQuery);
|
3
assets/3rdparty/sceditor/sceditor.min.js
vendored
Normal file
1
assets/3rdparty/sceditor/themes/content/default.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
/*! SCEditor | (C) 2011-2013, Sam Clarke | sceditor.com/license */body,code:before,html,p,table{margin:0;padding:0;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;color:#111;line-height:1.25;overflow:visible}html{height:100%}.ios{overflow:auto;-webkit-overflow-scrolling:touch}.ios body{position:relative;overflow:auto}body{min-height:100%;word-wrap:break-word}body.placeholder::before{content:attr(placeholder);color:#555;font-style:italic}ol,ul{margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0}table,td{border:1px dotted #000;empty-cells:show}table td{min-width:5px}code{display:block;background:#f1f1f1;white-space:pre;padding:1em;text-align:left;margin:.25em 0;direction:ltr}blockquote{background:#fff7d9;margin:.25em 0;border-left:.3em solid #f4e59f;padding:.5em .5em .5em .75em}blockquote cite{font-weight:700;display:block;font-size:1em;margin:0 -.5em .25em -.75em;padding:0 .5em .15em .75em;border-bottom:1px solid #f4e59f}h1,h2,h3,h4,h5,h6{padding:0;margin:0}div,p{min-height:1.25em}
|
1
assets/3rdparty/sceditor/themes/default.min.css
vendored
Normal file
1
assets/3rdparty/sceditor/themes/defaultdark.min.css
vendored
Normal file
BIN
assets/3rdparty/sceditor/themes/famfamfam.png
vendored
Normal file
After Width: | Height: | Size: 4.5 KiB |