diff -ruN ./vdr-plugin-restfulapi-20120905230348testing/osd.cpp ./vdr-plugin-restfulapi-20120905230348testing_new2/osd.cpp --- ./vdr-plugin-restfulapi-20120905230348testing/osd.cpp 2012-09-05 23:03:50.000000000 +0200 +++ ./vdr-plugin-restfulapi-20120905230348testing_new2/osd.cpp 2013-02-24 12:31:16.824651169 +0100 @@ -92,11 +92,11 @@ HtmlHeader htmlHeader; htmlHeader.Title("VDR Restfulapi: No OSD opened!"); htmlHeader.Stylesheet("/var/lib/vdr/plugins/restfulapi/osd.css"); - //htmlHeader.Script("/var/lib/vdr/plugins/restfulapi/osd.js"); - htmlHeader.MetaTag(""); + htmlHeader.Script("/var/lib/vdr/plugins/restfulapi/osd.js"); + htmlHeader.MetaTag(""); htmlHeader.ToStream(&se); - se.write("\n
 
\n"); + se.write("\n
 
\n"); se.write(""); } @@ -194,10 +194,10 @@ htmlHeader.Title("HtmlTextOsdList"); htmlHeader.Stylesheet("/var/lib/vdr/plugins/restfulapi/osd.css"); htmlHeader.Script("/var/lib/vdr/plugins/restfulapi/osd.js"); - htmlHeader.MetaTag(""); + htmlHeader.MetaTag(""); htmlHeader.ToStream(s); - s->write("\n
"); + s->write("\n
"); s->write("\n
"); if (textOsd->Title().length() > 0) s->write(textOsd->Title().c_str()); @@ -245,7 +245,7 @@ s->write("
 
