From: Mart Lubbers Date: Thu, 15 May 2014 10:13:43 +0000 (+0200) Subject: ding X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=e42592919c2e01f5933b5c8a226281b8b0124858;p=bsc-thesis1415.git ding --- diff --git a/program/hypfront/contextmenu_o.js b/program/hypfront/contextmenu_o.js index 468cfc6..feb3135 100644 --- a/program/hypfront/contextmenu_o.js +++ b/program/hypfront/contextmenu_o.js @@ -29,7 +29,6 @@ function init(a, w) { var c = '
'; c += a; c += '
'; - console.log(c) b.innerHTML = c; b.style.position = "absolute"; b.style.left = "0px"; @@ -44,10 +43,10 @@ function init(a, w) { } function mouseUp(e) { - var curselection = window.getSelection().getRangeAt(0); - if (curselection.endOffset - curselection.startOffset > 0) - selection = curselection; - console.log(selection) + var curselection = window.getSelection().getRangeAt(0); + if (curselection.endOffset - curselection.startOffset > 0) + selection = curselection; + console.log(selection) if (e.which == 1) document.getElementById("contextmenu").style.visibility = "hidden"; else if (e.which == 3) mouse_right = false } @@ -94,7 +93,12 @@ function post_all() { document.write(xmlhttp.responseText); } } - var params = "content="+encodeURIComponent(document.getElementsByTagName("table")[0].innerHTML); + var params = "content="+encodeURIComponent(document.getElementById("content-table").innerHTML); + params += "&name="+encodeURIComponent(document.getElementById("rssname").innerHTML); + var indatarray = document.getElementsByClassName('indat') + for (var i = 0; i + + HyperFrontend RSS feed POSTREQUEST + + + Thanks submitting: {}
+ Enter new rss feed +
+{}
+        
+ + +""".format(args.keys(), args['content'])) + + def req_pre(req): req.log_error('handler') req.content_type = 'text/html' @@ -17,35 +38,44 @@ def req_pre(req): HyperFrontend RSS feed input - + + + + + + + +
Venue: +
Frequency: +
Default location name: +
Adress: +
Website: +
+ Selecteer iets en klik de link
- + +
""") def req_post(req): req.write("""\ - + """) @@ -54,31 +84,29 @@ def req_post(req): def feed2html(req, url, name): url = urllib.unquote(url) url = url if re.match('https?://', url) else 'http://{}'.format(url) - req.write('\tLoading "{}" as "{}"
\n'.format(url, name)) + req.write( + '\tLoading "{}" as

"{}"


\n'.format(url, name)) feed = feedparser.parse(url) channel = feed.feed - req.write('\t\n') + req.write('\t
\n') req.write('\t\t\n') for i in feed.entries: req.write('\t\t\n'. format(i['title'].encode('ascii', 'xmlcharrefreplace'), i['summary'].encode('ascii', 'xmlcharrefreplace'))) req.write('\t
TitleSummary...
{}{}...
\n
') - for k, v in feed.entries[0].iteritems(): - req.write('{}: {}
\n'.format(k, v)) + def handler(req): if req.method == "POST": - raise Exception("POSTEDDDD") + req_pre_pos(req) else: req_pre(req) - args = dict(filter(lambda x: x[1], - map(lambda x: x.split('='), - req.__getattribute__('args').split('&')))) + args = util.FieldStorage(req) if 'url' not in args and 'name' not in args: req.write('Something went wrong, empty fields?
') req.write('back') else: feed2html(req, args['url'], args['name']) req_post(req) - return apache.OK + return apache.OK diff --git a/program/hypfront/index.html b/program/hypfront/index.html index c533b6e..788eeee 100644 --- a/program/hypfront/index.html +++ b/program/hypfront/index.html @@ -1,12 +1,14 @@ - -
- - - -

RSS URL:

RSS Name:

-
-
- + + + +
+ + + +

RSS URL:

RSS Name:
+
+
+