').html(html).html();
- // fixme: this converts '"' to '"'
- return Ox.element('
').html(html).html();
- }
-
-}());
-
-Ox.parseURL = (function() {
- // fixme: leak memory, like now, or create every time? ... benchmark??
- var a = document.createElement('a'),
- keys = ['hash', 'host', 'hostname', 'origin',
- 'pathname', 'port', 'protocol', 'search'];
- return function(str) {
- var ret = {};
- a.href = str;
- keys.forEach(function(key) {
- ret[key] = a[key];
- });
- return ret;
- };
-}());
-
-Ox.parseURLs = function(html) {
- return html.replace(
- /\b((https?:\/\/|www\.).+?)([\.,:;!\?\)\]]*?(\s|$))/gi,
- function(str, url, pre, end) {
- url = (pre == 'www.' ? 'http://' : '' ) + url;
- return Ox.formatString(
- '
{host}{end}',
- {
- end: end,
- host: Ox.parseURL(url).hostname,
- url: url
- }
- );
- }
- );
-};
-
-/*
-================================================================================
-Math functions
-================================================================================
-*/
-
-Ox.asinh = function(x) {
- /*
- fixme: no test
- */
- return Math.log(x + Math.sqrt(x * x + 1));
-};
-
-Ox.deg = function(rad) {
- /*
- >>> Ox.deg(2 * Math.PI)
- 360
- */
- return rad * 180 / Math.PI;
-};
-
-Ox.divideInt = function(num, by) {
- /*
- >>> Ox.divideInt(100, 3)
- [33, 33, 34]
- >>> Ox.divideInt(100, 6)
- [16, 16, 17, 17, 17, 17]
- */
- var arr = [],
- div = parseInt(num / by),
- mod = num % by,
- i;
- for (i = 0; i < by; i++) {
- arr[i] = div + (i > by - 1 - mod);
- }
- return arr;
-}
-
-Ox.limit = function(num, min, max) {
- /*
- >>> Ox.limit(1, 2, 3)
- 2
- >>> Ox.limit(2, 1)
- 1
- */
- var len = arguments.length;
- max = arguments[len - 1];
- min = len == 3 ? min : 0;
- return Math.min(Math.max(num, min), max);
-};
-
-Ox.log = function(num, base) {
- /*
- >>> Ox.log(100, 10)
- 2
- >>> Ox.log(Math.E)
- 1
- */
- return Math.log(num) / Math.log(base || Math.E);
-};
-
-Ox.mod = function(num, by) {
- /*
- >>> Ox.mod(11, 10)
- 1
- >>> Ox.mod(-11, 10)
- 9
- */
- var mod = num % by;
- return mod >= 0 ? mod : mod + by;
-};
-
-Ox.rad = function(deg) {
- /*
- >>> Ox.rad(360)
- 2 * Math.PI
- */
- return deg * Math.PI / 180;
-};
-
-Ox.random = function() {
- /*
- >>> Ox.random(3) in {0: 0, 1: 0, 2: 0, 3: 0}
- true
- >>> Ox.random(1, 2) in {1: 0, 2: 0}
- true
- */
- var len = arguments.length,
- min = len == 1 ? 0 : arguments[0],
- max = arguments[len - 1];
- return min + parseInt(Math.random() * (max - min + 1));
-};
-
-Ox.round = function(num, dec) {
- /*
- >>> Ox.round(2 / 3, 6)
- 0.666667
- >>> Ox.round(1 / 2, 3)
- 0.5
- */
- var pow = Math.pow(10, dec || 0);
- return Math.round(num * pow) / pow;
-};
-
-Ox.sinh = function(x) {
- /*
- fixme: no test
- */
- return (Math.exp(x) - Math.exp(-x)) / 2;
-};
-
-Ox.MAX_LATITUDE = Ox.deg(Math.atan(Ox.sinh(Math.PI)));
-Ox.MIN_LATITUDE = -Ox.MAX_LATITUDE;
-
-/*
-================================================================================
-RegExp functions
-================================================================================
-*/
-
-Ox.regexp = {
- 'accents': '¨´`ˆ˜',
- 'letters': 'a-z¨´`ˆ˜äåáà âãæçëéèèñïÃìîöóòôõøœßúùûÿ'
-};
-
-/*
-================================================================================
-String functions
-================================================================================
-*/
-
-Ox.basename = function(str) {
- /*
- fixme: this should go into Path functions
- >>> Ox.basename("foo/bar/foo.bar")
- "foo.bar"
- >>> Ox.basename("foo.bar")
- "foo.bar"
- */
- return str.replace(/^.*[\/\\]/g, '');
-};
-
-Ox.char = String.fromCharCode;
-
-Ox.clean = function(str) {
- /*
- >>> Ox.clean("foo bar")
- "foo bar"
- >>> Ox.clean(" foo bar ")
- "foo bar"
- >>> Ox.clean(" foo \n bar ")
- "foo\nbar"
- */
- return Ox.map(str.split('\n'), function(str) {
- return Ox.trim(str.replace(/\s+/g, ' '));
- }).join('\n');
-};
-
-Ox.contains = function(str, chr) {
- /*
- >>> Ox.contains("foo", "bar")
- false
- >>> Ox.contains("foobar", "bar")
- true
- */
- return str.indexOf(chr) > -1;
-};
-
-Ox.endsWith = function(str, sub) {
- /*
- >>> Ox.endsWith("foobar", "bar")
- true
- */
- return str.toString().substr(-sub.length) === sub;
-};
-
-Ox.highlight = function(txt, str) {
- // fixme: move to ox.ui
- return str ? txt.replace(
- new RegExp('(' + str + ')', 'ig'),
- '
$1'
- ) : txt;
-};
-
-Ox.isValidEmail = function(str) {
- /*
- >>> Ox.isValidEmail("foo@bar.com")
- true
- >>> Ox.isValidEmail("foo.bar@foobar.co.uk")
- true
- >>> Ox.isValidEmail("foo@bar")
- false
- */
- return !!/^[0-9A-Z\.\+\-_]+@(?:[0-9A-Z\-]+\.)+[A-Z]{2,6}$/i(str);
-}
-
-Ox.pad = function(str, len, pad, pos) {
- /*
- >>> Ox.pad(1, 2)
- "01"
- >>> Ox.pad("abc", 6, ".", "right")
- "abc..."
- >>> Ox.pad("foobar", 3, ".", "right")
- "foo"
- >>> Ox.pad("abc", 6, "123456", "right")
- "abc123"
- >>> Ox.pad("abc", 6, "123456", "left")
- "456abc"
- */
- str = str.toString().substr(0, len);
- pad = Ox.repeat(pad || "0", len - str.length);
- pos = pos || "left";
- str = pos == "left" ? pad + str : str + pad;
- str = pos == "left" ?
- str.substr(str.length - len, str.length) :
- str.substr(0, len);
- return str;
-};
-
-Ox.repeat = function(str, num) {
- /*
- fixme: make this work for arrays, like in python
- >>> Ox.repeat(1, 3)
- "111"
- >>> Ox.repeat("foo", 3)
- "foofoofoo"
- */
- return num >= 1 ? new Array(num + 1).join(str.toString()) : '';
-};
-
-Ox.reverse = function(str) {
- /*
- Ox.reverse("foo")
- oof
- */
- return str.toString().split('').reverse().join('');
-};
-
-Ox.startsWith = function(str, sub) {
- /*
- >>> Ox.startsWith("foobar", "foo")
- true
- */
- return str.toString().substr(0, sub.length) === sub;
-};
-
-Ox.stripTags = function(str) {
- /*
- >>> Ox.stripTags("f
oo")
- "foo"
- */
- return str.replace(/(<.*?>)/gi, '');
-};
-
-Ox.substr = function(str, start, stop) {
- /***
- Ox.substr behaves like str[start:stop] in Python
- (or like str.substring() with negative values for stop)
- not implemented
- >>> Ox.substr('foobar', 1)
- "oobar"
- >>> Ox.substr('foobar', -1)
- "r"
- >>> Ox.substr('foobar', 1, 3)
- "oo"
- >>> Ox.substr('foobar', -3, 5)
- "ba"
- >>> Ox.substr('foobar', 1, -2)
- "oob"
- >>> Ox.substr('foobar', -4, -1)
- "oba"
- ***/
- stop = Ox.isUndefined(stop) ? str.length : stop;
- return str.substring(
- start < 0 ? str.length + start : start,
- stop < 0 ? str.length + stop : stop
- );
-};
-
-Ox.toCamelCase = function(str) {
- /*
- >>> Ox.toCamelCase("foo-bar-baz")
- "fooBarBaz"
- >>> Ox.toCamelCase("foo/bar/baz")
- "fooBarBaz"
- >>> Ox.toCamelCase("foo_bar_baz")
- "fooBarBaz"
- */
- return str.replace(/[\-_\/][a-z]/g, function(str) {
- return str[1].toUpperCase();
- });
-};
-
-Ox.toDashes = function(str) {
- /*
- >>> Ox.toDashes("fooBarBaz")
- "foo-bar-baz"
- */
- return str.replace(/[A-Z]/g, function(str) {
- return '-' + str.toLowerCase();
- });
-};
-
-Ox.toSlashes = function(str) {
- /*
- >>> Ox.toSlashes("fooBarBaz")
- "foo/bar/baz"
- */
- return str.replace(/[A-Z]/g, function(str) {
- return '/' + str.toLowerCase();
- });
-};
-
-Ox.toTitleCase = function(str) {
- /*
- >>> Ox.toTitleCase("foo")
- "Foo"
- >>> Ox.toTitleCase("Apple releases iPhone, IBM stock plummets")
- "Apple Releases iPhone, IBM Stock Plummets"
- */
- return Ox.map(str.split(' '), function(v) {
- var sub = v.substr(1),
- low = sub.toLowerCase();
- if (sub == low) {
- v = v.substr(0, 1).toUpperCase() + low;
- }
- return v;
- }).join(" ");
-};
-
-Ox.toUnderscores = function(str) {
- /*
- >>> Ox.toUnderscores("fooBarBaz")
- "foo_bar_baz"
- */
- return str.replace(/[A-Z]/g, function(str) {
- return '_' + str.toLowerCase();
- });
-};
-
-Ox.trim = function(str) { // is in jQuery
- /*
- Ox.trim(" foo ")
- "foo"
- */
- return str.replace(/^\s+|\s+$/g, "");
-};
-
-Ox.truncate = function(str, len, pad, pos) {
- /*
- >>> Ox.truncate("anticonstitutionellement", 16, "...", "center")
- "anticon...lement"
- */
- var pad = pad || {},
- pos = pos || "right",
- strlen = str.length,
- padlen = pad.length,
- left, right;
- if (strlen > len) {
- if (pos == "left") {
- str = pad + str.substr(padlen + strlen - len);
- } else if (pos == "center") {
- left = Math.ceil((len - padlen) / 2);
- right = Math.floor((len - padlen) / 2);
- str = str.substr(0, left) + pad + str.substr(-right);
- } else if (pos == "right") {
- str = str.substr(0, len - padlen) + pad;
- }
- }
- return str;
-};
-
-Ox.words = function(str) {
- /*
- >>> Ox.words('He\'s referring to the "ill-conceived" AOL/TimeWarner merger--didn\'t you know?')
- ['he\'s', 'referring', 'to' , 'the' , 'ill-conceived' , 'aol', 'timewarner' , 'merger' , 'didn\'t', 'you', 'know']
- */
- var arr = str.toLowerCase().split(/\b/),
- chr = "-'",
- len = arr.length,
- startsWithWord = !!/\w/(arr[0]);
- arr.forEach(function(v, i) {
- // find single occurrences of chars in chr
- // that are not at the beginning or end of str
- // and join the surrounding words with them
- if (
- i > 0 && i < len - 1 &&
- v.length == 1 && chr.indexOf(v) > -1
- ) {
- arr[i + 1] = arr[i - 1] + arr[i] + arr[i + 1];
- arr[i - 1] = arr[i] = '';
- }
- });
- // remove elements that have been emptied above
- arr = arr.filter(function(v) {
- return v.length;
- });
- // return words, not spaces or punctuation
- return arr.filter(function(v, i) {
- return i % 2 == !startsWithWord;
- });
-}
-
-Ox.wordwrap = function(str, len, sep, bal, spa) {
- /*
- >>> Ox.wordwrap("Anticonstitutionellement, Paris s'eveille", 25, "
")
- "Anticonstitutionellement,
Paris s'eveille"
- >>> Ox.wordwrap("Anticonstitutionellement, Paris s'eveille", 16, "
")
- "Anticonstitution
ellement, Paris
s'eveille"
- >>> Ox.wordwrap("These are short words", 16, "
", true)
- "These are
short words"
- */
- var str = str === null ? '' : str.toString(),
- len = len || 80,
- sep = sep || "
",
- bal = bal || false,
- spa = Ox.isUndefined(spa) ? true : spa,
- words = str.split(" "),
- lines;
- if (bal) {
- // balance lines: test if same number of lines
- // can be achieved with a shorter line length
- lines = Ox.wordwrap(str, len, sep, false).split(sep);
- if (lines.length > 1) {
- // test shorter line, unless
- // that means cutting a word
- var max = Ox.max(Ox.map(words, function(word) {
- return word.length;
- }));
- while (len > max) {
- len--;
- if (Ox.wordwrap(str, len, sep, false).split(sep).length > lines.length) {
- len++;
- break;
- }
- }
- }
- }
- lines = [""];
- Ox.forEach(words, function(word) {
- if ((lines[lines.length - 1] + word + " ").length <= len + 1) {
- // word fits in current line
- lines[lines.length - 1] += word + " ";
- } else {
- if (word.length <= len) {
- // word fits in next line
- lines.push(word + " ");
- } else {
- // word is longer than line
- var chr = len - lines[lines.length - 1].length;
- lines[lines.length - 1] += word.substr(0, chr);
- for (var pos = chr; pos < word.length; pos += len) {
- lines.push(word.substr(pos, len));
- }
- lines[lines.length - 1] += " ";
- }
- }
- });
- if (!spa) {
- lines = Ox.map(lines, function(line) {
- return Ox.trim(line);
- });
- }
- return Ox.trim(lines.join(sep));
-};
-
-/*
-================================================================================
-Type functions
-================================================================================
-*/
-
-Ox.isArguments = function(val) {
- /*
- >>> Ox.isArguments((function() { return arguments; }()))
- true
- */
- return !!(val && val.toString() == '[object Arguments]');
-}
-
-Ox.isArray = function(val) { // is in jQuery
- /*
- >>> Ox.isArray([])
- true
- */
- return val instanceof Array;
-}
-
-Ox.isBoolean = function(val) {
- /*
- >>> Ox.isBoolean(false)
- true
- */
- return typeof val == 'boolean';
-};
-
-Ox.isDate = function(val) {
- /*
- >>> Ox.isDate(new Date())
- true
- */
- return val instanceof Date;
-};
-
-Ox.isElement = function(val) {
- /*
- >>> Ox.isElement(document.createElement())
- true
- */
- return !!(val && val.nodeType == 1);
-};
-
-Ox.isFunction = function(val) { // is in jQuery
- /*
- >>> Ox.isFunction(function() {})
- true
- >>> Ox.isFunction(/ /)
- false
- */
- return typeof val == 'function' && !Ox.isRegExp(val);
-};
-
-Ox.isInfinity = function(val) {
- /*
- >>> Ox.isInfinity(Infinity)
- true
- >>> Ox.isInfinity(-Infinity)
- true
- >>> Ox.isInfinity(NaN)
- false
- */
- return typeof val == 'number' && !isFinite(val) && !Ox.isNaN(val);
-};
-
-Ox.isNaN = function(val) {
- /*
- >>> Ox.isNaN(NaN)
- true
- */
- return val !== val;
-}
-
-Ox.isNull = function(val) {
- /*
- >>> Ox.isNull(null)
- true
- */
- return val === null;
-};
-
-Ox.isNumber = function(val) {
- /*
- >>> Ox.isNumber(0)
- true
- >>> Ox.isNumber(Infinity)
- false
- >>> Ox.isNumber(-Infinity)
- false
- >>> Ox.isNumber(NaN)
- false
- */
- return typeof val == 'number' && isFinite(val);
-};
-
-Ox.isObject = function(val) {
- /*
- >>> Ox.isObject({})
- true
- >>> Ox.isObject([])
- false
- >>> Ox.isObject(new Date())
- false
- >>> Ox.isObject(null)
- false
- */
- return typeof val == 'object' && !Ox.isArguments(val) &&
- !Ox.isArray(val) && !Ox.isDate(val) && !Ox.isNull(val);
-};
-
-Ox.isRegExp = function(val) {
- /*
- >>> Ox.isRegExp(/ /)
- true
- */
- return val instanceof RegExp;
-};
-
-Ox.isString = function(val) {
- /*
- >>> Ox.isString('')
- true
- */
- return typeof val == 'string';
-};
-
-Ox.isUndefined = function(val) {
- // fixme: void 0 is also nice
- /*
- >>> Ox.isUndefined()
- true
- */
- return typeof val == 'undefined';
-};
-
-Ox.typeOf = function(val) {
- /*
- >>> (function() { return Ox.typeOf(arguments); }())
- 'arguments'
- >>> Ox.typeOf([])
- 'array'
- >>> Ox.typeOf(false)
- 'boolean'
- >>> Ox.typeOf(new Date())
- 'date'
- >>> Ox.typeOf(document.createElement())
- 'element'
- >>> Ox.typeOf(function() {})
- 'function'
- >>> Ox.typeOf(Infinity)
- 'infinity'
- >>> Ox.typeOf(NaN)
- 'nan'
- >>> Ox.typeOf(null)
- 'null'
- >>> Ox.typeOf(0)
- 'number'
- >>> Ox.typeOf({})
- 'object'
- >>> Ox.typeOf(/ /)
- 'regexp'
- >>> Ox.typeOf('')
- 'string'
- >>> Ox.typeOf()
- 'undefined'
- */
- var ret;
- Ox.forEach(Ox.TYPES, function(type) {
- if (Ox['is' + type](val)) {
- ret = type.toLowerCase();
- return false;
- }
- });
- return ret;
-};
diff --git a/source/png/Ox.UI/marker.png b/source/png/Ox.UI/marker.png
deleted file mode 100644
index dbb10980..00000000
Binary files a/source/png/Ox.UI/marker.png and /dev/null differ
diff --git a/source/png/Ox.UI/markerEditing.png b/source/png/Ox.UI/markerEditing.png
deleted file mode 100644
index 03e695b4..00000000
Binary files a/source/png/Ox.UI/markerEditing.png and /dev/null differ
diff --git a/source/png/Ox.UI/markerResize.png b/source/png/Ox.UI/markerResize.png
deleted file mode 100644
index 00adf7c4..00000000
Binary files a/source/png/Ox.UI/markerResize.png and /dev/null differ
diff --git a/source/png/Ox.UI/markerResult.png b/source/png/Ox.UI/markerResult.png
deleted file mode 100644
index 4cf22def..00000000
Binary files a/source/png/Ox.UI/markerResult.png and /dev/null differ
diff --git a/source/png/Ox.UI/markerResultEditing.png b/source/png/Ox.UI/markerResultEditing.png
deleted file mode 100644
index 99f75f9a..00000000
Binary files a/source/png/Ox.UI/markerResultEditing.png and /dev/null differ
diff --git a/source/png/Ox.UI/markerResultSelected.png b/source/png/Ox.UI/markerResultSelected.png
deleted file mode 100644
index 4a38afd6..00000000
Binary files a/source/png/Ox.UI/markerResultSelected.png and /dev/null differ
diff --git a/source/png/Ox.UI/markerSelected.png b/source/png/Ox.UI/markerSelected.png
deleted file mode 100644
index d28b2449..00000000
Binary files a/source/png/Ox.UI/markerSelected.png and /dev/null differ
diff --git a/source/psd/buttons.psd b/source/psd/buttons.psd
deleted file mode 100644
index 9b5979dd..00000000
Binary files a/source/psd/buttons.psd and /dev/null differ
diff --git a/source/psd/loading.psd b/source/psd/loading.psd
deleted file mode 100644
index 10b5f7fc..00000000
Binary files a/source/psd/loading.psd and /dev/null differ
diff --git a/source/psd/marker.psd b/source/psd/marker.psd
deleted file mode 100644
index 46bcef83..00000000
Binary files a/source/psd/marker.psd and /dev/null differ
diff --git a/source/psd/scrollbar.psd b/source/psd/scrollbar.psd
deleted file mode 100644
index 9893631d..00000000
Binary files a/source/psd/scrollbar.psd and /dev/null differ
diff --git a/source/psd/videoMarkerPoint.psd b/source/psd/videoMarkerPoint.psd
deleted file mode 100644
index 9bd23905..00000000
Binary files a/source/psd/videoMarkerPoint.psd and /dev/null differ
diff --git a/source/psd/videoMarkerPointCorner.psd b/source/psd/videoMarkerPointCorner.psd
deleted file mode 100644
index 71b12901..00000000
Binary files a/source/psd/videoMarkerPointCorner.psd and /dev/null differ
diff --git a/source/psd/videoMarkerPosition.psd b/source/psd/videoMarkerPosition.psd
deleted file mode 100644
index 24b72a0d..00000000
Binary files a/source/psd/videoMarkerPosition.psd and /dev/null differ
diff --git a/source/svg/Ox.Geo/AD.svg b/source/svg/Ox.Geo/AD.svg
deleted file mode 100644
index bd465c3d..00000000
--- a/source/svg/Ox.Geo/AD.svg
+++ /dev/null
@@ -1,1170 +0,0 @@
-
-
-
-
diff --git a/source/svg/Ox.Geo/AF.svg b/source/svg/Ox.Geo/AF.svg
deleted file mode 100644
index 199ec07a..00000000
--- a/source/svg/Ox.Geo/AF.svg
+++ /dev/null
@@ -1,2480 +0,0 @@
-
-
-
diff --git a/source/svg/Ox.Geo/ANHH.svg b/source/svg/Ox.Geo/ANHH.svg
deleted file mode 100644
index 4662366c..00000000
--- a/source/svg/Ox.Geo/ANHH.svg
+++ /dev/null
@@ -1,129 +0,0 @@
-
-
diff --git a/source/svg/Ox.Geo/AR.svg b/source/svg/Ox.Geo/AR.svg
deleted file mode 100644
index 22103c8d..00000000
--- a/source/svg/Ox.Geo/AR.svg
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
diff --git a/source/svg/Ox.Geo/AZ.svg b/source/svg/Ox.Geo/AZ.svg
deleted file mode 100644
index 319455f3..00000000
--- a/source/svg/Ox.Geo/AZ.svg
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/source/svg/Ox.Geo/BO.svg b/source/svg/Ox.Geo/BO.svg
deleted file mode 100644
index 8e708bc2..00000000
--- a/source/svg/Ox.Geo/BO.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
\ No newline at end of file
diff --git a/source/svg/Ox.Geo/BQ.svg b/source/svg/Ox.Geo/BQ.svg
deleted file mode 100644
index f19bd004..00000000
--- a/source/svg/Ox.Geo/BQ.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
\ No newline at end of file
diff --git a/source/svg/Ox.Geo/CH.svg b/source/svg/Ox.Geo/CH.svg
deleted file mode 100644
index 8f524ce7..00000000
--- a/source/svg/Ox.Geo/CH.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/source/svg/Ox.Geo/CN.svg b/source/svg/Ox.Geo/CN.svg
deleted file mode 100644
index 7c7e50ef..00000000
--- a/source/svg/Ox.Geo/CN.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-
\ No newline at end of file
diff --git a/source/svg/Ox.Geo/CR.svg b/source/svg/Ox.Geo/CR.svg
deleted file mode 100644
index dbad67f8..00000000
--- a/source/svg/Ox.Geo/CR.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/source/svg/Ox.Geo/DJ.svg b/source/svg/Ox.Geo/DJ.svg
deleted file mode 100644
index 0aa332f8..00000000
--- a/source/svg/Ox.Geo/DJ.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
diff --git a/source/svg/Ox.Geo/DK.svg b/source/svg/Ox.Geo/DK.svg
deleted file mode 100644
index 95b32430..00000000
--- a/source/svg/Ox.Geo/DK.svg
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
diff --git a/source/svg/Ox.Geo/FO.svg b/source/svg/Ox.Geo/FO.svg
deleted file mode 100644
index 632439d0..00000000
--- a/source/svg/Ox.Geo/FO.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
diff --git a/source/svg/Ox.Geo/GA.svg b/source/svg/Ox.Geo/GA.svg
deleted file mode 100644
index f4165235..00000000
--- a/source/svg/Ox.Geo/GA.svg
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
\ No newline at end of file
diff --git a/source/svg/Ox.Geo/GB-ENG.svg b/source/svg/Ox.Geo/GB-ENG.svg
deleted file mode 100644
index 20107c71..00000000
--- a/source/svg/Ox.Geo/GB-ENG.svg
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/source/svg/Ox.Geo/GL.svg b/source/svg/Ox.Geo/GL.svg
deleted file mode 100644
index 21f4995a..00000000
--- a/source/svg/Ox.Geo/GL.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
diff --git a/source/svg/Ox.Geo/GP.svg b/source/svg/Ox.Geo/GP.svg
deleted file mode 100644
index 3b00b34f..00000000
--- a/source/svg/Ox.Geo/GP.svg
+++ /dev/null
@@ -1,334 +0,0 @@
-
-
diff --git a/source/svg/Ox.Geo/JTUM.svg b/source/svg/Ox.Geo/JTUM.svg
deleted file mode 100644
index f02c7a82..00000000
--- a/source/svg/Ox.Geo/JTUM.svg
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
\ No newline at end of file
diff --git a/source/svg/Ox.Geo/MF.svg b/source/svg/Ox.Geo/MF.svg
deleted file mode 100644
index 0baf7f3b..00000000
--- a/source/svg/Ox.Geo/MF.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/source/svg/Ox.Geo/MIUM.svg b/source/svg/Ox.Geo/MIUM.svg
deleted file mode 100644
index f02c7a82..00000000
--- a/source/svg/Ox.Geo/MIUM.svg
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
\ No newline at end of file
diff --git a/source/svg/Ox.Geo/MK.svg b/source/svg/Ox.Geo/MK.svg
deleted file mode 100644
index d51d30a7..00000000
--- a/source/svg/Ox.Geo/MK.svg
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
diff --git a/source/svg/Ox.Geo/NF.svg b/source/svg/Ox.Geo/NF.svg
deleted file mode 100644
index 37e9f808..00000000
--- a/source/svg/Ox.Geo/NF.svg
+++ /dev/null
@@ -1,108 +0,0 @@
-
-
-
diff --git a/source/svg/Ox.Geo/PE.svg b/source/svg/Ox.Geo/PE.svg
deleted file mode 100644
index 8812ab39..00000000
--- a/source/svg/Ox.Geo/PE.svg
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/source/svg/Ox.Geo/PZPA.png b/source/svg/Ox.Geo/PZPA.png
deleted file mode 100644
index 07635c3a..00000000
Binary files a/source/svg/Ox.Geo/PZPA.png and /dev/null differ
diff --git a/source/svg/Ox.Geo/RE.png b/source/svg/Ox.Geo/RE.png
deleted file mode 100644
index 22f72e1d..00000000
Binary files a/source/svg/Ox.Geo/RE.png and /dev/null differ
diff --git a/source/svg/Ox.Geo/SK.svg b/source/svg/Ox.Geo/SK.svg
deleted file mode 100644
index 586c9e65..00000000
--- a/source/svg/Ox.Geo/SK.svg
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/source/svg/Ox.Geo/SV.svg b/source/svg/Ox.Geo/SV.svg
deleted file mode 100644
index f69df774..00000000
--- a/source/svg/Ox.Geo/SV.svg
+++ /dev/null
@@ -1,9494 +0,0 @@
-
-
diff --git a/source/svg/Ox.Geo/TR.svg b/source/svg/Ox.Geo/TR.svg
deleted file mode 100644
index 8e82435a..00000000
--- a/source/svg/Ox.Geo/TR.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
diff --git a/source/svg/Ox.Geo/VE.svg b/source/svg/Ox.Geo/VE.svg
deleted file mode 100644
index 832826da..00000000
--- a/source/svg/Ox.Geo/VE.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
diff --git a/source/svg/Ox.Geo/WKUM.svg b/source/svg/Ox.Geo/WKUM.svg
deleted file mode 100644
index f02c7a82..00000000
--- a/source/svg/Ox.Geo/WKUM.svg
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
\ No newline at end of file
diff --git a/source/svg/Ox.Geo/YE.svg b/source/svg/Ox.Geo/YE.svg
deleted file mode 100644
index 7fd58936..00000000
--- a/source/svg/Ox.Geo/YE.svg
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/source/svg/Ox.Geo/ZRCD.svg b/source/svg/Ox.Geo/ZRCD.svg
deleted file mode 100644
index 2043db23..00000000
--- a/source/svg/Ox.Geo/ZRCD.svg
+++ /dev/null
@@ -1,116 +0,0 @@
-
-
-
diff --git a/source/svg/_loading.html b/source/svg/_loading.html
deleted file mode 100644
index 14b71093..00000000
--- a/source/svg/_loading.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tools/build/build.py b/tools/build/build.py
index 8af37d5c..5925e323 100755
--- a/tools/build/build.py
+++ b/tools/build/build.py
@@ -5,13 +5,6 @@ import os
import re
import shutil
-def append_file(file):
- split = file.split('/')[1].split('.')
- module = '.'.join([split[0], split[1]])
- if not module in files:
- files[module] = []
- files[module].append(file)
-
def copy_file(source, target):
print 'copying', source, 'to', target
write_file(target, read_file(source))
@@ -43,76 +36,60 @@ def write_path(file):
if path and not os.path.exists(path):
os.makedirs(path)
-# doesn't work here
base_path = os.path.dirname(__file__)
if base_path:
os.chdir(base_path)
source_path = '../../source/'
build_path = '../../build/'
-files = {}
+files = ['Ox.UI/css/Ox.UI.css']
-# css
-for path, dirnames, filenames in os.walk(source_path + 'css/'):
+# SVGs
+path = source_path + 'Ox.UI/themes/classic/svg/'
+for filename in os.listdir(path):
+ svg = read_file(path + filename)
+ svg = svg.replace('#404040', '#FFFFFF').replace('#000000', '#FFFFFF')
+ write_file(path.replace('/classic/', '/modern/') + filename, svg)
+
+# symlinks
+for path, dirnames, filenames in os.walk(source_path):
for filename in filenames:
- source = os.path.join(path, filename)
- target = source.replace(source_path, build_path)
- write_link(source, target)
- if filename == 'Ox.UI.css':
- append_file(target.replace(build_path, ''))
+ if not '_' in path and not filename[0] in '._':
+ parts = os.path.join(path.replace(source_path, ''), filename).split('/')
+ for i, part in enumerate(parts):
+ if i < len(parts) - 1:
+ parts[i] = '..'
+ source = '/'.join(parts).replace(filename, os.path.join(path, filename))[3:]
+ is_jquery = re.compile('^jquery-[\d\.]+\.js$').findall(filename)
+ is_jquery_min = re.compile('^jquery-[\d\.]+\.min\.js$').findall(filename)
+ is_jquery_plugin = re.compile('^jquery\..*?\.js$').findall(filename)
+ if is_jquery:
+ target = os.path.join(path.replace(source_path, build_path), 'jquery.js')
+ elif is_jquery_min:
+ target = os.path.join(path.replace(source_path, build_path), 'jquery.min.js')
+ else:
+ target = os.path.join(path.replace(source_path, build_path), filename)
+ if is_jquery_plugin:
+ files.append(target.replace(build_path, ''))
+ write_link(source, target)
-# js
-filename = 'js/Ox.js'
-write_link(source_path + filename, build_path + filename)
-root = source_path + 'js/'
+# Ox.UI
+js = ''
+section = ''
+root = source_path + 'Ox.UI/'
for path, dirnames, filenames in os.walk(root):
- for dirname in dirnames:
- if dirname[0] != '_':
- if path == root and dirname != 'jquery':
- source = os.path.join(path, dirname)
- target = source.replace(source_path, build_path)
- write_link(source, target)
for filename in filenames:
- if filename[0] != '.' and filename[0] != '_':
- if 'jquery' in path:
- is_jquery = re.compile('jquery-[\d\.]+\.js').findall(filename)
- is_jquery_min = re.compile('jquery-[\d\.]+\.min\.js').findall(filename)
- source = os.path.join(path, filename)
- if is_jquery:
- target = os.path.join(path.replace(source_path, build_path), 'jquery.js')
- elif is_jquery_min:
- target = os.path.join(path.replace(source_path, build_path), 'jquery.min.js')
- else:
- target = source.replace(source_path, build_path)
- copy_file(source, target)
- if not is_jquery and not is_jquery_min:
- files['Ox.UI'].append(target.replace(build_path, ''))
- elif path != root and not '_' in path:
- append_file(os.path.join(path, filename).replace(source_path, ''))
+ # theme css files get included by main css
+ if path != root and not '_' in path and not filename[0] in '._' and filename[-4:] != '.css':
+ files.append(os.path.join(path.replace(source_path, ''), filename))
+ if filename[-3:] == '.js':
+ folder = os.path.split(path)[-1]
+ if section != folder:
+ section = folder
+ js += '/*\n' + '=' * 80 + '\n' + section + '\n' + '=' * 80 + '\n*/\n\n'
+ js += '/*\n' + '-' * 80 + '\n' + filename[:-3] + '\n' + '-' * 80 + '\n*/\n\n'
+ js += read_file(os.path.join(path, filename)) + '\n\n'
-# png
-for path, dirnames, filenames in os.walk(source_path + 'png/'):
- for filename in filenames:
- if filename[:1] != '.':
- source = os.path.join(path, filename)
- target = source.replace(source_path, build_path)
- copy_file(source, target)
- append_file(target.replace(build_path, ''))
-
-# svg
-for path, dirnames, filenames in os.walk(source_path + 'svg/'):
- for filename in filenames:
- if filename[0] != '.' and filename[0] != '_':
- source = os.path.join(path, filename)
- target = source.replace(source_path, build_path)
- copy_file(source, target)
- append_file(target.replace(build_path, ''))
- if 'Ox.UI.classic' in source:
- svg = read_file(source).replace('#404040', '#FFFFFF').replace('#000000', '#FFFFFF')
- target = target.replace('Ox.UI.classic', 'Ox.UI.modern')
- write_file(target, svg)
- append_file(target.replace(build_path, ''))
-
-for module in files:
- file = build_path + 'json/' + module + '.json'
- write_file(file, json.dumps(sorted(files[module]), indent=4, sort_keys=True))
+write_file(build_path + 'Ox.UI/js/Ox.UI.js', js)
+files = json.dumps(sorted(files), indent=4, sort_keys=True)
+write_file(build_path + 'Ox.UI/json/Ox.UI.json', files)
\ No newline at end of file