\n"); s->write("
\n
\n"); - s->write("
\n"); + s->write("
\n"); s->write(""); } @@ -294,9 +294,10 @@ HtmlHeader htmlHeader; htmlHeader.Title("ProgrammeOsdWrapper"); htmlHeader.Stylesheet("/var/lib/vdr/plugins/restfulapi/osd.css"); - htmlHeader.MetaTag(""); + htmlHeader.Script("/var/lib/vdr/plugins/restfulapi/osd.js"); + htmlHeader.MetaTag(""); htmlHeader.ToStream(s); - + s->write("
\n"); s->write("
"); s->write(cString::sprintf("
%s
", osd->PresentTitle().c_str())); s->write(cString::sprintf("
%s - %s
", @@ -307,6 +308,7 @@ osd->FollowingSubtitle().c_str(), StringExtension::timeToString(osd->FollowingTime()).c_str())); s->write("
\n"); + s->write("
\n"); s->write("\n"); } @@ -343,7 +345,8 @@ HtmlHeader htmlHeader; htmlHeader.Title("ChannelOsdWrapper"); htmlHeader.Stylesheet("/var/lib/vdr/plugins/restfulapi/osd.css"); - htmlHeader.MetaTag(""); + htmlHeader.Script("/var/lib/vdr/plugins/restfulapi/osd.js"); + htmlHeader.MetaTag(""); htmlHeader.ToStream(s); s->write("
"); diff -ruN ./vdr-plugin-restfulapi-20120905230348testing/recordings.cpp ./vdr-plugin-restfulapi-20120905230348testing_new2/recordings.cpp --- ./vdr-plugin-restfulapi-20120905230348testing/recordings.cpp 2012-09-05 23:03:50.000000000 +0200 +++ ./vdr-plugin-restfulapi-20120905230348testing_new2/recordings.cpp 2013-02-24 14:45:46.493554522 +0100 @@ -6,6 +6,10 @@ QueryHandler::addHeader(reply); bool found = false; + if (request.method() == "OPTIONS") { + return; + } + if ((int)request.url().find("/recordings/play") == 0 ) { if ( request.method() == "GET" ) { playRecording(out, request, reply); diff -ruN ./vdr-plugin-restfulapi-20120905230348testing/searchtimers.cpp ./vdr-plugin-restfulapi-20120905230348testing_new2/searchtimers.cpp --- ./vdr-plugin-restfulapi-20120905230348testing/searchtimers.cpp 2012-09-05 23:03:50.000000000 +0200 +++ ./vdr-plugin-restfulapi-20120905230348testing_new2/searchtimers.cpp 2013-02-24 14:38:54.370825587 +0100 @@ -6,9 +6,6 @@ QueryHandler::addHeader(reply); cPlugin* plugin = cPluginManager::GetPlugin("epgsearch"); if (plugin == NULL) { - reply.addHeader("Access-Control-Allow-Origin", "*"); - reply.addHeader("Access-Control-Allow-Methods", "POST, GET, DELETE, PUT"); - reply.httpReturn(403, "Epgsearch isn't installed!"); return; } @@ -22,9 +19,9 @@ replyCreate(out, request, reply); } else if (request.method() == "DELETE") { replyDelete(out, request, reply); + } else if (request.method() == "OPTIONS") { + return; } else { - reply.addHeader("Access-Control-Allow-Origin", "*"); - reply.addHeader("Access-Control-Allow-Methods", "POST, GET, DELETE, PUT"); reply.httpReturn(404, "The searchtimer-service does only support the following methods: GET, POST and DELETE."); } } @@ -102,6 +99,8 @@ if (!result) reply.httpReturn(408, "Deleting searchtimer failed!"); + else + reply.httpReturn(200, "Searchtimer deleted."); } void SearchTimersResponder::replySearch(ostream& out, cxxtools::http::Request& request, cxxtools::http::Reply& reply) diff -ruN ./vdr-plugin-restfulapi-20120905230348testing/timers.cpp ./vdr-plugin-restfulapi-20120905230348testing_new2/timers.cpp --- ./vdr-plugin-restfulapi-20120905230348testing/timers.cpp 2012-09-05 23:03:50.000000000 +0200 +++ ./vdr-plugin-restfulapi-20120905230348testing_new2/timers.cpp 2013-02-24 14:38:59.324336482 +0100 @@ -12,6 +12,8 @@ createOrUpdateTimer(out, request, reply, false); } else if ( request.method() == "PUT" ) { createOrUpdateTimer(out, request, reply, true); + } else if (request.method() == "OPTIONS") { + return; } else { reply.httpReturn(501, "Only GET, DELETE, POST and PUT methods are supported."); } @@ -201,6 +203,7 @@ } Timers.Del(timer); Timers.SetModified(); + reply.httpReturn(200, "Timer deleted."); } } @@ -414,7 +417,7 @@ bool TimerValues::IsFileValid(string v) { - if ( v.length() > 0 && v.length() <= 40 ) + if ( v.length() > 0 && v.length() <= 99 ) return true; return false; } diff -ruN ./vdr-plugin-restfulapi-20120905230348testing/tools.cpp ./vdr-plugin-restfulapi-20120905230348testing_new2/tools.cpp --- ./vdr-plugin-restfulapi-20120905230348testing/tools.cpp 2012-09-05 23:03:50.000000000 +0200 +++ ./vdr-plugin-restfulapi-20120905230348testing_new2/tools.cpp 2013-02-23 09:59:02.567639000 +0100 @@ -95,7 +95,11 @@ se->write("\n"); se->write("\n"); - + // WebApp support + se->write("\n"); + se->write("\n"); + se->write("\n"); + for (int i=0;i<(int)_metatags.size();i++) { se->write(_metatags[i].c_str()); @@ -158,6 +162,11 @@ write("\n"); write("\n"); write("\n"); + // WebApp support + write("\n"); + write("\n"); + write("\n"); + write("VDR-Plugin-Restfulapi: "); if ( title.length() > 0 ) write(title.c_str()); write(""); diff -ruN ./vdr-plugin-restfulapi-20120905230348testing/web/osd.css ./vdr-plugin-restfulapi-20120905230348testing_new2/web/osd.css --- ./vdr-plugin-restfulapi-20120905230348testing/web/osd.css 2012-09-05 23:03:50.000000000 +0200 +++ ./vdr-plugin-restfulapi-20120905230348testing_new2/web/osd.css 2013-02-24 13:09:23.371963878 +0100 @@ -11,13 +11,13 @@ /* osd_container - main wrapper element */ -div#osd_container +div#osd_bg { position: absolute; - width:90%; - height: 90%; + width: 100%; + height: 100%; margin: 0%; - padding: 5%; + padding: 0%; overflow: hidden; background: #d8e0de; /* Old browsers */ background: -moz-linear-gradient(top, #d8e0de 0%, #aebfbc 22%, #99afab 33%, #8ea6a2 50%, #829d98 67%, #4e5c5a 82%, #0e0e0e 100%); /* FF3.6+ */ @@ -29,6 +29,16 @@ background: linear-gradient(top, #d8e0de 0%,#aebfbc 22%,#99afab 33%,#8ea6a2 50%,#829d98 67%,#4e5c5a 82%,#0e0e0e 100%); /* W3C */ } +div#osd_container +{ + position: absolute; + width: 90%; + height: 90%; + margin: 0%; + padding: 5%; + overflow: hidden; +} + /* header */ div#header diff -ruN ./vdr-plugin-restfulapi-20120905230348testing/web/osd.js ./vdr-plugin-restfulapi-20120905230348testing_new2/web/osd.js --- ./vdr-plugin-restfulapi-20120905230348testing/web/osd.js 2012-09-05 23:03:50.000000000 +0200 +++ ./vdr-plugin-restfulapi-20120905230348testing_new2/web/osd.js 2013-02-24 12:42:25.801919993 +0100 @@ -2,4 +2,4 @@ function bootstrap() { //alert("javascript bootstrap called!"); -} \ Kein Zeilenumbruch am Dateiende. +}