diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-03-09 23:50:50 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-03-09 23:50:50 +0100 |
commit | d842815194d431c2ce3130b4c904f69817244048 (patch) | |
tree | 9f86fec8e23b4889dbfa4d42140b5212892a0c27 /module/web | |
parent | new config page, mootools 1.3, removed old templates (diff) | |
download | pyload-d842815194d431c2ce3130b4c904f69817244048.tar.xz |
link parser from forum thx to ToFF, missing icons
Diffstat (limited to 'module/web')
-rw-r--r-- | module/web/media/default/img/error.png | bin | 0 -> 701 bytes | |||
-rw-r--r-- | module/web/media/default/img/notice.png | bin | 0 -> 778 bytes | |||
-rw-r--r-- | module/web/media/default/img/parseUri.png | bin | 0 -> 666 bytes | |||
-rw-r--r-- | module/web/media/default/img/success.png | bin | 0 -> 781 bytes | |||
-rw-r--r-- | module/web/media/default/js/funktions.js | 25 | ||||
-rw-r--r-- | module/web/templates/default/window.html | 6 |
6 files changed, 30 insertions, 1 deletions
diff --git a/module/web/media/default/img/error.png b/module/web/media/default/img/error.png Binary files differnew file mode 100644 index 000000000..c37bd062e --- /dev/null +++ b/module/web/media/default/img/error.png diff --git a/module/web/media/default/img/notice.png b/module/web/media/default/img/notice.png Binary files differnew file mode 100644 index 000000000..12cd1aef9 --- /dev/null +++ b/module/web/media/default/img/notice.png diff --git a/module/web/media/default/img/parseUri.png b/module/web/media/default/img/parseUri.png Binary files differnew file mode 100644 index 000000000..937bded9d --- /dev/null +++ b/module/web/media/default/img/parseUri.png diff --git a/module/web/media/default/img/success.png b/module/web/media/default/img/success.png Binary files differnew file mode 100644 index 000000000..89c8129a4 --- /dev/null +++ b/module/web/media/default/img/success.png 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 @@ <iframe id="upload_target" name="upload_target" src="" style="display: none; width:0;height:0"></iframe>
-<div id="add_bg" style="filter:alpha(opacity:80);KHTMLOpacity:0.80;MozOpacity:0.80;opacity:0.80; background:#000; width:100%; height: 100%; position:fixed; top:0; left:0; display:none;"> </div>
+<div id="add_bg" class=".window_box" style="filter:alpha(opacity:80);KHTMLOpacity:0.80;MozOpacity:0.80;opacity:0.80; background:#000; width:100%; height: 100%; position:fixed; top:0; left:0; display:none;"> </div>
<!--<div id="add_box" style="left:50%; top:200px; margin-left: -450px; width: 900px; position: absolute; background: #FFF; padding: 10px 10px 10px 10px; display:none;">-->
<!--<div style="width: 900px; text-align: right;"><b onclick="AddBox();">[Close]</b></div>-->
@@ -14,6 +14,10 @@ <label for="add_links">{{_("Links")}}
<span class="small">{{_("Paste your links here")}}</span>
+<span class="small"> {{ _("Filter urls") }}
+<img alt="URIParsing" Title="Parse Uri" src="/media/default/img/parseUri.png" style="cursor:pointer;" onclick="parseUri()"/>
+</span>
+
</label>
<textarea rows="5" name="add_links" id="add_links"></textarea>
|