From d842815194d431c2ce3130b4c904f69817244048 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 9 Mar 2011 23:50:50 +0100 Subject: link parser from forum thx to ToFF, missing icons --- module/web/media/default/img/error.png | Bin 0 -> 701 bytes module/web/media/default/img/notice.png | Bin 0 -> 778 bytes module/web/media/default/img/parseUri.png | Bin 0 -> 666 bytes module/web/media/default/img/success.png | Bin 0 -> 781 bytes module/web/media/default/js/funktions.js | 25 +++++++++++++++++++++++++ module/web/templates/default/window.html | 6 +++++- 6 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 module/web/media/default/img/error.png create mode 100644 module/web/media/default/img/notice.png create mode 100644 module/web/media/default/img/parseUri.png create mode 100644 module/web/media/default/img/success.png diff --git a/module/web/media/default/img/error.png b/module/web/media/default/img/error.png new file mode 100644 index 000000000..c37bd062e Binary files /dev/null and b/module/web/media/default/img/error.png differ diff --git a/module/web/media/default/img/notice.png b/module/web/media/default/img/notice.png new file mode 100644 index 000000000..12cd1aef9 Binary files /dev/null and b/module/web/media/default/img/notice.png differ diff --git a/module/web/media/default/img/parseUri.png b/module/web/media/default/img/parseUri.png new file mode 100644 index 000000000..937bded9d Binary files /dev/null and b/module/web/media/default/img/parseUri.png differ diff --git a/module/web/media/default/img/success.png b/module/web/media/default/img/success.png new file mode 100644 index 000000000..89c8129a4 Binary files /dev/null and b/module/web/media/default/img/success.png differ diff --git a/module/web/media/default/js/funktions.js b/module/web/media/default/js/funktions.js index c0f38b0bb..6240d32ad 100644 --- a/module/web/media/default/js/funktions.js +++ b/module/web/media/default/js/funktions.js @@ -8,6 +8,31 @@ function HumanFileSize(size) return (size == 0) ? "0 B" : (Math.round( size / a , 2) + " " + filesizename[i]); } +function parseUri() { + var oldString = $("add_links").value; + var regxp= new RegExp('(ht|f)tp(s?):\/\/[a-zA-Z0-9\-\.\/\?=]+[<| |\"|\'|\r|\n|\t]{1}', 'g'); + var resu=oldString.match(regxp); + if (resu == null) return; + var res=""; + for(var i=0; i < resu.length; i++){ + // remove the last char, if ... + if (resu[i].indexOf(" ") != -1){ + res = res + resu[i].replace(" ","\n"); + } else if (resu[i].indexOf("\t") != -1){ + res = res + resu[i].replace("\t","\n"); + } else if (resu[i].indexOf("\r") != -1){ + res = res + resu[i].replace("\r","\n"); + } else if (resu[i].indexOf("\"") != -1){ + res = res + resu[i].replace("\"","\n"); + } else if (resu[i].indexOf("<") != -1){ + res = res + resu[i].replace("<","\n"); + } else { + res = res + "\n" + resu[i].replace("'","\n"); + } + } + $("add_links").value = res; +} + Array.prototype.remove = function(from, to) { var rest = this.slice((to || from) + 1 || this.length); this.length = from < 0 ? this.length + from : from; diff --git a/module/web/templates/default/window.html b/module/web/templates/default/window.html index 734745887..b59189a93 100644 --- a/module/web/templates/default/window.html +++ b/module/web/templates/default/window.html @@ -1,5 +1,5 @@ - + @@ -14,6 +14,10 @@ -- cgit v1.2.3