diff --git a/configure.ac b/configure.ac index 44ba69398..0b6e710a8 100644 --- a/configure.ac +++ b/configure.ac @@ -82,7 +82,9 @@ src/nhttpd/Makefile src/nhttpd/web/Makefile src/nhttpd/web/images/Makefile src/nhttpd/web/scripts/Makefile +src/nhttpd/web/languages/Makefile src/nhttpd/tuxboxapi/Makefile +src/nhttpd/tuxboxapi/coolstream/Makefile src/nhttpd/yhttpd_core/Makefile src/nhttpd/yhttpd_mods/Makefile src/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 5be97e84d..d673779fe 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -39,7 +39,7 @@ neutrino_LDADD = \ timerd/libtimerd.a \ zapit/src/libzapit.a \ nhttpd/libnhttpd.a \ - nhttpd/tuxboxapi/libnhttpd_tuxboxapi.a \ + nhttpd/tuxboxapi/coolstream/libnhttpd_tuxboxapi.a \ nhttpd/yhttpd_mods/libyhttpdmods.a \ nhttpd/yhttpd_core/libyhttpd.a \ $(top_builddir)/lib/sectionsdclient/libsectionsdclient.a \ diff --git a/src/nhttpd/Makefile.am b/src/nhttpd/Makefile.am index 19586226b..bf4eb66a3 100644 --- a/src/nhttpd/Makefile.am +++ b/src/nhttpd/Makefile.am @@ -9,6 +9,7 @@ INCLUDES = \ -I$(top_srcdir)/src/nhttpd/yhttpd_core \ -I$(top_srcdir)/src/nhttpd/yhttpd_mods \ -I$(top_srcdir)/src/nhttpd/tuxboxapi \ + -I$(top_srcdir)/src/nhttpd/tuxboxapi/coolstream \ -I$(top_srcdir)/lib/libeventserver \ -I$(top_srcdir)/lib/libconfigfile \ -I$(top_srcdir)/lib/connection \ diff --git a/src/nhttpd/nhttpd.conf b/src/nhttpd/nhttpd.conf index c5904af99..3dbc110e2 100644 --- a/src/nhttpd/nhttpd.conf +++ b/src/nhttpd/nhttpd.conf @@ -2,7 +2,7 @@ ExtrasDocRoot=web ExtrasDocURL= Tuxbox.HostedDocumentRoot= WebsiteMain.directory=/share/tuxbox/neutrino/httpd -WebsiteMain.override_directory=/var/tmp/httpd +WebsiteMain.override_directory=/var/httpd WebsiteMain.port=80 WebsiteMain.special_locations=/hosted/=/mnt/hosted Zapit_XML_Path=/var/tuxbox/config/zapit diff --git a/src/nhttpd/tuxboxapi/Makefile.am b/src/nhttpd/tuxboxapi/Makefile.am index 5e7aed6f5..5ad38190f 100644 --- a/src/nhttpd/tuxboxapi/Makefile.am +++ b/src/nhttpd/tuxboxapi/Makefile.am @@ -1,20 +1,2 @@ -AM_CPPFLAGS = -fno-rtti -fno-exceptions +SUBDIRS = coolstream -INCLUDES = \ - -I$(top_srcdir)/lib \ - -I$(top_srcdir)/src/zapit/include \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/nhttpd \ - -I$(top_srcdir)/src/nhttpd/yhttpd_core \ - -I$(top_srcdir)/src/nhttpd/yhttpd_mods \ - -I$(top_srcdir)/lib/connection \ - -I$(top_srcdir)/lib/libeventserver \ - -I$(top_srcdir)/lib/libconfigfile \ - -I$(top_srcdir)/lib/xmltree \ - @FREETYPE_CFLAGS@ - -noinst_LIBRARIES = libnhttpd_tuxboxapi.a - -libnhttpd_tuxboxapi_a_SOURCES = \ - neutrinoapi.cpp neutrinoyparser.cpp lcdapi.cpp controlapi.cpp - diff --git a/src/nhttpd/tuxboxapi/dbox/Makefile.am b/src/nhttpd/tuxboxapi/dbox/Makefile.am new file mode 100644 index 000000000..5e7aed6f5 --- /dev/null +++ b/src/nhttpd/tuxboxapi/dbox/Makefile.am @@ -0,0 +1,20 @@ +AM_CPPFLAGS = -fno-rtti -fno-exceptions + +INCLUDES = \ + -I$(top_srcdir)/lib \ + -I$(top_srcdir)/src/zapit/include \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/nhttpd \ + -I$(top_srcdir)/src/nhttpd/yhttpd_core \ + -I$(top_srcdir)/src/nhttpd/yhttpd_mods \ + -I$(top_srcdir)/lib/connection \ + -I$(top_srcdir)/lib/libeventserver \ + -I$(top_srcdir)/lib/libconfigfile \ + -I$(top_srcdir)/lib/xmltree \ + @FREETYPE_CFLAGS@ + +noinst_LIBRARIES = libnhttpd_tuxboxapi.a + +libnhttpd_tuxboxapi_a_SOURCES = \ + neutrinoapi.cpp neutrinoyparser.cpp lcdapi.cpp controlapi.cpp + diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/dbox/controlapi.cpp similarity index 84% rename from src/nhttpd/tuxboxapi/controlapi.cpp rename to src/nhttpd/tuxboxapi/dbox/controlapi.cpp index 7b658b4bf..e192a0c99 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/dbox/controlapi.cpp @@ -29,18 +29,7 @@ #include "controlapi.h" #include "lcdapi.h" -bool sectionsd_getEPGidShort(event_id_t epgID, CShortEPGData * epgdata); -bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata); -void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = ""); -void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next ); -bool sectionsd_getLinkageDescriptorsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::LinkageDescriptorList& descriptors); -bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags); -extern tallchans allchans; -extern CBouquetManager *g_bouquetManager; -extern t_channel_id live_channel_id; - -//#define EVENTDEV "/dev/input/event0" -#define EVENTDEV "/dev/input/input0" +#define EVENTDEV "/dev/input/event0" //----------------------------------------------------------------------------- enum { // not defined in input.h but used like that, at least in 2.4.22 KEY_RELEASED = 0, @@ -79,6 +68,19 @@ void CControlAPI::init(CyhookHandler *hh) // Hooks! //============================================================================= //----------------------------------------------------------------------------- +THandleStatus CControlAPI::Hook_PrepareResponse(CyhookHandler *hh) +{ + init(hh); + + if(hh->UrlData["path"] == "/control/" + || hh->UrlData["path"] == "/cgi-bin/" + || hh->UrlData["path"] == "/fb/" + ) + return HANDLED_READY; + else + return HANDLED_NONE; +} +//----------------------------------------------------------------------------- // HOOK: response_hook Handler // This is the main dispatcher for this module //----------------------------------------------------------------------------- @@ -143,11 +145,10 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"standby", &CControlAPI::StandbyCGI, "text/plain"}, {"shutdown", &CControlAPI::ShutdownCGI, "text/plain"}, {"reboot", &CControlAPI::RebootCGI, "text/plain"}, + {"esound", &CControlAPI::EsoundCGI, "text/plain"}, {"getdate", &CControlAPI::GetDateCGI, "text/plain"}, {"gettime", &CControlAPI::GetTimeCGI, "text/plain"}, -#if 0 {"settings", &CControlAPI::SettingsCGI, "text/plain"}, -#endif {"info", &CControlAPI::InfoCGI, "text/plain"}, {"version", &CControlAPI::VersionCGI, ""}, // boxcontrol - devices @@ -162,9 +163,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"exec", &CControlAPI::ExecCGI, "+xml"}, {"yweb", &CControlAPI::YWebCGI, "text/plain"}, // video handling -#if 0 {"aspectratio", &CControlAPI::AspectRatioCGI, "text/plain"}, -#endif {"videoformat", &CControlAPI::VideoFormatCGI, "text/plain"}, {"videooutput", &CControlAPI::VideoOutputCGI, "text/plain"}, {"vcroutput", &CControlAPI::VCROutputCGI, "text/plain"}, @@ -383,45 +382,28 @@ void CControlAPI::SystemCGI(CyhookHandler *hh) { if (hh->ParamList["1"] == "getAViAExtIec") { -#if HAVE_DBOX2 hh->printf("%d\n", NeutrinoAPI->Zapit->IecState()); -#else - hh->printf("%d\n", 1); -#endif - } else if (hh->ParamList["setAViAExtIec"] == "on") { -#if HAVE_DBOX2 NeutrinoAPI->Zapit->IecOn(); -#endif hh->SendOk(); } else if (hh->ParamList["setAViAExtIec"] == "off") { -#if HAVE_DBOX2 NeutrinoAPI->Zapit->IecOff(); -#endif hh->SendOk(); } else if (hh->ParamList["1"] == "getAViAExtPlayBack") -#if HAVE_DBOX2 hh->printf("%d\n", NeutrinoAPI->Zapit->PlaybackState()); -#else - hh->printf("%d\n", 1); -#endif else if (hh->ParamList["setAViAExtPlayBack"] == "pes") { -#if HAVE_DBOX2 NeutrinoAPI->Zapit->PlaybackPES(); -#endif hh->SendOk(); } else if (hh->ParamList["setAViAExtPlayBack"] == "spts") { -#if HAVE_DBOX2 NeutrinoAPI->Zapit->PlaybackSPTS(); -#endif hh->SendOk(); } else @@ -450,11 +432,9 @@ void CControlAPI::StandbyCGI(CyhookHandler *hh) hh->SendError(); } else -#if HAVE_DBOX2 // FIXME: not implemented if(NeutrinoAPI->Controld->getVideoPowerDown()) hh->WriteLn("on"); else -#endif hh->WriteLn("off"); } @@ -473,6 +453,25 @@ void CControlAPI::RCCGI(CyhookHandler *hh) hh->SendOk(); } +//----------------------------------------------------------------------------- +void CControlAPI::EsoundCGI(CyhookHandler *hh) +{ + if (!(hh->ParamList.empty())) + { + if (hh->ParamList["1"] == "on") // esound on + { + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::ESOUND_ON, CEventServer::INITID_HTTPD); + } + else if (hh->ParamList["1"] == "off") // esound off + { + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::ESOUND_OFF, CEventServer::INITID_HTTPD); + } + else + hh->SendError(); + } + hh->SendOk(); +} + //----------------------------------------------------------------------------- // Get actual Date // security: strftime has buffer-overflow limit. ok! @@ -483,9 +482,9 @@ void CControlAPI::GetDateCGI(CyhookHandler *hh) { //paramlos char *timestr = new char[50]; - struct timeb tm; - ftime(&tm); - strftime(timestr, 20, "%d.%m.%Y\n", localtime(&tm.time) ); + struct timeval tm; + gettimeofday(&tm, NULL); + strftime(timestr, 20, "%d.%m.%Y\n", localtime(&tm.tv_sec) ); hh->Write(timestr); delete[] timestr; } @@ -515,14 +514,12 @@ void CControlAPI::GetTimeCGI(CyhookHandler *hh) else hh->SendError(); } -#if 0 //----------------------------------------------------------------------------- // send settings void CControlAPI::SettingsCGI(CyhookHandler *hh) { SendSettings(hh); } -#endif //----------------------------------------------------------------------------- // send services.xml void CControlAPI::GetServicesxmlCGI(CyhookHandler *hh) @@ -586,10 +583,8 @@ void CControlAPI::InfoCGI(CyhookHandler *hh) { if (hh->ParamList["1"] == "streaminfo") // print streaminfo SendStreamInfo(hh); -#if 0 else if (hh->ParamList["1"] == "settings") // print settings SendSettings(hh); -#endif else if (hh->ParamList["1"] == "version") // send version file hh->SendFile("/.version"); else if (hh->ParamList["1"] == "httpdversion") // print httpd version typ (only ffor comptibility) @@ -654,52 +649,130 @@ struct key { #endif static const struct key keynames[] = { - {"KEY_POWER", KEY_POWER}, - {"KEY_MUTE", KEY_MUTE}, - {"KEY_1", KEY_1}, - {"KEY_2", KEY_2}, - {"KEY_3", KEY_3}, - {"KEY_4", KEY_4}, - {"KEY_5", KEY_5}, - {"KEY_6", KEY_6}, - {"KEY_7", KEY_7}, - {"KEY_8", KEY_8}, - {"KEY_9", KEY_9}, - {"KEY_0", KEY_0}, - {"KEY_INFO", KEY_INFO}, - {"KEY_MODE", KEY_MODE}, - {"KEY_SETUP", KEY_MENU}, - {"KEY_EPG", KEY_EPG}, - {"KEY_FAVORITES", KEY_FAVORITES}, - {"KEY_HOME", KEY_EXIT}, - {"KEY_UP", KEY_UP}, - {"KEY_LEFT", KEY_LEFT}, - {"KEY_OK", KEY_OK}, - {"KEY_RIGHT", KEY_RIGHT}, - {"KEY_DOWN", KEY_DOWN}, - {"KEY_VOLUMEUP", KEY_VOLUMEUP}, - {"KEY_VOLUMEDOWN", KEY_VOLUMEDOWN}, - {"KEY_PAGEUP", KEY_PAGEUP}, - {"KEY_PAGEDOWN", KEY_PAGEDOWN}, - {"KEY_TV", KEY_TV}, - {"KEY_TEXT", KEY_TEXT}, - {"KEY_RADIO", KEY_RADIO}, - {"KEY_RED", KEY_RED}, - {"KEY_GREEN", KEY_GREEN}, - {"KEY_YELLOW", KEY_YELLOW}, - {"KEY_BLUE", KEY_BLUE}, - {"KEY_SAT", KEY_SAT}, - {"KEY_HELP", KEY_HELP}, - {"KEY_NEXT", KEY_NEXT}, - {"KEY_PREVIOUS", KEY_PREVIOUS}, - {"KEY_TIME", KEY_TIME}, - {"KEY_AUDIO", KEY_AUDIO}, - {"KEY_REWIND", KEY_REWIND}, - {"KEY_FORWARD", KEY_FORWARD}, - {"KEY_PAUSE", KEY_PAUSE}, - {"KEY_RECORD", KEY_RECORD}, - {"KEY_STOP", KEY_STOP}, - {"KEY_PLAY", KEY_PLAY} + {"KEY_0", KEY_0}, + {"KEY_1", KEY_1}, + {"KEY_2", KEY_2}, + {"KEY_3", KEY_3}, + {"KEY_4", KEY_4}, + {"KEY_5", KEY_5}, + {"KEY_6", KEY_6}, + {"KEY_7", KEY_7}, + {"KEY_8", KEY_8}, + {"KEY_9", KEY_9}, + {"KEY_BACKSPACE", KEY_BACKSPACE}, + {"KEY_HOME", KEY_HOME}, + {"KEY_UP", KEY_UP}, + {"KEY_PAGEUP", KEY_PAGEUP}, + {"KEY_LEFT", KEY_LEFT}, + {"KEY_RIGHT", KEY_RIGHT}, + {"KEY_DOWN", KEY_DOWN}, + {"KEY_PAGEDOWN", KEY_PAGEDOWN}, + {"KEY_MUTE", KEY_MUTE}, + {"KEY_VOLUMEDOWN", KEY_VOLUMEDOWN}, + {"KEY_VOLUMEUP", KEY_VOLUMEUP}, + {"KEY_POWER", KEY_POWER}, + {"KEY_HELP", KEY_HELP}, + {"KEY_SETUP", KEY_SETUP}, + {"KEY_OK", KEY_OK}, + {"KEY_RED", KEY_RED}, + {"KEY_GREEN", KEY_GREEN}, + {"KEY_YELLOW", KEY_YELLOW}, + {"KEY_BLUE", KEY_BLUE}, + {"KEY_TOPLEFT", KEY_TOPLEFT}, + {"KEY_TOPRIGHT", KEY_TOPRIGHT}, + {"KEY_BOTTOMLEFT", KEY_BOTTOMLEFT}, + {"KEY_BOTTOMRIGHT", KEY_BOTTOMRIGHT}, + + //////////////// Keys on the IR Keyboard + {"KEY_ESC", KEY_ESC}, + + {"KEY_MINUS", KEY_MINUS}, + {"KEY_EQUAL", KEY_EQUAL}, + {"KEY_TAB", KEY_TAB}, + {"KEY_Q", KEY_Q}, + {"KEY_W", KEY_W}, + {"KEY_E", KEY_E}, + {"KEY_R", KEY_R}, + {"KEY_T", KEY_T}, + {"KEY_Y", KEY_Y}, + {"KEY_U", KEY_U}, + {"KEY_I", KEY_I}, + {"KEY_O", KEY_O}, + {"KEY_P", KEY_P}, + {"KEY_LEFTBRACE", KEY_LEFTBRACE}, + {"KEY_RIGHTBRACE", KEY_RIGHTBRACE}, + {"KEY_ENTER", KEY_ENTER}, + {"KEY_LEFTCTRL", KEY_LEFTCTRL}, + {"KEY_A", KEY_A}, + {"KEY_S", KEY_S}, + {"KEY_D", KEY_D}, + {"KEY_F", KEY_F}, + {"KEY_G", KEY_G}, + {"KEY_H", KEY_H}, + {"KEY_J", KEY_J}, + {"KEY_K", KEY_K}, + {"KEY_L", KEY_L}, + {"KEY_SEMICOLON", KEY_SEMICOLON}, + {"KEY_APOSTROPHE", KEY_APOSTROPHE}, + {"KEY_GRAVE", KEY_GRAVE}, + {"KEY_LEFTSHIFT", KEY_LEFTSHIFT}, + {"KEY_BACKSLASH", KEY_BACKSLASH}, + {"KEY_Z", KEY_Z}, + {"KEY_X", KEY_X}, + {"KEY_C", KEY_C}, + {"KEY_V", KEY_V}, + {"KEY_B", KEY_B}, + {"KEY_N", KEY_N}, + {"KEY_M", KEY_M}, + {"KEY_COMMA", KEY_COMMA}, + {"KEY_DOT", KEY_DOT}, + {"KEY_SLASH", KEY_SLASH}, + {"KEY_RIGHTSHIFT", KEY_RIGHTSHIFT}, + {"KEY_KPASTERISK", KEY_KPASTERISK}, + {"KEY_LEFTALT", KEY_LEFTALT}, + {"KEY_SPACE", KEY_SPACE}, + {"KEY_CAPSLOCK", KEY_CAPSLOCK}, + {"KEY_F1", KEY_F1}, + {"KEY_F2", KEY_F2}, + {"KEY_F3", KEY_F3}, + {"KEY_F4", KEY_F4}, + {"KEY_F5", KEY_F5}, + {"KEY_F6", KEY_F6}, + {"KEY_F7", KEY_F7}, + {"KEY_F8", KEY_F8}, + {"KEY_F9", KEY_F9}, + {"KEY_F10", KEY_F10}, + {"KEY_NUMLOCK", KEY_NUMLOCK}, + {"KEY_SCROLLLOCK", KEY_SCROLLLOCK}, + {"KEY_KP7", KEY_KP7}, + {"KEY_KP8", KEY_KP8}, + {"KEY_KP9", KEY_KP9}, + {"KEY_KPMINUS", KEY_KPMINUS}, + {"KEY_KP4", KEY_KP4}, + {"KEY_KP5", KEY_KP5}, + {"KEY_KP6", KEY_KP6}, + {"KEY_KPPLUS", KEY_KPPLUS}, + {"KEY_KP1", KEY_KP1}, + {"KEY_KP2", KEY_KP2}, + {"KEY_KP3", KEY_KP3}, + {"KEY_KP0", KEY_KP0}, + {"KEY_KPDOT", KEY_KPDOT}, + {"KEY_102ND", KEY_102ND}, + {"KEY_KPENTER", KEY_KPENTER}, + {"KEY_KPSLASH", KEY_KPSLASH}, + {"KEY_SYSRQ", KEY_SYSRQ}, + {"KEY_RIGHTALT", KEY_RIGHTALT}, + {"KEY_END", KEY_END}, + {"KEY_INSERT", KEY_INSERT}, + {"KEY_DELETE", KEY_DELETE}, + + {"KEY_PAUSE", KEY_PAUSE}, + + {"KEY_LEFTMETA", KEY_LEFTMETA}, + {"KEY_RIGHTMETA", KEY_RIGHTMETA}, + + {"BTN_LEFT", BTN_LEFT}, + {"BTN_RIGHT", BTN_RIGHT} }; // The code here is based on rcsim. Thx Carjay! @@ -742,7 +815,6 @@ void CControlAPI::RCEmCGI(CyhookHandler *hh) close(evd); return; } -#if HAVE_DBOX2 for (unsigned int i = 0; i < repeat - 1; i++) { usleep(delay*1000); if (rc_send(evd, sendcode, KEY_AUTOREPEAT) < 0){ @@ -752,7 +824,6 @@ void CControlAPI::RCEmCGI(CyhookHandler *hh) return; } } -#endif if (rc_send(evd, sendcode, KEY_RELEASED)<0){ perror("writing 'KEY_RELEASED' event failed"); close(evd); @@ -762,19 +833,14 @@ void CControlAPI::RCEmCGI(CyhookHandler *hh) close(evd); hh->SendOk(); } -#if 0 //----------------------------------------------------------------------------- void CControlAPI::AspectRatioCGI(CyhookHandler *hh) { -#if HAVE_DBOX2 // FIXME: not implemented hh->printf("%s", NeutrinoAPI->Controld->getAspectRatio() == '\0' ? "4:3" : "16:9"); -#endif } -#endif //----------------------------------------------------------------------------- void CControlAPI::VideoFormatCGI(CyhookHandler *hh) { -#if HAVE_DBOX2 // FIXME: not implemented if (hh->ParamList.empty() || hh->ParamList["1"] == "status") { hh->WriteLn(NeutrinoAPI->videoformat_names[(unsigned int)NeutrinoAPI->Controld->getVideoFormat()]); return; @@ -797,14 +863,12 @@ void CControlAPI::VideoFormatCGI(CyhookHandler *hh) } else { hh->SendError(); } -#endif hh->SendOk(); } //----------------------------------------------------------------------------- void CControlAPI::VideoOutputCGI(CyhookHandler *hh) { -#if HAVE_DBOX2 // FIXME: not implemented unsigned int videooutput=0; if (hh->ParamList.empty() || hh->ParamList["1"] == "status") { hh->WriteLn(NeutrinoAPI->videooutput_names[(unsigned int) NeutrinoAPI->Controld->getVideoOutput()]); @@ -821,17 +885,16 @@ void CControlAPI::VideoOutputCGI(CyhookHandler *hh) videooutput = CControldClient::VIDEOOUTPUT_YUV_CVBS; else { hh->SendError(); + return; } NeutrinoAPI->Controld->setVideoOutput(videooutput); -#endif hh->SendOk(); } //----------------------------------------------------------------------------- void CControlAPI::VCROutputCGI(CyhookHandler *hh) { -#if HAVE_DBOX2 // FIXME: not implemented unsigned int vcroutput; if (hh->ParamList.empty() || hh->ParamList["1"] == "status") { hh->WriteLn(NeutrinoAPI->videooutput_names[(unsigned char)NeutrinoAPI->Controld->getVCROutput()]); @@ -854,7 +917,6 @@ void CControlAPI::VCROutputCGI(CyhookHandler *hh) return; } NeutrinoAPI->Controld->setVCROutput(vcroutput); -#endif hh->SendOk(); return; @@ -863,7 +925,6 @@ void CControlAPI::VCROutputCGI(CyhookHandler *hh) //----------------------------------------------------------------------------- void CControlAPI::ScartModeCGI(CyhookHandler *hh) { -#if HAVE_DBOX2 // FIXME: not implemented bool new_status; if (hh->ParamList.empty() || hh->ParamList["1"] == "status") { hh->printf(NeutrinoAPI->Controld->getScartMode() ? "on" : "off"); @@ -877,40 +938,33 @@ void CControlAPI::ScartModeCGI(CyhookHandler *hh) return; } NeutrinoAPI->Controld->setScartMode(new_status); -#endif hh->SendOk(); } //------------------------------------------------------------------------- void CControlAPI::VolumeCGI(CyhookHandler *hh) { - if (hh->ParamList.empty()) { //without param: show actual volumen - unsigned int volume; - NeutrinoAPI->Zapit->getVolume(&volume, &volume); - hh->printf("%d", volume); - //hh->printf("%d", NeutrinoAPI->Controld->getVolume()); + if (hh->ParamList.empty()) {//without param: show actual volumen + hh->printf("%d", NeutrinoAPI->Controld->getVolume()); } - else if (hh->ParamList["1"].compare("mute") == 0) { - NeutrinoAPI->Zapit->muteAudio(true); + NeutrinoAPI->Controld->setMute(true); hh->SendOk(); } else if (hh->ParamList["1"].compare("unmute") == 0) { - NeutrinoAPI->Zapit->muteAudio(false); + NeutrinoAPI->Controld->setMute(false); hh->SendOk(); } -/* else if (hh->ParamList["1"].compare("status") == 0)//FIXME + else if (hh->ParamList["1"].compare("status") == 0) { - hh->Write((char *) (NeutrinoAPI->Controld->getMute() ? "1" : "0")); // mute } -*/ else if(hh->ParamList["1"]!="") { //set volume char vol = atol( hh->ParamList["1"].c_str() ); - NeutrinoAPI->Zapit->setVolume(vol,vol); + NeutrinoAPI->Controld->setVolume(vol); hh->SendOk(); } else @@ -926,9 +980,6 @@ void CControlAPI::ChannellistCGI(CyhookHandler *hh) //----------------------------------------------------------------------------- void CControlAPI::GetBouquetCGI(CyhookHandler *hh) { - //CZapitClient::BouquetChannelList *bouquet; - CZapitClient::BouquetList blist; - if (!(hh->ParamList.empty())) { int mode = CZapitClient::MODE_CURRENT; @@ -945,10 +996,18 @@ void CControlAPI::GetBouquetCGI(CyhookHandler *hh) if (hh->ParamList["1"] == "actual") { int actual=0; - for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) { - if(g_bouquetManager->existsChannelInBouquet(i, live_channel_id)) { - actual=i+1; - break; + CZapitClient::BouquetChannelList *bouquet; + CZapitClient::BouquetList blist; + //easier? + for (unsigned int i = 0; i < NeutrinoAPI->BouquetList.size() && actual == 0;i++) + { + //hh->printf("%u %s\n", (NeutrinoAPI->BouquetList[i].bouquet_nr) + 1, NeutrinoAPI->BouquetList[i].name); + bouquet = NeutrinoAPI->GetBouquet((NeutrinoAPI->BouquetList[i].bouquet_nr) + 1, mode); + CZapitClient::BouquetChannelList::iterator channel = bouquet->begin(); + for (unsigned int j = 0; channel != bouquet->end() && actual == 0; channel++,j++) + { + if(channel->channel_id == NeutrinoAPI->Zapit->getCurrentServiceID()) + actual=i+1; } } hh->printf("%d",actual); @@ -958,41 +1017,32 @@ void CControlAPI::GetBouquetCGI(CyhookHandler *hh) hh->WriteLn(""); hh->WriteLn(""); hh->printf("\n\t%s\n\n",hh->ParamList["bouquet"].c_str()); + CZapitClient::BouquetChannelList *bouquet; + bouquet = NeutrinoAPI->GetBouquet(atoi(hh->ParamList["bouquet"].c_str()), mode); + CZapitClient::BouquetChannelList::iterator channel = bouquet->begin(); - ZapitChannelList channels; - int BouquetNr = atoi(hh->ParamList["bouquet"].c_str()); - if(BouquetNr > 0) - BouquetNr--; - channels = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->Bouquets[BouquetNr]->radioChannels : g_bouquetManager->Bouquets[BouquetNr]->tvChannels; - int num = 1 + (mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin().getNrofFirstChannelofBouquet(BouquetNr) : g_bouquetManager->tvChannelsBegin().getNrofFirstChannelofBouquet(BouquetNr)) ; - for(int j = 0; j < (int) channels.size(); j++) { - CZapitChannel * channel = channels[j]; + for (unsigned int i = 0; channel != bouquet->end(); channel++,i++) hh->printf("\n\t%u\n\t" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS "\n\t\n\n", - num + j, + channel->nr, channel->channel_id, - channel->getName().c_str()); - } + channel->name); hh->WriteLn(""); } else { - ZapitChannelList channels; - int BouquetNr = atoi(hh->ParamList["bouquet"].c_str()); - if(BouquetNr > 0) - BouquetNr--; - channels = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->Bouquets[BouquetNr]->radioChannels : g_bouquetManager->Bouquets[BouquetNr]->tvChannels; - int num = 1 + (mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin().getNrofFirstChannelofBouquet(BouquetNr) : g_bouquetManager->tvChannelsBegin().getNrofFirstChannelofBouquet(BouquetNr)) ; - for(int j = 0; j < (int) channels.size(); j++) { - CZapitChannel * channel = channels[j]; + CZapitClient::BouquetChannelList *bouquet; + bouquet = NeutrinoAPI->GetBouquet(atoi(hh->ParamList["bouquet"].c_str()), mode); + CZapitClient::BouquetChannelList::iterator channel = bouquet->begin(); + + for (unsigned int i = 0; channel != bouquet->end(); channel++,i++) hh->printf("%u " PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s\n", - num + j, + channel->nr, channel->channel_id, - channel->getName().c_str()); - } + channel->name); } } else @@ -1009,37 +1059,34 @@ void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) //----------------------------------------------------------------------------- void CControlAPI::EpgCGI(CyhookHandler *hh) { - //hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); + CChannelEvent *event; + NeutrinoAPI->GetChannelEvents(); + if (hh->ParamList.empty()) { - hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); - CChannelEvent *event; - NeutrinoAPI->GetChannelEvents(); - - int mode = NeutrinoAPI->Zapit->getMode(); - CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin(); - for (; !(cit.EndOfChannels()); cit++) { - CZapitChannel * channel = *cit; + hh->SetHeader(HTTP_OK, "text/plain"); + CZapitClient::BouquetChannelList *channellist = NeutrinoAPI->GetChannelList(CZapitClient::MODE_CURRENT); + CZapitClient::BouquetChannelList::iterator channel = channellist->begin(); + for(; channel != channellist->end();channel++) + { event = NeutrinoAPI->ChannelListEvents[channel->channel_id]; - if(event) + if (event) hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS - " %llu %s\n", - channel->channel_id, - event->eventID, - event->description.c_str()); + " %llu %s\n", + channel->channel_id, + event->eventID, + event->description.c_str()); } } else if (hh->ParamList["xml"].empty()) { - hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); + hh->SetHeader(HTTP_OK, "text/plain"); if (hh->ParamList["1"] == "ext") { - CChannelEvent *event; - NeutrinoAPI->GetChannelEvents(); - int mode = NeutrinoAPI->Zapit->getMode(); - CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin(); - for (; !(cit.EndOfChannels()); cit++) { - CZapitChannel * channel = *cit; + CZapitClient::BouquetChannelList *channellist = NeutrinoAPI->GetChannelList(CZapitClient::MODE_CURRENT); + CZapitClient::BouquetChannelList::iterator channel = channellist->begin(); + for(; channel != channellist->end();channel++) + { event = NeutrinoAPI->ChannelListEvents[channel->channel_id]; if(event) hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS @@ -1054,11 +1101,10 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) else if (hh->ParamList["eventid"] != "") { //special epg query - uint64_t epgid; + unsigned long long epgid; sscanf( hh->ParamList["eventid"].c_str(), "%llu", &epgid); CShortEPGData epg; - //if (NeutrinoAPI->Sectionsd->getEPGidShort(epgid,&epg)) - if (sectionsd_getEPGidShort(epgid,&epg)) + if (NeutrinoAPI->Sectionsd->getEPGidShort(epgid,&epg)) { hh->WriteLn(epg.title); hh->WriteLn(epg.info1); @@ -1069,13 +1115,12 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { if (hh->ParamList["starttime"] != "") { - uint64_t epgid; + unsigned long long epgid; time_t starttime; sscanf( hh->ParamList["fskid"].c_str(), "%llu", &epgid); sscanf( hh->ParamList["starttime"].c_str(), "%lu", &starttime); CEPGData longepg; - //if(NeutrinoAPI->Sectionsd->getEPGid(epgid, starttime, &longepg)) - if(sectionsd_getEPGid(epgid, starttime, &longepg)) + if(NeutrinoAPI->Sectionsd->getEPGid(epgid, starttime, &longepg)) { hh->printf("%u\n", longepg.fsk); return; @@ -1089,14 +1134,12 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) sscanf(hh->ParamList["id"].c_str(), SCANF_CHANNEL_ID_TYPE, &channel_id); - //NeutrinoAPI->eList = NeutrinoAPI->Sectionsd->getEventsServiceKey(channel_id&0xFFFFFFFFFFFFULL); - sectionsd_getEventsServiceKey(channel_id&0xFFFFFFFFFFFFULL, NeutrinoAPI->eList); + NeutrinoAPI->eList = NeutrinoAPI->Sectionsd->getEventsServiceKey(channel_id); CChannelEventList::iterator eventIterator; for (eventIterator = NeutrinoAPI->eList.begin(); eventIterator != NeutrinoAPI->eList.end(); eventIterator++) { CShortEPGData epg; - //if (NeutrinoAPI->Sectionsd->getEPGidShort(eventIterator->eventID,&epg)) - if (sectionsd_getEPGidShort(eventIterator->eventID,&epg)) + if (NeutrinoAPI->Sectionsd->getEPGidShort(eventIterator->eventID,&epg)) { hh->printf("%llu %ld %d\n", eventIterator->eventID, eventIterator->startTime, eventIterator->duration); hh->printf("%s\n",epg.title.c_str()); @@ -1120,7 +1163,8 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) // stoptime : show only items until stoptime reached else if (!(hh->ParamList["xml"].empty())) { - hh->SetHeader(HTTP_OK, "text/xml; charset=UTF-8"); + hh->SetHeader(HTTP_OK, "text/xml"); + t_channel_id channel_id = (t_channel_id)-1; if (!(hh->ParamList["channelid"].empty())) @@ -1135,10 +1179,9 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) } if(channel_id != (t_channel_id)-1) { - hh->WriteLn(""); + hh->WriteLn(""); hh->WriteLn(""); - //NeutrinoAPI->eList = NeutrinoAPI->Sectionsd->getEventsServiceKey(channel_id&0xFFFFFFFFFFFFULL); - sectionsd_getEventsServiceKey(channel_id&0xFFFFFFFFFFFFULL, NeutrinoAPI->eList); + NeutrinoAPI->eList = NeutrinoAPI->Sectionsd->getEventsServiceKey(channel_id); hh->printf("" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS "\r\n", channel_id); @@ -1167,7 +1210,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) struct tm *mtime = localtime(&eventIterator->startTime); strftime(zbuffer,20,"%H:%M",mtime); hh->printf("\t%s\r\n", zbuffer); - bzero(zbuffer,25); + memset(zbuffer, 0, 25); strftime(zbuffer,20,"%d.%m.%Y",mtime); hh->printf("\t%s\r\n", zbuffer); hh->printf("\t%ld\r\n", eventIterator->startTime+eventIterator->duration); @@ -1181,9 +1224,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) if (!(hh->ParamList["details"].empty())) { CShortEPGData epg; - - //if (NeutrinoAPI->Sectionsd->getEPGidShort(eventIterator->eventID,&epg)) - if (sectionsd_getEPGidShort(eventIterator->eventID,&epg)) + if (NeutrinoAPI->Sectionsd->getEPGidShort(eventIterator->eventID,&epg)) { hh->printf("\t\r\n",epg.info1.c_str()); hh->printf("\t\r\n",epg.info2.c_str()); @@ -1244,16 +1285,32 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh) hh->SendOk(); } else if (hh->ParamList["1"] == "statussectionsd") - hh->Write((char *) (NeutrinoAPI->Sectionsd->getIsScanningActive() ? "1" : "0")); + hh->Write((char *) (NeutrinoAPI->Sectionsd->getIsScanningActive() ? "scanning active" : "scanning paused\n")); + else if (hh->ParamList["1"] == "restartsectionsd") + { + NeutrinoAPI->Sectionsd->Restart(); + hh->printf("--> restarting sectionsd...
"); + NeutrinoAPI->Sectionsd->RegisterNeutrino(); + hh->printf("--> registering neutrino...
"); + NeutrinoAPI->Sectionsd->setPauseScanning(false); + hh->printf("--> set scanning active...
"); + NeutrinoAPI->Sectionsd->setServiceChanged(NeutrinoAPI->Zapit->getCurrentServiceID(), false); + hh->printf("--> send sectionsd ServiceChanged...
"); + hh->printf("
"); + hh->Write((char *) (NeutrinoAPI->Sectionsd->getIsScanningActive() ? "sectionsd restarted, scanning active!" : "sectionsd restarted, scanning paused")); + } + else if (hh->ParamList["1"] == "freememsectionsd") + { + NeutrinoAPI->Sectionsd->freeMemory(); + hh->printf("freeing memory... done!\n"); + } else if (hh->ParamList["1"] == "getallsubchannels") { t_channel_id current_channel = NeutrinoAPI->Zapit->getCurrentServiceID(); CSectionsdClient::LinkageDescriptorList desc; CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; - //NeutrinoAPI->Sectionsd->getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); - sectionsd_getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); - //if (NeutrinoAPI->Sectionsd->getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey,desc)) - if (sectionsd_getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey,desc)) + NeutrinoAPI->Sectionsd->getCurrentNextServiceKey(current_channel, currentNextInfo); + if (NeutrinoAPI->Sectionsd->getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey,desc)) { for(unsigned int i=0;i< desc.size();i++) { @@ -1337,28 +1394,26 @@ void CControlAPI::LCDAction(CyhookHandler *hh) error=1; } if (hh->ParamList["clear"] != "") { - if(sscanf( hh->ParamList["clear"].c_str(), "%d", &tval)) { + if(sscanf( hh->ParamList["clear"].c_str(), "%d", &tval)){ if(tval) NeutrinoAPI->LcdAPI->Clear(); - } else { - error=1; } + else + error=1; } - if (hh->ParamList["png"] != "") + if (hh->ParamList["png"] != "") { if(! NeutrinoAPI->LcdAPI->ShowPng((char*)hh->ParamList["png"].c_str())) error=1; - if (hh->ParamList["raw"] != "") - { + } + if (hh->ParamList["raw"] != "") { char *sptr=strdup((char*)hh->ParamList["raw"].c_str()),*pptr; int loop=4; pptr=sptr; error=1; - if(sscanf(pptr, "%d,%d,%d,%d",&x1,&y1,&x2,&y2)==4) - { + if(sscanf(pptr, "%d,%d,%d,%d",&x1,&y1,&x2,&y2)==4) { while(loop-- && ((pptr=strchr(pptr,','))!=NULL)) ++pptr; - if(pptr) - { + if(pptr) { NeutrinoAPI->LcdAPI->ShowRaw(x1,y1,x2,y2,pptr); error=0; } @@ -1414,9 +1469,9 @@ void CControlAPI::LCDAction(CyhookHandler *hh) if(sscanf( hh->ParamList["update"].c_str(), "%d", &tval)) { if(tval) NeutrinoAPI->LcdAPI->Update(); - } else { - error=1; } + else + error=1; } if(error) hh->SendError(); @@ -1429,9 +1484,7 @@ void CControlAPI::LCDAction(CyhookHandler *hh) void CControlAPI::SendEventList(CyhookHandler *hh, t_channel_id channel_id) { int pos; - - //NeutrinoAPI->eList = NeutrinoAPI->Sectionsd->getEventsServiceKey(channel_id&0xFFFFFFFFFFFFULL); - sectionsd_getEventsServiceKey(channel_id&0xFFFFFFFFFFFFULL, NeutrinoAPI->eList); + NeutrinoAPI->eList = NeutrinoAPI->Sectionsd->getEventsServiceKey(channel_id); CChannelEventList::iterator eventIterator; for (eventIterator = NeutrinoAPI->eList.begin(); eventIterator != NeutrinoAPI->eList.end(); eventIterator++, pos++) @@ -1441,16 +1494,14 @@ void CControlAPI::SendEventList(CyhookHandler *hh, t_channel_id channel_id) //----------------------------------------------------------------------------- void CControlAPI::SendChannelList(CyhookHandler *hh) { - int mode = NeutrinoAPI->Zapit->getMode(); - hh->SetHeader(HTTP_OK, "text/html; charset=UTF-8"); - CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin(); - for (; !(cit.EndOfChannels()); cit++) { - CZapitChannel * channel = *cit; + CZapitClient::BouquetChannelList *channellist = NeutrinoAPI->GetChannelList(CZapitClient::MODE_CURRENT); + CZapitClient::BouquetChannelList::iterator channel = channellist->begin(); + + for(; channel != channellist->end();channel++) hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s\n", channel->channel_id, - channel->getName().c_str()); - } + channel->name); } //----------------------------------------------------------------------------- @@ -1512,10 +1563,8 @@ void CControlAPI::SendAllCurrentVAPid(CyhookHandler *hh) t_channel_id current_channel = NeutrinoAPI->Zapit->getCurrentServiceID(); CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; - //NeutrinoAPI->Sectionsd->getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); - sectionsd_getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); - //if (NeutrinoAPI->Sectionsd->getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) - if (sectionsd_getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) + NeutrinoAPI->Sectionsd->getCurrentNextServiceKey(current_channel, currentNextInfo); + if (NeutrinoAPI->Sectionsd->getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) { for (unsigned int i=0; i< tags.size(); i++) { @@ -1565,11 +1614,9 @@ void CControlAPI::SendAllCurrentVAPid(CyhookHandler *hh) hh->printf("%05u pmt\n",pids.PIDs.pmtpid); } -#if 0 //----------------------------------------------------------------------------- void CControlAPI::SendSettings(CyhookHandler *hh) { -#if 0 hh->WriteLn( "Boxtype " + NeutrinoAPI->Dbox_Hersteller[NeutrinoAPI->Controld->getBoxType()] + @@ -1580,9 +1627,7 @@ void CControlAPI::SendSettings(CyhookHandler *hh) "videoformat " + NeutrinoAPI->videoformat_names[(unsigned char)NeutrinoAPI->Controld->getVideoFormat()] ); -#endif } -#endif //----------------------------------------------------------------------------- void CControlAPI::SendTimers(CyhookHandler *hh) { @@ -1613,9 +1658,7 @@ void CControlAPI::SendTimers(CyhookHandler *hh) case CTimerd::TIMER_RECORD: if (!send_id) { - //strncpy(zAddData, NeutrinoAPI->Zapit->getChannelName(timer->channel_id).c_str(), 22); - strncpy(zAddData, NeutrinoAPI->GetServiceName(timer->channel_id).c_str(), 22); - + strncpy(zAddData, NeutrinoAPI->Zapit->getChannelName(timer->channel_id).c_str(), 22); if (zAddData[0] == 0) strcpy(zAddData, NeutrinoAPI->Zapit->isChannelTVChannel(timer->channel_id) ? "Unbekannter TV-Kanal" : "Unbekannter Radiokanal"); } @@ -1712,7 +1755,7 @@ void CControlAPI::YWeb_SendRadioStreamingPid(CyhookHandler *hh) } //----------------------------------------------------------------------------- -std::string CControlAPI::YexecuteScript(CyhookHandler */*hh*/, std::string cmd) +std::string CControlAPI::YexecuteScript(CyhookHandler *, std::string cmd) { std::string script, para, result; bool found = false; @@ -1806,7 +1849,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) // Alarm Time - Format exact! HH:MM if(hh->ParamList["alTime"] != "") sscanf(hh->ParamList["alTime"].c_str(),"%2d.%2d",&(alarmTime->tm_hour), &(alarmTime->tm_min)); - + alHour = alarmTime->tm_hour; correctTime(alarmTime); alarmTimeT = mktime(alarmTime); announceTimeT = alarmTimeT; @@ -1825,7 +1868,6 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) } correctTime(stopTime); stopTimeT = mktime(stopTime); - alHour = alarmTime->tm_hour; if(hh->ParamList["stDate"] == "" && alHour > stopTime->tm_hour) stopTimeT += 24* 60 * 60; // add 1 Day } @@ -1844,6 +1886,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) alarmTime->tm_hour = atoi(hh->ParamList["ah"].c_str()); if(hh->ParamList["ami"] != "") alarmTime->tm_min = atoi(hh->ParamList["ami"].c_str()); + alarmTime->tm_sec = 0; correctTime(alarmTime); alarmTimeT = mktime(alarmTime); announceTimeT = alarmTimeT; @@ -1860,6 +1903,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) stopTime->tm_hour = atoi(hh->ParamList["sh"].c_str()); if(hh->ParamList["smi"] != "") stopTime->tm_min = atoi(hh->ParamList["smi"].c_str()); + stopTime->tm_sec = 0; correctTime(stopTime); stopTimeT = mktime(stopTime); } @@ -1883,8 +1927,35 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) rep = (CTimerd::CTimerEventRepeat) atoi(hh->ParamList["rep"].c_str()); else // default: no repeat rep = (CTimerd::CTimerEventRepeat)0; + if(((int)rep) >= ((int)CTimerd::TIMERREPEAT_WEEKDAYS) && hh->ParamList["wd"] != "") - NeutrinoAPI->Timerd->getWeekdaysFromStr(&rep, hh->ParamList["wd"].c_str()); + NeutrinoAPI->Timerd->getWeekdaysFromStr((int*)&rep, hh->ParamList["wd"].c_str()); + // apids + bool changeApids=false; + unsigned char apids=0; + if(hh->ParamList["apcf"] == "on") + { + changeApids=true; + apids=0; + } + else + { + if(hh->ParamList["apst"] == "on") + { + changeApids=true; + apids |= TIMERD_APIDS_STD; + } + if(hh->ParamList["apal"] == "on") + { + changeApids=true; + apids |= TIMERD_APIDS_ALT; + } + if(hh->ParamList["apac"] == "on") + { + changeApids=true; + apids |= TIMERD_APIDS_AC3; + } + } CTimerd::RecordingInfo recinfo; CTimerd::EventInfo eventinfo; @@ -1901,6 +1972,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) else eventinfo.channel_id = NeutrinoAPI->ChannelNameToChannelId(hh->ParamList["channel_name"]); + std::string _rec_dir = hh->ParamList["rec_dir"]; void *data=NULL; if(type == CTimerd::TIMER_RECORD) announceTimeT-=120; @@ -1913,15 +1985,16 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) data= &eventinfo; else if (type==CTimerd::TIMER_RECORD) { - std::string _rec_dir = hh->ParamList["rec_dir"]; if(_rec_dir == "") { // get Default Recordingdir CConfigFile *Config = new CConfigFile(','); Config->loadConfig(NEUTRINO_CONFIGFILE); - _rec_dir = Config->getString("network_nfs_recordingdir", "/mnt/filme"); - delete Config;//Memory leak: Config + _rec_dir = Config->getString("recording_dir_0", "/mnt/filme"); + delete Config; } + if(changeApids) + eventinfo.apids = apids; recinfo = eventinfo; strncpy(recinfo.recordingDir, _rec_dir.c_str(), RECORD_DIR_MAXLEN-1); data = &recinfo; @@ -1946,7 +2019,13 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) if(hh->ParamList["id"] != "") { unsigned modyId = atoi(hh->ParamList["id"].c_str()); - NeutrinoAPI->Timerd->removeTimerEvent(modyId); + if(type == CTimerd::TIMER_RECORD) + NeutrinoAPI->Timerd->modifyRecordTimerEvent(modyId, announceTimeT, alarmTimeT, stopTimeT, rep,repCount,_rec_dir.c_str()); + else + NeutrinoAPI->Timerd->modifyTimerEvent(modyId, announceTimeT, alarmTimeT, stopTimeT, rep,repCount); +// NeutrinoAPI->Timerd->removeTimerEvent(modyId); + if(changeApids) + NeutrinoAPI->Timerd->modifyTimerAPid(modyId,apids); } else { @@ -1970,9 +2049,12 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) NeutrinoAPI->Timerd->removeTimerEvent(timer->eventID); break; } + NeutrinoAPI->Timerd->addTimerEvent(type,data,announceTimeT,alarmTimeT,stopTimeT,rep,repCount); } } - NeutrinoAPI->Timerd->addTimerEvent(type,data,announceTimeT,alarmTimeT,stopTimeT,rep,repCount); + else + NeutrinoAPI->Timerd->addTimerEvent(type,data,announceTimeT,alarmTimeT,stopTimeT,rep,repCount); + hh->SendOk(); } //------------------------------------------------------------------------- @@ -2057,7 +2139,7 @@ void CControlAPI::renameBouquetCGI(CyhookHandler *hh) { if (NeutrinoAPI->Zapit->existsBouquet((hh->ParamList["nameto"]).c_str()) == -1) { - NeutrinoAPI->Zapit->renameBouquet(atoi(hh->ParamList["selected"].c_str()) - 1, hh->ParamList["nameto"].c_str()); + NeutrinoAPI->Zapit->renameBouquet(atoi(hh->ParamList["selected"].c_str()) - 1, ZapitTools::Latin1_to_UTF8(hh->ParamList["nameto"].c_str()).c_str()); hh->SendOk(); return; } @@ -2072,7 +2154,7 @@ void CControlAPI::changeBouquetCGI(CyhookHandler *hh) { int selected = atoi(hh->ParamList["selected"].c_str()); CZapitClient::BouquetChannelList BChannelList; - NeutrinoAPI->Zapit->getBouquetChannels(selected - 1, BChannelList, CZapitClient::MODE_CURRENT, true); + NeutrinoAPI->Zapit->getBouquetChannels(selected - 1, BChannelList, CZapitClient::MODE_CURRENT); CZapitClient::BouquetChannelList::iterator channels = BChannelList.begin(); for(; channels != BChannelList.end();channels++) { @@ -2141,8 +2223,7 @@ void CControlAPI::build_live_url(CyhookHandler *hh) if(!pids.APIDs.empty()) apid = pids.APIDs[0].pid; - //xpids = string_printf("0x%04x",apid); - xpids = string_printf("0x%04x,0x%04x",pids.PIDs.pmtpid,apid); + xpids = string_printf("0x%04x",apid); } else hh->SendError(); @@ -2152,10 +2233,8 @@ void CControlAPI::build_live_url(CyhookHandler *hh) url = "http://"+hh->ParamList["host"]; else url = "http://"+hh->HeaderList["Host"]; - //url += (mode == CZapitClient::MODE_TV) ? ":31339/0," : ":31338/"; - url += ":31339/0,"; + url += (mode == CZapitClient::MODE_TV) ? ":31339/0," : ":31338/"; url += xpids; -printf("Live url: %s\n", url.c_str()); // response url if(hh->ParamList["vlc_link"] !="") { @@ -2164,7 +2243,7 @@ printf("Live url: %s\n", url.c_str()); } else { - hh->SetHeader(HTTP_OK, "text/html; charset=UTF-8"); + hh->SetHeader(HTTP_OK, "text/html"); hh->Write(url); } } diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/dbox/controlapi.h similarity index 94% rename from src/nhttpd/tuxboxapi/controlapi.h rename to src/nhttpd/tuxboxapi/dbox/controlapi.h index 70a72ad9a..c63094820 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/dbox/controlapi.h @@ -32,9 +32,7 @@ private: void SendEventList(CyhookHandler *hh,t_channel_id channel_id); void SendcurrentVAPid(CyhookHandler *hh); void SendAllCurrentVAPid(CyhookHandler *hh); -#if 0 void SendSettings(CyhookHandler *hh); -#endif void SendStreamInfo(CyhookHandler *hh); void SendBouquets(CyhookHandler *hh); void SendBouquet(CyhookHandler *hh,int BouquetNr); @@ -45,7 +43,7 @@ private: friend class CNeutrinoWebserver; // for timer /fb/ compatibility void doModifyTimer(CyhookHandler *hh); void doNewTimer(CyhookHandler *hh); - + //yweb void YWeb_SendVideoStreamingPids(CyhookHandler *hh, int apid_no); void YWeb_SendRadioStreamingPid(CyhookHandler *hh); @@ -59,12 +57,11 @@ private: void ExecCGI(CyhookHandler *hh); void SystemCGI(CyhookHandler *hh); void StandbyCGI(CyhookHandler *hh); + void EsoundCGI(CyhookHandler *hh); void RCCGI(CyhookHandler *hh); void GetDateCGI(CyhookHandler *hh); void GetTimeCGI(CyhookHandler *hh); -#if 0 void SettingsCGI(CyhookHandler *hh); -#endif void GetServicesxmlCGI(CyhookHandler *hh); void GetBouquetsxmlCGI(CyhookHandler *hh); void GetChannel_IDCGI(CyhookHandler *hh); @@ -83,9 +80,7 @@ private: void YWebCGI(CyhookHandler *hh); void RebootCGI(CyhookHandler *hh); void RCEmCGI(CyhookHandler *hh); -#if 0 void AspectRatioCGI(CyhookHandler *hh); -#endif void VideoFormatCGI(CyhookHandler *hh); void VideoOutputCGI(CyhookHandler *hh); void VCROutputCGI(CyhookHandler *hh); @@ -103,7 +98,7 @@ private: protected: static const unsigned int PLUGIN_DIR_COUNT = 5; static std::string PLUGIN_DIRS[PLUGIN_DIR_COUNT]; - CNeutrinoAPI *NeutrinoAPI; + CNeutrinoAPI *NeutrinoAPI; void init(CyhookHandler *hh); void Execute(CyhookHandler *hh); @@ -114,8 +109,9 @@ public: // virtual functions for HookHandler/Hook virtual std::string getHookName(void) {return std::string("mod_ControlAPI");} - virtual std::string getHookVersion(void) {return std::string("$Revision: 1.4 $");} - virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); + virtual std::string getHookVersion(void) {return std::string("$Revision: 1.1.2.1 $");} + virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); + virtual THandleStatus Hook_PrepareResponse(CyhookHandler *hh); }; #endif /* __nhttpd_neutrinocontrolapi_hpp__ */ diff --git a/src/nhttpd/tuxboxapi/lcdapi.cpp b/src/nhttpd/tuxboxapi/dbox/lcdapi.cpp old mode 100755 new mode 100644 similarity index 89% rename from src/nhttpd/tuxboxapi/lcdapi.cpp rename to src/nhttpd/tuxboxapi/dbox/lcdapi.cpp index 45edf3ca5..e75454868 --- a/src/nhttpd/tuxboxapi/lcdapi.cpp +++ b/src/nhttpd/tuxboxapi/dbox/lcdapi.cpp @@ -4,7 +4,7 @@ Copyright (C) 2001/2002 Dirk Szymanski 'Dirch' Copyright (C) 2005 SnowHead - $Id: lcdapi.cpp,v 1.1 2006/09/16 14:47:44 yjogol Exp $ + $Id: lcdapi.cpp,v 1.1.2.1 2010/02/21 10:10:12 cvs Exp $ License: GPL @@ -86,7 +86,7 @@ void CLCDAPI::LockDisplay(int plock) } } -void CLCDAPI::DrawLine(int /*x1*/, int /*y1*/, int /*x2*/, int /*y2*/, int /*col*/) +void CLCDAPI::DrawLine(int x1, int y1, int x2, int y2, int col) { #if HAVE_LCD int color=(col==0)?(CLCDDisplay::PIXEL_OFF):((col==2)?(CLCDDisplay::PIXEL_INV):(CLCDDisplay::PIXEL_ON)); @@ -94,7 +94,7 @@ void CLCDAPI::DrawLine(int /*x1*/, int /*y1*/, int /*x2*/, int /*y2*/, int /*col #endif } -void CLCDAPI::DrawRect(int /*x1*/, int /*y1*/, int /*x2*/, int /*y2*/, int /*coll*/, int /*colf*/) +void CLCDAPI::DrawRect(int x1, int y1, int x2, int y2, int coll, int colf) { #if HAVE_LCD int colorl=(coll==0)?(CLCDDisplay::PIXEL_OFF):((coll==2)?(CLCDDisplay::PIXEL_INV):(CLCDDisplay::PIXEL_ON)); @@ -103,7 +103,7 @@ void CLCDAPI::DrawRect(int /*x1*/, int /*y1*/, int /*x2*/, int /*y2*/, int /*col #endif } -void CLCDAPI::DrawText(int /*px*/, int /*py*/, int /*psize*/, int /*pcolor*/, int /*pfont*/, char */*pmsg*/) +void CLCDAPI::DrawText(int px, int py, int psize, int pcolor, int pfont, char *pmsg) { #if HAVE_LCD int color=(pcolor==0)?(CLCDDisplay::PIXEL_OFF):((pcolor==2)?(CLCDDisplay::PIXEL_INV):(CLCDDisplay::PIXEL_ON)); @@ -116,7 +116,7 @@ void CLCDAPI::DrawText(int /*px*/, int /*py*/, int /*psize*/, int /*pcolor*/, in #endif } -bool CLCDAPI::ShowPng(char */*filename*/) +bool CLCDAPI::ShowPng(char *filename) { #if HAVE_LCD return display.load_png(filename); @@ -124,13 +124,13 @@ bool CLCDAPI::ShowPng(char */*filename*/) return 0; } -void CLCDAPI::ShowRaw(int /*xpos*/, int /*ypos*/, int /*xsize*/, int /*ysize*/, char */*ascreen*/) +void CLCDAPI::ShowRaw(int xpos, int ypos, int xsize, int ysize, char *ascreen) { #if HAVE_LCD int sbyte,dbit,dxpos,dypos,wasinc=0,gotval; char *sptr=ascreen; raw_display_t rscreen; - + display.dump_screen(&rscreen); gotval=sscanf(sptr,"%d",&sbyte); for(dypos=ypos; gotval && (dypos<(ypos+ysize)); dypos++) @@ -173,7 +173,7 @@ void CLCDAPI::ShowRaw(int /*xpos*/, int /*ypos*/, int /*xsize*/, int /*ysize*/, display.load_screen(&rscreen); #endif } - + //------------------------------------------------------------------------- // Konstruktor und destruktor @@ -183,7 +183,7 @@ CLCDAPI::CLCDAPI() { #if HAVE_LCD // int i; - + // display = new CLCDDisplay(); fontRenderer = new LcdFontRenderClass(&display); diff --git a/src/nhttpd/tuxboxapi/lcdapi.h b/src/nhttpd/tuxboxapi/dbox/lcdapi.h old mode 100755 new mode 100644 similarity index 96% rename from src/nhttpd/tuxboxapi/lcdapi.h rename to src/nhttpd/tuxboxapi/dbox/lcdapi.h index af11a38d2..9190b5822 --- a/src/nhttpd/tuxboxapi/lcdapi.h +++ b/src/nhttpd/tuxboxapi/dbox/lcdapi.h @@ -4,7 +4,7 @@ Copyright (C) 2001/2002 Dirk Szymanski 'Dirch' Copyright (C) 2005 SnowHead - $Id: lcdapi.h,v 1.1 2006/09/16 14:47:44 yjogol Exp $ + $Id: lcdapi.h,v 1.1.2.1 2010/02/21 10:10:12 cvs Exp $ License: GPL diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/dbox/neutrinoapi.cpp similarity index 89% rename from src/nhttpd/tuxboxapi/neutrinoapi.cpp rename to src/nhttpd/tuxboxapi/dbox/neutrinoapi.cpp index c544559da..930830a4c 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/dbox/neutrinoapi.cpp @@ -39,7 +39,7 @@ void sectionsd_getChannelEvents(CChannelEventList &eList, const bool tv_mode = t //============================================================================= static std::map iso639; - +#ifndef initialize_iso639_map bool _initialize_iso639_map(void) { std::string s, t, u, v; @@ -61,7 +61,7 @@ bool _initialize_iso639_map(void) else return false; } - +#endif //----------------------------------------------------------------------------- const char * _getISO639Description(const char * const iso) { @@ -85,7 +85,7 @@ std::string CNeutrinoAPI::audiotype_names[5] = {"none", "single channel","dual //============================================================================= CNeutrinoAPI::CNeutrinoAPI() { - //Controld = new CControldClient(); + Controld = new CControldClient(); Sectionsd = new CSectionsdClient(); Zapit = new CZapitClient(); Timerd = new CTimerdClient(); @@ -107,6 +107,8 @@ CNeutrinoAPI::CNeutrinoAPI() EventServer->registerEvent2( NeutrinoMessages::EVT_START_PLUGIN, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); EventServer->registerEvent2( NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); EventServer->registerEvent2( NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); + EventServer->registerEvent2( NeutrinoMessages::ESOUND_ON, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); + EventServer->registerEvent2( NeutrinoMessages::ESOUND_OFF, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); } //------------------------------------------------------------------------- @@ -118,8 +120,8 @@ CNeutrinoAPI::~CNeutrinoAPI(void) delete NeutrinoYParser; if (ControlAPI) delete ControlAPI; - //if (Controld) - // delete Controld; + if (Controld) + delete Controld; if (Sectionsd) delete Sectionsd; if (Zapit) @@ -134,15 +136,12 @@ CNeutrinoAPI::~CNeutrinoAPI(void) void CNeutrinoAPI::UpdateBouquets(void) { -#if 0 BouquetList.clear(); - Zapit->getBouquets(BouquetList, true, true); - + Zapit->getBouquets(BouquetList, true); for (unsigned int i = 1; i <= BouquetList.size(); i++) UpdateBouquet(i); UpdateChannelList(); -#endif } //------------------------------------------------------------------------- @@ -166,7 +165,7 @@ void CNeutrinoAPI::ZapToChannelId(t_channel_id channel_id) } if (Zapit->zapTo_serviceID(channel_id) != CZapitClient::ZAP_INVALID_PARAM) - Sectionsd->setServiceChanged(channel_id&0xFFFFFFFFFFFFULL, false); + Sectionsd->setServiceChanged(channel_id, false); } //------------------------------------------------------------------------- @@ -179,7 +178,7 @@ void CNeutrinoAPI::ZapToSubService(const char * const target) &channel_id); if (Zapit->zapTo_subServiceID(channel_id) != CZapitClient::ZAP_INVALID_PARAM) - Sectionsd->setServiceChanged(channel_id&0xFFFFFFFFFFFFULL, false); + Sectionsd->setServiceChanged(channel_id, false); } //------------------------------------------------------------------------- t_channel_id CNeutrinoAPI::ChannelNameToChannelId(std::string search_channel_name) @@ -188,16 +187,18 @@ t_channel_id CNeutrinoAPI::ChannelNameToChannelId(std::string search_channel_nam //int mode = Zapit->getMode(); t_channel_id channel_id = (t_channel_id)-1; CStringArray channel_names = ySplitStringVector(search_channel_name, ","); - - for (tallchans_iterator it = allchans.begin(); it != allchans.end(); it++) { - std::string channel_name = it->second.getName(); + CZapitClient::BouquetChannelList *channellist = GetChannelList(CZapitClient::MODE_CURRENT); + CZapitClient::BouquetChannelList::iterator channel = channellist->begin(); + for(; channel != channellist->end();channel++) + { + std::string channel_name = channel->name; for(unsigned int j=0;jsecond.channel_id; + channel_id = channel->channel_id; break; } } @@ -236,15 +237,10 @@ bool CNeutrinoAPI::GetStreamInfo(int bitInfo[10]) value=strtoul(tmpptr,NULL,0); bitInfo[pos]= value; pos++; -#if !HAVE_DB0X2 - if(pos > 4) break; -#endif } } -#if !HAVE_DB0X2 bitInfo[4] = 37500; bitInfo[6] = 3; -#endif fclose(fd); return true; @@ -254,8 +250,7 @@ bool CNeutrinoAPI::GetStreamInfo(int bitInfo[10]) bool CNeutrinoAPI::GetChannelEvents(void) { - //eList = Sectionsd->getChannelEvents(); - sectionsd_getChannelEvents(eList); + eList = Sectionsd->getChannelEvents(); CChannelEventList::iterator eventIterator; ChannelListEvents.clear(); @@ -273,29 +268,21 @@ bool CNeutrinoAPI::GetChannelEvents(void) std::string CNeutrinoAPI::GetServiceName(t_channel_id channel_id) { - tallchans_iterator it = allchans.find(channel_id); - if (it != allchans.end()) - it->second.getName(); -#if 0 unsigned int i; + for (i = 0; i < TVChannelList.size(); i++) if (TVChannelList[i].channel_id == channel_id) return TVChannelList[i].name; for (i = 0; i < RadioChannelList.size(); i++) if (RadioChannelList[i].channel_id == channel_id) return RadioChannelList[i].name; -#endif return ""; } //------------------------------------------------------------------------- -CZapitClient::BouquetChannelList *CNeutrinoAPI::GetBouquet(unsigned int /*BouquetNr*/, int /*Mode*/) +CZapitClient::BouquetChannelList *CNeutrinoAPI::GetBouquet(unsigned int BouquetNr, int Mode) { -//FIXME - printf("CNeutrinoAPI::GetChannelList still used !\n"); - return NULL; -#if 0 int mode; if (Mode == CZapitClient::MODE_CURRENT) @@ -307,17 +294,12 @@ CZapitClient::BouquetChannelList *CNeutrinoAPI::GetBouquet(unsigned int /*Bouque return &TVBouquetsList[BouquetNr]; else return &RadioBouquetsList[BouquetNr]; -#endif } //------------------------------------------------------------------------- -CZapitClient::BouquetChannelList *CNeutrinoAPI::GetChannelList(int /*Mode*/) +CZapitClient::BouquetChannelList *CNeutrinoAPI::GetChannelList(int Mode) { -//FIXME - printf("CNeutrinoAPI::GetChannelList still used !\n"); - return NULL; -#if 0 int mode; if (Mode == CZapitClient::MODE_CURRENT) @@ -329,31 +311,24 @@ CZapitClient::BouquetChannelList *CNeutrinoAPI::GetChannelList(int /*Mode*/) return &TVChannelList; else return &RadioChannelList; -#endif } //------------------------------------------------------------------------- - -void CNeutrinoAPI::UpdateBouquet(unsigned int /*BouquetNr*/) +void CNeutrinoAPI::UpdateBouquet(unsigned int BouquetNr) { -#if 0 //FIXME TVBouquetsList[BouquetNr].clear(); RadioBouquetsList[BouquetNr].clear(); - Zapit->getBouquetChannels(BouquetNr - 1, TVBouquetsList[BouquetNr], CZapitClient::MODE_TV, true); - Zapit->getBouquetChannels(BouquetNr - 1, RadioBouquetsList[BouquetNr], CZapitClient::MODE_RADIO, true); -#endif + Zapit->getBouquetChannels(BouquetNr - 1, TVBouquetsList[BouquetNr], CZapitClient::MODE_TV); + Zapit->getBouquetChannels(BouquetNr - 1, RadioBouquetsList[BouquetNr], CZapitClient::MODE_RADIO); } //------------------------------------------------------------------------- - void CNeutrinoAPI::UpdateChannelList(void) { -#if 0 TVChannelList.clear(); RadioChannelList.clear(); - Zapit->getChannels(RadioChannelList, CZapitClient::MODE_RADIO, CZapitClient::SORT_BOUQUET, true); - Zapit->getChannels(TVChannelList, CZapitClient::MODE_TV, CZapitClient::SORT_BOUQUET, true); -#endif + Zapit->getChannels(RadioChannelList, CZapitClient::MODE_RADIO); + Zapit->getChannels(TVChannelList, CZapitClient::MODE_TV); } //------------------------------------------------------------------------- diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.h b/src/nhttpd/tuxboxapi/dbox/neutrinoapi.h similarity index 95% rename from src/nhttpd/tuxboxapi/neutrinoapi.h rename to src/nhttpd/tuxboxapi/dbox/neutrinoapi.h index 38c36d0b1..4c3a0cf0c 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.h +++ b/src/nhttpd/tuxboxapi/dbox/neutrinoapi.h @@ -6,7 +6,7 @@ #include // tuxbox -//#include +#include #include #include #include @@ -28,7 +28,7 @@ bool _initialize_iso639_map(void); class CNeutrinoAPI { // Clientlibs - //CControldClient *Controld; + CControldClient *Controld; CSectionsdClient *Sectionsd; CZapitClient *Zapit; CTimerdClient *Timerd; @@ -83,6 +83,7 @@ public: CControlAPI *ControlAPI; friend class CNeutrinoYParser; // Backreference + friend class CNeutrinoYParserCoolstream; // Backreference friend class CControlAPI; }; diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/dbox/neutrinoyparser.cpp similarity index 74% rename from src/nhttpd/tuxboxapi/neutrinoyparser.cpp rename to src/nhttpd/tuxboxapi/dbox/neutrinoyparser.cpp index c73db32a3..5dd6c0249 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/dbox/neutrinoyparser.cpp @@ -7,6 +7,7 @@ #include #include #include +#include // system #include //ntohs #include //ntohs @@ -21,22 +22,6 @@ #include "neutrinoyparser.h" #include "neutrinoapi.h" -#include -#include -#include - -#include -#include - -extern tallchans allchans; -extern CBouquetManager *g_bouquetManager; -extern t_channel_id live_channel_id; - -bool sectionsd_getNVODTimesServiceKey(const t_channel_id uniqueServiceKey, CSectionsdClient::NVODTimesList& nvod_list); -void sectionsd_getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next ); -bool sectionsd_getComponentTagsUniqueKey(const event_id_t uniqueKey, CSectionsdClient::ComponentTagList& tags); -bool sectionsd_getActualEPGServiceKey(const t_channel_id uniqueServiceKey, CEPGData * epgdata); - //============================================================================= // Constructor & Destructor & Initialization //============================================================================= @@ -59,7 +44,7 @@ THandleStatus CNeutrinoYParser::Hook_SendResponse(CyhookHandler *hh) { hh->status = HANDLED_NONE; -// log_level_printf(4,"Neutrinoparser Hook Start url:%s\n",hh->UrlData["url"].c_str()); + log_level_printf(4,"Neutrinoparser Hook Start url:%s\n",hh->UrlData["url"].c_str()); init(hh); CNeutrinoYParser *yP = new CNeutrinoYParser(NeutrinoAPI); // create a Session @@ -74,7 +59,7 @@ THandleStatus CNeutrinoYParser::Hook_SendResponse(CyhookHandler *hh) delete yP; -// log_level_printf(4,"Neutrinoparser Hook Ende status:%d\n",(int)hh->status); + log_level_printf(4,"Neutrinoparser Hook Ende status:%d\n",(int)hh->status); // log_level_printf(5,"Neutrinoparser Hook Result:%s\n",hh->yresult.c_str()); return hh->status; @@ -89,6 +74,15 @@ THandleStatus CNeutrinoYParser::Hook_ReadConfig(CConfigFile *Config, CStringList ConfigList["ExtrasDocumentURL"] = Config->getString("ExtrasDocURL", EXTRASDOCUMENTURL); // ConfigList["NewGui"] = Config->getString("NewGui", "true"); ConfigList["Zapit_XML_Path"] = Config->getString("Zapit_XML_Path", ZAPITXMLPATH); + ConfigList["TUXBOX_LOGOS_URL"]= Config->getString("Tuxbox.LogosURL", TUXBOX_LOGOS_URL); + + if (Config->getInt32("configfile.version") < 3) + { + Config->setString("Tuxbox.LogosURL", Config->getString("ExtrasDocURL", EXTRASDOCUMENTURL) +"/logos"); + Config->setInt32("configfile.version", CONF_VERSION); + Config->saveConfig(HTTPD_CONFIGFILE); + } + return HANDLED_CONTINUE; } @@ -147,7 +141,7 @@ std::string CNeutrinoYParser::YWeb_cgi_func(CyhookHandler *hh, std::string ycmd //------------------------------------------------------------------------- // y-func : mount_get_list //------------------------------------------------------------------------- -std::string CNeutrinoYParser::func_mount_get_list(CyhookHandler */*hh*/, std::string /*para*/) +std::string CNeutrinoYParser::func_mount_get_list(CyhookHandler *, std::string) { CConfigFile *Config = new CConfigFile(','); std::string ysel, ytype, yip, ylocal_dir, ydir, ynr, yresult; @@ -176,7 +170,7 @@ std::string CNeutrinoYParser::func_mount_get_list(CyhookHandler */*hh*/, std::s //------------------------------------------------------------------------- // y-func : mount_set_values //------------------------------------------------------------------------- -std::string CNeutrinoYParser::func_mount_set_values(CyhookHandler *hh, std::string /*para*/) +std::string CNeutrinoYParser::func_mount_set_values(CyhookHandler *hh, std::string) { CConfigFile *Config = new CConfigFile(','); std::string ynr, yresult; @@ -201,32 +195,20 @@ std::string CNeutrinoYParser::func_mount_set_values(CyhookHandler *hh, std::str //------------------------------------------------------------------------- // y-func : get_bouquets_as_dropdown [] //------------------------------------------------------------------------- -std::string CNeutrinoYParser::func_get_bouquets_as_dropdown(CyhookHandler */*hh*/, std::string para) +std::string CNeutrinoYParser::func_get_bouquets_as_dropdown(CyhookHandler *, std::string para) { std::string ynr, yresult, sel, nr_str, do_show_hidden; - int nr=1; + unsigned int nr=1; ySplitString(para," ",nr_str, do_show_hidden); if(nr_str != "") nr = atoi(nr_str.c_str()); - - int mode = NeutrinoAPI->Zapit->getMode(); - for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) { - ZapitChannelList * channels = mode == CZapitClient::MODE_RADIO ? &g_bouquetManager->Bouquets[i]->radioChannels : &g_bouquetManager->Bouquets[i]->tvChannels; - sel=(nr==(i+1)) ? "selected=\"selected\"" : ""; - if(!channels->empty() && (!g_bouquetManager->Bouquets[i]->bHidden || do_show_hidden == "true")) - yresult += string_printf("\n", i + 1, sel.c_str(), - (encodeString(std::string(g_bouquetManager->Bouquets[i]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) :g_bouquetManager->Bouquets[i]->Name.c_str()))).c_str()); - //yresult += string_printf("\n", i + 1, sel.c_str(), (encodeString(std::string(g_bouquetManager->Bouquets[i]->Name.c_str()))).c_str()); - } -#if 0 for (unsigned int i = 0; i < NeutrinoAPI->BouquetList.size();i++) { sel=(nr==(i+1)) ? "selected=\"selected\"" : ""; if(!NeutrinoAPI->BouquetList[i].hidden || do_show_hidden == "true") yresult += string_printf("\n", (NeutrinoAPI->BouquetList[i].bouquet_nr) + 1, sel.c_str(), (encodeString(std::string(NeutrinoAPI->BouquetList[i].name))).c_str()); } -#endif return yresult; } @@ -234,19 +216,13 @@ std::string CNeutrinoYParser::func_get_bouquets_as_dropdown(CyhookHandler */*hh // y-func : get_bouquets_as_templatelist [~] // TODO: select actual Bouquet //------------------------------------------------------------------------- -std::string CNeutrinoYParser::func_get_bouquets_as_templatelist(CyhookHandler */*hh*/, std::string para) +std::string CNeutrinoYParser::func_get_bouquets_as_templatelist(CyhookHandler *, std::string para) { std::string yresult, ytemplate, do_show_hidden; + log_level_printf(4,"func_get_bouquets_as_templatelist STARt\n"); ySplitString(para,"~",ytemplate, do_show_hidden); //ytemplate += "\n"; //FIXME add newline to printf - for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) { - if(!g_bouquetManager->Bouquets[i]->bHidden || do_show_hidden == "true") { - yresult += string_printf(ytemplate.c_str(), i + 1, g_bouquetManager->Bouquets[i]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : g_bouquetManager->Bouquets[i]->Name.c_str()); - yresult += "\r\n"; - } - } -#if 0 for (unsigned int i = 0; i < NeutrinoAPI->BouquetList.size();i++) { if(!NeutrinoAPI->BouquetList[i].hidden || do_show_hidden == "true") @@ -255,22 +231,27 @@ std::string CNeutrinoYParser::func_get_bouquets_as_templatelist(CyhookHandler * yresult += "\r\n"; } } -#endif + log_level_printf(4,"func_get_bouquets_as_templatelist END\n"); + return yresult; } //------------------------------------------------------------------------- // y-func : get_actual_bouquet_number //------------------------------------------------------------------------- -std::string CNeutrinoYParser::func_get_actual_bouquet_number(CyhookHandler */*hh*/, std::string /*para*/) +std::string CNeutrinoYParser::func_get_actual_bouquet_number(CyhookHandler *, std::string) { - //CZapitClient::BouquetChannelList *bouquet; - //int mode = CZapitClient::MODE_CURRENT; int actual=0; + CZapitClient::BouquetChannelList *bouquet; + int mode = CZapitClient::MODE_CURRENT; - for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) { - if(g_bouquetManager->existsChannelInBouquet(i, live_channel_id)) { - actual=i+1; - break; + for (unsigned int i = 0; i < NeutrinoAPI->BouquetList.size() && actual == 0;i++) + { + bouquet = NeutrinoAPI->GetBouquet((NeutrinoAPI->BouquetList[i].bouquet_nr) + 1, mode); + CZapitClient::BouquetChannelList::iterator channel = bouquet->begin(); + for (unsigned int j = 0; channel != bouquet->end() && actual == 0; channel++,j++) + { + if(channel->channel_id == NeutrinoAPI->Zapit->getCurrentServiceID()) + actual=i+1; } } return std::string(itoa(actual)); @@ -279,32 +260,32 @@ std::string CNeutrinoYParser::func_get_actual_bouquet_number(CyhookHandler */*h //------------------------------------------------------------------------- // y-func : get_channel_dropdown [ []] //------------------------------------------------------------------------- -std::string CNeutrinoYParser::func_get_channels_as_dropdown(CyhookHandler */*hh*/, std::string para) +std::string CNeutrinoYParser::func_get_channels_as_dropdown(CyhookHandler *, std::string para) { + CZapitClient::BouquetChannelList *bouquet; + CZapitClient::BouquetList blist; std::string abouquet, achannel_id, yresult, sel, sid; int bnumber = 1; - //int mode = CZapitClient::MODE_CURRENT; - int mode = NeutrinoAPI->Zapit->getMode(); + int mode = CZapitClient::MODE_CURRENT; ySplitString(para," ",abouquet, achannel_id); if(abouquet != "") bnumber = atoi(abouquet.c_str()); + if(bnumber != 0) //Bouquet View + { + bouquet = NeutrinoAPI->GetBouquet(bnumber, mode); + CZapitClient::BouquetChannelList::iterator channel = bouquet->begin(); + CEPGData epg; - if(bnumber > 0) { - bnumber--; - ZapitChannelList channels; - channels = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->Bouquets[bnumber]->radioChannels : g_bouquetManager->Bouquets[bnumber]->tvChannels; - for(int j = 0; j < (int) channels.size(); j++) { - CEPGData epg; - CZapitChannel * channel = channels[j]; - char buf[100],id[20]; - sprintf(id,PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS,channel->channel_id); - std::string _sid = std::string(id); - sel = (_sid == achannel_id) ? "selected=\"selected\"" : ""; - sectionsd_getActualEPGServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, &epg); - sprintf(buf,"\n", channel->channel_id, sel.c_str(), channel->getName().c_str(),epg.title.c_str()); - yresult += buf; + for (unsigned int i = 0; channel != bouquet->end(); channel++,i++) + { + sid = string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS,channel->channel_id); + sel = (sid == achannel_id) ? "selected=\"selected\"" : ""; + NeutrinoAPI->Sectionsd->getActualEPGServiceKey(channel->channel_id, &epg); + std::string encoded_channel_name = encodeString(std::string(channel->name).substr(0,19)); + std::string encoded_title = encodeString((epg.title).substr(0,29)); + yresult += string_printf("\n", channel->channel_id, sel.c_str(), encoded_channel_name.c_str(),encoded_title.c_str()); } } return yresult; @@ -317,45 +298,31 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: { int BouquetNr = 0; std::string abnumber, tmp,yresult; - //CZapitClient::BouquetChannelList *channellist; - - ZapitChannelList channels; - int num; - int mode = NeutrinoAPI->Zapit->getMode(); + CZapitClient::BouquetChannelList *channellist; ySplitString(para," ",abnumber, tmp); if(abnumber != "") BouquetNr = atoi(abnumber.c_str()); - if (BouquetNr > 0) { - BouquetNr--; - channels = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->Bouquets[BouquetNr]->radioChannels : g_bouquetManager->Bouquets[BouquetNr]->tvChannels; - num = 1 + (mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin().getNrofFirstChannelofBouquet(BouquetNr) : g_bouquetManager->tvChannelsBegin().getNrofFirstChannelofBouquet(BouquetNr)) ; - } else { - CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin(); - for (; !(cit.EndOfChannels()); cit++) - channels.push_back(*cit); - num = 1; - } + if (BouquetNr > 0) + channellist = NeutrinoAPI->GetBouquet(BouquetNr, CZapitClient::MODE_CURRENT); + else + channellist = NeutrinoAPI->GetChannelList(CZapitClient::MODE_CURRENT); NeutrinoAPI->GetChannelEvents(); int i = 1; char classname; - t_channel_id current_channel = live_channel_id; //NeutrinoAPI->Zapit->getCurrentServiceID(); + t_channel_id current_channel = NeutrinoAPI->Zapit->getCurrentServiceID(); int prozent; CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; std::string timestr; bool have_logos = false; - if(hh->WebserverConfigList["ExtrasDocumentRoot"] == "web" || (access((hh->WebserverConfigList["ExtrasDocumentRoot"]+"/logos").c_str(),4)==0) ) + if(hh->WebserverConfigList["TUXBOX_LOGOS_URL"] != "" ||hh->WebserverConfigList["ExtrasDocumentRoot"] == "web" || (access((hh->WebserverConfigList["ExtrasDocumentRoot"]+"/logos").c_str(),4)==0) ) have_logos = true; - - //CZapitClient::BouquetChannelList::iterator channel = channellist->begin(); - //for (; channel != channellist->end();channel++) - for(int j = 0; j < (int) channels.size(); j++) + CZapitClient::BouquetChannelList::iterator channel = channellist->begin(); + for (; channel != channellist->end();channel++) { - CZapitChannel * channel = channels[j]; -#if 1 CChannelEvent *event; event = NeutrinoAPI->ChannelListEvents[channel->channel_id]; @@ -368,12 +335,11 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: if(have_logos) yresult += string_printf("", classname, channel->channel_id, - (hh->WebserverConfigList["ExtrasDocumentURL"]).c_str(), - channel->channel_id & 0xFFFFFFFFFFFFULL); - + ".gif\" alt=\"%s\"/>", classname, channel->channel_id, + (hh->WebserverConfigList["TUXBOX_LOGOS_URL"]).c_str(), + channel->channel_id, channel->name); /* timer slider */ if(event && event->duration > 0) prozent = 100 * (time(NULL) - event->startTime) / event->duration; @@ -399,9 +365,9 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: "')\">%s\n", ((channel->channel_id == current_channel) ? "" : " "), channel->channel_id, - num + j /*channel->nr*/, - channel->getName().c_str(), - (channel->getServiceType() == ST_NVOD_REFERENCE_SERVICE) ? " (NVOD)" : "", + channel->nr, + channel->name, + (channel->service_type == ST_NVOD_REFERENCE_SERVICE) ? " (NVOD)" : "", channel->channel_id, ((NeutrinoAPI->ChannelListEvents[channel->channel_id]) ? "\"Programmvorschau\"" : "")); @@ -410,13 +376,10 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: yresult += string_printf("\n\n\n"); - - if (channel->getServiceType() == ST_NVOD_REFERENCE_SERVICE) + if (channel->service_type == ST_NVOD_REFERENCE_SERVICE) { CSectionsdClient::NVODTimesList nvod_list; - - //if (NeutrinoAPI->Sectionsd->getNVODTimesServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, nvod_list)) - if (sectionsd_getNVODTimesServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, nvod_list)) + if (NeutrinoAPI->Sectionsd->getNVODTimesServiceKey(channel->channel_id, nvod_list)) { CZapitClient::subServiceList subServiceList; @@ -433,10 +396,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: t_channel_id channel_id = CREATE_CHANNEL_ID_FROM_SERVICE_ORIGINALNETWORK_TRANSPORTSTREAM_ID(cmd.service_id, cmd.original_network_id, cmd.transport_stream_id); timestr = timeString(ni->zeit.startzeit); // FIXME: time is wrong (at least on little endian)! - - //NeutrinoAPI->Sectionsd->getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epg); // FIXME: der scheissendreck geht nit!!! - sectionsd_getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epg); // FIXME: der scheissendreck geht nit!!! - + NeutrinoAPI->Sectionsd->getActualEPGServiceKey(channel_id, &epg); // FIXME: der scheissendreck geht nit!!! yresult += string_printf("\n ", classname); yresult += string_printf("%s ", classname, timestr.c_str()); yresult += string_printf("%sChannelListEvents[channel->channel_id])) { - //bool has_current_next = NeutrinoAPI->Sectionsd->getCurrentNextServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, currentNextInfo); - bool has_current_next = true; - sectionsd_getCurrentNextServiceKey(channel->channel_id&0xFFFFFFFFFFFFULL, currentNextInfo); + bool has_current_next = NeutrinoAPI->Sectionsd->getCurrentNextServiceKey(channel->channel_id, currentNextInfo); timestr = timeString(event->startTime); yresult += string_printf("",classname); @@ -483,7 +441,6 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: } else yresult += string_printf("\n"); -#endif } return yresult; } @@ -491,14 +448,14 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: //------------------------------------------------------------------------- // y-func : get_actual_channel_id //------------------------------------------------------------------------- -std::string CNeutrinoYParser::func_get_actual_channel_id(CyhookHandler */*hh*/, std::string /*para*/) +std::string CNeutrinoYParser::func_get_actual_channel_id(CyhookHandler *, std::string) { - return string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, live_channel_id /*NeutrinoAPI->Zapit->getCurrentServiceID()*/); + return string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS,NeutrinoAPI->Zapit->getCurrentServiceID()); } //------------------------------------------------------------------------- // y-func : get_mode (returns tv|radio|unknown) //------------------------------------------------------------------------- -std::string CNeutrinoYParser::func_get_mode(CyhookHandler */*hh*/, std::string /*para*/) +std::string CNeutrinoYParser::func_get_mode(CyhookHandler *, std::string) { std::string yresult; int mode = NeutrinoAPI->Zapit->getMode(); @@ -515,7 +472,7 @@ std::string CNeutrinoYParser::func_get_mode(CyhookHandler */*hh*/, std::string //------------------------------------------------------------------------- // y-func : get_video_pids (para=audio channel, returns: 0x0000,0x0000,0x0000) //------------------------------------------------------------------------- -std::string CNeutrinoYParser::func_get_video_pids(CyhookHandler */*hh*/, std::string para) +std::string CNeutrinoYParser::func_get_video_pids(CyhookHandler *, std::string para) { CZapitClient::responseGetPIDs pids; int apid=0,apid_no=0,apid_idx=0; @@ -534,7 +491,7 @@ std::string CNeutrinoYParser::func_get_video_pids(CyhookHandler */*hh*/, std::s //------------------------------------------------------------------------- // y-func : get_radio_pids (returns: 0x0000) //------------------------------------------------------------------------- -std::string CNeutrinoYParser::func_get_radio_pid(CyhookHandler */*hh*/, std::string /*para*/) +std::string CNeutrinoYParser::func_get_radio_pid(CyhookHandler *, std::string) { CZapitClient::responseGetPIDs pids; int apid=0; @@ -550,7 +507,7 @@ std::string CNeutrinoYParser::func_get_radio_pid(CyhookHandler */*hh*/, std::st // y-func : get_audio_pids_as_dropdown (from controlapi) // prara: [apid] option value = apid-Value. Default apid-Index //------------------------------------------------------------------------- -std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler */*hh*/, std::string para) +std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler *, std::string para) { std::string yresult; static bool init_iso=true; @@ -570,12 +527,10 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler */* pids.PIDs.vpid=0; NeutrinoAPI->Zapit->getPIDS(pids); - t_channel_id current_channel = live_channel_id; //NeutrinoAPI->Zapit->getCurrentServiceID(); + t_channel_id current_channel = NeutrinoAPI->Zapit->getCurrentServiceID(); CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; - //NeutrinoAPI->Sectionsd->getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); - sectionsd_getCurrentNextServiceKey(current_channel&0xFFFFFFFFFFFFULL, currentNextInfo); - //if (NeutrinoAPI->Sectionsd->getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) - if (sectionsd_getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) + NeutrinoAPI->Sectionsd->getCurrentNextServiceKey(current_channel, currentNextInfo); + if (NeutrinoAPI->Sectionsd->getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) { for (unsigned int i=0; i< tags.size(); i++) { @@ -625,7 +580,7 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler */* //------------------------------------------------------------------------- // y-func : build umount list //------------------------------------------------------------------------- -std::string CNeutrinoYParser::func_unmount_get_list(CyhookHandler */*hh*/, std::string /*para*/) +std::string CNeutrinoYParser::func_unmount_get_list(CyhookHandler *, std::string) { std::string ysel, ymount, ylocal_dir, yfstype, ynr, yresult, mounts; @@ -653,7 +608,7 @@ std::string CNeutrinoYParser::func_unmount_get_list(CyhookHandler */*hh*/, std: //------------------------------------------------------------------------- // y-func : build partition list //------------------------------------------------------------------------- -std::string CNeutrinoYParser::func_get_partition_list(CyhookHandler */*hh*/, std::string /*para*/) +std::string CNeutrinoYParser::func_get_partition_list(CyhookHandler *, std::string) { std::string ysel, ymtd, yname, dummy, yresult; char ytmp[200]; @@ -680,15 +635,14 @@ std::string CNeutrinoYParser::func_get_partition_list(CyhookHandler */*hh*/, st //------------------------------------------------------------------------- // y-func : get boxtypetext (Nokia, Philips, Sagem) //------------------------------------------------------------------------- -std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler * /*hh*/, std::string /*para*/) +std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) { - return "Coolstream";//FIXME - //return NeutrinoAPI->Dbox_Hersteller[NeutrinoAPI->Controld->getBoxType()]; + return NeutrinoAPI->Dbox_Hersteller[NeutrinoAPI->Controld->getBoxType()]; } //------------------------------------------------------------------------- // y-func : get stream info //------------------------------------------------------------------------- -std::string CNeutrinoYParser::func_get_current_stream_info(CyhookHandler *hh, std::string /*para*/) +std::string CNeutrinoYParser::func_get_current_stream_info(CyhookHandler *hh, std::string) { int bitInfo[10]; CZapitClient::CCurrentServiceInfo serviceinfo; @@ -703,7 +657,7 @@ std::string CNeutrinoYParser::func_get_current_stream_info(CyhookHandler *hh, s hh->ParamList["pmtpid"] = (serviceinfo.pmtpid != 0)?itoh(serviceinfo.pmtpid):"nicht verfügbar"; hh->ParamList["tsfrequency"] = string_printf("%d.%d MHz", serviceinfo.tsfrequency/1000, serviceinfo.tsfrequency%1000); hh->ParamList["polarisation"] = serviceinfo.polarisation==1?"h":"v"; - hh->ParamList["ServiceName"] = NeutrinoAPI->GetServiceName(live_channel_id);//NeutrinoAPI->Zapit->getCurrentServiceID()); + hh->ParamList["ServiceName"] = NeutrinoAPI->GetServiceName(NeutrinoAPI->Zapit->getCurrentServiceID()); NeutrinoAPI->GetStreamInfo(bitInfo); hh->ParamList["VideoFormat"] = string_printf("%d x %d", bitInfo[0], bitInfo[1] ); @@ -747,7 +701,7 @@ std::string CNeutrinoYParser::func_get_current_stream_info(CyhookHandler *hh, s // Template 1:classname, 2:zAlarmTime, 3: zStopTime, 4:zRep, 5:zRepCouunt // 6:zType, 7:sAddData, 8:timer->eventID, 9:timer->eventID //------------------------------------------------------------------------- -std::string CNeutrinoYParser::func_get_timer_list(CyhookHandler */*hh*/, std::string para) +std::string CNeutrinoYParser::func_get_timer_list(CyhookHandler *, std::string para) { std::string yresult; CTimerd::TimerList timerlist; // List of bouquets @@ -800,8 +754,7 @@ std::string CNeutrinoYParser::func_get_timer_list(CyhookHandler */*hh*/, std::s case CTimerd::TIMER_ZAPTO : case CTimerd::TIMER_RECORD : { - //sAddData = NeutrinoAPI->Zapit->getChannelName(timer->channel_id); - sAddData = NeutrinoAPI->GetServiceName(timer->channel_id); + sAddData = ZapitTools::UTF8_to_Latin1(NeutrinoAPI->Zapit->getChannelName(timer->channel_id).c_str()); if (sAddData.empty()) sAddData = NeutrinoAPI->Zapit->isChannelTVChannel(timer->channel_id) ? "Unbekannter TV-Kanal" : "Unbekannter Radiokanal"; @@ -932,12 +885,11 @@ std::string CNeutrinoYParser::func_set_timer_form(CyhookHandler *hh, std::strin { if(i!=(int)CTimerd::TIMER_NEXTPROGRAM) { - std::string _sel; std::string zType = NeutrinoAPI->timerEventType2Str((CTimerd::CTimerEventTypes) i); if(cmd != "new") - _sel = (i==(int)timer.eventType) ? "selected=\"selected\"" : ""; + sel = (i==(int)timer.eventType) ? "selected=\"selected\"" : ""; else - _sel = (i==(int)CTimerd::TIMER_RECORD) ? "selected=\"selected\"" : ""; + sel = (i==(int)CTimerd::TIMER_RECORD) ? "selected=\"selected\"" : ""; hh->ParamList["timertype"] += string_printf("\n", - (*cit)->channel_id, _sel.c_str(), (*cit)->getName().c_str()); - } - cit = g_bouquetManager->radioChannelsBegin(); - for (; !(cit.EndOfChannels()); cit++) { - std::string _sel = ((*cit)->channel_id == current_channel) ? "selected=\"selected\"" : ""; - hh->ParamList["program_row"] += - string_printf("\n", - (*cit)->channel_id, _sel.c_str(), (*cit)->getName().c_str()); - } -#if 0 // program row CZapitClient::BouquetChannelList channellist; channellist.clear(); - NeutrinoAPI->Zapit->getChannels(channellist,CZapitClient::MODE_TV, CZapitClient::SORT_BOUQUET, true); + NeutrinoAPI->Zapit->getChannels(channellist,CZapitClient::MODE_TV); + t_channel_id current_channel = (cmd == "new") ? NeutrinoAPI->Zapit->getCurrentServiceID() : timer.channel_id; CZapitClient::BouquetChannelList::iterator channel = channellist.begin(); for(; channel != channellist.end();channel++) { - std::string sel = (channel->channel_id == current_channel) ? "selected=\"selected\"" : ""; + sel = (channel->channel_id == current_channel) ? "selected=\"selected\"" : ""; hh->ParamList["program_row"] += string_printf("\n", - channel->channel_id, sel.c_str(), channel->getName()); + channel->channel_id, sel.c_str(), channel->name); } - channellist.clear(); - NeutrinoAPI->Zapit->getChannels(channellist,CZapitClient::MODE_RADIO, CZapitClient::SORT_BOUQUET, true); + NeutrinoAPI->Zapit->getChannels(channellist,CZapitClient::MODE_RADIO); for (channel = channellist.begin(); channel != channellist.end(); channel++) { - std::string sel = (channel->channel_id == current_channel) ? "selected=\"selected\"" : ""; + sel = (channel->channel_id == current_channel) ? "selected=\"selected\"" : ""; hh->ParamList["program_row"] += string_printf("\n", - channel->channel_id, sel.c_str(), channel->getName()); + channel->channel_id, sel.c_str(), channel->name); } -#endif // recordingDir hh->ParamList["RECORD_DIR_MAXLEN"] = itoa(RECORD_DIR_MAXLEN-1); if(cmd != "new") { @@ -1035,7 +966,7 @@ std::string CNeutrinoYParser::func_set_timer_form(CyhookHandler *hh, std::strin CConfigFile *Config = new CConfigFile(','); Config->loadConfig(NEUTRINO_CONFIGFILE); hh->ParamList["timer_recordingDir"] = Config->getString("network_nfs_recordingdir", "/mnt/filme"); - delete Config;//Memory leak: Config + delete Config; } hh->ParamList["standby"] = (cmd == "new")? "0" : ((timer.standby_on)?"1":"0"); hh->ParamList["message"] = (cmd == "new")? "" : timer.message; @@ -1057,36 +988,41 @@ std::string CNeutrinoYParser::func_bouquet_editor_main(CyhookHandler *hh, std:: if (hh->ParamList["selected"] != "") selected = atoi(hh->ParamList["selected"].c_str()); - int bouquetSize = (int) g_bouquetManager->Bouquets.size(); - for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) { + // List of all bouquets + CZapitClient::BouquetList AllBouquetList; - CZapitBouquet * bouquet = g_bouquetManager->Bouquets[i]; + NeutrinoAPI->Zapit->getBouquets(AllBouquetList, true, true); // UTF-8 + CZapitClient::BouquetList::iterator bouquet = AllBouquetList.begin(); - char classname = ((i & 1) == 0) ? 'a' : 'b'; - classname = (selected == (int) i + 1)?'c':classname; + unsigned int bouquetSize = AllBouquetList.size(); - std::string akt = (selected == (int) (i + 1)) ? "" : ""; + for(; bouquet != AllBouquetList.end();bouquet++) + { + char classname = ((bouquet->bouquet_nr & 1) == 0) ? 'a' : 'b'; + classname = (selected == (int) bouquet->bouquet_nr + 1)?'c':classname; + + std::string akt = (selected == (int) (bouquet->bouquet_nr + 1)) ? "" : ""; // lock/unlock - std::string lock_action = (bouquet->bLocked) ? "unlock" : "lock"; - std::string lock_img = (bouquet->bLocked) ? "lock" : "unlock"; - std::string lock_alt = (bouquet->bLocked) ? "entsperren" : "sperren"; + std::string lock_action = (bouquet->locked) ? "unlock" : "lock"; + std::string lock_img = (bouquet->locked) ? "lock" : "unlock"; + std::string lock_alt = (bouquet->locked) ? "entsperren" : "sperren"; // hide/show - std::string hidden_action= (bouquet->bHidden) ? "show" : "hide"; - std::string hidden_img = (bouquet->bHidden) ? "hidden" : "visible"; - std::string hidden_alt = (bouquet->bHidden) ? "verstecken" : "anzeigen"; + std::string hidden_action= (bouquet->hidden) ? "show" : "hide"; + std::string hidden_img = (bouquet->hidden) ? "hidden" : "visible"; + std::string hidden_alt = (bouquet->hidden) ? "verstecken" : "anzeigen"; // move down - std::string down_show = (i + 1 < bouquetSize) ? "visible" : "hidden"; + std::string down_show = (bouquet->bouquet_nr + 1 < bouquetSize) ? "visible" : "hidden"; //move up - std::string up_show = (i > 0) ? "visible" : "hidden"; + std::string up_show = (bouquet->bouquet_nr > 0) ? "visible" : "hidden"; // build from template yresult += string_printf(para.c_str(), classname, akt.c_str(), - i + 1, lock_action.c_str(), lock_img.c_str(), lock_alt.c_str(), //lock - i + 1, hidden_action.c_str(), hidden_img.c_str(), hidden_alt.c_str(), //hhidden - i + 1, bouquet->Name.c_str(), bouquet->Name.c_str(), //link - i + 1, bouquet->Name.c_str(), //rename - i + 1, bouquet->Name.c_str(), //delete - down_show.c_str(), i + 1, //down arrow - up_show.c_str(), i + 1); //up arrow + bouquet->bouquet_nr + 1, lock_action.c_str(), lock_img.c_str(), lock_alt.c_str(), //lock + bouquet->bouquet_nr + 1, hidden_action.c_str(), hidden_img.c_str(), hidden_alt.c_str(), //hhidden + bouquet->bouquet_nr + 1, bouquet->name, bouquet->name, //link + bouquet->bouquet_nr + 1, bouquet->name, //rename + bouquet->bouquet_nr + 1, bouquet->name, //delete + down_show.c_str(), bouquet->bouquet_nr + 1, //down arrow + up_show.c_str(), bouquet->bouquet_nr + 1); //up arrow } return yresult; } @@ -1094,45 +1030,10 @@ std::string CNeutrinoYParser::func_bouquet_editor_main(CyhookHandler *hh, std:: //------------------------------------------------------------------------- // func: Bouquet Edit //------------------------------------------------------------------------- -std::string CNeutrinoYParser::func_set_bouquet_edit_form(CyhookHandler *hh, std::string /*para*/) +std::string CNeutrinoYParser::func_set_bouquet_edit_form(CyhookHandler *hh, std::string) { if (!(hh->ParamList["selected"].empty())) { - int selected = atoi(hh->ParamList["selected"].c_str()) - 1; - int mode = NeutrinoAPI->Zapit->getMode(); - ZapitChannelList* channels = mode == CZapitClient::MODE_TV ? &(g_bouquetManager->Bouquets[selected]->tvChannels) : &(g_bouquetManager->Bouquets[selected]->radioChannels); - for(int j = 0; j < (int) channels->size(); j++) { - hh->ParamList["bouquet_channels"] += - string_printf("\n", - (*channels)[j]->channel_id, - (*channels)[j]->getName().c_str()); - } - ZapitChannelList Channels; - Channels.clear(); - if (mode == CZapitClient::MODE_RADIO) { - for (tallchans_iterator it = allchans.begin(); it != allchans.end(); it++) - if (it->second.getServiceType() == ST_DIGITAL_RADIO_SOUND_SERVICE) - Channels.push_back(&(it->second)); - } else { - for (tallchans_iterator it = allchans.begin(); it != allchans.end(); it++) - if (it->second.getServiceType() != ST_DIGITAL_RADIO_SOUND_SERVICE) - Channels.push_back(&(it->second)); - } - sort(Channels.begin(), Channels.end(), CmpChannelByChName()); - - for (int i = 0; i < (int) Channels.size(); i++) { - if (!g_bouquetManager->existsChannelInBouquet(selected, Channels[i]->channel_id)){ - hh->ParamList["all_channels"] += - string_printf("\n", - Channels[i]->channel_id, - Channels[i]->getName().c_str()); - } - } -#if 0 CZapitClient::BouquetChannelList BChannelList; CZapitClient::BouquetChannelList::iterator channels; @@ -1162,7 +1063,6 @@ std::string CNeutrinoYParser::func_set_bouquet_edit_form(CyhookHandler *hh, std channels->name); } } -#endif return ""; } else diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.h b/src/nhttpd/tuxboxapi/dbox/neutrinoyparser.h similarity index 99% rename from src/nhttpd/tuxboxapi/neutrinoyparser.h rename to src/nhttpd/tuxboxapi/dbox/neutrinoyparser.h index e4ea1054d..170cea575 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.h +++ b/src/nhttpd/tuxboxapi/dbox/neutrinoyparser.h @@ -62,7 +62,7 @@ public: virtual std::string YWeb_cgi_func(CyhookHandler *hh, std::string ycmd); // virtual functions for HookHandler/Hook virtual std::string getHookName(void) {return std::string("mod_NeutrinoYParser");} - virtual std::string getHookVersion(void) {return std::string("$Revision: 1.2 $");} + virtual std::string getHookVersion(void) {return std::string("$Revision: 1.1.2.1 $");} virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); virtual THandleStatus Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList); }; diff --git a/src/nhttpd/web/Makefile.am b/src/nhttpd/web/Makefile.am index 0432cadd8..a7aba9e15 100644 --- a/src/nhttpd/web/Makefile.am +++ b/src/nhttpd/web/Makefile.am @@ -1,38 +1,97 @@ -SUBDIRS = images scripts +SUBDIRS = images scripts languages -installdir = $(DATADIR)/neutrino/httpd-y +installdir = $(DATADIR)/neutrino/httpd -install_DATA = Y_About.yhtm Y_Boxcontrol_Bouquet_Editor_Edit.yhtm \ - Y_Boxcontrol_Bouquet_Editor_Main.yhtm \ - Y_Boxcontrol_Bouquetlist.yhtm Y_Boxcontrol_Bouquets.yhtm \ - Y_Boxcontrol_Channellist.yhtm Y_Boxcontrol_Menue.yhtm \ - Y_Boxcontrol_Messages.yhtm Y_Dyn_Pages.yhtm Y_EPG_Plus.yhtm \ - Y_Ext_Menue.yhtm Y_Ext_Settings.yhtm \ - Y_Ext_Update_refresh.yhtm Y_Ext_Update.yhtm Y_Info_Help.yhtm \ - Y_Info_Menue.yhtm Y_Info_Updates.yhtm Y_Live_DoubleView.yhtm \ - Y_Live_EPG_Info.yhtm Y_Live_EPG.yhtm Y_Live_Menue.yhtm \ - Y_Live_Msg.yhtm Y_Live_Record.yhtm Y_Live_Transcode.yhtm \ - Y_LiveViewFull.yhtm Y_Live.yhtm Y_Menue.yhtm \ - Y_Settings_automount_liste.yhtm Y_Settings_automount.yhtm \ - Y_Settings_Backup.yhtm Y_Settings_Live.yhtm \ - Y_Settings_Menue.yhtm Y_Settings_mount_liste.yhtm \ - Y_Settings_mount.yhtm Y_Settings_neutrino_forms.yhtm \ - Y_Settings_nhttpd.yhtm Y_Settings_Skin.yhtm \ - Y_Settings_Timer.yhtm Y_Settings_ucodes.yhtm \ - Y_Settings_umount_liste.yhtm Y_Settings_VNC.yhtm \ - Y_Settings_wol.yhtm Y_Settings.yhtm Y_Settings_yWeb.yhtm \ - Y_Settings_zapit.yhtm Y_StreamInfo.yhtm Y_Timer_Edit.yhtm \ - Y_Timer_List.yhtm Y_Timer_Menue.yhtm Y_Tools_Bootlogo.yhtm \ - Y_Tools_Boxcontrol.yhtm Y_Tools_Check_Install.yhtm \ - Y_Tools_Cmd.yhtm Y_Tools_fbshot.yhtm \ - Y_Tools_Flash_Menue.yhtm Y_Tools_Flash_Upload.yhtm \ - Y_Tools_Info_Menue.yhtm Y_Tools_Installer.yhtm \ - Y_Tools_Menue.yhtm Y_Tools_NetStream.yhtm Y_Tools_Rcsim.yhtm \ - Y_Tools_remote_osd.yhtm Y_Tools_Timer_Sync.yhtm \ - Y_blank.htm \ +install_DATA = channels.js \ + channels.txt \ + extentions.txt \ + favicon.ico \ index.html \ + prototype.js \ + robots.txt \ + Y_About.yhtm \ + Y_Baselib.js \ + Y_blank.htm \ + Y_Blocks.txt \ + Y_Boxcontrol_Bouquet_Editor_Edit.yhtm \ + Y_Boxcontrol_Bouquet_Editor_Main.yhtm \ + Y_Boxcontrol_Bouquetlist.yhtm \ + Y_Boxcontrol_Bouquets.yhtm \ + Y_Boxcontrol_Channellist.yhtm \ + Y_Boxcontrol_Menue.yhtm \ + Y_Boxcontrol_Messages.yhtm \ + Y_Dyn_Pages.yhtm \ + Y_EPG.js \ + Y_EPG_Plus.js \ + Y_EPG_Plus.yhtm \ + Y_Ext_Menue.yhtm \ + Y_Ext_Settings.yhtm \ + Y_Ext_Uninstall.yhtm \ + Y_Ext_Update.js \ + Y_Ext_Update_refresh.yhtm \ + Y_Ext_Update.yhtm \ + Y_Flash.js \ + Y_Info_Help.yhtm \ + Y_Info_Menue.yhtm \ + Y_Info_Updates.yhtm \ + Y_Live_DoubleView.yhtm \ + Y_Live_EPG_Info.yhtm \ + Y_Live_EPG.yhtm \ + Y_Live.js \ + Y_Live_Menue.yhtm \ + Y_Live_Msg.yhtm \ + Y_Live_Record.yhtm \ + Y_Live_Transcode.yhtm \ + Y_LiveViewFull.yhtm \ + Y_Live.yhtm \ Y_Main.css \ - channels.js Y_Baselib.js Y_VLC.js \ - channels.txt extentions.txt robots.txt Y_Blocks.txt \ - Y_neutrino_Blocks.txt Y_Version.txt \ - favicon.ico + Y_Menue.yhtm \ + Y_neutrino_Blocks.txt \ + Y_Settings_automount_liste.yhtm \ + Y_Settings_automount.yhtm \ + Y_Settings_Backup.yhtm \ + Y_Settings_buttons.yhtm \ + Y_Settings_lcd.yhtm \ + Y_Settings_Live.yhtm \ + Y_Settings_Menue.yhtm \ + Y_Settings_mount_liste.yhtm \ + Y_Settings_mount.yhtm \ + Y_Settings_neutrino_forms.yhtm \ + Y_Settings_nhttpd.yhtm \ + Y_Settings_personalize.yhtm \ + Y_Settings_Skin.yhtm \ + Y_Settings_Timer.yhtm \ + Y_Settings_ucodes.yhtm \ + Y_Settings_umount_liste.yhtm \ + Y_Settings_video_audio.yhtm \ + Y_Settings_VNC.yhtm \ + Y_Settings_wol.yhtm \ + Y_Settings.yhtm \ + Y_Settings_yWeb.yhtm \ + Y_Settings_zapit.yhtm \ + Y_StreamInfo.yhtm \ + Y_Timer_Edit.yhtm \ + Y_Timer_List.yhtm \ + Y_Timer_Menue.yhtm \ + Y_Tools_Bootlogo.yhtm \ + Y_Tools_Boxcontrol.yhtm \ + Y_Tools_Check_Install.yhtm \ + Y_Tools_Cmd.yhtm \ + Y_Tools_fbshot.yhtm \ + Y_Tools_Flash_Menue.yhtm \ + Y_Tools_Flash_Upload.yhtm \ + Y_Tools_Info_Menue.yhtm \ + Y_Tools_Installer.yhtm \ + Y_Tools_lcshot.yhtm \ + Y_Tools_Menue.yhtm \ + Y_Tools_NetStream.yhtm \ + Y_Tools_Rcsim.yhtm \ + Y_Tools_remote_osd.yhtm \ + Y_Tools_Timer_Sync.js \ + Y_Tools_Timer_Sync.yhtm \ + Y_Version.txt \ + Y_VLC.js \ + Y_Wait.yhtm \ + ywidget.css \ + ywidget.js \ + Y_yweb.js diff --git a/src/nhttpd/web/Y_About.yhtm b/src/nhttpd/web/Y_About.yhtm index 95e2b5264..6e293e872 100644 --- a/src/nhttpd/web/Y_About.yhtm +++ b/src/nhttpd/web/Y_About.yhtm @@ -1,23 +1,22 @@ {=var-set:cancache=yPyes=} {=include-block:Y_Blocks.txt;headCache=} +{=var-set:alt_httpd={=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.override_directory;/var/httpd=}=} +{=var-set:vf={=if-file-exists:{=var-get:alt_httpd=}/Y_Version.txt~{=var-get:alt_httpd=}/Y_Version.txt~Y_Version.txt=}=}
- {=var-set:help_url=Neutrino:yWeb:Info#About=}{=var-set:menu=About=}{=include-block:Y_Blocks.txt;work_menu=}
+ {=var-set:help_url=Help-Info-About=}{=var-set:menu=About=}{=include-block:Y_Blocks.txt;work_menu=}
- + + + +
y-logoyjogolyWeb
www.yjogol.com - Coolstream HD1 yWeb -
www.yjogol.de -

- {=ini-get:Y_Version.txt;version=}
- {=ini-get:Y_Version.txt;date=}
- {=ini-get:Y_Version.txt;type=}

- {=ini-get:Y_Version.txt;info=}
-

+ {=ini-get:{=var-get:vf=};version=} - {=ini-get:{=var-get:vf=};date=} - {=ini-get:{=var-get:vf=};type=}

+ {=ini-get:{=var-get:vf=};info=}
diff --git a/src/nhttpd/web/Y_Baselib.js b/src/nhttpd/web/Y_Baselib.js index 22a770f64..d55dbebe6 100644 --- a/src/nhttpd/web/Y_Baselib.js +++ b/src/nhttpd/web/Y_Baselib.js @@ -1,11 +1,15 @@ /* yWeb Baselib by yjogol - $Date: 2007/02/21 17:38:48 $ - $Revision: 1.3 $ + $Date: 2008/02/24 08:23:12 $ + $Revision: 1.5 $ */ +var baselib_version="2.0.0"; var agt=navigator.userAgent.toLowerCase(); var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)); - /*DHTML-Basics*/ +function $yN(_obj_name) +{ + return $(document.getElementsByName(_obj_name)); +} function id(obj_id) { return document.getElementById(obj_id); @@ -38,7 +42,7 @@ function obj_create(_typ, _class) { var __obj = document.createElement(_typ); var __class = document.createAttribute("class"); - + __class.nodeValue = _class; __obj.setAttributeNode(__class); return __obj; @@ -108,9 +112,18 @@ function y_add_html_cell_to_row(_row, _name, _value) __cell.innerHTML = _value; return __cell; } +function y_add_li_to_ul(_ul, _class, _value){ + var __li=document.createElement("li"); + var __class = document.createAttribute("class"); + __class.nodeValue = _class; + _ul.setAttributeNode(__class); + _ul.appendChild(__li); + __li.innerHTML=_value; + return __li; +} function getXMLNodeItemValue(node, itemname) { - + var item = node.getElementsByTagName(itemname); if(item.length>0) if(item[0].firstChild) @@ -132,9 +145,9 @@ function obj_addAttributeNode(_obj, _attr, _value) } /*XMLHttpRequest AJAX*/ var g_req; -function loadXMLDoc(_url, _processReqChange) +function loadXMLDoc(_url, _processReqChange) { - if (window.XMLHttpRequest) + if (window.XMLHttpRequest) { g_req = new XMLHttpRequest(); g_req.onreadystatechange = _processReqChange; @@ -143,71 +156,81 @@ function loadXMLDoc(_url, _processReqChange) g_req.open("GET", _url, true); g_req.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"); g_req.send(null); - } + } else if (window.ActiveXObject) { g_req = new ActiveXObject("Microsoft.XMLHTTP"); - if (g_req) + if (g_req) { g_req.onreadystatechange = _processReqChange; g_req.open("GET", _url, true); g_req.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"); g_req.send(); } - } + } else alert("Kein Browser-Support fr XMLHttpRequest"); } -function loadSyncURL(_url) +function loadSyncURL2(_url) +{ + var myAjax = new Ajax.Request( + _url, + { + method: 'post', + asynchronous: false + }); + return myAjax.responseText; +} +function loadSyncURL(_url) { var _req; - if (window.XMLHttpRequest) + if (window.XMLHttpRequest) { _req = new XMLHttpRequest(); _req.open("GET", _url, false); _req.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"); _req.send(null); - } + } else if (window.ActiveXObject) { _req = new ActiveXObject("Microsoft.XMLHTTP"); - if(_req) + if(_req) { _req.open("GET", _url, false); _req.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"); _req.send(); } - } + } else alert("Kein Browser-Support fr XMLHttpRequest"); - if (_req.readyState == 4 && _req.status == 200) + if (_req.readyState == 4 && _req.status == 200) return _req.responseText; else return ""; } -function loadSyncURLxml(_url) +function loadSyncURLxml(_url) { var _req; - if (window.XMLHttpRequest) + if (window.XMLHttpRequest) { _req = new XMLHttpRequest(); _req.open("GET", _url, false); _req.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"); _req.send(null); - } + } else if (window.ActiveXObject) { _req = new ActiveXObject("Microsoft.XMLHTTP"); - if(_req) + if(_req) { _req.open("GET", _url, false); _req.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"); _req.send(); } - } + } else alert("Kein Browser-Support fr XMLHttpRequest"); - if (_req.readyState == 4 && _req.status == 200) + if (_req.readyState == 4 && _req.status == 200) return _req.responseXML; else return ""; @@ -254,7 +277,7 @@ function split_one(_str, _delimiter) { var __p = _str.indexOf(_delimiter); var __left = _str.substring(0, __p); - var __right = _str.substring(__p+1); + var __right = _str.substring(__p+_delimiter.length); return new Array(__left, __right); } function split_left(_str, _delimiter) @@ -279,6 +302,50 @@ function epg_de_qout(_str) _str = _str.replace(/\x8A/g,"
"); return _str; } +function split_version(vstring,v){ + var l=vstring.split("."); + v.set('major', (l.length>0)?l[0]:"0"); + v.set('minor', (l.length>1)?l[1]:"0"); + v.set('patch', (l.length>2)?l[2]:"0"); + v.set('pre', (l.length>3)?l[3]:"0"); +} +function version_less(l, r) /* l<= r?*/{ + return (l.get('major') < r.get('major'))|| + ((l.get('major') == r.get('major')) && (l.get('minor') < r.get('minor'))) || + ((l.get('major') == r.get('major')) && (l.get('minor') == r.get('minor')) && (l.get('patch') < r.get('patch'))) || + ((l.get('major') == r.get('major')) && (l.get('minor') == r.get('minor')) && (l.get('patch') == r.get('patch')) && (l.get('pre') < r.get('pre'))); +} +function version_le(l, r) /* l<= r?*/{ + return (l.get('major') < r.get('major'))|| + ((l.get('major') == r.get('major')) && (l.get('minor') < r.get('minor'))) || + ((l.get('major') == r.get('major')) && (l.get('minor') == r.get('minor')) && (l.get('patch') < r.get('patch'))) || + ((l.get('major') == r.get('major')) && (l.get('minor') == r.get('minor')) && (l.get('patch') == r.get('patch')) && (l.get('pre') <= r.get('pre'))); +} +function version_str_less(l, r) /* l<= r?*/{ + var lh=$H(); + split_version(l,lh); + var rh=$H(); + split_version(r,rh); + return version_less(lh,rh); +} +function str_to_hash(str){ + var h=new Hash(); + var items=str.split(","); + items.each(function(e){ + pair=split_one(e,":"); + if(pair.length==2) + h.set((pair[0]).gsub("\"","").gsub("'","").strip(),(pair[1]).strip().gsub("\"","").gsub("'","")); + }); + return h; +} +function hash_to_str(h){ + var str=""; + h.each(function(e){ + if(str!="")str+=","; + str+=e.key+":"+e.value; + }); + return str; +} /*etc*/ function format_time(_t) { @@ -305,10 +372,23 @@ function bt_set_value(_bt_name, _text) __button.firstChild.nodeValue = _text; } /*dbox*/ +/*expermental*/ +function dbox_rcsim(_key){ + loadSyncURL("/control/rcem?" + _key); +} +function dbox_reload_neutrino(){ + var sc=dbox_exec_tools("restart_neutrino"); +} function dbox_exec_command(_cmd) { + alert("Diese Funktion dbox_exec_command wurde aus Sicherheitsgruenden abgeschafft. Bitte Extension updaten."); var __cmd = _cmd.replace(/ /g, "&"); - return loadSyncURL("/control/exec?Y_Tools&exec_cmd&"+__cmd); +// return loadSyncURL("/control/exec?Y_Tools&exec_cmd&"+__cmd); +} +function dbox_exec_tools(_cmd) +{ + var __cmd = _cmd.replace(/ /g, "&"); + return loadSyncURL("/control/exec?Y_Tools&"+__cmd); } function dbox_message(_msg) { @@ -358,7 +438,7 @@ function live_switchto(_mode) dbox_spts_set(true); else if(_mode == "radio" && _actual_spts) dbox_spts_set(false); - + var _actual_mode = dbox_getmode(); if(_actual_mode != _mode) dbox_setmode(_mode); diff --git a/src/nhttpd/web/Y_Blocks.txt b/src/nhttpd/web/Y_Blocks.txt index 0fae24d9c..48f00aea8 100644 --- a/src/nhttpd/web/Y_Blocks.txt +++ b/src/nhttpd/web/Y_Blocks.txt @@ -21,19 +21,24 @@ end-block~build_live_url # ------- yWeb save Settings start-block~yWeb_save_settings -{=ini-set:/var/tuxbox/config/Y-Web.conf;slavebox;{=slavebox=}~open=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;management_ip;{=managementIP=}~cache=} +{=ini-set:/var/tuxbox/config/Y-Web.conf;management_ip;{=managementIP=}~open=} {=ini-set:/var/tuxbox/config/Y-Web.conf;management_ip2;{=managementIP2=}~cache=} {=ini-set:/var/tuxbox/config/Y-Web.conf;wol_mac_1;{=wol_mac_1=}~cache=} {=ini-set:/var/tuxbox/config/Y-Web.conf;wol_mac_2;{=wol_mac_2=}~cache=} {=ini-set:/var/tuxbox/config/Y-Web.conf;wol_mac_3;{=wol_mac_3=}~cache=} +{=ini-set:/var/tuxbox/config/Y-Web.conf;wol_desc_1;{=wol_desc_1=}~cache=} +{=ini-set:/var/tuxbox/config/Y-Web.conf;wol_desc_2;{=wol_desc_2=}~cache=} +{=ini-set:/var/tuxbox/config/Y-Web.conf;wol_desc_3;{=wol_desc_3=}~cache=} +{=ini-set:/var/tuxbox/config/Y-Web.conf;fb;{=fb=}~cache=} +{=ini-set:/var/tuxbox/config/Y-Web.conf;start_page;{=start_page=}~cache=} {=ini-set:/var/tuxbox/config/Y-Web.conf;yweb_box_name;{=yweb_box_name=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;yweb_box_color;{=yweb_box_color=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;vlc_record_path;{=vlc_record_path=}~save=} +{=ini-set:/var/tuxbox/config/Y-Web.conf;yweb_box_color;{=yweb_box_color=}~save=} end-block~yWeb_save_settings # ------- Live save Settings start-block~Live_save_settings +{=ini-set:/var/tuxbox/config/Y-Web.conf;slavebox;{=slavebox=}~open=} +{=ini-set:/var/tuxbox/config/Y-Web.conf;vlc_record_path;{=vlc_record_path=}~cache=} {=ini-set:/var/tuxbox/config/Y-Web.conf;deinterlace;{=deinterlace=}~cache=} {=ini-set:/var/tuxbox/config/Y-Web.conf;deinterlace_filter;{=v=}~cache=} {=ini-set:/var/tuxbox/config/Y-Web.conf;udp;{=udp=}~cache=} @@ -46,15 +51,115 @@ start-block~nhttpd_save_settings {=ini-set:/var/tuxbox/config/nhttpd.conf;mod_auth.password;{=authpassword=}~cache=} {=ini-set:/var/tuxbox/config/nhttpd.conf;mod_auth.no_auth_client;{=noauthclient=}~cache=} {=ini-set:/var/tuxbox/config/nhttpd.conf;mod_auth.authenticate;{=authenticate=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;WebsiteMain.port;{=port=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;webserver.threading;{=threading=}~cache=} +{=ini-set:/var/tuxbox/config/nhttpd.conf;WebsiteMain.port;{=port=}~cache=} +{=ini-set:/var/tuxbox/config/nhttpd.conf;webserver.threading;{=threading=}~cache=} {=ini-set:/var/tuxbox/config/nhttpd.conf;server.no_keep-alive_ips;{=no_keep_alive_ips=}~cache=} {=ini-set:/var/tuxbox/config/nhttpd.conf;Tuxbox.HostedDocumentRoot;{=HostedDocRoot=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;ExtrasDocRoot;{=ExtrasDocRoot=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;ExtrasDocURL;{=ExtrasDocURL=}~save=} +{=ini-set:/var/tuxbox/config/nhttpd.conf;WebsiteMain.override_directory;{=override_directory=}~cache=} +{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_sendfile.mime_types;{=mod_sendfile_mime_types=}~cache=} +{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_sendfile.sendAll;{=mod_sendfile_sendAll=}~cache=} +{=ini-set:/var/tuxbox/config/nhttpd.conf;Language.selected;{=language=}~cache=} +{=ini-set:/var/tuxbox/config/nhttpd.conf;Tuxbox.LogosURL;{=Tuxbox_LogosURL=}~save=} {=func:do_reload_httpd_config=} end-block~nhttpd_save_settings +# ------- Video / Audio save Settings +start-block~video_audio_save_settings +{=ini-set:/var/tuxbox/config/neutrino.conf;video_Format;{=video_Format=}~open=} +{=ini-set:/var/tuxbox/config/neutrino.conf;video_backgroundFormat;{=video_backgroundFormat=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;video_csync;{=h_video_csync=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;vcr_AutoSwitch;{=vcr_AutoSwitch=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;audio_AnalogMode;{=audio_AnalogMode=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;audiochannel_up_down_enable;{=audiochannel_up_down_enable=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;audio_left_right_selectable;{=audio_left_right_selectable=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;audio_avs_Control;{=h_audio_avs_Control=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;audio_DolbyDigital;{=audio_DolbyDigital=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;audio_PCMOffset;{=audio_PCMOffset=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;audio_step;{=audio_step=}~save=} +{=ini-set:/var/tuxbox/config/controld.conf;vcroutput;{=h_vcroutput=}~open=} +{=ini-set:/var/tuxbox/config/controld.conf;videooutput;{=h_videooutput=}~save=} +end-block~video_audio_save_settings + +# ------- LCD save Settings +start-block~lcd_save_settings +{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_power;{=lcd_power=}~open=} +{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_inverse;{=lcd_inverse=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_dim_time;{=lcd_dim_time=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_dim_brightness;{=lcd_dim_brightness=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_epgmode;{=lcd_epgmode=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_show_volume;{=lcd_show_volume=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_contrast;{=lcd_contrast=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_brightness;{=lcd_brightness=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_standbybrightness;{=lcd_standbybrightness=}~save=} +end-block~lcd_save_settings + +# ------- Buttons save Settings +start-block~buttons_save_settings +{=ini-set:/var/tuxbox/config/neutrino.conf;bouquetlist_mode;{=bouquetlist_mode=}~open=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_bouquet_down;{=key_bouquet_down=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_bouquet_up;{=key_bouquet_up=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_addrecord;{=key_channelList_addrecord=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_addremind;{=key_channelList_addremind=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_cancel;{=key_channelList_cancel=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_pagedown;{=key_channelList_pagedown=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_pageup;{=key_channelList_pageup=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_reload;{=key_channelList_reload=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_search;{=key_channelList_search=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_sort;{=key_channelList_sort=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_lastchannel;{=key_lastchannel=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_quickzap_down;{=key_quickzap_down=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_quickzap_up;{=key_quickzap_up=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_subchannel_down;{=key_subchannel_down=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_subchannel_toggle;{=key_subchannel_toggle=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_subchannel_up;{=key_subchannel_up=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_tvradio_mode;{=key_tvradio_mode=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;key_zaphistory;{=key_zaphistory=}~save=} +end-block~buttons_save_settings + +# ------- Personalize save Settings +start-block~personalize_save_settings +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_tvmode;{=p_tv=}~open=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_radiomode;{=p_radio=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_scartmode;{=p_scart=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_games;{=p_games=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_audioplayer;{=p_audioplayer=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_inetradio;{=p_inetradio=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_esound;{=p_esound=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_movieplayer;{=p_movieplayer=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_pictureviewer;{=p_picviewer=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_pincode;{=p_pincode=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_upnpbrowser;{=p_upnp=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_sleeptimer;{=p_sleeptimer=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_reboot;{=p_reboot=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_shutdown;{=p_shutdown=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_settings;{=p_settings=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_video;{=p_video=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_audio;{=p_audio=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_youth;{=p_youth=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_network;{=p_network=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_recording;{=p_recording=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_language;{=p_language=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_colors;{=p_colors=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_lcd;{=p_lcd=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_keybinding;{=p_keybinding=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_mediaplayer;{=p_mediaplayer=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_driver;{=p_driver=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_misc;{=p_misc=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_service;{=p_service=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_bouqueteditor;{=p_bouqueteditor=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_scants;{=p_scants=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_reload;{=p_reload=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_getplugins;{=p_getplugins=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_restart;{=p_restart=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_epgrestart;{=p_epgrestart=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_ucodecheck;{=p_ucodecheck=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_chan_epg_stat;{=p_chan_epg_stat=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_imageinfo;{=p_imageinfo=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_update;{=p_update=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_bluebutton;{=p_bluebutton=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_redbutton;{=p_redbutton=}~save=} +end-block~personalize_save_settings + # ------- VNC save Settings start-block~vnc_save_settings {=ini-set:/var/tuxbox/config/vnc.conf;server;{=server=}~open=} @@ -68,6 +173,7 @@ start-block~timer_save_settings {=ini-set:/var/tuxbox/config/Y-Web.conf;tvinfo_username;{=tvinfo_username=}=} {=ini-set:/var/tuxbox/config/Y-Web.conf;tvinfo_password;{=tvinfo_password=}=} {=ini-set:/var/tuxbox/config/Y-Web.conf;klack_url;{=klack_url=}=} +{=ini-set:/var/tuxbox/config/Y-Web.conf;klack_securitycode;{=klack_securitycode=}=} {=ini-set:/var/tuxbox/config/Y-Web.conf;live_resolution_w;{=ini-get:/var/tuxbox/config/Y-Web.conf;live_resolution_w;384=}=} {=ini-set:/var/tuxbox/config/Y-Web.conf;live_resolution_h;{=ini-get:/var/tuxbox/config/Y-Web.conf;live_resolution_h;288=}=} {=file-action:/var/tuxbox/config/channels.txt;add;{=channels=}=} @@ -83,7 +189,7 @@ start-block~no_management {=include-block:Y_Blocks.txt;head=} -
+
Error
This page could be used for management proposes only. @@ -116,7 +222,7 @@ start-block~snip_wait {=if-empty:{=var-get:wait_text=}~Inquiry is worked on~{=var-get:wait_text=}=}
wait

Please wait
- +

@@ -132,16 +238,16 @@ start-block~snip_show_wait {=if-empty:{=var-get:wait_text=}~Inquiry is worked on~{=var-get:wait_text=}=}
wait

Please wait
- +

end-block~snip_show_wait # ------- Wiki Help display -# +# start-block~wiki_help -? +? end-block~wiki_help # ------- work menu @@ -161,49 +267,49 @@ start-block~head yWeb - + end-block~head # ------- Lay-HEAD start-block~headCache - + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + - + yWeb - + end-block~headCache # ------- Lay-HEAD without charset start-block~head_no_charset - + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + yWeb - + end-block~head_no_charset # ------- Lay-Frame HEAD start-block~frame_head - + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> + - - + + yWeb end-block~frame_head # ------- Lay-Frame HEAD start-block~frame_iso_head - + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> + - - + + yWeb end-block~frame_iso_head @@ -212,9 +318,9 @@ start-block~frame_main {=include-block:Y_Blocks.txt;frame_head=} dbox yWeb - - - + + + <body> <p>Your Browser does not support Frames.</p> @@ -228,7 +334,7 @@ end-block~frame_main start-block~page_frame_rest {=include-block:Y_Blocks.txt;head=} </head> -<body style="background : #F0F0F0;"> +<body style="background : white;"> </body> </html> end-block~page_frame_rest @@ -237,9 +343,9 @@ end-block~page_frame_rest start-block~frame_secondary {=include-block:Y_Blocks.txt;frame_iso_head=} </head> -<frameset cols="157,*"> - <frame name="sec_menu" src="{=var-get:sec_menu=}" scrolling="no" noresize="noresize" frameborder="0"/> - <frame name="work" src="{=var-get:work=}" scrolling="auto" frameborder="0"/> +<frameset cols="157,*" frameborder="0" framespacing="0"> + <frame name="sec_menu" src="{=var-get:sec_menu=}" scrolling="no" noresize="noresize" frameborder="0" /> + <frame name="work" src="{=var-get:work=}" scrolling="auto" frameborder="0" /> <noframes> <body> <p>Your Browser does not support Frames.</p> @@ -252,7 +358,12 @@ end-block~frame_secondary # ------- Lay-Frame Boxcontrol-Menu start-block~frame_boxcontrol {=var-set:sec_menu=Y_Boxcontrol_Menue.yhtm=} -{=var-set:work=Y_Boxcontrol_Bouquets.yhtm=} +{=var-set:startpage={=ini-get:/var/tuxbox/config/Y-Web.conf;start_page;bouquets=}=} +{=var-set:work= + {=if-equal:{=var-get:startpage=}~bouquets~Y_Boxcontrol_Bouquets.yhtm + ~ + {=if-equal:{=var-get:startpage=}~control~Y_Tools_Boxcontrol.yhtm~Y_blank.yhtm=} + =}=} {=include-block:Y_Blocks.txt;frame_secondary=} end-block~frame_boxcontrol @@ -305,30 +416,14 @@ start-block~frame_info {=include-block:Y_Blocks.txt;frame_secondary=} end-block~frame_info -# ------- Lay-Frame Tools-Info-Menu -start-block~frame_tools-info -{=include-block:Y_Blocks.txt;frame_head=} -</head> -<frameset rows="370,*"> - <frame name="oben" src="Y_Tools_Info_Menue.yhtm" scrolling="auto" frameborder="0"/> - <frame name="unten" src="Y_blank.htm" scrolling="auto" frameborder="0"/> - <noframes> - <body> - <p>Your Browser does not support Frames.</p> - </body> - - - -end-block~frame_tools-info - # ==== LIVE # ------- Lay-Frame Live-EPG Frameset start-block~frame_live_epg {=include-block:Y_Blocks.txt;frame_head=} - - - + + + <body> <p>Your Browser does not support Frames.</p> @@ -340,6 +435,77 @@ end-block~frame_live_epg # ------- Remote start-block~remote +{=if-equal:Nokia~{=if-equal:{=ini-get:/var/tuxbox/config/Y-Web.conf;fb;default=}~default~{=func:get_boxtype=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;fb;default=}=}~{=include-block:Y_Blocks.txt;remote_standard=}~{=if-equal:{=ini-get:/var/tuxbox/config/Y-Web.conf;fb;default=}~Sagem~{=include-block:Y_Blocks.txt;remote_sagem=}~{=include-block:Y_Blocks.txt;remote_coolstream=}=}=} +end-block~remote + +# ------- Remote +start-block~remote_standard +<img src="images/rc.jpg" usemap="#rc" alt="remote" /> +<map name="rc" id="rc"> + <area shape="rect" href="javascript:rcsim('KEY_SETUP')" coords="7,95,45,109" /> + <area shape="circle" href="javascript:rcsim('KEY_7')" coords="60,102,10" /> + <area shape="circle" href="javascript:rcsim('KEY_4')" coords="60,78,10" /> + <area shape="circle" href="javascript:rcsim('KEY_9')" coords="102,92,10" /> + <area shape="circle" href="javascript:rcsim('KEY_8')" coords="82,95,10" /> + <area shape="circle" href="javascript:rcsim('KEY_6')" coords="102,71,10" /> + <area shape="circle" href="javascript:rcsim('KEY_5')" coords="80,73,10" /> + <area shape="circle" href="javascript:rcsim('KEY_3')" coords="102,49,10" /> + <area shape="circle" href="javascript:rcsim('KEY_2')" coords="82,51,10" /> + <area shape="circle" href="javascript:rcsim('KEY_1')" coords="60,55,10" /> + <area shape="circle" href="javascript:rcsim('KEY_0')" coords="59,126,11" /> + <area shape="poly" href="javascript:rcsim('KEY_LEFT')" coords="35,264,51,252,45,238,50,222,39,210,27,239" /> + <area shape="poly" href="javascript:rcsim('KEY_RIGHT')" coords="97,265,87,255,91,241,85,223,98,210,108,240" /> + <area shape="poly" href="javascript:rcsim('KEY_UP')" coords="83,216,95,206,69,195,41,206,53,220,69,214" /> + <area shape="poly" href="javascript:rcsim('KEY_DOWN')" coords="95,271,85,255,71,262,51,256,41,268,68,283" /> + <area shape="rect" href="javascript:rcsim('KEY_HOME')" coords="7,72,45,86" /> + <area shape="circle" href="javascript:rcsim('KEY_MUTE')" coords="61,321,10" /> + <area shape="circle" href="javascript:rcsim('KEY_OK')" coords="66,237,18" /> + <area shape="circle" href="javascript:rcsim('KEY_BLUE')" coords="100,139,12" /> + <area shape="circle" href="javascript:rcsim('KEY_YELLOW')" coords="60,153,11" /> + <area shape="circle" href="javascript:rcsim('KEY_GREEN')" coords="37,171,12" /> + <area shape="circle" href="javascript:rcsim('KEY_RED')" coords="21,196,11" /> + <area shape="circle" href="javascript:rcsim('KEY_HELP')" coords="101,333,10" /> + <area shape="circle" href="javascript:rcsim('KEY_VOLUMEUP')" coords="17,270,10" /> + <area shape="circle" href="javascript:rcsim('KEY_VOLUMEDOWN')" coords="30,293,9" /> + <area shape="rect" href="javascript:rcsim('KEY_POWER')" coords="7,49,46,64" /> +</map> +end-block~remote_standard + +# ------- Remote Sagem +start-block~remote_sagem +<img src="images/rc_sagem.jpg" usemap="#rc" alt="remote" /> +<map name="rc" id="rc"> + <area shape="poly" href="javascript:rcsim('KEY_RIGHT')" coords="100,117,100,180,67,146,100,116" /> + <area shape="poly" href="javascript:rcsim('KEY_DOWN')" coords="36,181,101,180,66,146" /> + <area shape="poly" href="javascript:rcsim('KEY_UP')" coords="101,116,36,116,66,146" /> + <area shape="poly" href="javascript:rcsim('KEY_LEFT')" coords="66,147,36,117,35,182" /> + <area shape="circle" href="javascript:rcsim('KEY_SETUP')" coords="105,100,15" /> + <area shape="circle" href="javascript:rcsim('KEY_HELP')" coords="32,100,16" /> + <area shape="circle" href="javascript:rcsim('KEY_POWER')" coords="108,33,15" /> + <area shape="circle" href="javascript:rcsim('KEY_MUTE')" coords="69,255,13" /> + <area shape="circle" href="javascript:rcsim('KEY_VOLUMEUP')" coords="92,225,17" /> + <area shape="circle" href="javascript:rcsim('KEY_VOLUMEDOWN')" coords="47,225,17" /> + <area shape="circle" href="javascript:rcsim('KEY_OK')" coords="37,196,11" /> + <area shape="circle" href="javascript:rcsim('KEY_HOME')" coords="103,195,11" /> + <area shape="circle" href="javascript:rcsim('KEY_BLUE')" coords="108,72,11" /> + <area shape="circle" href="javascript:rcsim('KEY_RED')" coords="30,72,11" /> + <area shape="circle" href="javascript:rcsim('KEY_GREEN')" coords="54,57,11" /> + <area shape="circle" href="javascript:rcsim('KEY_YELLOW')" coords="85,57,11" /> + <area shape="circle" href="javascript:rcsim('KEY_0')" coords="69,363,12" /> + <area shape="circle" href="javascript:rcsim('KEY_9')" coords="102,336,12" /> + <area shape="circle" href="javascript:rcsim('KEY_8')" coords="69,337,12" /> + <area shape="circle" href="javascript:rcsim('KEY_7')" coords="37,336,12" /> + <area shape="circle" href="javascript:rcsim('KEY_6')" coords="102,310,12" /> + <area shape="circle" href="javascript:rcsim('KEY_5')" coords="69,310,12" /> + <area shape="circle" href="javascript:rcsim('KEY_4')" coords="37,310,12" /> + <area shape="circle" href="javascript:rcsim('KEY_3')" coords="102,284,12" /> + <area shape="circle" href="javascript:rcsim('KEY_2')" coords="69,284,12" /> + <area shape="circle" href="javascript:rcsim('KEY_1')" coords="37,284,12" /> +</map> +end-block~remote_sagem + +# ------- Remote Coolstream +start-block~remote_coolstream <img src="images/rcd.jpg" usemap="#rc"/> <map name="rc"> <area shape="rect" href="javascript:rcsim('KEY_POWER')" coords="175, 29, 210, 68" /> @@ -388,7 +554,4 @@ start-block~remote <area shape="rect" href="javascript:rcsim('KEY_STOP')" coords="105, 695, 155, 717" /> <area shape="rect" href="javascript:rcsim('KEY_PLAY')" coords="165, 695, 210, 716" /> </map> -end-block~remote - - - +end-block~remote_coolstream \ No newline at end of file diff --git a/src/nhttpd/web/Y_Boxcontrol_Bouquet_Editor_Edit.yhtm b/src/nhttpd/web/Y_Boxcontrol_Bouquet_Editor_Edit.yhtm index 2e4bd0c17..113ac8b19 100644 --- a/src/nhttpd/web/Y_Boxcontrol_Bouquet_Editor_Edit.yhtm +++ b/src/nhttpd/web/Y_Boxcontrol_Bouquet_Editor_Edit.yhtm @@ -3,20 +3,17 @@ <script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript"> //<![CDATA[ -function do_submit() -{ +function do_submit(){ show_waitbox(true); for (i=document.getElementById('channels').bchannels.length-1; i >= 0 ; i--) { document.getElementById('channels').bchannels.options[i].selected=true; } document.getElementById('channels').submit(); } -function do_abort() -{ +function do_abort(){ document.location.href="/Y_Boxcontrol_Bouquet_Editor_Main.yhtm?selected={=selected=}"; } -function movechannels(source, destination) -{ +function movechannels(source, destination){ for (i=0; i < source.length; i++) { if (source.options[i].selected==true) { destination.options[destination.length] = new Option(source.options[i].text, source.options[i].value); @@ -28,8 +25,7 @@ function movechannels(source, destination) } } } -function poschannel(box, direction) -{ +function poschannel(box, direction){ if (direction==0) { for (i=1; i < box.length ; i++) { if (box.options[i].selected==true) { @@ -57,10 +53,10 @@ function poschannel(box, direction) </head> <body> -{=var-set:wait_text=Save.=}{=include-block:Y_Blocks.txt;snip_wait=} +{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:BoxControl#Bouquet-Editor=}{=var-set:menu=Bouquet &quot;{=name=}&quot; workon=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-BoxControl-Bouquet-Editor=}{=var-set:menu=Bouquet &quot;{=name=}&quot;=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <form action="/control/changebouquet" method="post" id="channels" enctype="x-www-form-urlencoded"> <p><input type="hidden" name="selected" value="{=selected=}" /></p> @@ -72,10 +68,10 @@ function poschannel(box, direction) </select> </td> <td align="center"> - <input type="button" value="up" onclick="poschannel(document.getElementById('channels').bchannels, 0);" /><br /><br /> - <input type="button" value="down" onclick="poschannel(document.getElementById('channels').bchannels, 1);" /><br /><br /> - <input type="button" value="&gt;&gt;&gt;" onclick="movechannels(document.getElementById('channels').bchannels, document.getElementById('channels').achannels);" /><br /><br /> - <input type="button" value="&lt;&lt;&lt;" onclick="movechannels(document.getElementById('channels').achannels, document.getElementById('channels').bchannels);" /><br /><br /> + <button type="button" title="move up" onclick="poschannel(document.getElementById('channels').bchannels, 0);">&nbsp;<img src="/images/arrowup.png">&nbsp;</button><br /><br /> + <button type="button" title="move down" onclick="poschannel(document.getElementById('channels').bchannels, 1);">&nbsp;<img src="/images/arrowdown.png">&nbsp;</button><br /><br /> + <button type="button" title="remove" onclick="movechannels(document.getElementById('channels').bchannels, document.getElementById('channels').achannels);">&nbsp;<img src="/images/arrowright.png">&nbsp;</button><br /><br /> + <button type="button" title="add" onclick="movechannels(document.getElementById('channels').achannels, document.getElementById('channels').bchannels);">&nbsp;<img src="/images/arrowleft.png">&nbsp;</button><br /><br /> </td> <td> <select multiple="multiple" size="20" name="achannels"> @@ -85,9 +81,9 @@ function poschannel(box, direction) </tr> </table> <input type="hidden" name="redirect" value="/Y_Boxcontrol_Bouquet_Editor_Main.yhtm"/> - <p><input type="button" value="submit" onclick="do_submit();" /> - <input type="button" value="abort" onclick="do_abort();" /></p> - All changes must be still stored! + <p><button type="button" ytype="save" onclick="do_submit();">{=L:save=}</button> + <button type="button" ytype="cancel" onclick="do_abort();">{=L:cancel=}</button></p> + {=L:bouquets_must_be_saved=} </form> </div> </div> diff --git a/src/nhttpd/web/Y_Boxcontrol_Bouquet_Editor_Main.yhtm b/src/nhttpd/web/Y_Boxcontrol_Bouquet_Editor_Main.yhtm index 6b9255c55..c3b73f136 100644 --- a/src/nhttpd/web/Y_Boxcontrol_Bouquet_Editor_Main.yhtm +++ b/src/nhttpd/web/Y_Boxcontrol_Bouquet_Editor_Main.yhtm @@ -7,95 +7,91 @@ //<![CDATA[ var gurl= ""; var gurl_last= ""; -function hide_forms() -{ +function hide_forms(){ show_obj("add",false); show_obj("rename",false); } -function do_reload() -{ -//alert("href:"+document.location.href+" gurl:"+gurl+" path+s+h:"+document.location.pathname+document.location.search+document.location.hash); +function do_reload(){ if((document.location.pathname+document.location.search+document.location.hash) == gurl) document.location.reload(); else document.location.href = gurl; } -function do_set(bouquetnr, action) -{ - loadSyncURL("/control/setbouquet?selected="+bouquetnr+"&action="+action+"#akt"); +function do_set(bouquetnr, action){ + loadSyncURL("/control/setbouquet?selected="+bouquetnr+"&action="+action); gurl = "/Y_Boxcontrol_Bouquet_Editor_Main.yhtm?selected=" + bouquetnr+ "#akt"; window.setTimeout('do_reload()',50); } -function do_save() -{ +function do_save(){ hide_forms(); loadSyncURL("/control/savebouquet"); alert("Bouquet-Liste gespeichert"); } -function do_move(bouquetnr, action) -{ +function do_update(){ + hide_forms(); + loadSyncURL("/control/updatebouquet"); +} +function do_move(bouquetnr, action){ var sel = parseInt(String(bouquetnr)); - loadSyncURL("/control/movebouquet?selected="+bouquetnr+"&action="+action+"#akt"); + loadSyncURL("/control/movebouquet?selected="+bouquetnr+"&action="+action); if(action=="up") sel--; else sel++; - + gurl = "/Y_Boxcontrol_Bouquet_Editor_Main.yhtm?selected=" + sel+ "#akt"; window.setTimeout('do_reload()',50); } -function do_delete(bouquetnr, bouquet_name) -{ +function do_delete(bouquetnr, bouquet_name){ if (confirm("Bouquet \""+bouquet_name+"\" wirklich loeschen?")==true){ loadSyncURL("/control/deletebouquet?selected="+bouquetnr); gurl = "/Y_Boxcontrol_Bouquet_Editor_Main.yhtm?selected=" + bouquetnr+ "#akt"; window.setTimeout('do_reload()',50); } } -function do_add_start() -{ +function do_add_start(){ hide_forms(); show_obj("add",true); + document.add.bouquet_name.focus(); } -function do_add_abort() -{ +function do_add_abort(){ show_obj("add",false); } -function do_add() -{ +function do_add(){ if(document.add.bouquet_name.value != ""){ - if(loadSyncURL("/control/addbouquet?name="+document.add.bouquet_name.value) != "Ok\r\n") + res=loadSyncURL("/control/addbouquet?name="+document.add.bouquet_name.value); + /*if(res != "Ok\r\n") alert("Bouquet-Name existiert schon!"); - else + else*/ gurl = "/Y_Boxcontrol_Bouquet_Editor_Main.yhtm#akt"; +// gurl = "/Y_Boxcontrol_Bouquet_Editor_Main.yhtm?selected=" + bouquetnr+ "#akt"; show_obj("add",false); - window.setTimeout('do_reload()',50); + window.setTimeout('do_reload()',200); } else alert("Es wurde kein Bouquet-Name angegeben!"); } -function do_rename_start(bouquetnr, bouquet_name) -{ +function do_rename_start(bouquetnr, bouquet_name){ hide_forms(); document.rename.bouquetnr.value = bouquetnr; document.rename.bouquet_name.value = bouquet_name; show_obj("rename",true); + document.rename.bouquet_name.focus(); } -function do_rename_abort() -{ +function do_rename_abort(){ show_obj("rename",false); } -function do_rename() -{ +function do_rename(){ if(document.rename.bouquet_name.value != ""){ - if(loadSyncURL("/control/renamebouquet?selected="+document.rename.bouquetnr.value+"&nameto="+document.rename.bouquet_name.value) != "Ok\r\n") + res=loadSyncURL("/control/renamebouquet?selected="+document.rename.bouquetnr.value+"&nameto="+document.rename.bouquet_name.value); +/* if(res != "Ok\r\n") alert("Bouquet-Name existiert schon!"); else{ - gurl = "/Y_Boxcontrol_Bouquet_Editor_Main.yhtm?selected=" + bouquetnr+ "#akt"; +*/ + gurl = "/Y_Boxcontrol_Bouquet_Editor_Main.yhtm?selected=" + document.rename.bouquetnr.value+ "#akt"; show_obj("rename",false); -// display_obj("rename",false); - window.setTimeout('do_reload()',500); - } + window.setTimeout('do_reload()',200); +// } } else alert("Es wurde kein Bouquet-Name angegeben!"); @@ -120,65 +116,65 @@ function do_rename() <body> <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:BoxControl#Bouquet-Editor=}{=var-set:menu=Bouquet-Editor=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-BoxControl-Bouquet-Editor=}{=var-set:menu={=L:bouquet_editor=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> - <p> - <a href="javascript:do_add_start()">[add Bouquet]</a> - <a href="javascript:do_save()">[save]</a> - </p> <div id="add" class="fly_form"> <form name="add" accept-charset="UTF-8" action=""> - <p><b>Bouquet add</b><br/> - New Bouquets' name: + <p><b>{=L:bouquet_add=}</b><br/> + {=L:name_of_bouquet=}: <input type="text" size="30" name="bouquet_name" /> <br/> - <input type="button" value="add" onclick="do_add()" /> - <input type="button" value="abort" onclick="do_add_abort()" /> + <button type="button" ytype="save" onclick="do_add()">{=L:save=}</button> + <button type="button" ytype="cancel" onclick="do_add_abort()">{=L:cancel=}</button> </p> </form> </div> <div id="rename" class="fly_form"> <form name="rename" accept-charset="UTF-8" action=""> <p> - <p><b>Bouquet rename</b><br/> - New Bouquets' name: + <p><b>{=L:rename_bouquet=}</b><br/> + {=L:name_of_bouquet=}: <input type="text" size="30" name="bouquet_name" /> <input type="hidden" name="bouquetnr" value="" /> <br/> - <input type="button" value="rename" onclick="do_rename()" /> - <input type="button" value="abort" onclick="do_rename_abort()" /> + <button type="button" ytype="save" onclick="do_rename()">{=L:save=}</button> + <button type="button" ytype="cancel" onclick="do_rename_abort()">{=L:cancel=}</button> </p> </form> </div> - <table width="90%"> + <table width="100%" cellspacing="0" id="bouqueteditorlist"> <!-- line template --> {=var-set:row= <tr class="%c"> -<td align="center"> +<td align="center" width="30px"> %s <a href="javascript:do_set('%d','%s');"> - <img src="/images/%s.gif" alt="%s" style="border: 0px" /></a> + <img src="/images/%s.png" alt="%s" style="border: 0px" /></a> </td> -<td align="center"> +<td align="center" width="30px"> <a href="javascript:do_set('%d','%s');"> - <img src="/images/%s.gif" alt="%s" style="border: 0px" /> + <img src="/images/%s.png" alt="%s" style="border: 0px" /> </a> </td> <td><a href="/Y_Boxcontrol_Bouquet_Editor_Edit.yhtm?selected=%d&amp;name=%s">%s</a></td> -<td width="100" style="white-space: nowrap;"> +<td width="100" style="white-space: nowrap; font-weight:normal;"> <a href="javascript:do_rename_start('%d','%s');"> <img src="/images/modify.png" alt="umbenennen" style="border: 0px" /></a>&nbsp; <a href="javascript:do_delete('%d','%s');"> <img src="/images/remove.png" alt="l&ouml;schen" style="border: 0px" /></a>&nbsp; <span style="visibility:%s;"><a href="javascript:do_move('%d','down');"> - <img src="/images/arrowdown.gif" alt="nach unten" style="border: 0px" /></a>&nbsp;</span> + <img src="/images/arrowdown.png" alt="nach unten" style="border: 0px" /></a>&nbsp;</span> <span style="visibility:%s;"><a href="javascript:do_move('%d','up');"> - <img src="/images/arrowup.gif" alt="nach oben" style="border: 0px" /></a>&nbsp;</span> + <img src="/images/arrowup.png" alt="nach oben" style="border: 0px" /></a>&nbsp;</span> </td> </tr> =} {=func:bouquet_editor_main {=var-get:row=}=} </table> + <p> + <button type="button" ytype="add" onclick="javascript:do_add_start()">{=L:bouquet_add=}</button> + <button type="button" ytype="saveall" onclick="javascript:do_save()">{=L:save_all=}</button> + </p> </div> </div> </body> diff --git a/src/nhttpd/web/Y_Boxcontrol_Bouquets.yhtm b/src/nhttpd/web/Y_Boxcontrol_Bouquets.yhtm index ff46521b2..25f3c273e 100644 --- a/src/nhttpd/web/Y_Boxcontrol_Bouquets.yhtm +++ b/src/nhttpd/web/Y_Boxcontrol_Bouquets.yhtm @@ -3,7 +3,7 @@ <body> <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:BoxControl#Bouquet=}{=var-set:menu=Bouquet=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-BoxControl-Bouquet=}{=var-set:menu=Bouquet=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <iframe src="Y_Boxcontrol_Bouquetlist.yhtm?bouquet=#akt" scrolling="auto" marginheight="1" marginwidth="1" frameborder="0" name="bouquets" style="height : 600px;width:20%;"></iframe> diff --git a/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm b/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm index 60f196876..7adf30f94 100644 --- a/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm +++ b/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm @@ -1,25 +1,25 @@ {=var-set:cancache=yPInstall=} {=include-block:Y_Blocks.txt;head=} +<script type="text/javascript" src="/prototype.js"></script> <script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript" src="/Y_yweb.js"></script> <script type="text/javascript"> //<![CDATA[ var g_volumen = 100; -function volumen_set_audiobar(_volumen) -{ - var l = document.getElementById("audiobar_left"); - var r = document.getElementById("audiobar_right"); +function volumen_set_audiobar(_volumen){ + var l = $("audiobar_left"); + var r = $("audiobar_right"); /*IE: width=0 -> =""*/ if(_volumen > 0) l.width = _volumen.toString()+"%"; else - l.width = ""; + l.width = ""; if(_volumen >= 100) - r.width = ""; + r.width = ""; else r.width = (100-_volumen).toString()+"%"; } -function volumen_get() -{ +function volumen_get(){ var __volumen_str = loadSyncURL("/control/volume"); var __volumen = parseInt(__volumen_str,10); if(isNaN(__volumen)) __volumen=100; @@ -27,88 +27,122 @@ function volumen_get() g_volumen = __volumen; return __volumen; } -function volumen_set(_volumen) -{ +function volumen_set(_volumen){ _volumen = Math.min(100, _volumen); _volumen = Math.max(0, _volumen); loadSyncURL("/control/volume?"+_volumen); volumen_set_audiobar(_volumen); g_volumen = _volumen; } -function toggle_mute() -{ - var __button = document.getElementById("btMute"); - if(__button.firstChild.nodeValue == "Mute"){ - loadSyncURL("/control/volume?mute"); - __button.firstChild.nodeValue = "Unmute"; - } - else{ - loadSyncURL("/control/volume?unmute"); - __button.firstChild.nodeValue = "Mute"; - } +function set_mute_button(){ + var status = loadSyncURL("/control/volume?status"); + $('btMute').update( (status==1)? "&nbsp;<img src=\"/images/volumeunmute.png\">&nbsp;": "&nbsp;<img src=\"/images/volumemute.png\">&nbsp;"); + return status; } -function set_mode(_mode) -{ +function toggle_mute(){ + var status = loadSyncURL("/control/volume?status"); + if(status==0)//aus + loadSyncURL("/control/volume?mute"); + else + loadSyncURL("/control/volume?unmute"); + set_mute_button(); +} +function set_mode(_mode){ var actual_mode = loadSyncURL("/control/getmode"); if(actual_mode != _mode) loadSyncURL("/control/setmode?" + _mode); parent.work.location.reload(); } +function init(){ + volumen_set_audiobar(volumen_get()); + set_mute_button(); + var menu=ext.select_menu('boxcontrol'); + menu.each(function(e){ + var el=new Element('li').update( + new Element('a', {'target':'work', + 'title': e.get('desc'), + 'href': e.get('file') + }).update("-"+e.get('menuitem')) + ); + $('secmenu').insert({'bottom':el}); + }); + +} //]]> </script> </head> +{=var-set:lcshot={=if-file-exists:/bin/lcshot~true~{=if-file-exists:/var/bin/lcshot~true~false=}=}=} {=var-set:fbshot={=if-file-exists:/bin/fbshot~true~{=if-file-exists:/var/bin/fbshot~true~{=if-file-exists:/bin/dboxshot~true~{=if-file-exists:/var/bin/dboxshot~true~false=}=}=}=}=} {=var-set:dboxshot={=if-file-exists:/bin/dboxshot~true~{=if-file-exists:/var/bin/dboxshot~true~false=}=}=} <body> <div class="y_menu_sec_box"> - <div class="y_menu_sec_box_head"><h2>Boxcontrol</h2></div> + <div class="y_menu_sec_box_head"><h2>{=L:boxcontrol=}</h2></div> <div class="y_menu_sec_box_body"> <div class="y_menu_sec"> - <ul> - <li><a target="work" title="Switch channels" href="Y_Boxcontrol_Bouquets.yhtm">Bouquets</a></li> - <li><a target="work" title="control box functions (reboot, remote control, SPTS, ...)" href="Y_Tools_Boxcontrol.yhtm">Control</a></li> - <li><a target="work" title="send Messages to box" href="Y_Boxcontrol_Messages.yhtm">Messages</a></li> - <li><a target="work" title="Web-based Remote Control" href="Y_Tools_Rcsim.yhtm">Remote</a></li> - {=if-equal:{=var-get:fbshot=}~true~ - <li><a target="work" title="make osd screenshot" href="Y_Tools_fbshot.yhtm">OSD Screenshot</a></li> + <ul id="secmenu"> + <li><a target="work" title="{=L:bouquets_desc=}" href="Y_Boxcontrol_Bouquets.yhtm">{=L:bouquets=}</a></li> + <li><a target="work" title="{=L:control_desc=})" href="Y_Tools_Boxcontrol.yhtm">{=L:control=}</a></li> + <li><a target="work" title="{=L:messages_desc=}" href="Y_Boxcontrol_Messages.yhtm">{=L:messages=}</a></li> + <li><a target="work" title="{=L:remote_desc=}l" href="Y_Tools_Rcsim.yhtm">{=L:remote=}</a></li> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + {=if-equal:{=var-get:lcshot=}~true~ + <li><a target="work" title="{=L:lcd_screenshot_desc=}" href="Y_Tools_lcshot.yhtm">{=L:lcd_screenshot=}</a></li> ~ - <li class="disabled" title="fbshot not installed at /bin or /var/bin">OSD Screenshot</li> + <li class="disabled" title="{=L:lcd_screenshot_desc_ni=}">{=L:lcd_screenshot=}</li> + =} + ~=} + {=if-equal:{=var-get:fbshot=}~true~ + <li><a target="work" title="{=L:osd_screenshot_desc=}" href="Y_Tools_fbshot.yhtm">{=L:osd_screenshot=}</a></li> + ~ + <li class="disabled" title="{=L:osd_screenshot_desc_ni=}>{=L:osd_screenshot=}</li> =} {=if-equal:{=var-get:dboxshot=}~true~ - <li><a target="work" title="remote and osd" href="Y_Tools_remote_osd.yhtm">Remote &amp; OSD</a></li> + <li><a target="work" title="{=L:remote_osd_desc=}" href="Y_Tools_remote_osd.yhtm">{=L:remote_osd=}</a></li> ~ - <li class="disabled" title="dboxshot not installed at /bin or /var/bin">Remote &amp; OSD</li> + <li class="disabled" title="{=L:remote_osd_desc_ni=}">{=L:remote_osd=}</li> =} </ul> </div> </div> </div> <div class="y_menu_sec_box"> - <div class="y_menu_sec_box_head"><h2>Control</h2></div> + <div class="y_menu_sec_box_head"><h2>{=L:control=}</h2></div> <div class="y_menu_sec_box_body"> <center> - <table class="y_text_boxcontrol_table" cellspacing="0" cellpadding="0" title="volumen display"> + <table class="y_text_boxcontrol_table" cellspacing="0" cellpadding="0" title="{=L:volumen_display=}"> <tr> <td id="audiobar_left" width="100%"><img src="/images/blank.gif" height="1" width="0" alt="."/></td> <td id="audiobar_right" width="0%" bgcolor="white"><img src="/images/blank.gif" height="1" width="0" alt="."/></td> </tr> </table> <br/> - <span class="y_text_boxcontrol_button" title="decrease volumen"> - <a href="javascript:volumen_set(g_volumen-10);">&nbsp;<strong>-</strong>&nbsp;</a></span> - <span class="y_text_boxcontrol_button" title="increase volumen"> - <a href="javascript:volumen_set(g_volumen+10);">&nbsp;<strong>+</strong>&nbsp;</a></span> - <span class="y_text_boxcontrol_button" title="mute volumen"> - <a id="btMute" href="javascript:toggle_mute();">Mute</a></span> - <br/><br/> - <span class="y_text_boxcontrol_button" title="switch to TV"><a href="javascript:set_mode('tv');">TV</a></span> - <span class="y_text_boxcontrol_button" title="switch to Radio"><a href="javascript:set_mode('radio');">Radio</a></span> + <span title="{=L:decrease_volume=}"> + <a href="javascript:volumen_set(g_volumen-10);"><img src="/images/volumedown.png">&nbsp;</a></span> + <span title="{=L:increase_volume=}"> + <a href="javascript:volumen_set(g_volumen+10);"><img src="/images/volumeup.png"></a></span> + <span title="{=L:mute_volume=}"> + <a id="btMute" href="javascript:toggle_mute();">&nbsp;<img src="/images/volumemute.png">&nbsp;</a></span> +<!-- <br/><br/>--> + <span title="{=L:switch_to_tv=}"><a href="javascript:set_mode('tv');"><img src="/images/live.gif">&nbsp;</a></span> + <span title="{=L:switch_to_radio=}"><a href="javascript:set_mode('radio');">&nbsp;<img src="/images/radio.png"></a></span> </center> </div> </div> +{=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;slavebox=}~~ +<div class="y_menu_sec_box"> + <div class="y_menu_sec_box_head"><h2>Switch to</h2></div> + <div class="y_menu_sec_box_body"> + <div class="y_menu_sec"> + <ul> + <li><a target="_top" title="{=L:webinf_slavebox=}" href="http://{=ini-get:/var/tuxbox/config/Y-Web.conf;slavebox=}/">{=ini-get:/var/tuxbox/config/Y-Web.conf;slavebox=}</a></li> + </ul> + </div> + </div> +</div> +=} <script type="text/javascript"> //<![CDATA[ - volumen_set_audiobar(volumen_get()); + init(); //]]> </script> </body> diff --git a/src/nhttpd/web/Y_Boxcontrol_Messages.yhtm b/src/nhttpd/web/Y_Boxcontrol_Messages.yhtm index efe1273bb..fef59dbfa 100644 --- a/src/nhttpd/web/Y_Boxcontrol_Messages.yhtm +++ b/src/nhttpd/web/Y_Boxcontrol_Messages.yhtm @@ -1,35 +1,22 @@ {=var-set:cancache=yPyes=} {=include-block:Y_Blocks.txt;head=} -<script type="text/javascript" src="/Y_Baselib.js"></script> -<script type="text/javascript"> -//<![CDATA[ -function do_message() -{ - dbox_message(document.f.nmsg.value); -} -function do_popup() -{ - dbox_popup(document.f.popup.value); -} -//]]> -</script> </head> <body> <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:BoxControl#Message=}{=var-set:menu=Message=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-BoxControl-Message=}{=var-set:menu={=L:messages=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> - <form name="f" action="" method="get" enctype="application/x-www-form-urlencoded" accept-charset="UTF-8"> - <table class="y_invisible_table" cellpadding="5"> - <tr><td class="y_form_header">Message to Coolstram-TV Screen</td></tr> + <form name="f" action="/control/message" method="get" enctype="application/x-www-form-urlencoded" accept-charset="UTF-8"> + <table class="y_invisible_table" cellpadding="5" width="100%"> + <tr><td class="y_form_header">{=L:message_to_screen=}</td></tr> <tr><td> - <input name="nmsg" type="text" size="50" maxlength="255" title="enter message to send to TV screen"/> - <input type="button" name="message" value="send" title="send message" onclick="do_message()"/> + <input name="nmsg" type="text" size="50" maxlength="255" title="{=L:message_to_screen_desc=}"/> + <button type="submit" name="message" ytype="go" title="{=L:send=message=}">{=L:send=}</button> </td></tr> - <tr><td class="y_form_header">Popup message to Coolstream-TV Screen</td></tr> + <tr><td class="y_form_header">{=L:popup_to_screen=}</td></tr> <tr><td> - <input name="popup" type="text" size="50" maxlength="255" title="enter message to send to TV screen"/> - <input type="button" name="pmessage" value="send" title="send message" onclick="do_popup()"/> + <input name="popup" type="text" size="50" maxlength="255" title="{=L:message_to_screen_desc=}"/> + <button type="submit" name="pmessage" ytype="go" title="{=L:send=message=}">{=L:send=}</button> </td></tr> </table> <br/> diff --git a/src/nhttpd/web/Y_EPG.js b/src/nhttpd/web/Y_EPG.js new file mode 100644 index 000000000..7714bf9f4 --- /dev/null +++ b/src/nhttpd/web/Y_EPG.js @@ -0,0 +1,256 @@ +/* yWeb EPG by yjogol + $Date: 2008/02/24 08:23:12 $ + $Revision: 1.2 $ +*/ +/*EPG+*/ +var g_width_px=0; /*display width*/ +//var g_cols_to_display=0; /*minutes to display*/ +var g_number_of_cols=0; /*nr of cols*/ +var g_width_all_items=0; /*width without bouquet*/ +var c_width_px_per_min=3; /* px per minute */ +var c_min_per_col=15;/*minutes per col*/ +var c_width_px_bouquet=103; /* width of bouquet*/ +var c_slider_width=20; +var epg_data; /* all EPG Data in 2-dim Array*/ +var epg_data_index=0; +var g_timer_eventids = new Array(); +var g_selected=0; +//var epg_diag= new Y.Dialog('epg_info'); + +/* calc the dimension px and mins to display */ +function epg_plus_calc_dimensions(){ + var show_dim=$('epg_plus').getDimensions(); + var usable_width_px = show_dim.width-c_slider_width; /*get display width*/ + var max_minutes_to_display = Math.round((usable_width_px-c_width_px_bouquet)/c_width_px_per_min); /* calc display minutes*/ + g_number_of_cols = Math.round(max_minutes_to_display/c_min_per_col); + g_width_px = g_number_of_cols * c_width_px_per_min * c_min_per_col + c_width_px_bouquet; + g_width_all_items=g_width_px-c_width_px_bouquet; + $('epg_plus').style.cssText = "width:"+g_width_px; +} +function epg_zapto(){ + dbox_zapto($('d_channel_id').innerHTML); +} +function epg_set_timer(){ + dbox_set_timer($("d_channel_id").innerHTML, $("d_start").innerHTML, $("d_stop").innerHTML); +} +function build_epg_clear(){ + var ep = $("epg_plus"); + obj_clear_all_childs(ep); +} +/*set a layout box and content*/ +function build_epg_setbox(_item, _starttime, _stoptime, _start, _stop){ + var d_start = Math.max(_start, _starttime); + var d_stop = Math.min(_stop, _stoptime); + var d_left = c_width_px_bouquet+ Math.round((d_start-_starttime) * c_width_px_per_min / 60); + var d_width = Math.max(0,Math.round((d_stop-d_start) * c_width_px_per_min / 60)-3); + d_width= Math.min(d_width,g_width_px-d_left); + if(d_start<_stoptime) + _item.style.cssText = "position:absolute; top:0px; left:"+d_left+"px; width:"+d_width+"px;"; +} +/*show epg details*/ +function show_epg_item(_index){ + g_selected=_index; +//epg_diag.show(); + $("d_desc").update(epg_data[_index][4]+" "+epg_data[_index][0]); + $("d_info1").update(epg_data[_index][1]); + $("d_info2").update(epg_data[_index][2]); + $("d_start").update(epg_data[_index][3]); + $("d_stop").update(epg_data[_index][5]); + $("d_channel_id").update(epg_data[_index][6]); + $('d_logo').update( (g_logosURL!="")?"<img class=\"channel_logos\" src=\""+g_logosURL+"/"+epg_data[_index][6]+".gif\">":"" ); + var imdb_link = '<a target="_blank" class="exlink" href="http://german.imdb.com/find?s=all&q='+(epg_data[_index][0]).gsub(" ","+")+'">IMDb</a>'; + var klack_link = '<a target="_blank" class="exlink" href="http://klack.de/ProgramFinder2.php3?ZWTITLE='+(epg_data[_index][0]).gsub(" ","+")+'">klack.de</a>'; + var tvinfo_link = '<a target="_blank" class="exlink" href="http://www.tvinfo.de/exe.php3?quicksearch=1&volltext='+(epg_data[_index][0]).gsub(" ","+")+'&tpk=&showall=&genretipp=&target=list.inc">tvinfo.de</a>'; + $('d_lookup').update(imdb_link+" "+klack_link+" "+tvinfo_link); + + var off=$('epg_plus').cumulativeScrollOffset(); +// alert(off.inspect()); + $('epg_info').setStyle({ + 'left':off.left+50+'px', + 'top':off.top+50+'px', + 'position': 'absolute' +// 'background-color': 'white' + }); + show_obj("epg_info",true); +} +/* build one channel row*/ +function build_epg_bouquet(__bdiv, __channel_id, _starttime, _stoptime) +{ + var xml = loadSyncURLxml("/control/epg?xml=true&channelid="+__channel_id+"}&details=true&stoptime="+_stoptime); + if(xml){ + var prog_list = xml.getElementsByTagName('prog'); + for(var i=0;i<prog_list.length;i++){ + var prog = prog_list[i]; + + var _stop = getXMLNodeItemValue(prog, "stop_sec"); + _stop = parseInt(_stop); + if(_stop > _starttime){ + var _start_t = getXMLNodeItemValue(prog, "start_t"); + var _start = getXMLNodeItemValue(prog, "start_sec"); + _start = parseInt(_start); + var _stop_t = getXMLNodeItemValue(prog, "stop_t"); + var _desc = epg_de_qout(getXMLNodeItemValue(prog, "description")); + var _info1 = epg_de_qout(getXMLNodeItemValue(prog, "info1")); + var _info2 = epg_de_qout(getXMLNodeItemValue(prog, "info2")); + var __item = obj_createAt(__bdiv, "div", "ep_bouquet_item"); + + var epg_obj= new Array(_desc, _info1, _info2, _start, _start_t, _stop.toString(), __channel_id); + epg_data.push(epg_obj); + __item.innerHTML = "<span onclick=\"show_epg_item('"+epg_data_index+"');\" title=\""+_start_t+" "+_desc+" (click for details)\">"+_desc+"</span>"; + build_epg_setbox(__item, _starttime, _stoptime, _start, _stop); + epg_data_index++; + } + } + /* look for Timers*/ + var fou= g_timer_eventids.findAll(function(e){ + return e.get('channelid')==__channel_id; + }); + if(fou){ + fou.each(function(e){ + var stTime="0"; + var tclass=""; + if (e.get('eventType') == 3) { + stTime=e.get('alarmTime'); + stTime = parseInt(stTime, 10) + 200; + stTime = stTime.toString(); + tclass="ep_bouquet_zap"; + } + else if (e.get('eventType') == 5) {/*record*/ + stTime=e.get('stopTime'); + tclass="ep_bouquet_rec"; + } + var __item = obj_createAt(__bdiv, "div", tclass); + build_epg_setbox(__item, _starttime, _stoptime, e.get('alarmTime'), stTime); + }); + } + } +} +/* build time row*/ +function build_epg_time_bar(_tdiv, _starttime, _stoptime){ + var _start = _starttime; + for(var i=0;i<g_number_of_cols;i++){ + var __item = obj_createAt(_tdiv, "div", "ep_time_bar_item"); + __item.innerHTML = format_time(new Date(_start*1000)); + var _stop = _start + (c_min_per_col * 60); + build_epg_setbox(__item, _starttime, _stoptime, _start, _stop); + _start = _stop; + } +} +function get_timer(){ + g_timer_eventids = new Array(); + var timer = loadSyncURL("/control/timer?format=id"); + var lines=timer.split("\n"); + lines.each(function(e){ + var vals=e.split(" "); + if(vals.length>=8 && (vals[1]==3||vals[5])){ /*record and zap*/ + var aTimer=$H({ + 'eventID': vals[0], + 'eventType': vals[1], + 'eventRepeat': vals[2], + 'repcount': vals[3], + 'announceTime': vals[4], + 'alarmTime': vals[5], + 'stopTime': vals[6], + 'channelid': vals[7] + }); + g_timer_eventids.push(aTimer); + } + },this); +} + +/* main */ +var g_i = 0; +var g_bouquet_list; +var g_logosURL=""; +function build_epg_plus(_bouquet, _starttime) +{ + build_epg_clear(); + epg_data = new Array(); + epg_data_index=0; + var _bouquets_xml = loadSyncURLxml("/control/getbouquet?bouquet="+_bouquet+"&xml=true"); + if(_bouquets_xml){ + g_bouquet_list = _bouquets_xml.getElementsByTagName("channel"); + var ep = $("epg_plus"); + var _stoptime = _starttime + c_min_per_col * 60 * g_number_of_cols; + var __tdiv = obj_createAt(ep, "div", "ep_time_bar"); + var __tname_div = obj_createAt(__tdiv, "div", "ep_time_bar_item"); + __tname_div.innerHTML = "Uhrzeit"; + build_epg_time_bar(__tdiv, _starttime, _stoptime); + g_i=0; + window.setTimeout("build_epg_plus_loop("+_starttime+","+_stoptime+")",100); + } +} +function build_epg_plus_loop(_starttime, _stoptime) +{ + if(g_i<g_bouquet_list.length){ + var _bouquet = g_bouquet_list[g_i]; + var __channel_name = getXMLNodeItemValue(_bouquet, "name"); + var __channel_id = getXMLNodeItemValue(_bouquet, "id"); + var ep = $("epg_plus"); + var __bdiv = obj_createAt(ep, "div", "ep_bouquet"); + var __bname_div = obj_createAt(__bdiv, "div", "ep_bouquet_name"); + var ch_name_with_logo= (g_logosURL!="")?"<img class=\"channel_logos\" src=\""+g_logosURL+"/"+__channel_id+".gif\" alt=\""+__channel_name+"\" >":__channel_name; + $(__bname_div).update("<a href=\"javascript:do_zap('"+__channel_id+"');\">"+ch_name_with_logo+"</a>"); + build_epg_bouquet(__bdiv, __channel_id, _starttime, _stoptime); + window.setTimeout("build_epg_plus_loop("+_starttime+","+_stoptime+")",100); + g_i++; + } + else{ + show_waitbox(false); + obj_disable("btGet", false); + } +} +/* main: build epg+ */ +function build_epg_plus_main(){ + epg_plus_calc_dimensions(); + get_timer(); + show_obj("epg_info",false); + show_waitbox(true); + obj_disable("btGet", true); + var sel=document.e.bouquets.selectedIndex; + if(sel != -1) + bou = document.e.bouquets[sel].value; + else + bou = 1; + _secs=document.e.epg_time.value; + _secs=parseInt(_secs); + build_epg_plus(bou, _secs); + /*document.getElementById("epg_plus").width = g_width_px;*/ +} +/* change time offset and build epg+*/ +function build_epg_plus_delta(_delta){ + if(document.e.epg_time.selectedIndex + _delta < document.e.epg_time.length && document.e.epg_time.selectedIndex + _delta >= 0) + document.e.epg_time.selectedIndex += _delta; + build_epg_plus_main(); +} +/* time delta dropdown-list*/ +function build_time_list(_delta){ + var now = new Date(); + now.setMinutes(0); + now.setSeconds(0); + now.setMilliseconds(0); + now = new Date(now.getTime()+_delta*60*60*1000); + var _secs = now/1000; + var _hour = now.getHours(); + var et = document.getElementById("epg_time"); + for(i=0;i<24;i++){ + var _time = (_hour + i) % 24; + if(_time < 10) + _time = "0"+_time; + _time += ":00"; + var _time_t = _secs + i * 3600; + var __item = obj_createAt(et, "option", "ep_bouquet_item"); + __item.text = _time; + __item.value = _time_t; + } +} +/*init call*/ +function epg_plus_init(_logosURL){ + g_logosURL = _logosURL; + window.onresize=epg_plus_calc_dimensions; + build_time_list(0); +} +/* ---*/ +function do_zap(channelid){ + dbox_zapto(channelid); +} diff --git a/src/nhttpd/web/Y_EPG_Plus.js b/src/nhttpd/web/Y_EPG_Plus.js new file mode 100644 index 000000000..7e9ecaa0c --- /dev/null +++ b/src/nhttpd/web/Y_EPG_Plus.js @@ -0,0 +1,163 @@ +var g_width_px=650; +var g_width_min=135; +var g_delta_min=5; +var g_bar_delta_min=15; +var _delta = Math.round(g_width_px * g_delta_min / g_width_min); +var epg_data; +var epg_data_index=0; + +function epg_zapto() +{ + dbox_zapto(document.getElementById("d_channel_id").text); +} +function epg_set_timer() +{ + dbox_set_timer(document.getElementById("d_channel_id").text, document.getElementById("d_start").text, document.getElementById("d_stop").text); +} +function build_epg_clear() +{ + var ep = document.getElementById("epg_plus"); + obj_clear_all_childs(ep); +} +function build_epg_setbox(_item, _starttime, _stoptime, _start, _stop) +{ + var d_start = Math.max(_start, _starttime); + var d_stop = Math.min(_stop, _stoptime); + var d_left = 103+ Math.round((d_start-_starttime) * _delta / 60 / g_delta_min); + var d_width = Math.max(0,Math.round((d_stop-d_start) * _delta / 60 / g_delta_min)-3); + _item.style.cssText = "position:absolute; top:0px; left:"+d_left+"px; width:"+d_width+"px;"; +} +function show_epg_item(_index) +{ + show_obj("epg_info",true); + document.getElementById("d_desc").innerHTML = epg_data[_index][4]+" "+epg_data[_index][0]; + document.getElementById("d_info1").innerHTML = epg_data[_index][1]; + document.getElementById("d_info2").innerHTML = epg_data[_index][2]; + document.getElementById("d_start").text = epg_data[_index][3]; + document.getElementById("d_stop").text = epg_data[_index][5]; + document.getElementById("d_channel_id").text = epg_data[_index][6]; +} +function build_epg_bouquet(__bdiv, __channel_id, _starttime, _stoptime) +{ + var xml = loadSyncURLxml("/control/epg?xml=true&channelid="+__channel_id+"}&details=true&stoptime="+_stoptime); + if(xml){ + var prog_list = xml.getElementsByTagName('prog'); + for(var i=0;i<prog_list.length;i++){ + var prog = prog_list[i]; + + var _stop = getXMLNodeItemValue(prog, "stop_sec"); + _stop = parseInt(_stop); + if(_stop > _starttime){ + var _start_t = getXMLNodeItemValue(prog, "start_t"); + var _start = getXMLNodeItemValue(prog, "start_sec"); + _start = parseInt(_start); + var _stop_t = getXMLNodeItemValue(prog, "stop_t"); + var _desc = epg_de_qout(getXMLNodeItemValue(prog, "description")); + var _info1 = epg_de_qout(getXMLNodeItemValue(prog, "info1")); + var _info2 = epg_de_qout(getXMLNodeItemValue(prog, "info2")); + var __item = obj_createAt(__bdiv, "div", "ep_bouquet_item"); + + var epg_obj= new Array(_desc, _info1, _info2, _start, _start_t, _stop.toString(), __channel_id); + epg_data.push(epg_obj); + __item.innerHTML = "<span onclick=\"show_epg_item('"+epg_data_index+"');\" title=\""+_start_t+" "+_desc+" (click for details)\">"+_desc+"</span>"; + build_epg_setbox(__item, _starttime, _stoptime, _start, _stop); + epg_data_index++; + } + } + } +} +function build_epg_time_bar(_tdiv, _starttime, _stoptime) +{ + var __w_step = Math.round(g_width_px * g_bar_delta_min / g_width_min); + var __steps = Math.round(g_width_px / __w_step)+1; + var _start = _starttime; + for(var i=0;i<__steps;i++){ + var __item = obj_createAt(_tdiv, "div", "ep_time_bar_item"); + __item.innerHTML = format_time(new Date(_start*1000)); + var _stop = _start + (g_bar_delta_min * 60); + build_epg_setbox(__item, _starttime, _stoptime, _start, _stop); + _start = _stop; + } +} +var g_i = 0; +var g_bouquet_list; +function build_epg_plus(_bouquet, _starttime) +{ + build_epg_clear(); + epg_data = new Array(); + epg_data_index=0; + var _bouquets_xml = loadSyncURLxml("/control/getbouquet?bouquet="+_bouquet+"&xml=true"); + if(_bouquets_xml){ + g_bouquet_list = _bouquets_xml.getElementsByTagName("channel"); + var ep = document.getElementById("epg_plus"); + var _stoptime = _starttime + g_width_min * 60; + var __tdiv = obj_createAt(ep, "div", "ep_time_bar"); + var __tname_div = obj_createAt(__tdiv, "div", "ep_time_bar_item"); + __tname_div.innerHTML = "Uhrzeit"; + build_epg_time_bar(__tdiv, _starttime, _stoptime); + g_i=0; + window.setTimeout("build_epg_plus_loop("+_starttime+","+_stoptime+")",100); + } +} +function build_epg_plus_loop(_starttime, _stoptime) +{ + if(g_i<g_bouquet_list.length){ + var _bouquet = g_bouquet_list[g_i]; + var __channel_name = getXMLNodeItemValue(_bouquet, "name"); + var __channel_id = getXMLNodeItemValue(_bouquet, "id"); + var ep = document.getElementById("epg_plus"); + var __bdiv = obj_createAt(ep, "div", "ep_bouquet"); + var __bname_div = obj_createAt(__bdiv, "div", "ep_bouquet_name"); + + __bname_div.innerHTML = __channel_name; + build_epg_bouquet(__bdiv, __channel_id, _starttime, _stoptime); + window.setTimeout("build_epg_plus_loop("+_starttime+","+_stoptime+")",100); + g_i++; + } + else{ + show_waitbox(false); + obj_disable("btGet", false); + } +} +function build_epg_plus_main() +{ + show_obj("epg_info",false); + show_waitbox(true); + obj_disable("btGet", true); + var sel=document.e.bouquets.selectedIndex; + if(sel != -1) + bou = document.e.bouquets[sel].value; + else + bou = 1; + _secs=document.e.epg_time.value; + _secs=parseInt(_secs); + build_epg_plus(bou, _secs); + /*document.getElementById("epg_plus").width = g_width_px;*/ +} +function build_epg_plus_delta(_delta) +{ + if(document.e.epg_time.selectedIndex + _delta < document.e.epg_time.length && document.e.epg_time.selectedIndex + _delta >= 0) + document.e.epg_time.selectedIndex += _delta; + build_epg_plus_main(); +} +function build_time_list(_delta) +{ + var now = new Date(); + now.setMinutes(0); + now.setSeconds(0); + now.setMilliseconds(0); + now = new Date(now.getTime()+_delta*60*60*1000); + var _secs = now/1000; + var _hour = now.getHours(); + var et = document.getElementById("epg_time"); + for(i=0;i<24;i++){ + var _time = (_hour + i) % 24; + if(_time < 10) + _time = "0"+_time; + _time += ":00"; + var _time_t = _secs + i * 3600; + var __item = obj_createAt(et, "option", "ep_bouquet_item"); + __item.text = _time; + __item.value = _time_t; + } +} diff --git a/src/nhttpd/web/Y_EPG_Plus.yhtm b/src/nhttpd/web/Y_EPG_Plus.yhtm index 1d673fb55..d59bbd0e0 100644 --- a/src/nhttpd/web/Y_EPG_Plus.yhtm +++ b/src/nhttpd/web/Y_EPG_Plus.yhtm @@ -1,209 +1,68 @@ {=include-block:Y_Blocks.txt;head_no_charset=} <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript" src="/prototype.js"></script> +<script type="text/javascript" src="/Y_EPG.js"></script> <script type="text/javascript"> -//<![CDATA[ -var g_width_px=650; -var g_width_min=135; -var g_delta_min=5; -var g_bar_delta_min=15; -var _delta = Math.round(g_width_px * g_delta_min / g_width_min); -var epg_data; -var epg_data_index=0; - -function epg_zapto() -{ - dbox_zapto(document.getElementById("d_channel_id").text); +function epg_imdb(){ + } -function epg_set_timer() -{ - dbox_set_timer(document.getElementById("d_channel_id").text, document.getElementById("d_start").text, document.getElementById("d_stop").text); -} -function build_epg_clear() -{ - var ep = document.getElementById("epg_plus"); - obj_clear_all_childs(ep); -} -function build_epg_setbox(_item, _starttime, _stoptime, _start, _stop) -{ - var d_start = Math.max(_start, _starttime); - var d_stop = Math.min(_stop, _stoptime); - var d_left = 103+ Math.round((d_start-_starttime) * _delta / 60 / g_delta_min); - var d_width = Math.max(0,Math.round((d_stop-d_start) * _delta / 60 / g_delta_min)-3); - _item.style.cssText = "position:absolute; top:0px; left:"+d_left+"px; width:"+d_width+"px;"; -} -function show_epg_item(_index) -{ - show_obj("epg_info",true); - document.getElementById("d_desc").innerHTML = epg_data[_index][4]+" "+epg_data[_index][0]; - document.getElementById("d_info1").innerHTML = epg_data[_index][1]; - document.getElementById("d_info2").innerHTML = epg_data[_index][2]; - document.getElementById("d_start").text = epg_data[_index][3]; - document.getElementById("d_stop").text = epg_data[_index][5]; - document.getElementById("d_channel_id").text = epg_data[_index][6]; -} -function build_epg_bouquet(__bdiv, __channel_id, _starttime, _stoptime) -{ - var xml = loadSyncURLxml("/control/epg?xml=true&channelid="+__channel_id+"}&details=true&stoptime="+_stoptime); - if(xml){ - var prog_list = xml.getElementsByTagName('prog'); - for(var i=0;i<prog_list.length;i++){ - var prog = prog_list[i]; - - var _stop = getXMLNodeItemValue(prog, "stop_sec"); - _stop = parseInt(_stop); - if(_stop > _starttime){ - var _start_t = getXMLNodeItemValue(prog, "start_t"); - var _start = getXMLNodeItemValue(prog, "start_sec"); - _start = parseInt(_start); - var _stop_t = getXMLNodeItemValue(prog, "stop_t"); - var _desc = epg_de_qout(getXMLNodeItemValue(prog, "description")); - var _info1 = epg_de_qout(getXMLNodeItemValue(prog, "info1")); - var _info2 = epg_de_qout(getXMLNodeItemValue(prog, "info2")); - var __item = obj_createAt(__bdiv, "div", "ep_bouquet_item"); - - var epg_obj= new Array(_desc, _info1, _info2, _start, _start_t, _stop.toString(), __channel_id); - epg_data.push(epg_obj); - __item.innerHTML = "<span onclick=\"show_epg_item('"+epg_data_index+"');\" title=\""+_start_t+" "+_desc+"\">"+_desc+"</span>"; - build_epg_setbox(__item, _starttime, _stoptime, _start, _stop); - epg_data_index++; - } - } - } -} -function build_epg_time_bar(_tdiv, _starttime, _stoptime) -{ - var __w_step = Math.round(g_width_px * g_bar_delta_min / g_width_min); - var __steps = Math.round(g_width_px / __w_step)+1; - var _start = _starttime; - for(var i=0;i<__steps;i++){ - var __item = obj_createAt(_tdiv, "div", "ep_time_bar_item"); - __item.innerHTML = format_time(new Date(_start*1000)); - var _stop = _start + (g_bar_delta_min * 60); - build_epg_setbox(__item, _starttime, _stoptime, _start, _stop); - _start = _stop; - } -} -var g_i = 0; -var g_bouquet_list; -function build_epg_plus(_bouquet, _starttime) -{ - build_epg_clear(); - epg_data = new Array(); - epg_data_index=0; - var _bouquets_xml = loadSyncURLxml("/control/getbouquet?bouquet="+_bouquet+"&xml=true"); - if(_bouquets_xml){ - g_bouquet_list = _bouquets_xml.getElementsByTagName("channel"); - var ep = document.getElementById("epg_plus"); - var _stoptime = _starttime + g_width_min * 60; - var __tdiv = obj_createAt(ep, "div", "ep_time_bar"); - var __tname_div = obj_createAt(__tdiv, "div", "ep_bouquet_name"); - __tname_div.innerHTML = "Time"; - build_epg_time_bar(__tdiv, _starttime, _stoptime); - g_i=0; - window.setTimeout("build_epg_plus_loop("+_starttime+","+_stoptime+")",100); - } -} -function build_epg_plus_loop(_starttime, _stoptime) -{ - if(g_i<g_bouquet_list.length){ - var _bouquet = g_bouquet_list[g_i]; - var __channel_name = getXMLNodeItemValue(_bouquet, "name"); - var __channel_id = getXMLNodeItemValue(_bouquet, "id"); - var ep = document.getElementById("epg_plus"); - var __bdiv = obj_createAt(ep, "div", "ep_bouquet"); - var __bname_div = obj_createAt(__bdiv, "div", "ep_bouquet_name"); - - __bname_div.innerHTML = __channel_name; - build_epg_bouquet(__bdiv, __channel_id, _starttime, _stoptime); - window.setTimeout("build_epg_plus_loop("+_starttime+","+_stoptime+")",100); - g_i++; - } - else{ - show_waitbox(false); - obj_disable("btGet", false); - } -} -function build_epg_plus_main() -{ - show_obj("epg_info",false); - show_waitbox(true); - obj_disable("btGet", true); - var sel=document.e.bouquets.selectedIndex; - if(sel != -1) - bou = document.e.bouquets[sel].value; - else - bou = 1; - _secs=document.e.epg_time.value; - _secs=parseInt(_secs); - build_epg_plus(bou, _secs); - /*document.getElementById("epg_plus").width = g_width_px;*/ -} -function build_epg_plus_delta(_delta) -{ - if(document.e.epg_time.selectedIndex + _delta < document.e.epg_time.length && document.e.epg_time.selectedIndex + _delta >= 0) - document.e.epg_time.selectedIndex += _delta; - build_epg_plus_main(); -} -function build_time_list(_delta) -{ - var now = new Date(); - now.setMinutes(0); - now.setSeconds(0); - now.setMilliseconds(0); - now = new Date(now.getTime()+_delta*60*60*1000); - var _secs = now/1000; - var _hour = now.getHours(); - var et = document.getElementById("epg_time"); - for(i=0;i<24;i++){ - var _time = (_hour + i) % 24; - if(_time < 10) - _time = "0"+_time; - _time += ":00"; - var _time_t = _secs + i * 3600; - var __item = obj_createAt(et, "option", "ep_bouquet_item"); - __item.text = _time; - __item.value = _time_t; - } -} -//]]> </script> + </head> <body> -{=var-set:wait_text=get EPG.=}{=include-block:Y_Blocks.txt;snip_wait=} +{=var-set:wait_text={=L:get_epg=}=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Live_Timer#EPG_Plus=}{=var-set:menu=EPG Plus=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Live_Timer-EPG_Plus=}{=var-set:menu={=L:epg_plus=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <form name="e"> - <select size="1" class="y_live_bouquets" name="bouquets" title="select bouquet - channels will be updated"> + <select size="1" class="y_live_bouquets" name="bouquets" title="{=L:select_bouquet=}"> {=func:get_bouquets_as_dropdown {=if-empty:{=bouquets=}~{=func:get_actual_bouquet_number=}~{=bouquets=}=}=} </select> <select id="epg_time" size="1" name="epg_time"> </select> - <input id="btGet" type="button" value="Update" title="get or refresh EPG" onclick="build_epg_plus_main()"> - <input id="btPast" type="button" value="-2" title="past hours" onclick="build_epg_plus_delta(-2)"> - <input id="btNext" type="button" value="+2" title="next hours" onclick="build_epg_plus_delta(2)"> + <button id="btGet" type="button" ytype="{=L:refresh=}" title="get or refresh EPG" onclick="build_epg_plus_main()">{=L:refresh=}</button> + <button id="btPast" type="button" ytype="timedown" title="past hours" onclick="build_epg_plus_delta(-2)">-2</button> + <button id="btNext" type="button" ytype="timeup"" title="next hours" onclick="build_epg_plus_delta(2)">+2</button> </form> <div id="epg_plus">&nbsp;</div> - <div id="epg_info"> - <strong>Details</strong> - <input type="button" value="Record" title="set timer for recording" onclick="epg_set_timer()"/> - <input type="button" value="Zap" title="switch to channel" onclick="epg_zapto()"/> - <div id="d_desc" class="ep_info_desc">&nbsp;</div> - <div id="d_info1" class="ep_info_info1">&nbsp;</div> - <div id="d_info2" class="ep_info_info2">&nbsp;</div> - <div id="d_start" style="display:none"></div> - <div id="d_stop" style="display:none"></div> - <div id="d_channel_id" style="display:none"><div> - - </div> + </div> </div> +<div id="epg_info" style="visible:hidden;"> + <table cellpadding="2" cellspacing="2"> + <tr valign="top"> + <td width="50" valign="middle"><div id="d_logo"></div></td> + <td> + <div id="d_desc" class="ep_info_desc">&nbsp;</div> + <div id="d_info1" class="ep_info_info1">&nbsp;</div> + </td> + <td width="20"><a href="javascript:show_obj('epg_info',false);"><img src="/images/cross.png"></a></td> + </tr> + <tr> + <td colspan="3"> + <div id="d_info2" class="ep_info_info2">&nbsp;</div> + <div id="d_start" style="display:none"></div> + <div id="d_stop" style="display:none"></div> + <div id="d_channel_id" style="display:none"><div> + <br/> + </td> + </tr> + <tr> + <td colspan="3"> + <button ytype="record" title="set timer for recording" onclick="epg_set_timer();show_obj('epg_info',false);">{=L:record=}</button> + <button ytype="zap" title="switch to channel" onclick="epg_zapto();show_obj('epg_info',false);">{=L:zap=}</button> + {=L:lookup=}: + <span id="d_lookup"></span> + </td> + </tr> + </table> +</div> <script type="text/javascript"> //<![CDATA[ - build_time_list(0); + epg_plus_init("{=ini-get:/var/tuxbox/config/nhttpd.conf;Tuxbox.LogosURL=}"); //]]> </script> diff --git a/src/nhttpd/web/Y_Ext_Menue.yhtm b/src/nhttpd/web/Y_Ext_Menue.yhtm index aa0c080c4..f4fbcade8 100644 --- a/src/nhttpd/web/Y_Ext_Menue.yhtm +++ b/src/nhttpd/web/Y_Ext_Menue.yhtm @@ -1,67 +1,57 @@ -{=var-set:extention={=if-file-exists:/var/tuxbox/config/extentions.txt~/var/tuxbox/config/extentions.txt~{=if-file-exists:/var/httpd/extentions.txt~/var/httpd/extentions.txt~/share/tuxbox/neutrino/httpd-y/extentions.txt=}=}=} +{=var-set:extension={=if-file-exists:/var/tuxbox/config/extentions.txt~/var/tuxbox/config/extentions.txt~{=if-file-exists:/var/httpd/extentions.txt~/var/httpd/extentions.txt~/share/tuxbox/neutrino/httpd-y/extentions.txt=}=}=} {=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} {=include-block:Y_Blocks.txt;head=} +<script type="text/javascript" src="/prototype.js"></script> <script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript" src="/Y_yweb.js"></script> <script type="text/javascript"> //<![CDATA[ -function y_add_li_to_ul(_ul, _class, _value) -{ - var __li=document.createElement("li"); - var __class = document.createAttribute("class"); - __class.nodeValue = _class; - _ul.setAttributeNode(__class); - _ul.appendChild(__li); - __li.innerHTML=_value; - return __li; -} -function build_menu() -{ - var extfile = "{=var-get:extention=}"; - var extlist = loadSyncURL("/control/exec?Y_Tools&get_extention_list&" + Math.random()); - var list = extlist.split("\n"); - for(i=0;i<list.length;i++){ - var ext_type = list[i].charAt(0); - if(ext_type=="n" || ext_type=="m"){ - var pieces=list[i].split(","); - if(ext_type=="n"){ - var item="<a target=\"work\" title=\""+pieces[2]+"\" href=\""+pieces[3]+"\">"+pieces[1]+"</a>"; - y_add_li_to_ul(id("ext_normal"),"ext",item); - } else { - {=if-empty:{=var-get:management=}~ - var item="<span class=\"disabled\" title=\""+pieces[2]+" (restricted by ManagementIP)\">"+pieces[1]+"</span>"; - ~ - var item="<a target=\"work\" title=\""+pieces[2]+"\" href=\""+pieces[3]+"\">"+pieces[1]+"</a>"; - =} - y_add_li_to_ul(id("ext_management"),"ext",item); - } - } - } + +function build_menu(){ +// ext.read_items(); + var ext_normal=ext.select_type("n"); + ext_normal.each(function(e){ + var item="<a target=\"work\" title=\""+e.get('desc')+"\" href=\""+e.get('file')+"\">"+e.get('menuitem')+"</a>"; + y_add_li_to_ul(id("ext_normal"),"ext",item); + }); + var ext_normal=ext.select_type("m"); + ext_normal.each(function(e){ + {=if-empty:{=var-get:management=}~ + var item="<span class=\"disabled\" title=\""+e.get('desc')+" (restricted by ManagementIP)\">"+e.get('menuitem')+"</span>"; + ~ + var item="<a target=\"work\" title=\""+e.get('desc')+"\" href=\""+e.get('file')+"\">"+e.get('menuitem')+"</a>"; + =} + y_add_li_to_ul(id("ext_management"),"ext",item); + }); } //]]> </script> </head> <body onload="build_menu()"> <div class="y_menu_sec_box"> - <div class="y_menu_sec_box_head"><h2>Extentions</h2></div> + <div class="y_menu_sec_box_head"><h2>{=L:extensions=}</h2></div> <div class="y_menu_sec_box_body"> - <div class="y_menu_sec_section">Normal</div> + <div class="y_menu_sec_section">{=L:normal=}</div> <div class="y_menu_sec"> <ul id="ext_normal"> <ul> </div> - <div class="y_menu_sec_section">Management</div> + <div class="y_menu_sec_section">{=L:management=}</div> <div class="y_menu_sec" id="ext_management2"> <ul id="ext_management"> </ul> </div> - <div class="y_menu_sec_section">Admin</div> + <div class="y_menu_sec_section">{=L:administration=}</div> <div class="y_menu_sec"> <ul> {=if-empty:{=var-get:management=}~ - <li class="disabled" title="Extentions settings. (restricted by ManagementIP)">Settings</li> + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:settings=}</li> + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:ext.installer_updater=}</li> + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:uninstaller=}</li> ~ - <li><a target="work" title="Extentions settings" href="Y_Ext_Settings.yhtm">Settings</a></li> - <li><a target="work" title="Extentions updater/installer" href="Y_Ext_Update.yhtm">Updater/Installer</a></li> + <li><a target="work" title="" href="Y_Ext_Settings.yhtm">{=L:settings=}</a></li> + <li><a target="work" title="" href="Y_Ext_Update.yhtm">{=L:ext.installer_updater=}</a></li> + <li><a target="work" title="" href="Y_Ext_Uninstall.yhtm">{=L:uninstaller=}</a></li> =} </ul> </div> diff --git a/src/nhttpd/web/Y_Ext_Settings.yhtm b/src/nhttpd/web/Y_Ext_Settings.yhtm index ca6f62ca7..9da161630 100644 --- a/src/nhttpd/web/Y_Ext_Settings.yhtm +++ b/src/nhttpd/web/Y_Ext_Settings.yhtm @@ -1,10 +1,12 @@ {=include-block:Y_Blocks.txt;management_check_top=} {=include-block:Y_Blocks.txt;head=} +<script type="text/javascript" src="/prototype.js"></script> <script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript" src="/Y_yweb.js"></script> +<script type="text/javascript" src="/Y_Ext_Update.js"></script> <script type="text/javascript"> //<![CDATA[ -function do_submit() -{ +function do_submit(){ show_waitbox(true); document.f.submit(); } @@ -12,10 +14,10 @@ function do_submit() </script> </head> <body> -{=var-set:wait_text=Save.=}{=include-block:Y_Blocks.txt;snip_wait=} +{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Extentions#Settings=}{=var-set:menu=Extentions Settings=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Extensions-Settings=}{=var-set:menu={=L:settings=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <form name="f" accept-charset="UTF-8" action="/y/cgi"> <table border="0" class="y_form_table" cellspacing="0" cellpadding="0"> @@ -27,11 +29,10 @@ function do_submit() <br/> <input type="hidden" name="tmpl" value="Y_Ext_Update_refresh.yhtm"/> <input type="hidden" name="execute" value="include-block:Y_Blocks.txt;ext_save_settings;nix"/> - <input type="button" value="Save ..." title="submit and save values" onclick="do_submit()"/> + <button type="button" ytype="save" title="{=L:save_values_desc=}" onclick="do_submit()">{=L:save=}</button> </form> </div> </div> </body> </html> {=include-block:Y_Blocks.txt;management_check_bottom=} - diff --git a/src/nhttpd/web/Y_Ext_Uninstall.yhtm b/src/nhttpd/web/Y_Ext_Uninstall.yhtm new file mode 100644 index 000000000..a2080b4a3 --- /dev/null +++ b/src/nhttpd/web/Y_Ext_Uninstall.yhtm @@ -0,0 +1,79 @@ +{=include-block:Y_Blocks.txt;management_check_top=} +{=include-block:Y_Blocks.txt;head=} +<script type="text/javascript" src="/prototype.js"></script> +<script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript" src="/Y_yweb.js"></script> +<script type="text/javascript" src="/Y_Ext_Update.js"></script> +<script type="text/javascript"> +//<![CDATA[ +function init(){ + window.setTimeout("uninstall_build_list();",300); +} +//]]> +</script> +<style> +.type, .uninstall{ + text-align:center;; +} +</style> +</head> +<body onload="init()"> +{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=} +<div class="work_box"> + <div class="work_box_head"><div class="work_box_head_h2"> + {=var-set:help_url=Help-Extensions-Uninstall=}{=var-set:menu=Extensions Uninstaller=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + <div class="work_box_body"> + <div id="statusline"><img border="0" src="/images/wait.gif" width="20" height="20" alt="wait"/> + <span id="status">Search for Extensions ...</span></div> + + <form method="post" name="update" action=""> +<!-- <input type="button" value="build list" title="build list" onclick="build_list()"/>--> + <br/> + <div class="y_form_header_oline">installed extensions</div> + <table class="lt_table" cellspacing="0" cellpadding="2"> + <thead align="left"> + <tr valign="bottom"> + <th>Type</th><th>Extension</th> + <th>Tag</th><th>Version</th><th>Size/k</th><th>uninstall</th><th>Info</th> + </tr> + </thead> + <tbody id="update_list"> + <tr><td></td></tr> + </tbody> + </table> + </form> + <br/> + <div id="free">?</div> + Free:&nbsp;<span id="avaiable">?</span>k + <form method="post" name="log" action=""> + <div class="y_form_header_oline">Log</div> + <table class="lt_table" cellspacing="0" cellpadding="4"> + <thead align="left"> + <tr> + <th>&nbsp;</th><th>Action</th><th>Status</th> + </tr> + </thead> + <tbody id="slog_list"> + <tr><td></td></tr> + </tbody> + </table> + <br/> + </form> + <br/> + <div class="y_form_header">New extension settings (preview)</div> + <form name="f" accept-charset="UTF-8" action="/y/cgi"> + <table border="0" class="y_form_table" cellspacing="0" cellpadding="0"> + <tr> + <td><textarea name="extentions" cols="90" rows="5" title="extention list" style="background : white; font : 'Courier New',medium monospace; color : #436976;"></textarea></td> + </tr> + </table> + <br/> + <input type="hidden" name="tmpl" value="Y_Ext_Update_refresh.yhtm"/> + <input type="hidden" name="execute" value="include-block:Y_Blocks.txt;ext_save_settings;nix"/> + </form> + </div> +</div> +</body> +</html> +{=include-block:Y_Blocks.txt;management_check_bottom=} + diff --git a/src/nhttpd/web/Y_Ext_Update.js b/src/nhttpd/web/Y_Ext_Update.js new file mode 100644 index 000000000..e1ec3d232 --- /dev/null +++ b/src/nhttpd/web/Y_Ext_Update.js @@ -0,0 +1,239 @@ +function do_submit() +{ + show_waitbox(true); + document.f.submit(); +} +/*sLog*/ +var sLog_body; +var sLog_line_number; +function sLog_init(){ + sLog_line_number = 0; + sLog_body=$("slog_list"); +} +function sLog_clear(){ + sLog_body.update(); + sLog_line_number = 0; +} +function sLog_addRow(_body, state, action_text, state_text){ + sLog_line_number++; + var mycurrent_row = y_add_row_to_table(_body, ((sLog_line_number % 2) ==0)?"a":"b" ); + var __img ="/images/info.png"; + switch (state) + { + case "green": __img = "/images/accept.png"; break; + case "yellow": __img = "/images/alert.gif"; break; + case "ok": __img = "/images/info.png"; break; + case "red": __img = "/images/remove.png"; break; + } + y_add_html_cell_to_row(mycurrent_row, "icon", "<img src='"+__img+"'>"); + y_add_html_cell_to_row(mycurrent_row, "action_text", action_text); + y_add_text_cell_to_row(mycurrent_row, "state_text", state_text); +} +/*update_list*/ +var update_body; +/*<upd_site>,<type=n|m>,<link text>,<link helptext>,<url>,<unique tag>,<version>,<url of installer>*/ +/*<type=n|m>,<link text>,<link helptext>,<url>,<unique tag>,<version>*/ +/*<type=u>,<update site name>,<update site helptext>,<url of extention list>*/ +function list_init(){ + update_body=$("update_list"); +} +function list_clear(){ + update_body.update(); +} +function update_list_addRow(_body, i, your_version, ext_item) +{ + var mycurrent_row = y_add_row_to_table(_body, ((i % 2) ==0)?"a":"b" ); + + var check='<input type="checkbox" name="setupdate" id="ch'+i+'" ysize="'+ext_item.get('size')+'" onchange="changeitem(ch'+i+')">'; + var info=""; + var etype=""; + + switch (ext.upd_version){ + case "1": + yweb_version = "%"; + break; + case "2": + var yweb_version=ext_item.get('yweb_version'); + if (!yweb.require(yweb_version)) + check = ""; + info="<a href=\""+ext_item.get('info_url')+"\" target=\"_blank\"><img src=\"/images/info.png\"/></a>"; + break; + } + switch(ext_item.get('type')){ + case "m": etype="<img src=\"/images/ext_mgr.png\" alt=\"m\" title=\"Extension: Management\"/>";break; + case "n": etype="<img src=\"/images/ext_normal.png\" alt=\"n\" title=\"Extension: Normal\"/>";break; + case "s": etype="<img src=\"/images/ext_script.png\" alt=\"s\" title=\"Script\"/>";break; + case "p": etype="<img src=\"/images/ext_plugin.png\" alt=\"p\" title=\"Plugin\"/>";break; + case "x": etype="<img src=\"/images/ext_menu.png\" alt=\"x\" title=\"Menu Extension\"/>";break; + case "o": etype="<img src=\"/images/ext_ex.png\" alt=\"o\" title=\"One Time Run\"/>";break; + + } + var upd_version = ext_item.get('version'); + if(version_str_less(your_version,upd_version)) + upd_version="<b>"+upd_version+"</b>"; + y_add_html_cell_to_row(mycurrent_row, "setupdate", check); + y_add_text_cell_to_row(mycurrent_row, "site", ext_item.get('site')); + y_add_html_cell_to_row(mycurrent_row, "type", etype); + y_add_text_cell_to_row(mycurrent_row, "menu", ext_item.get('menuitem')); + y_add_text_cell_to_row(mycurrent_row, "tag", ext_item.get('tag')); + y_add_text_cell_to_row(mycurrent_row, "your_version", your_version); + y_add_html_cell_to_row(mycurrent_row, "update_version", upd_version); + y_add_html_cell_to_row(mycurrent_row, "yweb_version", yweb_version); + y_add_html_cell_to_row(mycurrent_row, "size", ext_item.get('size')); + y_add_html_cell_to_row(mycurrent_row, "info", info); +} +function changeitem(e){ + var avail=0; + try{ + var a=$('avaiable').innerHTML; + avail=parseInt(a,10); + var siz=parseInt($(e).readAttribute('ysize'),10); + if($(e).checked) + avail-=siz; + else + avail+=siz; + $('avaiable').update(avail); + } + catch(e){}; +} +function build_list(){ + $('statusline').show(); + window.setTimeout("build_list2()",300); +} +function build_list2() +{ + show_free(); + sLog_init(); + list_init(); + list_clear(); + + ext.read_items(); + sLog_addRow(sLog_body, "green", "installed Extensions: "+ext.installed_extensions.length, "ok"); + ext.on_get_updates=function(site,isError){ + if(isError) + sLog_addRow(sLog_body, "red", "cannot get list from: "+site, "error"); + else + sLog_addRow(sLog_body, "green", "get list from: "+site, "ok"); + }; + ext.get_updates(); + /*build_list*/ + i=0; + ext.upd_extensions.each(function(e){ + var your_version="%"; + var have=ext.installed_extensions.find(function(ex){ + try { return ex.get('tag')==e.get('tag');} + catch(e){return false;} + }); + if(have) + your_version = have.get('version'); + update_list_addRow(update_body,++i,your_version,e); + }); + $('statusline').hide(); +} +function do_set_updates(){ + show_waitbox(true); + window.setTimeout("do_set_updates2()",300); +} +function do_set_updates2(){ + var _rows = update_body.getElementsByTagName("tr"); + for(var i=0; i< _rows.length; i++){ + var rowNode = _rows.item(i); + if(rowNode.firstChild.firstChild && rowNode.firstChild.firstChild.checked == true){ + var res=ext.install(ext.upd_extensions[i]); + res=res.gsub("\n","<br/>"); + if(res.search(/error/)!=-1) + sLog_addRow(sLog_body, "red", "update error: "+res, "error"); + else + sLog_addRow(sLog_body, "green", "installed/updates: "+ext.upd_extensions[i].get('tag')+" "+ext.upd_extensions[i].get('version')+"<br>"+res, "ok"); + } + } + sLog_addRow(sLog_body, "green", "updating local extension list. Starting ...", "ok"); + var extfile=ext.build_extension_file(); + document.f.extentions.value=extfile; + show_waitbox(false); + alert("Update finished. Menue reload.") + do_submit(); +} +var avaiable=0; +function show_free(){ + var res=dbox_exec_tools("var_space"); + var Ausdruck = /([^ ]*)[ ]*([^ ]*)[ ]*([^ ]*)[ ]*([^ ]*)[ ]*([^ ]*)[ ]*([^ ]*).*$/; + Ausdruck.exec(res); + var total = RegExp.$2; + var used = RegExp.$3; + avaiable = RegExp.$4; + var percentage = RegExp.$5; + if (total != "") { + str = "Sapce in /var Total: " + total + "k used: " + used + "k Free: " + avaiable + "k part used: " + percentage; + $('avaiable').update(avaiable); + } + else + str = "Can not determine free space /var is no partition! JFFS2 oder YADD?"; + $("free").update(str); +} +/*uninstall*/ +function uninstall_list_addRow(_body, i, ext_item, has_uninstall) +{ + var mycurrent_row = y_add_row_to_table(_body, ((i % 2) ==0)?"a":"b" ); + +// var check='<input type="checkbox" name="setupdate" id="ch'+i+'" ysize="'+ext_item.get('size')+'" onchange="changeitem(ch'+i+')">'; + var etype=""; + var info="<a href=\""+ext_item.get('info_url')+"\" target=\"_blank\"><img src=\"/images/info.png\"/></a>"; + var uninst="<a href=\'javascript:do_uninstall(\""+ext_item.get('tag')+"\")\' title=\"uninstall\"><img src=\"/images/cross.png\"/></a>"; + if(!has_uninstall) uninst="&nbsp;"; + switch(ext_item.get('type')){ + case "m": etype="<img src=\"/images/ext_mgr.png\" alt=\"m\" title=\"Extension: Management\"/>";break; + case "n": etype="<img src=\"/images/ext_normal.png\" alt=\"n\" title=\"Extension: Normal\"/>";break; + case "s": etype="<img src=\"/images/ext_script.png\" alt=\"s\" title=\"Script\"/>";break; + case "p": etype="<img src=\"/images/ext_plugin.png\" alt=\"p\" title=\"Plugin\"/>";break; + case "x": etype="<img src=\"/images/ext_menu.png\" alt=\"x\" title=\"Menu Extension\"/>";break; + case "o": etype="<img src=\"/images/ext_ex.png\" alt=\"o\" title=\"One Time Run\"/>";break; + } + y_add_html_cell_to_row(mycurrent_row, "type", etype); + y_add_text_cell_to_row(mycurrent_row, "menu", ext_item.get('menuitem')); + y_add_text_cell_to_row(mycurrent_row, "tag", ext_item.get('tag')); + y_add_text_cell_to_row(mycurrent_row, "version", ext_item.get('version')); + y_add_html_cell_to_row(mycurrent_row, "size", ext_item.get('size')); + y_add_html_cell_to_row(mycurrent_row, "uninstall", uninst); + y_add_html_cell_to_row(mycurrent_row, "info", info); +} +function do_uninstall(tag){ + if (confirm("Delete " + tag)) { + show_waitbox(true); + window.setTimeout("do_uninstall2(\"" + tag + "\")", 300); + } +} +function do_uninstall2(tag){ + var res=ext.uninstall(tag); + res=res.gsub("\n","<br/>"); + if(res.search(/error/)!=-1) + sLog_addRow(sLog_body, "red", "uninstall error: "+res, "error"); + else + sLog_addRow(sLog_body, "green", "uninstalled: "+tag+"<br/>"+res, "ok"); + sLog_addRow(sLog_body, "green", "updating local extension list. Starting ...", "ok"); + var extfile=ext.build_extension_file(); + document.f.extentions.value=extfile; + show_waitbox(false); + alert("Update finished. Menue reload.") + do_submit(); +} +function uninstall_build_list(){ + $('statusline').show(); + window.setTimeout("uninstall_build_list2()",300); +} +function uninstall_build_list2(){ + show_free(); + sLog_init(); + list_init(); + list_clear(); + sLog_addRow(sLog_body, "green", "installed Extensions: "+ext.installed_extensions.length, "ok"); + + /*build_list*/ + i=0; + ext.installed_extensions.sortBy(function(e){return e.get('tag')}).each(function(e){ + res=loadSyncURL("/y/cgi?execute=if-file-exists:/var/tuxbox/config/ext/"+e.get('tag')+"_uninstall.inc~1~0"); + uninstall_list_addRow(update_body,++i,e,res=="1"); + }); + $('statusline').hide(); +} + diff --git a/src/nhttpd/web/Y_Ext_Update.yhtm b/src/nhttpd/web/Y_Ext_Update.yhtm index 1832d3a21..6bdb61b61 100644 --- a/src/nhttpd/web/Y_Ext_Update.yhtm +++ b/src/nhttpd/web/Y_Ext_Update.yhtm @@ -1,208 +1,57 @@ {=include-block:Y_Blocks.txt;management_check_top=} {=include-block:Y_Blocks.txt;head=} +<script type="text/javascript" src="/prototype.js"></script> <script type="text/javascript" src="/Y_Baselib.js"></script> -<script type="text/javascript"> -//<![CDATA[ -function do_submit() -{ - show_waitbox(true); - document.f.submit(); -} -/*sLog*/ -var sLog_body; -var sLog_line_number; -function sLog_init() -{ - sLog_line_number = 0; - sLog_body=document.getElementById("slog_list"); -} -function sLog_clear() -{ - while(sLog_body.childNodes.length > 0) - { - aChild=sLog_body.firstChild; - sLog_body.removeChild(aChild); - } - sLog_line_number = 0; -} -function sLog_addRow(_body, state, action_text, state_text) -{ - sLog_line_number++; - var mycurrent_row = y_add_row_to_table(_body, ((sLog_line_number % 2) ==0)?"a":"b" ); - var __img ="/images/ok.gif"; - switch (state) - { - case "green": __img = "/images/check_green.gif"; break; - case "yellow": __img = "/images/excl_yellow.gif"; break; - case "ok": __img = "/images/ok.gif"; break; - case "red": __img = "/images/x_red.gif"; break; - } - y_add_html_cell_to_row(mycurrent_row, "icon", "<img src='"+__img+"'>"); - y_add_html_cell_to_row(mycurrent_row, "action_text", action_text); - y_add_text_cell_to_row(mycurrent_row, "state_text", state_text); -} -/*update_list*/ -var update_body; -var upd_extentions = new Array(); /*<upd_site>,<type=n|m>,<link text>,<link helptext>,<url>,<unique tag>,<version>,<url of installer>*/ -var installed_extentions = new Array(); /*<type=n|m>,<link text>,<link helptext>,<url>,<unique tag>,<version>*/ -var update_sites = new Array(); /*<type=u>,<update site name>,<update site helptext>,<url of extention list>*/ -function update_list_init() -{ - update_body=document.getElementById("update_list"); -} -function update_list_clear() -{ - while(update_body.childNodes.length > 0){ - aChild=update_body.firstChild; - update_body.removeChild(aChild); - } -} -function update_list_addRow(_body, i, site, extention, tag, your_version, update_version) -{ - var mycurrent_row = y_add_row_to_table(_body, ((i % 2) ==0)?"a":"b" ); - y_add_html_cell_to_row(mycurrent_row, "setupdate", '<input type="checkbox" name="setupdate">'); - y_add_text_cell_to_row(mycurrent_row, "site", site); - y_add_text_cell_to_row(mycurrent_row, "extention", extention); - y_add_text_cell_to_row(mycurrent_row, "tag", tag); - y_add_text_cell_to_row(mycurrent_row, "your_version", your_version); - y_add_html_cell_to_row(mycurrent_row, "update_version", update_version); -} -function build_list() -{ - show_waitbox(true); - window.setTimeout("build_list2()",300); -} -function build_list2() -{ - sLog_init(); - update_list_init(); - update_list_clear(); - /*get installed ext and update sites*/ - var extlist = loadSyncURL("/control/exec?Y_Tools&get_extention_list&" + Math.random()); - var list = extlist.split("\n"); - installed_extentions = new Array(); - update_sites = new Array(); - for(i=0;i<list.length;i++){ - var ext_type = list[i].charAt(0); - if(ext_type=="n" || ext_type=="m"){ - var pieces=list[i].split(","); - installed_extentions.push(pieces); - } else if(ext_type == "u"){ - var pieces=list[i].split(","); - update_sites.push(pieces); - } - } - sLog_addRow(sLog_body, "green", "installed Extentions: "+installed_extentions.length, "ok"); - /* get updatesite ext*/ - upd_extentions = new Array(); - for(i=0;i<update_sites.length;i++){ - var update_file = loadSyncURL("/control/exec?Y_Tools&url_get&"+update_sites[i][3]+"&ext_upt.txt&" + Math.random()); - //TODO: error checking - sLog_addRow(sLog_body, "green", "get list from: "+update_sites[i][3], "ok"); - var list = update_file.split("\n"); - for(j=0;j<list.length;j++){ - var ext_type = list[j].charAt(0); - if(ext_type=="n" || ext_type=="m"){ - var pieces=list[j].split(","); - pieces.unshift(update_sites[i][1]); - upd_extentions.push(pieces); - } - } - } - /*build_list*/ - for(i=0;i<upd_extentions.length;i++){ - var your_version="%"; - for(j=0;j<installed_extentions.length;j++) - if(installed_extentions[j][4]==upd_extentions[i][5]) - your_version = installed_extentions[j][5]; - update_list_addRow(update_body,i,upd_extentions[i][0],upd_extentions[i][2],upd_extentions[i][5],your_version,upd_extentions[i][6]); - } - show_waitbox(false); -} -function do_set_updates() -{ - show_waitbox(true); - window.setTimeout("do_set_updates2()",300); -} -function do_set_updates2() -{ - var _rows = update_body.getElementsByTagName("tr"); - for(var i=0; i< _rows.length; i++){ - var rowNode = _rows.item(i); - if(rowNode.firstChild.firstChild.checked == true){ - var res = loadSyncURL("/control/exec?Y_Tools&ext_installer&"+upd_extentions[i][7]); - if(res.search(/error/)!=-1){ - alert(res); - sLog_addRow(sLog_body, "red", "update error: "+res, "error"); - } - else{ - sLog_addRow(sLog_body, "green", "installed/updates: "+upd_extentions[i][2], "ok"); - add_item_to_ext_list(i); - } - } - } - sLog_addRow(sLog_body, "green", "updating local extention list. Starting ...", "ok"); - var ext=write_extentions(); - document.f.extentions.value=ext; - show_waitbox(false); - alert("update fertig. Menue neuladen.") - do_submit(); -} -function write_extentions() -{ - var ext=""; - for(i=0;i<installed_extentions.length;i++) - ext += installed_extentions[i]+"\n"; - for(i=0;i<update_sites.length;i++) - ext += update_sites[i]+"\n"; - return ext; -} -function add_item_to_ext_list(upd_index) -{ - /*allready installed*/ - var allready_installed = false; - for(i=0;i<installed_extentions.length;i++){ - if(installed_extentions[i][4]==upd_extentions[upd_index][5]){ - allready_installed = true; - for(j=0;j<=5;j++) - installed_extentions[i][j] = upd_extentions[upd_index][j+1]; - } - } - if(!allready_installed){ - upd_extentions[upd_index].shift();//delete site name - upd_extentions[upd_index].pop();//delete url - var new_ext = upd_extentions[upd_index]; - installed_extentions.push(new_ext); - } -} -//]]> -</script> +<script type="text/javascript" src="/Y_yweb.js"></script> +<script type="text/javascript" src="/Y_Ext_Update.js"></script> </head> <body> -{=var-set:wait_text=Values are updated.=}{=include-block:Y_Blocks.txt;snip_wait=} +{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Extentions#Update=}{=var-set:menu=Extentions Updater/Installer=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> - <div class="work_box_body" width="100%s"> + {=var-set:help_url=Help-Extensions-Update=}{=var-set:menu={=L:ext.installer_updater=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + <div class="work_box_body" width="100%"> + <div id="statusline"><img border="0" src="/images/wait.gif" width="20" height="20" alt="wait"/> + <span id="status">Search for Updates ...</span></div> + <form method="post" name="update" action=""> - <input type="button" value="build list" title="build list" onclick="build_list()"/> +<!-- <input type="button" value="build list" title="build list" onclick="build_list()"/>--> <br/> - <b>update Preview List</b> - <table class="y_work_table" cellpadding="2"> + <div class="y_form_header_oline">update Preview List</div> + <table class="lt_table" cellspacing="0" cellpadding="2"> <thead align="left"> - <tr> + <tr valign="bottom"> <th>&nbsp;</th> - <th>Site</th><th>Extention</th> - <th>Tag</th><th>your Version</th><th>Update Version</th> + <th>Site</th><th>Type</th><th>Extension</th> + <th>Tag</th><th>your<br/>Version</th><th>Update<br/>Version</th> + <th title="minimal yWeb version">yWeb</th><th>Size/k</th><th>Info</th> </tr> </thead> <tbody id="update_list"> <tr><td></td></tr> </tbody> </table> - <input type="button" value="update/install" title="" name="set_updates" onclick="do_set_updates()"/>&nbsp; - </form> - <br/>New extention settings (preview)<br/> + <button type="button" ytype="go" title="" name="set_updates" onclick="do_set_updates()">update/install</button>&nbsp; + </form> + <br/> + <div id="free">?</div> + Free:&nbsp;<span id="avaiable">?</span>k + <form method="post" name="log" action=""> + <div class="y_form_header_oline">Log</div> + <table class="lt_table" cellspacing="0" cellpadding="4"> + <thead align="left"> + <tr> + <th>&nbsp;</th><th>Action</th><th>Status</th> + </tr> + </thead> + <tbody id="slog_list"> + <tr><td></td></tr> + </tbody> + </table> + <br/> + </form> + <br/> + <div class="y_form_header">New extension settings (preview)</div> <form name="f" accept-charset="UTF-8" action="/y/cgi"> <table border="0" class="y_form_table" cellspacing="0" cellpadding="0"> <tr> @@ -212,24 +61,15 @@ function add_item_to_ext_list(upd_index) <br/> <input type="hidden" name="tmpl" value="Y_Ext_Update_refresh.yhtm"/> <input type="hidden" name="execute" value="include-block:Y_Blocks.txt;ext_save_settings;nix"/> - </form> - <br/> - <form method="post" name="log" action=""> - <b>Log</b><br/> - <table class="y_work_table" cellpadding="4"> - <thead align="left"> - <tr> - <th>&nbsp;</th><th>Aktion</th><th>Status</th> - </tr> - </thead> - <tbody id="slog_list"> - <tr><td></td></tr> - </tbody> - </table> - <br/> - </form> + </form> </div> </div> +<script type="text/javascript"> +//<![CDATA[ + window.setTimeout("build_list();",500); + yversion_str="{=ini-get:Y_Version.txt;version=}"; +//]]> +</script> </body> </html> {=include-block:Y_Blocks.txt;management_check_bottom=} diff --git a/src/nhttpd/web/Y_Ext_Update_refresh.yhtm b/src/nhttpd/web/Y_Ext_Update_refresh.yhtm index bd71d09f1..ec5f2e528 100644 --- a/src/nhttpd/web/Y_Ext_Update_refresh.yhtm +++ b/src/nhttpd/web/Y_Ext_Update_refresh.yhtm @@ -1,21 +1,25 @@ {=include-block:Y_Blocks.txt;head=} +<script type="text/javascript" src="/prototype.js"></script> <script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript" src="/Y_yweb.js"></script> <script type="text/javascript"> //<![CDATA[ function do_onload() { + yhttpd_cache_clear(''); + ext.read_items(); parent.sec_menu.location.reload(); } //]]> </script> </head> <body onload="do_onload()"> -{=var-set:wait_text=Values are updated.=}{=include-block:Y_Blocks.txt;snip_wait=} +{=var-set:wait_text={=L:refreshing=}=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Extentions#Update=}{=var-set:menu=Extentions Settings saved=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Extensions-Update=}{=var-set:menu=Extensions Settings saved=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body" width="100%s"> - Settings stored. Menu is updated. + Settings saved. Refreshing Menue now. </div> </div> </body> diff --git a/src/nhttpd/web/Y_Flash.js b/src/nhttpd/web/Y_Flash.js new file mode 100644 index 000000000..467c25eae --- /dev/null +++ b/src/nhttpd/web/Y_Flash.js @@ -0,0 +1,117 @@ +/* yWeb Flash by yjogol + $Date: 2008/02/24 08:23:12 $ + $Revision: 1.3 $ +*/ +function do_image_upload_dialog() +{ + var nr=obj_get_radio_value('R1'); + nr = (nr=="")?0:nr; + document.f.mtd_text.value = document.f.elements[nr].title; + document.f.mtd.value = nr; + document.f.execute.value = "script:Y_Tools image_flash_free_tmp"; + document.f.tmpl.value = "Y_Tools_Flash_Upload.yhtm"; + document.f.submit(); +} +function do_image_download() +{ + show_waitbox(true); + $('f').disable(); + window.setTimeout("do_image_download_2()",100); + /*setTimeout:refresh output*/ +} +function do_image_download_2() +{ + var nr=obj_get_radio_value('R1'); + nr = (nr=="")?0:nr; + var res = loadSyncURL("/control/exec?Y_Tools&image_backup&"+nr); + $('download_link').href = res; + $('f').enable(); + show_waitbox(false); + $('download_box').show(); +} +function goConfirmUrl(_meld, _url) +{ + if (confirm(_meld)==true) + loadSyncURL(_url); +} +function image_delete() +{ + var res = loadSyncURL("/control/exec?Y_Tools&image_delete"); + $('download_box').hide(); +} +/*flashing*/ +var aktiv; +var flashing = false; +var flash_diag = null; +function show_progress(_msg,_type,_proz) +{ + var __msg = $("msg"); + __msg.value = _msg; + var tmsg=""; + if(_type == 1){ + tmsg="erasing"; + $("erasing_left").width = _proz; + } + else if(_type == 2){ + tmsg="writing"; + $("erasing_left").width = "100%"; + $("writing_left").width = _proz;; + } + else if(_type == 3){ + tmsg="verifying"; + $("writing_left").width = "100%"; + $("verifying_left").width = _proz;; + } + loadSyncURL("/control/lcd?lock=1&clear=1&xpos=10&ypos=27&size=20&font=2&text=yWeb%20flashing%0A"+tmsg+"%20"+encodeURI(_proz)+"&update=1"); +} +/* load fcp status from /tmp/e.txt*/ +function progress_onComplete(_req) +{ + var last = _req.responseText.lastIndexOf("\r"); + var last_line = _req.responseText.slice(last+1, _req.responseText.length); + var _type = 0; + if(last_line.search(/Erasing/)!=-1) + _type = 1; + if(last_line.search(/Writing/)!=-1) + _type = 2; + if(last_line.search(/Verifying/)!=-1) + _type = 3; + var Ausdruck = /\((.*)\)/; + var e=Ausdruck.exec(last_line); + var p = RegExp.$1; + show_progress(last_line, _type, p); +} +function progress_get() +{ + var myAjax = new Ajax.Request( + "/tmp/e.txt", + { + method: 'post', + onComplete: progress_onComplete + }); +} +function do_submit() +{ + var msg = "Image flashen?"; + if(document.f.demo.checked) + msg = "DEMO: "+msg; + if(confirm(msg)==true){ + show_waitbox(true); + document.f.submit(); + $('f').disable(); + } +} + +function do_image_upload_ready_error() +{ + $('f').enable(); + show_waitbox(false); +} +function do_image_flash_ready() +{ + window.clearInterval(aktiv); + $('flash_diag').hide(); + loadSyncURL("/control/lcd?lock=0"); + alert("Image geflasht. Nach Reboot OK druecken"); + top.location.href="/"; +} diff --git a/src/nhttpd/web/Y_Info_Help.yhtm b/src/nhttpd/web/Y_Info_Help.yhtm index fc3462ca6..e8be8d2dc 100644 --- a/src/nhttpd/web/Y_Info_Help.yhtm +++ b/src/nhttpd/web/Y_Info_Help.yhtm @@ -4,15 +4,17 @@ <body> <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Info#Hilfe=}{=var-set:menu=Help=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Info-Hilfe=}{=var-set:menu={=L:help=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <ul> - <li><a href="http://wiki.godofgta.de/Neutrino:yWeb" title="yWeb Help from Tuxbox Wiki" target="_blank">Tuxbox-Wiki Help</a></li> - <li><a href="http://www.yjogol.de/yFAQ.htm" title="FAQ at yjogol.de" target="_blank">FAQ zu yWeb</a></li> - <li><a href="http://forum.tuxbox.org" title="Tuxbox Dicussion Forum" target="_blank">Tuxbox Forum</a></li> - <li><a href="http://www.yjogol.de" title="Homepage of yWeb" target="_blank">Homepage yWeb</a></li> + <li><a href="http://www.yjogol.com/faq" class="exlink" title="FAQ at yjogol.com" target="_blank">FAQ zu yWeb</a></li> + <li><a href="http://wiki.dbox2-tuning.net/Neutrino:yWeb" class="exlink" title="yWeb Help from Tuxbox Wiki" target="_blank">Tuxbox-Wiki Help</a></li> + <li><a href="http://forum.tuxbox.org" class="exlink" title="Tuxbox Dicussion Forum" target="_blank">Tuxbox Forum</a></li> + <li><a href="http://www.yjogol.com" class="exlink" title="Homepage of yWeb" target="_blank">Homepage yWeb</a></li> </ul> </div> </div> + +{=include-block:Y_neutrino_Blocks.txt;neutrino_form_helpbox=} </body> </html> diff --git a/src/nhttpd/web/Y_Info_Menue.yhtm b/src/nhttpd/web/Y_Info_Menue.yhtm index f16744315..b1422bd7e 100644 --- a/src/nhttpd/web/Y_Info_Menue.yhtm +++ b/src/nhttpd/web/Y_Info_Menue.yhtm @@ -1,19 +1,36 @@ {=var-set:cancache=yPConf=} {=include-block:Y_Blocks.txt;head=} +<script type="text/javascript" src="/prototype.js"></script> +<script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript" src="/Y_yweb.js"></script> +<script type="text/javascript"> +function init(){ + var menu=ext.select_menu('info'); + menu.each(function(e){ + var el=new Element('li').update( + new Element('a', {'target':'work', + 'title': e.get('desc'), + 'href': e.get('file') + }).update("-"+e.get('menuitem')) + ); + $('secmenu').insert({'bottom':el}); + }); +} +</script> </head> {=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} -<body> +<body onload="init()"> <div class="y_menu_sec_box"> <div class="y_menu_sec_box_head"><h2>Info</h2></div> <div class="y_menu_sec_box_body"> <div class="y_menu_sec"> - <ul id="menu_sec"> - <li><a target="work" title="About yWeb" href="Y_About.yhtm">About</a></li> - <li><a target="work" title="Getting Help" href="Y_Info_Help.yhtm">Help</a></li> + <ul id="secmenu"> + <li><a target="work" title="About yWeb" href="Y_About.yhtm">{=L:About=}</a></li> + <li><a target="work" title="Getting Help" href="Y_Info_Help.yhtm">{=L:help=}</a></li> {=if-empty:{=var-get:management=}~ - <li class="disabled" title="Check for Update of yWeb (restricted by ManagementIP)">Auf Updates pr&uuml;fen</li> + <li class="disabled" title="Check for Update of yWeb (restricted by ManagementIP)">{=L:check_for_updates=}</li> ~ -<!--dbox2 only <li><a target="work" title="Check for Updates of yWeb" href="Y_Info_Updates.yhtm">Auf Updates pr&uuml;fen</a></li> dbox2 only--> + <li><a target="work" title="Check for Updates of yWeb" href="Y_Info_Updates.yhtm">{=L:check_for_updates=}</a></li> =} </ul> </div> diff --git a/src/nhttpd/web/Y_Info_Updates.yhtm b/src/nhttpd/web/Y_Info_Updates.yhtm index be149bfc4..cc94867ca 100644 --- a/src/nhttpd/web/Y_Info_Updates.yhtm +++ b/src/nhttpd/web/Y_Info_Updates.yhtm @@ -13,12 +13,12 @@ function check_updates() <body> <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Info#Auf_Updates_pr.C3.BCfen=}{=var-set:menu=Auf Updates pr&uuml;fen=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Info-Auf_Updates_pruefen=}{=var-set:menu={=L:check_for_updates=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <table border="0" cellpadding="2" cellspacing="4"> <tr> <td valign="top"> - <b>Deine Version</b> + <b>{=L:your_version=}</b> <p> {=ini-get:Y_Version.txt;version=}<br/> {=ini-get:Y_Version.txt;date=}<br/> @@ -27,14 +27,14 @@ function check_updates() </p> </td> <td valign="top"> - <b>Neue Version</b> + <b>{=L:actual_version=}</b> <p> {=ini-get:/tmp/version.txt;version=}<br/> {=ini-get:/tmp/version.txt;date=}<br/> {=ini-get:/tmp/version.txt;type=}<br/><br/> {=ini-get:/tmp/version.txt;info=}<br/> {=if-empty:{=ini-get:/tmp/version.txt;url=}~~ - <a href="{=ini-get:/tmp/version.txt;url=}" target="_blank">Download</a><br/> + <a href="{=ini-get:/tmp/version.txt;url=}" target="_blank">{=L:download=}</a><br/> =} </p> </td> diff --git a/src/nhttpd/web/Y_Live.js b/src/nhttpd/web/Y_Live.js new file mode 100644 index 000000000..c1a2bee7b --- /dev/null +++ b/src/nhttpd/web/Y_Live.js @@ -0,0 +1,337 @@ +/* yWeb Live by yjogol + $Date: 2008/11/13 16:45:38 $ + $Revision: 1.3 $ +*/ +/*globals*/ +var V2 = null; +var isUDP = false; +var IsTimeshift = true; //TEST +var IsLocked = false; +var IsMute = false; +var vlc_width = 384; +var vlc_height = 288; +var Window_delta_w = 0; +var Window_delta_h = 0; +var Mode = "tv"; +var AudioChannel = 0; +var isSubs=false; +var g_intervall=null; +/*resize,init*/ +function do_onload(){ + if(Mode != "tv" && Mode != "radio") + Mode = "tv"; + set_controls("disable"); + if(isUDP && Mode == "tv") + change_button_img('udp',"udp_switch_off"); + else if(Mode == "tv") + change_button_img('udp',"udp_switch_on"); + window.setTimeout("do_init()",300); +} +function do_onresize(){ + if((vlc_width+Window_delta_w != window.innerWidth) || (vlc_height+Window_delta_h != window.innerHeight)){ + window.onresize=null; + do_resize_vlc(yClientWidth()-Window_delta_w,yClientHeight()-Window_delta_h); + window.onresize=do_onresize; + } +} +function do_resize_vlc(width, height){ + vlc_width = width; + vlc_height = height; + V2.set_resolution(width, height); +} +function do_resize(){ + var dd = id('resolution'); + var sel = dd.selectedIndex; + var w = -1; + var h = -1; + if(sel != -1){ + switch(sel.toString()) { + case "0": w=384; h=288; break; + case "1": w=768; h=576; break; + case "2": w=960; h=720; break; + case "3": w=1152; h=864; break; + } + } + if(w != -1) + window.resizeTo(w+Window_delta_w, h+Window_delta_h); +} +function do_init(){ + live_switchto(Mode); + vlc_width = 384; + vlc_height = 288; + Window_delta_w = yClientWidth() - vlc_width; + Window_delta_h = yClientHeight() - vlc_height; + + if(Mode == "tv") + window.onresize=do_onresize; + insert_vlc_control(); + build_bouquet_list(-1); + set_controls("play"); +// do_play(); + change_channel_play(); +// g_intervall = window.setInterval('i_interval()', 20000); +} +function i_interval(){ + obj_update('bouquets_div', "<img src=\"/images/smallwait.gif\"/> getting bouquets ..."); + window.setTimeout("i_interval2()",300); +} +function i_interval2(){ + build_bouquet_list(-1); +} +function always_on_top() { window.focus(); + window.setTimeout("always_on_top()",100); +} +function insert_vlc_control(){ + if(Mode == "radio") { + var radio_html="<div style=\"width:"+vlc_width+"px;height:"+vlc_height+"px;text-align:center;\">" + +"<br/><br/><br/><br/><br/><br/><div id=\"vlc_radio\"></div><br/><h1>Radio</h1></div>"; + obj_update('vlc_view',radio_html); + V2 = new CyVLC('vlc', 'vlc_radio', 1, 1); + } else + V2 = new CyVLC('vlc', 'vlc_view', vlc_width, vlc_height); +} +function insert_message_control(msg){ + var wait_html="<div style=\"width:"+vlc_width+"px;height:"+vlc_height+"px;text-align:center;\">" + +"<br/><br/><br/><br/><br/><br/><img src=\"/images/wait.gif\"><br/>"+msg+"</div>"; + obj_update('vlc_view',wait_html); +} +function change_button_img(id,img){ + var imgstr = "<img src=\"/images/"+img+".png\" width=\"16\" height=\"16\">"; + obj_update(id, imgstr); +} +/*controls*/ +function set_controls(state){ + var go=false; + var play=false; + var opt=false; + if(V2 && V2.have_options()) + opt=true; + var plugin=""; + if(V2) plugin=V2.plugin; + + switch(state){ + case "disable": + go=false; + play=false; + break; + case "play": + go=true; + play=true; + break; + case "stop": + go=true; + play=false; + break; + } + obj_enable('go', go); + obj_enable('epg', go); + obj_enable('PlayOrPause', go); + obj_enable('stop', go); + obj_enable('mute', play); + obj_enable('volumeup', play); + obj_enable('volumedown', play); + obj_enable('livelock', go); + if(LiveTyp!="popup"){ + show_obj('rec',opt); + obj_enable('rec', play && opt); + show_obj('transcode',opt); + obj_enable('transcode', play && opt); + } + if(Mode == "tv"){ + show_obj('udp',haveUDP); + obj_enable('udp', go); + obj_enable('fullscreen', play); + show_obj('snapshot',(plugin != "moz3")); + obj_enable('snapshot', play && (plugin != "moz3")); + } +} +/*vlc control*/ +function do_play(){ + var options = new Array(); + if(Mode == "tv"){ + if(isDeinterlace){ + options.push(":vout-filter=deinterlace"); + options.push(":deinterlace-mode=bob"); + } + if(isUDP && Mode == "tv"){ + options.push(":access-filter=timeshift"); + } + else + if(cachetime > 0) + options.push(":http-caching="+cachetime); + if(AudioChannel != 0) + options.push(":audio-track="+AudioChannel); + } + do_play_state(0, options); +} +function start_udp_server(){ + var pids = loadSyncURL("/control/yweb?video_stream_pids=0&no_commas=true"); + var args = ClientAddr+" 31330 0 "+pids; + var _cmd = "udp_stream start "+args; + var __cmd = _cmd.replace(/ /g, "&"); + loadXMLDoc("/control/exec?Y_Live&"+__cmd, dummy); +} +function do_stop(){ + V2.stop(); + while(V2.is_playing()) + ; + change_button_img('PlayOrPause',"play"); + set_controls("stop"); +} +function dummy() +{ +} +// VCL does not work with prototype.js! +function do_play_bystring(_str){ + do_play_state(1,[_str]); +} +function do_play_state(_state, _options){ + change_button_img('PlayOrPause',"pause"); + _options.push(":input-repeat=1"); + V2.options = _options; + var mrl = ""; + if(Mode == "tv" && isUDP) + mrl = "udp://@:31330"; + else + mrl = loadSyncURL("/control/build_live_url"); + V2.set_actual_mrl(mrl); + V2.play(); + V2.next(); + set_controls("play"); + if(Mode == "tv" && isUDP) + window.setTimeout("start_udp_server()",1000); +} +function do_play_or_pause(){ + if(V2.is_playing()) { + change_button_img('PlayOrPause',"play"); + V2.pause() + set_controls("stop"); + } else { + change_button_img('PlayOrPause',"pause"); + V2.play(); + set_controls("play"); + if(isUDP) + window.setTimeout("start_udp_server()",1000); + } +} +/* bouquet & channel panel */ +function build_channel_list(bouquet, channel){ + set_controls("disable"); + var used_channel = channel; + if(used_channel == -1) + used_channel = loadSyncURL("/y/cgi?execute=func:get_actual_channel_id"); + var channel_dropdown_url = "/y/cgi?execute=func:get_channels_as_dropdown%20" + bouquet; + channel_dropdown_url += "%20" + used_channel; + var channel_dropdown = "<select size=\"1\" class=\"y_live_channels\" id=\"channels\" title=\"select channel - use go to zap\">"; + channel_dropdown += loadSyncURL(channel_dropdown_url); + channel_dropdown += "</select>"; + obj_update('channels_div', channel_dropdown); + set_controls("play"); +} +function change_bouquet(){ + var dd = id('bouquets'); + var bouquet = -1; + var channel = -1; + var sel = dd.selectedIndex; + if(sel != -1){ + bouquet = dd[sel].value; + channel = 0; + } + obj_update('channels_div', "<img src=\"/images/smallwait.gif\"/> getting channels ..."); + window.setTimeout("build_channel_list("+bouquet+", "+channel+")",2000); +} +function change_channel(){ + isSubs=false; + var dd = id('channels'); + var channel = -1; + var sel = dd.selectedIndex; + if(sel != -1) + channel = dd[sel].value; + do_stop(); + AudioChannel = 0; + window.setTimeout("change_channel_zapto(\""+channel+"\")",500); +} +function change_sub_channel(){ + var dd = id('subs'); + var channel = -1; + var sel = dd.selectedIndex; + if(sel != -1) + channel = dd[sel].value; + do_stop(); + AudioChannel = 0; + window.setTimeout("change_channel_zapto(\""+channel+"\")",500); +} +function change_channel_zapto(channel){ + dbox_zapto(channel); + window.setTimeout("change_channel_play()",500); +} +function build_subchannels(){ + var subs = loadSyncURL("/control/zapto?getallsubchannels"); + if (subs != "") { + var optlist=""; + var list = subs.split("\n"); + for(i=0;i<list.length;i++){ + var sc=split_one(list[i], " "); + optlist+="<option value=\""+sc[0]+"\">"+sc[1]+"</option>\n"; + } + optlist="<select id='subs' class='y_live_channels'>"+optlist+"</select>" + id('subs_div').innerHTML = optlist; + display_obj("subsRow", true); + isSubs=true; + } + else + display_obj("subsRow", false); +} +function change_channel_play(){ + do_play(); + if (V2.have_options() && Mode == "tv") { + build_audio_pid_list(); + if(!isSubs) + build_subchannels(); + } +} +/*other buttons*/ +function do_show_version(){ + alert("Version:"+V2.version_string+" Generation:"+V2.plugin+"\nlevel1:"+V2.version_level1+" 2:"+V2.version_level2 + +" 3:"+V2.version_level3+" 4:"+V2.version_level4); +} +function do_lock_toggle(){ + if( !IsLocked ) { + change_button_img('livelock',"liveunlock"); + IsLocked = true; + live_lock(); + } else { + change_button_img('livelock',"livelock"); + IsLocked = false; + live_unlock(); + } +} +function do_mute_toggle(){ + change_button_img('mute', (IsMute)?"volumemute":"volumeunmute"); + IsMute = !IsMute; + V2.toggle_mute(); +} +function do_udp_toggle(){ + change_button_img('udp', (isUDP)?"udp_switch_on":"udp_switch_off"); + isUDP = !isUDP; + do_stop(); + do_play(); +} +function view_streaminfo(){ + window.open("/fb/info.dbox2","streaminfo","width=400,height=400"); +} +function doChangeAudioPid(){ + var dd = id('audiopid'); + AudioChannel = dd.selectedIndex; + do_stop(); +// insert_message_control("... zapping ..."); + window.setTimeout("change_channel_play()",1000); +} +function build_audio_pid_list(){ + var audio_pids_url = "/y/cgi?execute=func:get_audio_pids_as_dropdown"; + var audio_pid_list = loadSyncURL(audio_pids_url); + audio_pid_list = "<select size=\"1\" class=\"y_live_audio_pids\" id=\"audiopid\" onChange=\"doChangeAudioPid()\">" + + audio_pid_list + + "</select>"; + obj_update('audio_pid_list', audio_pid_list); +} diff --git a/src/nhttpd/web/Y_Live.yhtm b/src/nhttpd/web/Y_Live.yhtm index c3a5bfffb..6dea88bac 100644 --- a/src/nhttpd/web/Y_Live.yhtm +++ b/src/nhttpd/web/Y_Live.yhtm @@ -1,345 +1,23 @@ {=var-set:must_management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} {=include-block:Y_Blocks.txt;head_no_charset=} -<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> +<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/> <script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript" src="/Y_VLC.js"></script> +<script type="text/javascript" src="/Y_Live.js"></script> <script type="text/javascript"> //<![CDATA[ - -/*globals*/ -{=var-set:udp={=if-file-exists:/sbin/udpstreamts~true~{=if-file-exists:/var/bin/udpstreamts~true~false=}=}=} -var V2 = null; -var IsUDP = false; -var IsTimeshift = true; //TEST -var IsLocked = false; -var IsMute = false; -var vlc_width = 384; -var vlc_height = 288; -var Window_delta_w = 0; -var Window_delta_h = 0; -var Mode = "tv"; -var AudioChannel = 0; - -/*resize,init*/ -function do_onresize() -{ - if((vlc_width+Window_delta_w != window.innerWidth) || (vlc_height+Window_delta_h != window.innerHeight)){ - window.onresize=null; - do_resize_vlc(yClientWidth()-Window_delta_w,yClientHeight()-Window_delta_h); - window.onresize=do_onresize; - } -} -function do_resize_vlc(width, height) -{ - vlc_width = width; - vlc_height = height; - V2.set_resolution(width, height); -} -function do_resize() -{ - var dd = id('resolution'); - var sel = dd.selectedIndex; - var w = -1; - var h = -1; - if(sel != -1){ - switch(sel.toString()) { - case "0": w=384; h=288; break; - case "1": w=768; h=576; break; - case "2": w=960; h=720; break; - case "3": w=1152; h=864; break; - } - } - if(w != -1) - window.resizeTo(w+Window_delta_w, h+Window_delta_h); -} -function do_init() -{ - live_switchto(Mode); - vlc_width = 384; - vlc_height = 288; - Window_delta_w = yClientWidth() - vlc_width; - Window_delta_h = yClientHeight() - vlc_height; - - if(Mode == "tv") - window.onresize=do_onresize; - insert_vlc_control(); - build_bouquet_list(-1); - set_controls("play"); - do_play(); -} -function always_on_top() { - window.focus(); - window.setTimeout("always_on_top()",100); -} -function do_onload() -{ - Mode = "{=mode=}"; - if(Mode != "tv" && Mode != "radio") - Mode = "tv"; - set_controls("disable"); - if("{=ini-get:/var/tuxbox/config/Y-Web.conf;udp;false=}" == "true" && Mode == "tv") - id('udp').checked = true; - else if(Mode == "tv") - id('udp').checked = false; -/*TODO - {=if-equal:{=typ=}~popup~ - if(is_ie) - window.onblur = self.focus(); - else - always_on_top(); - =} -*/ - window.setTimeout("do_init()",300); -} -/*controls*/ -function set_controls(state) -{ - var go=false; - var play=false; - var opt=false; - if(V2 && V2.have_options()) - opt=true; - var plugin=""; - if(V2) plugin=V2.plugin; - - switch(state){ - case "disable": - go=false; - play=false; - break; - case "play": - go=true; - play=true; - break; - case "stop": - go=true; - play=false; - break; - } - obj_enable('go', go); - obj_enable('epg', go); - obj_enable('PlayOrPause', go); - obj_enable('stop', go); - obj_enable('mute', play); - obj_enable('volumeup', play); - obj_enable('volumedown', play); - obj_enable('livelock', go); - {=if-equal:{=typ=}~popup~~ - show_obj('rec',opt); - obj_enable('rec', play && opt); - show_obj('transcode',opt); - obj_enable('transcode', play && opt); - =} - if(Mode == "tv"){ - show_obj('have_udp',{=var-get:udp=}); - obj_enable('udp', go); - obj_enable('fullscreen', play); - show_obj('snapshot',(plugin != "moz3")); - obj_enable('snapshot', play && (plugin != "moz3")); - } - -} -function insert_vlc_control() -{ - if(Mode == "radio") { - var radio_html="<div style=\"width:"+vlc_width+"px;height:"+vlc_height+"px;text-align:center;\">" - +"<br/><br/><br/><br/><br/><br/><div id=\"vlc_radio\"></div><br/><h1>Radio</h1></div>"; - obj_update('vlc_view',radio_html); - V2 = new CyVLC('vlc', 'vlc_radio', 1, 1); - } else - V2 = new CyVLC('vlc', 'vlc_view', vlc_width, vlc_height); -} -function insert_message_control(msg) -{ - var wait_html="<div style=\"width:"+vlc_width+"px;height:"+vlc_height+"px;text-align:center;\">" - +"<br/><br/><br/><br/><br/><br/><img src=\"/images/wait.gif\"><br/>"+msg+"</div>"; - obj_update('vlc_view',wait_html); -} -function change_button_img(id,img) -{ - var imgstr = "<img src=\"/images/"+img+".png\" width=\"16\" height=\"16\">"; - obj_update(id, imgstr); -} -/*vlc control*/ -function do_stop() -{ - V2.stop(); - while(V2.is_playing()) - ; - change_button_img('PlayOrPause',"play"); - set_controls("stop"); -} -function dummy() -{ -} -function start_udp_server() -{ - var pids = loadSyncURL("/control/yweb?video_stream_pids=0&no_commas=true"); - var args = "{=func:get_request_data clientaddr=} 31330 0 "+pids; - var _cmd = "udp_stream start "+args; - var __cmd = _cmd.replace(/ /g, "&"); - loadXMLDoc("/control/exec?Y_Live&"+__cmd, dummy); -} -function do_play_state(_state, _options) -{ - change_button_img('PlayOrPause',"pause"); - _options.push(":input-repeat=1"); - V2.options = _options; - var mrl = ""; - if(Mode == "tv" && id('udp').checked) - mrl = "udp://@:31330"; - else - mrl = loadSyncURL("/control/build_live_url"); - V2.set_actual_mrl(mrl); - V2.play(); - V2.next(); - set_controls("play"); - if(id('udp').checked && Mode == "tv") - window.setTimeout("start_udp_server()",1000); -} -function do_play() -{ - var options = new Array(); - if(Mode == "tv"){ - {=if-equal:{=ini-get:/var/tuxbox/config/Y-Web.conf;deinterlace;true=}~true~ - options.push(":vout-filter=deinterlace"); - options.push(":deinterlace-mode=bob"); - =} - if(id('udp').checked && Mode == "tv"){ - options.push(":access-filter=timeshift"); - } - else{ - var cachetime = {=ini-get:/var/tuxbox/config/Y-Web.conf;http_caching;0=}; - if(cachetime > 0) - options.push(":http-caching="+cachetime); - } - if(AudioChannel != 0) - options.push(":audio-track="+AudioChannel); - } - do_play_state(0, options); -} -function do_play_or_pause() -{ - if(V2.is_playing()) { - change_button_img('PlayOrPause',"play"); - V2.pause() - set_controls("stop"); - } else { - change_button_img('PlayOrPause',"pause"); - V2.play(); - set_controls("play"); - if(id('udp').checked) - window.setTimeout("start_udp_server()",1000); - } -} -/* bouquet & channel panel */ -function build_channel_list(bouquet, channel) -{ - set_controls("disable"); - var used_channel = channel; - if(used_channel == -1) - used_channel = loadSyncURL("/y/cgi?execute=func:get_actual_channel_id"); - var channel_dropdown_url = "/y/cgi?execute=func:get_channels_as_dropdown%20" + bouquet; - channel_dropdown_url += "%20" + used_channel; - var channel_dropdown = "<select size=\"1\" class=\"y_live_channels\" id=\"channels\" title=\"select channel - use go to zap\">"; - channel_dropdown += loadSyncURL(channel_dropdown_url); - channel_dropdown += "</select>"; - obj_update('channels_div', channel_dropdown); - set_controls("play"); -} -function build_bouquet_list(bouquet) -{ +function build_bouquet_list(bouquet){ var used_bouquet = bouquet; if(used_bouquet == -1) used_bouquet = loadSyncURL("/y/cgi?execute=func:get_actual_bouquet_number"); var bouquet_dropdown_url = "/y/cgi?execute=func:get_bouquets_as_dropdown%20" + used_bouquet + "{=if-empty:{=var-get:must_management=}~~%20true=}"; var bouquet_dropdown = "<select size=\"1\" class=\"y_live_bouquets\" id=\"bouquets\" onchange=\"change_bouquet()\" title=\"select bouquet - channels will be updated\">"; bouquet_dropdown += loadSyncURL(bouquet_dropdown_url); - bouquet_dropdown += "</select>"; + bouquet_dropdown += "<\/select>"; obj_update('bouquets_div', bouquet_dropdown); build_channel_list(used_bouquet, -1); } -function change_bouquet() -{ - var dd = id('bouquets'); - var bouquet = -1; - var channel = -1; - var sel = dd.selectedIndex; - if(sel != -1){ - bouquet = dd[sel].value; - channel = 0; - } - build_channel_list(bouquet, channel); -} -function change_channel() -{ - var dd = id('channels'); - var channel = -1; - var sel = dd.selectedIndex; - if(sel != -1) - channel = dd[sel].value; - do_stop(); - AudioChannel = 0; - window.setTimeout("change_channel_zapto(\""+channel+"\")",500); -} -function change_channel_zapto(channel) -{ - dbox_zapto(channel); - window.setTimeout("change_channel_play()",500); -} -function change_channel_play() -{ - do_play(); - if(V2.have_options() && Mode == "tv") - build_audio_pid_list(); -} -/*other buttons*/ -function do_show_version() -{ - alert("Version:"+V2.version_string+" Generation:"+V2.plugin+"\nlevel1:"+V2.version_level1+" 2:"+V2.version_level2 - +" 3:"+V2.version_level3+" 4:"+V2.version_level4); -} -function do_lock_toggle() -{ - if( !IsLocked ) { - change_button_img('livelock',"liveunlock"); - IsLocked = true; - live_lock(); - } else { - change_button_img('livelock',"livelock"); - IsLocked = false; - live_unlock(); - } -} -function do_mute_toggle() -{ - change_button_img('mute', (IsMute)?"volumemute":"volumeunmute"); - IsMute = !IsMute; - V2.toggle_mute(); -} -function view_streaminfo() -{ - window.open("/fb/info.dbox2","streaminfo","width=400,height=400"); -} -function doChangeAudioPid() -{ - var dd = id('audiopid'); - AudioChannel = dd.selectedIndex; - do_stop(); -// insert_message_control("... zapping ..."); - window.setTimeout("change_channel_play()",1000); -} -function build_audio_pid_list() -{ - var audio_pids_url = "/y/cgi?execute=func:get_audio_pids_as_dropdown"; - var audio_pid_list = loadSyncURL(audio_pids_url); - audio_pid_list = "<select size=\"1\" class=\"y_live_audio_pids\" id=\"audiopid\" onChange=\"doChangeAudioPid()\">" - + audio_pid_list - + "</select>"; - obj_update('audio_pid_list', audio_pid_list); -} -function view_epg() -{ +function view_epg(){ var sel=document.x.channels.selectedIndex; if(sel != -1){ channel = document.x.channels[sel].value; @@ -351,34 +29,32 @@ function view_epg() =} } } -function view_expert_mode() -{ +function view_epg_reload(){ + build_bouquet_list(-1); +} +function view_expert_mode(){ parent.col2.location.href = "/Y_Live_Expert.yhtm?browser={=browser=}&mode={=mode=}&typ={=typ=}"; } -function view_record_mode() -{ +function view_record_mode(){ parent.col2.location.href = "/Y_Live_Record.yhtm?browser={=browser=}&mode={=mode=}&typ={=typ=}"; } -function view_settings_mode() -{ +function view_settings_mode(){ parent.col2.location.href = "/Y_Settings_Live.yhtm?browser={=browser=}&mode={=mode=}&typ={=typ=}"; } -function view_transcode_mode() -{ +function view_transcode_mode(){ parent.col2.location.href = "/Y_Live_Transcode.yhtm?browser={=browser=}&mode={=mode=}&typ=transcode"; } - //]]> </script> </head> -<body onload="do_onload()"> +<body> {=var-set:wait_text=Streaming-Informationen<br/>werden ermittelt.=}{=include-block:Y_Blocks.txt;snip_wait=} <div id="live_panel"> -<form name="x" action="" method="get"> +<form name="x" action="" method="get" style="margin:0;padding:0;"> <table class="y_live_table" cellspacing="0" cellpadding="0" style="margin:0"> <tr><td> <div id="bouquets_div"><div class="y_live_channels" style="border:1px solid #555555;"> - <img src="/images/smallwait.gif"> getting bouquets ...</div> + <img src="/images/smallwait.gif"/> getting bouquets ...</div> </div> </td><td> {=if-equal:{=typ=}~popup~ @@ -393,14 +69,27 @@ function view_transcode_mode() </td></tr> <tr><td> <div id="channels_div"><div class="y_live_bouquets" style="border:1px solid #555555;"> - <img src="/images/smallwait.gif"> getting channels ...</div> + <img src="/images/smallwait.gif"/> getting channels ...</div> </div> </td><td> <button id="go" class="y_live_button" type="button" title="change channel" onclick="change_channel()" disabled="disabled"> - <img src="/images/play.png"></button> + <img src="/images/play.png"/></button> <button id="epg" class="y_live_button" type="button" title="view epg for selected channel" onclick="view_epg()" disabled="disabled"> - <img src="/images/epg.png"></button> + <img src="/images/epg.png"/></button> + <button id="epg_reload" class="y_live_button" type="button" title="reload bouquets and channels" onclick="view_epg_reload()"> + <img src="/images/reload.gif"/></button> </td></tr> + <tr id="subsRow" style="display:none"> + <td> + <div id="subs_div"><div class="y_live_channels" style="border:1px solid #555555;"> + <img src="/images/smallwait.gif"/> getting subchannels ...</div> + </div> + </td><td> + <button class="y_live_button" type="button" title="change channel" onclick="change_sub_channel()"> + <img src="/images/play.png"/></button> + + </td> + </tr> </table> </form> </div> @@ -408,62 +97,59 @@ function view_transcode_mode() <div id="vlc_view"> </div> <div id="live_controls"> - <form name="v" action="" method="get"> - <button id="PlayOrPause" class="y_live_button" type="button" title="play or pause streaming" - onclick="do_play_or_pause()"><img src="/images/pause.png"></button> + <form name="v" action="" method="get" style="margin:0;padding:0;"> + <button id="PlayOrPause" class="y_live_button" type="button" title="play or pause streaming" + onclick="do_play_or_pause()"><img src="/images/pause.png"/></button> <button id="stop" type="button" title="stop streaming" onclick="do_stop()" class="y_live_button"> - <img src="/images/stop.png"></button> + <img src="/images/stop.png"/></button> <button id="mute" class="y_live_button" type="button" value="Mute" title="mute / unmute volume" onclick="do_mute_toggle()"> - <img src="/images/volumemute.png"></button> + <img src="/images/volumemute.png"/></button> <button id="volumedown" class="y_live_button" type="button" value="-" title="lower volume" onclick="V2.set_volume_delta(-10);"> - <img src="/images/volumedown.png"></button> + <img src="/images/volumedown.png"/></button> <button id="volumeup" class="y_live_button" type="button" value="+" title="higher volume" onclick="V2.set_volume_delta(+10);"> - <img src="/images/volumeup.png"></button> + <img src="/images/volumeup.png"/></button> {=if-equal:{=mode=}~tv~ - <button id="fullscreen" class="y_live_button" type="button" value="F" + <button id="fullscreen" class="y_live_button" type="button" value="F" title="switch to fullscreen-mode - or use double-click" onclick="V2.toggle_fullscreen()"> - <img src="/images/fullscreen.png"></button> + <img src="/images/fullscreen.png"/></button> =} <button id="livelock" class="y_live_button" type="button" value="Lock" title="lock / unlock TV (record mode, rc, lcd)" name="lock" onclick="do_lock_toggle()"> - <img src="/images/livelock.png"></button> -<!-- </form> -</div> -<div id="live_extended_controls"> - <form name="le" action="" method="get">--> + <img src="/images/livelock.png"/></button> + {=if-equal:{=mode=}~tv~ - <span id="have_udp" style="visibility:hidden"><input type="checkbox" id="udp" title="UDP Streaming"/>UDP</span> + <button class="y_live_button" style="visibility:hidden" type="button" value="set" title="UDP Streaming on/off" id="udp" onclick="do_udp_toggle()"> + <img src="/images/udp_switch_on.png"/></button> <button class="y_live_button" type="button" value="set" title="LiveView settings" id="settings" onclick="view_settings_mode()"> - <img src="/images/properties.gif"></button> + <img src="/images/properties.png"/></button> <button class="y_live_button" type="button" value="S" title="create snapshot picture" id="snapshot" onclick="V2.snapshot()" style="visibility:hidden"> - <img src="/images/snapshot.png"></button> + <img src="/images/snapshot.png"/></button> =} {=if-equal:{=typ=}~popup~~ {=if-equal:{=typ=}~transcode~~ <button id="rec" class="y_live_button" type="button" value="Rec" title="record mode" name="record_mode" onclick="view_record_mode()" style="visibility:hidden"> - <img src="/images/record.gif"></button> + <img src="/images/record.png"/></button> =} <button id="transcode" class="y_live_button" type="button" value="Transcode" title="transcode mode" onclick="view_transcode_mode()" style="visibility:hidden"> - <img src="/images/transcode.png"></button> + <img src="/images/transcode.png"/></button> =} <span id="audio_pid_list"></span> -<!--- - test: - <input class="y_live_button" type="button" value="Ver" title="record mode" name="record_mode" onclick="do_show_version()"/> - <button class="y_live_button" type="button" value="test" title="" - name="test" onclick="do_test()"/>test</button> - <input class="y_live_button" type="button" value="udp" title="test" name="snapshot" onclick="doUDP()"/> ---> - </form> </div> <script type="text/javascript"> //<![CDATA[ + haveUDP = ("{=if-file-exists:/sbin/udpstreamts~true~{=if-file-exists:/var/bin/udpstreamts~true~false=}=}" == "true"); + isUDP = ("{=ini-get:/var/tuxbox/config/Y-Web.conf;udp;false=}" == "true"); + Mode = "{=mode=}"; + LiveTyp = "{=typ=}"; + ClientAddr = "{=func:get_request_data clientaddr=}"; insert_message_control("... build vlc control ..."); + isDeinterlace = ("{=ini-get:/var/tuxbox/config/Y-Web.conf;deinterlace;true=}" == "true"); + cachetime = {=ini-get:/var/tuxbox/config/Y-Web.conf;http_caching;0=}; /* {=if-equal:{=typ=}~popup~ always_on_top(); =} - window.setTimeout("do_init()",300); */ +do_onload(); //]]> </script> diff --git a/src/nhttpd/web/Y_LiveViewFull.yhtm b/src/nhttpd/web/Y_LiveViewFull.yhtm index d678ef65e..a545417b0 100644 --- a/src/nhttpd/web/Y_LiveViewFull.yhtm +++ b/src/nhttpd/web/Y_LiveViewFull.yhtm @@ -18,7 +18,7 @@ function setTranscode() <body> <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Live_Timer#LiveView=}{=var-set:menu={=typ=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Live_Timer-LiveView=}{=var-set:menu={=typ=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <table cellpadding="0" cellspacing="0" border="0"> <tr><td valign="top"> @@ -29,7 +29,7 @@ function setTranscode() <td> <iframe name="col2" src="Y_blank.htm" height="400" width="350" scrolling="auto" marginheight="0" marginwidth="0" frameborder="0"> Ihr Browser unterst&uuml;tzt Inlineframes nicht oder zeigt sie in der derzeitigen Konfiguration nicht an. - </iframe> + </iframe> </td> </tr> </table> diff --git a/src/nhttpd/web/Y_Live_DoubleView.yhtm b/src/nhttpd/web/Y_Live_DoubleView.yhtm index 4fa1e2d68..74262dce6 100644 --- a/src/nhttpd/web/Y_Live_DoubleView.yhtm +++ b/src/nhttpd/web/Y_Live_DoubleView.yhtm @@ -3,14 +3,14 @@ <body> <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Live_Timer#Double_View=}{=var-set:menu=Live - DoubleView=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Live_Timer-Double_View=}{=var-set:menu=Live - DoubleView=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <iframe name="I1" src="Y_Live_View.yhtm" target="Hauptframe" width="400" height="360" scrolling="no"> - Your Browser does not support Inlineframes or is not configured correctely. + Ihr Browser unterst&uuml;tzt Inlineframes nicht oder zeigt sie in der derzeitigen Konfiguration nicht an. </iframe> - {=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;slavebox=}~<div><font color="Red">No IP for the Slave Box supplied!<br>Einstellen unter Settings->yWeb.</font></div>~ + {=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;slavebox=}~<div><font color="Red">Kein IP f�r Slave Box angegeben!<br>Einstellen unter Settings->yWeb.</font></div>~ <iframe name="I2" src="http://{=ini-get:/var/tuxbox/config/Y-Web.conf;slavebox=}/Y_Live_View.yhtm" width="400" height="360" scrolling="no"> - Your Browser does not support Inlineframes or is not configured correctely. + Ihr Browser unterst&uuml;tzt Inlineframes nicht oder zeigt sie in der derzeitigen Konfiguration nicht an. </iframe> =} </div> diff --git a/src/nhttpd/web/Y_Live_EPG.yhtm b/src/nhttpd/web/Y_Live_EPG.yhtm index 4163b183d..41834ca4c 100644 --- a/src/nhttpd/web/Y_Live_EPG.yhtm +++ b/src/nhttpd/web/Y_Live_EPG.yhtm @@ -20,13 +20,14 @@ function sLog_clear() } sLog_line_number = 0; } -function sLog_addRow(_body, _rec, _zapit, _start, _end, _title) +function sLog_addRow(_body, _date, _rec, _zapit, _start, _end, _title) { sLog_line_number++; var mycurrent_row = y_add_row_to_table(_body, ((sLog_line_number % 2) ==0)?"a":"b" ); - + y_add_html_cell_to_row(mycurrent_row, "rec", _rec); y_add_html_cell_to_row(mycurrent_row, "zap", _zapit); + y_add_html_cell_to_row(mycurrent_row, "date", _date); y_add_html_cell_to_row(mycurrent_row, "starttime", _start); y_add_html_cell_to_row(mycurrent_row, "endtime", _end); y_add_html_cell_to_row(mycurrent_row, "epgtitle", _title); @@ -55,7 +56,11 @@ function check_logo() =} show_obj("logo",true); } -function show_epg() +function show_epg() { + show_waitbox(true); + window.setTimeout("_show_epg()",100); +} +function _show_epg() { check_logo(); sLog_init(); @@ -71,23 +76,24 @@ function show_epg() var prog_list = epg_xml.getElementsByTagName('prog'); for(i=0;i<prog_list.length;i++){ var prog = prog_list[i]; - + var _stop = getXMLNodeItemValue(prog, "stop_sec"); if(_stop > _starttime){ var _start_t = getXMLNodeItemValue(prog, "start_t"); + var _date = getXMLNodeItemValue(prog, "date"); var _start = getXMLNodeItemValue(prog, "start_sec"); var _stop_t = getXMLNodeItemValue(prog, "stop_t"); var _desc = epg_de_qout(getXMLNodeItemValue(prog, "description")); var _info1 = epg_de_qout(getXMLNodeItemValue(prog, "info1")); var _info2 = epg_de_qout(getXMLNodeItemValue(prog, "info2")); - + var epg_obj= new Array(_desc, _info1, _info2, _start, _start_t, _stop.toString(), "{=channel=}"); epg_data.push(epg_obj); - - var _rec = "<a title=\"record\" href=\"javascript:set_timer('{=channel=}',"+_start+","+_stop+");\">Rec</a>"; - var _zapit = "<a title=\"zapping\" href=\"javascript:set_zapit('{=channel=}',"+_start+");\">Zap</a>"; + + var _rec = "<a title=\"record\" href=\"javascript:set_timer('{=channel=}',"+_start+","+_stop+");\"><img src=\"images/record.png\"/></a>"; + var _zapit = "<a title=\"zapping\" href=\"javascript:set_zapit('{=channel=}',"+_start+");\"><img src=\"images/zap.png\"/></a>"; var _tit = "<span onmouseover=\"show_info('"+epg_data_index+"')\">"+_desc+"</span>"; - sLog_addRow(sLog_body, _rec, _zapit, _start_t, _stop_t, _tit); + sLog_addRow(sLog_body, _date, _rec, _zapit, _start_t, _stop_t, _tit); epg_data_index++; } } @@ -97,26 +103,18 @@ function show_epg() //]]> </script> </head> -{=var-set:wait_text=EPG is loaded.=}{=include-block:Y_Blocks.txt;snip_show_wait=} +{=var-set:wait_text={=L:get_epg=}=}{=include-block:Y_Blocks.txt;snip_show_wait=} <body onload="show_epg()"> - <table class="y_invisible_table" cellpadding="4" width="100%"> + <table id="epglist" class="y_invisible_table" cellpadding="4" cellspacing="0" width="100%"> <thead align="left"> <tr> - <th colspan="2"><img id="logo" src="{=ini-get:/var/tuxbox/config/nhttpd.conf;ExtrasDocURL=}/logos/{=channel=}.gif" style="visibility:hidden">&nbsp;</th> - <th>From</th><th>to</th><th>Broadcasting</th> + <th colspan="2"><img id="logo" src="{=ini-get:/var/tuxbox/config/nhttpd.conf;Tuxbox.LogosURL=}/{=channel=}.gif" style="visibility:hidden">&nbsp;</th> + <th>{=L:date=}</th><th>{=L:from=}</th><th>{=L:to=}</th><th>{=L:program=}</th> </tr> </thead> <tbody id="slog_list"> - <tr><td></td></tr> </tbody> </table> <br /> -<script type="text/javascript"> -//<![CDATA[ -// show_waitbox(true); -// window.setTimeout("show_epg()",500); -//]]> -</script> - </body> </html> \ No newline at end of file diff --git a/src/nhttpd/web/Y_Live_EPG_Info.yhtm b/src/nhttpd/web/Y_Live_EPG_Info.yhtm index 2b96573d2..27b5e5677 100644 --- a/src/nhttpd/web/Y_Live_EPG_Info.yhtm +++ b/src/nhttpd/web/Y_Live_EPG_Info.yhtm @@ -2,8 +2,7 @@ <script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript"> //<![CDATA[ -function show_info(_desc, _info1, _info2) -{ +function show_info(_desc, _info1, _info2){ document.getElementById("description").innerHTML = _desc; document.getElementById("info1").innerHTML = _info1; document.getElementById("info2").innerHTML = _info2; @@ -11,12 +10,12 @@ function show_info(_desc, _info1, _info2) //]]> </script> </head> -<a href="javascript:window.history.back()"><u>Back</u></a> +<a href="javascript:window.history.back()"><u>{=L:back=}</u></a> <body> <div class="y_epg_info"> <div id="description">&nbsp;</div> <div id="info1">&nbsp;</div> - <div id="info2">For details: move the mouse on the corresponding program.</div> + <div id="info2">{=L:hover_for_details=}</div> </div> </body> </html> \ No newline at end of file diff --git a/src/nhttpd/web/Y_Live_Menue.yhtm b/src/nhttpd/web/Y_Live_Menue.yhtm index 1988372ff..786218504 100644 --- a/src/nhttpd/web/Y_Live_Menue.yhtm +++ b/src/nhttpd/web/Y_Live_Menue.yhtm @@ -1,32 +1,48 @@ {=include-block:Y_Blocks.txt;head=} +<script type="text/javascript" src="/prototype.js"></script> <script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript" src="/Y_yweb.js"></script> <script type="text/javascript"> //<![CDATA[ var live_window; -function go_live() -{ -/* try{ - live_window.close(); - }catch(e){}*/ - var _url = (is_ie) ? "Y_Tools_NetStream.yhtm?browser=ie" : "Y_Tools_NetStream.yhtm?browser=moz"; - parent.frames[1].location.href = _url; -} -function go_live_popup(_url) -{ +function go_live_popup(_url){ res_w=384; - res_h=288+90; + res_h=288+120; var par = "width="+res_w+",height="+res_h+",resizable=yes"; tv = window.open(_url,'tv',par); parent.frames[1].location.href = "Y_Live_Msg.yhtm"; } -function go_live_popup_tv() -{ +function go_live_popup_tv(){ live_window = go_live_popup("/Y_Live.yhtm?typ=popup&mode=tv"); } -function go_live_popup_radio() -{ +function go_live_popup_radio(){ live_window = go_live_popup("/Y_Live.yhtm?typ=popup&mode=radio"); } +function epg_plus_popup() { + window.open("Y_EPG_Plus.yhtm","_blank","resizable=yes,scrollbars=yes"); +} +function init(){ + var menu=ext.select_menu('live'); + menu.each(function(e){ + var el=new Element('li').update( + new Element('a', {'target':'work', + 'title': e.get('desc'), + 'href': e.get('file') + }).update("-"+e.get('menuitem')) + ); + $('secmenu_live').insert({'bottom':el}); + }); + var menu=ext.select_menu('timer'); + menu.each(function(e){ + var el=new Element('li').update( + new Element('a', {'target':'work', + 'title': e.get('desc'), + 'href': e.get('file') + }).update("-"+e.get('menuitem')) + ); + $('secmenu_timer').insert({'bottom':el}); + }); +} //]]> </script> </head> @@ -37,33 +53,36 @@ function go_live_popup_radio() <div class="y_menu_sec_box_body"> <div class="y_menu_sec_section">Live</div> <div class="y_menu_sec"> - <ul> + <ul id="secmenu_live"> <li> <table class="y_invisible_table" cellspacing="0" cellpadding="0" style="width:100%; padding-right:15px;margin:0"><tr> <td><a target="work" title="LiveTV" href="Y_LiveViewFull.yhtm?mode=tv&amp;typ=live">TV</a></td> - <td align="right"><a title="LiveTV (popup)" href="javascript:go_live_popup_tv()">Popup</a></td> + <td align="right"><a title="LiveTV (popup)" href="javascript:go_live_popup_tv()"><img src="/images/popup.png"/></a></td> </tr></table> </li> <li> <table class="y_invisible_table" cellspacing="0" cellpadding="0" style="width:100%; padding-right:15px;margin:0"><tr> <td><a target="work" title="LiveRadio" href="Y_LiveViewFull.yhtm?mode=radio&amp;typ=live">Radio</a></td> - <td align="right"><a title="LiveRadio (popup)" href="javascript:go_live_popup_radio()">Popup</a></td> + <td align="right"><a title="LiveRadio (popup)" href="javascript:go_live_popup_radio()"><img src="/images/popup.png"/></a></td> </tr></table> </li> - <li><a title="LiveView" href="Y_Live.yhtm?browser=ie&type=live&mode=tv" target="work">LiveView</a></li> - <li id="transcode" style="display:none"> - <a target="work" title="transcode box-stream" href="Y_LiveViewFull.yhtm?mode=tv&amp;typ=transcode">Transcoder</a></li> - <li><a title="test vlc plugin" href="javascript:go_live()">NetStream</a></li> <li><a target="work" title="use LiveView with 2 boxes" href="Y_Live_DoubleView.yhtm">DoubleView</a></li> </ul> </div> <div class="y_menu_sec_section">Timer</div> <div class="y_menu_sec"> - <ul> + <ul id="secmenu_timer"> <li><a target="work" title="organize timer" href="Y_Timer_List.yhtm">Timer</a></li> <li><a target="work" title="View EPG" href="Y_Boxcontrol_Bouquets.yhtm">EPG</a></li> - <li><a target="work" title="View EPG" href="Y_EPG_Plus.yhtm">EPG Plus</a></li> + <li> + <table class="y_invisible_table" cellspacing="0" cellpadding="0" style="width:100%; padding-right:15px;margin:0"><tr> + <td><a target="work" title="View EPG" href="Y_EPG_Plus.yhtm">EPG Plus</a></td> + <td align="right"><a title="EPG+ (popup)" href="javascript:epg_plus_popup()"><img src="/images/popup.png"/></a></td> + </tr></table> + </li> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ <li><a target="work" title="timer synchronisation with web tv-planer" href="Y_Tools_Timer_Sync.yhtm">Timer Sync</a></li> + ~=} <!--<li><a target="work" title="recorder" href="Y_Blank.yhtm">Recorder</a></li>--> </ul> </div> @@ -71,14 +90,10 @@ function go_live_popup_radio() </div> <script type="text/javascript"> //<![CDATA[ - if(is_ie) - { - var _obj = document.getElementById("transcode"); - _obj.style.display = "block"; - } {=if-empty:{=start=}~~ go_live_popup_tv(); =} + init(); //]]> </script> </body> diff --git a/src/nhttpd/web/Y_Live_Msg.yhtm b/src/nhttpd/web/Y_Live_Msg.yhtm index 74a2f6d5b..c4c8dd096 100644 --- a/src/nhttpd/web/Y_Live_Msg.yhtm +++ b/src/nhttpd/web/Y_Live_Msg.yhtm @@ -4,7 +4,7 @@ <body> <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Live_Timer#LiveView=}{=var-set:menu=LiveView PopUp=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Live_Timer-LiveView=}{=var-set:menu=LiveView PopUp=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> Under Live-View do not zap channels direct by the web or by the dbox' RC.<br/> <a href="Javascript:live_unlock();"><u>unlock</u></a> diff --git a/src/nhttpd/web/Y_Live_Record.yhtm b/src/nhttpd/web/Y_Live_Record.yhtm index 8a59bb5ef..5251f745a 100644 --- a/src/nhttpd/web/Y_Live_Record.yhtm +++ b/src/nhttpd/web/Y_Live_Record.yhtm @@ -1,103 +1,83 @@ {=include-block:Y_Blocks.txt;head=} <script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript" src="/prototype.js"></script> <script type="text/javascript"> //<![CDATA[ /*0=normal, 1=record*/ +var isRecord=false; function setControls(state) { - switch(state) - { + switch(state) { case 1: - document.v.record_filename.disabled=true; - document.v.tdisplay.disabled=true; - document.v.transon.disabled=true; + $('record_filename','tdisplay', 'transon').invoke('disable'); break; - + default: - document.v.record_filename.disabled=false; - document.v.tdisplay.disabled=false; - document.v.transon.disabled=false; + $('record_filename','tdisplay', 'transon').invoke('enable'); break; } } /*0=custom, 1=off*/ function setControlsCustom(state) { - switch(state) - { + switch(state){ case 1: {=if-equal:{=mode=}~tv~ - document.v.twidth.disabled=true; - document.v.theight.disabled=true; - document.v.vcodec.disabled=true; - document.v.vb.disabled=true; - document.v.scale.disabled=true; + $('twidth','theight', 'vcodec', 'vb', 'scale').invoke('disable'); =} - document.v.acodec.disabled=true; - document.v.ab.disabled=true; - document.v.channels.disabled=true; - document.v.tmux.disabled=true; + $('acodec','ab', 'channels', 'tmux').invoke('disable'); break; default: {=if-equal:{=mode=}~tv~ - document.v.twidth.disabled=false; - document.v.theight.disabled=false; - document.v.vcodec.disabled=false; - document.v.vb.disabled=false; - document.v.scale.disabled=false; + $('twidth','theight', 'vcodec', 'vb', 'scale').invoke('enable'); =} - document.v.acodec.disabled=false; - document.v.ab.disabled=false; - document.v.channels.disabled=false; - document.v.tmux.disabled=false; + $('acodec','ab', 'channels', 'tmux').invoke('enable'); break; } } function on_profile_change() { - if(document.v.profile.value == "custom") + if($F('profile') == "custom") setControlsCustom(0); else setControlsCustom(1); } function on_transon_change() { - if(document.v.transon.checked) - { - document.v.profile.disabled=false; + if($('transon').checked){ + $('profile').enable(); on_profile_change(); } - else - { - document.v.profile.disabled=true; + else { + $('profile').disable(); setControlsCustom(1); } } function doRecord() { var _live = parent.live; - if(document.v.record.value == "Record") + if(!isRecord) { var transcode = ""; var stream = ""; - if(document.v.transon.checked) + if($('transon').checked) { - switch(document.v.profile.value) + switch($F('profile')) { case "custom": transcode = "transcode{"+ {=if-equal:{=mode=}~tv~ - "width=" +document.v.twidth.value+ - ",height=" +document.v.theight.value+ - ",vcodec=" +document.v.vcodec.value+ - ",vb=" +document.v.vb.value+ - ",scale=" +document.v.scale.value+ + "width=" +$F('twidth')+ + ",height=" +$F('theight')+ + ",vcodec=" +$F('vcodec')+ + ",vb=" +$F('vb')+ + ",scale=" +$F('scale')+ ","+ - =} - "acodec=" +document.v.acodec.value+ - ",ab=" +document.v.ab.value+ - ",channels=" +document.v.channels.value+ + =} + "acodec=" +$F('acodec')+ + ",ab=" +$F('ab')+ + ",channels=" +$F('channels')+ ",deinterlace}:"; break; @@ -105,6 +85,10 @@ function doRecord() transcode = "transcode{width=320,height=240,vcodec=mp4v,vb=768,acodec=mp4a,ab=128}:"; break; + case "divx3": + transcode = "transcode{vcodec=DIV3,vb=1024,scale=1,acodec=mp3,ab=192,channels=2}:"; + break; + case "mp3": transcode = "transcode{acodec=mp3,ab=192}:"; break; @@ -114,13 +98,13 @@ function doRecord() break; } } - switch(document.v.profile.value) + switch($F('profile')) { case "mp3": stream = "dst=std{"+ "access=file"+ ",mux=raw"+ - ",url="+document.v.record_filename.value+ + ",url=\""+$F('record_filename')+"\""+ "}"; break; @@ -128,104 +112,106 @@ function doRecord() stream = "dst=std{"+ "access=file"+ ",mux=mp4"+ - ",url="+document.v.record_filename.value+ + ",url=\""+$F('record_filename')+"\""+ + "}"; + break; + + case "divx3": + stream = "dst=std{"+ + "access=file"+ + ",mux=asf"+ + ",url=\""+$F('record_filename')+"\""+ "}"; break; default: stream = "dst=std{"+ "access=file"+ - ",mux="+document.v.tmux.value+ - ",url="+document.v.record_filename.value+ + ",mux="+$F('tmux')+ + ",url=\""+$F('record_filename')+"\""+ "}"; break; } - if(document.v.tdisplay.checked) + if($('tdisplay').checked) stream = stream+",dst=display"; var __vlc_cmd = ":sout=#"+transcode+"duplicate{"+stream+"}"; -/* var sel = document.v.tmux.selectedIndex; - var ymux = (sel != -1) ? document.v.tmux[sel].value : "ts"; - var __vlc_cmd = ":sout=#duplicate{dst=display,dst=std{access=file,mux="+ymux+",url="+document.v.record_filename.value+"}}"; -*/ - var options = new Array(__vlc_cmd,":input-repeat=1"); - document.v.record.value = "Stop Record"; setControls(1); - _live.do_play_state(1, options); + _live.do_play_bystring(__vlc_cmd); } else { - document.v.record.value = "Record"; setControls(0); _live.do_play(); } + isRecord=!isRecord; + $('record').update( (isRecord)? "Stop Record": "Record"); } //]]> </script> </head> <body> - <form name="v" action="" method="get"> - <table class="y_live_table" cellspacing="0" width="100%"> - <tr><td class="y_form_header" colspan="5">Record Mode</td></tr> + <form id="v" class="y_form" action="" method="get"> + <table cellspacing="0" width="100%"> + <tr><td class="y_form_header" colspan="4">Record Mode</td></tr> <tr> - <td>&nbsp;</td> <td>Filename:</td> - <td colspan="3"><input type="text" name="record_filename" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;vlc_record_path=}"/></td> + <td colspan="3"><input type="text" id="record_filename" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;vlc_record_path=}"/></td> </tr> <tr> - <td>&nbsp;</td> <td colspan="4"> - <input type="checkbox" name="tdisplay" value="1" title="Display on while transcoding" checked="checked"/>Display on&nbsp; - <input type="checkbox" name="transon" value="1" title="use transcoding" onclick="on_transon_change()"/>Transcoding on + <input type="checkbox" id="tdisplay" value="1" title="Display on while transcoding" checked="checked"/>Display on&nbsp; + <input type="checkbox" id="transon" value="1" title="use transcoding" onclick="on_transon_change()"/>Transcoding on </td> </tr> <tr> - <td>&nbsp;</td> <td colspan="4"> <br/> - <button class="y_live_button" type="button" value="r" title="record stream to file" name="record" onclick="doRecord()">Record</button> + <button class="y_live_button" type="button" value="Record" title="record stream to file" onclick="doRecord()"> + <img src="/images/record.png">&nbsp;<span id="record">Record</span></button> </td> </tr> - <tr><td class="y_form_header" colspan="5"><br/>Record Transcode</td></tr> + <tr><td class="y_form_header" colspan="4"><br/>Record Transcode</td></tr> <tr> - <td>&nbsp;</td> <td>Profile:</td> - <td> - <select name="profile" class="y_live_button" onchange="on_profile_change()"> + <td colspan="3"> + <select id="profile" class="y_live_button" onchange="on_profile_change()"> {=if-equal:{=mode=}~tv~ <option value="ipod" selected>iPod Video</option> + <option value="divx3">DivX</option> =} <option value="custom">custom</option> <option value="ipoda">iPod Audio</option> <option value="mp3">mp3 Audio</option> </select> </td> - <td>&nbsp;</td> - <td>&nbsp;</td> </tr> {=if-equal:{=mode=}~tv~ - <tr><td class="y_form_section"><br/>Video</td><td class="y_form_section" colspan="4">&nbsp;</td></tr> + <tr><td class="y_form_section"><br/>Video</td><td class="y_form_section" colspan="3">&nbsp;</td></tr> <tr> - <td>&nbsp;</td> <td>Breite:</td> - <td><input type="text" name="twidth" size="4" value="384" class="y_live_button"/></td> + <td><input type="text" id="twidth" size="4" value="720" class="y_live_button"/></td> <td>H&ouml;he:</td> - <td><input type="text" name="theight" size="4" value="288" class="y_live_button"/></td> + <td><input type="text" id="theight" size="4" value="576" class="y_live_button"/></td> </tr> <tr> - <td>&nbsp;</td> <td>Codec:</td> <td> - <select name="vcodec" class="y_live_button"> + <select id="vcodec" class="y_live_button"> <option value="mp4v" selected>mp4v</option> + <option value="mp1v">mp1v</option> <option value="mp2v">mp2v</option> <option value="DIV3">DIV3</option> <option value="h264">h264</option> + <option value="H263">h263</option> + <option value="h264">h264</option> + <option value="WMV1">WMV1</option> + <option value="WMV1">WMV2</option> </select> </td> <td>Bitrate:</td> - <td> - <select name="vb" class="y_live_button"> + <td> + <select id="vb" class="y_live_button"> <option value="1024">1024</option> <option value="786">786</option> <option value="512">512</option> @@ -238,10 +224,9 @@ function doRecord() </td> </tr> <tr> - <td>&nbsp;</td> <td>Scale:</td> <td> - <select name="scale" class="y_live_button"> + <select id="scale" class="y_live_button"> <option value="0.25">0.25</option> <option value="0.50">0.50</option> <option value="0.75">0.75</option> @@ -256,21 +241,23 @@ function doRecord() <td>&nbsp;</td> </tr> =} - <tr><td class="y_form_section">Audio</td><td class="y_form_section" colspan="4">&nbsp;</td></tr> + <tr><td class="y_form_section">Audio</td><td class="y_form_section" colspan="3">&nbsp;</td></tr> <tr> - <td>&nbsp;</td> <td>Codec:</td> <td> - <select name="acodec" class="y_live_button"> + <select id="acodec" class="y_live_button"> <option value="mp4a" selected>mp4a</option> <option value="mp3">mp3</option> <option value="mp2a">mp2a</option> <option value="a52">a52</option> + <option value="vorb">vorb</option> + <option value="flac">flac</option> + <option value="fl32">fl32</option> </select> </td> <td>Bitrate:</td> <td> - <select name="ab" class="y_live_button"> + <select id="ab" class="y_live_button"> <option value="192">192</option> <option value="128">128</option> <option value="96">96</option> @@ -281,10 +268,9 @@ function doRecord() </td> </tr> <tr> - <td>&nbsp;</td> <td>Channels:</td> <td> - <select name="channels" class="y_live_button"> + <select id="channels" class="y_live_button"> <option value="1">1</option> <option value="2 selected">2</option> <option value="6">6</option> @@ -293,21 +279,24 @@ function doRecord() <td>&nbsp;</td> <td>&nbsp;</td> </tr> - <tr><td class="y_form_section">Mux</td><td class="y_form_section" colspan="4">&nbsp;</td></tr> + <tr><td class="y_form_section">Mux</td><td class="y_form_section" colspan="3">&nbsp;</td></tr> <tr> - <td>&nbsp;</td> <td>Mux:</td> <td> - <select name="tmux" class="y_live_button"> + <select id="tmux" class="y_live_button"> {=if-equal:{=mode=}~tv~ <option value="ts" selected>ts</option> <option value="ps">ps</option> <option value="mp4">mp4</option> <option value="mov">mov</option> - <option value="raw">raw</option> + <option value="ogg">ogg</option> + <option value="asf">asf</option> + <option value="mpeg1">mpeg1</option> + <option value="wav">wav</option> ~ <option value="raw" selected>raw</option> <option value="mp4">mp4</option> + <option value="ogg">ogg</option> =} </select> </td> diff --git a/src/nhttpd/web/Y_Live_Transcode.yhtm b/src/nhttpd/web/Y_Live_Transcode.yhtm index bb2ecdf4c..d88ed0a26 100644 --- a/src/nhttpd/web/Y_Live_Transcode.yhtm +++ b/src/nhttpd/web/Y_Live_Transcode.yhtm @@ -25,7 +25,7 @@ function doTranscode() "}"; if(document.v.tdisplay.checked) stream = stream+",dst=display"; - + var __vlc_cmd = ":sout=#"+transcode+"duplicate{"+stream+"}"; var options = new Array(__vlc_cmd,":input-repeat=1"); document.v.transcode.value = "Stop Transcode"; @@ -41,26 +41,29 @@ function doTranscode() </script> </head> <body> - <form name="v" action="" method="get"> - <table class="y_live_table" cellspacing="0" width="100%"> + <form class="y_form" name="v" action="" method="get"> + <table cellspacing="0"> <tr><td class="y_form_header" colspan="5">Transcode-Broadcast</td></tr> - <tr><td class="y_form_section"><br/>Video</td><td class="y_form_section" colspan="4">&nbsp;</td></tr> + <tr><td class="y_form_section"><br/>Video</td><td class="y_form_section" colspan="3">&nbsp;</td></tr> <tr> - <td>&nbsp;</td> - <td>Width:</td> + <td>Breite:</td> <td><input type="text" name="twidth" size="4" value="384" class="y_live_button"/></td> - <td>Height:</td> + <td>H&ouml;he:</td> <td><input type="text" name="theight" size="4" value="288" class="y_live_button"/></td> </tr> <tr> - <td>&nbsp;</td> <td>Codec:</td> <td> <select name="vcodec" class="y_live_button"> <option value="mp4v" selected>mp4v</option> + <option value="mp1v">mp1v</option> <option value="mp2v">mp2v</option> <option value="DIV3">DIV3</option> <option value="h264">h264</option> + <option value="H263">h263</option> + <option value="h264">h264</option> + <option value="WMV1">WMV1</option> + <option value="WMV1">WMV2</option> </select> </td> <td>Bitrate:</td> @@ -78,7 +81,6 @@ function doTranscode() </td> </tr> <tr> - <td>&nbsp;</td> <td>Scale:</td> <td> <select name="scale" class="y_live_button"> @@ -95,9 +97,8 @@ function doTranscode() <td>&nbsp;</td> <td>&nbsp;</td> </tr> - <tr><td class="y_form_section"><br/>Audio</td><td class="y_form_section" colspan="4">&nbsp;</td></tr> + <tr><td class="y_form_section"><br/>Audio</td><td class="y_form_section" colspan="3">&nbsp;</td></tr> <tr> - <td>&nbsp;</td> <td>Codec:</td> <td> <select name="acodec" class="y_live_button"> @@ -105,6 +106,9 @@ function doTranscode() <option value="mp3">mp3</option> <option value="mp2a">mp2a</option> <option value="a52">a52</option> + <option value="vorb">vorb</option> + <option value="flac">flac</option> + <option value="fl32">fl32</option> </select> </td> <td>Bitrate:</td> @@ -120,7 +124,6 @@ function doTranscode() </td> </tr> <tr> - <td>&nbsp;</td> <td>Channels:</td> <td> <select name="channels" class="y_live_button"> @@ -132,9 +135,8 @@ function doTranscode() <td>&nbsp;</td> <td>&nbsp;</td> </tr> - <tr><td class="y_form_section"><br/>Access</td><td class="y_form_section" colspan="4">&nbsp;</td></tr> + <tr><td class="y_form_section"><br/>Access</td><td class="y_form_section" colspan="3">&nbsp;</td></tr> <tr> - <td>&nbsp;</td> <td>Type:</td> <td> <select name="access" class="y_live_button"> @@ -150,22 +152,24 @@ function doTranscode() <option value="ps">ps</option> <option value="mp4">mp4</option> <option value="mov">mov</option> - </select> + <option value="ogg">ogg</option> + <option value="asf">asf</option> + <option value="mpeg1">mpeg1</option> + <option value="wav">wav</option> +s </select> </td> </tr> <tr> - <td>&nbsp;</td> <td>IP:Port:</td> <td colspan="3"> <input type="text" name="tip" size="18" value="localhost:1234" class="y_live_button"> </td> </tr> <tr> - <td>&nbsp;</td> - <td colspan="4"> + <td colspan="3"> <br/> <input type="checkbox" name="tdisplay" value="1" title="Display on while transcoding" checked="checked"/>Display on - &nbsp;<button class="y_live_button" type="button" value="transcode" title="transcode stream" name="transcode" onclick="doTranscode()">Transcode</button> + &nbsp;<button class="y_live_button" type="button" value="transcode" title="transcode stream" name="transcode" onclick="doTranscode()"><img src="/images/transcode.png">&nbsp;Transcode</button> </td> </tr> </table> diff --git a/src/nhttpd/web/Y_Main.css b/src/nhttpd/web/Y_Main.css index 43054a4b4..38c38b6e2 100644 --- a/src/nhttpd/web/Y_Main.css +++ b/src/nhttpd/web/Y_Main.css @@ -1,43 +1,115 @@ -body -{ - font-family: Arial, Tahoma, Verdana, Geneva, Helvetica, sans-serif; +body { + font-family: Verdana, Geneva, Arial, 'Lucida Grande',Tahoma, Helvetica, sans-serif; background-color: White; - margin-left: 0px; - margin-right: 0px; - margin-top: 0px; - margin-bottom: 0px; + margin: 0; padding:0; font-size:10pt; - color: #555555; + color: #555555; } +/*standards*/ +img {border:0;margin:0;padding:0;} +button,input,select,form,td { + font-family: Verdana, Geneva, Arial, 'Lucida Grande',Tahoma, Helvetica, sans-serif; + color:#555555; +} +/* buttons */ +/*button{margin:1px}*/ +a img:hover { + position:relative; + left:1px; + top:1px; +} +button[ytype]{ + background-position:1px; + background-attachment: scroll; + background-color: transparent; + background-repeat: no-repeat; + padding-left: 20px; + padding-right:0px; + vertical-align: middle; + text-align:left; +} +button[ytype="save"]{background-image:url(/images/save.png);} +button[ytype="saveall"]{background-image:url(/images/saveall.png);} +button[ytype="cancel"]{background-image:url(/images/cross.png);} +button[ytype="refresh"],button[ytype="reboot"]{background-image:url(/images/reload.gif);} +button[ytype="record"]{background-image:url(/images/record.png);} +button[ytype="zap"]{background-image:url(/images/zap.png);} +button[ytype="timeup"]{background-image:url(/images/time_up.png);} +button[ytype="timedown"]{background-image:url(/images/time_down.png);} +button[ytype="timeadd"]{background-image:url(/images/time_add.png);} +button[ytype="shot"]{background-image:url(/images/snapshot.png);} +button[ytype="clearshot"]{background-image:url(/images/remove.png);} +button[ytype="go"]{background-image:url(/images/accept.png);} +button[ytype="download"]{background-image:url(/images/wget.gif);} +button[ytype="clear"]{background-image:url(/images/remove.png);} +button[ytype="add"]{background-image:url(/images/new.png);} +button[ytype="delete"]{background-image:url(/images/remove.png);} +button[ytype="edit"]{background-image:url(/images/modify.png);} +button[ytype="flash"]{background-image:url(/images/flash.png);} -img {border:0;} -button {font-family:Arial,Sans-Serif; color:#555555;} -input {font-family:Arial,Sans-Serif; color:#555555;} -select {font-family:Arial,Sans-Serif; color:#555555;} -form {margin: 0; padding: 0;} +button[ytype="no"]{height:21px;padding-left:1px} +/*TODO: input file*/ +button,input[type="button"],input[type="submit"]/*,input[type="file"],input[type="file"] > input[type="button"],input[type="file"] > input[type="text"]*/ { + border: 1px solid #888888; + background-color: transparent; +} +button:hover,input[type="button"]:hover,input[type="submit"]:hover/*,input[type="file"]:hover*/ { + position:relative; + left:1px; + top:1px; + border: 1px solid #888888; +} +div { + margin:0; + padding:0; +} +input[type="text"]:focus,input[type="password"]:focus{ + border-top: 1px solid #666666; + border-left: 1px solid #666666; + margin: 0px; + background: #ffffcc; + +} +input[type="text"],input[type="password"],select{ + border: 1px solid #aaaaaa; + margin: 0px; + +} * html .boxhead h2 {height: 1%;} /* For IE 5 PC */ - a { - color: #555555; + color: #555555; font-size:10pt; - text-decoration:none; + text-decoration:none; } - td { - color: #555555; + color: #555555; font-size:10pt; } - tr { - color: #555555; + color: #555555; font-size:10pt; } - +.exlink{ + background:transparent url(/images/exlink.gif) no-repeat scroll left center; + text-decoration: underline; + padding-left: 20px; +} +.inlink{ + background:transparent url(/images/inlink.gif) no-repeat scroll left center; + text-decoration: underline; + padding-left: 20px; +} +.comment{ + background:transparent url(/images/comment.png) no-repeat scroll left center; + text-decoration: underline; + padding-left: 20px; +} /* primary Navigation */ .y_menu_prim_box { margin: 0; +/* padding:0;*/ width: 100%; background: url(/images/body-trans-r.gif) no-repeat bottom right; font-size: 100%; @@ -48,70 +120,69 @@ tr { padding: 0; text-align: center; } -.y_menu_prim_box_head h2 { +.y_menu_prim_box_head_h2 { background: url(/images/head-trans-l.gif) no-repeat top left; margin: 0; padding: 5px 0px 5px; - color: white; - font-size: 0; - line-height: 0.5em; + color: white; +/* font-size: 0;*/ +/* line-height: 0.5em;*/ } .y_menu_prim_box_body { background: url(/images/body-trans-l.gif) no-repeat bottom left; - margin: 0; +/* margin: 0;*/ padding-bottom: 8px; padding-left: 20px; padding-right: 20px; } -.y_menu_item -{ +.y_menu_item { margin: 0; - display: block; - background-repeat: no-repeat; +/* display: block; + background-repeat: no-repeat;*/ } -.y_menu_prim -{ - background-color: transparent; - padding: 0em 0em 0em 0em; - white-space: nowrap; +.y_menu_prim { + margin: 0; + padding: 0; +/* background-color: transparent; + white-space: nowrap;*/ list-style: none; - margin: 0; height: auto; - line-height: normal; +/* line-height: normal;*/ } -.y_menu_prim li -{ +.y_menu_prim li { display: inline; -} -.y_menu_prim_item -{ margin: 0; +/* font-family: Arial, 'Lucida Grande',Tahoma, Verdana, Geneva, Helvetica, sans-serif; background-repeat: no-repeat; background-position: 0 1px; - text-align:center; - font-weight: bold; - font-size: 12pt; - text-decoration: none; - height: auto; - padding: 0em 0.5em; +*/ text-align:center; + font-weight: normal; +/* height: auto;*/ + padding: 0em 0.3em; +} +.y_menu_prim_item { } .y_menu_prim li a { + font-size: 11pt; + text-decoration: none; } -.y_menu_prim li.selected a -{ +.y_menu_prim li.selected a { background-color: #dee7ec; border: 1px solid #6D96A9; color: #555555; } -.y_menu_prim li a:hover -{ +.y_menu_prim li a:hover { color: #FF6600; } - +#box_name { + font-weight:normal; + font-size:10pt; +} /* secondary Navigation */ .y_menu_sec_box { margin: 0; - width: 100%; + padding: 0; + width: 100%; background: url(/images/body-trans-r.gif) no-repeat bottom right; font-size: 100%; } @@ -121,24 +192,22 @@ tr { padding: 0; } .y_menu_sec_box_head h2 { - background: url(/images/head-orange-l.gif) no-repeat top left; - margin: 0; - padding: 12px 30px 3px 30px; - color: white; - font-weight: bold; - font-size: 1.2em; - line-height: 1.5em; - text-align: left; + padding: 10px 30px 3px 25px; + background: url(/images/head-orange-l.gif) no-repeat top left; + font-family: Arial, 'Lucida Grande',Tahoma, Verdana, Geneva, Helvetica, sans-serif; + color: white; + font-weight: bold; + font-size: 12pt; +/* line-height: 1.5em;*/ + text-align: left; } .y_menu_sec_box_body { background: url(/images/body-trans-l.gif) no-repeat bottom left; margin: 0; - padding-top: 5px; - padding-left: 6px; - padding-bottom: 20px; - padding-right: 6px; - +/* padding:0;*/ + padding: 5px 5px 20px 5px; + } .y_menu_sec { display: block; @@ -147,46 +216,41 @@ tr { } .y_menu_sec ul { - padding: 0em 0em 0em 0em; + padding: 0; list-style: none; - margin: 0px; + margin: 0; } .y_menu_sec li { text-align: left; margin-bottom: 1px; padding-left: 20px; - color: #555555 + color: #555555; } -.y_menu_sec li.disabled -{ +.y_menu_sec li.disabled { height: auto; margin-bottom: 0.1em; color: #808080; text-decoration:line-through; } -.y_menu_sec li a -{ +.y_menu_sec li a { text-decoration: none; - font-size: 12px; + font-size: 10pt; } -.y_menu_sec li.plain a -{ +.y_menu_sec li.plain a { color: #555555 } -.y_menu_sec li.disabled a -{ +.y_menu_sec li.disabled a { } -.y_menu_sec li a:hover -{ +.y_menu_sec li a:hover { color: #FF6600; } .y_menu_sec_section { margin: 10px 0px 0px 0px; - padding: 5px 2px 5px 10px; + padding: 3px 2px 3px 10px; background-color: #FFCC99; font-size: 10pt; - font-weight: bold; + font-weight: bold; } /*work*/ @@ -201,24 +265,15 @@ tr { padding: 0; text-align: center; } -.work_box_head h2 { +.work_box_head h2,.work_box_head_h2 { background: url(/images/head-blue-l.gif) no-repeat top left; margin: 0; - padding: 12px 30px 3px 30px; - color: white; - font-weight: bold; - font-size: 1.2em; - line-height: 1.5em; - text-align: left; -} -.work_box_head_h2 { - background: url(/images/head-blue-l.gif) no-repeat top left; - margin: 0; - padding: 12px 30px 3px 30px; - color: white; - font-weight: bold; - font-size: 1.2em; - line-height: 1.5em; + padding: 10px 30px 3px 30px; + font-family: Arial, 'Lucida Grande',Tahoma, Verdana, Geneva, Helvetica, sans-serif; + color: white; + font-weight: bold; + font-size: 12pt; +/* line-height: 1.5em;*/ text-align: left; } .work_box_body { @@ -235,11 +290,22 @@ tr { .work_box_help a { float:right; width:3em; - color: white; - font-weight: bold; - font-size: 1.2em; + color: white; + font-weight: bold; + font-size: 1.2em; text-align:right; } +/*raus +.y_work_table { + border: 1px dashed #2188e0; + border-collapse: collapse; + background: white; + color: #555555; + margin:0; + padding:0; +}*/ +/*y_menu*/ +/*raus .y_menu { font-size: 10pt; @@ -261,44 +327,8 @@ tr { background-position: center; background-repeat: no-repeat; } -.y_audio_bar -{ - background: #6D96A9; -} -.y_head -{ - font-weight: bold; - color: #555555; - font-size: 14pt; - clear:both; -} -.y_work_box -{ - border-spacing: 1px; - padding-left: 20px; - padding-right: 20px; - padding-top: 10px; - padding-bottom: 10px; - float:left; - width: auto; - color: #555555; - display:block; -} -.y_work_table -{ - border: 1px dashed #2188e0; - border-collapse: collapse; - background: white; - color: #555555; - margin:0; - padding:0; -} -.y_live_box -{ - border-top: 1px solid #6D96A9; - font-size: 8pt; +*/ -} /*wait box*/ .y_wait_box { margin: 0; @@ -327,14 +357,13 @@ tr { } .y_wait_box_head h2 { background: url(/images/head-orange-l.gif) no-repeat top left; - margin: 0; padding: 12px 30px 3px 30px; - color: white; - font-weight: bold; - font-size: 1.2em; + color: white; + font-weight: bold; + font-size: 1.2em; line-height: 1.5em; - text-align: center; + text-align: center; } .y_wait_box_body { background: url(/images/body-trans-l.gif) no-repeat bottom left; @@ -343,23 +372,34 @@ tr { padding-left: 16px; padding-bottom: 20px; padding-right: 16px; - + } .y_wait_box_main { - color: #666666; + color: #666666; font-weight: bold; text-align: center; } /**/ -.y_live_table +/*raus +.y_audio_bar { + background: #6D96A9; +} +.y_live_box +{ + border-top: 1px solid #6D96A9; + font-size: 8pt; + +}*/ +.y_table,.y_form_table,.y_invisible_table,y_form table { color: #555555; padding: 0; margin: 0; border: 0; + border-spacing: 0px; + width: 100%; } -.y_live_button -{ +.y_live_button { /* font-size: 8pt; height: 22px;*/ padding: 0; @@ -389,46 +429,54 @@ tr { color: #555555; } -.y_form_table -{ - font-size: 10pt; - border: 0px; - border-spacing: 0px; - padding: 0; - margin:0; -} - -.y_invisible_table -{ - border: 0px; - border-spacing: 0px; - padding: 0; -} .y_topline { border-top: 1px solid #2188e0; } +.y_form { + margin:0; + padding:0; +} +.y_form_header_oline +{ +/* font-size : 12pt;*/ + font-weight:bold; + color : #555555; + margin:0; +} .y_form_header { - font-size : 12pt; - font-weight:bold; - border-bottom : 1px solid #6cadfd; - color : #0066cc; +/* font-size : 12pt;*/ + font-weight:bold; margin:0; + border-bottom : 1px solid #555555; + color : #555555; + padding-top:0.5em; +} +.y_form .y_form_header,.y_form .y_form_header_oline { + padding-left:0px; +/* margin:0; + padding:0;*/ +} +.y_form td{ + padding-left:20px; +} +.y_form #colorTable td{ + padding-left:0px; } .y_form_section { - font-size : 10pt; - font-weight:bold; - border-bottom : 1px solid #aaaaaa; + font-size : 10pt; + font-weight:bold; + border-bottom : 1px solid #aaaaaa; color : #555555; } -.y_text_boxcontrol_button +.y_text_boxcontrol_button { padding : 1px; border : #FF8e42 solid 1px; } -.y_text_boxcontrol_button a:hover +.y_text_boxcontrol_button a:hover { background:#FF8e42; } @@ -441,7 +489,7 @@ tr { } .y_epg_info { border: 1px solid #CCCCCC; - display:block; + background-color: white; } .y_epg_info #description { font-weight:bold; @@ -451,39 +499,88 @@ tr { } .channel_logos { - width: 40px; - height: 21px; + max-width: 44px; + max-height: 21px; +} +#epg_plus { + border-top : #BBBBBB solid 1px; + border-left : #BBBBBB solid 1px; + border-right : #BBBBBB solid 1px; + margin: 0px; +/* width:auto;*/ + overflow:auto; } .ep_bouquet { - margin-bottom: 2px; + margin: 0px; + padding: 0px; position:relative; + border-bottom : #BBBBBB solid 1px; } .ep_bouquet_name { - border : #BBBBBB solid 1px; + border-right : #BBBBBB solid 1px; width : 100px; - height: 1.3em; +/* height: 1.3em;*/ overflow:hidden; padding-left: 1px; padding-right: 1px; + font-size:8pt; + text-align: center; + min-height: 20px; } .ep_bouquet_item { - border : #BBBBBB solid 1px; + border-right : #BBBBBB solid 1px; overflow:hidden; - height: 1.3em; +/* height: 1.3em;*/ padding-left: 1px; padding-right: 1px; + height: 100%; + font-size:10pt; +} +.ep_bouquet_rec { + border-right : #BBBBBB solid 1px; + overflow:hidden; +/* height: 1.3em;*/ + padding-left: 1px; + padding-right: 1px; + background-color: #FF6600; + height: 100%; + font-size:8pt; + z-index:-10; + -moz-opacity: 0.2; + opacity:.20; + filter: alpha(opacity=20); +} +.ep_bouquet_zap { + border-right : #BBBBBB solid 1px; + overflow:hidden; +/* height: 1.3em;*/ + padding-left: 1px; + padding-right: 1px; + background-color: green; + height: 100%; + font-size:8pt; + z-index:10; + -moz-opacity: 0.2; + opacity:.20; + filter: alpha(opacity=20); +} +.ep_bouquet_item:hover { + background-color : #DDDDDD; } .ep_time_bar { width:100%; - margin-bottom: 2px; + margin-bottom: 0px; position:relative; + border-bottom : #BBBBBB solid 1px; } .ep_time_bar_item { - border : #999999 solid 1px; + font-weight:bold; + border-right : #BBBBBB solid 1px; height: 1.3em; padding-left: 1px; padding-right: 1px; overflow:hidden; + font-size:8pt; } .ep_info_desc { font-weight:bold; @@ -498,10 +595,12 @@ tr { #epg_info { border : #999999 solid 1px; visibility:hidden; -} -#epg_plus { - width:auto; - overflow:auto; + display:block; + z-index: 9980; + position: absolute; + background-color: white; + left: 50px; + top: 50px; } #epg_time { font-size: 8pt; @@ -516,6 +615,14 @@ tr { } tr.bouquetlist { +} +#bouqueteditorlist { + width:100%; + +} +#bouqueteditorlist tr:hover { + background-color: #dddddd; + } /*channels*/ .bouquetitemlist @@ -536,6 +643,14 @@ tr.bouquetlist padding-right: 20px; margin:0px; } +#epglist th { + font-weight:bold; + text-align: center; + border-bottom : 1px solid #aaaaaa; +} +#epglist tbody tr:hover { + background-color: #dddddd; +} .aepg { background-color: #F0FAFF; @@ -561,18 +676,18 @@ tr.bouquetlist padding-left: 10px; } a:hover.clist -{ +{ font-size:10pt; text-decoration:underline; } a:hover.clistsmall -{ +{ font-size:10pt; text-decoration:underline; } .c { - background-color:#dee7ec; + background-color:#D3E7F8; font-weight:bold; font-size:11pt; padding-left: 10px; @@ -581,15 +696,15 @@ a:hover.clistsmall } .cepg { - background-color:#dee7ec; + background-color:#D3E7F8; font-weight:normal; font-size:10pt; padding-left: 10px; } .cslider_table { - height: 10px; - border: 1px solid #436976; + height: 10px; + border: 1px solid #6cafea; width: 30px; border-spacing: 0px; padding: 0px; @@ -597,7 +712,7 @@ a:hover.clistsmall } .cslider_used { - background-color: #6D96A9; + background-color: #A1CCF2; height: 10px; } .cslider_free @@ -621,58 +736,56 @@ a:hover.clistsmall padding: 0px; } a:hover.elist -{ +{ font-size:10pt; text-decoration:underline; font-weight:bold; } /*Timer*/ -.timer -{ +.timer { border-collapse: collapse; padding: 0px; margin: 0px; + border: 0; + width: 100%; } -a.timer -{ +a.timer { text-decoration:underline; } -.atimer -{ +.atimer { background-color: #F0FAFF; - font-weight:normal; - padding-left: 5px; - padding-right: 5px; -} -.atimer td -{ text-align: center; } -.btimer -{ - background-color:White; +.btimer { font-weight:normal; - padding-left: 5px; - padding-right: 5px; -} -.btimer td -{ text-align: center; } -.ctimer -{ - background-color:#dee7ec; - font-weight:normal; - padding-left: 5px; - padding-right: 5px; -} -.ctimer td -{ +.timer_header td { + font-weight:bold; text-align: center; + border-bottom : 1px solid #aaaaaa; +} +.timer_footer td { + font-weight:bold; + text-align: center; + border-top : 1px solid #aaaaaa; } .blist { white-space: nowrap; height: 20px; } +/*list table*/ +.lt_table { + width: 100%; + border-bottom : 1px solid #aaaaaa; +} +.lt_table th { + font-weight:bold; + border-bottom : 1px solid #aaaaaa; + color : #555555; +} +.lt_table td { + white-space: pre-wrap; +} diff --git a/src/nhttpd/web/Y_Menue.yhtm b/src/nhttpd/web/Y_Menue.yhtm index 2db143c43..88ef359a8 100644 --- a/src/nhttpd/web/Y_Menue.yhtm +++ b/src/nhttpd/web/Y_Menue.yhtm @@ -1,6 +1,9 @@ -{=var-set:cancache=true=} +{=global-var-set:boxtype={=ini-get:/var/tuxbox/config/nhttpd.conf;Box.type;coolstream=}=} +{=global-var-set:alpha=true=} {=include-block:Y_Blocks.txt;head=} +<script type="text/javascript" src="/prototype.js"></script> <script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript" src="/Y_yweb.js"></script> <script type="text/javascript"> //<![CDATA[ /*Indicator*/ @@ -8,21 +11,18 @@ var g_i_active = false; var g_i_counter = 0; var g_i_rec_state = new Array("&nbsp;&nbsp;&nbsp;REC&nbsp;&nbsp;&nbsp;", "&nbsp;&nbsp;(REC)&nbsp;&nbsp;", " ((REC)) ", "(((REC)))"); var g_i_recording = false; -function i_state_check() -{ +function i_state_check(){ var res = ""; //var res = loadSyncURL("/control/setmode?status"); g_i_recording = (res.search(/on/)!=-1); } -function i_state_view() -{ +function i_state_view(){ if(g_i_recording) document.getElementById('state').innerHTML = g_i_rec_state[g_i_active %4]; else document.getElementById('state').innerHTML = ""; } -function i_clock() -{ +function i_clock(){ now = new Date(); var hour = now.getHours(); var min = now.getMinutes(); @@ -32,68 +32,100 @@ function i_clock() min = "0" + min; document.getElementById('clock').innerHTML = hour + ":" + min; } -function i_interval() -{ +function i_interval(){ if(g_i_active<12) - g_i_active++; - else - { + g_i_active++; + else{ g_i_active=0; i_clock(); i_state_check(); } i_state_view(); } -function i_start() -{ +function i_start(){ g_i_counter = 0; i_clock(); g_i_active = window.setInterval('i_interval()', 1000); + var mainmenu=ext.select_menu('main'); + mainmenu.each(function(e){ + var el=new Element('li').update( + new Element('a', {'class':'y_menu_prim_item', 'target':'base', + 'title': e.get('desc'), + 'href': e.get('file') + }).update(e.get('menuitem')) + ); + $('menu_prim').insert({'bottom':el}); + }); } -function i_stop() -{ +function i_stop(){ window.clearInterval(g_i_active); } +/* frame navigation */ +function nav_prim(_prim){ + top.top_main.base.location.href="Y_Dyn_Pages.yhtm?page=frame_"+_prim; +} +function nav_work(_work){ + top.top_main.base.work.location.href=_work; +} +var g_work=""; +function _nav_work(){ + top.top_main.base.work.location.href=g_work; +} +function nav(_prim, _work){ + g_work=_work; + nav_prim(_prim); + window.setTimeout("_nav_work()",300); +} +function vlc() { + var vlc_url = loadSyncURL("/control/build_live_url?vlc_link=true"); + window.open("/tmp/vlc.m3u?"+Math.random(),"_blank"); +} //]]> </script> +<style> +#prim{ + background: url(/images/tux-yweb.gif) no-repeat left top; + height:38px; +} +</style> </head> +{=var-set:alt_httpd={=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.override_directory;/var/httpd=}=} +{=var-set:vf={=if-file-exists:{=var-get:alt_httpd=}/Y_Version.txt~{=var-get:alt_httpd=}/Y_Version.txt~Y_Version.txt=}=} <body> <div class="y_menu_prim_box"> - <div class="y_menu_prim_box_head"><h2>&nbsp;</h2></div> + <div class="y_menu_prim_box_head"><div class="y_menu_prim_box_head_h2"></div></div> <div class="y_menu_prim_box_body"> <table border="0" width="100%"> <tr> - <td width="50" align="center" valign="middle"><a href="http://wiki.godofgta.de/Neutrino:yWeb" target="_blank"><img src="images/tux.gif" title="Tuxbox Wiki" alt="Tuxbox Wiki"/></a></td> - <td width="100"> - <span style="font-weight: bold;font-size: 10pt;">yWeb</span> - <br/> - <span style="font-size: 8pt;">Version {=ini-get:Y_Version.txt;version=}</span> + <td width="150" id="prim"> + <span style="font-size: 8pt;position:relative;left:45px;top:10px;">{=L:version=} {=ini-get:Y_Version.txt;version=}</span> </td> <td> <ul id="menu_prim" class="y_menu_prim"> - <li><a class="y_menu_prim_item" target="base" href="Y_Dyn_Pages.yhtm?page=frame_boxcontrol" - title="Boxcontrol &#038; Bouquets">Boxcontrol</a></li> - <li><a class="y_menu_prim_item" target="base" href="Y_Dyn_Pages.yhtm?page=frame_live" - title="LiveView, Timer Sync &amp; Settings">Live/Timer</a></li> - <li><a class="y_menu_prim_item" target="base" href="Y_Dyn_Pages.yhtm?page=frame_tools" - title="Mounts, WOL, Expert Tools">Tools</a></li> - <li><a class="y_menu_prim_item" target="base" href="Y_Dyn_Pages.yhtm?page=frame_settings" - title="Settings for Box, Web, Plugins ...">Settings</a></li> - <li><a class="y_menu_prim_item" target="base" href="Y_Dyn_Pages.yhtm?page=frame_ext" - title="User Extentions ...">Extentions</a></li> - <li><a class="y_menu_prim_item" target="base" href="Y_Dyn_Pages.yhtm?page=frame_info" - title="Information about yWeb, Updates">Info</a></li> + <li><a target="base" href="Y_Dyn_Pages.yhtm?page=frame_boxcontrol" + title="{=L:boxcontrol_desc=}">{=L:boxcontrol=}</a></li> + <li><a target="base" href="Y_Dyn_Pages.yhtm?page=frame_live" + title="{=L:live_desc=}">{=L:live=}</a></li> + <li><a target="base" href="Y_Dyn_Pages.yhtm?page=frame_tools" + title="{=L:tools_desc=}">{=L:tools=}</a></li> + <li><a target="base" href="Y_Dyn_Pages.yhtm?page=frame_settings" + title="{=L:settings_desc=}">{=L:settings=}</a></li> + <li><a target="base" href="Y_Dyn_Pages.yhtm?page=frame_ext" + title="{=L:extensions_desc=}">{=L:extensions=}</a></li> + <li><a target="base" href="Y_Dyn_Pages.yhtm?page=frame_info" + title="{=L:info_desc=}">{=L:info=}</a></li> </ul> </td> <td> - <a target="base" href="Y_Dyn_Pages.yhtm?page=frame_live_directtv" title="LiveTV"><img src="/images/live.gif"></a>&nbsp; - <a target="base" href="Y_Dyn_Pages.yhtm?page=frame_live&dostart=live_tv_popup" title="LiveTV Popup"><img src="/images/live_popup.gif"></a>&nbsp; - <a href="/control/build_live_url?vlc_link=true" title="Stream to VLC Client"><img src="/images/vlc.gif"></a> + <a target="base" href="Y_Dyn_Pages.yhtm?page=frame_live_directtv" title={=L:live_tv_desc=}><img src="/images/live.gif"></a>&nbsp; + <a target="base" href="Y_Dyn_Pages.yhtm?page=frame_live&dostart=live_tv_popup" title="{=L:live_tv_popup_desc=}"><img src="/images/live_popup.gif"></a>&nbsp; + <a target="base" href="Y_Tools_remote_osd.yhtm?full=1" title="{=L:remote_full_desc=}"><img src="/images/fb.png"></a>&nbsp; + <a href="javascript:vlc()" title="{=L:stream_to_vlc_client_desc=}"><img src="/images/vlc.gif"></a> </td> <td align="right"> <span id="state" style="color : red;font-family: Courier New, Courier, monospace;">&nbsp;</span> <span id="box_name" {=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;yweb_box_color=}~~style="color : #{=ini-get:/var/tuxbox/config/Y-Web.conf;yweb_box_color=};"=}> - <b>{=ini-get:/var/tuxbox/config/Y-Web.conf;yweb_box_name=}</b></span> + {=ini-get:/var/tuxbox/config/Y-Web.conf;yweb_box_name=}</span> <span id="clock">00:00</span> </td> </tr> diff --git a/src/nhttpd/web/Y_Settings_Backup.yhtm b/src/nhttpd/web/Y_Settings_Backup.yhtm index 9f2b61f44..02f908e1d 100644 --- a/src/nhttpd/web/Y_Settings_Backup.yhtm +++ b/src/nhttpd/web/Y_Settings_Backup.yhtm @@ -4,7 +4,7 @@ <script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript"> //<![CDATA[ -function do_submit() +function do_submit() { if(document.f.filename.value != "") { @@ -36,8 +36,12 @@ function do_backup2() {=var-set:wait_text=Settings=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Settings#Backup_.26_Restore=}{=var-set:menu=Backup &amp; Restore=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Settings-Backup_Restore=}{=var-set:menu=Backup &amp; Restore=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> + <p><div style="border: 1px solid #cccccc;margin-top:20px"> + <img src="/images/cross.png">&nbsp;<span><font size="2" color="Red"><b>Achtung</b>&nbsp;</font>Backup &amp; Restore ist nur bei einem gleichen Image mit gleichem Stand sinnvoll. + </span></div></p> + <br /> <table class="y_invisible_table" cellspacing="0" width="100%"> <tr><td class="y_form_header">Backup</td></tr> <tr> @@ -47,7 +51,7 @@ function do_backup2() </div> </td> </tr> - <tr><td class="y_form_header">Restore (Warning: box will REBOOT after restore!)</td></tr> + <tr><td class="y_form_header">Restore</td></tr> <tr> <td> <form name="f" method="post" enctype="multipart/form-data" action="/control/exec?Y_Tools&amp;settings_backup_restore&amp;restore"> diff --git a/src/nhttpd/web/Y_Settings_Live.yhtm b/src/nhttpd/web/Y_Settings_Live.yhtm index df51355f3..bb9126cc4 100644 --- a/src/nhttpd/web/Y_Settings_Live.yhtm +++ b/src/nhttpd/web/Y_Settings_Live.yhtm @@ -11,15 +11,15 @@ function do_refresh_liveview() </script> </head> <body> -{=var-set:wait_text=Save.=}{=include-block:Y_Blocks.txt;snip_wait=} - <form name="f" action="/y/cgi"> - <table border="0" class="y_live_table" cellspacing="0" width="100%"> +{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=} + <form class="y_form" name="f" action="/y/cgi"> + <table border="0" cellspacing="0"> <tr><td class="y_form_header" colspan="2"><br/>VLC Settings (IE &amp; Mozilla >= 0.8.6.1)</td></tr> <tr> <td>Deinterlace</td> <td> - <input type="radio" name="deinterlace" value="false" title="deinterlace: off"/>Off&nbsp; - <input type="radio" name="deinterlace" value="true" title="deinterlace: on"/>On + <input type="radio" name="deinterlace" value="false" title="deinterlace: off"/>AUS&nbsp; + <input type="radio" name="deinterlace" value="true" title="deinterlace: on"/>AN </td> </tr> <tr> @@ -29,19 +29,33 @@ function do_refresh_liveview() <tr> <td>UDP as default</td> <td> - <input type="radio" name="udp" value="false" title="udp: off"/>Off&nbsp; - <input type="radio" name="udp" value="true" title="udp: on"/>On + <input type="radio" name="udp" value="false" title="udp: off"/>AUS&nbsp; + <input type="radio" name="udp" value="true" title="udp: on"/>AN </td> - </tr> </table> + </tr> + <tr> + <td>Slave Box IP (2. dbox)</td> + <td><input type="text" name="slavebox" size="15" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;slavebox=}" title="enter IP (xxx.xxx.xxx.xxx) of slave-box"/></td> + </tr> + <tr> + <td>VLC Aufnahmepfad</td> + <td><input type="text" name="vlc_record_path" size="17" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;vlc_record_path=}" title="VLC record path for LiveView direct recording."/></td> + </tr> +<!--- <tr> + <td>VLC Aufnahmetyp</td> + <td><input type="text" name="vlc_record_mux_type" size="17" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;vlc_record_mux_type=}" title="VLC record mux type"/></td> + </tr> +--> + </table> <br/> <input type="hidden" name="tmpl" value="Y_Settings_Live.yhtm"/> <input type="hidden" name="execute" value="include-block:Y_Blocks.txt;Live_save_settings;nix"/> - <input type="button" value="Save ..." title="submit and save values" onclick="do_submit()"/> - <input type="button" value="Refresh LiveView" title="Refresh LiveView" onclick="do_refresh_liveview()"/> + <button type="button" ytype="save" title="submit and save values" onclick="do_submit()">Speichern</button> + <button type="button" ytype="refresh" title="Refresh LiveView" onclick="do_refresh_liveview()">Refresh LiveView</button> </form> <script type="text/javascript"> //<![CDATA[ -function form_init() +function form_init() { val = "{=ini-get:/var/tuxbox/config/Y-Web.conf;deinterlace;false=}"; if(val == "true") diff --git a/src/nhttpd/web/Y_Settings_Menue.yhtm b/src/nhttpd/web/Y_Settings_Menue.yhtm index 68f99c2d6..395f518df 100644 --- a/src/nhttpd/web/Y_Settings_Menue.yhtm +++ b/src/nhttpd/web/Y_Settings_Menue.yhtm @@ -1,69 +1,144 @@ {=var-set:cancache=yPConf=} {=include-block:Y_Blocks.txt;head=} +<script type="text/javascript" src="/prototype.js"></script> +<script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript" src="/Y_yweb.js"></script> +<script type="text/javascript"> +function init(){ + var menu=ext.select_menu('settings_general'); + menu.each(function(e){ + var el=new Element('li').update( + new Element('a', {'target':'work', + 'title': e.get('desc'), + 'href': e.get('file') + }).update("-"+e.get('menuitem')) + ); + $('secmenu_general').insert({'bottom':el}); + }); + var menu=ext.select_menu('settings_neutrino'); + menu.each(function(e){ + var el=new Element('li').update( + new Element('a', {'target':'work', + 'title': e.get('desc'), + 'href': e.get('file') + }).update("-"+e.get('menuitem')) + ); + $('secmenu_neutrino').insert({'bottom':el}); + }); + var menu=ext.select_menu('settings_plugins'); + menu.each(function(e){ + var el=new Element('li').update( + new Element('a', {'target':'work', + 'title': e.get('desc'), + 'href': e.get('file') + }).update("-"+e.get('menuitem')) + ); + $('secmenu_plugins').insert({'bottom':el}); + }); +} +</script> </head> -<body> +<body onload="init()"> {=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} <div class="y_menu_sec_box"> - <div class="y_menu_sec_box_head"><h2>Settings</h2></div> + <div class="y_menu_sec_box_head"><h2>{=L:settings=}</h2></div> <div class="y_menu_sec_box_body"> - <div class="y_menu_sec_section">General</div> + <div class="y_menu_sec_section">{=L:general=}</div> <div class="y_menu_sec"> - <ul> + <ul id="secmenu_general"> {=if-empty:{=var-get:management=}~ - <li class="disabled" title="settings for yWeb itselfs (restricted by ManagementIP)">yWeb</li> - <li class="disabled" title="settings for Web Server daemon (restricted by ManagementIP)">WebServer</li> -<!--dbox2 only <li class="disabled" title="download or upload ucodes (restricted by ManagementIP)">Ucodes</li> dbox2 only--> - <li class="disabled" title="download or upload Bouquetlist, Channellist, ... (restricted by ManagementIP)">Zapit</li> - <li class="disabled" title="backup or upload boot logos (restricted by ManagementIP)">Boot Logo</li> - <li class="disabled" title="SyncTimer Settings (restricted by ManagementIP)">Timer Settings</a></li> + <li class="disabled" title="{=L:restriced_by_management_ip=}">yWeb</li> + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:webserver=}</li> + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:zapit=}</li> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:ucodes=}</li> + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:boot_logo=}</li> + ~=} + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=timer_settings=}</a></li> ~ - <li><a title="settings for yWeb itselfs" target="work" href="Y_Settings_yWeb.yhtm">yWeb</a></li> - <li><a title="settings for Web Server daemon" target="work" href="Y_Settings_nhttpd.yhtm">WebServer</a></li> -<!--dbox2 only <li><a title="download or upload ucodes" target="work" href="Y_Settings_ucodes.yhtm">Ucodes</a></li> dbox2 only--> - <li><a title="download or upload Bouquetlist, Channellist, ..." target="work" href="Y_Settings_zapit.yhtm">Zapit</a></li> -<!--dbox2 only <li><a title="backup or upload boot logos" target="work" href="Y_Tools_Bootlogo.yhtm">Boot Logo</a></li> dbox2 only--> - <li><a title="backup or restore settings" target="work" href="Y_Settings_Backup.yhtm">Backup &amp; Restore</a></li> - <li><a title="SyncTimer Settings" target="work" href="Y_Settings_Timer.yhtm">Timer Settings</a></li> + <li><a target="work" href="Y_Settings_yWeb.yhtm">yWeb</a></li> + <li><a target="work" href="Y_Settings_nhttpd.yhtm">{=L:webserver=}</a></li> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <li><a target="work" href="Y_Settings_zapit.yhtm">{=L:zapit=}</a></li> + <li><a target="work" href="Y_Settings_ucodes.yhtm">{=L:ucodes=}</a></li> + <li><a target="work" href="Y_Tools_Bootlogo.yhtm">{=L:boot_logo=}</a></li> + ~=} + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <li><a target="work" href="Y_Settings_Backup.yhtm">{=L:backup_restore=}</a></li> + ~=} + <li><a target="work" href="Y_Settings_Timer.yhtm">{=timer_settings=}</a></li> =} <!--<li><a title="change layout skin" target="work" href="Y_Settings_Skin.yhtm">Skins</a></li>--> </ul> </div> <div class="y_menu_sec_section">Neutrino</div> <div class="y_menu_sec"> - <ul> + <ul id="secmenu_neutrino"> {=if-empty:{=var-get:management=}~ - <li class="disabled" title="Bouquet Editor (restricted by ManagementIP)">Bouquet Editor</a></li> - <li class="disabled" title="Parental settings (restricted by ManagementIP)">Parental</a></li> - <li class="disabled" title="Recording settings (restricted by ManagementIP)">Recording</a></li> - <li class="disabled" title="Movieplayer settings (restricted by ManagementIP)">Movieplayer</a></li> - <li class="disabled" title="Audioplayer settings (restricted by ManagementIP)">Audioplayer</a></li> - <li class="disabled" title="Pictureviewer settings (restricted by ManagementIP)">Pictureviewer</a></li> - <li class="disabled" title="boot settings (restricted by ManagementIP)">Boot options</a></li> - <li class="disabled" title="rest of settings (restricted by ManagementIP)">Misc</a></li> + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:bouquet_editor=}</a></li> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:video_audio=}</a></li> + ~=} + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:parental=}</a></li> + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:recording=}</a></li> + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:direct_recording=}</a></li> + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:audio_player=}</a></li> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:esound_server=}</a></li> + ~=} + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:movieplayer=}</a></li> + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:pictureviewer=}</a></li> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:lcd_display=}</a></li> + ~=} + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:key_settings=}</a></li> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:boot_options=}</a></li> + ~=} + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:others=}</a></li> + <li class="disabled" title="{=L:restriced_by_management_ip=}">{=L:peronalization=}</li> ~ - - <li><a title="Bouquet Editor" target="work" href="Y_Boxcontrol_Bouquet_Editor_Main.yhtm">Bouquet Editor</a></li> - <li><a title="Parental settings" target="work" href="Y_Settings_neutrino_forms.yhtm?form=neutrino_form-data_parental">Parental</a></li> - <li><a title="Recording settings" target="work" href="Y_Settings_neutrino_forms.yhtm?form=neutrino_form-data_record">Recording</a></li> - <li><a title="Direct Recording" target="work" href="Y_Settings_neutrino_forms.yhtm?form=neutrino_form-data_direct_recording">Direct Recording</a></li> - <li><a title="Movieplayer settings" target="work" href="Y_Settings_neutrino_forms.yhtm?form=neutrino_form-data_movieplayer">Movieplayer</a></li> - <li><a title="Audioplayer settings" target="work" href="Y_Settings_neutrino_forms.yhtm?form=neutrino_form-data_audioplayer">Audioplayer</a></li> - <li><a title="Pictureviewer settings" target="work" href="Y_Settings_neutrino_forms.yhtm?form=neutrino_form-data_pictureviewer">Pictureviewer</a></li> -<!--dbox2 only <li><a title="boot settings" target="work" href="Y_Settings_neutrino_forms.yhtm?form=neutrino_form-data_bootoptions">Boot options</a></li> dbox2 only--> - <li><a title="rest of settings" target="work" href="Y_Settings_neutrino_forms.yhtm?form=neutrino_form-data_diverse">Misc</a></li> - =} - </ul> - </div> - <div class="y_menu_sec_section">Plugins</div> - <div class="y_menu_sec"> - <ul> - {=if-empty:{=var-get:management=}~ - <li class="disabled" title="configure VNC-Plugin (restricted by ManagementIP)">VNC</li> - ~ - <li><a title="configure VNC-Plugin" target="work" href="Y_Settings_VNC.yhtm">VNC</a></li> + <li><a target="work" href="Y_Boxcontrol_Bouquet_Editor_Main.yhtm">{=L:bouquet_editor=}</a></li> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <li><a target="work" href="Y_Settings_video_audio.yhtm">{=L:video_audio=}</a></li> + ~=} + <li><a target="work" href="Y_Settings_neutrino_forms.yhtm?form=neutrino_form-data_parental">{=L:parental=}</a></li> + <li><a target="work" href="Y_Settings_neutrino_forms.yhtm?form=neutrino_form-data_record">{=L:recording=}</a></li> + <li><a target="work" href="Y_Settings_neutrino_forms.yhtm?form=neutrino_form-data_direct_recording">{=L:direct_recording=}</a></li> + <li><a target="work" href="Y_Settings_neutrino_forms.yhtm?form=neutrino_form-data_audioplayer">{=L:audio_player=}</a></li> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <li><a target="work" href="Y_Settings_neutrino_forms.yhtm?form=neutrino_form-data_esound">{=L:esound_server=}</a></li> + ~=} + <li><a target="work" href="Y_Settings_neutrino_forms.yhtm?form=neutrino_form-data_movieplayer">{=L:movieplayer=}</a></li> + <li><a target="work" href="Y_Settings_neutrino_forms.yhtm?form=neutrino_form-data_pictureviewer">{=L:pictureviewer=}</a></li> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <li><a target="work" href="Y_Settings_lcd.yhtm">{=L:lcd_display=}</a></li> + ~=} + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <li><a target="work" href="Y_Settings_buttons.yhtm">{=L:key_settings=}</a></li> + ~=} + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <li><a target="work" href="Y_Settings_neutrino_forms.yhtm?form=neutrino_form-data_bootoptions">{=L:boot_options=}</a></li> + ~=} + <li><a target="work" href="Y_Settings_neutrino_forms.yhtm?form=neutrino_form-data_diverse">{=L:others=}</a></li> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <li><a target="work" href="Y_Settings_personalize.yhtm">{=L:peronalization=}</a></li> + ~=} =} </ul> </div> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <div class="y_menu_sec_section">{=L:plugins=}</div> + <div class="y_menu_sec"> + <ul id="secmenu_plugins"> + {=if-empty:{=var-get:management=}~ + <li class="disabled" title="{=L:restriced_by_management_ip=}">VNC</li> + ~ + <li><a target="work" href="Y_Settings_VNC.yhtm">VNC</a></li> + =} + </ul> + </div> + ~=} </div> </div> diff --git a/src/nhttpd/web/Y_Settings_Timer.yhtm b/src/nhttpd/web/Y_Settings_Timer.yhtm index d0394d476..52b04b8c9 100644 --- a/src/nhttpd/web/Y_Settings_Timer.yhtm +++ b/src/nhttpd/web/Y_Settings_Timer.yhtm @@ -14,18 +14,18 @@ function do_submit() </script> </head> <body> -{=var-set:wait_text=Save.=}{=include-block:Y_Blocks.txt;snip_wait=} +{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Settings#Timer_Settings=}{=var-set:menu=Timer Settings=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Settings-Timer_Settings=}{=var-set:menu=Timer Settings=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> - <form name="f" accept-charset="UTF-8" action="/y/cgi"> - <table border="0" class="y_form_table" cellspacing="0" cellpadding="0"> + <form name="f" class="y_form" accept-charset="UTF-8" action="/y/cgi?execute=include-block:Y_Blocks.txt;timer_save_settings;nix" method="POST"> + <table border="0" width="100%"> <tr> - <td colspan="2" ><strong>tvinfo.de</strong></td> + <td colspan="2" class="y_form_header">tvinfo.de</td> </tr> <tr> - <td>Username</td> + <td>Benutzername</td> <td><input type="text" name="tvinfo_username" size="15" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;tvinfo_username=}" title="username"/></td> </tr> <tr> @@ -33,14 +33,19 @@ function do_submit() <td><input type="password" name="tvinfo_password" size="15" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;tvinfo_password=}" title="password"/><br/><br/></td> </tr> <tr> - <td colspan="2" style="border-top: 1px solid #6D96A9;"><strong>klack.de</strong><br/>(&#038; will be converted to &quot;;&quot; on save)</td> + <td colspan="2" class="y_form_header">klack.de (V2)</td> </tr> <tr> <td>personal RSS TV-Planer URL</td> - <td><input type="text" name="klack_url" size="60" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;klack_url=}" title="Klack.de RSS TV-Planer URL"/><br/><br/></td> + <td><input type="text" name="klack_url" size="60" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;klack_url=}" title="Klack.de RSS TV-Planer URL"/><br/> + (&#038; will be converted to &quot;;&quot; on save)</br></td> </tr> <tr> - <td colspan="2" style="border-top: 1px solid #6D96A9;"><strong>Sender name</strong></td> + <td>Security Code</td> + <td><input type="password" name="klack_securitycode" size="15" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;klack_securitycode=}" title="your klack security code to get your data without login"/><br/><br/></td> + </tr> + <tr> + <td colspan="2" class="y_form_header">Sendernamen</td> </tr> <tr> <td>&nbsp;</td> @@ -49,8 +54,7 @@ function do_submit() </table> <br/> <input type="hidden" name="tmpl" value="Y_Settings_Timer.yhtm"/> - <input type="hidden" name="execute" value="include-block:Y_Blocks.txt;timer_save_settings;nix"/> - <input type="button" value="Save ..." title="submit and save values" onclick="do_submit()"/> + <button type="button" ytype="save" title="submit and save values" onclick="do_submit()">Speichern</button> </form> </div> </div> diff --git a/src/nhttpd/web/Y_Settings_VNC.yhtm b/src/nhttpd/web/Y_Settings_VNC.yhtm index ba0cf69ff..e99eaa92b 100644 --- a/src/nhttpd/web/Y_Settings_VNC.yhtm +++ b/src/nhttpd/web/Y_Settings_VNC.yhtm @@ -2,7 +2,7 @@ <script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript"> //<![CDATA[ -function form_init() +function form_init() { var val = {=ini-get:/var/tuxbox/config/vnc.conf;scale;1=}; document.f.scale[val-1].selected = true; @@ -16,10 +16,10 @@ function do_submit() </script> </head> <body onload="form_init()"> -{=var-set:wait_text=Save.=}{=include-block:Y_Blocks.txt;snip_wait=} +{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Settings#VNC=}{=var-set:menu=VNC=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Settings-VNC=}{=var-set:menu=VNC=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <form name="f" action=""> <table border="0"> @@ -36,7 +36,7 @@ function do_submit() <td><input type="password" name="password" size="20" value="{=ini-get:/var/tuxbox/config/vnc.conf;passwd=}"/></td> </tr> <tr> - <td>Scaling</td> + <td>Skalierung</td> <td> <select name="scale" title="enter scale for Screen"> <option value="1">1</option> @@ -50,7 +50,7 @@ function do_submit() <br/> <input type="hidden" name="tmpl" value="Y_Settings_nhttpd.yhtm"/> <input type="hidden" name="execute" value="include-block:Y_Blocks.txt;vnc_save_settings;nix"/> - <input type="button" value="Save ..." title="submit and save values" onclick="do_submit()"/> + <button type="button" ytype="save" title="submit and save values" onclick="do_submit()">Speichern</button> </form> </div> </div> diff --git a/src/nhttpd/web/Y_Settings_automount.yhtm b/src/nhttpd/web/Y_Settings_automount.yhtm index f19396b13..ca176cf38 100644 --- a/src/nhttpd/web/Y_Settings_automount.yhtm +++ b/src/nhttpd/web/Y_Settings_automount.yhtm @@ -31,13 +31,13 @@ function automount_edit() { var _sub_ops = _ops_list[i].split("="); if(_sub_ops.length > 1) - + switch (_sub_ops[0]) { case "user": document.f.username.value = _sub_ops[1]; break; - + case "password": document.f.password.value = _sub_ops[1]; break; @@ -47,7 +47,7 @@ function automount_edit() if(_options != "") _options += ","; _options += _ops_list[i]; - } + } } document.f.opt1.value = _options; var Ausdruck = /\/\/(.*)\/(.*).*/; @@ -61,7 +61,7 @@ function automount_edit() break; } } -function form_init() +function form_init() { obj_set_radio_value("type", "nfs"); {=if-equal:{=cmd=}~edit~ @@ -107,7 +107,7 @@ function do_save2() } show_waitbox(false); mstr = mstr.replace(/=/gi,",,"); - + var _url ="/control/exec?Y_Tools&automount_setline&/var/etc/auto.net&"+mountname+"&"+mstr; var res = loadSyncURL(_url); window.document.location.href="/Y_Settings_automount_liste.yhtm"; @@ -130,10 +130,10 @@ function change_type() </script> </head> <body onLoad="form_init()"> -{=var-set:wait_text=Save.=}{=include-block:Y_Blocks.txt;snip_wait=} +{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"> - <div class="work_box_head_h2">{=var-set:help_url=Neutrino:yWeb:Tools#AutoMount=}{=var-set:menu=AutoMount=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + <div class="work_box_head_h2">{=var-set:help_url=Help-Tools-AutoMount=}{=var-set:menu=AutoMount=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <form name="f" action="/y/cgi"> <input type="hidden" name="nr" value="{=R1=}"/> @@ -141,7 +141,7 @@ function change_type() <tr> <td>Mountname</td> <td><input type="text" name="mountname" size="20" value="" {=if-equal:{=cmd=}~add~~disabled="disabled"=}/></td> - </tr> + </tr> <tr> <td>Typ</td> <td> @@ -156,25 +156,25 @@ function change_type() <td><input type="text" name="ip" size="20" value=""/></td> </tr> <tr> - <td>Directory</td> + <td>Verzeichnis</td> <td><input type="text" name="dir" size="30" value="" title="remote directory"/></td> </tr> <tr> - <td>Option</td> + <td>Optionen</td> <td><input type="text" name="opt1" size="30" value="" title="mount options 1"/></td> </tr> <tr id="vusername" style="visibility:hidden"> - <td>Username</td> + <td>Benutzername</td> <td><input type="text" name="username" size="30" value="" title="username"/></td> </tr> <tr id="vpassword" style="visibility:hidden"> - <td>Password</td> + <td>Passwort</td> <td><input type="password" name="password" size="30" value="" title="password"/></td> </tr> </table> <br/> - <input type="button" value="Save ..." title="submit and save values" onClick="do_save()"/> - <input type="button" value="Cansel" title="cancel" name="abort" onClick='window.document.location.href="/Y_Settings_automount_liste.yhtm"'/> + <button type="button" ytype="save" title="submit and save values" onClick="do_save()">Speichern</button> + <button type="button" ytype="cancel" title="cancel" name="abort" onClick='window.document.location.href="/Y_Settings_automount_liste.yhtm"'>Abbrechen</button> </form> </div> </div> diff --git a/src/nhttpd/web/Y_Settings_automount_liste.yhtm b/src/nhttpd/web/Y_Settings_automount_liste.yhtm index 92c860bf0..51a3b72a9 100644 --- a/src/nhttpd/web/Y_Settings_automount_liste.yhtm +++ b/src/nhttpd/web/Y_Settings_automount_liste.yhtm @@ -36,7 +36,7 @@ function do_delete() {=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"> - <div class="work_box_head_h2">{=var-set:help_url=Neutrino:yWeb:Tools#AutoMount=}{=var-set:menu=AutoMount=}{=include-block:Y_Blocks.txt;work_menu=}</div> + <div class="work_box_head_h2">{=var-set:help_url=Help-Tools-AutoMount=}{=var-set:menu=AutoMount=}{=include-block:Y_Blocks.txt;work_menu=}</div> </div> <div class="work_box_body"> <form action="/y/cgi" name="f" id="f"> @@ -44,9 +44,9 @@ function do_delete() <input type="hidden" name="tmpl" value="Y_Settings_automount.yhtm"/> <input type="hidden" name="execute" value=""/> <input type="hidden" name="cmd" value=""/> - <input type="button" value="Edit" title="edit mount settings" onclick="do_edit()"/> - <input type="button" value="Add" title="add new mount" onclick="do_add()"/> - <input type="button" value="Del" title="delete mount" onclick="do_delete()"/> + <button type="button" ytype="edit" title="edit mount settings" onclick="do_edit()">&auml;ndern</button> + <button type="button" ytype="add" title="add new mount" onclick="do_add()">hinzuf&uuml;gen</button> + <button type="button" ytype="delete" title="delete mount" onclick="do_delete()">l&ouml;schen</button> </form> </div> </div> diff --git a/src/nhttpd/web/Y_Settings_buttons.yhtm b/src/nhttpd/web/Y_Settings_buttons.yhtm new file mode 100644 index 000000000..52c5bb55e --- /dev/null +++ b/src/nhttpd/web/Y_Settings_buttons.yhtm @@ -0,0 +1,341 @@ +{=include-block:Y_Blocks.txt;management_check_top=} +{=include-block:Y_Blocks.txt;head=} +<style type="text/css"> +/*<![CDATA[*/ +.alink { + text-decoration: underline; +} +input[type="text"],select { + font-weight: bold; + background-color: #FF9; + width: 145px; +} +.butnokey { + visibility: hidden; + vertical-align: middle; + font-size: 9px; +} +/*]]>*/ +</style> +<script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript"> +//<![CDATA[ +function do_init() +{ + var val = ""; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;bouquetlist_mode;0~open=}"; + document.f.bouquetlist_mode.selectedIndex = val; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_bouquet_down;105~cache=}"; + document.f.key_bouquet_down.value = itoKey(val); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_bouquet_up;106~cache=}"; + document.f.key_bouquet_up.value = itoKey(val); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_addrecord;398~cache=}"; + document.f.key_channelList_addrecord.value = itoKey(val); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_addremind;400~cache=}"; + document.f.key_channelList_addremind.value = itoKey(val); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_cancel;102~cache=}"; + document.f.key_channelList_cancel.value = itoKey(val); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_pagedown;115~cache=}"; + document.f.key_channelList_pagedown.value = itoKey(val); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_pageup;114~cache=}"; + document.f.key_channelList_pageup.value = itoKey(val); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_reload;141~cache=}"; + document.f.key_channelList_reload.value = itoKey(val); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_search;399~cache=}"; + document.f.key_channelList_search.value = itoKey(val); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_sort;401~cache=}"; + document.f.key_channelList_sort.value = itoKey(val); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_lastchannel;11~cache=}"; + document.f.key_lastchannel.value = itoKey(val); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_quickzap_down;108~cache=}"; + document.f.key_quickzap_down.value = itoKey(val); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_quickzap_up;103~cache=}"; + document.f.key_quickzap_up.value = itoKey(val); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_subchannel_down;105~cache=}"; + document.f.key_subchannel_down.value = itoKey(val); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_subchannel_toggle;11~cache=}"; + document.f.key_subchannel_toggle.value = itoKey(val); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_subchannel_up;106~cache=}"; + document.f.key_subchannel_up.value = itoKey(val); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_tvradio_mode;-2~cache=}"; + document.f.key_tvradio_mode.value = itoKey(val); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_zaphistory;102~cache=}"; + document.f.key_zaphistory.value = itoKey(val); +} +function rcsim(_key) +{ + var radioLength = document.f.but.length; + for(var i=0; i<radioLength; i++) + if(document.f.but[i].checked) { + document.getElementById('id'+(100+i)).value = _key; + break; + } +} +function setFocus() +{ + hideAll(); + var radioLength = document.f.but.length; + for(var i=0; i<radioLength; i++) + if(document.f.but[i].checked) { + document.getElementById('id'+(100+i)).focus(); + document.getElementById('id'+(200+i)).style.visibility = "visible"; + break; + } +} +function setradio(_i) +{ + hideAll(); + document.f.but[_i].checked = "checked"; + document.getElementById('id'+(200+_i)).style.visibility = "visible"; +} +function hideAll() +{ + var radioLength = document.f.but.length; + for(var t=0; t<radioLength; t++) + document.getElementById('id'+(200+t)).style.visibility = "hidden"; +} +function killkey() +{ + var radioLength = document.f.but.length; + for(var i=0; i<radioLength; i++) + if(document.f.but[i].checked) { + document.getElementById('id'+(100+i)).value = "KEY_NONE"; + break; + } +} +function keytoi(_key) +{ +var i; + switch(_key) { + case "KEY_NONE": i="-2"; break; + case "KEY_1": i="2"; break; + case "KEY_2": i="3"; break; + case "KEY_3": i="4"; break; + case "KEY_4": i="5"; break; + case "KEY_5": i="6"; break; + case "KEY_6": i="7"; break; + case "KEY_7": i="8"; break; + case "KEY_8": i="9"; break; + case "KEY_9": i="10"; break; + case "KEY_0": i="11"; break; + case "KEY_HOME": i="102"; break; + case "KEY_UP": i="103"; break; + case "KEY_LEFT": i="105"; break; + case "KEY_RIGHT": i="106"; break; + case "KEY_DOWN": i="108"; break; + case "KEY_MUTE": i="113"; break; + case "KEY_VOLUMEDOWN": i="114"; break; + case "KEY_VOLUMEUP": i="115"; break; + case "KEY_POWER": i="116"; break; + case "KEY_HELP": i="138"; break; + case "KEY_SETUP": i="141"; break; + case "KEY_OK": i="352"; break; + case "KEY_RED": i="398"; break; + case "KEY_GREEN": i="399"; break; + case "KEY_YELLOW": i="400"; break; + case "KEY_BLUE": i="401"; break; + default: i="-2"; break; + } + return i; +} +function itoKey(_val) +{ +var _key; + switch(_val) { + case "-2": _key="KEY_NONE"; break; + case "2": _key="KEY_1"; break; + case "3": _key="KEY_2"; break; + case "4": _key="KEY_3"; break; + case "5": _key="KEY_4"; break; + case "6": _key="KEY_5"; break; + case "7": _key="KEY_6"; break; + case "8": _key="KEY_7"; break; + case "9": _key="KEY_8"; break; + case "10": _key="KEY_9"; break; + case "11": _key="KEY_0"; break; + case "102": _key="KEY_HOME"; break; + case "103": _key="KEY_UP"; break; + case "105": _key="KEY_LEFT"; break; + case "106": _key="KEY_RIGHT"; break; + case "108": _key="KEY_DOWN"; break; + case "113": _key="KEY_MUTE"; break; + case "114": _key="KEY_VOLUMEDOWN"; break; + case "115": _key="KEY_VOLUMEUP"; break; + case "116": _key="KEY_POWER"; break; + case "138": _key="KEY_HELP"; break; + case "141": _key="KEY_SETUP"; break; + case "352": _key="KEY_OK"; break; + case "398": _key="KEY_RED"; break; + case "399": _key="KEY_GREEN"; break; + case "400": _key="KEY_YELLOW"; break; + case "401": _key="KEY_BLUE"; break; + default: _key="KEY_NONE"; break; + } + return _key; +} +function setDefault() +{ + document.f.bouquetlist_mode.selectedIndex = 0; + document.f.key_bouquet_down.value = "KEY_LEFT"; //105 + document.f.key_bouquet_up.value = "KEY_RIGHT"; //106 + document.f.key_channelList_addrecord.value = "KEY_RED"; //398 + document.f.key_channelList_addremind.value = "KEY_YELLOW"; //400 + document.f.key_channelList_cancel.value = "KEY_HOME"; //102 + document.f.key_channelList_pagedown.value = "KEY_VOLUMEUP"; //115 + document.f.key_channelList_pageup.value = "KEY_VOLUMEDOWN"; //114 + document.f.key_channelList_reload.value = "KEY_SETUP"; //141 + document.f.key_channelList_search.value = "KEY_GREEN"; //399 + document.f.key_channelList_sort.value = "KEY_BLUE"; //401 + document.f.key_lastchannel.value = "KEY_0"; //11 + document.f.key_quickzap_down.value = "KEY_DOWN"; //108 + document.f.key_quickzap_up.value = "KEY_UP"; //103 + document.f.key_subchannel_down.value = "KEY_LEFT"; //105 + document.f.key_subchannel_toggle.value = "KEY_0"; //11 + document.f.key_subchannel_up.value = "KEY_RIGHT"; //106 + document.f.key_tvradio_mode.value = "KEY_NONE"; //-2 + document.f.key_zaphistory.value = "KEY_HOME"; //102 +} +function do_submit() +{ + show_waitbox(true); + var radioLength = document.f.but.length; + for(var i=0; i<radioLength; i++) { + document.getElementById('id'+(100+i)).value = keytoi(document.getElementById('id'+(100+i)).value); + } + document.f.submit(); +} +//]]> +</script> +</head> +<body onload="do_init()"> +{=var-set:wait_text=Werte werden &uuml;bernommen (Save).=}{=include-block:Y_Blocks.txt;snip_wait=} +<div class="work_box"> + <div class="work_box_head"><div class="work_box_head_h2"> + {=var-set:help_url=Help-Settings-Buttons=}{=var-set:menu=Tastenbelegung=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + <div class="work_box_body"> + <form name="f" class="y_form" action=""> + <table cellspacing="0" border="0" cellpadding="2" width="100%"> + <tr> + <td width="25%">&nbsp;</td> + <td colspan="2" class="y_form_header">Modus wechsel</td> + </tr> + <tr> + <td rowspan="20">{=include-block:Y_Blocks.txt;remote=}</td> + <td><input type="radio" name="but" onclick="setFocus()" />TV-/Radio-Modus</td> + <td><input type="text" name="key_tvradio_mode" id="id100" onclick="setradio(0)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id200" value="Keine Taste" onclick="killkey()" /></td> + </tr> + <tr> + <td colspan="2" class="y_form_header">Kanalliste</td> + </tr> + <tr> + <td>&nbsp;OK-Taste f&uuml;r</td> + <td> + <select name="bouquetlist_mode" title="OK-Button for..."> + <option value="0" selected="selected">Bouquet-Kan&auml;le</option> + <option value="1">Bouquetliste</option> + <option value="2">Kanalliste</option> + </select> + </td> + </tr> + <tr> + <td><input type="radio" name="but" onclick="setFocus()" /> Seite hochbl&auml;ttern</td> + <td><input type="text" name="key_channelList_pageup" id="id101" onclick="setradio(1)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id201" onclick="killkey()" value="Keine Taste" /></td> + </tr> + <tr> + <td><input type="radio" name="but" onclick="setFocus()" /> Seite runterbl&auml;ttern</td> + <td><input type="text" name="key_channelList_pagedown" id="id102" onclick="setradio(2)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id202" onclick="killkey()" value="Keine Taste" /></td> + </tr> + <tr> + <td><input type="radio" name="but" onclick="setFocus()" /> Kanalliste schlie&szlig;en</td> + <td><input type="text" name="key_channelList_cancel" id="id103" onclick="setradio(3)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id203" onclick="killkey()" value="Keine Taste" /></td> + </tr> + <tr> + <td><input type="radio" name="but" onclick="setFocus()" /> Sortierreihenfolge &auml;ndern</td> + <td><input type="text" name="key_channelList_sort" id="id104" onclick="setradio(4)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id204" onclick="killkey()" value="Keine Taste" /></td> + </tr> + <tr> + <td><input type="radio" name="but" onclick="setFocus()" /> Stichwortsuche im EPG</td> + <td><input type="text" name="key_channelList_search" id="id105" onclick="setradio(5)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id205" onclick="killkey()" value="Keine Taste" /></td> + </tr> + <tr> + <td><input type="radio" name="but" onclick="setFocus()" /> Aufnahme-Timer hinzuf&uuml;gen</td> + <td><input type="text" name="key_channelList_addrecord" id="id106" onclick="setradio(6)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id206" onclick="killkey()" value="Keine Taste" /></td> + </tr> + <tr> + <td><input type="radio" name="but" onclick="setFocus()" /> Umschalt-Timer hinzuf&uuml;gen</td> + <td><input type="text" name="key_channelList_addremind" id="id107" onclick="setradio(7)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id207" onclick="killkey()" value="Keine Taste" /></td> + </tr> + <tr> + <td><input type="radio" name="but" onclick="setFocus()" /> EPG aktualisieren</td> + <td><input type="text" name="key_channelList_reload" id="id108" onclick="setradio(8)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id208" onclick="killkey()" value="Keine Taste" /></td> + </tr> + <tr> + <td colspan="2" class="y_form_header">Schnellumschaltung</td> + </tr> + <tr> + <td><input type="radio" name="but" onclick="setFocus()" /> Kanal hoch</td> + <td><input type="text" name="key_quickzap_up" id="id109" onclick="setradio(9)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id209" onclick="killkey()" value="Keine Taste" /></td> + </tr> + <tr> + <td><input type="radio" name="but" onclick="setFocus()" /> Kanal runter</td> + <td><input type="text" name="key_quickzap_down" id="id110" onclick="setradio(10)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id210" onclick="killkey()" value="Keine Taste" /></td> + </tr> + <tr> + <td><input type="radio" name="but" onclick="setFocus()" /> Bouquet weiter</td> + <td><input type="text" name="key_bouquet_down" id="id111" onclick="setradio(11)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id211" onclick="killkey()" value="Keine Taste" /></td> + </tr> + <tr> + <td><input type="radio" name="but" onclick="setFocus()" /> Bouquet zur&uuml;ck</td> + <td><input type="text" name="key_bouquet_up" id="id112" onclick="setradio(12)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id212" onclick="killkey()" value="Keine Taste" /></td> + </tr> + <tr> + <td><input type="radio" name="but" onclick="setFocus()" /> Unterkanal weiter</td> + <td><input type="text" name="key_subchannel_down" id="id113" onclick="setradio(13)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id213" onclick="killkey()" value="Keine Taste" /></td> + </tr> + <tr> + <td><input type="radio" name="but" onclick="setFocus()" /> Unterkanal zur&uuml;ck</td> + <td><input type="text" name="key_subchannel_up" id="id114" onclick="setradio(14)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id214" onclick="killkey()" value="Keine Taste" /></td> + </tr> + <tr> + <td><input type="radio" name="but" onclick="setFocus()" /> Unterkanal wechseln</td> + <td><input type="text" name="key_subchannel_toggle" id="id115" onclick="setradio(15)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id215" onclick="killkey()" value="Keine Taste" /></td> + </tr> + <tr> + <td><input type="radio" name="but" onclick="setFocus()" /> Zapping-History Bouquet</td> + <td><input type="text" name="key_zaphistory" id="id116" onclick="setradio(16)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id216" onclick="killkey()" value="Keine Taste" /></td> + </tr> + <tr> + <td><a href="javascript:setDefault()" class="alink">Vorbelegung benutzen</a></td> + <td><input type="radio" name="but" onclick="setFocus()" /> Letzter Kanal</td> + <td><input type="text" name="key_lastchannel" id="id117" onclick="setradio(17)" readonly="readonly" /> + &nbsp;<input type="button" class="butnokey" id="id217" onclick="killkey()" value="Keine Taste" /></td> + </tr> + </table> + <br /> + <input type="hidden" name="execute" value="include-block:Y_Blocks.txt;buttons_save_settings;nix" /> + <button type="button" ytype="save" title="submit and save values" onclick="do_submit()">Speichern</button> + &nbsp;<button type="button" ytype="refresh" onclick="dbox_reload_neutrino()">reload Neutrino</button> + &nbsp;<a href="javascript:top.top_main.prim_menu.nav('info', 'Y_Info_Help.yhtm');" class="inlink">Hilfe</a> + </form> + </div> +</div> +</body> +</html> +{=include-block:Y_Blocks.txt;management_check_bottom=} diff --git a/src/nhttpd/web/Y_Settings_lcd.yhtm b/src/nhttpd/web/Y_Settings_lcd.yhtm new file mode 100644 index 000000000..8d2ea3e3d --- /dev/null +++ b/src/nhttpd/web/Y_Settings_lcd.yhtm @@ -0,0 +1,168 @@ +{=include-block:Y_Blocks.txt;management_check_top=} +{=include-block:Y_Blocks.txt;head=} +<style type="text/css"> +/*<![CDATA[*/ + .alink { + text-decoration: underline; + } +/*]]>*/ +</style> +<script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript"> +/*<![CDATA[*/ +function do_init() +{ + var val = ""; + obj_set_radio_value('lcd_power', "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_power;1~open=}"); + obj_set_radio_value('lcd_inverse', "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_inverse;0~cache=}"); + + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_dim_time;0~cache=}"; + document.f.lcd_dim_time.value = val; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_dim_brightness;0~cache=}"; + document.f.lcd_dim_brightness.value = val; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_contrast;15~cache=}"; + document.f.lcd_contrast.value = val; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_brightness;255~cache=}"; + document.f.lcd_brightness.value = val; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_standbybrightness;170~cache=}"; + document.f.lcd_standbybrightness.value = val; + + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_epgmode;1~cache=}"; + var sel = 0; + if(val=="2") sel=1; + if(val=="3") sel=2; + if(val=="7") sel=3; + if(val=="11") sel=4; + if(val=="15") sel=5; + document.f.lcd_epgmode.selectedIndex = sel; + + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_show_volume;0~cache=}" + document.f.lcd_show_volume.value = val; +} + +function setDefault() +{ + document.f.lcd_contrast.value = 15; + document.f.lcd_brightness.value = 255; + document.f.lcd_standbybrightness.value = 170; +} + +function do_submit() +{ + show_waitbox(true); + if (document.f.lcd_contrast.value > 63) + document.f.lcd_contrast.value = 63; + else if (document.f.lcd_contrast.value < 0) + document.f.lcd_contrast.value = 0; + if (document.f.lcd_brightness.value > 255) + document.f.lcd_brightness.value = 255; + else if (document.f.lcd_brightness.value < 0) + document.f.lcd_brightness.value = 0; + if (document.f.lcd_standbybrightness.value > 255) + document.f.lcd_standbybrightness.value = 255; + else if (document.f.lcd_standbybrightness.value < 0) + document.f.lcd_standbybrightness.value = 0; + document.f.submit(); +} +/*]]>*/ +</script> +</head> +<body onload="do_init()"> +{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=} +<div class="work_box"> + <div class="work_box_head"><div class="work_box_head_h2"> + {=var-set:help_url=Help-Settings-LCD=}{=var-set:menu=LCD Einstellungen=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + <div class="work_box_body"> + <form name="f" class="y_form" action=""> + <table cellspacing="0" border="0" cellpadding="2" width="100%"> + <tr> + <td colspan="2" class="y_form_header">LCD</td> + </tr> + <tr> + <td title="lcd: off/on" width="35%">Power</td> + <td> + <input type="radio" name="lcd_power" value="0" />AUS&nbsp; + <input type="radio" name="lcd_power" value="1" />EIN + </td> + </tr> + <tr> + <td title="inverse lcd: off/on">Invertieren</td> + <td> + <input type="radio" name="lcd_inverse" value="0" />AUS&nbsp; + <input type="radio" name="lcd_inverse" value="1" />EIN + </td> + </tr> + <tr> + <td title="dimm-timeout">Dimm-Timeout</td> + <td> + <input type="text" name="lcd_dim_time" size="3" maxlength="3" /> + </td> + </tr> + <tr> + <td title="brightness after dimm-timeout">Helligkeit nach dimm-Timeout</td> + <td> + <input type="text" name="lcd_dim_brightness" size="3" maxlength="3" /> + </td> + </tr> + <tr> + <td colspan="2" class="y_form_header">Kontrast / Helligkeit</td> + </tr> + <tr> + <td title="lcd contrast 0-63">Kontrast</td> + <td> + <input type="text" name="lcd_contrast" size="3" maxlength="3" /> + </td> + </tr> + <tr> + <td title="lcd brightness normal 0-255">normale Helligkeit</td> + <td> + <input type="text" name="lcd_brightness" size="3" maxlength="3" /> + </td> + </tr> + <tr> + <td title="lcd brightness standby 0-255">Standby Helligkeit</td> + <td> + <input type="text" name="lcd_standbybrightness" size="3" maxlength="3" /> + </td> + </tr> + <tr> + <td>&nbsp;</td> + <td><a href="javascript:setDefault()" class="alink">Voreinstellung benutzen</a></td> + </tr> + <tr> + <td colspan="2" class="y_form_header">Anzeige-Modi</td> + </tr> + <tr><td>EPG-Anzeige</td> + <td> + <select name="lcd_epgmode" title="select visualisation of LCD"> + <option value="1" selected="selected">Standard (Kanal)</option> + <option value="2">Sendung</option> + <option value="3">Kanal / Sendung</option> + <option value="7">Kanal / Trennl. / Sendung</option> + <option value="11">Kanal (kurz) / Sendung</option> + <option value="15">Kanal (kurz) / Trennl. / Sendung</option> + </select> + </td> + </tr> + <tr><td>Statuszeile</td> + <td> + <select name="lcd_show_volume" title="select visualisation of LCD"> + <option value="0" selected="selected">Sendungsfortschritt</option> + <option value="1">Lautst&auml;rke</option> + <option value="2">Lautst&auml;rke / Fortschritt</option> + <option value="3">Laut. / Fort. / Audio</option> + </select> + </td> + </tr> + </table> + <br /> + <input type="hidden" name="execute" value="include-block:Y_Blocks.txt;lcd_save_settings;nix" /> + <button type="button" ytype="save" title="submit and save values" onclick="do_submit()">Speichern</button>&nbsp; + <button type="button" ytype="refresh" onclick="dbox_reload_neutrino()">reload Neutrino</button>&nbsp; + <a href="javascript:top.top_main.prim_menu.nav('info', 'Y_Info_Help.yhtm');" class="inlink">Hilfe</a> + </form> + </div> +</div> +</body> +</html> +{=include-block:Y_Blocks.txt;management_check_bottom=} diff --git a/src/nhttpd/web/Y_Settings_mount.yhtm b/src/nhttpd/web/Y_Settings_mount.yhtm index 4504d9b73..926ee0fa7 100644 --- a/src/nhttpd/web/Y_Settings_mount.yhtm +++ b/src/nhttpd/web/Y_Settings_mount.yhtm @@ -2,11 +2,11 @@ <script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript"> //<![CDATA[ -function form_init() +function form_init() { var check = {=ini-get:/var/tuxbox/config/neutrino.conf;network_nfs_type_{=R1=}=}; document.f.type[check].checked = true; - + check = {=ini-get:/var/tuxbox/config/neutrino.conf;network_nfs_automount_{=R1=}=}; document.f.automount[check].checked = true; } @@ -19,10 +19,10 @@ function do_submit() </script> </head> <body onLoad="form_init()"> -{=var-set:wait_text=Save.=}{=include-block:Y_Blocks.txt;snip_wait=} +{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"> - <div class="work_box_head_h2">{=var-set:help_url=Neutrino:yWeb:Tools#Mounts=}{=var-set:menu=Mount {=R1=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + <div class="work_box_head_h2">{=var-set:help_url=Help-Tools-Mounts=}{=var-set:menu=Mount {=R1=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <form name="f" action="/y/cgi"> <input type="hidden" name="nr" value="{=R1=}"/> @@ -40,11 +40,11 @@ function do_submit() <td><input type="text" name="ip" size="20" value="{=ini-get:/var/tuxbox/config/neutrino.conf;network_nfs_ip_{=R1=}=}"/></td> </tr> <tr> - <td>Directory</td> - <td><input type="text" name="dir" size="30" value="{=ini-get:/var/tuxbox/config/neutrino.conf;network_nfs_dir_{=R1=}=}" title="remote directory"/></td> + <td>Verzeichnis</td> + <td><input type="text" name="dir" size="30" value="{=ini-get:/var/tuxbox/config/neutrino.conf;network_nfs_dir_{=R1=}=}" title="remote directory. For CIFS do not use a leading slash."/></td> </tr> <tr> - <td>Local Directory</td> + <td>Lokales Verzeichnis</td> <td><input type="text" name="localdir" size="30" value="{=ini-get:/var/tuxbox/config/neutrino.conf;network_nfs_local_dir_{=R1=}=}" title="local directory to by mounted"/></td> </tr> <tr> @@ -52,22 +52,22 @@ function do_submit() <td><input type="text" name="mac" size="30" value="{=ini-get:/var/tuxbox/config/neutrino.conf;network_nfs_mac_{=R1=}=}"/></td> </tr> <tr> - <td>Option 1</td> + <td>Optionen 1</td> <td><input type="text" name="opt1" size="30" value="{=ini-get:/var/tuxbox/config/neutrino.conf;network_nfs_mount_options1_{=R1=}=}" title="mount options 1"/></td> </tr> <tr> - <td>Option 2</td> + <td>Optionen 2</td> <td><input type="text" name="opt2" size="30" value="{=ini-get:/var/tuxbox/config/neutrino.conf;network_nfs_mount_options2_{=R1=}=}" title="mount options 2"/></td> </tr> <tr> <td>Automount</td> <td> - <INPUT type="radio" name="automount" value="0" title="off"/>Off&nbsp; - <INPUT type="radio" name="automount" value="1" title="on"/>On + <INPUT type="radio" name="automount" value="0" title="off"/>AUS&nbsp; + <INPUT type="radio" name="automount" value="1" title="on"/>AN </td> </tr> <tr> - <td>Username</td> + <td>Benutzername</td> <td><input type="text" name="username" size="30" value="{=ini-get:/var/tuxbox/config/neutrino.conf;network_nfs_username_{=R1=}=}" title="username"/></td> </tr> <tr> @@ -78,8 +78,8 @@ function do_submit() <br/> <input type="hidden" name="tmpl" value="Y_Settings_mount_liste.yhtm"/> <input type="hidden" name="execute" value="func:mount-set-values"/> - <input type="button" value="Save ..." title="submit and save values" onClick="do_submit()"/> - <input type="button" value="Cancel" title="cancel" name="abort" onClick='window.document.location.href="/Y_Settings_mount_liste.yhtm"'/> + <button type="button" ytype="save" title="submit and save values" onClick="do_submit()">Speichern</button> + <button type="button" ytype="cancel" title="cancel" name="abort" onClick='window.document.location.href="/Y_Settings_mount_liste.yhtm"'>Abbrechen</button> </form> </div> </div> diff --git a/src/nhttpd/web/Y_Settings_mount_liste.yhtm b/src/nhttpd/web/Y_Settings_mount_liste.yhtm index 907fe9664..5670744c6 100644 --- a/src/nhttpd/web/Y_Settings_mount_liste.yhtm +++ b/src/nhttpd/web/Y_Settings_mount_liste.yhtm @@ -2,7 +2,7 @@ <script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript"> //<![CDATA[ -function do_mount() +function do_mount() { show_waitbox(true); var nr = 0; @@ -27,16 +27,16 @@ function do_edit() {=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"> - <div class="work_box_head_h2">{=var-set:help_url=Neutrino:yWeb:Tools#Mounts=}{=var-set:menu=Mount=}{=include-block:Y_Blocks.txt;work_menu=}</div> + <div class="work_box_head_h2">{=var-set:help_url=Help-Tools-Mounts=}{=var-set:menu=Mount=}{=include-block:Y_Blocks.txt;work_menu=}</div> </div> <div class="work_box_body"> <form action="/y/cgi" name="f" id="f"> {=func:mount-get-list=} <input type="hidden" name="tmpl" value="Y_Settings_mount.yhtm"/> <input type="hidden" name="execute" value=""/> - <input type="button" value="Edit ..." title="edit mount settings" onclick="do_edit()"/> - <input type="button" value="Mount" title="mount selected directory" onclick="do_mount()"/> - <input type="button" value="Unmount list" title="view unmount list" onclick='window.document.location.href="/Y_Settings_umount_liste.yhtm"'/> + <button type="button" ytype="edit" title="edit mount settings" onclick="do_edit()">&Auml;ndern</button> + <button type="button" ytype="no" title="mount selected directory" onclick="do_mount()">Mount</button> + <button type="button" ytype="no" title="view unmount list" onclick='window.document.location.href="/Y_Settings_umount_liste.yhtm"'>Unmount list</button> </form> </div> </div> diff --git a/src/nhttpd/web/Y_Settings_nhttpd.yhtm b/src/nhttpd/web/Y_Settings_nhttpd.yhtm index b8b60d0e8..30b22cbcc 100644 --- a/src/nhttpd/web/Y_Settings_nhttpd.yhtm +++ b/src/nhttpd/web/Y_Settings_nhttpd.yhtm @@ -3,18 +3,11 @@ <script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript"> //<![CDATA[ -function form_init() +function form_init() { - var val = "{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_auth.authenticate;false=}"; - if(val == "true") - document.f.authenticate[1].checked = true - else - document.f.authenticate[0].checked = true; - var val = "{=ini-get:/var/tuxbox/config/nhttpd.conf;webserver.threading;false=}"; - if(val == "true") - document.f.threading[1].checked = true - else - document.f.threading[0].checked = true; + obj_set_radio_value('authenticate', "{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_auth.authenticate;false=}"); + obj_set_radio_value('threading', "{=ini-get:/var/tuxbox/config/nhttpd.conf;webserver.threading;false=}"); + obj_set_radio_value('mod_sendfile_sendAll', "{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_sendfile.sendAll;false=}"); } function do_submit() { @@ -23,10 +16,9 @@ function do_submit() else if(document.f.port.value == "") alert("Port muss angegeben werden"); - else - { + else{ show_waitbox(true); - yhttpd_cache_clear("yPConf"); + yhttpd_cache_clear(""); document.f.submit(); } } @@ -34,80 +26,90 @@ function do_submit() </script> </head> <body onload="form_init()"> -{=var-set:wait_text=Save.=}{=include-block:Y_Blocks.txt;snip_wait=} +{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Settings#WebServer=}{=var-set:menu=WebServer (nhttpd)=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Settings-WebServer=}{=var-set:menu={=L:webserver=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> - <form name="f" action="/y/cgi"> - <table border="0"> - <tr><td colspan="2" class="y_form_header">Authentification</td></tr> + <form name="f" class="y_form" action="/y/cgi"> + <table border="0" width="100%"> + <tr><td colspan="2" class="y_form_header">{=L:authentication=}</td></tr> <tr> - <td>User</td> - <td><input type="text" name="authuser" size="20" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_auth.username;root~open=}" title="username"/></td> + <td>{=L:user=}</td> + <td><input type="text" name="authuser" size="20" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_auth.username;root~open=}" title="{=L:user=}"/></td> </tr> <tr> - <td>Passwort</td> - <td><input type="password" name="authpassword" size="20" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_auth.password;dbox2~cache=}" title="password"/></td> + <td>{=L:password=}</td> + <td><input type="password" name="authpassword" size="20" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_auth.password;dbox2~cache=}" title="{=L:password=}"/></td> </tr> <tr> - <td>Client ohne Authentification</td> - <td><input type="text" name="noauthclient" size="20" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_auth.no_auth_client~cache=}" title="Client with no authentication check. Enter IP."/></td> + <td>{=L:client_without_authentication=}</td> + <td><input type="text" name="noauthclient" size="20" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_auth.no_auth_client~cache=}" title="{=L:client_without_authentication_desc=}"/></td> </tr> <tr> - <td>Authentification</td> + <td>{=L:authentication=}</td> <td> - <input type="radio" name="authenticate" value="false" title="authentication: off"/>OFF&nbsp; - <input type="radio" name="authenticate" value="true" title="authentication: on"/>ON + <input type="radio" name="authenticate" value="false" />{=L:off=}&nbsp; + <input type="radio" name="authenticate" value="true" />{=L:on=} </td> </tr> - <tr><td colspan="2" class="y_form_header">General</td></tr> + <tr><td colspan="2" class="y_form_header">{=L:general=}</td></tr> <tr> - <td>Port</td> - <td><input type="text" name="port" size="20" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.port;80~cache=}" title="port"/> - <br/>Changed port will only be valid after a restart. + <td>{=L:language=}</td> + <td colspan="3"> <select name="language" title="{=L:language=}"> + {=func:get_languages_as_dropdown=} + </select> + </tr> + <tr> + <td>{=L:port=}</td> + <td><input type="text" name="port" size="20" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.port;80~cache=}" title="{=L:port=}"/>&nbsp;{=L:active_after_boot=} </td> </tr> -<!-- - <td>Threading</td> + <td>{=L:threading=}</td> <td> - <input type="radio" name="threading" value="false" title="threading: off"/>Off; - <input type="radio" name="threading" value="true" title="threading: on"/>On - <br/>Changed will be valid after a restart. + <input type="radio" name="threading" value="false" />{=L:off=}&nbsp; + <input type="radio" name="threading" value="true" />{=L:on=} </td> ---> <tr> - <td>Hosted Web (Mount)</td> - <td><input type="text" name="hosteddocumentroot" size="60" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;Tuxbox.HostedDocumentRoot~cache=}" title="Root of hosted Web. Enter mount directory."/></td> - </tr> - <tr><td colspan="2" class="y_form_header">Logos &amp; Extras</td></tr> - <tr> - <td>Directory ("web"=nur URL)</td> - <td><input type="text" name="ExtrasDocRoot" size="60" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;ExtrasDocRoot~cache=}" title="Enter mount directory (/mnt/hosted/extras or web)."/></td> + <td>{=L:alternate_web_folder=}</td> + <td><input type="text" name="override_directory" size="20" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.override_directory~cache=}" title="{=L:alternate_web_folder=}"/>&nbsp;{=L:active_after_boot=} + <input type="hidden" name="HostedDocRoot" size="60" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;Tuxbox.HostedDocumentRoot~cache=}" title="Root of hosted Web. Enter mount directory."/></td> </tr> <tr> - <td>URL</td> - <td><input type="text" name="ExtrasDocURL" size="60" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;ExtrasDocURL~cache=}" title="URL Root of hosted Extra Web. Enter URL (/hosted/extras)."/></td> + <td>{=L:allowed_file_extensions=}</td> + <td><input type="text" name="mod_sendfile_mime_types" size="60" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_sendfile.mime_types~cache=}" "/></td> </tr> - <tr><td colspan="2" class="y_form_header">Server</td></tr> <tr> - <td>IPs Not keep-alive<br/>(like JtG, comma seperated) </td> - <td><input type="text" name="no_keep_alive_ips" size="30" maxsize="254" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;server.no_keep-alive_ips;~cache=}" title="IPs not to HTTP1.1 keep alive like JtG. Comma seperated."/> + <td>{=L:allow_all_file_extensions=}</td> + <td> + <input type="radio" name="mod_sendfile_sendAll" value="false" />{=L:off=}&nbsp; + <input type="radio" name="mod_sendfile_sendAll" value="true" />{=L:on=} + </td> + </tr> + <tr><td colspan="2" class="y_form_header">{=L:logos=}</td></tr> + <tr> + <td>{=L:url=}</td> + <td><input type="text" name="Tuxbox_LogosURL" size="60" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;Tuxbox.LogosURL~cache=}" title="{=L:url_of_logos_desc=}"/></td> + </tr> + <tr><td colspan="2" class="y_form_header">{=L:server=}</td></tr> + <tr> + <td>{=L:ips_without_keep_alive=}<br/>{=L:ips_without_keep_alive_desc=} </td> + <td><input type="text" name="no_keep_alive_ips" size="30" maxsize="254" value="{=ini-get:/var/tuxbox/config/nhttpd.conf;server.no_keep-alive_ips;~cache=}" "/> </td> </tr> <tr> - <td>Cache</td> - <td><a href="/y/cache-info" target="_blank"><u>Cache info</u>&nbsp;</a><input type="button" name="clearcache" value="clear cache" title="clear cache" onclick="javascript:yhttpd_cache_clear('');"/></td> + <td>{=L:cache=}</td> + <td><a href="/y/cache-info" target="_blank"><u>{=L:cache_info=}</u>&nbsp;</a><button type="button" ytype="clear" name="clearcache" onclick="javascript:yhttpd_cache_clear('');">{=L:clear_cache=}</button></td> </tr> <tr> - <td>Server Configuration</td> - <td><a href="/y/server-config" target="_blank"><u>Server Config</u></a></td> + <td>{=L:server_configuration=}</td> + <td><a href="/y/server-config" target="_blank"><u>{=L:server_configuration=}</u></a></td> </tr> </table> <br/> <input type="hidden" name="tmpl" value="Y_Settings_nhttpd.yhtm"/> <input type="hidden" name="execute" value="include-block:Y_Blocks.txt;nhttpd_save_settings;nix"/> - <input type="button" value="Save ..." title="submit and save values" onclick="do_submit()"/> + <button type="button" ytype="save" title="{=L:save_values_desc=}" onclick="do_submit()">{=L:save=}</button> </form> </div> </div> diff --git a/src/nhttpd/web/Y_Settings_personalize.yhtm b/src/nhttpd/web/Y_Settings_personalize.yhtm new file mode 100644 index 000000000..5cbcf937e --- /dev/null +++ b/src/nhttpd/web/Y_Settings_personalize.yhtm @@ -0,0 +1,366 @@ +{=include-block:Y_Blocks.txt;management_check_top=} +{=include-block:Y_Blocks.txt;head=} + +<script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript"> +//<![CDATA[ +function do_submit() +{ + if(document.f.p_pincode.value.length < 4) + alert("PIN Code muss 4-stellig sein"); + else{ + show_waitbox(true); + document.f.submit(); + } +} +function do_init() +{ + obj_set_radio_value('p_tv', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_tvmode;1~open=}"); + obj_set_radio_value('p_radio', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_radiomode;1~cache=}"); + obj_set_radio_value('p_scart', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_scartmode;1~cache=}"); + obj_set_radio_value('p_games', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_games;1~cache=}"); + obj_set_radio_value('p_audioplayer', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_audioplayer;1~cache=}"); + obj_set_radio_value('p_inetradio', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_inetradio;1~cache=}"); + obj_set_radio_value('p_esound', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_esound;1~cache=}"); + obj_set_radio_value('p_movieplayer', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_movieplayer;1~cache=}"); + obj_set_radio_value('p_picviewer', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_pictureviewer;1~cache=}"); + obj_set_radio_value('p_pinstatus', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_pinstatus;0~cache=}"); + obj_set_radio_value('p_upnp', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_upnpbrowser;1~cache=}"); + obj_set_radio_value('p_sleeptimer', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_sleeptimer;1~cache=}"); + obj_set_radio_value('p_reboot', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_reboot;1~cache=}"); + obj_set_radio_value('p_shutdown', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_shutdown;1~cache=}"); + obj_set_radio_value('p_settings', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_settings;0~cache=}"); + obj_set_radio_value('p_video', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_video;1~cache=}"); + obj_set_radio_value('p_audio', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_audio;1~cache=}"); + obj_set_radio_value('p_youth', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_youth;1~cache=}"); + obj_set_radio_value('p_network', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_network;1~cache=}"); + obj_set_radio_value('p_recording', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_recording;1~cache=}"); + obj_set_radio_value('p_language', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_language;1~cache=}"); + obj_set_radio_value('p_colors', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_colors;1~cache=}"); + obj_set_radio_value('p_lcd', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_lcd;1~cache=}"); + obj_set_radio_value('p_keybinding', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_keybinding;1~cache=}"); + obj_set_radio_value('p_mediaplayer', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_mediaplayer;1~cache=}"); + obj_set_radio_value('p_driver', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_driver;1~cache=}"); + obj_set_radio_value('p_misc', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_misc;1~cache=}"); + obj_set_radio_value('p_service', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_service;0~cache=}"); + obj_set_radio_value('p_bouqueteditor', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_bouqueteditor;1~cache=}"); + obj_set_radio_value('p_scants', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_scants;1~cache=}"); + obj_set_radio_value('p_reload', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_reload;1~cache=}"); + obj_set_radio_value('p_getplugins', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_getplugins;1~cache=}"); + obj_set_radio_value('p_restart', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_restart;1~cache=}"); + obj_set_radio_value('p_epgrestart', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_epgrestart;1~cache=}"); + obj_set_radio_value('p_ucodecheck', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_ucodecheck;1~cache=}"); + obj_set_radio_value('p_chan_epg_stat', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_chan_epg_stat;1~cache=}"); + obj_set_radio_value('p_imageinfo', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_imageinfo;1~cache=}"); + obj_set_radio_value('p_update', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_update;1~cache=}"); + obj_set_radio_value('p_bluebutton', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_bluebutton;1~cache=}"); + obj_set_radio_value('p_redbutton', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_redbutton;1~cache=}"); +} +//]]> +</script> + +</head> +<body onload="do_init()"> +{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=} +<div class="work_box"> + <div class="work_box_head"><div class="work_box_head_h2"> + {=var-set:help_url=Help-Settings-Personalize=}{=var-set:menu=Personalisierung=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + <div class="work_box_body"> + <form name="f" class="y_form" action=""> + <table cellspacing="0" border="0" cellpadding="2" width="100%"> + <tr><td colspan="2" class="y_form_header">Zugang Personalisierung</td></tr> + <tr><td width="35%">PIN ben&ouml;tigt</td> + <td> + <input type="radio" name="p_pinstatus" value="1"/>JA&nbsp; + <input type="radio" name="p_pinstatus" value="0"/>NEIN + </td> + </tr> + <tr> + <td>PIN Code</td> + <td>&nbsp;<input type="text" name="p_pincode" size="4" maxlength="4" value="{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_pincode~open=}" title="PIN code"/></td> + </tr> + <tr><td colspan="2" class="y_form_header">Farbtasten</td></tr> + <tr><td>Taste Blau (Features)</td> + <td> + <input type="radio" name="p_bluebutton" value="1"/>AKTIVIERT&nbsp; + <input type="radio" name="p_bluebutton" value="0"/>DEAKTIVIERT + </td> + </tr> + <tr><td>Taste Rot (EPG/Info)</td> + <td> + <input type="radio" name="p_redbutton" value="1"/>AKTIVIERT&nbsp; + <input type="radio" name="p_redbutton" value="0"/>DEAKTIVIERT + </td> + </tr> + <tr><td colspan="2" class="y_form_header">Hauptmen&uuml;</td></tr> + <tr><td>TV-Modus</td> + <td> + <input type="radio" name="p_tv" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_tv" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_tv" value="2"/>PIN + </td> + </tr> + <tr><td>Radio-Modus</td> + <td> + <input type="radio" name="p_radio" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_radio" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_radio" value="2"/>PIN + </td> + </tr> + <tr><td>Scart-Eingang</td> + <td> + <input type="radio" name="p_scart" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_scart" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_scart" value="2"/>PIN + </td> + </tr> + <tr><td>Spiele</td> + <td> + <input type="radio" name="p_games" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_games" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_games" value="2"/>PIN + </td> + </tr> + <tr><td>Audioplayer</td> + <td> + <input type="radio" name="p_audioplayer" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_audioplayer" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_audioplayer" value="2"/>PIN + </td> + </tr> + </tr><td>Internetradio</td> + <td> + <input type="radio" name="p_inetradio" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_inetradio" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_inetradio" value="2"/>PIN + </td> + </tr> + <tr><td>Esound Soundserver</td> + <td> + <input type="radio" name="p_esound" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_esound" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_esound" value="2"/>PIN + </td> + </tr> + <tr><td>Movieplayer</td> + <td> + <input type="radio" name="p_movieplayer" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_movieplayer" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_movieplayer" value="2"/>PIN + </td> + </tr> + <tr><td>Bildbetrachter</td> + <td> + <input type="radio" name="p_picviewer" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_picviewer" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_picviewer" value="2"/>PIN + </td> + </tr> + <tr><td>UPNP Browser</td> + <td> + <input type="radio" name="p_upnp" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_upnp" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_upnp" value="2"/>PIN + </td> + </tr> + <tr><td>SleepTimer</td> + <td> + <input type="radio" name="p_sleeptimer" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_sleeptimer" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_sleeptimer" value="2"/>PIN + </td> + </tr> + <tr><td>Neu starten</td> + <td> + <input type="radio" name="p_reboot" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_reboot" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_reboot" value="2"/>PIN + </td> + </tr> + <tr><td>Ausschalten</td> + <td> + <input type="radio" name="p_shutdown" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_shutdown" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_shutdown" value="2"/>PIN + </td> + </tr> + <tr><td colspan="2" class="y_form_header">Einstellungen</td></tr> + <tr><td>Einstellungen-Men&uuml; mit PIN</td> + <td> + <input type="radio" name="p_settings" value="1"/>JA&nbsp; + <input type="radio" name="p_settings" value="0"/>NEIN + </td> + </tr> + <tr><td>Video</td> + <td> + <input type="radio" name="p_video" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_video" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_video" value="2"/>PIN + </td> + </tr> + <tr><td>Audio</td> + <td> + <input type="radio" name="p_audio" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_audio" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_audio" value="2"/>PIN + </td> + </tr> + <tr><td>Jugendschutz</td> + <td> + <input type="radio" name="p_youth" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_youth" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_youth" value="2"/>PIN + </td> + </tr> + <tr><td>Netzwerk</td> + <td> + <input type="radio" name="p_network" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_network" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_network" value="2"/>PIN + </td> + </tr> + <tr><td>Aufnahme</td> + <td> + <input type="radio" name="p_recording" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_recording" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_recording" value="2"/>PIN + </td> + </tr> + <tr><td>Sprache</td> + <td> + <input type="radio" name="p_language" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_language" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_language" value="2"/>PIN + </td> + </tr> + <tr><td>Farben / Themes / Schrift</td> + <td> + <input type="radio" name="p_colors" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_colors" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_colors" value="2"/>PIN + </td> + </tr> + <tr><td>LCD-Display</td> + <td> + <input type="radio" name="p_lcd" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_lcd" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_lcd" value="2"/>PIN + </td> + </tr> + <tr><td>Tasten Einstellungen</td> + <td> + <input type="radio" name="p_keybinding" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_keybinding" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_keybinding" value="2"/>PIN + </td> + </tr> + <tr><td>Medienwiedergabe</td> + <td> + <input type="radio" name="p_mediaplayer" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_mediaplayer" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_mediaplayer" value="2"/>PIN + </td> + </tr> + <tr><td>Treiber- und Bootoptionen</td> + <td> + <input type="radio" name="p_driver" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_driver" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_driver" value="2"/>PIN + </td> + </tr> + <tr><td>Diverse Einstellungen</td> + <td> + <input type="radio" name="p_misc" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_misc" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_misc" value="2"/>PIN + </td> + </tr> + <tr><td colspan="2" class="y_form_header">Service</td></tr> + <tr><td>Service-Men&uuml; mit PIN</td> + <td> + <input type="radio" name="p_service" value="1"/>JA&nbsp; + <input type="radio" name="p_service" value="0"/>NEIN + </td> + </tr> + <tr><td>Bouquet-Verwaltung</td> + <td> + <input type="radio" name="p_bouqueteditor" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_bouqueteditor" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_bouqueteditor" value="2"/>PIN + </td> + </tr> + <tr><td>Kanalsuche</td> + <td> + <input type="radio" name="p_scants" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_scants" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_scants" value="2"/>PIN + </td> + </tr> + <tr><td>Kanallisten neu laden</td> + <td> + <input type="radio" name="p_reload" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_reload" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_reload" value="2"/>PIN + </td> + </tr> + <tr><td>Plugins neu laden</td> + <td> + <input type="radio" name="p_getplugins" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_getplugins" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_getplugins" value="2"/>PIN + </td> + </tr> + <tr><td>Neutrino neu starten</td> + <td> + <input type="radio" name="p_restart" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_restart" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_restart" value="2"/>PIN + </td> + </tr> + <tr><td>EPG neu starten</td> + <td> + <input type="radio" name="p_epgrestart" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_epgrestart" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_epgrestart" value="2"/>PIN + </td> + </tr> + <tr><td>Ucodes &uuml;berpr&uuml;fen</td> + <td> + <input type="radio" name="p_ucodecheck" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_ucodecheck" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_ucodecheck" value="2"/>PIN + </td> + </tr> + <tr><td>Sender/EPG Statistik</td> + <td> + <input type="radio" name="p_chan_epg_stat" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_chan_epg_stat" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_chan_epg_stat" value="2"/>PIN + </td> + </tr> + <tr><td>Image Informationen</td> + <td> + <input type="radio" name="p_imageinfo" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_imageinfo" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_imageinfo" value="2"/>PIN + </td> + </tr> + <tr><td>Software-Aktualisierung</td> + <td> + <input type="radio" name="p_update" value="0"/>nicht sichtbar&nbsp; + <input type="radio" name="p_update" value="1"/>sichtbar&nbsp; + <input type="radio" name="p_update" value="2"/>PIN + </td> + </tr> + </table> + <br /> + <input type="hidden" name="execute" value="include-block:Y_Blocks.txt;personalize_save_settings;nix"/> + <button type="button" ytype="save" title="submit and save values" onclick="do_submit()">Speichern</button> + &nbsp;<button type="button" ytype="refresh" onclick="dbox_reload_neutrino()">reload Neutrino</button> + &nbsp;<a href="javascript:top.top_main.prim_menu.nav('info', 'Y_Info_Help.yhtm');" class="inlink">Hilfe</a> + </form> + </div> +</div> +</body> +</html> +{=include-block:Y_Blocks.txt;management_check_bottom=} diff --git a/src/nhttpd/web/Y_Settings_ucodes.yhtm b/src/nhttpd/web/Y_Settings_ucodes.yhtm index aa7ec6ba9..49cacf81c 100644 --- a/src/nhttpd/web/Y_Settings_ucodes.yhtm +++ b/src/nhttpd/web/Y_Settings_ucodes.yhtm @@ -13,7 +13,7 @@ function do_submit() } else if (document.f.R1[3].checked == true) { _url="/control/exec?Y_Tools&ucodes_upload&ucode.bin"; } else { - alert("Please make a choice"); + alert("Bitte eine Auswahl treffen"); } document.f.action=_url; document.f.submit(); @@ -24,10 +24,10 @@ function do_submit() <body> <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Settings#ucodes=}{=var-set:menu=Ucodes=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Settings-ucodes=}{=var-set:menu=Ucodes=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> - <table border="0" cellpadding="5"> - <tr><td class="y_form_header">Upload</td></tr> + <table border="0" cellpadding="5" width="100%"> + <tr><td width="50%" class="y_form_header">Upload</td><td class="y_form_header">Download</td></tr> <tr> <td> <form name="f" method="post" enctype="multipart/form-data" action="/control/exec?Y_Tools&amp;test_upload"> @@ -37,14 +37,11 @@ function do_submit() <input type="radio" name="R1" value="avia600.ux"/>avia600.ux<br/> <input type="radio" name="R1" value="ucode.bin"/>ucode.bin<br/> - <input type="file" name="F1" size="20"/>&nbsp; - <input type="button" id="su" value="Absenden" title="upload selected file" name="B1" onclick="do_submit()"/> + <input type="file" name="F1" size="20"/><br/> + <button type="button" id="su" ytype="save" name="B1" title="upload selected file" onclick="do_submit()">Absenden</button> </p> </form> </td> - </tr> - <tr><td class="y_form_header">Download</td></tr> - <tr> <td> <ul> <li><a type="application/octet-stream" href="/var/tuxbox/ucodes/avia500.ux"><u>avia500.ux</u></a></li> diff --git a/src/nhttpd/web/Y_Settings_umount_liste.yhtm b/src/nhttpd/web/Y_Settings_umount_liste.yhtm index 993fb1970..7b23f4189 100644 --- a/src/nhttpd/web/Y_Settings_umount_liste.yhtm +++ b/src/nhttpd/web/Y_Settings_umount_liste.yhtm @@ -2,7 +2,7 @@ <script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript"> //<![CDATA[ -function do_unmount() +function do_unmount() { var local_dir=""; for(i=0; i<document.f.length;i++) @@ -23,7 +23,7 @@ function do_unmount() {=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"> - <div class="work_box_head_h2">{=var-set:help_url=Neutrino:yWeb:Tools#Mounts=}{=var-set:menu=UnMount=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + <div class="work_box_head_h2">{=var-set:help_url=Help-Tools-Mounts=}{=var-set:menu=UnMount=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <form action="/y/cgi" name="f" id="f"> {=func:umount_get_list=} diff --git a/src/nhttpd/web/Y_Settings_video_audio.yhtm b/src/nhttpd/web/Y_Settings_video_audio.yhtm new file mode 100644 index 000000000..d35642433 --- /dev/null +++ b/src/nhttpd/web/Y_Settings_video_audio.yhtm @@ -0,0 +1,189 @@ +{=include-block:Y_Blocks.txt;management_check_top=} +{=include-block:Y_Blocks.txt;head=} + +<script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript"> +//<![CDATA[ +function do_init() +{ + var val = ""; +//video + val = "{=ini-get:/var/tuxbox/config/controld.conf;videooutput;1~open=}"; + document.f.videooutput.selectedIndex = val; + obj_set_radio_value('vcroutput', "{=ini-get:/var/tuxbox/config/controld.conf;vcroutput;0~cache=}"); + document.f.h_vcroutput.value = obj_get_radio_value("vcroutput"); + + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;video_Format;2~open=}"; + document.f.video_Format.selectedIndex = val; + + val = "{=ini-get:/var/tuxbox/config/controld.conf;video_backgroundFormat;2~cache=}"; + var sel = 0; + if(val=="2") sel=1; + if(val=="3") sel=2; + document.f.video_backgroundFormat.selectedIndex = sel; + + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;video_csync;0~cache=}" + document.f.video_csync.value = val; + obj_set_radio_value('vcr_AutoSwitch', "{=ini-get:/var/tuxbox/config/neutrino.conf;vcr_AutoSwitch;true~cache=}"); +//audio + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;audio_AnalogMode;0~cache=}"; + document.f.audio_AnalogMode.selectedIndex = val; + obj_set_radio_value('audiochannel_up_down_enable', "{=ini-get:/var/tuxbox/config/neutrino.conf;audiochannel_up_down_enable;false~cache=}"); + obj_set_radio_value('audio_left_right_selectable', "{=ini-get:/var/tuxbox/config/neutrino.conf;audio_left_right_selectable;false~cache=}"); + obj_set_radio_value('audio_DolbyDigital', "{=ini-get:/var/tuxbox/config/neutrino.conf;audio_DolbyDigital;false~cache=}"); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;audio_avs_Control;1~cache=}"; + document.f.audio_avs_Control.selectedIndex = val; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;audio_PCMOffset;0~cache=}" + document.f.audio_PCMOffset.value = val; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;audio_step;5~cache=}" + document.f.audio_step.value = val; +} +function set_hidden_values() +{ + document.f.h_videooutput.value = document.f.videooutput.selectedIndex; + document.f.h_video_csync.value = document.f.video_csync.value; + document.f.h_vcroutput.value = obj_get_radio_value("vcroutput"); + document.f.h_audio_avs_Control.value = document.f.audio_avs_Control.selectedIndex; +} +function do_submit() +{ + if(document.f.video_csync.value < 0 || document.f.video_csync.value > 31) + alert("Erlaubte Werte: 0 - 31"); + else{ + set_hidden_values(); + show_waitbox(true); + document.f.submit(); + } +} +//]]> +</script> +</head> +<body onload="do_init()"> +{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=} +<div class="work_box"> + <div class="work_box_head"><div class="work_box_head_h2"> + {=var-set:help_url=Help-Settings-Video-Audio=}{=var-set:menu=Video und Audio Einstellungen=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + <div class="work_box_body"> + <form name="f" class="y_form" action=""> + <table cellspacing="0" border="0" cellpadding="2" width="100%"> + <tr> + <td colspan="2" class="y_form_header">Video</td> + </tr> + <tr><td width="35%">Video Signalart</td> + <td> + <select name="videooutput" title="select videooutput" disabled="disabled"> + <option value="0" selected="selected">CVBS</option> + <option value="1">RGB + CVBS</option> + <option value="2">S-Video</option> + <option value="3">YUV + VBS</option> + <option value="4">YUV + CVBS</option> + </select> + <input type="hidden" name="h_videooutput"/>(*) + </td> + </tr> + <tr> + <td>Bildschirmformat</td> + <td> + <select name="video_Format" title="select videoformat"> + <option value="0" selected="selected">automatisch</option> + <option value="1">16:9</option> + <option value="2">4:3 (LB)</option> + <option value="3">4:3 (PS)</option> + </select> + </td> + </tr> + <tr> + <td>Hintergrundbildformat</td> + <td> + <select name="video_backgroundFormat" title="select backgroundformat"> + <option value="1" selected="selected">16:9</option> + <option value="2">4:3 (LB)</option> + <option value="3">4:3 (PS)</option> + </select> + </td> + </tr> + <tr> + <td>RGB-Zentrierung</td> + <td> + <input type="text" name="video_csync" size="2" maxlength="2" disabled="disabled" title="set rgb-sync"/> + <input type="hidden" name="h_video_csync"/>(*) + </td> + </tr> + <tr> + <td title="select vcr_output">VCR-Ausgang Signalart</td> + <td> + <input type="radio" name="vcroutput" value="0" disabled="disabled"/>CVBS&nbsp; + <input type="radio" name="vcroutput" value="2" disabled="disabled"/>S-Video + <input type="hidden" name="h_vcroutput"/>(*) + </td> + </tr> + <tr> + <td title="vcr_AutoSwitch: off/on">Scart-Eingang automatisch</td> + <td> + <input type="radio" name="vcr_AutoSwitch" value="false"/>NEIN&nbsp; + <input type="radio" name="vcr_AutoSwitch" value="true"/>JA + </td> + </tr> + <tr><td colspan="2" class="y_form_header">Audio</td></tr> + <tr> + <td>Analog-Ausgang</td> + <td> + <select name="audio_AnalogMode" title="select audio analogMode"> + <option value="0" selected="selected">Stereo</option> + <option value="1">Mono links</option> + <option value="2">Mono rechts</option> + </select> + </td> + </tr> + <tr> + <td title="audiochannel selectable in menu: off/on">in Tonwahl w&auml;hlbar</td> + <td> + <input type="radio" name="audiochannel_up_down_enable" value="false"/>AUS&nbsp; + <input type="radio" name="audiochannel_up_down_enable" value="true"/>EIN + </td> + </tr> + <tr> + <td title="enable audioselect with left/right: off/on">Audio mit Links/Rechts w&auml;hlbar</td> + <td> + <input type="radio" name="audio_left_right_selectable" value="false"/>AUS&nbsp; + <input type="radio" name="audio_left_right_selectable" value="true"/>EIN + </td> + </tr> + <tr><td title="dolby digital default: off/on">Dolby Digital Default</td> + <td> + <input type="radio" name="audio_DolbyDigital" value="false"/>AUS&nbsp; + <input type="radio" name="audio_DolbyDigital" value="true"/>EIN + </td> + </tr> + <tr><td>Volume Steuerung</td> + <td> + <select name="audio_avs_Control" title="select volume control" disabled="disabled"> + <option value="0" selected="selected">ost</option> + <option value="1">avs</option> + <option value="2">lirc</option> + </select> + <input type="hidden" name="h_audio_avs_Control"/>(*) + </td> + </tr> + <tr><td>Lautst&auml;rkeabsenkung PCM</td> + <td> + <input type="text" name="audio_PCMOffset" size="2" maxlength="2" title="pcm offset"/> + </td> + </tr> + <tr><td>Lautst&auml;rke Schrittweite</td> + <td> + <input type="text" name="audio_step" size="2" maxlength="2" title="audio step"/> + </td> + </tr> + </table> + <br/> + <input type="hidden" name="execute" value="include-block:Y_Blocks.txt;video_audio_save_settings;nix"/> + <button type="button" ytype="save" title="submit and save values" onclick="do_submit()">Speichern</button>&nbsp; + <button type="button" ytype="refresh" onclick="dbox_reload_neutrino()">reload Neutrino</button>&nbsp; + <a href="javascript:top.top_main.prim_menu.nav('info', 'Y_Info_Help.yhtm');" class="inlink">Hilfe</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(* diese Einstellungen sind nur lesbar) + </form> + </div> +</div> +</body> +</html> +{=include-block:Y_Blocks.txt;management_check_bottom=} diff --git a/src/nhttpd/web/Y_Settings_wol.yhtm b/src/nhttpd/web/Y_Settings_wol.yhtm index 783b152d7..b4788fb35 100644 --- a/src/nhttpd/web/Y_Settings_wol.yhtm +++ b/src/nhttpd/web/Y_Settings_wol.yhtm @@ -4,10 +4,10 @@ <script type="text/javascript"> //<![CDATA[ var g_wol = new Array( - "{=ini-get:/var/tuxbox/config/Y-Web.conf;wol_mac_1=}", - "{=ini-get:/var/tuxbox/config/Y-Web.conf;wol_mac_2=}", + "{=ini-get:/var/tuxbox/config/Y-Web.conf;wol_mac_1=}", + "{=ini-get:/var/tuxbox/config/Y-Web.conf;wol_mac_2=}", "{=ini-get:/var/tuxbox/config/Y-Web.conf;wol_mac_3=}"); -function do_wol(_nr) +function do_wol(_nr) { var nhttpd_version = loadSyncURL("/control/exec?Y_Tools&wol&"+g_wol[_nr-1]); } @@ -16,31 +16,35 @@ function init_wol() for(i=1;i<=3;i++) document.getElementById("wol"+i).disabled = (g_wol[i-1] == ""); } +function goto_settings(){ + top.top_main.prim_menu.nav("settings", "Y_Settings_yWeb.yhtm"); +} //]]> </script> </head> <body> <div class="work_box"> <div class="work_box_head"> - <div class="work_box_head_h2">{=var-set:help_url=Neutrino:yWeb:Tools#Wake_on_LAN=}{=var-set:menu=Wake on LAN=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + <div class="work_box_head_h2">{=var-set:help_url=Help-Tools-Wake_on_LAN=}{=var-set:menu=Wake on LAN=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <form name="f" action="/y/cgi"> <table border="0" class="y_form_table"> <tr> - <td>Wake on Lan MAC 1 ({=ini-get:/var/tuxbox/config/Y-Web.conf;wol_mac_1=})</td> + <td>Wake on Lan MAC 1 ({=ini-get:/var/tuxbox/config/Y-Web.conf;wol_mac_1=}) {=ini-get:/var/tuxbox/config/Y-Web.conf;wol_desc_1=}</td> <td><input id="wol1" type="button" name="wol_mac_1" value="wake up" title="wake up that MAC" onclick='do_wol(1)'/></td> </tr> <tr> - <td>Wake on Lan MAC 2 ({=ini-get:/var/tuxbox/config/Y-Web.conf;wol_mac_2=})</td> + <td>Wake on Lan MAC 2 ({=ini-get:/var/tuxbox/config/Y-Web.conf;wol_mac_2=}) {=ini-get:/var/tuxbox/config/Y-Web.conf;wol_desc_2=}</td> <td><input id="wol2" type="button" name="wol_mac_2" value="wake up" title="wake up that MAC" onclick='do_wol(2)'/></td> </tr> <tr> - <td>Wake on Lan MAC 3 ({=ini-get:/var/tuxbox/config/Y-Web.conf;wol_mac_3=})</td> + <td>Wake on Lan MAC 3 ({=ini-get:/var/tuxbox/config/Y-Web.conf;wol_mac_3=}) {=ini-get:/var/tuxbox/config/Y-Web.conf;wol_desc_3=}</td> <td><input id="wol3" type="button" name="wol_mac_3" value="wake up" title="wake up that MAC" onclick='do_wol(3)'/></td> </tr> + <tr><td colspan="2"><a href="javascript:goto_settings()" class="inlink">Einstellungen</a></td></tr> </table> </form> - <!--<a href="Y_Settings_yWeb.yhtm" title="WOL Settings">Settings</a>--> + <!--<a href="Y_Settings_yWeb.yhtm" title="WOL Settings">Einstellungen</a>--> </div> </div> <script type="text/javascript"> diff --git a/src/nhttpd/web/Y_Settings_yWeb.yhtm b/src/nhttpd/web/Y_Settings_yWeb.yhtm index cd1412b32..3da2f0e75 100644 --- a/src/nhttpd/web/Y_Settings_yWeb.yhtm +++ b/src/nhttpd/web/Y_Settings_yWeb.yhtm @@ -3,71 +3,98 @@ <script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript"> //<![CDATA[ -function do_submit() -{ +function do_submit(){ show_waitbox(true); yhttpd_cache_clear(""); document.f.submit(); } +function do_init(){ + val = "{=ini-get:/var/tuxbox/config/Y-Web.conf;fb;default~open=}"; + var sel=2; + switch(val){ + case "default": sel=0; break; + case "Nokia": sel=1; break; + } + document.f.fb.selectedIndex = sel; + val = "{=ini-get:/var/tuxbox/config/Y-Web.conf;start_page;bouquets~cache=}"; + var sel=2; + switch(val){ + case "bouquets": sel=0; break; + case "control": sel=1; break; + } + document.f.start_page.selectedIndex = sel; +} //]]> </script> </head> -<body> -{=var-set:wait_text=Values are saved (Save).=}{=include-block:Y_Blocks.txt;snip_wait=} +<body onload="do_init()"> +{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Settings#yWeb=}{=var-set:menu=yWeb=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Settings-yWeb=}{=var-set:menu=yWeb=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> - <form name="f" action="/y/cgi"> + <form name="f" class="y_form" action="/y/cgi"> <table border="0" class="y_form_table"> + <tr><td class="y_form_header" colspan="4">{=L:management_IPs=}</td></tr> <tr> - <td>Slave Box IP (2. dbox)</td> - <td><input type="text" name="slavebox" size="15" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;slavebox=}" title="enter IP (xxx.xxx.xxx.xxx) of slave-box"/></td> + <td>IP 1</td> + <td colspan="3"><input type="text" name="managementIP" size="15" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip=}" title="{=L:enter_ip_desc=}"/></td> </tr> <tr> - <td>Management IP 1</td> - <td><input type="text" name="managementIP" size="15" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip=}" title="enter IP (xxx.xxx.xxx.xxx)"/></td> + <td>IP 2</td> + <td colspan="3"><input type="text" name="managementIP2" size="15" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}" title="{=L:enter_ip_desc=}"/></td> + </tr> + <tr><td class="y_form_header" colspan="4">{=L:wake_on_lan=}</td></tr> + <tr> + <td>MAC 1</td> + <td><input type="text" name="wol_mac_1" size="17" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;wol_mac_1=}" title="{=L:enter_mac_desc=}"/></td> + <td>{=L:description=}</td> + <td><input type="text" name="wol_desc_1" size="17" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;wol_desc_1=}" title="{=L:enter_description_desc=}"/></td> </tr> <tr> - <td>Management IP 2</td> - <td><input type="text" name="managementIP2" size="15" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}" title="enter IP (xxx.xxx.xxx.xxx)"/></td> + <td>MAC 2</td> + <td><input type="text" name="wol_mac_2" size="17" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;wol_mac_2=}" title="{=L:enter_mac_desc=}"/></td> + <td>{=L:description=}</td> + <td><input type="text" name="wol_desc_2" size="17" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;wol_desc_2=}" title="{=L:enter_description_desc=}"/></td> </tr> <tr> - <td>Wake on Lan MAC 1</td> - <td><input type="text" name="wol_mac_1" size="17" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;wol_mac_1=}" title="enter MAC Adress (xx:xx:xx:xx:xx:xx)"/></td> + <td>MAC 3</td> + <td><input type="text" name="wol_mac_3" size="17" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;wol_mac_3=}" title="{=L:enter_mac_desc=}"/></td> + <td>{=L:description=}</td> + <td><input type="text" name="wol_desc_3" size="17" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;wol_desc_3=}" title="{=L:enter_description_desc=}"/></td> + </tr> + <tr><td class="y_form_header" colspan="4">{=L:box_tag=}</td></tr> + <tr> + <td>{=L:tag=}</td> + <td colspan="3"><input type="text" name="yweb_box_name" size="8" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;yweb_box_name=}" + title="{=L:box_tag_desc=}"/></td> </tr> <tr> - <td>Wake on Lan MAC 2</td> - <td><input type="text" name="wol_mac_2" size="17" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;wol_mac_2=}" title="enter MAC Adress (xx:xx:xx:xx:xx:xx)"/></td> + <td>{=L:color=}</td> + <td colspan="3"><input type="text" name="yweb_box_color" size="8" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;yweb_box_color=}" + title="{=L:box_color_desc=}"/></td> + </tr> + <tr><td class="y_form_header" colspan="4">{=L:others=}</td></tr> + <tr> + <td>{=L:remote=}</td> + <td colspan="3"> <select name="fb" title="{=L:remote=}"> + <option value="default" selected="selected">default</option> + <option value="Nokia">Nokia</option> + <option value="Sagem">Sagem/Philips</option> + <option value="Coolstream">Coolstream</option> </tr> <tr> - <td>Wake on Lan MAC 3</td> - <td><input type="text" name="wol_mac_3" size="17" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;wol_mac_3=}" title="enter MAC Adress (xx:xx:xx:xx:xx:xx)"/></td> - </tr> - <tr> - <td>VLC Recording path</td> - <td><input type="text" name="vlc_record_path" size="17" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;vlc_record_path=}" title="VLC record path for LiveView direct recording."/></td> - </tr> -<!--- <tr> - <td>VLC Aufnahmetyp</td> - <td><input type="text" name="vlc_record_mux_type" size="17" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;vlc_record_mux_type=}" title="VLC record mux type"/></td> - </tr> ---> - <tr> - <td>Box-name</td> - <td><input type="text" name="yweb_box_name" size="8" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;yweb_box_name=}" - title="Box Name in Top-Menue."/></td> - </tr> - <tr> - <td>Box-name/colour</td> - <td><input type="text" name="yweb_box_color" size="8" value="{=ini-get:/var/tuxbox/config/Y-Web.conf;yweb_box_color=}" - title="Box Name color in Top-Menue. e.g. enter 2188e0 without #"/></td> + <td>{=L:start_page=}</td> + <td colspan="3"> <select name="start_page" title="{=L:start_page=}"> + <option value="bouquets" selected="selected">{=L:bouquets=}</option> + <option value="control">{=L:control=}</option> + <option value="none">{=L:empty=}</option> </tr> </table> <br/> <input type="hidden" name="tmpl" value="Y_Settings_yWeb.yhtm"/> <input type="hidden" name="execute" value="include-block:Y_Blocks.txt;yWeb_save_settings;nix"/> - <input type="button" value="Save ..." title="submit and save values" onclick="do_submit()"/> + <button type="button" ytype="save" title="{=L:save_values_desc=}" onclick="do_submit()">{=L:save=}</button> </form> </div> </div> diff --git a/src/nhttpd/web/Y_Settings_zapit.yhtm b/src/nhttpd/web/Y_Settings_zapit.yhtm index 050776c2e..8279ffe86 100644 --- a/src/nhttpd/web/Y_Settings_zapit.yhtm +++ b/src/nhttpd/web/Y_Settings_zapit.yhtm @@ -9,9 +9,9 @@ function do_submit() else if (document.f.R1[1].checked == true) _url="/control/exec?Y_Tools&zapit_upload&services.xml"; else if (document.f.R1[2].checked == true) - _url="/control/exec?Y_Tools&zapit_upload&ubouquets.xml"; + _url="/control/exec?Y_Tools&zapit_upload&myservices.xml"; else - alert("Please make a choice"); + alert("Bitte eine Auswahl treffen"); document.f.action=_url; document.f.submit(); } @@ -21,32 +21,29 @@ function do_submit() <body> <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Settings#zapit=}{=var-set:menu=zapit=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Settings-zapit=}{=var-set:menu=zapit=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> - <table border="0" cellpadding="5"> - <tr><td class="y_form_header">Upload</td></tr> + <table border="0" cellpadding="5" width="100%"> + <tr><td width="50%" class="y_form_header">Upload</td><td class="y_form_header">Download</td></tr> <tr> <td> <form name="f" method="post" enctype="multipart/form-data" action=""> <p> <input type="radio" name="R1" checked="checked" value="bouquets.xml"/>bouquets.xml<br/> <input type="radio" name="R1" value="services.xml"/>services.xml<br/> - <input type="radio" name="R1" value="ubouquets.xml"/>ubouquets.xml<br/> + <input type="radio" name="R1" value="myservices.xml"/>myservices.xml<br/> - <input type="file" name="F1" size="20"/>&nbsp; - <input type="button" id="su" value="Absenden" name="B1" title="upload selected file" onclick="do_submit()"/> + <input type="file" name="F1" size="20"/><br/> + <button type="button" id="su" ytype="save" name="B1" title="upload selected file" onclick="do_submit()">Absenden</button> </p> </form> </td> - </tr> - <tr><td class="y_form_header">Download</td></tr> - <tr> <td> - <ul> - <li><a type="application/octet-stream" href="/var/tuxbox/config/zapit/bouquets.xml"><u>bouquets.xml</u></a></li> - <li><a type="application/octet-stream" href="/var/tuxbox/config/zapit/services.xml"><u>services.xml</u></a></li> - <li><a type="application/octet-stream" href="/var/tuxbox/config/zapit/ubouquets.xml"><u>ubouquets.xml</u></a></li> - </ul> + <ul> + <li><a type="application/octet-stream" href="/var/tuxbox/config/zapit/bouquets.xml"><u>bouquets.xml</u></a></li> + <li><a type="application/octet-stream" href="/var/tuxbox/config/zapit/services.xml"><u>services.xml</u></a></li> + <li><a type="application/octet-stream" href="/var/tuxbox/config/zapit/myservices.xml"><u>myservices.xml</u></a></li> + </ul> </td> </tr> </table> diff --git a/src/nhttpd/web/Y_StreamInfo.yhtm b/src/nhttpd/web/Y_StreamInfo.yhtm index eebca22e1..4c421627a 100644 --- a/src/nhttpd/web/Y_StreamInfo.yhtm +++ b/src/nhttpd/web/Y_StreamInfo.yhtm @@ -1,4 +1,23 @@ {=include-block:Y_Blocks.txt;head_no_charset=} +<style> +.y_work_box { + border-spacing: 1px; + padding-left: 20px; + padding-right: 20px; + padding-top: 10px; + padding-bottom: 10px; + float:left; + width: auto; + color: #555555; + display:block; +} +.y_head { + font-weight: bold; + color: #555555; + font-size: 14pt; + clear:both; +} +</style> </head> <body> <BR> @@ -7,12 +26,12 @@ <div class="y_work_box"> <TABLE cellspacing="2" cellpadding="3" class="tableborder" width="300px"> <TR> -<TD class="set"><B>Resolution:</B></TD> +<TD class="set"><B>Aufl&ouml;sung:</B></TD> <TD width="30">&nbsp;</TD> <TD class="set">{=VideoFormat=}</TD> </TR> <TR> -<TD class="set"><B>Relation:</B></TD> +<TD class="set"><B>Verh&auml;ltnis:</B></TD> <TD>&nbsp;</TD> <TD class="set"> <div align="left">{=AspectRatio=}</div></TD> </TR> @@ -22,12 +41,12 @@ <TD class="set"> <div align="left">{=BitRate=} bit/sec</div></TD> </TR> <TR> -<TD class="set"><B>Framerate:</B></TD> +<TD class="set"><B>Bildrate:</B></TD> <TD>&nbsp;</TD> <TD class="set"> <div align="left">{=FPS=} fps</div></TD> </TR> <TR> -<TD class="set"><B>Audiotype:</B></TD> +<TD class="set"><B>Audiotyp:</B></TD> <TD>&nbsp;</TD> <TD class="set"> <div align="left">{=AudioType=}</div></TD> </TR> @@ -47,7 +66,7 @@ <TD class="set"> <div align="left">{=tsid=}</div></TD> </TR> <TR> -<TD class="set"><B>frequency:</B></TD> +<TD class="set"><B>tsfrequency:</B></TD> <TD>&nbsp;</TD> <TD class="set"> <div align="left">{=tsfrequency=} ({=polarisation=})</div></TD> </TR> diff --git a/src/nhttpd/web/Y_Timer_Edit.yhtm b/src/nhttpd/web/Y_Timer_Edit.yhtm index dc309370e..e2bb39abd 100644 --- a/src/nhttpd/web/Y_Timer_Edit.yhtm +++ b/src/nhttpd/web/Y_Timer_Edit.yhtm @@ -1,11 +1,11 @@ {=func:set_timer_form {=typ=} {=tid=}=} {=include-block:Y_Blocks.txt;head_no_charset=} <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/> +<script type="text/javascript" src="/prototype.js"></script> <script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript"> //<![CDATA[ -function my_show(id) {document.getElementById(id).style.visibility="visible";} -function my_hide(id) {document.getElementById(id).style.visibility="hidden";} +function my_display(id,state) {(state)?$(id).show():$(id).hide();} function focusNMark() { document.f.ad.select(); @@ -14,23 +14,25 @@ function focusNMark() function onEventChange() { tType=document.f.type.value; - show_obj("StopDateRow",(tType == "5")); - show_obj("StandbyRow",(tType == "4")); - show_obj("ProgramRow",(tType == "5" || tType=="2" || tType=="3")); - show_obj("ApidRow",(tType == "5")); - show_obj("MessageRow",(tType == "6")); - show_obj("PluginNameRow",(tType == "8")); + my_display("StopDateRow",(tType == "5")); + my_display("StandbyRow",(tType == "4")); + my_display("ProgramRow",(tType == "5" || tType=="2" || tType=="3")); + my_display("ApidRow",(tType == "5")); + my_display("MessageRow",(tType == "6")); + my_display("PluginNameRow",(tType == "8")); + my_display("RecDirRow",(tType == "5")); + my_display("ValuesRow",(tType != "1" && tType!="7")); focusNMark(); } function onEventChange2() { tType=document.f.rep.value; - show_obj("WeekdaysRow",(tType == "256")); - show_obj("repcountRow",!(tType == "0")); + my_display("WeekdaysRow",(tType == "256")); + my_display("repcountRow",!(tType == "0")); } function onApidDefChange() -{ +{ if(document.f.apcf.checked == true) { document.f.apst.checked=false; @@ -40,7 +42,7 @@ function onApidDefChange() } function onApidChange() { - if(document.f.apst.checked == true || + if(document.f.apst.checked == true || document.f.apal.checked == true || document.f.apac.checked == true) document.f.apcf.checked=false; @@ -50,40 +52,52 @@ function do_submit() show_waitbox(true); document.f.submit(); } +function obj_set_select_value(_obj_name, _value) +{ + var _obj = document.getElementById(_obj_name); + if(_obj){ + for(i=0;i<_obj.length;i++) + if(_obj.options[i].value == _value) + + _obj.selectedIndex=i; + } +} function init() { onEventChange(); onEventChange2(); + var rd="{=timer_recordingDir=}"; + obj_set_select_value("rec_dir", rd); } //]]> </script> </head> <body onload="init()"> -{=var-set:wait_text=Save.=}{=include-block:Y_Blocks.txt;snip_wait=} +{=var-set:wait_text={=L:save_values=}=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Live#Timer=}{=var-set:menu=Timer=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Live_Timer-Timer=}{=var-set:menu=Timer=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> - <form method="get" name="f" action="/fb/timer.dbox2"> - <input TYPE="hidden" name="action" value="{=typ=}"/> - <input name="id" TYPE="hidden" value="{=timerId=}"/> - <table border="0"> + <form method="get" class="y_form" name="f" action="/fb/timer.dbox2"> + <input type="hidden" name="action" value="{=typ=}"/> + <input name="id" type="hidden" value="{=timerId=}"/> + <table border="0" width="100%"> <tr><td colspan="2" class="y_form_header">Timer</td></tr> <tr> - <td>Type</td> + <td>Typ</td> <td> <select name="type" onchange="onEventChange();"> {=timertype=} </select> </td> </tr> - <tr><td colspan="2" class="y_form_header">Times</td></tr> + <tr><td colspan="2" class="y_form_header">Zeiten</td></tr> <tr> - <td>Alarm-Date</td> + <td>Alarm-Datum</td> <td><input type="text" name="ad" value="{=alarm_mday=}" size="2" maxlength="2"/> .&nbsp;<input type="text" name="amo" value="{=alarm_mon=}" size="2" maxlength="2"/> .&nbsp;<input type="text" name="ay" value="{=alarm_year=}" size="4" maxlength="4"/> - &nbsp;Time&nbsp;<input type="text" name="ah" value="{=alarm_hour=}" size="2" maxlength="2"/> + &nbsp;Zeit&nbsp;<input type="text" name="ah" value="{=alarm_hour=}" size="2" maxlength="2"/> &nbsp;:&nbsp;<input type="text" name="ami" value="{=alarm_min=}" size="2" maxlength="2"/> </td> </tr> @@ -92,38 +106,38 @@ function init() <td><input type="text" name="sd" value="{=stop_mday=}" size="2" maxlength="2"/> .&nbsp;<input type="text" name="smo" value="{=stop_mon=}" size="2" maxlength="2"/> .&nbsp;<input type="text" name="sy" value="{=stop_year=}" size="4" maxlength="4"/> - &nbsp;Time&nbsp;<input type="text" name="sh" value="{=stop_hour=}" size="2" maxlength="2"/> + &nbsp;Zeit&nbsp;<input type="text" name="sh" value="{=stop_hour=}" size="2" maxlength="2"/> &nbsp;:&nbsp;<input type="text" name="smi" value="{=stop_min=}" size="2" maxlength="2"/> </td> </tr> <tr> - <td>Repeat</td> + <td>Wiederholung</td> <td><select name="rep" onchange="onEventChange2();"> {=repeat=} </select> </td> </tr> - <tr id="repcountRow" style="visibility:hidden;"> - <td>repeat (0 = indefinitely)</td> + <tr id="repcountRow" style="display:none;"> + <td>Wiederholungen (0 = unbegrenzt)</td> <td><input type="text" name="repcount" id="repcount" value="{=timer_repeatCount=}" size="4" maxlength="3"/> </td> </tr> - <tr id="WeekdaysRow" style="visibility:hidden;"> - <td>Weekdays</td> + <tr id="WeekdaysRow" style="display:none;"> + <td>Wochentage</td> <td><input type="text" name="wd" value="{=weekdays=}" size="7" maxlength="7"/> (Mo-So, X=Timer) </td> </tr> - <tr><td colspan="2" class="y_form_header">Values</td></tr> - <tr id="ProgramRow" style="visibility:hidden"> - <td>Program</td> + <tr id="ValuesRow" style="display:none"><td colspan="2" class="y_form_header">Werte</td></tr> + <tr id="ProgramRow" style="display:none"> + <td>Programm</td> <td><select name="channel_id"> {=program_row=} </select> </td> </tr> - <tr id="ApidRow" style="visibility:hidden"> + <tr id="ApidRow" style="display:none"> <td>APIDs:</td> <td><input type="checkbox" name="apcf" onchange="onApidDefChange();" {=if-equal:{=TIMERD_APIDS_CONF=}~y~checked="checked"=}/>Default <input type="checkbox" name="apst" onchange="onApidChange();" {=if-equal:{=TIMERD_APIDS_STD=}~y~checked="checked"=}/>Standard @@ -131,34 +145,45 @@ function init() <input type="checkbox" name="apac" onchange="onApidChange();" {=if-equal:{=TIMERD_APIDS_AC3=}~y~checked="checked"=}/>AC3 </td> </tr> - <tr id="StandbyRow" style="visibility:hidden"> + <tr id="StandbyRow" style="display:none"> <td>Standby</td> - <td><input type="radio" name="sbon" value="1" {=if-equal:{=standby=}~1~~checked="checked"=}/>On - <input type="radio" name="sbon" value="0" {=if-equal:{=standby=}~0~~checked="checked"=}/>Off + <td><input type="radio" name="sbon" value="1" {=if-equal:{=standby=}~1~~checked="checked"=}/>An + <input type="radio" name="sbon" value="0" {=if-equal:{=standby=}~0~~checked="checked"=}/>Aus </td> </tr> - <tr id="MessageRow" style="visibility:hidden"> - <td>New</td> + <tr id="MessageRow" style="display:none"> + <td>Nachricht</td> <td><input type="text" name="msg" value="{=message=}" size="20" maxlength="30"/> ('/'=NL) </td> </tr> - <tr id="PluginNameRow" style="visibility:hidden"> + <tr id="PluginNameRow" style="display:none"> <td>Plugin</td> <td><input type="text" name="PluginName" value="{=pluginname=}" size="20" maxlength="30"/> </td> </tr> -{=if-empty:{=timer_recordingDir=}~~ - <tr> - <td>List:</td> - <td><input type="text" name="rec_dir" value="{=timer_recordingDir=}" size="20" maxlength="{=RECORD_DIR_MAXLEN-1=}"/> + <tr id="RecDirRow" style="display:none"> + <td>Aufnahmeverzeichnis:</td> + <td> + <select name="rec_dir" id="rec_dir" class="y_live_button"> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_0;/mnt/filme~open=}" selected="selected">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_0;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_1;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_1;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_2;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_2;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_3;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_3;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_4;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_4;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_5;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_5;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_6;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_6;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_7;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_7;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_8;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_8;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_9;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_9;/mnt/filme~cache=}</option> + </select> </td> </tr> -=} </table> <br/> - - <input type="button" value="save" title="submit and save values" onclick="do_submit()"/> - <input type="button" value="abort" onclick='window.document.location.href="/Y_Timer_List.yhtm"'/> + +<!-- <input type="button" value="speichern" title="submit and save values" onclick="do_submit()"/>--> + <button type="button" ytype="save" title="submit and save values" onclick="do_submit()">speichern</button> + <button type="button" ytype="cancel" title="cancel" onclick='window.document.location.href="/Y_Timer_List.yhtm"'>abbrechen</button> </form> </div> </div> diff --git a/src/nhttpd/web/Y_Timer_List.yhtm b/src/nhttpd/web/Y_Timer_List.yhtm index cb0f14e75..0c86b68ef 100644 --- a/src/nhttpd/web/Y_Timer_List.yhtm +++ b/src/nhttpd/web/Y_Timer_List.yhtm @@ -4,18 +4,18 @@ <body> <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Live_Timer#Timer=}{=var-set:menu=Timer=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Live_Timer-Timer=}{=var-set:menu=Timer=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> -<table class="timer" border="0"> -<tr> - <td class="ctimer" align="center"><b>Alarm time</b></td> - <td class="ctimer" align="center"><b>Stop time</b></td> - <td class="ctimer" align="center"><b>Repeat</b></td> - <td class="ctimer" align="center"><b>Repeats</b></td> - <td class="ctimer" align="center"><b>Type</b></td> - <td class="ctimer" align="center"><b>Description</b></td> - <td class="ctimer">&nbsp;</td> - <td class="ctimer">&nbsp;</td> +<table class="timer"> +<tr class="timer_header"> + <td>Alarm-Zeit</td> + <td>Stop-Zeit</td> + <td>Wiederholung</td> + <td>Wiederholungen</td> + <td>Typ</td> + <td>Beschreibung</td> + <td>&nbsp;</td> + <td>&nbsp;</td> </tr> {=var-set:row= <tr class="%ctimer"> @@ -27,28 +27,27 @@ <td>%s<br/> <td> <a href="/fb/timer.dbox2?action=remove&amp;id=%d"> - <img src="/images/remove.png" alt="del Timer"/></a> + <img src="/images/remove.png" alt="Timer l&ouml;schen"/></a> </td> <td> <a href="/Y_Timer_Edit.yhtm?typ=modify&amp;tid=%d"> - <img src="/images/modify.png" alt="edit Timer"/></a> + <img src="/images/modify.png" alt="Timer &auml;ndern"/></a> </td> </tr> =} {=func:get_timer_list {=var-get:row=}=} -<tr> - <td class="atimer" colspan="6"><img src="/images/blank.gif" width="1" height="1"/></td> - <td class="atimer" align="center"> - <a href="javascript:location.reload()"> - <img src="/images/reload.gif" alt="Update"/></a> - </td> - <td class="atimer" align="center"> +<tr class="timer_footer"> + <td colspan="6"><img src="/images/blank.gif" width="1" height="1"/></td> + <td> <a href="/Y_Timer_Edit.yhtm?typ=new"> - <img src="/images/new.gif" alt="new Timer"/></a> + <img src="/images/new.png" alt="neuer Timer"/></a> + </td> + <td> + <a href="javascript:location.reload()"> + <img src="/images/reload.gif" alt="Aktualisieren"/></a> </td> </tr> - </table> </div> </div> diff --git a/src/nhttpd/web/Y_Tools_Bootlogo.yhtm b/src/nhttpd/web/Y_Tools_Bootlogo.yhtm index 9a740cdcb..1f2d6cf3e 100644 --- a/src/nhttpd/web/Y_Tools_Bootlogo.yhtm +++ b/src/nhttpd/web/Y_Tools_Bootlogo.yhtm @@ -2,7 +2,7 @@ <script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript"> //<![CDATA[ -function do_submit() +function do_submit() { show_waitbox(true); document.f.su.disabled=true; @@ -19,17 +19,21 @@ function do_submit() {=var-set:wait_text=Logo wird hochgeladen (Upload).=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Settings#Boot_Logo=}{=var-set:menu=Bootlogo / LCD=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Settings-Boot_Logo=}{=var-set:menu=Bootlogo / LCD=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <form name="f" method="post" enctype="multipart/form-data" action="/control/exec?Y_Tools&amp;bootlogo_upload"> <p> - <font size="2" color="Red">Achtung<br/>Das Boot-Logo muss schon im Zielformat vorliegen!</font><br/> + <div style="border: 1px solid #cccccc"> + <img src="/images/cross.png">&nbsp;<span><font size="2" color="Red"><b>Achtung</b>&nbsp;</font>Das Boot-Logo muss schon im Zielformat vorliegen! + </span></div> + <br /> <input type="radio" checked="checked" name="logotype" value="bootlogo_upload"/>Boot Logo<br/> - <input type="radio" name="logotype" value="bootlogo_lcd_upload"/>Boot LCD Logo<br/> - <input type="file" name="F1" size="20"/><br/> + <input type="radio" name="logotype" value="bootlogo_lcd_upload"/>Boot LCD Logo<br/><br/> + <input type="file" name="F1" size="30"/>&nbsp; <input type="button" name="su" value="hochladen" title="upload" onclick="do_submit()"/> </p> </form> + <br /> </div> </div> </body> diff --git a/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm b/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm index 32a027d8d..5f91dd2b0 100644 --- a/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm +++ b/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm @@ -1,15 +1,19 @@ {=var-set:cancache=yPyes=} {=include-block:Y_Blocks.txt;head=} <script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript" src="/prototype.js"></script> <script type="text/javascript"> //<![CDATA[ -function goConfirmUrl(_meld, _url) -{ +function goConfirmUrl(_meld, _url){ if (confirm(_meld)==true) goUrl(_url); } -function goUrl(_url) -{ - out.location.href = _url; +function goUrl(_url){ + var res = trim(loadSyncURL(_url)); + switch(res){ + case "1": res="on"; break; + case "0": res="off"; break; + } + $("out").update(res); } //]]> </script> @@ -17,61 +21,90 @@ function goUrl(_url) <body> <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:BoxControl#Control=}{=var-set:menu=Control=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-BoxControl-Control=}{=var-set:menu=Control=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <form action=""> - <table class="y_invisible_table" cellpadding="5"> - <tr><td class="y_form_header">Coolstream HD1</td><td class="y_form_header">Standby Mode</td></tr> + <table class="y_invisible_table" cellpadding="5" width="100%"> + <tr><td class="y_form_header">{=L:box=}</td><td class="y_form_header">{=L:standby_mode=}</td></tr> <tr> <td> - <input type="button" value="Restart" title="reboot" onclick='goConfirmUrl("Do you really want to reboot the dbox?","/control/reboot");'/> - <input type="button" value="Turn Off" title="shutdown" onclick='goConfirmUrl("Do you really want to turn the Dbox off?","/control/shutdown");'/> + <input type="button" value="{=L:reboot=}" title="reboot" onclick='goConfirmUrl("dbox wirklich neu starten?","/control/reboot");'/> + <input type="button" value="{=L:shutdown=}" title="shutdown" onclick='goConfirmUrl("dbox wirklich ausschalten?","/control/shutdown");'/> </td> <td> - <input type="button" value="On" onclick='goUrl("/control/standby?on");'/> - <input type="button" value="Off" onclick='goUrl("/control/standby?off");'/> - <input type="button" value="Status" onclick='goUrl("/control/exec?Y_Tools&amp;standby_status");'/> + <input type="button" value="{=L:on=}" onclick='goUrl("/control/standby?on");'/> + <input type="button" value="{=L:off=}" onclick='goUrl("/control/standby?off");'/> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <input type="button" value="{=L:status=}" onclick='goUrl("/control/exec?Y_Tools&amp;standby_status");'/> + ~=} </td> </tr> - <tr><td class="y_form_header">Playback</td><td class="y_form_header">Recording</td></tr> + <tr><td class="y_form_header">{=L:playback=}</td><td class="y_form_header">{=L:recording_mode=}</td></tr> <tr> <td> - <input type="button" value="On" onclick='goUrl("/control/zapto?startplayback");'/> - <input type="button" value="Off" onclick='goUrl("/control/zapto?stopplayback");'/> - <input type="button" value="Status" onclick='goUrl("/control/zapto?statusplayback");'/> + <input type="button" value="{=L:on=}" onclick='goUrl("/control/zapto?startplayback");'/> + <input type="button" value="{=L:off=}" onclick='goUrl("/control/zapto?stopplayback");'/> + <input type="button" value="{=L:status=}" onclick='goUrl("/control/zapto?statusplayback");'/> </td> <td> - <input type="button" value="On" onclick='goUrl("/control/setmode?record=start");'/> - <input type="button" value="Off" onclick='goUrl("/control/setmode?record=stop");'/> - <input type="button" value="Status" onclick='goUrl("/control/setmode?status");'/> + <input type="button" value="{=L:on=}" onclick='goUrl("/control/setmode?record=start");'/> + <input type="button" value="{=L:off=}" onclick='goUrl("/control/setmode?record=stop");'/> + <input type="button" value="{=L:status=}" onclick='goUrl("/control/setmode?status");'/> </td> </tr> - <tr><td class="y_form_header">Remote Control</td><td class="y_form_header">Live Lock</td></tr> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <tr><td class="y_form_header">{=L:epg_sectiond=}</td><td class="y_form_header">{=L:spts=}</td></tr> <tr> <td> - <input type="button" value="On" onclick='goUrl("/control/rc?unlock");'/> - <input type="button" value="Off" onclick='goUrl("/control/rc?lock");'/> - <input type="button" value="LCD Unlock" onclick='goUrl("/control/exec?Y_Live&amp;live_LCD_off");'/> + <input type="button" value="{=L:on=}" onclick='goUrl("/control/zapto?startsectionsd");'/> + <input type="button" value="{=L:off=}" onclick='goUrl("/control/zapto?stopsectionsd");'/> + <input type="button" value="{=L:status=}" onclick='goUrl("/control/zapto?statussectionsd");'/> + <input type="button" value="{=L:restart=}" onclick='goUrl("/control/zapto?restartsectionsd");'/> + <input type="button" value="{=L:freemem=}" onclick='goUrl("/control/zapto?freememsectionsd");'/> </td> <td> - <input type="button" value="Lock" onclick='live_lock();'/> - <input type="button" value="Unlock" onclick='live_unlock();'/> + <input type="button" value="{=L:on=}" onclick='goUrl("/control/system?setAViAExtPlayBack=spts");'/> + <input type="button" value="{=L:off=}" onclick='goUrl("/control/system?setAViAExtPlayBack=pes");'/> + <input type="button" value="{=L:status=}" onclick='goUrl("/control/system?getAViAExtPlayBack");'/> </td> </tr> -<!--dbox2 only <tr><td class="y_form_header">Optical Output</td><td class="y_form_header">&nbsp;</td></tr> - <tr> dbox2 only--> -<!--dbox2 only <td> - <input type="button" value="On" onclick='goUrl("/control/system?setAViAExtIec=on");'/> - <input type="button" value="OFF" onclick='goUrl("/control/system?setAViAExtIec=off");'/> - <input type="button" value="Status" onclick='goUrl("/control/system?getAViAExtIec");'/> - </td> dbox2 only--> + ~=} + <tr><td class="y_form_header">{=L:remote=}</td><td class="y_form_header">{=L:live_lock=}</td></tr> + <tr> <td> - </tr> + <input type="button" value="{=L:on=}" onclick='goUrl("/control/rc?unlock");'/> + <input type="button" value="{=L:off=}" onclick='goUrl("/control/rc?lock");'/> + <input type="button" value="{=L:lcd_unlock=}" onclick='goUrl("/control/exec?Y_Live&amp;live_unlock");'/> + </td> + <td> + <input type="button" value="{=L:lock=}" onclick='live_lock();' /> + <input type="button" value="{=L:unlock=}" onclick='live_unlock();' /> + </td> + </tr> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <tr><td class="y_form_header">{=L:optical_output=}</td><td class="y_form_header">{=L:esound_server=}</td></tr> + <tr> + <td> + <input type="button" value="{=L:on=}" onclick='goUrl("/control/system?setAViAExtIec=on");'/> + <input type="button" value="{=L:off=}" onclick='goUrl("/control/system?setAViAExtIec=off");'/> + <input type="button" value="{=L:status=}" onclick='goUrl("/control/system?getAViAExtIec");'/> + </td> + <td> + <input type="button" value="{=L:on=}" onclick='goUrl("/control/esound?on");'/> + <input type="button" value="{=L:off=}" onclick='goUrl("/control/esound?off");'/> + </td> + </tr> + ~=} </table> </form> </div> </div> -<iframe name="out" id="out" width="100%" height="200" align="left" frameborder="0">Your Browser does not support IFrames.</iframe> - +<div class="work_box"> + <div class="work_box_head"><div class="work_box_head_h2"> + {=var-set:help_url=Help-BoxControl-Control=}{=var-set:menu={=L:answer=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + <div class="work_box_body"> + <div id="out"></div> + </div> +</div> </body> </html> diff --git a/src/nhttpd/web/Y_Tools_Check_Install.yhtm b/src/nhttpd/web/Y_Tools_Check_Install.yhtm index 1aba765e8..06a285dac 100644 --- a/src/nhttpd/web/Y_Tools_Check_Install.yhtm +++ b/src/nhttpd/web/Y_Tools_Check_Install.yhtm @@ -1,118 +1,145 @@ {=include-block:Y_Blocks.txt;head=} <script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript" src="/prototype.js"></script> <script type="text/javascript"> //<![CDATA[ +function do_start(){ + $('statusline').show(); + do_check(); +} +function do_stop(){ + $('statusline').hide(); +} /*sLog*/ var sLog_body; var sLog_line_number; -function sLog_init() -{ +function sLog_init(){ sLog_line_number = 0; sLog_body=document.getElementById("slog_list"); } -function sLog_clear() -{ - while(sLog_body.childNodes.length > 0) - { +function sLog_clear(){ + while(sLog_body.childNodes.length > 0) { aChild=sLog_body.firstChild; sLog_body.removeChild(aChild); } sLog_line_number = 0; } -function sLog_addRow(_body, state, action_text, state_text) -{ +function sLog_addRow(_body, state, action_text, state_text){ sLog_line_number++; var mycurrent_row = y_add_row_to_table(_body, ((sLog_line_number % 2) ==0)?"a":"b" ); var __img ="/images/ok.gif"; - switch (state) - { - case "green": __img = "/images/check_green.gif"; break; - case "yellow": __img = "/images/excl_yellow.gif"; break; - case "ok": __img = "/images/ok.gif"; break; - case "red": __img = "/images/x_red.gif"; break; + switch (state) { + case "green": __img = "/images/accept.png"; break; + case "yellow": __img = "/images/alert.gif"; break; + case "ok": __img = "/images/accept.png"; break; + case "red": __img = "/images/remove.png"; break; } y_add_html_cell_to_row(mycurrent_row, "icon", "<img src='"+__img+"'>"); y_add_html_cell_to_row(mycurrent_row, "action_text", action_text); y_add_text_cell_to_row(mycurrent_row, "state_text", state_text); } /*check*/ -function wiki_url(_page) -{ - return "<a href=\"http://wiki.tuxbox.org/"+_page+"\" target='_blank'><b>[Help]<\/b><\/a>" +function wiki_url(_page){ + return "<a href=\"http://wiki.dbox2-tuning.net/"+_page+"\" target='_blank'><b>[Help]<\/b><\/a>" } -function do_check() -{ +function y_url(_page){ + return "<a href=\"http://www.yjogol.com/"+_page+"\" target='_blank'><b>[Help]<\/b><\/a>" +} +function do_check(){ sLog_init(); sLog_clear(); sLog_addRow(sLog_body, "ok", "yWeb Version is: {=ini-get:Y_Version.txt;version=} {=ini-get:Y_Version.txt;date=}", "ok"); - + /*webserver*/ - var needed_nhttpd_version = "3.1.2"; + var needed_nhttpd_version = "3.1.8"; var nhttpd_version = loadSyncURL("/control/info?nhttpd_version"); if(nhttpd_version.search(/error/)!=-1) nhttpd_version = "0.0.0-unknown"; if(nhttpd_version < needed_nhttpd_version) sLog_addRow(sLog_body, "red", "WebServer: version: "+nhttpd_version+" version needed: "+needed_nhttpd_version+ - " <a href='http://www.yjogol.de/yFAQ.htm#diy' target='_blank'><b>[Help]<\/b><\/a>", "fail"); + " <a href='http://www.yjogol.com/yFAQ.htm#diy' target='_blank'><b>[Help]<\/b><\/a>", "fail"); else sLog_addRow(sLog_body, "green", "WebServer: version is "+nhttpd_version, "ok"); - + {=if-equal:{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_auth.authenticate;false=}~false~~ - sLog_addRow(sLog_body, "yellow", "WebServer: Authentication is on. "+wiki_url("Neutrino:yWeb:Settings#Webserver"), "notice"); + sLog_addRow(sLog_body, "yellow", "WebServer: Authentication is on. "+y_url("Help-Settings-Webserver"), "notice"); =} {=if-equal:{=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.port;80=}~80~~ - sLog_addRow(sLog_body, "yellow", + sLog_addRow(sLog_body, "yellow", "WebServer: not set to Standard-Port. Actual: {=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.port;80=} "+wiki_url("Neutrino:yWeb#Webserver"), "notice"); =} - /*settings*/ + /*settings*/ {=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip=}~~ - sLog_addRow(sLog_body, "yellow", + sLog_addRow(sLog_body, "yellow", "Settings: Management IP(1) is set to {=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip=} ! Your IP is {=func:get_request_data client_addr=}. " - +wiki_url("Neutrino:yWeb:Settings#yWeb"), "notice"); + +wiki_url("Help-Settings-yWeb"), "notice"); =} {=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~~ - sLog_addRow(sLog_body, "yellow", + sLog_addRow(sLog_body, "yellow", "Settings: Management IP(2) is set to {=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=} ! Your IP is {=func:get_request_data client_addr=}. " +wiki_url("Neutrino:yWeb#yWeb"), "notice"); =} - + /*programs*/ {=var-set:fbshot={=if-file-exists:/bin/fbshot~/bin/fbshot~{=if-file-exists:/var/bin/fbshot~/var/bin/fbshot~false=}=}=} {=if-equal:{=var-get:fbshot=}~false~ - sLog_addRow(sLog_body, "red", "Programs: fbshot is not installed. OSD Screenshot is disabled. "+wiki_url("Neutrino:yWeb:BoxControl#OSD_Screenshot"), "failed"); + sLog_addRow(sLog_body, "red", "Programs: fbshot is not installed. OSD Screenshot is disabled. "+y_url("Help-BoxControl-OSD_Screenshot"), "failed"); ~ sLog_addRow(sLog_body, "green", "Programs: fbshot is installed at: {=var-get:fbshot=}. OSD Screenshot is enabled.", "ok"); =} {=var-set:dboxshot={=if-file-exists:/bin/dboxshot~/bin/dboxshot~{=if-file-exists:/var/bin/dboxshot~/var/bin/dboxshot~false=}=}=} {=if-equal:{=var-get:dboxshot=}~false~ - sLog_addRow(sLog_body, "red", "Programs: dboxshot is not installed. Remote &amp; OSD is disabled. <a href='http://www.yjogol.de/yFAQ.htm#diy' target='_blank'><b>[Download]<\/b><\/a>", "failed"); + sLog_addRow(sLog_body, "red", "Programs: dboxshot is not installed. Remote &amp; OSD is disabled. <a href='http://www.yjogol.com/faq-diy' target='_blank'><b>[Download]<\/b><\/a>", "failed"); ~ sLog_addRow(sLog_body, "green", "Programs: dboxshot is installed at: {=var-get:dboxshot=}. Remote &amp; OSD is enabled.", "ok"); =} {=var-set:fcp={=if-file-exists:/sbin/fcp~/sbin/fcp~{=if-file-exists:/var/bin/fcp~/var/bin/fcp~{=if-file-exists:/bin/fcp~/bin/fcp~false=}=}=}=} {=if-equal:{=var-get:fcp=}~false~ - sLog_addRow(sLog_body, "red", "Programs: fcp is not installed. Image flashing is disabled. "+wiki_url("Neutrino:yWeb:Tools#Image"), "failed"); + sLog_addRow(sLog_body, "red", "Programs: fcp is not installed. Image flashing is disabled. "+y_url("Help-Tools-Image"), "failed"); ~ sLog_addRow(sLog_body, "green", "Programs: fcp is installed at: {=var-get:fcp=}. Image flashing is enabled.", "ok"); =} {=var-set:etherwake={=if-file-exists:/bin/etherwake~/bin/etherwake~{=if-file-exists:/var/bin/etherwake~/var/bin/etherwake~false=}=}=} {=if-equal:{=var-get:etherwake=}~false~ - sLog_addRow(sLog_body, "red", "Programs: etherwake is not installed. Wake on LAN is disabled. "+wiki_url("Neutrino:yWeb:Tools#Wake_on_LAN"), "failed"); + sLog_addRow(sLog_body, "red", "Programs: etherwake is not installed. Wake on LAN is disabled. "+y_url("Help-Tools-Wake_on_LAN"), "failed"); ~ sLog_addRow(sLog_body, "green", "Programs: etherwake is installed at: {=var-get:etherwake=}. Wake on LAN is enabled.", "ok"); =} + /*automount*/ + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ {=var-set:automount={=if-file-exists:/sbin/automount~/sbin/automount~{=if-file-exists:/var/bin/automount~/var/bin/automount~false=}=}=} {=if-equal:{=var-get:automount=}~false~ - sLog_addRow(sLog_body, "red", "Programs: automount is not installed. AutoMount is disabled. "+wiki_url("Neutrino:yWeb:Tools#AutoMount"), "failed"); + sLog_addRow(sLog_body, "red", "Programs: automount is not installed. AutoMount is disabled. "+y_url("Help-Tools-AutoMount"), "failed"); ~ sLog_addRow(sLog_body, "green", "Programs: automount is installed at: {=var-get:automount=}. AutoMount is enabled.", "ok"); =} + ~=} {=var-set:udpstreamts={=if-file-exists:/sbin/udpstreamts~/sbin/udpstreamts~{=if-file-exists:/var/bin/udpstreamts~/var/bin/udpstreamts~false=}=}=} {=if-equal:{=var-get:udpstreamts=}~false~ - sLog_addRow(sLog_body, "red", "Programs: udpstreamts is not installed. udp-streaming is disabled. "+wiki_url("Neutrino:yWeb:Live:Timer#UDP_Streaming"), "failed"); + sLog_addRow(sLog_body, "red", "Programs: udpstreamts is not installed. udp-streaming is disabled. "+y_url("Help-Live_Timer-UDP_Streaming"), "failed"); ~ sLog_addRow(sLog_body, "green", "Programs: udpstreamts is installed at: {=var-get:udpstreamts=}. udp-streaming is enabled.", "ok"); =} + + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + /*ucodes*/ + {=if-file-exists:/var/tuxbox/ucodes/avia500.ux~ + sLog_addRow(sLog_body, "green", "Ucodes: avia500.ux found", "ok"); + ~ + sLog_addRow(sLog_body, "yellow", "Ucodes: avia500.ux not found. "+wiki_url("Ucodes"), "notice"); + =} + {=if-file-exists:/var/tuxbox/ucodes/avia600.ux~ + sLog_addRow(sLog_body, "green", "Ucodes: avia600.ux found", "ok"); + ~ + sLog_addRow(sLog_body, "yellow", "Ucodes: avia600.ux not found. "+wiki_url("Ucodes"), "notice"); + =} + {=if-file-exists:/var/tuxbox/ucodes/cam-alpha.bin~ + sLog_addRow(sLog_body, "green", "Ucodes: cam-alpha found", "ok"); + ~ + sLog_addRow(sLog_body, "red", "Ucodes: cam-alpha not found. "+wiki_url("Ucodes"), "failed"); + =} + ~=} + do_stop(); } //]]> </script> @@ -121,19 +148,16 @@ function do_check() <div class="work_box"> <div class="work_box_head"> <div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Tools#Check_Install=}{=var-set:menu=Check Install=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Tools-Check_Install=}{=var-set:menu=Check Install=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <br /> - <form method="post" name="f" action=""> - <input type="button" value="check" title="check" name="check" onclick="do_check()"/>&nbsp; - </form> - + <div id="statusline"><img border="0" src="/images/wait.gif" width="20" height="20" alt="wait"/> + <span id="status">collecting information</span></div> <form method="post" name="log" action=""> - <b>Check Results</b><br/> - <table class="y_work_table" cellpadding="4"> + <table border="0" cellspacing="0" cellpadding="4" width="100%"> <thead align="left"> <tr> - <th>&nbsp;</th><th>Aktion</th><th>Status</th> + <th class="y_form_header">&nbsp;</th><th class="y_form_header">Aktion</th><th class="y_form_header">Status</th> </tr> </thead> <tbody id="slog_list"> @@ -144,5 +168,10 @@ function do_check() </form> </div> </div> +<script type="text/javascript"> +//<![CDATA[ + window.setTimeout("do_start();",500); +//]]> +</script> </body> -</html> \ No newline at end of file +</html> diff --git a/src/nhttpd/web/Y_Tools_Cmd.yhtm b/src/nhttpd/web/Y_Tools_Cmd.yhtm index d3cff727f..a3625a55d 100644 --- a/src/nhttpd/web/Y_Tools_Cmd.yhtm +++ b/src/nhttpd/web/Y_Tools_Cmd.yhtm @@ -4,7 +4,7 @@ <script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript"> //<![CDATA[ -function do_submit() +function do_submit() { if(document.f.cmd.value != "") { @@ -16,16 +16,16 @@ function do_submit() document.f.cmd.value=""; } } -function set_pwd(_pwd) +function set_pwd(_pwd) { document.f.pwd.value = _pwd; } -function do_clear() +function do_clear() { document.co.cmds.value = ""; } /* Cursor to end . works only with IE */ -function setCaretToEnd(control) +function setCaretToEnd(control) { if (control.createTextRange) { var range = control.createTextRange(); @@ -48,7 +48,7 @@ function doUpload() <body> <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Tools#Command_Shell=}{=var-set:menu=Command Shell=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Tools-Command_Shell=}{=var-set:menu=Command Shell=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <form name="co" action=""> <textarea name="cmds" cols="80" rows="18" title="shell output window" style="display: block;background : white; font : 'Courier New','medium monospace'; color : #436976;"></textarea> @@ -58,7 +58,7 @@ function doUpload() <table> <tr> <td><input type="button" name="clear" value="clear" title="clear output screeb" onclick="do_clear()"/></td> - <td><input type="checkbox" name="appendx" value="1" title="append output (only IE)"/>append output (only IE scrollen) + <td><input type="checkbox" name="appendx" value="1" title="append output (only IE)"/>&nbsp;fortlaufende Ausgabe (nur IE - wg. scrollen) <!--<input type="button" value="Upload" title="upload a file to current directory" onClick="doUpload()">--> </td> </tr><tr> diff --git a/src/nhttpd/web/Y_Tools_Flash_Menue.yhtm b/src/nhttpd/web/Y_Tools_Flash_Menue.yhtm index dbc0ce317..1636af42d 100644 --- a/src/nhttpd/web/Y_Tools_Flash_Menue.yhtm +++ b/src/nhttpd/web/Y_Tools_Flash_Menue.yhtm @@ -1,68 +1,14 @@ {=include-block:Y_Blocks.txt;management_check_top=} {=include-block:Y_Blocks.txt;head=} <script type="text/javascript" src="/Y_Baselib.js"></script> -<script type="text/javascript"> -//<![CDATA[ -function show_download_box(_show) -{ - var obj = document.getElementById("download_box"); - obj.style.visibility= (_show) ? "visible" : "hidden"; -} -function do_image_upload_dialog() -{ - var nr=0; - for(i=0; i<document.f.R1.length;i++) - if(document.f.elements[i].name == "R1") - if(document.f.elements[i].checked == true) - { - nr = document.f.elements[i].value; - document.f.mtd_text.value = document.f.elements[i].title; - } - document.f.mtd.value = nr; - document.f.execute.value = "script:Y_Tools image_flash_free_tmp"; - document.f.tmpl.value = "Y_Tools_Flash_Upload.yhtm"; - document.f.submit(); -} -function do_image_download() -{ - show_waitbox(true); - document.f.download.disabled = true; - document.f.upload.disabled = true; - window.setTimeout("do_image_download_2()",100); - /*setTimeout:refresh output*/ -} -function do_image_download_2() -{ - var nr=0; - for(i=0; i<document.f.R1.length;i++) - if(document.f.elements[i].name == "R1") - if(document.f.elements[i].checked == true) - nr = document.f.elements[i].value; - var res = loadSyncURL("/control/exec?Y_Tools&image_backup&"+nr); - document.getElementById("download_link").href = res; - document.f.download.disabled = false; - document.f.upload.disabled = false; - show_waitbox(false); - show_download_box(true); -} -function goConfirmUrl(_meld, _url) -{ - if (confirm(_meld)==true) - loadSyncURL(_url); -} -function image_delete() -{ - var res = loadSyncURL("/control/exec?Y_Tools&image_delete"); - show_download_box(false); -} -//]]> -</script> +<script type="text/javascript" src="/prototype.js"></script> +<script type="text/javascript" src="/Y_Flash.js"></script> </head> <body> -{=var-set:wait_text=Image will be generated (create image).=}{=include-block:Y_Blocks.txt;snip_wait=} +{=var-set:wait_text=Image wird erstellt (create image).=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"> - <div class="work_box_head_h2">{=var-set:help_url=Neutrino:yWeb:Tools#Image=}{=var-set:menu=Image=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + <div class="work_box_head_h2">{=var-set:help_url=Help-Tools-Image=}{=var-set:menu=Image=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <b><font size="2">Partition</font></b><br/> <form action="/y/cgi" name="f" id="f"> @@ -71,28 +17,28 @@ function image_delete() <input type="hidden" name="execute" value=""/> <input type="hidden" name="mtd_text" value=""/> <input type="hidden" name="mtd" value=""/> - <input type="button" name="download" value="Download" title="Generate Image for download" onclick="do_image_download()"/> - <input type="button" name="upload" value="Flash ..." title="go to Upload Dialog" onclick="do_image_upload_dialog()"/> + <button type="button" ytype="download" name="download" title="Generate Image for download" onclick="do_image_download()">Download</button> + <button type="button" ytype="flash" name="upload" title="go to Upload Dialog" onclick="do_image_upload_dialog()">Flash ...</button> </form> </div> </div> <div style="clear:both">&nbsp;</div> <div class="work_box"> - <div class="work_box_head"><h2>Instruction</h2></div> + <div class="work_box_head"><h2>Hinweis</h2></div> <div class="work_box_body" title="You should reboot the box before flashing"> - It is usefull to reboot the Box before flashing.<br/> - <input type=button value="Restart" title="reboot" onclick='goConfirmUrl("dbox wirklich neu starten?","/control/reboot");'/> + Es ist sinnvoll die Box vor dem flashen frisch zu booten.<br/> + <button type=button ytype="reboot" title="reboot" onclick='goConfirmUrl("dbox wirklich neu starten?","/control/reboot");'>Neu starten</button> </div> </div> <div style="clear:both">&nbsp;</div> -<div class="work_box" id="download_box" style="visibility : hidden;"> +<div class="work_box" id="download_box" style="display: none;"> <div class="work_box_head"><h2>Download</h2></div> <div class="work_box_body" title="Download your image"> - <b>The image was provided.</b> + <b>Das Image wurde erstellt.</b> <p> 1) <a id="download_link" type="application/octet-stream" href=""><u>Download</u></a><br/><br/> - 2) <a href='javascript:image_delete();'><u>Download ready. Image in /tmp placed.</u></a> + 2) <a href='javascript:image_delete();'><u>Download fertig. Image in /tmp loeschen.</u></a> </p> </div> </div> diff --git a/src/nhttpd/web/Y_Tools_Flash_Upload.yhtm b/src/nhttpd/web/Y_Tools_Flash_Upload.yhtm index da5b5ecbb..ad039693e 100644 --- a/src/nhttpd/web/Y_Tools_Flash_Upload.yhtm +++ b/src/nhttpd/web/Y_Tools_Flash_Upload.yhtm @@ -1,154 +1,85 @@ {=include-block:Y_Blocks.txt;management_check_top=} {=include-block:Y_Blocks.txt;head=} <script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript" src="/prototype.js"></script> +<script type="text/javascript" src="/Y_Flash.js"></script> <script type="text/javascript"> //<![CDATA[ -var aktiv; -var flashing = false; - -function show_progress(_msg,_type,_proz) -{ - var __msg = document.getElementById("msg"); - __msg.value = _msg; - if(_type == 1) - document.getElementById("erasing_left").width = _proz; - else if(_type == 2) - { - document.getElementById("erasing_left").width = "100%"; - document.getElementById("writing_left").width = _proz;; - } - else if(_type == 3) - { - document.getElementById("writing_left").width = "100%"; - document.getElementById("verifying_left").width = _proz;; - } -} -/* load fcp status from /tmp/e.txt*/ -function processReqChange() -{ - if (g_req.readyState == 4) { - if (g_req.status == 200) - { - var last = g_req.responseText.lastIndexOf("\r"); - var last_line = g_req.responseText.slice(last+1, g_req.responseText.length); - var _type = 0; - if(last_line.search(/Erasing/)!=-1) - _type = 1; - if(last_line.search(/Writing/)!=-1) - _type = 2; - if(last_line.search(/Verifying/)!=-1) - _type = 3; - var Ausdruck = /\((.*)\)/; - var e=Ausdruck.exec(last_line); - var p = RegExp.$1; - show_progress(last_line, _type, p); - } - } -} -function do_submit() -{ - var msg = "Image flashen?"; - if(document.f.demo.checked) - msg = "DEMO: "+msg; - if(confirm(msg)==true) - { - show_waitbox(true); - document.f.submit(); - document.f.su.disabled = true; - document.f.file.disabled = true; - document.f.demo.disabled = true; - } -} -function do_image_upload_ready() +function do_image_upload_ready() { show_waitbox(false); - show_obj("wait_flash", true); - aktiv = window.setInterval('loadXMLDoc("/tmp/e.txt", processReqChange)', 3000); + $('wait_flash').show(); + loadSyncURL("/control/lcd?lock=1&clear=1&xpos=10&ypos=27&size=20&font=2&text=yWeb%20flashing&update=1"); + + aktiv = window.setInterval('progress_get()', 3000); var simulate = "true"; if(!document.f.demo.checked) simulate = "false"; window.setTimeout("out.location.href = \"/control/exec?Y_Tools&image_flash&{=mtd=}&"+simulate+"\"",1000); } -function do_image_upload_ready_error() -{ - document.f.su.disabled = false; - document.f.file.disabled = false; - document.f.demo.disabled = false; - show_waitbox(false); -} -function do_image_flash_ready() -{ - window.clearInterval(aktiv); - show_obj("wait_flash", false); - alert("Image geflasht. Nach Reboot OK druecken"); - top.location.href="/"; -} -function do_test() -{ - show_obj("wait_flash", true); -} -//]]>div +//]]> </script> </head> <body> {=var-set:fcp={=if-file-exists:/sbin/fcp~true~{=if-file-exists:/var/bin/fcp~true~{=if-file-exists:/bin/fcp~true~false=}=}=}=} {=var-set:wait_text=Image wird hochgeladen (upload image).=}{=include-block:Y_Blocks.txt;snip_wait=} -<div id="wait_flash" class="y_wait_box" style="left : 100px; position : absolute; top : 100px; visibility : hidden; z-index : 6;"> +<div id="wait_flash" class="ydiagfree" style="left: 100px; position: absolute; top: 100px; display: none;"> +<div class="y_wait_box_visible"> <div class="y_wait_box_head"><h2>Flashing</h2></div> <div class="y_wait_box_body"> - <p align="center"> - <font color="#666666"><b>Image wird geflasht. Nicht unterbrechen!<br/>Image will be flashed. Do not interrupt!</b></font><br/><br/> - <img border="0" src="/images/wait.gif" width="20" height="20" alt="wait"/><br/><br/> - <input type="text" id="msg" value="" size="40" readonly="readonly" disabled="disabled"/> - </p> + <div style="text-align:center;white-space:nowrap;"> + <div style="font-weight:bold;color:#666666;">Image wird geflasht. Nicht unterbrechen!<br/>Image will be flashed. Do not interrupt!</div> + <br/> + <input type="text" id="msg" value="" size="40" readonly="readonly" disabled="disabled"/><br/> + <img border="0" src="/images/wait.gif" width="20" height="20" alt="wait"/><br/> + </div> <table border="0" style="margin-left:30px;margin-right:30px;"> <tr><td>Erasing</td> <td> - <table width="250" style="border: 1px dashed #0066cc;"> + <table width="250" style="border: 1px solid #0066cc;" cellspacing="0" cellpadding="0"> <tr> - <td width="0%" bgcolor="#2188e0" id="erasing_left" height="5"><img src="/images/blank.gif" height="1" width="0" alt="blank"/></td> + <td width="0%" bgcolor="#2188e0" id="erasing_left" height="10"><img src="/images/blank.gif" height="1" width="0" alt="blank"/></td> <td id="erasing_right" width="100%"><img src="/images/blank.gif" height="1" width="0" alt="blank"/></td> </tr> </table> </td></tr> <tr><td>Writing</td> <td> - <table width="250" style="border: 1px dashed #0066cc;"> + <table width="250" style="border: 1px solid #0066cc;" cellspacing="0" cellpadding="0"> <tr> - <td id="writing_left" width="0%" bgcolor="#2188e0" height="5"><img src="/images/blank.gif" height="1" width="0" alt="blank"/></td> + <td id="writing_left" width="0%" bgcolor="#2188e0" height="10"><img src="/images/blank.gif" height="1" width="0" alt="blank"/></td> <td id="writing_right" width="100%"><img src="/images/blank.gif" height="1" width="0" alt="blank"/></td> </tr> </table> </td></tr> <tr><td>Verifying</td> <td> - <table width="250" style="border: 1px dashed #0066cc;"> + <table width="250" style="border: 1px solid #0066cc;" cellspacing="0" cellpadding="0"> <tr> - <td id="verifying_left" width="0%" bgcolor="#2188e0" height="5"><img src="/images/blank.gif" height="1" width="0" alt="blank"/></td> + <td id="verifying_left" width="0%" bgcolor="#2188e0" height="10"><img src="/images/blank.gif" height="1" width="0" alt="blank"/></td> <td id="verifying_right" width="100%"><img src="/images/blank.gif" height="1" width="0" alt="blank"/></td> </tr> </table> </td></tr> </table> - <p align="center"> - Please wait<br/> - - </p> + <div style="text-align:center;white-space:nowrap;"> + Bitte warten<br/> + Please wait + </div> </div> </div> - +</div> <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Tools#Image=}{=var-set:menu=Image flashen=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Tools-Image=}{=var-set:menu=Image flashen=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <b><font size="2">Partition mtd {=mtd=}</font><br/>{=mtd_text=}</b> {=if-equal:{=var-get:fcp=}~true~ - <form method="post" name="f" enctype="multipart/form-data" action="/control/exec?Y_Tools&amp;image_upload" target="out"> + <form method="post" name="f" id="f" enctype="multipart/form-data" action="/control/exec?Y_Tools&amp;image_upload" target="out"> <p> <input type="file" name="file" size="40"/><br/> <span style="margin:0; padding:0;" title="Switch on Demo-Modus. Flashing will be simulated."><input type="checkbox" name="demo"/> Demomodus&nbsp;</span> - <input type="button" value="Image flashen" title="upload and flash" name="su" onclick="do_submit()"/><br/> - + <button type="button" ytype="flash" title="upload and flash" name="su" onclick="do_submit()">Image flashen</button><br/> </p> </form> ~ diff --git a/src/nhttpd/web/Y_Tools_Info_Menue.yhtm b/src/nhttpd/web/Y_Tools_Info_Menue.yhtm index 815356ce2..3f185ee5d 100644 --- a/src/nhttpd/web/Y_Tools_Info_Menue.yhtm +++ b/src/nhttpd/web/Y_Tools_Info_Menue.yhtm @@ -1,10 +1,10 @@ -{=var-set:cancache=yPyes=} {=include-block:Y_Blocks.txt;head=} +<script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript"> //<![CDATA[ -function goUrl(_url) -{ - parent.frames[1].location.href = _url; +function goUrl(_url){ + var res = loadSyncURL(_url); + id("out").innerHTML = res; } //]]> </script> @@ -12,22 +12,22 @@ function goUrl(_url) <body> <div class="work_box"> <div class="work_box_head"> - <div class="work_box_head_h2">{=var-set:help_url=Neutrino:yWeb#Info=}{=var-set:menu=Info=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + <div class="work_box_head_h2">{=var-set:help_url=Help-Tools-Info=}{=var-set:menu=Info=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <form action=""> - <table class="y_invisible_table" cellpadding="8"> + <table class="y_invisible_table" cellpadding="5" width="100%"> <tr><td class="y_form_header">Linux</td></tr> <tr><td> - <input type="button" value="Kernel Messages" title="show Linux kernel stack messages" onclick='goUrl("/control/exec?Y_Tools&amp;kernel-stack");'/> - <input type="button" value="Processes" title="show currently running processes" onclick='goUrl("/control/exec?Y_Tools&amp;ps");'/> - <input type="button" value="Memory" title="show memory space" onclick='goUrl("/control/exec?Y_Tools&amp;free");'/> + <input type="button" value="Kernel Meldungen" title="show Linux kernel stack messages" onclick='goUrl("/control/exec?Y_Tools&amp;kernel-stack");'/> + <input type="button" value="Prozesse" title="show currently running processes" onclick='goUrl("/control/exec?Y_Tools&amp;ps");'/> + <input type="button" value="Speicher" title="show memory space" onclick='goUrl("/control/exec?Y_Tools&amp;free");'/> </td></tr> - <tr><td class="y_form_header">Coolstream HD1</td></tr> + <tr><td class="y_form_header">Box</td></tr> <tr><td> - <input type="button" value="GUI Info" onclick='goUrl("/control/info");'/> + <input type="button" value="Info" onclick='goUrl("/control/info");'/> <input type="button" value="Version" onclick='goUrl("/control/info?version");'/> - <!--dbox2 only <input type="button" value="Settings" onclick='goUrl("/control/info?settings");'/> dbox2 only--> - <input type="button" value="Time" onclick='goUrl("/control/gettime");'/> + <input type="button" value="Settings" onclick='goUrl("/control/info?settings");'/> + <input type="button" value="Box Zeit" onclick='goUrl("/control/gettime");'/> </td></tr> <tr><td class="y_form_header">proc</td></tr> <tr><td> @@ -42,6 +42,7 @@ function goUrl(_url) </form> </div> </div> +<div id="out"></div> </body> </html> \ No newline at end of file diff --git a/src/nhttpd/web/Y_Tools_Installer.yhtm b/src/nhttpd/web/Y_Tools_Installer.yhtm index 1069c1a1a..f556e19dd 100644 --- a/src/nhttpd/web/Y_Tools_Installer.yhtm +++ b/src/nhttpd/web/Y_Tools_Installer.yhtm @@ -4,35 +4,50 @@ <script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript"> //<![CDATA[ -function do_submit() +function do_submit() { if(document.f.filename.value != "") { out.location.href = "Y_Wait.yhtm"; document.f.su.disabled=true; yhttpd_cache_clear("yPInstall"); - yhttpd_cache_clear(''); + yhttpd_cache_clear(''); window.setTimeout("document.f.submit()",1000); document.f.su.disabled=false; } else alert("No file given!"); } +function init(){ + var res=dbox_exec_tools("var_space"); + var Ausdruck = /([^ ]*)[ ]*([^ ]*)[ ]*([^ ]*)[ ]*([^ ]*)[ ]*([^ ]*)[ ]*([^ ]*).*$/; + Ausdruck.exec(res); + var total = RegExp.$2; + var used = RegExp.$3; + var avaiable = RegExp.$4; + var percentage = RegExp.$5; + if(total != "") + str="Platz in /var Gesamt: "+total+"k Benutzt: "+used+"k Frei: "+avaiable+"k Anteil benutzt: "+percentage; + else + str="Kann freien Speicherplatz nicht ermitteln /var ist keine Partition! JFFS2 oder YADD?"; + id("free").innerHTML=str; +} //]]>div </script> </head> -<body> +<body onload="init()"> <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Tools#yInstaller=}{=var-set:menu=yInstaller=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Tools-yInstaller=}{=var-set:menu=yInstaller=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <form name="f" method="post" enctype="multipart/form-data" action="/control/exec?Y_Tools&amp;installer" target="out"> tar-File:&nbsp;<input type="file" name="filename" size="70"/>&nbsp;<br/> - <input type="button" name="su" value="install" title="upload and install" onclick="do_submit()"/> + <input type="button" name="su" value="installieren" title="upload and install" onclick="do_submit()"/> <br/><br/> </form> - <div style="height:290px;width:540px;"> - <iframe height="250" width="500" scrolling="no" align="left" frameborder="0" name="out" id="out">Your Browser does not support IFrames.</iframe> + <div id="free"></div> + <div style="height:290px;width:740px;"> + <iframe height="250" width="750" scrolling="auto" align="left" frameborder="0" name="out" id="out">Your Browser does not support IFrames.</iframe> </div> </div> </div> diff --git a/src/nhttpd/web/Y_Tools_Menue.yhtm b/src/nhttpd/web/Y_Tools_Menue.yhtm index c7f15ce2d..e7a714375 100644 --- a/src/nhttpd/web/Y_Tools_Menue.yhtm +++ b/src/nhttpd/web/Y_Tools_Menue.yhtm @@ -1,42 +1,84 @@ {=include-block:Y_Blocks.txt;head=} +<script type="text/javascript" src="/prototype.js"></script> <script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript" src="/Y_yweb.js"></script> +<script type="text/javascript"> +function cmd_popup(){ + window.open('Y_Tools_Cmd.yhtm','cmd','width=720,height=470,resizable=yes'); +} +function init(){ + var menu=ext.select_menu('tools'); + menu.each(function(e){ + var el=new Element('li').update( + new Element('a', {'target':'work', + 'title': e.get('desc'), + 'href': e.get('file') + }).update("-"+e.get('menuitem')) + ); + $('secmenu_tools').insert({'bottom':el}); + }); + var menu=ext.select_menu('expert'); + menu.each(function(e){ + var el=new Element('li').update( + new Element('a', {'target':'work', + 'title': e.get('desc'), + 'href': e.get('file') + }).update("-"+e.get('menuitem')) + ); + $('secmenu_expert').insert({'bottom':el}); + }); +} +</script> </head> -{=var-set:automount={=if-file-exists:/sbin/automount~true~{=if-file-exists:/var/bin/automount~true~false=}=}=} +{=var-set:automount={=if-file-exists:/sbin/automount~true~{=if-file-exists:/var/bin/automount~true~=}=}=} {=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} -<body> +{=var-set:etherwake={=if-file-exists:/bin/etherwake~/bin/etherwake~{=if-file-exists:/var/bin/etherwake~/var/bin/etherwake~=}=}=} + +<body onload="init()"> <div class="y_menu_sec_box"> <div class="y_menu_sec_box_head"><h2>Tools</h2></div> <div class="y_menu_sec_box_body"> <div class="y_menu_sec_section">Tools</div> <div class="y_menu_sec"> - <ul> + <ul id="secmenu_tools"> {=if-empty:{=var-get:management=}~ -<!--dbox2 only <li class="disabled" title="organize file automounts (automount not installed)">AutoMounts</li> dbox2 only--> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <li class="disabled" title="organize file automounts (automount not installed)">AutoMounts</li> <li class="disabled" title="organize file mounts (restricted by ManagementIP)">Mounts</li> <li class="disabled" title="Wake on LAN (restricted by ManagementIP)">Wake on LAN</li> + ~=} ~ - {=if-empty:{=var-get:automount=}~ -<!--dbox2 only <li class="disabled" title="organize file automounts (automount not installed)">AutoMounts</li> dbox2 only--> - ~ -<!--dbox2 only <li><a target="work" title="organize file automounts" href="Y_Settings_automount_liste.yhtm">AutoMounts</a></li> dbox2 only--> - =} + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + {=if-empty:{=var-get:automount=}~ + <li class="disabled" title="organize file automounts (automount not installed)">AutoMounts</li> + ~ + <li><a target="work" title="organize file automounts" href="Y_Settings_automount_liste.yhtm">AutoMounts</a></li> + =} <li><a target="work" title="organize file mounts" href="Y_Settings_mount_liste.yhtm">Mounts</a></li> - <li><a target="work" title="Wake on LAN" href="Y_Settings_wol.yhtm">Wake on LAN</a></li> + {=if-empty:{=var-get:etherwake=}~ + <li class="disabled" title="Wake on LAN (etherwake not installed)" >Wake on LAN</li> + ~ + <li><a target="work" title="Wake on LAN" href="Y_Settings_wol.yhtm">Wake on LAN</a></li> + =} + ~=} =} <li><a target="work" title="check Installation" href="Y_Tools_Check_Install.yhtm">Check Install</a></li> </ul> </div> <div class="y_menu_sec_section">Expert</div> <div class="y_menu_sec"> - <ul> - <li><a target="work" title="get box infos" href="Y_Dyn_Pages.yhtm?page=frame_tools-info">Info</a></li> + <ul id="secmenu_expert"> + <li><a target="work" title="get box infos" href="Y_Tools_Info_Menue.yhtm">Info</a></li> {=if-empty:{=var-get:management=}~ <li class="disabled" title="backup or flash image. (restricted by ManagementIP)">Image</li> <li class="disabled" title="command shell (restricted by ManagementIP)">Command Shell</li> <li class="disabled" title="yInstaller (for files, plugins, ...) (restricted by ManagementIP)">yInstaller</li> ~ -<!--dbox2 only <li><a target="work" title="backup or flash image" href="Y_Tools_Flash_Menue.yhtm">Image</a></li> dbox2 only--> - <li><a target="work" title="command shell" href="Y_Tools_Cmd.yhtm">Command Shell</a></li> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <li><a target="work" title="backup or flash image" href="Y_Tools_Flash_Menue.yhtm">Image</a></li> + ~=} + <li><a target="work" title="command shell" href="Y_Tools_Cmd.yhtm">Command Shell</a>&nbsp; + <a title="command shell (popup)" href="javascript:cmd_popup()"><img src="/images/popup.png"/></a></li> <li><a target="work" title="yInstaller (for files, plugins, ...)" href="Y_Tools_Installer.yhtm">yInstaller</a></li> =} </ul> diff --git a/src/nhttpd/web/Y_Tools_Timer_Sync.js b/src/nhttpd/web/Y_Tools_Timer_Sync.js new file mode 100644 index 000000000..276f74ce1 --- /dev/null +++ b/src/nhttpd/web/Y_Tools_Timer_Sync.js @@ -0,0 +1,298 @@ +function wiki_url(_page) +{ + return "<a href=\"http://wiki.dbox2-tuning.net/"+_page+"\"' target=\"_blank\"><b>[Help]<\/b><\/a>" +} +/*timer_list*/ +var timer_body; +function timer_list_init() +{ + timer_body=document.getElementById("timer_list"); +} +function timer_list_clear() +{ + while(timer_body.childNodes.length > 0) + { + aChild=timer_body.firstChild; + timer_body.removeChild(aChild); + } + + document.getElementById("checkall").checked = true; +} +function timer_list_addRow(_body, i, alDate, alTime, stDate, stTime, channel_name, progName, origin) +{ + var mycurrent_row = y_add_row_to_table(_body, ((i % 2) ==0)?"a":"b" ); + y_add_html_cell_to_row(mycurrent_row, "settimer", '<input type="checkbox" checked="true" name="settimer">'); + y_add_text_cell_to_row(mycurrent_row, "alDate", alDate); + y_add_text_cell_to_row(mycurrent_row, "alTime", alTime); + y_add_text_cell_to_row(mycurrent_row, "stDate", stDate); + y_add_text_cell_to_row(mycurrent_row, "stTime", stTime); + y_add_html_cell_to_row(mycurrent_row, "channel_name", channel_name); + y_add_html_cell_to_row(mycurrent_row, "progName", progName); + y_add_text_cell_to_row(mycurrent_row, "origin", origin); +} +/*sLog*/ +var sLog_body; +var sLog_line_number; +function sLog_init() +{ + sLog_line_number = 0; + sLog_body=document.getElementById("slog_list"); +} +function sLog_clear() +{ + while(sLog_body.childNodes.length > 0) + { + aChild=sLog_body.firstChild; + sLog_body.removeChild(aChild); + } + sLog_line_number = 0; +} +function sLog_addRow(_body, state, action_text, state_text) +{ + sLog_line_number++; + var mycurrent_row = y_add_row_to_table(_body, ((sLog_line_number % 2) ==0)?"a":"b" ); + var __img ="/images/info.png"; + switch (state) + { + case "green": __img = "/images/accept.png"; break; + case "yellow": __img = "/images/alert.gif"; break; + case "ok": __img = "/images/info.png"; break; + case "red": __img = "/images/remove.png"; break; + } + y_add_html_cell_to_row(mycurrent_row, "icon", "<img src='"+__img+"'>"); + y_add_html_cell_to_row(mycurrent_row, "action_text", action_text); + y_add_text_cell_to_row(mycurrent_row, "state_text", state_text); +} +/*request*/ +function processReqChange() +{ + if (g_req.readyState == 4) { + if (g_req.status == 200) + { + if (document.f.planer[0].checked == true) + { + var xml = g_req.responseXML; + var recProg_NodeList = xml.getElementsByTagName('recProg'); + + for(i=0;i<recProg_NodeList.length;i++) + { + var recProg_Node = recProg_NodeList[i]; + + var sender = getXMLNodeItemValue(recProg_Node, 'sender'); + var progName = getXMLNodeItemValue(recProg_Node, 'progName'); + var progStartDate = getXMLNodeItemValue(recProg_Node, 'progStartDate'); + var progStartTime = getXMLNodeItemValue(recProg_Node, 'progStartTime'); + var progEndDate = getXMLNodeItemValue(recProg_Node, 'progEndDate'); + var progEndTime = getXMLNodeItemValue(recProg_Node, 'progEndTime'); + + progName = decodeURI(progName); + /*convert startdate*/ + var Ausdruck = /(.*)-(.*)-(.*).*$/; + Ausdruck.exec(progStartDate); + var alDate = RegExp.$3+"."+RegExp.$2+"."+RegExp.$1; + + Ausdruck = /(.*):(.*):(.*).*$/; + Ausdruck.exec(progStartTime); + var alTime = RegExp.$1+":"+RegExp.$2; + + /*convert enddate*/ + Ausdruck = /(.*)-(.*)-(.*).*$/; + Ausdruck.exec(progEndDate); + var stDate = RegExp.$3+"."+RegExp.$2+"."+RegExp.$1; + + Ausdruck = /(.*):(.*):(.*).*$/; + Ausdruck.exec(progEndTime); + var stTime = RegExp.$1+":"+RegExp.$2; + + timer_list_addRow(timer_body, i, alDate, alTime, stDate, stTime, sender, progName, "TVInfo"); + if(document.f.debug.checked == true) + sLog_addRow(sLog_body, "green", "- Timer "+i+": "+alDate+" "+alTime+" "+sender+" "+progName, "analyzed"); + } + if(recProg_NodeList.length>0) + sLog_addRow(sLog_body, "green", "Analyze "+recProg_NodeList.length+" Timers", "finished"); + else + sLog_addRow(sLog_body, "yellow", "No Timers found", "finished"); + } + else if (document.f.planer[1].checked == true) + { + var agt=navigator.userAgent.toLowerCase(); + var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)); + var xml = g_req.responseXML; + var recProg_NodeList = xml.getElementsByTagName('item'); + for(i=0;i<recProg_NodeList.length;i++) + { + var recProg_Node = recProg_NodeList[i]; + + var progName = getXMLNodeItemValue(recProg_Node, 'title'); + var description = getXMLNodeItemValue(recProg_Node, 'description'); +//FF3?Probs if(is_ie) + { + var sDate = getXMLNodeItemValue(recProg_Node, 'dc:date'); + var sender = getXMLNodeItemValue(recProg_Node, 'dc:subject'); + } +/* else + { + var sDate = getXMLNodeItemValue(recProg_Node, 'date'); + var sender = getXMLNodeItemValue(recProg_Node, 'subject'); + } +*/ + var tmp = progName.replace(/(.*):/,""); + progName = tmp; + var stDate =""; + + /*convert startdate*/ + var Ausdruck = /(.*)-(.*)-(.*)T.*$/; + Ausdruck.exec(sDate); + var alYear = RegExp.$1; + var Ausdruck = /^(.*)\.(.*) (.*):(.*) Uhr -.*$/; + Ausdruck.exec(description); + alDate = RegExp.$1+"."+RegExp.$2+"."+alYear; + alTime = RegExp.$3+":"+RegExp.$4; + + var Ausdruck = /Ende (.*):(.*) Uhr.*$/; + Ausdruck.exec(description); + stTime = RegExp.$1+":"+RegExp.$2; + timer_list_addRow(timer_body, i, alDate, alTime, stDate, stTime, sender, progName, "Klack") + if(document.f.debug.checked == true) + sLog_addRow(sLog_body, "green", "- Timer "+i+": "+alDate+" "+alTime+" "+sender+" "+progName, "analyzed"); + } + if(recProg_NodeList.length>0) + sLog_addRow(sLog_body, "green", "Analyze "+recProg_NodeList.length+" Timers", "finished"); + else + sLog_addRow(sLog_body, "yellow", "No Timers found", "finished"); + } + } + } +} +function do_analyze_tvinfo() +{ + loadXMLDoc("/tmp/tvinfo.xml", processReqChange); +} +function do_analyze_klack() +{ + loadXMLDoc("/tmp/klack.xml", processReqChange); +} +function do_get_tvinfo() +{ + sLog_addRow(sLog_body, "ok", "TVinfo: Sync Timer", "started"); + var _url = "/control/exec?Y_Tools&timer_get_tvinfo&"+_username+"&"+_password; + + if(_username != "") + if(_password != "") + { + var res = loadSyncURL(_url); + if(res.search(/Connecting/)!=-1) + { + sLog_addRow(sLog_body, "green", "TVinfo: connecting "+res, "ok"); + if(res.search(/empty/)!=-1) + sLog_addRow(sLog_body, "red", "TVinfo: Username and/or Password wrong. "+wiki_url("Neutrino:yWeb#Timer_Sync"), "failed"); + else + sLog_addRow(sLog_body, "green", "TVinfo: Username / Password ok", "ok"); + } + else + sLog_addRow(sLog_body, "red", "TVinfo: connecting. "+wiki_url("Neutrino:yWeb#Timer_Sync"), "failed"); + } + else + sLog_addRow(sLog_body, "red", "TVinfo: no password given. "+wiki_url("Neutrino:yWeb#Timer_Sync"), "failed"); + else + sLog_addRow(sLog_body, "red", "TVinfo: no username given. "+wiki_url("Neutrino:yWeb#Timer_Sync"), "failed"); + +} +function do_get_klack() +{ + sLog_addRow(sLog_body, "ok", "Klack: Sync Timer", "started"); + var _url = "/control/exec?Y_Tools&timer_get_klack"; + var res = loadSyncURL(_url); + if(res.search(/Connecting/)!=-1) + sLog_addRow(sLog_body, "green", "Klack: connecting: "+res, "ok"); + else + sLog_addRow(sLog_body, "red", "Klack: connecting. "+wiki_url("Neutrino:yWeb#Timer_Sync"), "failed"); +} +function do_clear_all() +{ + sLog_clear(); + timer_list_clear(); +} +function do_get_selected() +{ + document.getElementById("wait").style.visibility="visible"; + if (document.f.planer[0].checked == true) + { + do_get_tvinfo(); + do_analyze_tvinfo(); + } + else if (document.f.planer[1].checked == true) + { + do_get_klack(); + do_analyze_klack(); + } + document.getElementById("wait").style.visibility="hidden"; +} +function doToogleCheckboxes() +{ + var state = document.timer.checkall.checked; + var _rows = timer_body.getElementsByTagName("tr"); + for(var i=0; i< _rows.length; i++) + { + var rowNode = _rows.item(i); + rowNode.firstChild.firstChild.checked = state; + } +} +/*set timer*/ +function do_set_timer() +{ + sLog_addRow(sLog_body, "green", "Sync Timer to box", "started"); + var channel_replace = loadSyncURL("/control/exec?Y_Tools&get_synctimer_channels&" + Math.random()); + if(channel_replace.length > 0) + sLog_addRow(sLog_body, "green", "Channel-Replace-List loaded "+channel_replace.length+" bytes", "ok"); + else + sLog_addRow(sLog_body, "yellow", "Channel-Replace-List is empty", "notify"); + var channels=0; + + if(typ != "tv") + { + loadSyncURL("/control/setmode?tv"); + sLog_addRow(sLog_body, "green", "Switsch to TV-Mode", "ok"); + } + + var _rows = timer_body.getElementsByTagName("tr"); + for(var i=0; i< _rows.length; i++) + { + var rowNode = _rows.item(i); + if(rowNode.firstChild.firstChild.checked == true) + { + var channel_name = rowNode.childNodes[5].firstChild.nodeValue; + if(rowNode.childNodes[7].firstChild.nodeValue == "TVInfo") + var Ausdruck = new RegExp("(.*);"+rowNode.childNodes[5].firstChild.nodeValue+";.*","i"); + else if(rowNode.childNodes[7].firstChild.nodeValue == "Klack") + var Ausdruck = new RegExp("(.*);.*;"+rowNode.childNodes[5].firstChild.nodeValue+".*","i"); + else + var Ausdruck =""; + if(Ausdruck != "") + { + Ergebnis=Ausdruck.exec(channel_replace); + if(Ergebnis) + channel_name = RegExp.$1; + } + var _urlt = "/control/timer?action=new&alDate="+rowNode.childNodes[1].firstChild.nodeValue + +"&alTime="+rowNode.childNodes[2].firstChild.nodeValue + +"&stDate="+rowNode.childNodes[3].firstChild.nodeValue + +"&stTime="+rowNode.childNodes[4].firstChild.nodeValue + +"&channel_name="+channel_name + +"&rec_dir="+document.f.rec_dir.value + +"&rs=1" + +"&update=1"; + _url = _urlt.replace(/:/gi,"."); + /*_url = encodeURI(_url);*/ + loadSyncURL(_url); + channels++; + if(document.f.debug.checked) + /*sLog_addRow(sLog_body, "green", "Sync Timer to box: "+channel_name+" "+rowNode.childNodes[6].firstChild.nodeValue, "added");*/ + sLog_addRow(sLog_body, "green", "Sync Timer to box url: "+_url, "added"); + } + } + if(channels > 0) + sLog_addRow(sLog_body, "green", "Sync Timer to box: "+channels+" Timers added", "finished"); + else + sLog_addRow(sLog_body, "yellow", "Sync Timer to box: No Timers to add", "finished"); +} diff --git a/src/nhttpd/web/Y_Tools_Timer_Sync.yhtm b/src/nhttpd/web/Y_Tools_Timer_Sync.yhtm index 5e7020146..30788e1d9 100644 --- a/src/nhttpd/web/Y_Tools_Timer_Sync.yhtm +++ b/src/nhttpd/web/Y_Tools_Timer_Sync.yhtm @@ -1,365 +1,75 @@ {=include-block:Y_Blocks.txt;head=} <script type="text/javascript" src="/Y_Baselib.js"></script> -<script type="text/javascript"> -//<![CDATA[ -function wiki_url(_page) -{ - return "<a href=\"http://wiki.tuxbox.org/"+_page+"\"' target=\"_blank\"><b>[Help]<\/b><\/a>" -} -/*timer_list*/ -var timer_body; -function timer_list_init() -{ - timer_body=document.getElementById("timer_list"); -} -function timer_list_clear() -{ - while(timer_body.childNodes.length > 0) - { - aChild=timer_body.firstChild; - timer_body.removeChild(aChild); - } - - document.getElementById("checkall").checked = true; -} -function timer_list_addRow(_body, i, alDate, alTime, stDate, stTime, channel_name, progName, origin) -{ - var mycurrent_row = y_add_row_to_table(_body, ((i % 2) ==0)?"a":"b" ); - y_add_html_cell_to_row(mycurrent_row, "settimer", '<input type="checkbox" checked="true" name="settimer">'); - y_add_text_cell_to_row(mycurrent_row, "alDate", alDate); - y_add_text_cell_to_row(mycurrent_row, "alTime", alTime); - y_add_text_cell_to_row(mycurrent_row, "stDate", stDate); - y_add_text_cell_to_row(mycurrent_row, "stTime", stTime); - y_add_html_cell_to_row(mycurrent_row, "channel_name", channel_name); - y_add_html_cell_to_row(mycurrent_row, "progName", progName); - y_add_text_cell_to_row(mycurrent_row, "origin", origin); -} -/*sLog*/ -var sLog_body; -var sLog_line_number; -function sLog_init() -{ - sLog_line_number = 0; - sLog_body=document.getElementById("slog_list"); -} -function sLog_clear() -{ - while(sLog_body.childNodes.length > 0) - { - aChild=sLog_body.firstChild; - sLog_body.removeChild(aChild); - } - sLog_line_number = 0; -} -function sLog_addRow(_body, state, action_text, state_text) -{ - sLog_line_number++; - var mycurrent_row = y_add_row_to_table(_body, ((sLog_line_number % 2) ==0)?"a":"b" ); - var __img ="/images/ok.gif"; - switch (state) - { - case "green": __img = "/images/check_green.gif"; break; - case "yellow": __img = "/images/excl_yellow.gif"; break; - case "ok": __img = "/images/ok.gif"; break; - case "red": __img = "/images/x_red.gif"; break; - } - y_add_html_cell_to_row(mycurrent_row, "icon", "<img src='"+__img+"'>"); - y_add_html_cell_to_row(mycurrent_row, "action_text", action_text); - y_add_text_cell_to_row(mycurrent_row, "state_text", state_text); -} -/*request*/ -function processReqChange() -{ - if (g_req.readyState == 4) { - if (g_req.status == 200) - { - if (document.f.planer[0].checked == true) - { - var xml = g_req.responseXML; - var recProg_NodeList = xml.getElementsByTagName('recProg'); - - for(i=0;i<recProg_NodeList.length;i++) - { - var recProg_Node = recProg_NodeList[i]; - - var sender = recProg_Node.getElementsByTagName('sender')[0].firstChild.nodeValue; - var progName = recProg_Node.getElementsByTagName('progName')[0].firstChild.nodeValue; - var progStartDate = recProg_Node.getElementsByTagName('progStartDate')[0].firstChild.nodeValue; - var progStartTime = recProg_Node.getElementsByTagName('progStartTime')[0].firstChild.nodeValue; - var progEndDate = recProg_Node.getElementsByTagName('progEndDate')[0].firstChild.nodeValue; - var progEndTime = recProg_Node.getElementsByTagName('progEndTime')[0].firstChild.nodeValue; - - progName = decodeURI(progName); - /*convert startdate*/ - var Ausdruck = /(.*)-(.*)-(.*).*$/; - Ausdruck.exec(progStartDate); - var alDate = RegExp.$3+"."+RegExp.$2+"."+RegExp.$1; - - Ausdruck = /(.*):(.*):(.*).*$/; - Ausdruck.exec(progStartTime); - var alTime = RegExp.$1+":"+RegExp.$2; - - /*convert enddate*/ - Ausdruck = /(.*)-(.*)-(.*).*$/; - Ausdruck.exec(progEndDate); - var stDate = RegExp.$3+"."+RegExp.$2+"."+RegExp.$1; - - Ausdruck = /(.*):(.*):(.*).*$/; - Ausdruck.exec(progEndTime); - var stTime = RegExp.$1+":"+RegExp.$2; - - timer_list_addRow(timer_body, i, alDate, alTime, stDate, stTime, sender, progName, "TVInfo"); - if(document.f.debug.checked == true) - sLog_addRow(sLog_body, "green", "- Timer "+i+": "+alDate+" "+alTime+" "+sender+" "+progName, "analyzed"); - } - if(recProg_NodeList.length>0) - sLog_addRow(sLog_body, "green", "Analyze "+recProg_NodeList.length+" Timers", "finished"); - else - sLog_addRow(sLog_body, "yellow", "No Timers found", "finished"); - } - else if (document.f.planer[1].checked == true) - { - var agt=navigator.userAgent.toLowerCase(); - var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)); - var xml = g_req.responseXML; - var recProg_NodeList = xml.getElementsByTagName('item'); - for(i=0;i<recProg_NodeList.length;i++) - { - var recProg_Node = recProg_NodeList[i]; - - var progName = recProg_Node.getElementsByTagName('title')[0].firstChild.nodeValue; - var description = recProg_Node.getElementsByTagName('description')[0].firstChild.nodeValue; - if(is_ie) - { - var sDate = recProg_Node.getElementsByTagName('dc:date')[0].firstChild.nodeValue; - var sender = recProg_Node.getElementsByTagName('dc:subject')[0].firstChild.nodeValue; - } - else - { - var sDate = recProg_Node.getElementsByTagName('date')[0].firstChild.nodeValue; - var sender = recProg_Node.getElementsByTagName('subject')[0].firstChild.nodeValue; - } - - var tmp = progName.replace(/(.*):/,""); - progName = tmp; - var stDate =""; - - /*convert startdate*/ - var Ausdruck = /(.*)-(.*)-(.*)T.*$/; - Ausdruck.exec(sDate); - var alYear = RegExp.$1; - var Ausdruck = /^(.*)\.(.*) (.*):(.*) Uhr -.*$/; - Ausdruck.exec(description); - alDate = RegExp.$1+"."+RegExp.$2+"."+alYear; - alTime = RegExp.$3+":"+RegExp.$4; - - var Ausdruck = /Ende (.*):(.*) Uhr.*$/; - Ausdruck.exec(description); - stTime = RegExp.$1+":"+RegExp.$2; - timer_list_addRow(timer_body, i, alDate, alTime, stDate, stTime, sender, progName, "Klack") - if(document.f.debug.checked == true) - sLog_addRow(sLog_body, "green", "- Timer "+i+": "+alDate+" "+alTime+" "+sender+" "+progName, "analyzed"); - } - if(recProg_NodeList.length>0) - sLog_addRow(sLog_body, "green", "Analyze "+recProg_NodeList.length+" Timers", "finished"); - else - sLog_addRow(sLog_body, "yellow", "No Timers found", "finished"); - } - } - } -} -function do_analyze_tvinfo() -{ - loadXMLDoc("/tmp/tvinfo.xml", processReqChange); -} -function do_analyze_klack() -{ - loadXMLDoc("/tmp/klack.xml", processReqChange); -} -function do_get_tvinfo() -{ - sLog_addRow(sLog_body, "ok", "TVinfo: Sync Timer", "started"); - var _username = "{=ini-get:/var/tuxbox/config/Y-Web.conf;tvinfo_username=}"; - var _password = "{=ini-get:/var/tuxbox/config/Y-Web.conf;tvinfo_password=}"; - var _url = "/control/exec?Y_Tools&timer_get_tvinfo&"+_username+"&"+_password; - - if(_username != "") - if(_password != "") - { - var res = loadSyncURL(_url); - if(res.search(/Connecting/)!=-1) - { - sLog_addRow(sLog_body, "green", "TVinfo: connecting "+res, "ok"); - if(res.search(/empty/)!=-1) - sLog_addRow(sLog_body, "red", "TVinfo: Username and/or Password wrong. "+wiki_url("Neutrino:yWeb#Timer_Sync"), "failed"); - else - sLog_addRow(sLog_body, "green", "TVinfo: Username / Password ok", "ok"); - } - else - sLog_addRow(sLog_body, "red", "TVinfo: connecting. "+wiki_url("Neutrino:yWeb#Timer_Sync"), "failed"); - } - else - sLog_addRow(sLog_body, "red", "TVinfo: no password given. "+wiki_url("Neutrino:yWeb#Timer_Sync"), "failed"); - else - sLog_addRow(sLog_body, "red", "TVinfo: no username given. "+wiki_url("Neutrino:yWeb#Timer_Sync"), "failed"); - -} -function do_get_klack() -{ - sLog_addRow(sLog_body, "ok", "Klack: Sync Timer", "started"); - var _url = "/control/exec?Y_Tools&timer_get_klack"; - var res = loadSyncURL(_url); - if(res.search(/Connecting/)!=-1) - sLog_addRow(sLog_body, "green", "Klack: connecting: "+res, "ok"); - else - sLog_addRow(sLog_body, "red", "Klack: connecting. "+wiki_url("Neutrino:yWeb#Timer_Sync"), "failed"); -} -function do_clear_all() -{ - sLog_clear(); - timer_list_clear(); -} -function do_get_selected() -{ - document.getElementById("wait").style.visibility="visible"; - if (document.f.planer[0].checked == true) - { - do_get_tvinfo(); - do_analyze_tvinfo(); - } - else if (document.f.planer[1].checked == true) - { - do_get_klack(); - do_analyze_klack(); - } - document.getElementById("wait").style.visibility="hidden"; -} -function doToogleCheckboxes() -{ - var state = document.timer.checkall.checked; - var _rows = timer_body.getElementsByTagName("tr"); - for(var i=0; i< _rows.length; i++) - { - var rowNode = _rows.item(i); - rowNode.firstChild.firstChild.checked = state; - } -} -/*set timer*/ -function do_set_timer() -{ - sLog_addRow(sLog_body, "green", "Sync Timer to box", "started"); - var channel_replace = loadSyncURL("/control/exec?Y_Tools&get_synctimer_channels&" + Math.random()); - if(channel_replace.length > 0) - sLog_addRow(sLog_body, "green", "Channel-Replace-List loaded "+channel_replace.length+" bytes", "ok"); - else - sLog_addRow(sLog_body, "yellow", "Channel-Replace-List is empty", "notify"); - var channels=0; - - var typ = "{=func:get_mode=}"; - if(typ != "tv") - { - loadSyncURL("/control/setmode?tv"); - sLog_addRow(sLog_body, "green", "Switsch to TV-Mode", "ok"); - } - - var _rows = timer_body.getElementsByTagName("tr"); - for(var i=0; i< _rows.length; i++) - { - var rowNode = _rows.item(i); - if(rowNode.firstChild.firstChild.checked == true) - { - var channel_name = rowNode.childNodes[5].firstChild.nodeValue; - if(rowNode.childNodes[7].firstChild.nodeValue == "TVInfo") - var Ausdruck = new RegExp("(.*);"+rowNode.childNodes[5].firstChild.nodeValue+";.*","i"); - else if(rowNode.childNodes[7].firstChild.nodeValue == "Klack") - var Ausdruck = new RegExp("(.*);.*;"+rowNode.childNodes[5].firstChild.nodeValue+".*","i"); - else - var Ausdruck =""; - if(Ausdruck != "") - { - Ergebnis=Ausdruck.exec(channel_replace); - if(Ergebnis) - channel_name = RegExp.$1; - } - var _urlt = "/control/timer?action=new&alDate="+rowNode.childNodes[1].firstChild.nodeValue - +"&alTime="+rowNode.childNodes[2].firstChild.nodeValue - +"&stDate="+rowNode.childNodes[3].firstChild.nodeValue - +"&stTime="+rowNode.childNodes[4].firstChild.nodeValue - +"&channel_name="+channel_name - +"&rec_dir="+document.f.rec_dir.value - +"&rs=1" - +"&update=1"; - _url = _urlt.replace(/:/gi,"."); - /*_url = encodeURI(_url);*/ - loadSyncURL(_url); - channels++; - if(document.f.debug.checked) - /*sLog_addRow(sLog_body, "green", "Sync Timer to box: "+channel_name+" "+rowNode.childNodes[6].firstChild.nodeValue, "added");*/ - sLog_addRow(sLog_body, "green", "Sync Timer to box url: "+_url, "added"); - } - } - if(channels > 0) - sLog_addRow(sLog_body, "green", "Sync Timer to box: "+channels+" Timers added", "finished"); - else - sLog_addRow(sLog_body, "yellow", "Sync Timer to box: No Timers to add", "finished"); -} -//]]> -</script> +<script type="text/javascript" src="/prototype.js"></script> +<script type="text/javascript" src="/Y_Tools_Timer_Sync.js"></script> </head> <body> -{=var-set:wait_text=get timer.=}{=include-block:Y_Blocks.txt;snip_wait=} +{=var-set:wait_text=Timer holen (get timer).=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Live_Timer#Timer_Sync=}{=var-set:menu=Timer Sync=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Live_Timer-Timer_Sync=}{=var-set:menu=Timer Sync=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <form method="post" name="f" action=""> - <b>Sync Timer</b> - <table class="y_work_table"> + <div class="y_form_header">Timer Source</div> + <table border="0" cellspacing="0" cellpadding="4" width="100%"> <tr> <td> <input type="radio" name="planer" value="TVInfo" {=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;tvinfo_username=}~disabled~=}/>TVInfo<br/> <input type="radio" name="planer" value="Klack" {=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;klack_url=}~disabled~=}/>Klack - + </td> <td> - <input type="checkbox" name="debug" value="1"/>Debugging <!-- <input type="radio" name="planer" value="slave" disabled="disabled"/>Slave box<br/> <input type="radio" name="planer" value="slave" disabled="disabled"/>Test<br/> --> - </td> - </tr> - <tr><td colspan="2"> - Recording Directory: <input type="text" name="rec_dir" value="{=ini-get:/var/tuxbox/config/neutrino.conf;network_nfs_recordingdir;/mnt/filme=}" title="recording dir"/> - <br/>Settings within Settings-Timer</td> + Aufnahmeverzeichnis: + <select name="rec_dir" class="y_live_button"> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_0;/mnt/filme~open=}" selected="selected">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_0;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_1;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_1;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_2;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_2;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_3;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_3;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_4;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_4;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_5;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_5;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_6;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_6;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_7;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_7;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_8;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_8;/mnt/filme~cache=}</option> + <option value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_9;/mnt/filme~cache=}">{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_9;/mnt/filme~cache=}</option> + </select> + + <br/><a href="javascript:top.top_main.prim_menu.nav('settings', 'Y_Settings_Timer.yhtm');" class="inlink">Einstellungen</a>&nbsp;<input type="checkbox" name="debug" value="1"/>Debugging</td> </tr> </table> - <input type="button" value="get selected" title="get selected" name="get_selected" onclick="do_get_selected()"/>&nbsp; - <input type="button" value="clear all" title="clear all" name="clear_all" onclick="do_clear_all()"/> + <button type="button" ytype="download" itle="get selected" name="get_selected" onclick="do_get_selected()">get selected</button> + &nbsp; + <button type="button" ytype="clear" title="clear all" name="clear_all" onclick="do_clear_all()">clear all</button> </form> <br/> <form method="post" name="timer" action=""> - <b>Timer Preview List</b> - <table class="y_work_table" cellpadding="2"> + <div class="y_form_header_oline">Timer Preview List</div> + <table class="lt_table" border="0" cellspacing="0" cellpadding="4"> <thead align="left"> <tr> - <th><input type="checkbox" checked="checked" name="checkall" onclick="doToogleCheckboxes();" id="checkall"/></th><th colspan="2">StartTime</th><th colspan="2">EndeTime</th> - <th>Sender</th><th>Program</th><th>Quelle</th> + <th><input type="checkbox" checked="checked" name="checkall" onclick="doToogleCheckboxes();" id="checkall"/></th> + <th colspan="2">Startzeit</th><th colspan="2">Endezeit</th> + <th>Sender</th><th>Sendung</th><th>Quelle</th> </tr> </thead> <tbody id="timer_list"> <tr><td></td></tr> </tbody> </table> - <input type="button" value="set timer" title="" name="set_timers" onclick="do_set_timer()"/>&nbsp; - <input type="button" value="clear log" title="" name="clear_log" onclick="sLog_clear()"/> + <div style="padding-top:2px"> + <button type="button" ytype="timeadd" title="" name="set_timers" onclick="do_set_timer()">set timer</button>&nbsp; + <button type="button" ytype="clear" title="" name="clear_log" onclick="sLog_clear()">clear log</button> + </div> </form> <br/> <form method="post" name="log" action=""> - <b>Log</b><br/> - <table class="y_work_table" cellpadding="4"> + <div class="y_form_header_oline">Log</div> + <table class="lt_table" border="0" cellspacing="0" cellpadding="4"> <thead align="left"> <tr> - <th>&nbsp;</th><th>Action</th><th>Status</th> + <th>&nbsp;</th><th>Aktion</th><th>Status</th> </tr> </thead> <tbody id="slog_list"> @@ -372,6 +82,10 @@ function do_set_timer() </div> <script type="text/javascript"> //<![CDATA[ + var _username = "{=ini-get:/var/tuxbox/config/Y-Web.conf;tvinfo_username=}"; + var _password = "{=ini-get:/var/tuxbox/config/Y-Web.conf;tvinfo_password=}"; + var typ = "{=func:get_mode=}"; + timer_list_init(); sLog_init(); do_clear_all(); diff --git a/src/nhttpd/web/Y_Tools_fbshot.yhtm b/src/nhttpd/web/Y_Tools_fbshot.yhtm index 0d7df60cc..7ec6cebc1 100644 --- a/src/nhttpd/web/Y_Tools_fbshot.yhtm +++ b/src/nhttpd/web/Y_Tools_fbshot.yhtm @@ -3,61 +3,53 @@ <script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript"> //<![CDATA[ -function do_snapshot() -{ +function do_snapshot(){ show_waitbox(true); window.setTimeout("do_snapshot2()", 500); } -function do_snapshot2() -{ +function do_snapshot2(){ var _shot = document.getElementById("shot"); var filename = id("file").value; - dbox_exec_command("{=if-file-exists:/var/bin/fbshot~/var/bin/fbshot~fbshot=} -q /tmp/"+filename+".png"); + dbox_exec_tools("fbshot fb -q /tmp/"+filename+".png"); show_waitbox(false); show_obj("shot", true); _shot.src = "/tmp/"+filename+".png?"+Math.random(); } -function do_dboxshot() -{ +function do_dboxshot(){ show_waitbox(true); window.setTimeout("do_dboxshot2()", 500); } -function do_dboxshot2() -{ +function do_dboxshot2(){ var _shot = document.getElementById("shot"); var filename = id("file").value; - var res = dbox_exec_command("{=if-file-exists:/var/bin/dboxshot~/var/bin/dboxshot~dboxshot=} /tmp/"+filename+".bmp"); + var res = dbox_exec_tools("fbshot -r -o /tmp/"+filename+".bmp"); if(res != "") - dbox_exec_command("{=if-file-exists:/var/bin/dboxshot~/var/bin/dboxshot~dboxshot=} /tmp/"+filename+".bmp"); + dbox_exec_tools("fbshot -o /tmp/"+filename+".bmp"); show_waitbox(false); show_obj("shot", true); _shot.src = "/tmp/"+filename+".bmp?"+Math.random(); } -function do_clearshot() -{ +function do_clearshot(){ window.setTimeout("do_clearshot2()", 500); } -function do_clearshot2() -{ - var _shot = document.getElementById("shot"); - dbox_exec_command("rm /tmp/*.png"); - dbox_exec_command("rm /tmp/*.bmp"); +function do_clearshot2(){ + dbox_exec_tools("fbshot_clear"); } //]]> </script> </head> <body> -{=var-set:wait_text=Snapshot taken=}{=include-block:Y_Blocks.txt;snip_wait=} +{=var-set:wait_text=Schnappschuss wird erstellt (take snapshot)=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:BoxControl#OSD_Screenshot=}{=var-set:menu=OSD Screenshot=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-BoxControl-OSD_Screenshot=}{=var-set:menu=OSD Screenshot=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> - <button name="snapshot" onclick="do_snapshot()">Snapshot</button> + <button name="snapshot" ytype="shot" onclick="do_snapshot()">Snapshot</button> {=var-set:dboxshot={=if-file-exists:/bin/dboxshot~true~{=if-file-exists:/var/bin/dboxshot~true~false=}=}=} {=if-equal:{=var-get:dboxshot=}~true~ - <button name="dboxshot" onclick="do_dboxshot()">dboxshot</button> + <button name="dboxshot" ytype="shot" onclick="do_dboxshot()">dboxshot</button> =} - <button name="clearshot" onclick="do_clearshot()">Delete Screenshots</button> + <button name="clearshot" ytype="clearshot" onclick="do_clearshot()">Delete Screenshots</button> &nbsp;Filename:<input type="text" value="a" id="file" size="16"/> <br/> <img id="shot" src="" style="visibility:hidden;"/> diff --git a/src/nhttpd/web/Y_Tools_lcshot.yhtm b/src/nhttpd/web/Y_Tools_lcshot.yhtm new file mode 100644 index 000000000..5b0754959 --- /dev/null +++ b/src/nhttpd/web/Y_Tools_lcshot.yhtm @@ -0,0 +1,132 @@ +{=var-set:cancache=yPInstall=} +{=include-block:Y_Blocks.txt;head=} +<script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript"> +//<![CDATA[ +function do_init(){ + document.getElementById("colorBox").style.background = "#99FF33"; + document.getElementById("colorBox").value = "99FF33"; + document.f.zooming.selectedIndex = 1; +} +function setcolorbox(hexString){ + document.getElementById("colorBox").style.background = "#"+hexString; + document.getElementById("colorBox").value = hexString; +} +function do_lcshot(){ + show_waitbox(true); + window.setTimeout("do_lcshot2()", 500); +} +function do_lcshot2(){ + var _shot = document.getElementById("shot"); + var filename = id("file").value; + var color = document.getElementById("colorBox").value; + color = " -c "+color; + var zoom = document.f.zooming.value; + zoom = " -z "+zoom; + var comp = " -u"; + if(document.f.compress.checked) + comp = ""; + var gscale = ""; + if(document.f.grayscale.checked) + gscale = " -g"; + + dbox_exec_tools("lcshot"+gscale+comp+zoom+color+" /tmp/"+filename+".png"); + show_waitbox(false); + show_obj("shot", true); + _shot.src = "/tmp/"+filename+".png?"+Math.random(); +} +function do_clearshot(){ + window.setTimeout("do_clearshot2()", 500); +} +function do_clearshot2(){ + dbox_exec_tools("fbshot_clear"); +} +//]]> +</script> +</head> +<body onload="do_init()"> +{=var-set:wait_text=Schnappschuss wird erstellt (take snapshot)=}{=include-block:Y_Blocks.txt;snip_wait=} +<div class="work_box"> + <div class="work_box_head"><div class="work_box_head_h2"> + {=var-set:help_url=Help-BoxControl-LCD_Screenshot=}{=var-set:menu=LCD Screenshot=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + <div class="work_box_body"> + <button name="lcshot" ytype="shot" onclick="do_lcshot()">LCD-Shot</button> + <button name="clearshot" ytype="clearshot" onclick="do_clearshot()">Delete Shot</button> + &nbsp;Filename:<input value="lcd" id="file" size="16" type="text" />.png + <br /> + <form name="f" class="y_form" action=""> + <table width="100%" border="0" cellpadding="2" cellspacing="0"> + <tr> + <td colspan="3" class="y_form_header">Optionen</td> + </tr> + <tr> + <td width="30%">Displayfarbe</td> + <td width="20%"> + <input type="text" id="colorBox" size="7" readonly="readonly" /> + </td> + <td rowspan="4"><div id="colorTable" style="height:98px;"> + <table border="0" cellpadding="0" cellspacing="1"> + <tr> + <td colspan="18"></td> + </tr> +<script type="text/javascript"> +//<![CDATA[ +clr = new Array('00','33','66','99','CC','FF'); + +for(k=0;k<6;++k){ +for(j=0;j<6;){ +document.write('<tr>\n'); +for(m=0;m<3;++m){ +for(i=0;i<6;++i){ +document.write('<td bgcolor=#'+clr[k]+clr[j+m]+clr[i]+'>'); +document.write('<a href="javascript:void(null)" '); +document.write('onClick="setcolorbox(\''+clr[k]+clr[j+m]+clr[i]+'\')\;">'); +document.write('<img src="../images/blank.gif" width="12" height="8" border="0"></a></td>\n'); +} +} +j+=3; +document.write('</tr>\n'); +} +} +//]]> +</script> + </table> + </div></td> + </tr> + <tr> + <td>Zoommodus</td> + <td><select name="zooming" title="zoomfactor"> + <option value="1">100%</option> + <option value="2">200%</option> + <option value="3">300%</option> + <option value="4">400%</option> + </select></td> + </tr> + <tr> + <td>Dateiausgabe</td> + <td><input name="compress" type="checkbox" checked="checked" /> + komprimiert</td> + </tr> + <tr> + <td>Farbausgabe</td> + <td><input name="grayscale" type="checkbox" /> + Grauskalenbild</td> + </tr> + <tr> + <td colspan="3" class="y_form_header">Ausgabe</td> + </tr> + <tr> + <td colspan="3">&nbsp;</td> + </tr> + <tr> + <td colspan="3"><img src="" id="shot" style="visibility:hidden;" alt="" /></td> + </tr> + <tr> + <td colspan="3">&nbsp;</td> + </tr> + </table> + </form> + </div> +</div> +</body> +</html> diff --git a/src/nhttpd/web/Y_Tools_remote_osd.yhtm b/src/nhttpd/web/Y_Tools_remote_osd.yhtm index 0ace138e7..9bbae810f 100644 --- a/src/nhttpd/web/Y_Tools_remote_osd.yhtm +++ b/src/nhttpd/web/Y_Tools_remote_osd.yhtm @@ -1,60 +1,43 @@ -{=var-set:cancache=yPInstall=} -{=var-set:dboxshot={=if-file-exists:/bin/dboxshot~/bin/dboxshot~{=if-file-exists:/var/bin/dboxshot~/var/bin/dboxshot~/var/bin/dboxshot=}=}=} {=include-block:Y_Blocks.txt;head=} <script type="text/javascript" src="/Y_Baselib.js"></script> <script type="text/javascript"> //<![CDATA[ -function rcsim(_key) -{ - loadSyncURL("/control/rcem?"+_key); +function rcsim(_key) { + dbox_rcsim(_key); do_dboxshot(); } -function do_dboxshot() -{ - {=if-empty:{=var-get:dboxshot=}~~ - var _shot = document.getElementById("shot"); - var res = dbox_exec_command("{=var-get:dboxshot=} -o /tmp/a.bmp"); +function do_dboxshot(){ + var res = dbox_exec_tools("fbshot -r -o /tmp/a.bmp"); if(res != "") - dbox_exec_command("{=var-get:dboxshot=} -o /tmp/a.bmp"); + dbox_exec_tools("fbshot -o /tmp/a.bmp"); + var _shot = document.getElementById("shot"); _shot.src = "/tmp/a.bmp?"+Math.random(); - =} } -function do_clearshot() -{ +function do_clearshot(){ window.setTimeout("do_clearshot2()", 500); } -function do_clearshot2() -{ - var _shot = document.getElementById("shot"); - dbox_exec_command("rm /tmp/a.*"); +function do_clearshot2(){ + dbox_exec_tools("fbshot_clear"); show_waitbox(false); } //]]> </script> </head> -<body> -{=var-set:wait_text=Snapshot taken=}{=include-block:Y_Blocks.txt;snip_wait=} +<body onload="do_dboxshot()"> +{=var-set:wait_text=Schnappschuss wird erstellt (take snapshot)=}{=include-block:Y_Blocks.txt;snip_wait=} <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:BoxControl#Remote_OSD=}{=var-set:menu=Remote &amp; OSD=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-BoxControl-Remote_OSD=}{=var-set:menu=Remote &amp; OSD=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> - {=if-empty:{=var-get:dboxshot=}~~ - <button name="dboxshot" onclick="do_dboxshot()">shot</button> - =} - <button name="clearshot" onclick="do_clearshot()">Delete shots</button> + <button name="dboxshot" ytype="shot" onclick="do_dboxshot()">Shot</button>&nbsp; + <button name="clearshot" ytype="clearshot" onclick="do_clearshot()">Delete shots</button> <table cellpadding="0"> <tr> <td>{=include-block:Y_Blocks.txt;remote=}</td> - <td><img id="shot" src="" style="width:600px"/></td> + <td><img id="shot" src="" {=if-empty:{=full=}~style="width:600px"~=}/></td> </tr> </table> - </div> </div> -<script type="text/javascript"> -//<![CDATA[ - do_dboxshot(); -//]]> -</script> </body> </html> diff --git a/src/nhttpd/web/Y_VLC.js b/src/nhttpd/web/Y_VLC.js index 4b590dba1..d0f7bfdde 100644 --- a/src/nhttpd/web/Y_VLC.js +++ b/src/nhttpd/web/Y_VLC.js @@ -1,6 +1,6 @@ /* VLC abstraction by yjogol@online.de - $Date: 2007/02/21 17:38:48 $ - $Revision: 1.1 $ + $Date: 2008/11/13 16:45:38 $ + $Revision: 1.4 $ */ /*ie1=ActiveC, moz1=Mozilla<0.8.5.1, moz2>= 0.8.5.1*/ var CyVLC = function(_id, masterid, width, height) { @@ -36,12 +36,12 @@ CyVLC.prototype = { } this.insert_control(); this.vlc = id(_id); - this.set_resolution(this.c_width, this.c_height); if(is_ie) { this.version_string = this._get_version(); this._generate_sub_versions(); this._determine_plugin_generation(); } + this.set_resolution(this.c_width, this.c_height); }, _get_version : function() { if(is_ie) @@ -55,6 +55,8 @@ CyVLC.prototype = { var plug = navigator.plugins['VLC multimedia plugin']; if(typeof plug == 'undefined') var plug = navigator.plugins['VLC Multimedia Plugin']; + if(typeof plug == 'undefined') + var plug = navigator.plugins['VLC Multimedia Plug-in']; var ex = /^.*[vV]ersion [\"]*([^ \"]*)[\"]*.*$/; var ve = ex.exec(plug.description); if(ve[1]) @@ -170,7 +172,7 @@ CyVLC.prototype = { }, toggle_mute : function() { switch(this.plugin) { - case "ie1": this.vlc.toggleMute();reak; + case "ie1": this.vlc.toggleMute();break; case "moz2": this.vlc.audio.toggleMute();break; default: this.vlc.mute();break; } @@ -220,11 +222,14 @@ CyVLC.prototype = { if(is_ie) { vlc_control_html = "<object classid=\"clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8\" " + +/* "<object classid=\"clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921\" " +*/ + "width=\""+this.c_width+"\" height=\""+this.c_height+"\" id=\""+this.id+"\" events=\"True\">" + "<param name='ShowDisplay' value='"+this.c_show_display+"' />" + "<param name='Loop' value='"+this.c_loop+"' />" + "<param name='AutoPlay' value='"+this.c_auto_play+"' />" + - "<param name=\"Visible\" value=\"-1\"/>" + +/* "<param name=\"Visible\" value=\"-1\"/>" + */ + "<param name='ShowDisplay' value='True'/>" + "The VideoLan Client ActiveX is not installed.<br/>"+ "You need <a href='http://www.videolan.org' target='_blank'>VideoLan Client</a> V0.8.5 or higher.<br/>" + "Install with Option ActiveX." + diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index d039aa59a..e8f273aa8 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,6 +1,5 @@ -version=2.5.0 -date=21.02.2007 -type=Release -info=mod neutrino.dream plus - +version=2.8.a.3 +date=24.02.2010 +type=Alpha +info=Port Coolstream diff --git a/src/nhttpd/web/Y_Wait.yhtm b/src/nhttpd/web/Y_Wait.yhtm new file mode 100644 index 000000000..bb8c81b0f --- /dev/null +++ b/src/nhttpd/web/Y_Wait.yhtm @@ -0,0 +1,18 @@ +{=var-set:cancache=yPyes=} +{=include-block:Y_Blocks.txt;head=} +</head> +<body> +<br/> +<table class="y_wait_box_visible" cellpadding="8"> +<tr> + <td> + <font color="#666666"><b>Anfrage wird bearbeitet</b></font><p align="center"> + <img border="0" src="images/wait.gif"/></p> + <p align="center"><font size="2"> + Bitte warten ...</font> + </td> +</tr> +</table> + +</body> +</html> \ No newline at end of file diff --git a/src/nhttpd/web/Y_blank.htm b/src/nhttpd/web/Y_blank.htm index c99ab7e31..fc906f34e 100644 --- a/src/nhttpd/web/Y_blank.htm +++ b/src/nhttpd/web/Y_blank.htm @@ -1,7 +1,8 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> -<html> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> <head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>yWeb</title> </head> <body> diff --git a/src/nhttpd/web/Y_neutrino_Blocks.txt b/src/nhttpd/web/Y_neutrino_Blocks.txt index 083e5ca6a..82f308b5c 100644 --- a/src/nhttpd/web/Y_neutrino_Blocks.txt +++ b/src/nhttpd/web/Y_neutrino_Blocks.txt @@ -5,11 +5,16 @@ start-block~neutrino_form {=include-block:Y_Blocks.txt;management_check_top=} {=include-block:Y_Blocks.txt;head=} <script type="text/javascript" src="/Y_Baselib.js"></script> +<script type="text/javascript" src="/prototype.js"></script> +<style type="text/css"> +/*<![CDATA[*/ +.line {border-top: 1px solid #6D96A9;} +/*]]>*/ +</style> </head> <body> -{=var-set:wait_text=Save.=}{=include-block:Y_Blocks.txt;snip_wait=} +{=var-set:wait_text=Werte werden &uuml;bernommen (Save).=}{=include-block:Y_Blocks.txt;snip_wait=} {=include-block:Y_neutrino_Blocks.txt;{=var-get:neutrino=}=} -{=include-block:Y_neutrino_Blocks.txt;neutrino_form_helpbox=} </body> </html> {=include-block:Y_Blocks.txt;management_check_bottom=} @@ -18,7 +23,7 @@ end-block~neutrino_form # ------- Neutrino form help box start-block~neutrino_form_helpbox <div class="work_box"> - <div class="work_box_head"><div class="work_box_head_h2">To Synchronize with Neutrino</div></div> + <div class="work_box_head"><div class="work_box_head_h2">Zur Synchronisation mit Neutrino</div></div> <div class="work_box_body"> After changing settings via yWeb: <br/> Choose on TV "Main Menu->Service->Soft restart", to accept the changes within neutrino. @@ -33,95 +38,128 @@ end-block~neutrino_form_helpbox start-block~neutrino_form-data_record <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Settings#Aufnahme=}{=var-set:menu=Recording=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Settings-Aufnahme=}{=var-set:menu=Aufnahme=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> - <form name="f" action="/y/cgi"> - <table cellspacing="0" border="0" cellpadding="2"> + <form name="f" class="y_form" action="/y/cgi"> + <table cellspacing="0" border="0" cellpadding="2" width="100%"> + <tr><td colspan="2" class="y_form_header">Aufnahmeziel</td></tr> <tr> - <td>Recording device</td> + <td width="35%">Aufnahmeger&auml;t</td> <td> <select name="rec_type" onchange="change_rec_type()" title="record mode"> - <option value="0" selected="selected">Off</option> + <option value="0" selected="selected">Aus</option> <option value="1">Server</option> <option value="2">Videorekorder</option> - <option value="3">File</option> + <option value="3">Datei</option> </select> </td> </tr> <tr> - <td style="border-top: 1px solid #6D96A9;">IP</td> - <td style="border-top: 1px solid #6D96A9;"><input type="text" name="ip" size="20" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_server_ip~open=}" title="server ip (xxx.xxx.xxx.xxx)"/></td> + <td>Aufnahmeserver IP</td> + <td> <input type="text" id="ip" name="ip" size="20" title="server ip (xxx.xxx.xxx.xxx)"/> + <input type="hidden" name="h_ip"/> + </td> </tr> <tr> - <td>Port</td> - <td><input type="text" name="port" size="6" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_server_port;4000=}" title="port"/></td> - </tr> - <tr> - <td>Wake up</td> + <td>Aufnahmeserver Port</td> <td> - <input type="radio" name="wol" value="0" title="wakup: off"/>Off&nbsp; - <input type="radio" name="wol" value="1" title="wakeup: on"/>On + <input type="text" id="port" name="port" size="6" title="port"/> + <input type="hidden" name="h_port"/> </td> </tr> - <tr> - <td>MAC</td> - <td><input type="text" name="mac" size="20" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_server_mac=}" title="MAC"/></td> - </tr> - <tr> - <td style="border-top: 1px solid #6D96A9;">Stop Playback</td> - <td style="border-top: 1px solid #6D96A9;"> - <input type="radio" name="stopplayback" value="false" title="stopplayback: off"/>Off - <input type="radio" name="stopplayback" value="true" title="stopplayback: on"/>On - </td> - </tr> - <tr> - <td>Sectionsd</td> + <tr title="wakeup: off/on"> + <td>Aufnahmeserver WOL</td> <td> - <input type="radio" name="stopsectionsd" value="false" title="stopsectionsd: off"/>Off - <input type="radio" name="stopsectionsd" value="true" title="stopsectionsd: on"/>On + <input type="radio" id="wol0" name="wol" value="0" onchange="change_mac()"/>{=L:off=}&nbsp; + <input type="radio" id="wol1" name="wol" value="1" onchange="change_mac()"/>{=L:on=} + <input type="hidden" name="h_wol"/> </td> </tr> <tr> - <td style="border-top: 1px solid #6D96A9;">Scart</td> - <td style="border-top: 1px solid #6D96A9;"> - <input type="radio" name="vcr_no_scart" value="0" title="vcr_no_scart: off"/>Off - <input type="radio" name="vcr_no_scart" value="1" title="vcr_no_scart: on"/>On - </td> - </tr> - <tr> - <td style="border-top: 1px solid #6D96A9;">Recording start time correction (sec)</td> - <td style="border-top: 1px solid #6D96A9;"><input type="text" name="EXTRA_TIME_START" size="5" value="{=ini-get:/var/tuxbox/config/timerd.conf;EXTRA_TIME_START;0=}" title="start timer delay"/>&nbsp;Reboot urgently</td> - </tr> - <tr> - <td>Recording stop time correction (sec)</td> - <td><input type="text" name="EXTRA_TIME_END" size="5" value="{=ini-get:/var/tuxbox/config/timerd.conf;EXTRA_TIME_END;0=}" title="end timer delay"/>&nbsp;Reboot urgently</td> - </tr> -<!--dbox2 only <tr> - <td style="border-top: 1px solid #6D96A9;">record in SPTS-Mode</td> - <td style="border-top: 1px solid #6D96A9;"> - <input type="radio" name="in_spts_mode" value="false" title="SPTS mode: off"/>Off&nbsp; - <input type="radio" name="in_spts_mode" value="true" title="SPTS mode: on"/>On - </td> - </tr> dbox2 only--> - <tr> - <td style="border-top: 1px solid #6D96A9;">Standard audio stream</td> - <td style="border-top: 1px solid #6D96A9;"> - <input type="radio" name="audio_std" value="0" title="record standard audio channel: off"/>Off - <input type="radio" name="audio_std" value="1" title="record standard audio channel: on"/>On - </td> - </tr> - <tr> - <td>Alternative audio streams</td> + <td>MAC Adresse</td> <td> - <input type="radio" name="audio_alt" value="0" title="record alternate audio channel: off"/>Off - <input type="radio" name="audio_alt" value="1" title="record alternate audio channel: on"/>On + <input type="text" id="mac" name="mac" size="20" title="MAC"/> + <input type="hidden" name="h_mac"/> + </td> + </tr> + <tr><td colspan="2" class="y_form_header">Aufnahmeverhalten</td></tr> + <tr title="stopplayback: off/on"> + <td>Playback anhalten</td> + <td> + <input type="radio" id="sp0" name="stopplayback" value="false"/>{=L:off=}&nbsp; + <input type="radio" id="sp1" name="stopplayback" value="true""/>{=L:on=} + <input type="hidden" name="h_stopplayback"/> </td> </tr> <tr> - <td>AC3 audio stream</td> + <td>EPG (Sectionsd)</td> <td> - <input type="radio" name="audio_ac3" value="0" title="record ac3 audio channels: off"/>Off - <input type="radio" name="audio_ac3" value="1" title="record ac3 audio channels: on"/>On + <select id="ss" name="stopsectionsd" title="sectionsd: off/on/restart"> + <option value="0" selected="selected">nicht anhalten</option> + <option value="1">anhalten</option> + <option value="2">neu starten</option> + </select> + <input type="hidden" name="h_stopsectionsd"/> + </td> + </tr> + <tr title="zap on announce: off/on"> + <td>Umschalten bei Ank&uuml;ndigung</td> + <td> + <input type="radio" name="zap_on_announce" value="false"/>{=L:off=}&nbsp; + <input type="radio" name="zap_on_announce" value="true"/>{=L:on=} + </td> + </tr> + <tr title="vcr_no_scart: off/on"> + <td>Unterdr&uuml;cke Scart-Umschaltung</td> + <td> + <input type="radio" id="vcr0" name="vcr_no_scart" value="0"/>{=L:off=}&nbsp; + <input type="radio" id="vcr1" name="vcr_no_scart" value="1"/>{=L:on=} + <input type="hidden" name="h_vcr_no_scart"/> + </td> + </tr> + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ + <tr title="SPTS mode: off/on"> + <td>Im SPTS-Modus aufnehmen</td> + <td> + <input type="radio" id="spts0" name="in_spts_mode" value="false"/>{=L:off=}&nbsp; + <input type="radio" id="spts1" name="in_spts_mode" value="true"/>{=L:on=} + <input type="hidden" name="h_in_spts_mode"/> + </td> + </tr> + ~=} + <tr><td colspan="2" class="y_form_header">Timereinstellungen</td></tr> + <tr> + <td>Aufnahmestart-Korrektur (sec)</td> + <td><input type="text" name="EXTRA_TIME_START" size="3" maxlength="3" value="{=ini-get:/var/tuxbox/config/timerd.conf;EXTRA_TIME_START;0=}" title="start timer delay"/>&nbsp;Reboot n&ouml;tig</td> + </tr> + <tr> + <td>Aufnahmeende-Korrektur (sec)</td> + <td><input type="text" name="EXTRA_TIME_END" size="3" maxlength="3" value="{=ini-get:/var/tuxbox/config/timerd.conf;EXTRA_TIME_END;0=}" title="end timer delay"/>&nbsp;Reboot n&ouml;tig</td> + </tr> + <tr> + <td>Umschaltstart-Korrektur (sec)</td> + <td><input type="text" name="ZAPTO_EXTRA_TIME_START" size="3" maxlength="3" value="{=ini-get:/var/tuxbox/config/timerd.conf;ZAPTO_EXTRA_TIME_START;0=}" title="zapto timer delay"/>&nbsp;Reboot n&ouml;tig</td> + </tr> + <tr><td colspan="2" class="y_form_header">Tonspuren</td></tr> + <tr title="record standard audio channel: off/on"> + <td>Standard Tonspur aufnehmen</td> + <td> + <input class="audio" type="radio" name="audio_std" value="0"/>{=L:off=}&nbsp; + <input class="audio" type="radio" name="audio_std" value="1"/>{=L:on=} + </td> + </tr> + <tr title="record alternate audio channel: off/on"> + <td>Alternative Tonspur aufnehmen</td> + <td> + <input class="audio" type="radio" name="audio_alt" value="0"/>{=L:off=}&nbsp; + <input class="audio" type="radio" name="audio_alt" value="1"/>{=L:on=} + </td> + </tr> + <tr title="record ac3 audio channels: off/on"> + <td>AC3 Tonspuren aufnehmen</td> + <td> + <input class="audio" type="radio" name="audio_ac3" value="0"/>{=L:off=}&nbsp; + <input class="audio" type="radio" name="audio_ac3" value="1"/>{=L:on=} </td> </tr> <input type="hidden" name="recording_audio_pids_default" value=""/> @@ -130,98 +168,95 @@ start-block~neutrino_form-data_record <input type="hidden" name="tmpl" value="Y_Settings_neutrino_forms.yhtm"/> <input type="hidden" name="execute" value="include-block:Y_neutrino_Blocks.txt;neutrino_record_save_settings;nix"/> <input type="hidden" name="form" value="{=form=}"/> - <input type="button" value="Save ..." title="submit and save values" onclick="do_submit()"/> + <button type="button" ytype="save" title="{=L:save_values_desc=}s" onclick="do_submit()">{=L:save=}</button> + &nbsp;<button type="button" ytype="refresh" onclick="dbox_reload_neutrino()">reload Neutrino</button> + &nbsp;<a href="javascript:top.top_main.prim_menu.nav('info', 'Y_Info_Help.yhtm');" class="inlink">{=L:help=}</a> </form> </div> </div> <script type="text/javascript"> //<![CDATA[ -function form_init() +function form_init() { - var val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_server_wakeup;0=}"; - if(val == "1") - document.f.wol[1].checked = true; + var val = ""; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_server_ip;10.10.10.10=}"; + document.f.ip.value = val; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_server_port;4000=}"; + document.f.port.value = val; + obj_set_radio_value('wol', "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_server_wakeup;0=}"); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_server_mac;11:22:33:44:55:66=}"; + document.f.mac.value = val; + obj_set_radio_value('stopplayback', "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_stopplayback;false=}"); + obj_set_radio_value('zap_on_announce', "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_zap_on_announce;false=}"); + obj_set_radio_value('vcr_no_scart', "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_vcr_no_scart;0=}"); + obj_set_radio_value('in_spts_mode', "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_in_spts_mode;true=}"); + + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_stopsectionsd;0~cache=}"; + document.f.stopsectionsd.selectedIndex = val; + + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_audio_pids_default;true=}"; + val = parseInt(val); + if(val & 1) + document.f.audio_std[1].checked = true; else - document.f.wol[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_stopplayback;false=}"; - if(val == "true") - document.f.stopplayback[1].checked = true; + document.f.audio_std[0].checked = true; + if(val & 2) + document.f.audio_alt[1].checked = true; else - document.f.stopplayback[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_stopsectionsd;false=}"; - if(val == "true") - document.f.stopsectionsd[1].checked = true; + document.f.audio_alt[0].checked = true; + if(val & 4) + document.f.audio_ac3[1].checked = true; else - document.f.stopsectionsd[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_vcr_no_scart;0=}"; - if(val == "1") - document.f.vcr_no_scart[1].checked = true; - else - document.f.vcr_no_scart[0].checked = true; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_in_spts_mode;true=}"; - if(val == "true") - document.f.in_spts_mode[1].checked = true; - else - document.f.in_spts_mode[0].checked = true; + document.f.audio_ac3[0].checked = true; val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_type;0=}"; document.f.rec_type.selectedIndex = val; - change_rec_type(); } function change_rec_type() { if(document.f.rec_type.selectedIndex != 1) - { - document.f.ip.disabled = true; - document.f.port.disabled = true; - document.f.wol[0].disabled = true; - document.f.wol[1].disabled = true; - document.f.mac.disabled = true; - document.f.stopplayback[0].disabled = true; - document.f.stopplayback[1].disabled = true; - document.f.stopsectionsd[0].disabled = true; - document.f.stopsectionsd[1].disabled = true; - } + $('ip','port', 'mac', 'wol0', 'wol1').invoke('disable'); else - { - document.f.ip.disabled = false; - document.f.port.disabled = false; - document.f.wol[0].disabled = false; - document.f.wol[1].disabled = false; - document.f.mac.disabled = false; - document.f.stopplayback[0].disabled = false; - document.f.stopplayback[1].disabled = false; - document.f.stopsectionsd[0].disabled = false; - document.f.stopsectionsd[1].disabled = false; - } + $('ip','port', 'mac', 'wol0', 'wol1').invoke('enable'); if(document.f.rec_type.selectedIndex != 2) - { - document.f.vcr_no_scart[0].disabled = true; - document.f.vcr_no_scart[1].disabled = true; - } + $('vcr0','vcr1').invoke('disable'); else - { - document.f.vcr_no_scart[0].disabled = false; - document.f.vcr_no_scart[1].disabled = false; + $('vcr0','vcr1').invoke('enable') + if(document.f.rec_type.selectedIndex != 1 && document.f.rec_type.selectedIndex != 3){ + $('spts0','spts1', 'sp0', 'sp1', 'ss').invoke('disable'); + $$('.audio').invoke('disable'); } - if((document.f.rec_type.selectedIndex != 1 && (document.f.rec_type.selectedIndex != 3))) - { - document.f.in_spts_mode[0].disabled = true; - document.f.in_spts_mode[1].disabled = true; - } - else - { - document.f.in_spts_mode[0].disabled = false; - document.f.in_spts_mode[1].disabled = false; + else{ + $('spts0','spts1', 'sp0', 'sp1', 'ss').invoke('enable'); + $$('.audio').invoke('enable'); } + change_mac(); +} +function set_hidden_values() +{ + document.f.h_ip.value = document.f.ip.value; + document.f.h_port.value = document.f.port.value; + document.f.h_wol.value = obj_get_radio_value("wol"); + document.f.h_mac.value = document.f.mac.value; + document.f.h_stopplayback.value = obj_get_radio_value("stopplayback"); + document.f.h_stopsectionsd.value = document.f.stopsectionsd.selectedIndex; + document.f.h_vcr_no_scart.value = obj_get_radio_value("vcr_no_scart"); + document.f.h_in_spts_mode.value = obj_get_radio_value("in_spts_mode"); +} +function change_mac() +{ + var vis = document.f.wol[0].checked; + if(document.f.rec_type.selectedIndex == 1) + document.f.mac.disabled = vis; } - function do_submit() { + set_hidden_values(); show_waitbox(true); + var val = (document.f.audio_std[1].checked == true)?1:0; + val +=(document.f.audio_alt[1].checked == true)?2:0; + val +=(document.f.audio_ac3[1].checked == true)?4:0; + document.f.recording_audio_pids_default.value = val; document.f.submit(); } form_init(); @@ -231,17 +266,20 @@ end-block~neutrino_form-data_record # ------- yWeb save Settings start-block~neutrino_record_save_settings -{=ini-set:/var/tuxbox/config/neutrino.conf;recording_server_ip;{=ip=}~open=} -{=ini-set:/var/tuxbox/config/neutrino.conf;recording_server_port;{=port=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;recording_server_mac;{=mac=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;recording_server_wakeup;{=wol=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_server_ip;{=h_ip=}~open=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_server_port;{=h_port=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_server_mac;{=h_mac=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_server_wakeup;{=h_wol=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;recording_type;{=rec_type=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;recording_stopplayback;{=stopplayback=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;recording_stopsectionsd;{=stopsectionsd=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;recording_vcr_no_scart;{=vcr_no_scart=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;recording_in_spts_mode;{=in_spts_mode=}~save=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_stopplayback;{=h_stopplayback=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_stopsectionsd;{=h_stopsectionsd=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_zap_on_announce;{=zap_on_announce=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_vcr_no_scart;{=h_vcr_no_scart=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_in_spts_mode;{=h_in_spts_mode=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_audio_pids_default;{=recording_audio_pids_default=}~save=} {=ini-set:/var/tuxbox/config/timerd.conf;EXTRA_TIME_START;{=EXTRA_TIME_START=}=} {=ini-set:/var/tuxbox/config/timerd.conf;EXTRA_TIME_END;{=EXTRA_TIME_END=}=} +{=ini-set:/var/tuxbox/config/timerd.conf;ZAPTO_EXTRA_TIME_START;{=ZAPTO_EXTRA_TIME_START=}=} end-block~neutrino_record_save_settings @@ -249,42 +287,60 @@ end-block~neutrino_record_save_settings start-block~neutrino_form-data_movieplayer <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Settings#Movieplayer=}{=var-set:menu=Movieplayer=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Settings-Movieplayer=}{=var-set:menu=Movieplayer=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> - <form name="f" action="/y/cgi"> - <table cellspacing="0" border="0" cellpadding="2"> - <tr> - <td>Streaming server</td> + <form name="f" class="y_form" action="/y/cgi"> + <table cellspacing="0" border="0" cellpadding="2" width="100%"> + <tr><td colspan="2" class="y_form_header">Quellen</td></tr> + <tr class="s" title="Streamingserver: off/on"> + <td width="35%">Streamingserver</td> <td> - <input type="radio" name="streaming_type" value="0" title="Streamingserver: off" onchange="change_streaming_type()"/>Off&nbsp; - <input type="radio" name="streaming_type" value="1" title="Streamingserver: on" onchange="change_streaming_type()"/>On + <input type="radio" name="streaming_type" value="0" onchange="change_streaming_type()"/>{=L:off=}&nbsp; + <input type="radio" name="streaming_type" value="1" onchange="change_streaming_type()"/>{=L:on=} </td> </tr> <tr> - <td style="border-top: 1px solid #6D96A9;">Streamingserver IP</td> - <td style="border-top: 1px solid #6D96A9;"><input type="text" name="streaming_server_ip" size="20" value="{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_server_ip~open=}" title="server ip (xxx.xxx.xxx.xxx)"/></td> + <td>Streamingserver IP</td> + <td> + <input type="text" name="streaming_server_ip" size="20" title="server ip (xxx.xxx.xxx.xxx)"/> + <input type="hidden" name="h_streaming_server_ip"/> + </td> </tr> <tr> <td>Streamingserver Port</td> - <td><input type="text" name="streaming_server_port" size="5" value="{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_server_port;8080~cache=}" title="port"/></td> + <td> + <input type="text" name="streaming_server_port" size="5" maxlength="5" title="port"/> + <input type="hidden" name="h_streaming_server_port"/> + </td> </tr> <tr> - <td>DVD Drive</td> - <td><input type="text" name="streaming_server_cddrive" size="10" value="{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_server_cddrive~cache=}" title="DVD drive on server"/></td> + <td>DVD Laufwerk</td> + <td> + <input type="text" name="streaming_server_cddrive" size="10" title="DVD drive on server"/> + <input type="hidden" name="h_streaming_server_cddrive"/> + </td> </tr> <tr> - <td>Directory (VLC)</td> - <td><input type="text" name="streaming_server_startdir" size="40" value="{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_server_startdir~cache=}" title="VLC directory on server"/></td> + <td>Verzeichnis (VLC)</td> + <td> + <input type="text" name="streaming_server_startdir" size="40" title="VLC directory on server"/> + <input type="hidden" name="h_streaming_server_startdir"/> + </td> </tr> + <tr><td colspan="2" class="y_form_header">Transcoding</td></tr> <tr> - <td style="border-top: 1px solid #6D96A9;">Data Rate Video</td> - <td style="border-top: 1px solid #6D96A9;"><input type="text" name="streaming_videorate" size="6" value="{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_videorate;1000~cache=}" title="video data rate"/></td> + <td>Datenrate Video</td> + <td> + <input type="text" name="streaming_videorate" size="6" title="video data rate"/> + <input type="hidden" name="h_streaming_videorate"/> + </td> </tr> - <tr> + <tr title="Transcode: off/on"> <td>Transcode</td> <td> - <input type="radio" name="streaming_force_transcode_video" value="0" title="Transcode: off"/>Off&nbsp; - <input type="radio" name="streaming_force_transcode_video" value="1" title="Transcode: on"/>On + <input type="radio" name="streaming_force_transcode_video" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="streaming_force_transcode_video" value="1"/>{=L:on=} + <input type="hidden" name="h_streaming_force_transcode_video"/> </td> </tr> <tr> @@ -294,92 +350,135 @@ start-block~neutrino_form-data_movieplayer <option value="0" selected="selected">MPEG1</option> <option value="1">MPEG2</option> </select> + <input type="hidden" name="h_streaming_transcode_video_codec"/> </td> </tr> <tr> - <td>Resulotion</td> + <td>Aufl&ouml;sung</td> <td> <select name="streaming_resolution" title="Resolution"> <option value="0" selected="selected">352 x 288</option> <option value="1">352 x 576</option> <option value="2">480 x 576</option> <option value="3">704 x 576</option> - <option value="4">352 x 277</option> - <option value="5">352 x 576</option> - <option value="6">480 x 576</option> </select> + <input type="hidden" name="h_streaming_resolution"/> </td> </tr> <tr> - <td style="border-top: 1px solid #6D96A9;">Data Rate Audio</td> - <td style="border-top: 1px solid #6D96A9;"><input type="text" name="streaming_audiorate" size="6" value="{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_audiorate;192~cache=}" title="audio data rate"/></td> - </tr> - <tr> + <td>Datenrate Audio</td> + <td> + <input type="text" name="streaming_audiorate" size="6" title="audio data rate"/> + <input type="hidden" name="h_streaming_audiorate"/> + </td> + </tr> + <tr title="Transcode: off/on"> <td>Transcode Audio (dvd/vcd/mpg)</td> <td> - <input type="radio" name="streaming_transcode_audio" value="0" title="Transcode: off"/>Off&nbsp; - <input type="radio" name="streaming_transcode_audio" value="1" title="Transcode: on"/>On + <input type="radio" name="streaming_transcode_audio" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="streaming_transcode_audio" value="1"/>{=L:on=} + <input type="hidden" name="h_streaming_transcode_audio"/> </td> </tr> - <tr> - <td>Force AC3 with avi</td> + <tr title="force AC3: off/on"> + <td>Erzwinge AC3 bei avi</td> <td> - <input type="radio" name="streaming_force_avi_rawaudio" value="0" title="force AC3: off"/>Off&nbsp; - <input type="radio" name="streaming_force_avi_rawaudio" value="1" title="force AC3: on"/>On + <input type="radio" name="streaming_force_avi_rawaudio" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="streaming_force_avi_rawaudio" value="1"/>{=L:on=} + <input type="hidden" name="h_streaming_force_avi_rawaudio"/> </td> </tr> - + <tr><td colspan="2" class="y_form_header">Player</td></tr> <tr> - <td style="border-top: 1px solid #6D96A9;">Start Directory</td> - <td style="border-top: 1px solid #6D96A9;"><input type="text" name="network_nfs_moviedir" size="40" value="{=ini-get:/var/tuxbox/config/neutrino.conf;network_nfs_moviedir~cache=}" title="movie start directory"/></td> - </tr> + <td>Startverzeichnis</td> + <td><input type="text" name="streaming_moviedir" size="40" title="movie start directory"/></td> + </tr> + <tr> + <td width="35%">EPG (Sectionsd)</td> + <td> + <select name="stopsectionsd_mp" title="sectionsd: off/on/restart"> + <option value="0" selected="selected">nicht anhalten</option> + <option value="1">anhalten</option> + <option value="2">neu starten</option> + </select>&nbsp;(Nur Movieplayer1) + </td> + </tr> + <tr> + <td>Verwende Buffer (WabberQueue)</td> + <td> + <input type="radio" name="streaming_use_buffer" value="0" title="WabberQueue: off"/>{=L:off=}&nbsp; + <input type="radio" name="streaming_use_buffer" value="1" title="WabberQueue: on"/>{=L:on=}&nbsp;&nbsp;(Nur Movieplayer1) + </td> + </tr> + <tr> + <td>Anzahl Buffersegmente</td> + <td><input type="text" name="streaming_buffer_segment_size" size="2" maxlength="2" title="VLC directory on server"/><span style="position:absolute; left:424px;">(Nur Movieplayer1)</span></td> + </tr> + <tr title="show tv in browser: off/on"> + <td>TV Bild im Browser</td> + <td> + <input type="radio" name="streaming_show_tv_in_browser" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="streaming_show_tv_in_browser" value="1"/>{=L:on=} + </td> + </tr> </table> <br/> <input type="hidden" name="tmpl" value="Y_Settings_neutrino_forms.yhtm"/> <input type="hidden" name="execute" value="include-block:Y_neutrino_Blocks.txt;neutrino_movieplayer_save_settings;nix"/> <input type="hidden" name="form" value="{=form=}"/> - <input type="button" value="Save ..." title="submit and save values" onclick="do_submit()"/> + <button type="button" ytype="save" title="{=L:save_values_desc=}s" onclick="do_submit()">{=L:save=}</button> + &nbsp;<button type="button" ytype="refresh" onclick="dbox_reload_neutrino()">reload Neutrino</button> + &nbsp;<a href="javascript:top.top_main.prim_menu.nav('info', 'Y_Info_Help.yhtm');" class="inlink">{=L:help=}</a> </form> </div> </div> <script type="text/javascript"> //<![CDATA[ -function form_init() +function form_init() { - var val = "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_type;0~cache=}"; - if(val == "1") - document.f.streaming_type[1].checked = true; - else - document.f.streaming_type[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_force_transcode_video;0~cache=}"; - if(val == "1") - document.f.streaming_force_transcode_video[1].checked = true; - else - document.f.streaming_force_transcode_video[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_transcode_audio;0~cache=}"; - if(val == "1") - document.f.streaming_transcode_audio[1].checked = true; - else - document.f.streaming_transcode_audio[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_force_avi_rawaudio;0~cache=}"; - if(val == "1") - document.f.streaming_force_avi_rawaudio[1].checked = true; - else - document.f.streaming_force_avi_rawaudio[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_resolution;0~cache=}"; - document.f.streaming_resolution.selectedIndex = val; + var val = ""; + obj_set_radio_value('streaming_type', "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_type;0~open=}"); + + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_server_ip~cache=}"; + document.f.streaming_server_ip.value = val; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_server_port;8080~cache=}"; + document.f.streaming_server_port.value = val; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_server_cddrive;D:~cache=}"; + document.f.streaming_server_cddrive.value = val; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_server_startdir;C:/Movies~cache=}"; + document.f.streaming_server_startdir.value = val; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_videorate;1000~cache=}"; + document.f.streaming_videorate.value = val; + + obj_set_radio_value('streaming_force_transcode_video', "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_force_transcode_video;0~cache=}"); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_transcode_video_codec;0~cache=}"; document.f.streaming_transcode_video_codec.selectedIndex = val; - + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_resolution;0~cache=}"; + document.f.streaming_resolution.selectedIndex = val; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_audiorate;192~cache=}"; + document.f.streaming_audiorate.value = val; + + obj_set_radio_value('streaming_transcode_audio', "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_transcode_audio;0~cache=}"); + obj_set_radio_value('streaming_force_avi_rawaudio', "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_force_avi_rawaudio;0~cache=}"); + + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_moviedir~cache=}"; + document.f.streaming_moviedir.value = val; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_stopsectionsd;1~cache=}"; + document.f.stopsectionsd_mp.selectedIndex = val; + + obj_set_radio_value('streaming_use_buffer', "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_use_buffer;1~cache=}"); + + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_buffer_segment_size;24~cache=}"; + document.f.streaming_buffer_segment_size.value = val; + + obj_set_radio_value('streaming_show_tv_in_browser', "{=ini-get:/var/tuxbox/config/neutrino.conf;streaming_show_tv_in_browser;0~cache=}"); change_streaming_type(); } function change_streaming_type() { var vis = document.f.streaming_type[0].checked; + document.f.streaming_server_ip.disabled = vis; document.f.streaming_server_port.disabled = vis; document.f.streaming_server_cddrive.disabled = vis; @@ -395,9 +494,23 @@ function change_streaming_type() document.f.streaming_force_avi_rawaudio[0].disabled = vis; document.f.streaming_force_avi_rawaudio[1].disabled = vis; } - +function set_hidden_values() +{ + document.f.h_streaming_server_ip.value = document.f.streaming_server_ip.value; + document.f.h_streaming_server_port.value = document.f.streaming_server_port.value; + document.f.h_streaming_server_cddrive.value = document.f.streaming_server_cddrive.value; + document.f.h_streaming_server_startdir.value = document.f.streaming_server_startdir.value; + document.f.h_streaming_videorate.value = document.f.streaming_videorate.value; + document.f.h_streaming_force_transcode_video.value = obj_get_radio_value("streaming_force_transcode_video"); + document.f.h_streaming_transcode_video_codec.value = document.f.streaming_transcode_video_codec.selectedIndex; + document.f.h_streaming_resolution.value = document.f.streaming_resolution.selectedIndex; + document.f.h_streaming_audiorate.value = document.f.streaming_audiorate.value; + document.f.h_streaming_transcode_audio.value = obj_get_radio_value("streaming_transcode_audio"); + document.f.h_streaming_force_avi_rawaudio.value = obj_get_radio_value("streaming_force_avi_rawaudio"); +} function do_submit() { + set_hidden_values(); show_waitbox(true); document.f.submit(); } @@ -409,18 +522,23 @@ end-block~neutrino_form-data_movieplayer # ------- yWeb save Settings start-block~neutrino_movieplayer_save_settings {=ini-set:/var/tuxbox/config/neutrino.conf;streaming_type;{=streaming_type=}~open=} -{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_server_ip;{=streaming_server_ip=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_server_port;{=streaming_server_port=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_server_cddrive;{=streaming_server_cddrive=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_server_startdir;{=streaming_server_startdir=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_videorate;{=streaming_videorate=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_force_transcode_video;{=streaming_force_transcode_video=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_transcode_video_codec;{=streaming_transcode_video_codec=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_resolution;{=streaming_resolution=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_audiorate;{=streaming_audiorate=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_transcode_audio;{=streaming_transcode_audio=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_force_avi_rawaudio;{=streaming_force_avi_rawaudio=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;network_nfs_moviedir;{=network_nfs_moviedir=}~save=} +{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_server_ip;{=h_streaming_server_ip=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_server_port;{=h_streaming_server_port=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_server_cddrive;{=h_streaming_server_cddrive=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_server_startdir;{=h_streaming_server_startdir=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_videorate;{=h_streaming_videorate=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_force_transcode_video;{=h_streaming_force_transcode_video=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_transcode_video_codec;{=h_streaming_transcode_video_codec=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_resolution;{=h_streaming_resolution=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_audiorate;{=h_streaming_audiorate=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_transcode_audio;{=h_streaming_transcode_audio=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_force_avi_rawaudio;{=h_streaming_force_avi_rawaudio=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_moviedir;{=streaming_moviedir=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_stopsectionsd;{=stopsectionsd_mp=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_use_buffer;{=streaming_use_buffer=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_buffer_segment_size;{=streaming_buffer_segment_size=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;streaming_show_tv_in_browser;{=streaming_show_tv_in_browser=}~save=} + end-block~neutrino_movieplayer_save_settings @@ -428,24 +546,24 @@ end-block~neutrino_movieplayer_save_settings start-block~neutrino_form-data_parental <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Settings#Jugendschutz=}{=var-set:menu=Parental=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Settings-Jugendschutz=}{=var-set:menu=Jugendschutz=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <form name="f" action="/y/cgi"> - <table cellspacing="0" border="0" cellpadding="2"> + <table cellspacing="0" border="0" cellpadding="2" width="100%"> <tr> - <td>Activate</td> + <td width="35%">Aktivieren</td> <td> <select name="parentallock_prompt" title="parental type"> - <option value="0">Never</option> + <option value="0">Nie</option> <option value="2">Bouquet</option> - <option value="3">Preblock</option> + <option value="3">Vorsperre</option> </select> </td> </tr> <tr> - <td title="minimal age">Minimum Age</td> + <td title="minimal age">Mindestalter</td> <td> - <select name="parentallock_lockage" title="mimimal age"> + <select name="parentallock_lockage" title="minimal age"> <option value="12">12</option> <option value="16">16</option> <option value="18">18</option> @@ -454,20 +572,22 @@ start-block~neutrino_form-data_parental </tr> <tr> <td>PIN</td> - <td><input type="text" name="parentallock_pincode" size="4" value="{=ini-get:/var/tuxbox/config/neutrino.conf;parentallock_pincode~open=}" title="PIN code"/></td> + <td><input type="text" name="parentallock_pincode" size="4" maxlength="4" value="{=ini-get:/var/tuxbox/config/neutrino.conf;parentallock_pincode~open=}" title="PIN code"/></td> </tr> </table> <br/> <input type="hidden" name="tmpl" value="Y_Settings_neutrino_forms.yhtm"/> <input type="hidden" name="execute" value="include-block:Y_neutrino_Blocks.txt;neutrino_parental_save_settings;nix"/> <input type="hidden" name="form" value="{=form=}"/> - <input type="button" value="Save ..." title="submit and save values" onclick="do_submit()"/> + <button type="button" ytype="save" title="{=L:save_values_desc=}s" onclick="do_submit()">{=L:save=}</button> + &nbsp;<button type="button" ytype="refresh" onclick="dbox_reload_neutrino()">reload Neutrino</button> + &nbsp;<a href="javascript:top.top_main.prim_menu.nav('info', 'Y_Info_Help.yhtm');" class="inlink">{=L:help=}</a> </form> </div> </div> <script type="text/javascript"> //<![CDATA[ -function form_init() +function form_init() { var val = ""; val = "{=ini-get:/var/tuxbox/config/neutrino.conf;parentallock_prompt;0~open=}"; @@ -481,8 +601,12 @@ function form_init() } function do_submit() { - show_waitbox(true); - document.f.submit(); + if(document.f.parentallock_pincode.value.length < 1) + alert("Jugendschutz-PIN muss 1-4 stellig sein"); + else{ + show_waitbox(true); + document.f.submit(); + } } form_init(); //]]> @@ -500,118 +624,247 @@ end-block~neutrino_parental_save_settings start-block~neutrino_form-data_diverse <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Settings#Diverse=}{=var-set:menu=Misc=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Settings-Diverse=}{=var-set:menu=Diverse Einstellungen=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> - <form name="f" action="/y/cgi"> - <table cellspacing="0" border="0" cellpadding="2"> + <form name="f" action="/y/cgi" class="y_form"> + <table cellspacing="0" border="0" cellpadding="2" width="100%"> <tr> - <td><strong>Standard</strong></td> - <td>&nbsp;</td> + <td colspan="2" width="35%" class="y_form_header">Allgemein</td> </tr> <tr> - <td>Standby mode</td> + <td>Startmodus</td> <td> - <input type="radio" name="shutdown_real" value="true" title="Shutdown: off"/>Off&nbsp; - <input type="radio" name="shutdown_real" value="false" title="Shutdown: on"/>On - </td> - </tr> - <tr> - <td>Turn off completely</td> - <td><input type="text" name="shutdown_count" size="3" value="{=ini-get:/var/tuxbox/config/neutrino.conf;shutdown_count;0~open=}" title="shutdown after x sec"/></td> - </tr> - <tr> - <td>Infobar Satellite type</td> - <td> - <input type="radio" name="infobar_sat_display" value="false" title="infobar sat display: off"/>Off&nbsp; - <input type="radio" name="infobar_sat_display" value="true" title="infobar sat display: on"/>On - </td> - </tr> - <tr> - <td>Show Subchannel</td> - <td> - <select name="infobar_subchan_disp_pos" title="subchannel display position"> - <option value="0" selected="selected">top right</option> - <option value="1">top left</option> - <option value="2">bottom left</option> - <option value="3">bottom right</option> + <select name="startmode" title="select startmodus"> + <option value="0" selected="selected">Letzter Modus</option> + <option value="1">TV-Modus</option> + <option value="2">Radio-Modus</option> + <option value="3">Scart-Eingang</option> + <option value="4">Audioplayer</option> + <option value="5">Internetradio</option> + <option value="6">Esound Soundserver</option> + <option value="7">Standby</option> </select> </td> </tr> - <tr> - <td>Save Teletext</td> + <tr title="Shutdown: off/on"> + <td>Standbymodus</td> <td> - <input type="radio" name="tuxtxt_cache" value="false" title="tuxtxt cache: off"/>Off&nbsp; - <input type="radio" name="tuxtxt_cache" value="true" title="tuxtxt cache: on"/>On + <input type="radio" name="shutdown_real" value="true"/>{=L:off=}&nbsp; + <input type="radio" name="shutdown_real" value="false"/>{=L:on=} + </td> + </tr> + <tr title="Save power: off/on"> + <td>Standby Stromsparmodus (exp.)</td> + <td> + <input type="radio" name="standby_save_power" value="false"/>{=L:off=}&nbsp; + <input type="radio" name="standby_save_power" value="true"/>{=L:on=} </td> </tr> <tr> - <td>Virtual zap Infobar</td> + <td>Komplett ausschalten nach</td> + <td><input type="text" name="shutdown_count" size="3" value="{=ini-get:/var/tuxbox/config/neutrino.conf;shutdown_count;0~open=}" title="shutdown after x sec"/>&nbsp;Min.</td> + </tr> + <tr title="shutdown delay: off/on"> + <td>Verz&ouml;gerter Shutdown</td> <td> - <input type="radio" name="virtual_zap_mode" value="false" title="virtual zap: off"/>Off&nbsp; - <input type="radio" name="virtual_zap_mode" value="true" title="virtual zap: on"/>On + <input type="radio" name="shutdown_real_rcdelay" value="false"/>{=L:off=}&nbsp; + <input type="radio" name="shutdown_real_rcdelay" value="true"/>{=L:on=} </td> </tr> <tr> - <td style="border-top: 1px solid #6D96A9;"><strong>EPG-Settings</strong></td> - <td style="border-top: 1px solid #6D96A9;">&nbsp;</td> + <td>Standby aus mit</td> + <td> + <select name="standby_off_with" title="select button"> + <option value="0" selected="selected">Power</option> + <option value="1">Power, OK</option> + <option value="2">Power, Home</option> + <option value="3">Power, Home, OK</option> + </select> + </td> + </tr> + <tr title="tuxtxt cache: off/on"> + <td>Videotext zwischenspeichern</td> + <td> + <input type="radio" name="tuxtxt_cache" value="false"/>{=L:off=}&nbsp; + <input type="radio" name="tuxtxt_cache" value="true"/>{=L:on=} + </td> </tr> - <tr> - <td>EPG-Cache (Days)</td> + <td colspan="2" width="35%" class="y_form_header">OSD-Extras</td> + </tr> + <tr> + <td>Lautstärkeanzeige</td> + <td> + <select name="volumebar_disp_pos" title="select volumebar position"> + <option value="0" selected="selected">oben rechts</option> + <option value="1">oben links</option> + <option value="2">unten links</option> + <option value="3">unten rechts</option> + <option value="4">unten Mitte</option> + <option value="5">erh&ouml;hte Mitte</option> + <option value="6">aus</option> + </select> + </td> + </tr> + <tr title="Mute Icon: on/off"> + <td>Mute Icon bei Lautstärke 0</td> + <td> + <input type="radio" name="show_mute_icon" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="show_mute_icon" value="1"/>{=L:on=}&nbsp; + <input type="radio" name="show_mute_icon" value="2"/>nicht bei AC3 + </td> + </tr> + <tr> + <td colspan="2" width="35%" class="y_form_header">Infobar</td> + </tr> + <tr title="infobar sat display: off/on"> + <td>Satellitenanzeige</td> + <td> + <input type="radio" name="infobar_sat_display" value="false"/>{=L:off=}&nbsp; + <input type="radio" name="infobar_sat_display" value="true"/>{=L:on=} + </td> + </tr> + <tr> + <td>Unterkanalanzeige</td> + <td> + <select name="infobar_subchan_disp_pos" title="subchannel display position"> + <option value="0" selected="selected">oben rechts</option> + <option value="1">oben links</option> + <option value="2">unten links</option> + <option value="3">unten rechts</option> + <option value="4">in Infobar</option> + </select> + </td> + </tr> + <tr title="virtual zap: off/on"> + <td>Virtual Zap</td> + <td> + <input type="radio" name="virtual_zap_mode" value="false"/>{=L:off=}&nbsp; + <input type="radio" name="virtual_zap_mode" value="true"/>{=L:on=} + </td> + </tr> + <tr> + <td>Info bei EPG &Auml;nderung</td> + <td> + <select name="infobar_show" title="infobar show type"> + <option value="0" selected="selected">Aus</option> + <option value="1">Popup</option> + <option value="2">Infobar einblenden</option> + </select> + </td> + </tr> + <tr title="radiotext: off/on"> + <td>Radiotext</td> + <td> + <input type="radio" name="radiotext" value="false"/>{=L:off=}&nbsp; + <input type="radio" name="radiotext" value="true"/>{=L:on=} + </td> + </tr> + <tr> + <td colspan="2" width="35%" class="y_form_header">Kanalliste</td> + </tr> + <tr title="programtext position: left/right"> + <td>Ausrichtung Programmtext</td> + <td> + <input type="radio" name="epgtext_align_right" value="false"/>links&nbsp; + <input type="radio" name="epgtext_align_right" value="true"/>rechts + </td> + </tr> + <tr title="extended channellist: on/off"> + <td>erweiterte Kanalliste</td> + <td> + <input type="radio" name="channellist_extended" value="false"/>{=L:off=}&nbsp; + <input type="radio" name="channellist_extended" value="true"/>{=L:on=} + </td> + </tr> + <tr> + <td colspan="2" width="35%" class="y_form_header">EPG-Einstellungen</td> + </tr> + <tr> + <td>EPG-Cache (Tage)</td> <td><input type="text" name="epg_cache_time" size="5" value="{=ini-get:/var/tuxbox/config/neutrino.conf;epg_cache_time~cache=}" title="EPG cache"/></td> </tr> <tr> - <td>EPG remove after (Std.)</td> + <td>EPG-Langtext (Stunden)</td> + <td><input type="text" name="epg_extendedcache_time" size="5" value="{=ini-get:/var/tuxbox/config/neutrino.conf;epg_extendedcache_time~cache=}" title="EPG extended cache"/></td> + </tr> + <tr> + <td>EPG verwerfen nach (Std.)</td> <td><input type="text" name="epg_old_events" size="5" value="{=ini-get:/var/tuxbox/config/neutrino.conf;epg_old_events~cache=}" title=""/></td> </tr> <tr> <td>Max. Events</td> <td><input type="text" name="epg_max_events" size="5" value="{=ini-get:/var/tuxbox/config/neutrino.conf;epg_max_events~cache=}" title=""/></td> + </tr> + <tr> + <td>EPG Verzeichnis</td> + <td><input type="text" name="epg_dir" size="40" value="{=ini-get:/var/tuxbox/config/neutrino.conf;epg_dir~cache=}" title="epg dircetory"/>&nbsp;e.g. /mnt/mmc/epg/</td> + </tr> + <tr> + <td colspan="2" width="35%" class="y_form_header">Zapit (Hinweis: pzapit -kill vorm Speichern ausf&uuml;hren)</td> + </tr> + <tr title="save last channel: on/off"> + <td>letzten Kanal speichern</td> + <td> + <input type="radio" onchange="change_lastchannel()" name="save_lastchannel" value="false"/>{=L:off=}&nbsp; + <input type="radio" onchange="change_lastchannel()" name="save_lastchannel" value="true"/>{=L:on=} </td> </tr> <tr> - <td style="border-top: 1px solid #6D96A9;"><strong>Remote Control</strong></td> - <td style="border-top: 1px solid #6D96A9;">&nbsp;</td> - </tr> - - <tr> - <td>Repeat delay</td> - <td><input type="text" name="repeat_blocker" size="3" value="{=ini-get:/var/tuxbox/config/neutrino.conf;repeat_blocker~cache=}" title="repeat delay"/></td> + <td>TV-Startkanal</td> + <td><input type="text" name="startchannel_tv" size="4" value="{=ini-get:/var/tuxbox/config/zapit/zapit.conf;startChannelTV;0~open=}" title="tv-startchannel"/></td> </tr> <tr> - <td>Start delay</td> - <td><input type="text" name="repeat_genericblocker" size="3" value="{=ini-get:/var/tuxbox/config/neutrino.conf;repeat_genericblocker~cache=}" title="start delay"/></td> + <td>Radio-Startkanal</td> + <td><input type="text" name="startchannel_radio" size="4" value="{=ini-get:/var/tuxbox/config/zapit/zapit.conf;startChannelRadio;0~cache=}" title="radio-startchannel"/></td> </tr> - <tr> - <td>Delay Shutdown</td> + <tr title="save audio-PIDs: on/off"> + <td>Audio-PIDs speichern</td> <td> - <input type="radio" name="shutdown_real_rcdelay" value="false" title="shutdown delay: off"/>Off&nbsp; - <input type="radio" name="shutdown_real_rcdelay" value="true" title="shutdown delay: on"/>On + <input type="radio" name="save_audio_pids" value="false"/>{=L:off=}&nbsp; + <input type="radio" name="save_audio_pids" value="true"/>{=L:on=} + </td> + </tr> + <tr title="bouquet others: on/off"> + <td>Bouquet Andere</td> + <td> + <input type="radio" name="bouquet_others" value="false"/>{=L:off=}&nbsp; + <input type="radio" name="bouquet_others" value="true"/>{=L:on=} </td> </tr> <tr> - <td style="border-top: 1px solid #6D96A9;"><strong>Filebrowser</strong></td> - <td style="border-top: 1px solid #6D96A9;">&nbsp;</td> + <td colspan="2" width="35%" class="y_form_header">Fernbedienung</td> </tr> <tr> - <td>Filesystem</td> + <td>Anfangsverz&ouml;gerung</td> + <td><input type="text" name="repeat_blocker" size="3" maxlength="3" value="{=ini-get:/var/tuxbox/config/neutrino.conf;repeat_blocker~open=}" title="start delay"/></td> + </tr> + <tr> + <td>Wiederholungsverz&ouml;gerung</td> + <td><input type="text" name="repeat_genericblocker" size="3" maxlength="3" value="{=ini-get:/var/tuxbox/config/neutrino.conf;repeat_genericblocker~cache=}" title="repeat delay"/></td> + </tr> + <tr> + <td colspan="2" width="35%" class="y_form_header">Filebrowser</td> + </tr> + <tr title="filesystem type"> + <td>Dateisystem</td> <td> - <input type="radio" name="filesystem_is_utf8" value="false" title="filesystem type"/>ISO-8859-1&nbsp; - <input type="radio" name="filesystem_is_utf8" value="true" title="filesystem type"/>UTF-8 + <input type="radio" name="filesystem_is_utf8" value="false"/>ISO-8859-1&nbsp; + <input type="radio" name="filesystem_is_utf8" value="true"/>UTF-8 </td> </tr> - <tr> - <td>Show file rights</td> + <tr title="show filesystem rights: off/on"> + <td>Dateirechte anzeigen</td> <td> - <input type="radio" name="filebrowser_showrights" value="0" title="show filesystem rights: off"/>Off&nbsp; - <input type="radio" name="filebrowser_showrights" value="1" title="show filesystem rights: on"/>On + <input type="radio" name="filebrowser_showrights" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="filebrowser_showrights" value="1"/>{=L:on=} </td> </tr> - <tr> - <td>Absolute start directory</td> + <tr title="start directory is absolute: off/on"> + <td>Startverzeichnis absolut</td> <td> - <input type="radio" name="filebrowser_denydirectoryleave" value="false" title="start directory is absolute: off"/>Off&nbsp; - <input type="radio" name="filebrowser_denydirectoryleave" value="true" title="start directory is absolute: on"/>On + <input type="radio" name="filebrowser_denydirectoryleave" value="false"/>{=L:off=}&nbsp; + <input type="radio" name="filebrowser_denydirectoryleave" value="true"/>{=L:on=} </td> </tr> </table> @@ -619,85 +872,56 @@ start-block~neutrino_form-data_diverse <input type="hidden" name="tmpl" value="Y_Settings_neutrino_forms.yhtm"/> <input type="hidden" name="execute" value="include-block:Y_neutrino_Blocks.txt;neutrino_diverse_save_settings;nix"/> <input type="hidden" name="form" value="{=form=}"/> - <input type="button" value="Save ..." title="submit and save values" onclick="do_submit()"/> + <button type="button" ytype="save" title="{=L:save_values_desc=}s" onclick="do_submit()">{=L:save=}</button> + &nbsp;<button type="button" ytype="refresh" onclick="dbox_reload_neutrino()">reload Neutrino</button> + &nbsp;<a href="javascript:top.top_main.prim_menu.nav('info', 'Y_Info_Help.yhtm');" class="inlink">{=L:help=}</a> </form> </div> </div> <script type="text/javascript"> //<![CDATA[ -function form_init() +function form_init() { - var val = "{=ini-get:/var/tuxbox/config/neutrino.conf;shutdown_real~cache=}"; - if(val == "false") - document.f.shutdown_real[1].checked = true; - else - document.f.shutdown_real[0].checked = true; + var val = ""; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;startmode;0=}"; + document.f.startmode.selectedIndex = val; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;infobar_sat_display~cache=}"; - if(val == "true") - document.f.infobar_sat_display[1].checked = true; - else - document.f.infobar_sat_display[0].checked = true; + obj_set_radio_value('shutdown_real', "{=ini-get:/var/tuxbox/config/neutrino.conf;shutdown_real;true~cache=}"); + obj_set_radio_value('standby_save_power', "{=ini-get:/var/tuxbox/config/neutrino.conf;standby_save_power;false~cache=}"); + obj_set_radio_value('shutdown_real_rcdelay', "{=ini-get:/var/tuxbox/config/neutrino.conf;shutdown_real_rcdelay;true~cache=}"); + obj_set_radio_value('tuxtxt_cache', "{=ini-get:/var/tuxbox/config/neutrino.conf;tuxtxt_cache;false~cache=}"); + + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;volumebar_disp_pos;4=}"; + document.f.volumebar_disp_pos.selectedIndex = val; + obj_set_radio_value('show_mute_icon', "{=ini-get:/var/tuxbox/config/neutrino.conf;show_mute_icon;1~cache=}"); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;infobar_subchan_disp_pos;0~cache=}"; + obj_set_radio_value('infobar_sat_display', "{=ini-get:/var/tuxbox/config/neutrino.conf;infobar_sat_display;true~cache=}"); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;infobar_subchan_disp_pos;0=}"; document.f.infobar_subchan_disp_pos.selectedIndex = val; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;tuxtxt_cache~cache=}"; - if(val == "true") - document.f.tuxtxt_cache[1].checked = true; - else - document.f.tuxtxt_cache[0].checked = true; + obj_set_radio_value('virtual_zap_mode', "{=ini-get:/var/tuxbox/config/neutrino.conf;virtual_zap_mode;false~cache=}"); + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;infobar_show;0=}"; + document.f.infobar_show.selectedIndex = val; + obj_set_radio_value('radiotext', "{=ini-get:/var/tuxbox/config/neutrino.conf;radiotext_enable;false~cache=}"); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;virtual_zap_mode~cache=}"; - if(val == "true") - document.f.virtual_zap_mode[1].checked = true; - else - document.f.virtual_zap_mode[0].checked = true; + obj_set_radio_value('epgtext_align_right', "{=ini-get:/var/tuxbox/config/neutrino.conf;channellist_epgtext_align_right;false~cache=}"); + obj_set_radio_value('channellist_extended', "{=ini-get:/var/tuxbox/config/neutrino.conf;channellist_extended;false~cache=}"); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;shutdown_real_rcdelay~cache=}"; - if(val == "true") - document.f.shutdown_real_rcdelay[1].checked = true; - else - document.f.shutdown_real_rcdelay[0].checked = true; + val = "{=ini-get:/var/tuxbox/config/neutrino.conf;standby_off_with;0=}"; + document.f.standby_off_with.selectedIndex = val; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;infobar_sat_display~cache=}"; - if(val == "true") - document.f.infobar_sat_display[1].checked = true; - else - document.f.infobar_sat_display[0].checked = true; + obj_set_radio_value('filesystem_is_utf8', "{=ini-get:/var/tuxbox/config/neutrino.conf;filesystem_is_utf8;true~cache=}"); + obj_set_radio_value('filebrowser_showrights', "{=ini-get:/var/tuxbox/config/neutrino.conf;filebrowser_showrights;1~cache=}"); + obj_set_radio_value('filebrowser_denydirectoryleave', "{=ini-get:/var/tuxbox/config/neutrino.conf;filebrowser_denydirectoryleave;false~cache=}"); +//zapit + obj_set_radio_value('save_lastchannel', "{=ini-get:/var/tuxbox/config/zapit/zapit.conf;saveLastChannel;true~open=}"); + obj_set_radio_value('save_audio_pids', "{=ini-get:/var/tuxbox/config/zapit/zapit.conf;saveAudioPIDs;false~cache=}"); + obj_set_radio_value('bouquet_others', "{=ini-get:/var/tuxbox/config/zapit/zapit.conf;makeRemainingChannelsBouquet;true~cache=}"); + change_lastchannel(); +} - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;infobar_subchan_disp_pos;0~cache=}"; - document.f.infobar_subchan_disp_pos.selectedIndex = val; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;tuxtxt_cache~cache=}"; - if(val == "true") - document.f.tuxtxt_cache[1].checked = true; - else - document.f.tuxtxt_cache[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;shutdown_real_rcdelay~cache=}"; - if(val == "true") - document.f.shutdown_real_rcdelay[1].checked = true; - else - document.f.shutdown_real_rcdelay[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;filesystem_is_utf8~cache=}"; - if(val == "true") - document.f.filesystem_is_utf8[1].checked = true; - else - document.f.filesystem_is_utf8[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;filebrowser_showrights;0~cache=}"; - if(val == "1") - document.f.filebrowser_showrights[1].checked = true; - else - document.f.filebrowser_showrights[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;filebrowser_denydirectoryleave~cache=}"; - if(val == "true") - document.f.filebrowser_denydirectoryleave[1].checked = true; - else - document.f.filebrowser_denydirectoryleave[0].checked = true; +function change_lastchannel() +{ } function do_submit() @@ -710,23 +934,39 @@ form_init(); </script> end-block~neutrino_form-data_diverse -# ------- yWeb save Settings +# ------- yWeb save Settings start-block~neutrino_diverse_save_settings -{=ini-set:/var/tuxbox/config/neutrino.conf;shutdown_real;{=shutdown_real=}~open=} -{=ini-set:/var/tuxbox/config/neutrino.conf;shutdown_count;{=shutdown_count=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;infobar_sat_display;{=infobar_sat_display=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;infobar_subchan_disp_pos;{=infobar_subchan_disp_pos=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;tuxtxt_cache;{=tuxtxt_cache=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;virtual_zap_mode;{=virtual_zap_mode=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;channellist_epgtext_align_right;{=epgtext_align_right=}~open=} +{=ini-set:/var/tuxbox/config/neutrino.conf;channellist_extended;{=channellist_extended=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;epg_cache_time;{=epg_cache_time=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;epg_old_events;{=epg_old_events=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;epg_dir;{=epg_dir=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;epg_extendedcache_time;{=epg_extendedcache_time=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;epg_max_events;{=epg_max_events=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;epg_old_events;{=epg_old_events=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;filebrowser_showrights;{=filebrowser_showrights=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;filebrowser_denydirectoryleave;{=filebrowser_denydirectoryleave=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;filesystem_is_utf8;{=filesystem_is_utf8=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;infobar_sat_display;{=infobar_sat_display=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;infobar_show;{=infobar_show=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;infobar_subchan_disp_pos;{=infobar_subchan_disp_pos=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;radiotext_enable;{=radiotext=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;repeat_blocker;{=repeat_blocker=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;repeat_genericblocker;{=repeat_genericblocker=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;show_mute_icon;{=show_mute_icon=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;shutdown_count;{=shutdown_count=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;shutdown_real;{=shutdown_real=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;shutdown_real_rcdelay;{=shutdown_real_rcdelay=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;filesystem_is_utf8;{=filesystem_is_utf8=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;filebrowser_showrights;{=filebrowser_showrights=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;filebrowser_denydirectoryleave;{=filebrowser_denydirectoryleave=}~save=} +{=ini-set:/var/tuxbox/config/neutrino.conf;standby_off_with;{=standby_off_with=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;standby_save_power;{=standby_save_power=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;startmode;{=startmode=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;tuxtxt_cache;{=tuxtxt_cache=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;virtual_zap_mode;{=virtual_zap_mode=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;volumebar_disp_pos;{=volumebar_disp_pos=}~save=} +{=ini-set:/var/tuxbox/config/zapit/zapit.conf;saveAudioPIDs;{=save_audio_pids=}~open=} +{=ini-set:/var/tuxbox/config/zapit/zapit.conf;saveLastChannel;{=save_lastchannel=}~cache=} +{=ini-set:/var/tuxbox/config/zapit/zapit.conf;startChannelRadio;{=startchannel_radio=}~cache=} +{=ini-set:/var/tuxbox/config/zapit/zapit.conf;startChannelTV;{=startchannel_tv=}~cache=} +{=ini-set:/var/tuxbox/config/zapit/zapit.conf;makeRemainingChannelsBouquet;{=bouquet_others=}~save=} end-block~neutrino_diverse_save_settings @@ -734,57 +974,98 @@ end-block~neutrino_diverse_save_settings start-block~neutrino_form-data_bootoptions <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Settings#Bootoptionen=}{=var-set:menu=Driver- and Bootoptions=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Settings-Bootoptionen=}{=var-set:menu=Treiber- und Bootoptionen=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> - <form name="f" action="/y/cgi"> - <table cellspacing="0" border="0" cellpadding="2"> - <tr> - <td>Load SPTS-Mode Drivers</td> + <form name="f" class="y_form" action="/y/cgi"> + <table cellspacing="0" border="0" cellpadding="2" width="100%"> + <tr title="SPTS mode: off/on"> + <td width="35%">SPTS-Mode Treiber laden</td> <td> - <input type="radio" name="misc_spts" value="false" title="SPTS mode: off"/>Off&nbsp; - <input type="radio" name="misc_spts" value="true" title="SPTS mode: on"/>On + <input type="radio" name="misc_spts" value="false"/>{=L:off=}&nbsp; + <input type="radio" name="misc_spts" value="true"/>{=L:on=} + </td> + </tr> + <tr title="Bootinfo: off/on"> + <td>Infos beim Booten anzeigen</td> + <td> + <input type="radio" name="bootinfo" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="bootinfo" value="1"/>{=L:on=} + </td> + </tr> + <tr title="HW Sections: off/on"> + <td>HW-Sections verwenden</td> + <td> + <input type="radio" name="hwsections" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="hwsections" value="1"/>{=L:on=} + </td> + </tr> + <tr title="AVIA-Watchdog: off/on"> + <td>AVIA-Watchdog aktivieren</td> + <td> + <input type="radio" name="no_watchdog" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="no_watchdog" value="1"/>{=L:on=} + </td> + </tr> + <tr title="eNX-Watchdog: off/on"> + <td>eNX-Watchdog aktivieren</td> + <td> + <input type="radio" name="no_enxwatchdog" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="no_enxwatchdog" value="1"/>{=L:on=} + </td> + </tr> + <tr title="philips rc patch: off/on"> + <td>Philips/Sagem FB Workaround</td> + <td> + <input type="radio" name="philips_rc_patch" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="philips_rc_patch" value="1"/>{=L:on=} + </td> + </tr> + <tr title="AVIA spts-fix: off/on"> + <td>SPTS-Fix AVIA500</td> + <td> + <input type="radio" name="sptsfix" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="sptsfix" value="1"/>{=L:on=} + </td> + </tr> + <tr title="RTC: off/on"> + <td>Realtime Clock (RTC) aktivieren</td> + <td> + <input type="radio" name="rtc" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="rtc" value="1"/>{=L:on=} + </td> + </tr> + <tr title="PMT Update: off/on"> + <td>PMT Update verwenden</td> + <td> + <input type="radio" name="no_pmt_update" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="no_pmt_update" value="1"/>{=L:on=} </td> </tr> <tr> - <td>Show Bootmenu</td> + <td>EXPERT! Boot-Konsole</td> <td> - <input type="radio" name="bootmenu" value="0" title="Bootmenu: off"/>Off&nbsp; - <input type="radio" name="bootmenu" value="1" title="Bootmenu: on"/>On + <select name="console" title="expert boot-console"> + <option value="null" selected="selected">null</option> + <option value="ttyS0">seriell</option> + <option value="tty">framebuffer</option> + </select> + </td> + </tr> + <tr title="Fullduplex: off/on"> + <td>FullDuplex Mode</td> + <td> + <input type="radio" name="dbox_duplex" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="dbox_duplex" value="1"/>{=L:on=} </td> </tr> <tr> - <td>Show Infos whilst booting</td> - <td> - <input type="radio" name="bootinfo" value="0" title="Bootinfo: off"/>Off&nbsp; - <input type="radio" name="bootinfo" value="1" title="Bootinfo: on"/>On - </td> + <td colspan="2" width="35%" class="y_form_header">Diverses</td> </tr> - <tr> - <td>Use HW-Sections</td> + <tr title="Bootmenu: off/on"> + <td>Bootmen&uuml; anzeigen</td> <td> - <input type="radio" name="hwsections" value="0" title="HW Sections: off"/>Off&nbsp; - <input type="radio" name="hwsections" value="1" title="HW Sections: on"/>On - </td> - </tr> - <tr> - <td>Activate AVIA-Watchdog</td> - <td> - <input type="radio" name="no_watchdog" value="0" title="AVIA-Watchdog: off"/>Off&nbsp; - <input type="radio" name="no_watchdog" value="1" title="AVIA-Watchdog: on"/>On - </td> - </tr> - <tr> - <td>Activate eNX-Watchdog</td> - <td> - <input type="radio" name="no_enxwatchdog" value="0" title="eNX-Watchdog: off"/>Off&nbsp; - <input type="radio" name="no_enxwatchdog" value="1" title="eNX-Watchdog: on"/>On - </td> - </tr> - <tr> - <td>Use PMT Update</td> - <td> - <input type="radio" name="pmt_update" value="0" title="PMT Update: off"/>Off&nbsp; - <input type="radio" name="pmt_update" value="1" title="PMT Update: on"/>On + <input type="radio" name="bootmenu" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="bootmenu" value="1"/>{=L:on=} </td> </tr> </table> @@ -792,55 +1073,33 @@ start-block~neutrino_form-data_bootoptions <input type="hidden" name="tmpl" value="Y_Settings_neutrino_forms.yhtm"/> <input type="hidden" name="execute" value="include-block:Y_neutrino_Blocks.txt;neutrino_bootoptions_save_settings;nix"/> <input type="hidden" name="form" value="{=form=}"/> - <input type="button" value="Save ..." title="submit and save values" onclick="do_submit()"/> + <button type="button" ytype="save" title="{=L:save_values_desc=}s" onclick="do_submit()">{=L:save=}</button> + &nbsp;<button type="button" ytype="refresh" onclick="dbox_reload_neutrino()">reload Neutrino</button> + &nbsp;<a href="javascript:top.top_main.prim_menu.nav('info', 'Y_Info_Help.yhtm');" class="inlink">{=L:help=}</a> </form> </div> </div> <script type="text/javascript"> //<![CDATA[ -function form_init() +function form_init() { - var val = "{=ini-get:/var/tuxbox/config/neutrino.conf;misc_spts~open=}"; - if(val == "true") - document.f.misc_spts[1].checked = true; - else - document.f.misc_spts[0].checked = true; - - var val = "{=if-file-exists:/var/etc/.neutrino~1~0=}"; - if(val == "0") - document.f.bootmenu[1].checked = true; - else - document.f.bootmenu[0].checked = true; - - var val = "{=if-file-exists:/var/etc/.boot_info~1~0=}"; - if(val == "1") - document.f.bootinfo[1].checked = true; - else - document.f.bootinfo[0].checked = true; - - var val = "{=if-file-exists:/var/etc/.hw_sections~1~0=}"; - if(val == "0") - document.f.hwsections[1].checked = true; - else - document.f.hwsections[0].checked = true; - - var val = "{=if-file-exists:/var/etc/.no_watchdog~1~0=}"; - if(val == "0") - document.f.no_watchdog[1].checked = true; - else - document.f.no_watchdog[0].checked = true; - - var val = "{=if-file-exists:/var/etc/.no_enxwatchdog~1~0=}"; - if(val == "0") - document.f.no_enxwatchdog[1].checked = true; - else - document.f.no_enxwatchdog[0].checked = true; - - var val = "{=if-file-exists:/var/etc/.pmt_update~1~0=}"; - if(val == "1") - document.f.pmt_update[1].checked = true; - else - document.f.pmt_update[0].checked = true; + var val = "{=ini-get:/var/tuxbox/boot/boot.conf;console~open=}"; + var sel = 0; + if(val=="ttyS0") sel=1; + if(val=="tty") sel=2; + document.f.console.selectedIndex = sel; + + obj_set_radio_value('dbox_duplex', "{=ini-get:/var/tuxbox/boot/boot.conf;dbox_duplex~cache=}"); + obj_set_radio_value('misc_spts', "{=ini-get:/var/tuxbox/config/neutrino.conf;misc_spts~open=}"); + obj_set_radio_value('bootmenu', "{=if-file-exists:/var/etc/.neutrino~0~1=}"); + obj_set_radio_value('bootinfo', "{=if-file-exists:/var/etc/.boot_info~1~0=}"); + obj_set_radio_value('hwsections', "{=if-file-exists:/var/etc/.hw_sections~0~1=}"); + obj_set_radio_value('no_watchdog', "{=if-file-exists:/var/etc/.no_watchdog~0~1=}"); + obj_set_radio_value('no_enxwatchdog', "{=if-file-exists:/var/etc/.no_enxwatchdog~0~1=}"); + obj_set_radio_value('philips_rc_patch', "{=if-file-exists:/var/etc/.philips_rc_patch~1~0=}"); + obj_set_radio_value('sptsfix', "{=if-file-exists:/var/etc/.sptsfix~1~0=}"); + obj_set_radio_value('rtc', "{=if-file-exists:/var/etc/.rtc~1~0=}"); + obj_set_radio_value('no_pmt_update', "{=if-file-exists:/var/etc/.no_pmt_update~0~1=}"); } function do_submit() @@ -861,60 +1120,67 @@ start-block~neutrino_bootoptions_save_settings {=file-action:/var/etc/.hw_sections;{=if-equal:{=hwsections=}~0~add~delete=}=} {=file-action:/var/etc/.no_watchdog;{=if-equal:{=no_watchdog=}~0~add~delete=}=} {=file-action:/var/etc/.no_enxwatchdog;{=if-equal:{=no_enxwatchdog=}~0~add~delete=}=} -{=file-action:/var/etc/.pmt_update;{=if-equal:{=pmt_update=}~1~add~delete=}=} +{=file-action:/var/etc/.philips_rc_patch;{=if-equal:{=philips_rc_patch=}~1~add~delete=}=} +{=file-action:/var/etc/.sptsfix;{=if-equal:{=sptsfix=}~1~add~delete=}=} +{=file-action:/var/etc/.rtc;{=if-equal:{=rtc=}~1~add~delete=}=} +{=file-action:/var/etc/.no_pmt_update;{=if-equal:{=no_pmt_update=}~0~add~delete=}=} +{=ini-set:/var/tuxbox/boot/boot.conf;console;{=console=}=} +{=ini-set:/var/tuxbox/boot/boot.conf;dbox_duplex;{=dbox_duplex=}=} -{=file-action:/var/etc/.test;add;moin\nduu=} +#{=file-action:/var/etc/.test;add;moin\nduu=} end-block~neutrino_bootoptions_save_settings # ------- Neutrino form-data: pictureviewer ------------------------------- start-block~neutrino_form-data_pictureviewer <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Settings#Bildbetrachter=}{=var-set:menu=Pictureviewer=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Settings-Bildbetrachter=}{=var-set:menu=Bildbetrachter=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <form name="f" action="/y/cgi"> - <table cellspacing="0" border="0" cellpadding="2"> + <table cellspacing="0" border="0" cellpadding="2" width="100%"> <tr> - <td>Scaling</td> + <td width="35%">Skalierung</td> <td> <select name="picviewer_scaling" title="scaling"> - <option value="0" selected="selected">none</option> - <option value="1">simple</option> - <option value="2">complex</option> + <option value="0" selected="selected">keine / none</option> + <option value="1">einfach / simple</option> + <option value="2">aufwendig / complex</option> </select> </td> </tr> <tr> - <td>Slideshow display time</td> - <td><input type="text" name="picviewer_slide_time" size="3" value="{=ini-get:/var/tuxbox/config/neutrino.conf;picviewer_slide_time~open=}" title="view time"/></td> + <td>Diaschau-Anzeigedauer</td> + <td><input type="text" name="picviewer_slide_time" size="2" maxlength="2" value="{=ini-get:/var/tuxbox/config/neutrino.conf;picviewer_slide_time~open=}" title="view time"/></td> </tr> <tr> - <td>Start Directory</td> - <td><input type="text" name="network_nfs_picturedir" size="20" value="{=ini-get:/var/tuxbox/config/neutrino.conf;network_nfs_picturedir~cache=}" title="directory to begin"/></td> + <td>Start-Verz.</td> + <td><input type="text" name="picviewer_picturedir" size="20" value="{=ini-get:/var/tuxbox/config/neutrino.conf;picviewer_picturedir~cache=}" title="directory to begin"/></td> </tr> <tr> <td>Decoding-Server IP</td> - <td><input type="text" name="picviewer_decode_server_ip" size="15" value="{=ini-get:/var/tuxbox/config/neutrino.conf;picviewer_decode_server_ip~cache=}" title="server ip (xxx.xxx.xxx.xxx)"/></td> + <td><input type="text" name="picviewer_decode_server_ip" size="15" maxlength="15" value="{=ini-get:/var/tuxbox/config/neutrino.conf;picviewer_decode_server_ip~cache=}" title="server ip (xxx.xxx.xxx.xxx)"/></td> </tr> <tr> <td>Decoding-Server Port</td> - <td><input type="text" name="picviewer_decode_server_port" size="5" value="{=ini-get:/var/tuxbox/config/neutrino.conf;picviewer_decode_server_port~cache=}" title="port"/></td> + <td><input type="text" name="picviewer_decode_server_port" size="5" maxlength="5" value="{=ini-get:/var/tuxbox/config/neutrino.conf;picviewer_decode_server_port~cache=}" title="port"/></td> </tr> </table> <br/> <input type="hidden" name="tmpl" value="Y_Settings_neutrino_forms.yhtm"/> <input type="hidden" name="execute" value="include-block:Y_neutrino_Blocks.txt;neutrino_pictureviewer_save_settings;nix"/> <input type="hidden" name="form" value="{=form=}"/> - <input type="button" value="Save ..." title="submit and save values" onclick="do_submit()"/> + <button type="button" ytype="save" title="{=L:save_values_desc=}s" onclick="do_submit()">{=L:save=}</button> + &nbsp;<button type="button" ytype="refresh" onclick="dbox_reload_neutrino()">reload Neutrino</button> + &nbsp;<a href="javascript:top.top_main.prim_menu.nav('info', 'Y_Info_Help.yhtm');" class="inlink">{=L:help=}</a> </form> </div> </div> <script type="text/javascript"> //<![CDATA[ -function form_init() +function form_init() { - var val; + var val = ""; val = "{=ini-get:/var/tuxbox/config/neutrino.conf;picviewer_scaling;0=}"; document.f.picviewer_scaling.selectedIndex = val; } @@ -933,7 +1199,7 @@ end-block~neutrino_form-data_pictureviewer start-block~neutrino_pictureviewer_save_settings {=ini-set:/var/tuxbox/config/neutrino.conf;picviewer_scaling;{=picviewer_scaling=}~open=} {=ini-set:/var/tuxbox/config/neutrino.conf;picviewer_slide_time;{=picviewer_slide_time=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;network_nfs_picturedir;{=network_nfs_picturedir=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;picviewer_picturedir;{=picviewer_picturedir=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;picviewer_decode_server_ip;{=picviewer_decode_server_ip=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;picviewer_decode_server_port;{=picviewer_decode_server_port=}~save=} end-block~neutrino_pictureviewer_save_settings @@ -942,67 +1208,67 @@ end-block~neutrino_pictureviewer_save_settings start-block~neutrino_form-data_audioplayer <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Settings#Audioplayer=}{=var-set:menu=Audioplayer=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Settings-Audioplayer=}{=var-set:menu=Audioplayer=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> <form name="f" action="/y/cgi"> - <table cellspacing="0" border="0" cellpadding="2"> + <table cellspacing="0" border="0" cellpadding="2" width="100%"> <tr> - <td>Display order</td> + <td width="35%">Anzeige</td> <td> <select name="audioplayer_display" title="display order"> - <option value="0" selected="selected">Artist, Titel</option> - <option value="1">Titel, Artist</option> + <option value="0" selected="selected">Interpret, Titel</option> + <option value="1">Titel, Interpret</option> </select> </td> </tr> - <tr> - <td>Select actual track</td> + <tr title="select actual track: off/on"> + <td>Selektiere akt. Track</td> <td> - <input type="radio" name="audioplayer_follow" value="0" title="select actual track: off"/>Off&nbsp; - <input type="radio" name="audioplayer_follow" value="1" title="select actual track: on"/>On + <input type="radio" name="audioplayer_follow" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="audioplayer_follow" value="1"/>{=L:on=} + </td> + </tr> + <tr title="search by Name: off/on"> + <td>Titelsuche nach Name</td> + <td> + <input type="radio" name="audioplayer_select_title_by_name" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="audioplayer_select_title_by_name" value="1"/>{=L:on=} + </td> + </tr> + <tr title="Repeatmode: off/on"> + <td>Repeatmodus aktivieren</td> + <td> + <input type="radio" name="audioplayer_repeat_on" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="audioplayer_repeat_on" value="1"/>{=L:on=} + </td> + </tr> + <tr title="Show Playlist: off/on"> + <td>Playlist anzeigen</td> + <td> + <input type="radio" name="audioplayer_show_playlist" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="audioplayer_show_playlist" value="1"/>{=L:on=} </td> </tr> <tr> - <td>Titele search by Name</td> + <td>Bildschirmschoner (min, 0=aus)</td> + <td><input type="text" name="audioplayer_screensaver" size="2" maxlength="2" value="{=ini-get:/var/tuxbox/config/neutrino.conf;audioplayer_screensaver~open=}" title="screen saver"/></td> + </tr> + <tr title="decode at high priority: off/on"> + <td>Hohe Decodier-Priorit&auml;t</td> <td> - <input type="radio" name="audioplayer_select_title_by_name" value="0" title="search by Name: off"/>Off&nbsp; - <input type="radio" name="audioplayer_select_title_by_name" value="1" title="search by Name: on"/>On + <input type="radio" name="audioplayer_highprio" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="audioplayer_highprio" value="1"/>{=L:on=} </td> </tr> <tr> - <td>Activate repeat-mode</td> - <td> - <input type="radio" name="audioplayer_repeat_on" value="0" title="Repeatmode: off"/>Off&nbsp; - <input type="radio" name="audioplayer_repeat_on" value="1" title="Repeatmode: on"/>On - </td> + <td>Start-Verz.</td> + <td><input type="text" name="audioplayer_audioplayerdir" size="20" value="{=ini-get:/var/tuxbox/config/neutrino.conf;audioplayer_audioplayerdir~cache=}" title="directory to begin"/></td> </tr> - <tr> - <td>Show Playlist</td> - <td> - <input type="radio" name="audioplayer_show_playlist" value="0" title="Show Playlist: off"/>Off&nbsp; - <input type="radio" name="audioplayer_show_playlist" value="1" title="Show Playlist: on"/>On - </td> - </tr> - <tr> - <td>Screensaver (min, 0=off)</td> - <td><input type="text" name="audioplayer_screensaver" size="3" value="{=ini-get:/var/tuxbox/config/neutrino.conf;audioplayer_screensaver~open=}" title="screen saver"/></td> - </tr> - <tr> - <td>High Decoding-Priority</td> - <td> - <input type="radio" name="audioplayer_highprio" value="0" title="decode at high priority: off"/>Off&nbsp; - <input type="radio" name="audioplayer_highprio" value="1" title="decode at high priority: on"/>On - </td> - </tr> - <tr> - <td>Start Directory</td> - <td><input type="text" name="network_nfs_audioplayerdir" size="20" value="{=ini-get:/var/tuxbox/config/neutrino.conf;network_nfs_audioplayerdir~cache=}" title="directory to begin"/></td> - </tr> - <tr> + <tr title="parse Shoutcast Meta-Data: off/on"> <td>Shoutcast Meta-Daten</td> <td> - <input type="radio" name="audioplayer_enable_sc_metadata" value="0" title="parse Shoutcast Meta-Data: off"/>Off&nbsp; - <input type="radio" name="audioplayer_enable_sc_metadata" value="1" title="arse Shoutcast Meta-Data: on"/>On + <input type="radio" name="audioplayer_enable_sc_metadata" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="audioplayer_enable_sc_metadata" value="1"/>{=L:on=} </td> </tr> </table> @@ -1010,50 +1276,23 @@ start-block~neutrino_form-data_audioplayer <input type="hidden" name="tmpl" value="Y_Settings_neutrino_forms.yhtm"/> <input type="hidden" name="execute" value="include-block:Y_neutrino_Blocks.txt;neutrino_audioplayer_save_settings;nix"/> <input type="hidden" name="form" value="{=form=}"/> - <input type="button" value="Save ..." title="submit and save values" onclick="do_submit()"/> + <button type="button" ytype="save" title="{=L:save_values_desc=}s" onclick="do_submit()">{=L:save=}</button> + &nbsp;<button type="button" ytype="refresh" onclick="dbox_reload_neutrino()">reload Neutrino</button> + &nbsp;<a href="javascript:top.top_main.prim_menu.nav('info', 'Y_Info_Help.yhtm');" class="inlink">{=L:help=}</a> </form> </div> </div> <script type="text/javascript"> //<![CDATA[ -function form_init() +function form_init() { - var val; - var val = "{=ini-get:/var/tuxbox/config/neutrino.conf;audioplayer_follow~cache=}"; - if(val == "1") - document.f.audioplayer_follow[1].checked = true; - else - document.f.audioplayer_follow[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;audioplayer_select_title_by_name;0~cache=}"; - if(val == "1") - document.f.audioplayer_select_title_by_name[1].checked = true; - else - document.f.audioplayer_select_title_by_name[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;audioplayer_repeat_on;0~cache=}"; - if(val == "1") - document.f.audioplayer_repeat_on[1].checked = true; - else - document.f.audioplayer_repeat_on[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;audioplayer_show_playlist;0~cache=}"; - if(val == "1") - document.f.audioplayer_show_playlist[1].checked = true; - else - document.f.audioplayer_show_playlist[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;audioplayer_highprio;0~cache=}"; - if(val == "1") - document.f.audioplayer_highprio[1].checked = true; - else - document.f.audioplayer_highprio[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;audioplayer_enable_sc_metadata;0~cache=}"; - if(val == "1") - document.f.audioplayer_enable_sc_metadata[1].checked = true; - else - document.f.audioplayer_enable_sc_metadata[0].checked = true; + var val = ""; + obj_set_radio_value('audioplayer_follow', "{=ini-get:/var/tuxbox/config/neutrino.conf;audioplayer_follow;0~cache=}"); + obj_set_radio_value('audioplayer_select_title_by_name', "{=ini-get:/var/tuxbox/config/neutrino.conf;audioplayer_select_title_by_name;0~cache=}"); + obj_set_radio_value('audioplayer_repeat_on', "{=ini-get:/var/tuxbox/config/neutrino.conf;audioplayer_repeat_on;0~cache=}"); + obj_set_radio_value('audioplayer_show_playlist', "{=ini-get:/var/tuxbox/config/neutrino.conf;audioplayer_show_playlist;0~cache=}"); + obj_set_radio_value('audioplayer_highprio', "{=ini-get:/var/tuxbox/config/neutrino.conf;audioplayer_highprio;0~cache=}"); + obj_set_radio_value('audioplayer_enable_sc_metadata', "{=ini-get:/var/tuxbox/config/neutrino.conf;audioplayer_enable_sc_metadata;0~cache=}"); val = "{=ini-get:/var/tuxbox/config/neutrino.conf;audioplayer_display;0~cache=}"; document.f.audioplayer_display.selectedIndex = val; @@ -1078,7 +1317,7 @@ start-block~neutrino_audioplayer_save_settings {=ini-set:/var/tuxbox/config/neutrino.conf;audioplayer_show_playlist;{=audioplayer_show_playlist=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;audioplayer_screensaver;{=audioplayer_screensaver=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;audioplayer_highprio;{=audioplayer_highprio=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;network_nfs_audioplayerdir;{=network_nfs_audioplayerdir=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;audioplayer_audioplayerdir;{=audioplayer_audioplayerdir=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;audioplayer_enable_sc_metadata;{=audioplayer_enable_sc_metadata=}~save=} end-block~neutrino_audioplayer_save_settings @@ -1086,125 +1325,152 @@ end-block~neutrino_audioplayer_save_settings start-block~neutrino_form-data_direct_recording <div class="work_box"> <div class="work_box_head"><div class="work_box_head_h2"> - {=var-set:help_url=Neutrino:yWeb:Settings#Direktaufnahme=}{=var-set:menu=Direkt Recording=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + {=var-set:help_url=Help-Settings-Direktaufnahme=}{=var-set:menu=Direktaufnahme=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> <div class="work_box_body"> - <form name="f" action="/y/cgi"> - <table cellspacing="0" border="0" cellpadding="2"> + <form name="f" class="y_form" action="/y/cgi"> + <table cellspacing="0" border="0" cellpadding="2" width="100%"> <tr> - <td>Recording Directory</td> - <td><input type="text" name="network_nfs_recordingdir" size="16" value="{=ini-get:/var/tuxbox/config/neutrino.conf;network_nfs_recordingdir;/mnt/filme~open=}" title="recording directory"/></td> + <td colspan="2" class="y_form_header">Aufnahmeeinstellungen</td> </tr> <tr> - <td>Max. File size (MB)</td> - <td><input type="text" name="recording_splitsize" size="5" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_splitsize;9999~cache=}" title="Max filesize/splitsize"/></td> + <td width="35%">Max. Dateigr&ouml;&szlig;e (MB)</td> + <td><input type="text" name="recording_splitsize" size="5" maxlength="5" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_splitsize;9999~open=}" title="Max filesize/splitsize"/></td> </tr> <tr> - <td>Max. Ringbuffer</td> - <td><input type="text" name="recordingmenu_ringbuffers" size="5" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recordingmenu.ringbuffers;20~cache=}" title="Max ringbuffers"/></td> - </tr> - <tr> - <td>Sync write (O_SYNC)</td> + <td>Gr&ouml;&szlig;e Ringpuffer</td> <td> - <input type="radio" name="recordingmenu_use_o_sync" value="false" title="Sync write (O_SYNC): off"/>Off&nbsp; - <input type="radio" name="recordingmenu_use_o_sync" value="true" title="Sync write (O_SYNC): on"/>On + <select name="ringbuffers" title="Max ringbuffers"> + <option value="0" selected="selected">512 KB</option> + <option value="1">1 MB</option> + <option value="2">2 MB</option> + <option value="3">4 MB</option> + <option value="4">8 MB</option> + </select> + </td> + </tr> + <tr title="Sync write (O_SYNC): off/on"> + <td>Synchrones Schreiben (O_SYNC)</td> + <td> + <input type="radio" name="recordingmenu_use_o_sync" value="false"/>{=L:off=}&nbsp; + <input type="radio" name="recordingmenu_use_o_sync" value="true"/>{=L:on=} + </td> + </tr> + <tr title="Sync write (fdatasync): off/on"> + <td>Synchrones Schreiben (fdatasync)</td> + <td> + <input type="radio" name="recordingmenu_use_fdatasync" value="false"/>{=L:off=}&nbsp; + <input type="radio" name="recordingmenu_use_fdatasync" value="true"/>{=L:on=} + </td> + </tr> + <tr title="record videotext: off/on"> + <td>Videotext aufzeichnen</td> + <td> + <input type="radio" name="recordingmenu_stream_vtxt_pid" value="false"/>{=L:off=}&nbsp; + <input type="radio" name="recordingmenu_stream_vtxt_pid" value="true"/>{=L:on=} + </td> + </tr> + <tr title="record PMT: off/on"> + <td>Untertitel aufzeichnen</td> + <td> + <input type="radio" name="recordingmenu_stream_subtitle_pid" value="false"/>{=L:off=}&nbsp; + <input type="radio" name="recordingmenu_stream_subtitle_pid" value="true"/>{=L:on=} + </td> + </tr> + <tr title="Choose directory on record: off/on"> + <td>Bei Sofortaufn. Verzeichnisauswahl</td> + <td> + <input type="radio" name="recording_choose_direct_rec_dir" value="0"/>{=L:off=}&nbsp; + <input type="radio" name="recording_choose_direct_rec_dir" value="1"/>{=L:on=} + </td> + </tr> + <tr title="EPG in filename: off/on"> + <td>lange Dateinamen (mit EPG-Daten)</td> + <td> + <input type="radio" name="recording_epg_for_filename" value="false"/>{=L:off=}&nbsp; + <input type="radio" name="recording_epg_for_filename" value="true"/>{=L:on=} </td> </tr> <tr> - <td>Sync write (fdatasync)</td> - <td> - <input type="radio" name="recordingmenu_use_fdatasync" value="false" title="Sync write (fdatasync): off"/>Off&nbsp; - <input type="radio" name="recordingmenu_use_fdatasync" value="true" title="Sync write (fdatasync): on"/>On - </td> - </tr> - <tr> - <td>Record Teletext</td> - <td> - <input type="radio" name="recordingmenu_stream_vtxt_pid" value="false" title="record videotext: off"/>Off&nbsp; - <input type="radio" name="recordingmenu_stream_vtxt_pid" value="true" title="record videotext: on"/>On - </td> - </tr> - <tr> - <td>Record PMT</td> - <td> - <input type="radio" name="recordingmenu_stream_pmt_pid" value="false" title="record PMT: off"/>Off&nbsp; - <input type="radio" name="recordingmenu_stream_pmt_pid" value="true" title="record PMT: on"/>On - </td> - </tr> - <tr> - <td>Directory selection on direct recording</td> - <td> - <input type="radio" name="recording_choose_direct_rec_dir" value="0" title="Choose directory on record: off"/>Off&nbsp; - <input type="radio" name="recording_choose_direct_rec_dir" value="1" title="Choose directory on record: on"/>On - </td> - </tr> - <tr> - <td>Long Filenames (with EPG-Data)</td> - <td> - <input type="radio" name="recording_epg_for_filename" value="false" title="EPG in filename: off"/>Off&nbsp; - <input type="radio" name="recording_epg_for_filename" value="true" title="EPG in filename: on"/>On - </td> - </tr> - <tr> - <td>Recording Filename Template</td> + <td>Vorlage f&uuml;r Dateinamen</td> <td><input type="text" name="recording_filename_template_0" size="16" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_filename_template_0;%C_%I_%d_%t~cache=}" title="filename template %C=channel %T=title %I=info %d=date %t=time"/></td> </tr> <tr> - <td>Directory permission</td> - <td><input type="text" name="recording_dir_permissions_0" size="3" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_permissions_0;755~cache=}" title="directory permissions (UNIX octals)"/></td> + <td>Verzeichnisrechte</td> + <td><input type="text" name="recording_dir_permissions_0" size="3" maxlength="3" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_permissions_0;755~cache=}" title="directory permissions (UNIX octals)"/></td> </tr> - + <tr> + <td colspan="2" class="y_form_header">Aufnahmeverzeichnisse</td> + </tr> + <tr> + <td>Aufnahmeverzeichnis 0</td> + <td><input type="text" name="recording_dir_0" size="40" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_0;~cache=}" title="recording directory"/></td> + </tr> + <tr> + <td>Aufnahmeverzeichnis 1</td> + <td><input type="text" name="recording_dir_1" size="40" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_1;~cache=}" title="recording directory"/></td> + </tr> + <tr> + <td>Aufnahmeverzeichnis 2</td> + <td><input type="text" name="recording_dir_2" size="40" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_2;~cache=}" title="recording directory"/></td> + </tr> + <tr> + <td>Aufnahmeverzeichnis 3</td> + <td><input type="text" name="recording_dir_3" size="40" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_3;~cache=}" title="recording directory"/></td> + </tr> + <tr> + <td>Aufnahmeverzeichnis 4</td> + <td><input type="text" name="recording_dir_4" size="40" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_4;~cache=}" title="recording directory"/></td> + </tr> + <tr> + <td>Aufnahmeverzeichnis 5</td> + <td><input type="text" name="recording_dir_5" size="40" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_5;~cache=}" title="recording directory"/></td> + </tr> + <tr> + <td>Aufnahmeverzeichnis 6</td> + <td><input type="text" name="recording_dir_6" size="40" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_6;~cache=}" title="recording directory"/></td> + </tr> + <tr> + <td>Aufnahmeverzeichnis 7</td> + <td><input type="text" name="recording_dir_7" size="40" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_7;~cache=}" title="recording directory"/></td> + </tr> + <tr> + <td>Aufnahmeverzeichnis 8</td> + <td><input type="text" name="recording_dir_8" size="40" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_8;~cache=}" title="recording directory"/></td> + </tr> + <tr> + <td>Aufnahmeverzeichnis 9</td> + <td><input type="text" name="recording_dir_9" size="40" value="{=ini-get:/var/tuxbox/config/neutrino.conf;recording_dir_9;~cache=}" title="recording directory"/></td> + </tr> + </table> <br/> <input type="hidden" name="tmpl" value="Y_Settings_neutrino_forms.yhtm"/> <input type="hidden" name="execute" value="include-block:Y_neutrino_Blocks.txt;neutrino_direct_recording_save_settings;nix"/> <input type="hidden" name="form" value="{=form=}"/> - <input type="button" value="Save ..." title="submit and save values" onclick="do_submit()"/> + <button type="button" ytype="save" title="{=L:save_values_desc=}s" onclick="do_submit()">{=L:save=}</button> + &nbsp;<button type="button" ytype="refresh" onclick="dbox_reload_neutrino()">reload Neutrino</button> + &nbsp;<a href="javascript:top.top_main.prim_menu.nav('info', 'Y_Info_Help.yhtm');" class="inlink">{=L:help=}</a> </form> </div> </div> <script type="text/javascript"> //<![CDATA[ -function form_init() +function form_init() { - var val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recordingmenu.use_o_sync;0~cache=}"; - if(val == "true") - document.f.recordingmenu_use_o_sync[1].checked = true; - else - document.f.recordingmenu_use_o_sync[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recordingmenu.use_fdatasync;0~cache=}"; - if(val == "true") - document.f.recordingmenu_use_fdatasync[1].checked = true; - else - document.f.recordingmenu_use_fdatasync[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recordingmenu.stream_vtxt_pid;0~cache=}"; - if(val == "true") - document.f.recordingmenu_stream_vtxt_pid[1].checked = true; - else - document.f.recordingmenu_stream_vtxt_pid[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recordingmenu.stream_pmt_pid;0~cache=}"; - if(val == "true") - document.f.recordingmenu_stream_pmt_pid[1].checked = true; - else - document.f.recordingmenu_stream_pmt_pid[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_choose_direct_rec_dir;0~cache=}"; - if(val == "1") - document.f.recording_choose_direct_rec_dir[1].checked = true; - else - document.f.recording_choose_direct_rec_dir[0].checked = true; - - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_epg_for_filename;0~cache=}"; - if(val == "true") - document.f.recording_epg_for_filename[1].checked = true; - else - document.f.recording_epg_for_filename[0].checked = true; + var val = "{=ini-get:/var/tuxbox/config/neutrino.conf;recordingmenu.ringbuffers;2~cache=}"; + document.f.ringbuffers.selectedIndex = val; + + obj_set_radio_value('recordingmenu_use_o_sync', "{=ini-get:/var/tuxbox/config/neutrino.conf;recordingmenu.use_o_sync;0~cache=}"); + obj_set_radio_value('recordingmenu_use_fdatasync', "{=ini-get:/var/tuxbox/config/neutrino.conf;recordingmenu.use_fdatasync;0~cache=}"); + obj_set_radio_value('recordingmenu_stream_subtitle_pid', "{=ini-get:/var/tuxbox/config/neutrino.conf;recordingmenu.stream_subtitle_pid;0~cache=}"); + obj_set_radio_value('recordingmenu_stream_vtxt_pid', "{=ini-get:/var/tuxbox/config/neutrino.conf;recordingmenu.stream_vtxt_pid;0~cache=}"); + obj_set_radio_value('recording_choose_direct_rec_dir', "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_choose_direct_rec_dir;0~cache=}"); + obj_set_radio_value('recording_epg_for_filename', "{=ini-get:/var/tuxbox/config/neutrino.conf;recording_epg_for_filename;0~cache=}"); } function do_submit() { + document.f.recording_filename_template_0.value = encodeURI(document.f.recording_filename_template_0.value); show_waitbox(true); document.f.submit(); } @@ -1215,16 +1481,70 @@ end-block~neutrino_form-data_direct_recording # ------- direct recording save Settings start-block~neutrino_direct_recording_save_settings -{=ini-set:/var/tuxbox/config/neutrino.conf;network_nfs_recordingdir;{=network_nfs_recordingdir=}~open=} -{=ini-set:/var/tuxbox/config/neutrino.conf;recording_splitsize;{=recording_splitsize=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_splitsize;{=recording_splitsize=}~open=} {=ini-set:/var/tuxbox/config/neutrino.conf;recordingmenu.ringbuffers;{=recordingmenu_ringbuffers=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;recordingmenu.use_o_sync;{=recordingmenu_use_o_sync=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;recordingmenu.use_fdatasync;{=recordingmenu_use_fdatasync=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recordingmenu.stream_subtitle_pid;{=recordingmenu_stream_subtitle_pid=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;recordingmenu.stream_vtxt_pid;{=recordingmenu_stream_vtxt_pid=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;recordingmenu.stream_pmt_pid;{=recordingmenu_stream_pmt_pid=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;recording_choose_direct_rec_dir;{=recording_choose_direct_rec_dir=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;recording_epg_for_filename;{=recording_epg_for_filename=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;recording_filename_template_0;{=recording_filename_template_0=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_dir_0;{=recording_dir_0=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_dir_1;{=recording_dir_1=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_dir_2;{=recording_dir_2=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_dir_3;{=recording_dir_3=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_dir_4;{=recording_dir_4=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_dir_5;{=recording_dir_5=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_dir_6;{=recording_dir_6=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_dir_7;{=recording_dir_7=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_dir_8;{=recording_dir_8=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;recording_dir_9;{=recording_dir_9=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;recording_dir_permissions_0;{=recording_dir_permissions_0=}~save=} end-block~neutrino_direct_recording_save_settings +# ------- Neutrino form-data: esound ------------------------------- +start-block~neutrino_form-data_esound +<div class="work_box"> + <div class="work_box_head"><div class="work_box_head_h2"> + {=var-set:help_url=Help-Settings-Esound_Soundserver=}{=var-set:menu=Esound Soundserver=}{=include-block:Y_Blocks.txt;work_menu=}</div></div> + <div class="work_box_body"> + <form name="f" action="/y/cgi"> + <table cellspacing="0" border="0" cellpadding="2" width="100%"> + <tr> + <td width="35%">Esound Port</td> + <td><input type="text" name="esound_port" size="5" maxlength="5" value="{=ini-get:/var/tuxbox/config/neutrino.conf;esound_port~open=}" title="esound port"/>&nbsp;default: 16001</td> + </tr> + </table> + <br/> + <input type="hidden" name="tmpl" value="Y_Settings_neutrino_forms.yhtm"/> + <input type="hidden" name="execute" value="include-block:Y_neutrino_Blocks.txt;neutrino_esound_save_settings;nix"/> + <input type="hidden" name="form" value="{=form=}"/> + <button type="button" ytype="save" title="{=L:save_values_desc=}s" onclick="do_submit()">{=L:save=}</button> + &nbsp;<button type="button" ytype="refresh" onclick="dbox_reload_neutrino()">reload Neutrino</button> + &nbsp;<a href="javascript:top.top_main.prim_menu.nav('info', 'Y_Info_Help.yhtm');" class="inlink">{=L:help=}</a> + </form> + </div> +</div> + +<script type="text/javascript"> +//<![CDATA[ +function form_init() +{ +} + +function do_submit() +{ + show_waitbox(true); + document.f.submit(); +} +form_init(); +//]]> +</script> +end-block~neutrino_form-data_esound + +# ------- yWeb save Settings +start-block~neutrino_esound_save_settings +{=ini-set:/var/tuxbox/config/neutrino.conf;esound_port;{=esound_port=}=} + +end-block~neutrino_esound_save_settings diff --git a/src/nhttpd/web/Y_yweb.js b/src/nhttpd/web/Y_yweb.js new file mode 100644 index 000000000..8230b5166 --- /dev/null +++ b/src/nhttpd/web/Y_yweb.js @@ -0,0 +1,197 @@ +/* yWeb by yjogol + internal organisation of yweb + $Date: 2008/02/24 08:23:12 $ + $Revision: 1.1 $ +*/ + +/* define namespace */ +if(typeof(Y) == "undefined") + Y = {}; +/* Class Y.yweb */ +Y.yweb = new Class.create(); +Object.extend(Y.yweb.prototype, { + ver_file_prop : new Hash(), + yweb_version: $H({major:'0', minor:'0', patch:'0', pre:'0'}), + yweblib_version: $H({major:'1', minor:'0', patch:'0', pre:'0'}), + prototype_version: $H({major:'0', minor:'0', patch:'0', pre:'0'}), + baselib_version: $H({major:'1', minor:'0', patch:'0', pre:'0'}), + + initialize: function(){ + this.ver_file_get() + split_version(this.ver_file_prop.get('version'),this.yweb_version); + split_version(Prototype.Version,this.prototype_version); + if(typeof(baselib_version)!="undefined") + split_version(baselib_version,this.baselib_version); + }, + ver_file_get: function(){ + var v_file=loadSyncURL("/Y_Version.txt"); + var lines=v_file.split("\n"); + lines.each(function(e){ + var x=e.split("="); + if(x.length==2 && (x[0]!="")) + this.ver_file_prop.set(x[0],x[1]); + },this); + }, + _require: function(min_version_str,check_version,is_msg,msg_text){ + var v=$H(); + split_version(min_version_str,v); + if (!version_le(v, check_version)) { + if (typeof(is_msg) != "undefined") alert(msg_text + min_version_str + " required"); + return false; + } + else + return true; + }, + require_prototype:function(min_version_str,is_msg){ + return this._require(min_version_str,this.prototype_version,is_msg,"prototype-library version: "); + }, + require_baselib:function(min_version_str,is_msg){ + return this._require(min_version_str,this.baselib_version,is_msg,"baselib-library version: "); + }, + require_yweblib:function(min_version_str,is_msg){ + return this._require(min_version_str,this.yweblib_version,is_msg,"yweb-library version: "); + }, + require:function(min_version_str,is_msg){ + return this._require(min_version_str,this.yweb_version,is_msg,"yweb version: "); + } +}); + + +/* main instance */ +if (window == top.top_main.prim_menu) { + var yweb = new Y.yweb(); + yweb.require_prototype("1.6"); +} +else + if(top.top_main.prim_menu && top.top_main.prim_menu.yweb) + var yweb = top.top_main.prim_menu.yweb; + else { // should not happen! + var yweb = new Y.yweb(); + yweb.require_prototype("1.6"); + } + +/* n/m= type, menuitem, desc, file, tag, version, url, yweb_version, info_url + * x= type, menuitem, ymenu, file, tag, version, url, yweb_version, info_url + * u=type,site,description,url + */ + + +/* Class Y.extension */ +Y.extension = new Class.create(); +Object.extend(Y.extension.prototype, { + ext_version: 1, /* ver of Y.extention*/ + conf_version: 2,/* ver of local conf file */ + upd_version: 2, /* ver of upd file */ + file: "", + installed_extensions: [], + update_sites: [], + upd_extensions: [], + on_get_updates: null, + get_file: function(){ + this.file = loadSyncURL("/control/exec?Y_Tools&get_extension_list&" + Math.random()); + }, + read_items: function(){ + this.installed_extensions=[]; + this.update_sites=[]; + this.conf_version=2; + this.get_file(); + if(this.file!=""){ + var list = this.file.split("\n"); + list.each(function(line){ + var p=str_to_hash(line) + switch(p.get('type')){ + case "m": case "n": case "p": case "x": case "s": case "o": + this.installed_extensions.push(p); + break; + case "u": + this.update_sites.push(p); + break; + case "v": + this.conf_version=p.get('version'); + break; + } + },this); + } + }, + get_updates: function(){ + this.upd_extensions=[]; + this.upd_version=2; + this.update_sites.each(function(e){ + var update_file = loadSyncURL("/control/exec?Y_Tools&url_get&"+e.get('url')+"&ext_upt.txt&" + Math.random()); + if(this.on_get_updates) this.on_get_updates(e.get('url'), (update_file.search(/wget: cannot/)!=-1) ); + var list = update_file.split("\n"); + list.each(function(line){ + var p=str_to_hash(line); + switch(p.get('type')){ + case "m": case "n": case "p": case "x": case "s": case "o": + p.set('site', e.get('site')); + this.upd_extensions.push(p); + break; + case "v": + this.upd_version=p.get('version'); + break; + } + },this) + },this); + this.upd_extensions = this.upd_extensions.sortBy(function(e){return e.get('tag');}); + }, + build_extension_file: function(){ + var ext="version:"+this.conf_version+"\n"; + for (i = 0; i < this.installed_extensions.length; i++) + ext+=hash_to_str(this.installed_extensions[i])+"\n"; + for(i=0;i<this.update_sites.length;i++) + ext+=hash_to_str(this.update_sites[i])+"\n"; + return ext; + }, + add_extension_to_installed: function(props) { + var allready_installed = false; + for(i=0;i<this.installed_extensions.length;i++){ + if(this.installed_extensions[i].get('tag')==props.get('tag')){ + allready_installed = true; + this.installed_extensions[i]=props; + } + } + if(!allready_installed) + this.installed_extensions.push(props); + }, + install: function(item){ + var res = loadSyncURL("/control/exec?Y_Tools&ext_installer&"+item.get('url')); + if(res.search(/error/)==-1) + this.add_extension_to_installed(item); + return res; + }, + get_item_by_tag:function(tag){ + return this.installed_extensions.find(function(e){ + return e.get('tag')==tag; + },this); + }, + uninstall: function(tag){ + var res = loadSyncURL("/control/exec?Y_Tools&ext_uninstaller&"+tag); + if(res.search(/error/)==-1) + this.installed_extensions = this.installed_extensions.without(this.get_item_by_tag(tag)); + return res; + }, + select_menu: function(menu_name){ + return this.installed_extensions.findAll(function(e){ + return e.get('type')=="x" && e.get('ymenu')==menu_name; + },this); + }, + select_type: function(_type){ + return this.installed_extensions.findAll(function(e){ + return e.get('type')==_type; + },this); + } +}); +/* singleton pattern*/ +if (window == top.top_main.prim_menu) { + var ext = new Y.extension(); + ext.read_items(); +} +else + if(top.top_main.prim_menu && top.top_main.prim_menu.ext) + var ext = top.top_main.prim_menu.ext; + else { // should not happen! + var ext = new Y.extension(); + ext.read_items(); + } + diff --git a/src/nhttpd/web/extentions.txt b/src/nhttpd/web/extentions.txt index 13437862f..1e69863c5 100644 --- a/src/nhttpd/web/extentions.txt +++ b/src/nhttpd/web/extentions.txt @@ -1 +1,2 @@ -u,yjogol,yjogol update site,http://www.yjogol.de/download/Y_extentions.txt +type:u,site:yjogol,desc:yjogol updates,url:http://www.yjogol.com/download/Y_extensions.txt + diff --git a/src/nhttpd/web/images/LICENSE b/src/nhttpd/web/images/LICENSE new file mode 100644 index 000000000..5988e4386 --- /dev/null +++ b/src/nhttpd/web/images/LICENSE @@ -0,0 +1,25 @@ +Same pictures used are form the Tuxbox Community: +Published under GPL v2 +- rc.jpg : Jonny Spitzner <jonnyspitzner@gmx.de> +- rc_sagem.jpg Jonny Spitzner <jonnyspitzner@gmx.de> +- tux.gif : from wiki.tuxbox.org + +From Johannes Golombek yjogol@online.de: +Published under GPL v2 +- y.png +- audiobar.gif +- blank.gif +- body-trans* +- head-blue* +- head-orange* +- head-trans* +- help_white.gif + +From old (before yWeb): +Published under GPL v2 +- elist.gif +- streaminfo.png + +All others are from Mark James (www.famfamfam.com) +Published under Creative Common License 2.5 +(http://creativecommons.org/licenses/by/2.5/) diff --git a/src/nhttpd/web/images/Makefile.am b/src/nhttpd/web/images/Makefile.am index 869777e7a..153032104 100644 --- a/src/nhttpd/web/images/Makefile.am +++ b/src/nhttpd/web/images/Makefile.am @@ -1,24 +1,116 @@ -installdir = $(DATADIR)/neutrino/httpd-y/images +installdir = $(DATADIR)/neutrino/httpd/images -install_DATA = addfolder.gif arrowdown.gif arrowup.gif audiobar.gif \ - blank.gif body-trans-l.gif body-trans-r.gif \ - check_green.gif chmod.gif delete.gif download.gif \ - elist.gif excl_yellow.gif ftype_file.gif ftype_folder.gif ftype_link.gif \ - head-blue-l.gif head-blue-r.gif head-orange-l.gif head-orange-r.gif \ - head-trans-l.gif head-trans-r.gif help.gif help_white.gif \ - hidden.gif home-dir.gif hourglas.gif \ - live.gif live_popup.gif lock.gif \ - new.gif ok.gif properties.gif \ - record.gif reload.gif rename.gif \ +install_DATA = accept.png \ + addfolder.gif \ + alert.gif \ + arrowdown.gif \ + arrowdown.png \ + arrowleft.png \ + arrowright.png \ + arrowup.gif \ + arrowup.png \ + audiobar.gif \ + blank.gif \ + body-trans-l.gif \ + body-trans-r.gif \ + check_green.gif \ + chmod.gif \ + comment.gif \ + comment.png \ + cross.png \ + delete.gif \ + download.gif \ + elist.gif \ + epg.png \ + excl_yellow.gif \ + exlink.gif \ + ext_add.png \ + ext_delete.png \ + ext_edit.png \ + ext_error.png \ + ext_ex.png \ + ext_menu.png \ + ext_mgr.png \ + ext_normal.png \ + ext_plugin.png \ + ext_script.png \ + fb.png \ + flash.png \ + ftype_file.gif \ + ftype_folder.gif \ + ftype_link.gif \ + fullscreen.png \ + head-blue-l.gif \ + head-blue-r.gif \ + head-orange-l.gif \ + head-orange-r.gif \ + head-trans-l.gif \ + head-trans-r.gif \ + help.gif \ + help_white.gif \ + hidden.gif \ + hidden.png \ + home-dir.gif \ + hourglas.gif \ + info.png \ + inlink.gif \ + live.gif \ + livelock.png \ + live.png \ + live_popup.gif \ + live_popup.png \ + liveunlock.png \ + lock.gif \ + lock.png \ + modify.png \ + new.gif \ + new.png \ + ok.gif \ + pause.png \ + play.png \ + popup.png \ + properties.gif \ + properties.png \ + radio.png \ + rcd.jpg \ + rc.gif \ + rc.jpg \ + rc_sagem.jpg \ + record.gif \ + record.png \ + reload.gif \ + remotescreen.gif \ + remove.png \ + rename.gif \ + saveall.png \ + save.png \ smallwait.gif \ - timer.gif tux.gif \ - unlock.gif upload.gif \ - visible.gif vlc.gif \ - wait.gif x_red.gif \ - epg.png fullscreen.png \ - livelock.png live.png live_popup.png liveunlock.png \ - modify.png pause.png play.png remove.png \ - snapshot.png stop.png streaminfo.png \ + snapshot.png \ + stop.png \ + streaminfo.png \ + time_add.png \ + time_down.png \ + timer.gif \ + time_up.png \ transcode.png \ - volumedown.png volumemute.png volumeunmute.png volumeup.png \ - y.png rcd.jpg + tux.gif \ + tux-yweb.gif \ + udp_switch_off.png \ + udp_switch_on.png \ + unlock.gif \ + unlock.png \ + upload.gif \ + visible.gif \ + visible.png \ + vlc.gif \ + volumedown.png \ + volumemute.png \ + volumeunmute.png \ + volumeup.png \ + wait.gif \ + wget.gif \ + x_red.gif \ + yjogol.gif \ + y.png \ + zap.png + \ No newline at end of file diff --git a/src/nhttpd/web/images/accept.png b/src/nhttpd/web/images/accept.png new file mode 100644 index 000000000..89c8129a4 Binary files /dev/null and b/src/nhttpd/web/images/accept.png differ diff --git a/src/nhttpd/web/images/alert.gif b/src/nhttpd/web/images/alert.gif new file mode 100644 index 000000000..429a5d9be Binary files /dev/null and b/src/nhttpd/web/images/alert.gif differ diff --git a/src/nhttpd/web/images/arrowdown.png b/src/nhttpd/web/images/arrowdown.png new file mode 100644 index 000000000..2c4e27937 Binary files /dev/null and b/src/nhttpd/web/images/arrowdown.png differ diff --git a/src/nhttpd/web/images/arrowleft.png b/src/nhttpd/web/images/arrowleft.png new file mode 100644 index 000000000..5dc696781 Binary files /dev/null and b/src/nhttpd/web/images/arrowleft.png differ diff --git a/src/nhttpd/web/images/arrowright.png b/src/nhttpd/web/images/arrowright.png new file mode 100644 index 000000000..b1a181923 Binary files /dev/null and b/src/nhttpd/web/images/arrowright.png differ diff --git a/src/nhttpd/web/images/arrowup.png b/src/nhttpd/web/images/arrowup.png new file mode 100644 index 000000000..1ebb19324 Binary files /dev/null and b/src/nhttpd/web/images/arrowup.png differ diff --git a/src/nhttpd/web/images/body-trans-l.gif b/src/nhttpd/web/images/body-trans-l.gif index 5eb6479cc..20e08cbf4 100644 Binary files a/src/nhttpd/web/images/body-trans-l.gif and b/src/nhttpd/web/images/body-trans-l.gif differ diff --git a/src/nhttpd/web/images/body-trans-r.gif b/src/nhttpd/web/images/body-trans-r.gif index 3de6b14d4..ed091687e 100644 Binary files a/src/nhttpd/web/images/body-trans-r.gif and b/src/nhttpd/web/images/body-trans-r.gif differ diff --git a/src/nhttpd/web/images/comment.gif b/src/nhttpd/web/images/comment.gif new file mode 100644 index 000000000..76db53250 Binary files /dev/null and b/src/nhttpd/web/images/comment.gif differ diff --git a/src/nhttpd/web/images/comment.png b/src/nhttpd/web/images/comment.png new file mode 100644 index 000000000..7bc9233ea Binary files /dev/null and b/src/nhttpd/web/images/comment.png differ diff --git a/src/nhttpd/web/images/cross.png b/src/nhttpd/web/images/cross.png new file mode 100644 index 000000000..1514d51a3 Binary files /dev/null and b/src/nhttpd/web/images/cross.png differ diff --git a/src/nhttpd/web/images/exlink.gif b/src/nhttpd/web/images/exlink.gif new file mode 100644 index 000000000..54f166deb Binary files /dev/null and b/src/nhttpd/web/images/exlink.gif differ diff --git a/src/nhttpd/web/images/ext_add.png b/src/nhttpd/web/images/ext_add.png new file mode 100644 index 000000000..2e945076c Binary files /dev/null and b/src/nhttpd/web/images/ext_add.png differ diff --git a/src/nhttpd/web/images/ext_delete.png b/src/nhttpd/web/images/ext_delete.png new file mode 100644 index 000000000..0a335acf6 Binary files /dev/null and b/src/nhttpd/web/images/ext_delete.png differ diff --git a/src/nhttpd/web/images/ext_edit.png b/src/nhttpd/web/images/ext_edit.png new file mode 100644 index 000000000..fb2efb877 Binary files /dev/null and b/src/nhttpd/web/images/ext_edit.png differ diff --git a/src/nhttpd/web/images/ext_error.png b/src/nhttpd/web/images/ext_error.png new file mode 100644 index 000000000..b35fa5717 Binary files /dev/null and b/src/nhttpd/web/images/ext_error.png differ diff --git a/src/nhttpd/web/images/ext_ex.png b/src/nhttpd/web/images/ext_ex.png new file mode 100644 index 000000000..7e91545c7 Binary files /dev/null and b/src/nhttpd/web/images/ext_ex.png differ diff --git a/src/nhttpd/web/images/ext_menu.png b/src/nhttpd/web/images/ext_menu.png new file mode 100644 index 000000000..efbf3c4f8 Binary files /dev/null and b/src/nhttpd/web/images/ext_menu.png differ diff --git a/src/nhttpd/web/images/ext_mgr.png b/src/nhttpd/web/images/ext_mgr.png new file mode 100644 index 000000000..998d65c69 Binary files /dev/null and b/src/nhttpd/web/images/ext_mgr.png differ diff --git a/src/nhttpd/web/images/ext_normal.png b/src/nhttpd/web/images/ext_normal.png new file mode 100644 index 000000000..1dee9e366 Binary files /dev/null and b/src/nhttpd/web/images/ext_normal.png differ diff --git a/src/nhttpd/web/images/ext_plugin.png b/src/nhttpd/web/images/ext_plugin.png new file mode 100644 index 000000000..851950db7 Binary files /dev/null and b/src/nhttpd/web/images/ext_plugin.png differ diff --git a/src/nhttpd/web/images/ext_script.png b/src/nhttpd/web/images/ext_script.png new file mode 100644 index 000000000..b3d8ce01e Binary files /dev/null and b/src/nhttpd/web/images/ext_script.png differ diff --git a/src/nhttpd/web/images/fb.png b/src/nhttpd/web/images/fb.png new file mode 100644 index 000000000..3bc0bd32f Binary files /dev/null and b/src/nhttpd/web/images/fb.png differ diff --git a/src/nhttpd/web/images/flash.png b/src/nhttpd/web/images/flash.png new file mode 100644 index 000000000..7e91545c7 Binary files /dev/null and b/src/nhttpd/web/images/flash.png differ diff --git a/src/nhttpd/web/images/head-blue-l.gif b/src/nhttpd/web/images/head-blue-l.gif index 08203a4b1..9e763cf03 100644 Binary files a/src/nhttpd/web/images/head-blue-l.gif and b/src/nhttpd/web/images/head-blue-l.gif differ diff --git a/src/nhttpd/web/images/head-blue-r.gif b/src/nhttpd/web/images/head-blue-r.gif index ab01edef7..a998161c8 100644 Binary files a/src/nhttpd/web/images/head-blue-r.gif and b/src/nhttpd/web/images/head-blue-r.gif differ diff --git a/src/nhttpd/web/images/head-orange-l.gif b/src/nhttpd/web/images/head-orange-l.gif index d3c19631e..6adb3fc94 100644 Binary files a/src/nhttpd/web/images/head-orange-l.gif and b/src/nhttpd/web/images/head-orange-l.gif differ diff --git a/src/nhttpd/web/images/head-orange-r.gif b/src/nhttpd/web/images/head-orange-r.gif index a6b0b09e7..a1875e3a2 100644 Binary files a/src/nhttpd/web/images/head-orange-r.gif and b/src/nhttpd/web/images/head-orange-r.gif differ diff --git a/src/nhttpd/web/images/head-trans-l.gif b/src/nhttpd/web/images/head-trans-l.gif index f92828d89..035aa26f0 100644 Binary files a/src/nhttpd/web/images/head-trans-l.gif and b/src/nhttpd/web/images/head-trans-l.gif differ diff --git a/src/nhttpd/web/images/head-trans-r.gif b/src/nhttpd/web/images/head-trans-r.gif index 91da79fcd..7dc2c7828 100644 Binary files a/src/nhttpd/web/images/head-trans-r.gif and b/src/nhttpd/web/images/head-trans-r.gif differ diff --git a/src/nhttpd/web/images/help.gif b/src/nhttpd/web/images/help.gif index 4d1c304ba..9dfa0e196 100644 Binary files a/src/nhttpd/web/images/help.gif and b/src/nhttpd/web/images/help.gif differ diff --git a/src/nhttpd/web/images/hidden.png b/src/nhttpd/web/images/hidden.png new file mode 100644 index 000000000..fc5d6139e Binary files /dev/null and b/src/nhttpd/web/images/hidden.png differ diff --git a/src/nhttpd/web/images/info.png b/src/nhttpd/web/images/info.png new file mode 100644 index 000000000..12cd1aef9 Binary files /dev/null and b/src/nhttpd/web/images/info.png differ diff --git a/src/nhttpd/web/images/inlink.gif b/src/nhttpd/web/images/inlink.gif new file mode 100644 index 000000000..540870514 Binary files /dev/null and b/src/nhttpd/web/images/inlink.gif differ diff --git a/src/nhttpd/web/images/lock.png b/src/nhttpd/web/images/lock.png new file mode 100644 index 000000000..ecb50a93f Binary files /dev/null and b/src/nhttpd/web/images/lock.png differ diff --git a/src/nhttpd/web/images/modify.png b/src/nhttpd/web/images/modify.png index c407bb828..fb2efb877 100644 Binary files a/src/nhttpd/web/images/modify.png and b/src/nhttpd/web/images/modify.png differ diff --git a/src/nhttpd/web/images/new.png b/src/nhttpd/web/images/new.png new file mode 100644 index 000000000..6332fefea Binary files /dev/null and b/src/nhttpd/web/images/new.png differ diff --git a/src/nhttpd/web/images/popup.png b/src/nhttpd/web/images/popup.png new file mode 100644 index 000000000..647592f2e Binary files /dev/null and b/src/nhttpd/web/images/popup.png differ diff --git a/src/nhttpd/web/images/properties.png b/src/nhttpd/web/images/properties.png new file mode 100644 index 000000000..046811ed7 Binary files /dev/null and b/src/nhttpd/web/images/properties.png differ diff --git a/src/nhttpd/web/images/radio.png b/src/nhttpd/web/images/radio.png new file mode 100644 index 000000000..fef6e8bad Binary files /dev/null and b/src/nhttpd/web/images/radio.png differ diff --git a/src/nhttpd/web/images/rc.gif b/src/nhttpd/web/images/rc.gif new file mode 100644 index 000000000..dfa2a1520 Binary files /dev/null and b/src/nhttpd/web/images/rc.gif differ diff --git a/src/nhttpd/web/images/rc.jpg b/src/nhttpd/web/images/rc.jpg new file mode 100644 index 000000000..bd181e7c8 Binary files /dev/null and b/src/nhttpd/web/images/rc.jpg differ diff --git a/src/nhttpd/web/images/rc_sagem.jpg b/src/nhttpd/web/images/rc_sagem.jpg new file mode 100644 index 000000000..9b0c203d7 Binary files /dev/null and b/src/nhttpd/web/images/rc_sagem.jpg differ diff --git a/src/nhttpd/web/images/record.png b/src/nhttpd/web/images/record.png new file mode 100644 index 000000000..0cfd58596 Binary files /dev/null and b/src/nhttpd/web/images/record.png differ diff --git a/src/nhttpd/web/images/reload.gif b/src/nhttpd/web/images/reload.gif index c2c00610e..8268958a1 100644 Binary files a/src/nhttpd/web/images/reload.gif and b/src/nhttpd/web/images/reload.gif differ diff --git a/src/nhttpd/web/images/remotescreen.gif b/src/nhttpd/web/images/remotescreen.gif new file mode 100644 index 000000000..3bc44a7ac Binary files /dev/null and b/src/nhttpd/web/images/remotescreen.gif differ diff --git a/src/nhttpd/web/images/remove.png b/src/nhttpd/web/images/remove.png index 2aedce084..08f249365 100644 Binary files a/src/nhttpd/web/images/remove.png and b/src/nhttpd/web/images/remove.png differ diff --git a/src/nhttpd/web/images/save.png b/src/nhttpd/web/images/save.png new file mode 100644 index 000000000..99d532e8b Binary files /dev/null and b/src/nhttpd/web/images/save.png differ diff --git a/src/nhttpd/web/images/saveall.png b/src/nhttpd/web/images/saveall.png new file mode 100644 index 000000000..fc5a52f5e Binary files /dev/null and b/src/nhttpd/web/images/saveall.png differ diff --git a/src/nhttpd/web/images/snapshot.png b/src/nhttpd/web/images/snapshot.png index f501a593a..8536d1a79 100755 Binary files a/src/nhttpd/web/images/snapshot.png and b/src/nhttpd/web/images/snapshot.png differ diff --git a/src/nhttpd/web/images/time_add.png b/src/nhttpd/web/images/time_add.png new file mode 100644 index 000000000..dcc45cb22 Binary files /dev/null and b/src/nhttpd/web/images/time_add.png differ diff --git a/src/nhttpd/web/images/time_down.png b/src/nhttpd/web/images/time_down.png new file mode 100644 index 000000000..b158203f3 Binary files /dev/null and b/src/nhttpd/web/images/time_down.png differ diff --git a/src/nhttpd/web/images/time_up.png b/src/nhttpd/web/images/time_up.png new file mode 100644 index 000000000..fc6b2af5d Binary files /dev/null and b/src/nhttpd/web/images/time_up.png differ diff --git a/src/nhttpd/web/images/tux-yweb.gif b/src/nhttpd/web/images/tux-yweb.gif new file mode 100644 index 000000000..fa1398fde Binary files /dev/null and b/src/nhttpd/web/images/tux-yweb.gif differ diff --git a/src/nhttpd/web/images/udp_switch_off.png b/src/nhttpd/web/images/udp_switch_off.png new file mode 100644 index 000000000..66217f526 Binary files /dev/null and b/src/nhttpd/web/images/udp_switch_off.png differ diff --git a/src/nhttpd/web/images/udp_switch_on.png b/src/nhttpd/web/images/udp_switch_on.png new file mode 100644 index 000000000..a2c512499 Binary files /dev/null and b/src/nhttpd/web/images/udp_switch_on.png differ diff --git a/src/nhttpd/web/images/unlock.png b/src/nhttpd/web/images/unlock.png new file mode 100644 index 000000000..a7b566b1f Binary files /dev/null and b/src/nhttpd/web/images/unlock.png differ diff --git a/src/nhttpd/web/images/visible.png b/src/nhttpd/web/images/visible.png new file mode 100644 index 000000000..c260e1d96 Binary files /dev/null and b/src/nhttpd/web/images/visible.png differ diff --git a/src/nhttpd/web/images/wget.gif b/src/nhttpd/web/images/wget.gif new file mode 100644 index 000000000..f99a5383b Binary files /dev/null and b/src/nhttpd/web/images/wget.gif differ diff --git a/src/nhttpd/web/images/yjogol.gif b/src/nhttpd/web/images/yjogol.gif new file mode 100644 index 000000000..ec54c9699 Binary files /dev/null and b/src/nhttpd/web/images/yjogol.gif differ diff --git a/src/nhttpd/web/images/zap.png b/src/nhttpd/web/images/zap.png new file mode 100644 index 000000000..d451ee061 Binary files /dev/null and b/src/nhttpd/web/images/zap.png differ diff --git a/src/nhttpd/web/index.html b/src/nhttpd/web/index.html index d819152c5..b6bc74dfa 100644 --- a/src/nhttpd/web/index.html +++ b/src/nhttpd/web/index.html @@ -1,12 +1,13 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "DTD/xhtml1-frameset.dtd"> -<html> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> <head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> -<title>Coolstream HD1 yWeb</title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>yWeb</title> </head> -<frameset cols="*,980,*"> - <frame name="top_left" src="Y_Dyn_Pages.yhtm?page=page_frame_rest" marginwidth="0" marginheight="0" frameborder="0"/> - <frame name="top_main" src="Y_Dyn_Pages.yhtm?page=frame_main" scrolling="no" frameborder="0" style="width:980px;height:100%"/> - <frame name="top_right" src="Y_Dyn_Pages.yhtm?page=page_frame_rest" marginwidth="0" marginheight="0" frameborder="0"/> +<frameset cols="*,980,*" frameborder="0" framespacing="0"> + <frame name="top_left" src="Y_Dyn_Pages.yhtm?page=page_frame_rest" marginwidth="0" marginheight="0" frameborder="0" border="0"/> + <frame name="top_main" src="Y_Dyn_Pages.yhtm?page=frame_main" scrolling="no" frameborder="0" style="width:980px;height:100%" border="0"/> + <frame name="top_right" src="Y_Dyn_Pages.yhtm?page=page_frame_rest" marginwidth="0" marginheight="0" frameborder="0" border="0"/> </frameset> </html> diff --git a/src/nhttpd/web/languages/Deutsch b/src/nhttpd/web/languages/Deutsch new file mode 100644 index 000000000..ca4319d7f --- /dev/null +++ b/src/nhttpd/web/languages/Deutsch @@ -0,0 +1,173 @@ +# Main Menue +boxcontrol=Boxsteuerung +boxcontrol_desc=Boxcontrol & Bouquets +live=Live +live_desc=LiveView, Aufnahmeliste, EPG +tools=Werkzeuge +tools_desc=Mounts, WOL, Experten Werkzeuge, Flashen +settings=Einstellungen +settings_desc=Einstellungen für die Box, Webserver, ... +extensions=Erweiterungen +extensions_desc=Installierte Erweiterungen und Verwaltung +info=Info +info_desc=Information über das yWeb, Version +live_tv_desc=LiveTV +live_tv_popup_desc=LiveTV Popup +remote_full_desc=Fernbedinung & OSD Vollbild +stream_to_vlc_client_desc=Live TV direkt im VLC Client +version=Version + +#========= Boxcontrol Menue +bouquets_desc=Sender auswählen +bouquets=Sender +control_desc=Box Funktionen (Neustart, Aufnahmemodus,...) +control=Steuerung +messages_desc=Nachricht an die Box senden +messages=Nachrichten +remote_desc=Fernbedinung +remote=Fernbedienung +lcd_screenshot_desc=lcd screenshot machen +lcd_screenshot=LCD Screenshot +lcd_screenshot_desc_ni=lcshot nicht installiert in /bin oder /var/bin +osd_screenshot_desc=osd screenshot machen +osd_screenshot=OSD Screenshot +osd_screenshot_desc_ni=fbshot nicht installiert in /bin oder /var/bin +remote_osd_desc=Fernbedienung und On Screen Display +remote_osd=Fernbed. & OSD +remote_osd_desc_ni=dboxshot nicht installiert in /bin oder /var/bin + +decrease_volume=Lautstärke verringern +increase_volume=Lautstärke erhöhen +mute_volume=Lautstärke an / aus +switch_to_tv=Zum TV umschalten +switch_to_radio=Zum Radio umschalten +webinf_slavebox=Webinterface der SlaveBox +volumen_display=Lautstärke Anzeige + +========= BOX Control +freemem=FreeMem +lock=sperren +unlock=freigeben +lcd_unlock=LCD freigeben +standby_mode=Standby Modus +recording_mode=Aufnahmemodus +box=Box +playback=Abspielen +epg_sectiond=EPG Sectiond +spts=SPTS +live_lock=Live sperren +optical_output=Optischer Ausgang +esound_server=ESound Server + +message_to_screen_desc=Nachricht eingeben +message_to_screen=Meldung auf Bildschirm +popup_to_screen=Popup auf Bildschirm +send_message=Nachricht senden +====== EXtension +ext.installer_updater=Installtion +restriced_by_management_ip=Zugriff verwert wg. ManagementIP +====== Bouquet +bouquets_must_be_saved=Alle &Auml;nderungen m&uuml;ssen noch gespeichert werden! +bouquet_editor=Bouquet-Editor +bouquet_add=Bouquet hinzuf&uuml;gen +name_of_bouquet=Name des neuen Bouquets +rename_bouquet=Bouquet umbenennen +========EPG +get_epg=EPG holen ... +epg_plus=EPG Plus +select_bouquet=Bouquet auswählen - Kanäle werden aktualisiert +hover_for_details=F&uuml;r Details: Maus &uuml;ber die entsprechende Sendung bewegen. +========Settings NHTTP +webserver=Webserver +authentication=Authentifikation +client_without_authentication_desc=Rechner ohne Authentifikation. IP des Rechners eingeben. +client_without_authentication=Rechner ohne Authentifikation +active_after_boot=Nach Neustart aktiv +port=Port +threading=Threading +alternate_web_folder=Alternativer Web-Ordner +allowed_file_extensions=Erlaubte Dateiendungen / MIME +allow_all_file_extensions=Alle Dateiendungen erlauben +url_of_logos_desc=URL der Logos eingeben +ips_without_keep_alive_desc=(z.B. JtG Server, Mit Kommas trennen) +ips_without_keep_alive=IPs mit No keep-alive +cache=Cache +cache_info=Cache Informationen +clear_cache=Cache löschen +server_configuration=Server Konfiguration +=========Settings yWeb +enter_ip_desc=IP Adresse eingeben (xxx.xxx.xxx.xxx) +enter_mac_desc=MAC Adresse eingeben (xx:xx:xx:xx:xx:xx) +enter_description_desc=Beschreibung eingeben +management_IPs=Management IPs +wake_on_lan=Wake on Lan +box_tag_desc=Box Name im Top-Menue. +box_tag=Box Bezeichnung +box_color_desc=Farbe der Box Bezeichnung im Top-Menue. z.B. 2188e0 eingeben ohne # +start_page=Startseite +=======Settings general +ucodes=Ucodes +boot_logo=Boot Logo +timer_settings=Timer Einstellungen +zapit=Zapit +backup_restore=Sichern und Wiederherstellen +video_audio=Video/Audio +parental=Jugendschutz +direct_recording=Direktaufnahme +recording=Aufnahme +audio_player=Audioplayer +esound_server=Esound Server +movieplayer=Movieplayer +pictureviewer=Bildbetrachter +lcd_display=LC-Display +key_settings=Tastenbelegung +boot_options=Bootoptionen +peronalization=Personalisierung +plugins=Plugins +=========== GENERAL +user=Benutzer +password=Passwort +language=Sprache +general=Allgemein +logos=Logos +url=URL +server=Server +refreshing=aktualisieren ... +refresh=Aktualisieren +record=aufnehmen +zap=umschalten +lookup=nachschlagen +save_values_desc=senden und speichern der Werte +save_values=Werte werden übernommen ... +administration=Administration +normal=Normal +management=Management +uninstaller=Deinstallation +send=senden +save=speichern +save_all=Alle &Auml;nderungen speichern +cancel=abbrechen +answer=Antwort +reboot=Neustart +shutdown=Ausschalten +status=Status +restart=Neustart +on=An +off=Aus +download=Herunterladen +back=Zur&uuml;ck +date=Datum +from=Von +to=bis +program=Sendung +others=Sonstiges +description=Beschreibung +color=Farbe +tag=Bezeichnung +empty=leer +=========INFO +help=Hilfe +About=Über +check_for_updates=Auf Updates prüfen +your_version=Deine Version +actual_version=Aktuelle Version diff --git a/src/nhttpd/web/languages/English b/src/nhttpd/web/languages/English new file mode 100644 index 000000000..f6f706a31 --- /dev/null +++ b/src/nhttpd/web/languages/English @@ -0,0 +1,177 @@ +# =========Main Menue +boxcontrol=Boxcontrol +boxcontrol_desc=Boxcontrol & Bouquets +live=Live +live_desc=LiveView, Timer Sync &amp; Settings +tools=Tools +tools_desc=Mounts, WOL, Expert Tools +settings=Settings +settings_desc=Settings for Box, Web, Plugins ... +extensions=Extensions +extensions_desc=User Extentions ... +info=Info +info_desc=Information about yWeb, Updates + +live_tv_desc=LiveTV +live_tv_popup_desc=LiveTV popup +remote_full_desc=Remote & OSD full +stream_to_vlc_client_desc=Stream to VLC Client + +version=Version + +#========= Boxcontrol Menue +bouquets_desc=Switch channels +bouquets=Bouquets +control_desc=control box functions (reboot, remote control, SPTS, ...) +control=Control +messages_desc=send Messages to box +messages=Messages +remote_desc=Web-based Remote Control +remote=Remote +lcd_screenshot_desc=make lcd screenshot +lcd_screenshot=LCD Screenshot +lcd_screenshot_desc_ni=lcshot not installed at /bin or /var/bin +osd_screenshot_desc=make osd screenshot +osd_screenshot=OSD Screenshot +osd_screenshot_desc_ni=fbshot not installed at /bin or /var/bin +remote_osd_desc=remote and osd +remote_osd=Remote & OSD +remote_osd_desc_ni=dboxshot not installed at /bin or /var/bin + +decrease_volume=decrease volumen +increase_volume=increase volumen +mute_volume=mute volumen +switch_to_tv=switch to TV +switch_to_radio=switch to Radio +webinf_slavebox=Webinterface der SlaveBox +volumen_display=volumen display + +========= BOX Control +freemem=FreeMem +lock=lock +unlock=unlock +lcd_unlock=LCD unlock +standby_mode=standby mode +recording_mode=recording mode +box=box +playback=playback +epg_sectiond=EPG Sectiond +spts=SPTS +live_lock=live lock +optical_output=optical output +esound_server=ESound Server + +message_to_screen_desc=enter message to send to TV screen +message_to_screen=Message on screen +popup_to_screen=Message as popup +send_message=send message +====== EXtension +ext.installer_updater=Installer/Updater +restriced_by_management_ip=restricted by ManagementIP +====== Bouquet +bouquets_must_be_saved=All bouquets must be saved! +bouquet_editor=Bouquet-Editor +bouquet_add=add bouquet +name_of_bouquet=Name of bouquets +rename_bouquet=rename bouquet +========EPG +get_epg=get EPG ... +epg_plus=EPG Plus +select_bouquet=select bouquet - channels will be updated +hover_for_details=move to program for more details +========Settings NHTTP +webserver=Webserver +authentication=Authentication +client_without_authentication_desc=Client with no authentication check. Enter IP. +client_without_authentication=Client without Authentication +active_after_boot=active after boot +port=Port +threading=Threading +alternate_web_folder=Alternate Web-Folder +allowed_file_extensions=Allowed File Extensions / MIME +allow_all_file_extensions=Allow all File Extensions +url_of_logos_desc=Enter URL of Logos +ips_without_keep_alive_desc=(e.g. JtG Server, separate with commas) +ips_without_keep_alive=IPs with No keep-alive +cache=Cache +cache_info=Cache info +clear_cache=clear cache +server_configuration=Server Configuration +=========Settings yWeb +enter_ip_desc=enter IP (xxx.xxx.xxx.xxx) +enter_mac_desc=enter MAC Adress (xx:xx:xx:xx:xx:xx) +enter_description_desc=enter description +management_IPs=Management IPs +wake_on_lan=Wake on Lan +box_tag_desc=Box Name in Top-Menue. +box_tag=Box Tag +box_color_desc=Box Name color in Top-Menue. e.g. enter 2188e0 without # +start_page=Start page +=======Settings general +ucodes=Ucodes +boot_logo=Boot Logo +timer_settings=Timer Settings +zapit=Zapit +backup_restore=Backup &amp; Restore +video_audio=Video/Audio +parental=Parental +direct_recording=Direct Recording +recording=Recording +audio_player=Audioplayer +esound_server=Esound Server +movieplayer=Movieplayer +pictureviewer=Picture Viewer +lcd_display=LC-Display +key_settings=Key Layout +boot_options=Boot options +peronalization=Personalization +plugins=Plugins +=========== GENERAL +user=User +password=Password +language=Language +general=General +logos=Logos +url=URL +server=Server +refreshing=refreshing ... +refresh=refresh +record=record +zap=zap +lookup=lookup +save_values_desc=submit and save values +save_values=Save values ... +save=save +save_all=save all +administration=Administration +normal=Normal +management=Management +uninstaller=Uninstaller +send=send +cancel=cancel +answer=Answer +reboot=reboot +shutdown=shutdown +status=status +restart=restart +on=on +off=off +download=Download +back=back +date=date +from=from +to=to +program=program +others=others +description=description +color=Color +tag=Tag +empty=empty +========== +#Info +help=Help +About=About +check_for_updates=Check for Updates +your_version=Your Version +actual_version=Actual Version + diff --git a/src/nhttpd/web/languages/Makefile.am b/src/nhttpd/web/languages/Makefile.am new file mode 100644 index 000000000..a08f43d03 --- /dev/null +++ b/src/nhttpd/web/languages/Makefile.am @@ -0,0 +1,4 @@ +installdir = $(DATADIR)/neutrino/httpd/languages + +install_DATA = Deutsch English + diff --git a/src/nhttpd/web/prototype.js b/src/nhttpd/web/prototype.js new file mode 100644 index 000000000..e87fff2e2 --- /dev/null +++ b/src/nhttpd/web/prototype.js @@ -0,0 +1 @@ +var Prototype={Version:"1.6.0",Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div").__proto__&&document.createElement("div").__proto__!==document.createElement("form").__proto__},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(A){return A;}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false;}if(Prototype.Browser.WebKit){Prototype.BrowserFeatures.XPath=false;}var Class={create:function(){var E=null,D=$A(arguments);if(Object.isFunction(D[0])){E=D.shift();}function A(){this.initialize.apply(this,arguments);}Object.extend(A,Class.Methods);A.superclass=E;A.subclasses=[];if(E){var B=function(){};B.prototype=E.prototype;A.prototype=new B;E.subclasses.push(A);}for(var C=0;C<D.length;C++){A.addMethods(D[C]);}if(!A.prototype.initialize){A.prototype.initialize=Prototype.emptyFunction;}A.prototype.constructor=A;return A;}};Class.Methods={addMethods:function(G){var C=this.superclass&&this.superclass.prototype;var B=Object.keys(G);if(!Object.keys({toString:true}).length){B.push("toString","valueOf");}for(var A=0,D=B.length;A<D;A++){var F=B[A],E=G[F];if(C&&Object.isFunction(E)&&E.argumentNames().first()=="$super"){var H=E,E=Object.extend((function(I){return function(){return C[I].apply(this,arguments);};})(F).wrap(H),{valueOf:function(){return H;},toString:function(){return H.toString();}});}this.prototype[F]=E;}return this;}};var Abstract={};Object.extend=function(A,C){for(var B in C){A[B]=C[B];}return A;};Object.extend(Object,{inspect:function(A){try{if(A===undefined){return"undefined";}if(A===null){return"null";}return A.inspect?A.inspect():A.toString();}catch(B){if(B instanceof RangeError){return"...";}throw B;}},toJSON:function(A){var C=typeof A;switch(C){case"undefined":case"function":case"unknown":return ;case"boolean":return A.toString();}if(A===null){return"null";}if(A.toJSON){return A.toJSON();}if(Object.isElement(A)){return ;}var B=[];for(var E in A){var D=Object.toJSON(A[E]);if(D!==undefined){B.push(E.toJSON()+": "+D);}}return"{"+B.join(", ")+"}";},toQueryString:function(A){return $H(A).toQueryString();},toHTML:function(A){return A&&A.toHTML?A.toHTML():String.interpret(A);},keys:function(A){var B=[];for(var C in A){B.push(C);}return B;},values:function(B){var A=[];for(var C in B){A.push(B[C]);}return A;},clone:function(A){return Object.extend({},A);},isElement:function(A){return A&&A.nodeType==1;},isArray:function(A){return A&&A.constructor===Array;},isHash:function(A){return A instanceof Hash;},isFunction:function(A){return typeof A=="function";},isString:function(A){return typeof A=="string";},isNumber:function(A){return typeof A=="number";},isUndefined:function(A){return typeof A=="undefined";}});Object.extend(Function.prototype,{argumentNames:function(){var A=this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");return A.length==1&&!A[0]?[]:A;},bind:function(){if(arguments.length<2&&arguments[0]===undefined){return this;}var A=this,C=$A(arguments),B=C.shift();return function(){return A.apply(B,C.concat($A(arguments)));};},bindAsEventListener:function(){var A=this,C=$A(arguments),B=C.shift();return function(D){return A.apply(B,[D||window.event].concat(C));};},curry:function(){if(!arguments.length){return this;}var A=this,B=$A(arguments);return function(){return A.apply(this,B.concat($A(arguments)));};},delay:function(){var A=this,B=$A(arguments),C=B.shift()*1000;return window.setTimeout(function(){return A.apply(A,B);},C);},wrap:function(B){var A=this;return function(){return B.apply(this,[A.bind(this)].concat($A(arguments)));};},methodize:function(){if(this._methodized){return this._methodized;}var A=this;return this._methodized=function(){return A.apply(null,[this].concat($A(arguments)));};}});Function.prototype.defer=Function.prototype.delay.curry(0.01);Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"';};var Try={these:function(){var C;for(var B=0,D=arguments.length;B<D;B++){var A=arguments[B];try{C=A();break;}catch(E){}}return C;}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(A){return String(A).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1");};var PeriodicalExecuter=Class.create({initialize:function(B,A){this.callback=B;this.frequency=A;this.currentlyExecuting=false;this.registerCallback();},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},execute:function(){this.callback(this);},stop:function(){if(!this.timer){return ;}clearInterval(this.timer);this.timer=null;},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute();}finally{this.currentlyExecuting=false;}}}});Object.extend(String,{interpret:function(A){return A==null?"":String(A);},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,{gsub:function(E,C){var A="",D=this,B;C=arguments.callee.prepareReplacement(C);while(D.length>0){if(B=D.match(E)){A+=D.slice(0,B.index);A+=String.interpret(C(B));D=D.slice(B.index+B[0].length);}else{A+=D,D="";}}return A;},sub:function(C,A,B){A=this.gsub.prepareReplacement(A);B=B===undefined?1:B;return this.gsub(C,function(D){if(--B<0){return D[0];}return A(D);});},scan:function(B,A){this.gsub(B,A);return String(this);},truncate:function(B,A){B=B||30;A=A===undefined?"...":A;return this.length>B?this.slice(0,B-A.length)+A:String(this);},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"");},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"");},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");},extractScripts:function(){var B=new RegExp(Prototype.ScriptFragment,"img");var A=new RegExp(Prototype.ScriptFragment,"im");return(this.match(B)||[]).map(function(C){return(C.match(A)||["",""])[1];});},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script);});},escapeHTML:function(){var A=arguments.callee;A.text.data=this;return A.div.innerHTML;},unescapeHTML:function(){var A=new Element("div");A.innerHTML=this.stripTags();return A.childNodes[0]?(A.childNodes.length>1?$A(A.childNodes).inject("",function(B,C){return B+C.nodeValue;}):A.childNodes[0].nodeValue):"";},toQueryParams:function(B){var A=this.strip().match(/([^?#]*)(#.*)?$/);if(!A){return{};}return A[1].split(B||"&").inject({},function(E,F){if((F=F.split("="))[0]){var C=decodeURIComponent(F.shift());var D=F.length>1?F.join("="):F[0];if(D!=undefined){D=decodeURIComponent(D);}if(C in E){if(!Object.isArray(E[C])){E[C]=[E[C]];}E[C].push(D);}else{E[C]=D;}}return E;});},toArray:function(){return this.split("");},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1);},times:function(A){return A<1?"":new Array(A+1).join(this);},camelize:function(){var D=this.split("-"),A=D.length;if(A==1){return D[0];}var C=this.charAt(0)=="-"?D[0].charAt(0).toUpperCase()+D[0].substring(1):D[0];for(var B=1;B<A;B++){C+=D[B].charAt(0).toUpperCase()+D[B].substring(1);}return C;},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase();},dasherize:function(){return this.gsub(/_/,"-");},inspect:function(B){var A=this.gsub(/[\x00-\x1f\\]/,function(C){var D=String.specialChar[C[0]];return D?D:"\\u00"+C[0].charCodeAt().toPaddedString(2,16);});if(B){return'"'+A.replace(/"/g,'\\"')+'"';}return"'"+A.replace(/'/g,"\\'")+"'";},toJSON:function(){return this.inspect(true);},unfilterJSON:function(A){return this.sub(A||Prototype.JSONFilter,"#{1}");},isJSON:function(){var A=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(A);},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")");}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect());},include:function(A){return this.indexOf(A)>-1;},startsWith:function(A){return this.indexOf(A)===0;},endsWith:function(A){var B=this.length-A.length;return B>=0&&this.lastIndexOf(A)===B;},empty:function(){return this=="";},blank:function(){return/^\s*$/.test(this);},interpolate:function(A,B){return new Template(this,B).evaluate(A);}});if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");},unescapeHTML:function(){return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">");}});}String.prototype.gsub.prepareReplacement=function(B){if(Object.isFunction(B)){return B;}var A=new Template(B);return function(C){return A.evaluate(C);};};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});with(String.prototype.escapeHTML){div.appendChild(text);}var Template=Class.create({initialize:function(A,B){this.template=A.toString();this.pattern=B||Template.Pattern;},evaluate:function(A){if(Object.isFunction(A.toTemplateReplacements)){A=A.toTemplateReplacements();}return this.template.gsub(this.pattern,function(D){if(A==null){return"";}var F=D[1]||"";if(F=="\\"){return D[2];}var B=A,G=D[3];var E=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/,D=E.exec(G);if(D==null){return F;}while(D!=null){var C=D[1].startsWith("[")?D[2].gsub("\\\\]","]"):D[1];B=B[C];if(null==B||""==D[3]){break;}G=G.substring("["==D[3]?D[1].length:D[0].length);D=E.exec(G);}return F+String.interpret(B);}.bind(this));}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(C,B){var A=0;C=C.bind(B);try{this._each(function(E){C(E,A++);});}catch(D){if(D!=$break){throw D;}}return this;},eachSlice:function(D,C,B){C=C?C.bind(B):Prototype.K;var A=-D,E=[],F=this.toArray();while((A+=D)<F.length){E.push(F.slice(A,A+D));}return E.collect(C,B);},all:function(C,B){C=C?C.bind(B):Prototype.K;var A=true;this.each(function(E,D){A=A&&!!C(E,D);if(!A){throw $break;}});return A;},any:function(C,B){C=C?C.bind(B):Prototype.K;var A=false;this.each(function(E,D){if(A=!!C(E,D)){throw $break;}});return A;},collect:function(C,B){C=C?C.bind(B):Prototype.K;var A=[];this.each(function(E,D){A.push(C(E,D));});return A;},detect:function(C,B){C=C.bind(B);var A;this.each(function(E,D){if(C(E,D)){A=E;throw $break;}});return A;},findAll:function(C,B){C=C.bind(B);var A=[];this.each(function(E,D){if(C(E,D)){A.push(E);}});return A;},grep:function(D,C,B){C=C?C.bind(B):Prototype.K;var A=[];if(Object.isString(D)){D=new RegExp(D);}this.each(function(F,E){if(D.match(F)){A.push(C(F,E));}});return A;},include:function(A){if(Object.isFunction(this.indexOf)){if(this.indexOf(A)!=-1){return true;}}var B=false;this.each(function(C){if(C==A){B=true;throw $break;}});return B;},inGroupsOf:function(B,A){A=A===undefined?null:A;return this.eachSlice(B,function(C){while(C.length<B){C.push(A);}return C;});},inject:function(A,C,B){C=C.bind(B);this.each(function(E,D){A=C(A,E,D);});return A;},invoke:function(B){var A=$A(arguments).slice(1);return this.map(function(C){return C[B].apply(C,A);});},max:function(C,B){C=C?C.bind(B):Prototype.K;var A;this.each(function(E,D){E=C(E,D);if(A==undefined||E>=A){A=E;}});return A;},min:function(C,B){C=C?C.bind(B):Prototype.K;var A;this.each(function(E,D){E=C(E,D);if(A==undefined||E<A){A=E;}});return A;},partition:function(D,B){D=D?D.bind(B):Prototype.K;var C=[],A=[];this.each(function(F,E){(D(F,E)?C:A).push(F);});return[C,A];},pluck:function(B){var A=[];this.each(function(C){A.push(C[B]);});return A;},reject:function(C,B){C=C.bind(B);var A=[];this.each(function(E,D){if(!C(E,D)){A.push(E);}});return A;},sortBy:function(B,A){B=B.bind(A);return this.map(function(D,C){return{value:D,criteria:B(D,C)};}).sort(function(F,E){var D=F.criteria,C=E.criteria;return D<C?-1:D>C?1:0;}).pluck("value");},toArray:function(){return this.map();},zip:function(){var B=Prototype.K,A=$A(arguments);if(Object.isFunction(A.last())){B=A.pop();}var C=[this].concat(A).map($A);return this.map(function(E,D){return B(C.pluck(D));});},size:function(){return this.toArray().length;},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">";}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(C){if(!C){return[];}if(C.toArray){return C.toArray();}var B=C.length,A=new Array(B);while(B--){A[B]=C[B];}return A;}if(Prototype.Browser.WebKit){function $A(C){if(!C){return[];}if(!(Object.isFunction(C)&&C=="[object NodeList]")&&C.toArray){return C.toArray();}var B=C.length,A=new Array(B);while(B--){A[B]=C[B];}return A;}}Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse;}Object.extend(Array.prototype,{_each:function(B){for(var A=0,C=this.length;A<C;A++){B(this[A]);}},clear:function(){this.length=0;return this;},first:function(){return this[0];},last:function(){return this[this.length-1];},compact:function(){return this.select(function(A){return A!=null;});},flatten:function(){return this.inject([],function(B,A){return B.concat(Object.isArray(A)?A.flatten():[A]);});},without:function(){var A=$A(arguments);return this.select(function(B){return !A.include(B);});},reverse:function(A){return(A!==false?this:this.toArray())._reverse();},reduce:function(){return this.length>1?this:this[0];},uniq:function(A){return this.inject([],function(D,C,B){if(0==B||(A?D.last()!=C:!D.include(C))){D.push(C);}return D;});},intersect:function(A){return this.uniq().findAll(function(B){return A.detect(function(C){return B===C;});});},clone:function(){return[].concat(this);},size:function(){return this.length;},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]";},toJSON:function(){var A=[];this.each(function(B){var C=Object.toJSON(B);if(C!==undefined){A.push(C);}});return"["+A.join(", ")+"]";}});if(Object.isFunction(Array.prototype.forEach)){Array.prototype._each=Array.prototype.forEach;}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(C,A){A||(A=0);var B=this.length;if(A<0){A=B+A;}for(;A<B;A++){if(this[A]===C){return A;}}return -1;};}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(B,A){A=isNaN(A)?this.length:(A<0?this.length+A:A)+1;var C=this.slice(0,A).reverse().indexOf(B);return(C<0)?C:A-C-1;};}Array.prototype.toArray=Array.prototype.clone;function $w(A){if(!Object.isString(A)){return[];}A=A.strip();return A?A.split(/\s+/):[];}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var E=[];for(var B=0,C=this.length;B<C;B++){E.push(this[B]);}for(var B=0,C=arguments.length;B<C;B++){if(Object.isArray(arguments[B])){for(var A=0,D=arguments[B].length;A<D;A++){E.push(arguments[B][A]);}}else{E.push(arguments[B]);}}return E;};}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16);},succ:function(){return this+1;},times:function(A){$R(0,this,true).each(A);return this;},toPaddedString:function(C,B){var A=this.toString(B||10);return"0".times(C-A.length)+A;},toJSON:function(){return isFinite(this)?this.toString():"null";}});$w("abs round ceil floor").each(function(A){Number.prototype[A]=Math[A].methodize();});function $H(A){return new Hash(A);}var Hash=Class.create(Enumerable,(function(){if(function(){var C=0,E=function(F){this.key=F;};E.prototype.key="foo";for(var D in new E("bar")){C++;}return C>1;}()){function B(E){var C=[];for(var D in this._object){var F=this._object[D];if(C.include(D)){continue;}C.push(D);var G=[D,F];G.key=D;G.value=F;E(G);}}}else{function B(D){for(var C in this._object){var E=this._object[C],F=[C,E];F.key=C;F.value=E;D(F);}}}function A(C,D){if(Object.isUndefined(D)){return C;}return C+"="+encodeURIComponent(String.interpret(D));}return{initialize:function(C){this._object=Object.isHash(C)?C.toObject():Object.clone(C);},_each:B,set:function(C,D){return this._object[C]=D;},get:function(C){return this._object[C];},unset:function(C){var D=this._object[C];delete this._object[C];return D;},toObject:function(){return Object.clone(this._object);},keys:function(){return this.pluck("key");},values:function(){return this.pluck("value");},index:function(D){var C=this.detect(function(E){return E.value===D;});return C&&C.key;},merge:function(C){return this.clone().update(C);},update:function(C){return new Hash(C).inject(this,function(D,E){D.set(E.key,E.value);return D;});},toQueryString:function(){return this.map(function(E){var D=encodeURIComponent(E.key),C=E.value;if(C&&typeof C=="object"){if(Object.isArray(C)){return C.map(A.curry(D)).join("&");}}return A(D,C);}).join("&");},inspect:function(){return"#<Hash:{"+this.map(function(C){return C.map(Object.inspect).join(": ");}).join(", ")+"}>";},toJSON:function(){return Object.toJSON(this.toObject());},clone:function(){return new Hash(this);}};})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(C,A,B){this.start=C;this.end=A;this.exclusive=B;},_each:function(A){var B=this.start;while(this.include(B)){A(B);B=B.succ();}},include:function(A){if(A<this.start){return false;}if(this.exclusive){return A<this.end;}return A<=this.end;}});var $R=function(C,A,B){return new ObjectRange(C,A,B);};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest();},function(){return new ActiveXObject("Msxml2.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");})||false;},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(A){this.responders._each(A);},register:function(A){if(!this.include(A)){this.responders.push(A);}},unregister:function(A){this.responders=this.responders.without(A);},dispatch:function(D,B,C,A){this.each(function(E){if(Object.isFunction(E[D])){try{E[D].apply(E,[B,C,A]);}catch(F){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++;},onComplete:function(){Ajax.activeRequestCount--;}});Ajax.Base=Class.create({initialize:function(A){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,A||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams();}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,B,A){$super(A);this.transport=Ajax.getTransport();this.request(B);},request:function(B){this.url=B;this.method=this.options.method;var D=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){D["_method"]=this.method;this.method="post";}this.parameters=D;if(D=Object.toQueryString(D)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+D;}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){D+="&_=";}}}try{var A=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(A);}Ajax.Responders.dispatch("onCreate",this,A);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1);}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||D):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange();}}catch(C){this.dispatchException(C);}},onStateChange:function(){var A=this.transport.readyState;if(A>1&&!((A==4)&&this._complete)){this.respondToReadyState(this.transport.readyState);}},setRequestHeaders:function(){var E={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){E["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){E["Connection"]="close";}}if(typeof this.options.requestHeaders=="object"){var C=this.options.requestHeaders;if(Object.isFunction(C.push)){for(var B=0,D=C.length;B<D;B+=2){E[C[B]]=C[B+1];}}else{$H(C).each(function(F){E[F.key]=F.value;});}}for(var A in E){this.transport.setRequestHeader(A,E[A]);}},success:function(){var A=this.getStatus();return !A||(A>=200&&A<300);},getStatus:function(){try{return this.transport.status||0;}catch(A){return 0;}},respondToReadyState:function(A){var C=Ajax.Request.Events[A],B=new Ajax.Response(this);if(C=="Complete"){try{this._complete=true;(this.options["on"+B.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(B,B.headerJSON);}catch(D){this.dispatchException(D);}var E=B.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&E&&E.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse();}}try{(this.options["on"+C]||Prototype.emptyFunction)(B,B.headerJSON);Ajax.Responders.dispatch("on"+C,this,B,B.headerJSON);}catch(D){this.dispatchException(D);}if(C=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction;}},getHeader:function(A){try{return this.transport.getResponseHeader(A);}catch(B){return null;}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON());}catch(e){this.dispatchException(e);}},dispatchException:function(A){(this.options.onException||Prototype.emptyFunction)(this,A);Ajax.Responders.dispatch("onException",this,A);}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(C){this.request=C;var D=this.transport=C.transport,A=this.readyState=D.readyState;if((A>2&&!Prototype.Browser.IE)||A==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(D.responseText);this.headerJSON=this._getHeaderJSON();}if(A==4){var B=D.responseXML;this.responseXML=B===undefined?null:B;this.responseJSON=this._getResponseJSON();}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||"";}catch(A){return"";}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders();}catch(A){return null;}},getResponseHeader:function(A){return this.transport.getResponseHeader(A);},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders();},_getHeaderJSON:function(){var A=this.getHeader("X-JSON");if(!A){return null;}A=decodeURIComponent(escape(A));try{return A.evalJSON(this.request.options.sanitizeJSON);}catch(B){this.request.dispatchException(B);}},_getResponseJSON:function(){var A=this.request.options;if(!A.evalJSON||(A.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))){return null;}try{return this.transport.responseText.evalJSON(A.sanitizeJSON);}catch(B){this.request.dispatchException(B);}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,A,C,B){this.container={success:(A.success||A),failure:(A.failure||(A.success?null:A))};B=B||{};var D=B.onComplete;B.onComplete=(function(E,F){this.updateContent(E.responseText);if(Object.isFunction(D)){D(E,F);}}).bind(this);$super(C,B);},updateContent:function(D){var C=this.container[this.success()?"success":"failure"],A=this.options;if(!A.evalScripts){D=D.stripScripts();}if(C=$(C)){if(A.insertion){if(Object.isString(A.insertion)){var B={};B[A.insertion]=D;C.insert(B);}else{A.insertion(C,D);}}else{C.update(D);}}if(this.success()){if(this.onComplete){this.onComplete.bind(this).defer();}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,A,C,B){$super(B);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=A;this.url=C;this.start();},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent();},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments);},updateComplete:function(A){if(this.options.decay){this.decay=(A.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=A.responseText;}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency);},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options);}});function $(B){if(arguments.length>1){for(var A=0,D=[],C=arguments.length;A<C;A++){D.push($(arguments[A]));}return D;}if(Object.isString(B)){B=document.getElementById(B);}return Element.extend(B);}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(F,A){var C=[];var E=document.evaluate(F,$(A)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var B=0,D=E.snapshotLength;B<D;B++){C.push(Element.extend(E.snapshotItem(B)));}return C;};}if(!window.Node){var Node={};}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12});}(function(){var A=this.Element;this.Element=function(D,C){C=C||{};D=D.toLowerCase();var B=Element.cache;if(Prototype.Browser.IE&&C.name){D="<"+D+' name="'+C.name+'">';delete C.name;return Element.writeAttribute(document.createElement(D),C);}if(!B[D]){B[D]=Element.extend(document.createElement(D));}return Element.writeAttribute(B[D].cloneNode(false),C);};Object.extend(this.Element,A||{});}).call(window);Element.cache={};Element.Methods={visible:function(A){return $(A).style.display!="none";},toggle:function(A){A=$(A);Element[Element.visible(A)?"hide":"show"](A);return A;},hide:function(A){$(A).style.display="none";return A;},show:function(A){$(A).style.display="";return A;},remove:function(A){A=$(A);A.parentNode.removeChild(A);return A;},update:function(A,B){A=$(A);if(B&&B.toElement){B=B.toElement();}if(Object.isElement(B)){return A.update().insert(B);}B=Object.toHTML(B);A.innerHTML=B.stripScripts();B.evalScripts.bind(B).defer();return A;},replace:function(B,C){B=$(B);if(C&&C.toElement){C=C.toElement();}else{if(!Object.isElement(C)){C=Object.toHTML(C);var A=B.ownerDocument.createRange();A.selectNode(B);C.evalScripts.bind(C).defer();C=A.createContextualFragment(C.stripScripts());}}B.parentNode.replaceChild(C,B);return B;},insert:function(C,E){C=$(C);if(Object.isString(E)||Object.isNumber(E)||Object.isElement(E)||(E&&(E.toElement||E.toHTML))){E={bottom:E};}var D,B,A;for(position in E){D=E[position];position=position.toLowerCase();B=Element._insertionTranslations[position];if(D&&D.toElement){D=D.toElement();}if(Object.isElement(D)){B.insert(C,D);continue;}D=Object.toHTML(D);A=C.ownerDocument.createRange();B.initializeRange(C,A);B.insert(C,A.createContextualFragment(D.stripScripts()));D.evalScripts.bind(D).defer();}return C;},wrap:function(B,C,A){B=$(B);if(Object.isElement(C)){$(C).writeAttribute(A||{});}else{if(Object.isString(C)){C=new Element(C,A);}else{C=new Element("div",C);}}if(B.parentNode){B.parentNode.replaceChild(C,B);}C.appendChild(B);return C;},inspect:function(B){B=$(B);var A="<"+B.tagName.toLowerCase();$H({"id":"id","className":"class"}).each(function(F){var E=F.first(),C=F.last();var D=(B[E]||"").toString();if(D){A+=" "+C+"="+D.inspect(true);}});return A+">";},recursivelyCollect:function(A,C){A=$(A);var B=[];while(A=A[C]){if(A.nodeType==1){B.push(Element.extend(A));}}return B;},ancestors:function(A){return $(A).recursivelyCollect("parentNode");},descendants:function(A){return $A($(A).getElementsByTagName("*")).each(Element.extend);},firstDescendant:function(A){A=$(A).firstChild;while(A&&A.nodeType!=1){A=A.nextSibling;}return $(A);},immediateDescendants:function(A){if(!(A=$(A).firstChild)){return[];}while(A&&A.nodeType!=1){A=A.nextSibling;}if(A){return[A].concat($(A).nextSiblings());}return[];},previousSiblings:function(A){return $(A).recursivelyCollect("previousSibling");},nextSiblings:function(A){return $(A).recursivelyCollect("nextSibling");},siblings:function(A){A=$(A);return A.previousSiblings().reverse().concat(A.nextSiblings());},match:function(B,A){if(Object.isString(A)){A=new Selector(A);}return A.match($(B));},up:function(B,D,A){B=$(B);if(arguments.length==1){return $(B.parentNode);}var C=B.ancestors();return D?Selector.findElement(C,D,A):C[A||0];},down:function(B,C,A){B=$(B);if(arguments.length==1){return B.firstDescendant();}var D=B.descendants();return C?Selector.findElement(D,C,A):D[A||0];},previous:function(B,D,A){B=$(B);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(B));}var C=B.previousSiblings();return D?Selector.findElement(C,D,A):C[A||0];},next:function(C,D,B){C=$(C);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(C));}var A=C.nextSiblings();return D?Selector.findElement(A,D,B):A[B||0];},select:function(){var A=$A(arguments),B=$(A.shift());return Selector.findChildElements(B,A);},adjacent:function(){var A=$A(arguments),B=$(A.shift());return Selector.findChildElements(B.parentNode,A).without(B);},identify:function(B){B=$(B);var C=B.readAttribute("id"),A=arguments.callee;if(C){return C;}do{C="anonymous_element_"+A.counter++;}while($(C));B.writeAttribute("id",C);return C;},readAttribute:function(C,A){C=$(C);if(Prototype.Browser.IE){var B=Element._attributeTranslations.read;if(B.values[A]){return B.values[A](C,A);}if(B.names[A]){A=B.names[A];}if(A.include(":")){return(!C.attributes||!C.attributes[A])?null:C.attributes[A].value;}}return C.getAttribute(A);},writeAttribute:function(E,C,F){E=$(E);var B={},D=Element._attributeTranslations.write;if(typeof C=="object"){B=C;}else{B[C]=F===undefined?true:F;}for(var A in B){var C=D.names[A]||A,F=B[A];if(D.values[A]){C=D.values[A](E,F);}if(F===false||F===null){E.removeAttribute(C);}else{if(F===true){E.setAttribute(C,C);}else{E.setAttribute(C,F);}}}return E;},getHeight:function(A){return $(A).getDimensions().height;},getWidth:function(A){return $(A).getDimensions().width;},classNames:function(A){return new Element.ClassNames(A);},hasClassName:function(A,B){if(!(A=$(A))){return ;}var C=A.className;return(C.length>0&&(C==B||new RegExp("(^|\\s)"+B+"(\\s|$)").test(C)));},addClassName:function(A,B){if(!(A=$(A))){return ;}if(!A.hasClassName(B)){A.className+=(A.className?" ":"")+B;}return A;},removeClassName:function(A,B){if(!(A=$(A))){return ;}A.className=A.className.replace(new RegExp("(^|\\s+)"+B+"(\\s+|$)")," ").strip();return A;},toggleClassName:function(A,B){if(!(A=$(A))){return ;}return A[A.hasClassName(B)?"removeClassName":"addClassName"](B);},cleanWhitespace:function(B){B=$(B);var C=B.firstChild;while(C){var A=C.nextSibling;if(C.nodeType==3&&!/\S/.test(C.nodeValue)){B.removeChild(C);}C=A;}return B;},empty:function(A){return $(A).innerHTML.blank();},descendantOf:function(D,C){D=$(D),C=$(C);if(D.compareDocumentPosition){return(D.compareDocumentPosition(C)&8)===8;}if(D.sourceIndex&&!Prototype.Browser.Opera){var E=D.sourceIndex,B=C.sourceIndex,A=C.nextSibling;if(!A){do{C=C.parentNode;}while(!(A=C.nextSibling)&&C.parentNode);}if(A){return(E>B&&E<A.sourceIndex);}}while(D=D.parentNode){if(D==C){return true;}}return false;},scrollTo:function(A){A=$(A);var B=A.cumulativeOffset();window.scrollTo(B[0],B[1]);return A;},getStyle:function(B,C){B=$(B);C=C=="float"?"cssFloat":C.camelize();var D=B.style[C];if(!D){var A=document.defaultView.getComputedStyle(B,null);D=A?A[C]:null;}if(C=="opacity"){return D?parseFloat(D):1;}return D=="auto"?null:D;},getOpacity:function(A){return $(A).getStyle("opacity");},setStyle:function(B,C){B=$(B);var E=B.style,A;if(Object.isString(C)){B.style.cssText+=";"+C;return C.include("opacity")?B.setOpacity(C.match(/opacity:\s*(\d?\.?\d*)/)[1]):B;}for(var D in C){if(D=="opacity"){B.setOpacity(C[D]);}else{E[(D=="float"||D=="cssFloat")?(E.styleFloat===undefined?"cssFloat":"styleFloat"):D]=C[D];}}return B;},setOpacity:function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;return A;},getDimensions:function(C){C=$(C);var G=$(C).getStyle("display");if(G!="none"&&G!=null){return{width:C.offsetWidth,height:C.offsetHeight};}var B=C.style;var F=B.visibility;var D=B.position;var A=B.display;B.visibility="hidden";B.position="absolute";B.display="block";var H=C.clientWidth;var E=C.clientHeight;B.display=A;B.position=D;B.visibility=F;return{width:H,height:E};},makePositioned:function(A){A=$(A);var B=Element.getStyle(A,"position");if(B=="static"||!B){A._madePositioned=true;A.style.position="relative";if(window.opera){A.style.top=0;A.style.left=0;}}return A;},undoPositioned:function(A){A=$(A);if(A._madePositioned){A._madePositioned=undefined;A.style.position=A.style.top=A.style.left=A.style.bottom=A.style.right="";}return A;},makeClipping:function(A){A=$(A);if(A._overflow){return A;}A._overflow=Element.getStyle(A,"overflow")||"auto";if(A._overflow!=="hidden"){A.style.overflow="hidden";}return A;},undoClipping:function(A){A=$(A);if(!A._overflow){return A;}A.style.overflow=A._overflow=="auto"?"":A._overflow;A._overflow=null;return A;},cumulativeOffset:function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;B=B.offsetParent;}while(B);return Element._returnOffset(C,A);},positionedOffset:function(B){var A=0,D=0;do{A+=B.offsetTop||0;D+=B.offsetLeft||0;B=B.offsetParent;if(B){if(B.tagName=="BODY"){break;}var C=Element.getStyle(B,"position");if(C=="relative"||C=="absolute"){break;}}}while(B);return Element._returnOffset(D,A);},absolutize:function(B){B=$(B);if(B.getStyle("position")=="absolute"){return ;}var D=B.positionedOffset();var F=D[1];var E=D[0];var C=B.clientWidth;var A=B.clientHeight;B._originalLeft=E-parseFloat(B.style.left||0);B._originalTop=F-parseFloat(B.style.top||0);B._originalWidth=B.style.width;B._originalHeight=B.style.height;B.style.position="absolute";B.style.top=F+"px";B.style.left=E+"px";B.style.width=C+"px";B.style.height=A+"px";return B;},relativize:function(A){A=$(A);if(A.getStyle("position")=="relative"){return ;}A.style.position="relative";var C=parseFloat(A.style.top||0)-(A._originalTop||0);var B=parseFloat(A.style.left||0)-(A._originalLeft||0);A.style.top=C+"px";A.style.left=B+"px";A.style.height=A._originalHeight;A.style.width=A._originalWidth;return A;},cumulativeScrollOffset:function(B){var A=0,C=0;do{A+=B.scrollTop||0;C+=B.scrollLeft||0;B=B.parentNode;}while(B);return Element._returnOffset(C,A);},getOffsetParent:function(A){if(A.offsetParent){return $(A.offsetParent);}if(A==document.body){return $(A);}while((A=A.parentNode)&&A!=document.body){if(Element.getStyle(A,"position")!="static"){return $(A);}}return $(document.body);},viewportOffset:function(D){var A=0,C=0;var B=D;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;if(B.offsetParent==document.body&&Element.getStyle(B,"position")=="absolute"){break;}}while(B=B.offsetParent);B=D;do{if(!Prototype.Browser.Opera||B.tagName=="BODY"){A-=B.scrollTop||0;C-=B.scrollLeft||0;}}while(B=B.parentNode);return Element._returnOffset(C,A);},clonePosition:function(B,D){var A=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});D=$(D);var E=D.viewportOffset();B=$(B);var F=[0,0];var C=null;if(Element.getStyle(B,"position")=="absolute"){C=B.getOffsetParent();F=C.viewportOffset();}if(C==document.body){F[0]-=document.body.offsetLeft;F[1]-=document.body.offsetTop;}if(A.setLeft){B.style.left=(E[0]-F[0]+A.offsetLeft)+"px";}if(A.setTop){B.style.top=(E[1]-F[1]+A.offsetTop)+"px";}if(A.setWidth){B.style.width=D.offsetWidth+"px";}if(A.setHeight){B.style.height=D.offsetHeight+"px";}return B;}};Element.Methods.identify.counter=1;Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(!document.createRange||Prototype.Browser.Opera){Element.Methods.insert=function(E,G){E=$(E);if(Object.isString(G)||Object.isNumber(G)||Object.isElement(G)||(G&&(G.toElement||G.toHTML))){G={bottom:G};}var D=Element._insertionTranslations,F,B,H,C;for(B in G){F=G[B];B=B.toLowerCase();H=D[B];if(F&&F.toElement){F=F.toElement();}if(Object.isElement(F)){H.insert(E,F);continue;}F=Object.toHTML(F);C=((B=="before"||B=="after")?E.parentNode:E).tagName.toUpperCase();if(D.tags[C]){var A=Element._getContentFromAnonymousElement(C,F.stripScripts());if(B=="top"||B=="after"){A.reverse();}A.each(H.insert.curry(E));}else{E.insertAdjacentHTML(H.adjacency,F.stripScripts());}F.evalScripts.bind(F).defer();}return E;};}if(Prototype.Browser.Opera){Element.Methods._getStyle=Element.Methods.getStyle;Element.Methods.getStyle=function(A,B){switch(B){case"left":case"top":case"right":case"bottom":if(Element._getStyle(A,"position")=="static"){return null;}default:return Element._getStyle(A,B);}};Element.Methods._readAttribute=Element.Methods.readAttribute;Element.Methods.readAttribute=function(A,B){if(B=="title"){return A.title;}return Element._readAttribute(A,B);};}else{if(Prototype.Browser.IE){$w("positionedOffset getOffsetParent viewportOffset").each(function(A){Element.Methods[A]=Element.Methods[A].wrap(function(D,C){C=$(C);var B=C.getStyle("position");if(B!="static"){return D(C);}C.setStyle({position:"relative"});var E=D(C);C.setStyle({position:B});return E;});});Element.Methods.getStyle=function(A,B){A=$(A);B=(B=="float"||B=="cssFloat")?"styleFloat":B.camelize();var C=A.style[B];if(!C&&A.currentStyle){C=A.currentStyle[B];}if(B=="opacity"){if(C=(A.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(C[1]){return parseFloat(C[1])/100;}}return 1;}if(C=="auto"){if((B=="width"||B=="height")&&(A.getStyle("display")!="none")){return A["offset"+B.capitalize()]+"px";}return null;}return C;};Element.Methods.setOpacity=function(B,E){function F(G){return G.replace(/alpha\([^\)]*\)/gi,"");}B=$(B);var A=B.currentStyle;if((A&&!A.hasLayout)||(!A&&B.style.zoom=="normal")){B.style.zoom=1;}var D=B.getStyle("filter"),C=B.style;if(E==1||E===""){(D=F(D))?C.filter=D:C.removeAttribute("filter");return B;}else{if(E<0.00001){E=0;}}C.filter=F(D)+"alpha(opacity="+(E*100)+")";return B;};Element._attributeTranslations={read:{names:{"class":"className","for":"htmlFor"},values:{_getAttr:function(A,B){return A.getAttribute(B,2);},_getAttrNode:function(A,C){var B=A.getAttributeNode(C);return B?B.value:"";},_getEv:function(A,B){var B=A.getAttribute(B);return B?B.toString().slice(23,-2):null;},_flag:function(A,B){return $(A).hasAttribute(B)?B:null;},style:function(A){return A.style.cssText.toLowerCase();},title:function(A){return A.title;}}}};Element._attributeTranslations.write={names:Object.clone(Element._attributeTranslations.read.names),values:{checked:function(A,B){A.checked=!!B;},style:function(A,B){A.style.cssText=B?B:"";}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc").each(function(A){Element._attributeTranslations.write.names[A.toLowerCase()]=A;Element._attributeTranslations.has[A.toLowerCase()]=A;});(function(A){Object.extend(A,{href:A._getAttr,src:A._getAttr,type:A._getAttr,action:A._getAttrNode,disabled:A._flag,checked:A._flag,readonly:A._flag,multiple:A._flag,onload:A._getEv,onunload:A._getEv,onclick:A._getEv,ondblclick:A._getEv,onmousedown:A._getEv,onmouseup:A._getEv,onmouseover:A._getEv,onmousemove:A._getEv,onmouseout:A._getEv,onfocus:A._getEv,onblur:A._getEv,onkeypress:A._getEv,onkeydown:A._getEv,onkeyup:A._getEv,onsubmit:A._getEv,onreset:A._getEv,onselect:A._getEv,onchange:A._getEv});})(Element._attributeTranslations.read.values);}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1)?0.999999:(B==="")?"":(B<0.00001)?0:B;return A;};}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;if(B==1){if(A.tagName=="IMG"&&A.width){A.width++;A.width--;}else{try{var D=document.createTextNode(" ");A.appendChild(D);A.removeChild(D);}catch(C){}}}return A;};Element.Methods.cumulativeOffset=function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;if(B.offsetParent==document.body){if(Element.getStyle(B,"position")=="absolute"){break;}}B=B.offsetParent;}while(B);return Element._returnOffset(C,A);};}}}}if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(B,C){B=$(B);if(C&&C.toElement){C=C.toElement();}if(Object.isElement(C)){return B.update().insert(C);}C=Object.toHTML(C);var A=B.tagName.toUpperCase();if(A in Element._insertionTranslations.tags){$A(B.childNodes).each(function(D){B.removeChild(D);});Element._getContentFromAnonymousElement(A,C.stripScripts()).each(function(D){B.appendChild(D);});}else{B.innerHTML=C.stripScripts();}C.evalScripts.bind(C).defer();return B;};}if(document.createElement("div").outerHTML){Element.Methods.replace=function(C,E){C=$(C);if(E&&E.toElement){E=E.toElement();}if(Object.isElement(E)){C.parentNode.replaceChild(E,C);return C;}E=Object.toHTML(E);var D=C.parentNode,B=D.tagName.toUpperCase();if(Element._insertionTranslations.tags[B]){var F=C.next();var A=Element._getContentFromAnonymousElement(B,E.stripScripts());D.removeChild(C);if(F){A.each(function(G){D.insertBefore(G,F);});}else{A.each(function(G){D.appendChild(G);});}}else{C.outerHTML=E.stripScripts();}E.evalScripts.bind(E).defer();return C;};}Element._returnOffset=function(B,C){var A=[B,C];A.left=B;A.top=C;return A;};Element._getContentFromAnonymousElement=function(C,B){var D=new Element("div"),A=Element._insertionTranslations.tags[C];D.innerHTML=A[0]+B+A[1];A[2].times(function(){D=D.firstChild;});return $A(D.childNodes);};Element._insertionTranslations={before:{adjacency:"beforeBegin",insert:function(A,B){A.parentNode.insertBefore(B,A);},initializeRange:function(B,A){A.setStartBefore(B);}},top:{adjacency:"afterBegin",insert:function(A,B){A.insertBefore(B,A.firstChild);},initializeRange:function(B,A){A.selectNodeContents(B);A.collapse(true);}},bottom:{adjacency:"beforeEnd",insert:function(A,B){A.appendChild(B);}},after:{adjacency:"afterEnd",insert:function(A,B){A.parentNode.insertBefore(B,A.nextSibling);},initializeRange:function(B,A){A.setStartAfter(B);}},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){this.bottom.initializeRange=this.top.initializeRange;Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD});}).call(Element._insertionTranslations);Element.Methods.Simulated={hasAttribute:function(A,C){C=Element._attributeTranslations.has[C]||C;var B=$(A).getAttributeNode(C);return B&&B.specified;}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div").__proto__){window.HTMLElement={};window.HTMLElement.prototype=document.createElement("div").__proto__;Prototype.BrowserFeatures.ElementExtensions=true;}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions){return Prototype.K;}var A={},B=Element.Methods.ByTag;var C=Object.extend(function(F){if(!F||F._extendedByPrototype||F.nodeType!=1||F==window){return F;}var D=Object.clone(A),E=F.tagName,H,G;if(B[E]){Object.extend(D,B[E]);}for(H in D){G=D[H];if(Object.isFunction(G)&&!(H in F)){F[H]=G.methodize();}}F._extendedByPrototype=Prototype.emptyFunction;return F;},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(A,Element.Methods);Object.extend(A,Element.Methods.Simulated);}}});C.refresh();return C;})();Element.hasAttribute=function(A,B){if(A.hasAttribute){return A.hasAttribute(B);}return Element.Methods.Simulated.hasAttribute(A,B);};Element.addMethods=function(C){var I=Prototype.BrowserFeatures,D=Element.Methods.ByTag;if(!C){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{"FORM":Object.clone(Form.Methods),"INPUT":Object.clone(Form.Element.Methods),"SELECT":Object.clone(Form.Element.Methods),"TEXTAREA":Object.clone(Form.Element.Methods)});}if(arguments.length==2){var B=C;C=arguments[1];}if(!B){Object.extend(Element.Methods,C||{});}else{if(Object.isArray(B)){B.each(H);}else{H(B);}}function H(F){F=F.toUpperCase();if(!Element.Methods.ByTag[F]){Element.Methods.ByTag[F]={};}Object.extend(Element.Methods.ByTag[F],C);}function A(L,K,F){F=F||false;for(var N in L){var M=L[N];if(!Object.isFunction(M)){continue;}if(!F||!(N in K)){K[N]=M.methodize();}}}function E(L){var F;var K={"OPTGROUP":"OptGroup","TEXTAREA":"TextArea","P":"Paragraph","FIELDSET":"FieldSet","UL":"UList","OL":"OList","DL":"DList","DIR":"Directory","H1":"Heading","H2":"Heading","H3":"Heading","H4":"Heading","H5":"Heading","H6":"Heading","Q":"Quote","INS":"Mod","DEL":"Mod","A":"Anchor","IMG":"Image","CAPTION":"TableCaption","COL":"TableCol","COLGROUP":"TableCol","THEAD":"TableSection","TFOOT":"TableSection","TBODY":"TableSection","TR":"TableRow","TH":"TableCell","TD":"TableCell","FRAMESET":"FrameSet","IFRAME":"IFrame"};if(K[L]){F="HTML"+K[L]+"Element";}if(window[F]){return window[F];}F="HTML"+L+"Element";if(window[F]){return window[F];}F="HTML"+L.capitalize()+"Element";if(window[F]){return window[F];}window[F]={};window[F].prototype=document.createElement(L).__proto__;return window[F];}if(I.ElementExtensions){A(Element.Methods,HTMLElement.prototype);A(Element.Methods.Simulated,HTMLElement.prototype,true);}if(I.SpecificElementExtensions){for(var J in Element.Methods.ByTag){var G=E(J);if(Object.isUndefined(G)){continue;}A(D[J],G.prototype);}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh();}Element.cache={};};document.viewport={getDimensions:function(){var A={};$w("width height").each(function(C){var B=C.capitalize();A[C]=self["inner"+B]||(document.documentElement["client"+B]||document.body["client"+B]);});return A;},getWidth:function(){return this.getDimensions().width;},getHeight:function(){return this.getDimensions().height;},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop);}};var Selector=Class.create({initialize:function(A){this.expression=A.strip();this.compileMatcher();},compileMatcher:function(){if(Prototype.BrowserFeatures.XPath&&!(/(\[[\w-]*?:|:checked)/).test(this.expression)){return this.compileXPathMatcher();}var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return ;}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],"");break;}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher;},compileXPathMatcher:function(){var E=this.expression,F=Selector.patterns,B=Selector.xpath,D,A;if(Selector._cache[E]){this.xpath=Selector._cache[E];return ;}this.matcher=[".//*"];while(E&&D!=E&&(/\S/).test(E)){D=E;for(var C in F){if(A=E.match(F[C])){this.matcher.push(Object.isFunction(B[C])?B[C](A):new Template(B[C]).evaluate(A));E=E.replace(A[0],"");break;}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath;},findElements:function(A){A=A||document;if(this.xpath){return document._getElementsByXPath(this.xpath,A);}return this.matcher(A);},match:function(H){this.tokens=[];var L=this.expression,A=Selector.patterns,E=Selector.assertions;var B,D,F;while(L&&B!==L&&(/\S/).test(L)){B=L;for(var I in A){D=A[I];if(F=L.match(D)){if(E[I]){this.tokens.push([I,Object.clone(F)]);L=L.replace(F[0],"");}else{return this.findElements(document).include(H);}}}}var K=true,C,J;for(var I=0,G;G=this.tokens[I];I++){C=G[0],J=G[1];if(!Selector.assertions[C](H,J)){K=false;break;}}return K;},toString:function(){return this.expression;},inspect:function(){return"#<Selector:"+this.expression.inspect()+">";}});Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(A){if(A[1]=="*"){return"";}return"[local-name()='"+A[1].toLowerCase()+"' or local-name()='"+A[1].toUpperCase()+"']";},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:"[@#{1}]",attr:function(A){A[3]=A[5]||A[6];return new Template(Selector.xpath.operators[A[2]]).evaluate(A);},pseudo:function(A){var B=Selector.xpath.pseudos[A[1]];if(!B){return"";}if(Object.isFunction(B)){return B(A);}return new Template(Selector.xpath.pseudos[A[1]]).evaluate(A);},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]","empty":"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]","checked":"[@checked]","disabled":"[@disabled]","enabled":"[not(@disabled)]","not":function(B){var H=B[6],G=Selector.patterns,A=Selector.xpath,E,B,C;var F=[];while(H&&E!=H&&(/\S/).test(H)){E=H;for(var D in G){if(B=H.match(G[D])){C=Object.isFunction(A[D])?A[D](B):new Template(A[D]).evaluate(B);F.push("("+C.substring(1,C.length-1)+")");H=H.replace(B[0],"");break;}}}return"[not("+F.join(" and ")+")]";},"nth-child":function(A){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",A);},"nth-last-child":function(A){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",A);},"nth-of-type":function(A){return Selector.xpath.pseudos.nth("position() ",A);},"nth-last-of-type":function(A){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",A);},"first-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-of-type"](A);},"last-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](A);},"only-of-type":function(A){var B=Selector.xpath.pseudos;return B["first-of-type"](A)+B["last-of-type"](A);},nth:function(E,C){var F,G=C[6],B;if(G=="even"){G="2n+0";}if(G=="odd"){G="2n+1";}if(F=G.match(/^(\d+)$/)){return"["+E+"= "+F[1]+"]";}if(F=G.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(F[1]=="-"){F[1]=-1;}var D=F[1]?Number(F[1]):1;var A=F[2]?Number(F[2]):0;B="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(B).evaluate({fragment:E,a:D,b:A});}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c); c = false;',className:'n = h.className(n, r, "#{1}", c); c = false;',id:'n = h.id(n, r, "#{1}", c); c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}"); c = false;',attr:function(A){A[3]=(A[5]||A[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(A);},pseudo:function(A){if(A[6]){A[6]=A[6].replace(/"/g,'\\"');}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(A);},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s)|(?=:))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(A,B){return B[1].toUpperCase()==A.tagName.toUpperCase();},className:function(A,B){return Element.hasClassName(A,B[1]);},id:function(A,B){return A.id===B[1];},attrPresence:function(A,B){return Element.hasAttribute(A,B[1]);},attr:function(B,C){var A=Element.readAttribute(B,C[1]);return Selector.operators[C[2]](A,C[3]);}},handlers:{concat:function(B,A){for(var C=0,D;D=A[C];C++){B.push(D);}return B;},mark:function(A){for(var B=0,C;C=A[B];B++){C._counted=true;}return A;},unmark:function(A){for(var B=0,C;C=A[B];B++){C._counted=undefined;}return A;},index:function(A,D,G){A._counted=true;if(D){for(var B=A.childNodes,E=B.length-1,C=1;E>=0;E--){var F=B[E];if(F.nodeType==1&&(!G||F._counted)){F.nodeIndex=C++;}}}else{for(var E=0,C=1,B=A.childNodes;F=B[E];E++){if(F.nodeType==1&&(!G||F._counted)){F.nodeIndex=C++;}}}},unique:function(B){if(B.length==0){return B;}var D=[],E;for(var C=0,A=B.length;C<A;C++){if(!(E=B[C])._counted){E._counted=true;D.push(Element.extend(E));}}return Selector.handlers.unmark(D);},descendant:function(A){var D=Selector.handlers;for(var C=0,B=[],E;E=A[C];C++){D.concat(B,E.getElementsByTagName("*"));}return B;},child:function(A){var F=Selector.handlers;for(var E=0,D=[],G;G=A[E];E++){for(var B=0,C=[],H;H=G.childNodes[B];B++){if(H.nodeType==1&&H.tagName!="!"){D.push(H);}}}return D;},adjacent:function(A){for(var C=0,B=[],E;E=A[C];C++){var D=this.nextElementSibling(E);if(D){B.push(D);}}return B;},laterSibling:function(A){var D=Selector.handlers;for(var C=0,B=[],E;E=A[C];C++){D.concat(B,Element.nextSiblings(E));}return B;},nextElementSibling:function(A){while(A=A.nextSibling){if(A.nodeType==1){return A;}}return null;},previousElementSibling:function(A){while(A=A.previousSibling){if(A.nodeType==1){return A;}}return null;},tagName:function(B,A,E,H){E=E.toUpperCase();var D=[],F=Selector.handlers;if(B){if(H){if(H=="descendant"){for(var C=0,G;G=B[C];C++){F.concat(D,G.getElementsByTagName(E));}return D;}else{B=this[H](B);}if(E=="*"){return B;}}for(var C=0,G;G=B[C];C++){if(G.tagName.toUpperCase()==E){D.push(G);}}return D;}else{return A.getElementsByTagName(E);}},id:function(B,A,H,F){var G=$(H),D=Selector.handlers;if(!G){return[];}if(!B&&A==document){return[G];}if(B){if(F){if(F=="child"){for(var C=0,E;E=B[C];C++){if(G.parentNode==E){return[G];}}}else{if(F=="descendant"){for(var C=0,E;E=B[C];C++){if(Element.descendantOf(G,E)){return[G];}}}else{if(F=="adjacent"){for(var C=0,E;E=B[C];C++){if(Selector.handlers.previousElementSibling(G)==E){return[G];}}}else{B=D[F](B);}}}}for(var C=0,E;E=B[C];C++){if(E==G){return[G];}}return[];}return(G&&Element.descendantOf(G,A))?[G]:[];},className:function(B,A,C,D){if(B&&D){B=this[D](B);}return Selector.handlers.byClassName(B,A,C);},byClassName:function(C,B,F){if(!C){C=Selector.handlers.descendant([B]);}var H=" "+F+" ";for(var E=0,D=[],G,A;G=C[E];E++){A=G.className;if(A.length==0){continue;}if(A==F||(" "+A+" ").include(H)){D.push(G);}}return D;},attrPresence:function(C,B,A){if(!C){C=B.getElementsByTagName("*");}var E=[];for(var D=0,F;F=C[D];D++){if(Element.hasAttribute(F,A)){E.push(F);}}return E;},attr:function(A,H,G,I,B){if(!A){A=H.getElementsByTagName("*");}var J=Selector.operators[B],D=[];for(var E=0,C;C=A[E];E++){var F=Element.readAttribute(C,G);if(F===null){continue;}if(J(F,I)){D.push(C);}}return D;},pseudo:function(B,C,E,A,D){if(B&&D){B=this[D](B);}if(!B){B=A.getElementsByTagName("*");}return Selector.pseudos[C](B,E,A);}},pseudos:{"first-child":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(Selector.handlers.previousElementSibling(E)){continue;}C.push(E);}return C;},"last-child":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(Selector.handlers.nextElementSibling(E)){continue;}C.push(E);}return C;},"only-child":function(B,G,A){var E=Selector.handlers;for(var D=0,C=[],F;F=B[D];D++){if(!E.previousElementSibling(F)&&!E.nextElementSibling(F)){C.push(F);}}return C;},"nth-child":function(B,C,A){return Selector.pseudos.nth(B,C,A);},"nth-last-child":function(B,C,A){return Selector.pseudos.nth(B,C,A,true);},"nth-of-type":function(B,C,A){return Selector.pseudos.nth(B,C,A,false,true);},"nth-last-of-type":function(B,C,A){return Selector.pseudos.nth(B,C,A,true,true);},"first-of-type":function(B,C,A){return Selector.pseudos.nth(B,"1",A,false,true);},"last-of-type":function(B,C,A){return Selector.pseudos.nth(B,"1",A,true,true);},"only-of-type":function(B,D,A){var C=Selector.pseudos;return C["last-of-type"](C["first-of-type"](B,D,A),D,A);},getIndices:function(B,A,C){if(B==0){return A>0?[A]:[];}return $R(1,C).inject([],function(D,E){if(0==(E-A)%B&&(E-A)/B>=0){D.push(E);}return D;});},nth:function(A,L,N,K,C){if(A.length==0){return[];}if(L=="even"){L="2n+0";}if(L=="odd"){L="2n+1";}var J=Selector.handlers,I=[],B=[],E;J.mark(A);for(var H=0,D;D=A[H];H++){if(!D.parentNode._counted){J.index(D.parentNode,K,C);B.push(D.parentNode);}}if(L.match(/^\d+$/)){L=Number(L);for(var H=0,D;D=A[H];H++){if(D.nodeIndex==L){I.push(D);}}}else{if(E=L.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(E[1]=="-"){E[1]=-1;}var O=E[1]?Number(E[1]):1;var M=E[2]?Number(E[2]):0;var P=Selector.pseudos.getIndices(O,M,A.length);for(var H=0,D,F=P.length;D=A[H];H++){for(var G=0;G<F;G++){if(D.nodeIndex==P[G]){I.push(D);}}}}}J.unmark(A);J.unmark(B);return I;},"empty":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.tagName=="!"||(E.firstChild&&!E.innerHTML.match(/^\s*$/))){continue;}C.push(E);}return C;},"not":function(A,D,I){var G=Selector.handlers,J,C;var H=new Selector(D).findElements(I);G.mark(H);for(var F=0,E=[],B;B=A[F];F++){if(!B._counted){E.push(B);}}G.unmark(H);return E;},"enabled":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(!E.disabled){C.push(E);}}return C;},"disabled":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.disabled){C.push(E);}}return C;},"checked":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.checked){C.push(E);}}return C;}},operators:{"=":function(B,A){return B==A;},"!=":function(B,A){return B!=A;},"^=":function(B,A){return B.startsWith(A);},"$=":function(B,A){return B.endsWith(A);},"*=":function(B,A){return B.include(A);},"~=":function(B,A){return(" "+B+" ").include(" "+A+" ");},"|=":function(B,A){return("-"+B.toUpperCase()+"-").include("-"+A.toUpperCase()+"-");}},matchElements:function(F,G){var E=new Selector(G).findElements(),D=Selector.handlers;D.mark(E);for(var C=0,B=[],A;A=F[C];C++){if(A._counted){B.push(A);}}D.unmark(E);return B;},findElement:function(B,C,A){if(Object.isNumber(C)){A=C;C=false;}return Selector.matchElements(B,C||"*")[A||0];},findChildElements:function(E,G){var H=G.join(","),G=[];H.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(I){G.push(I[1].strip());});var D=[],F=Selector.handlers;for(var C=0,B=G.length,A;C<B;C++){A=new Selector(G[C].strip());F.concat(D,A.findElements(E));}return(B>1)?F.unique(D):D;}});function $$(){return Selector.findChildElements(document,$A(arguments));}var Form={reset:function(A){$(A).reset();return A;},serializeElements:function(G,B){if(typeof B!="object"){B={hash:!!B};}else{if(B.hash===undefined){B.hash=true;}}var C,F,A=false,E=B.submit;var D=G.inject({},function(H,I){if(!I.disabled&&I.name){C=I.name;F=$(I).getValue();if(F!=null&&(I.type!="submit"||(!A&&E!==false&&(!E||C==E)&&(A=true)))){if(C in H){if(!Object.isArray(H[C])){H[C]=[H[C]];}H[C].push(F);}else{H[C]=F;}}}return H;});return B.hash?D:Object.toQueryString(D);}};Form.Methods={serialize:function(B,A){return Form.serializeElements(Form.getElements(B),A);},getElements:function(A){return $A($(A).getElementsByTagName("*")).inject([],function(B,C){if(Form.Element.Serializers[C.tagName.toLowerCase()]){B.push(Element.extend(C));}return B;});},getInputs:function(G,C,D){G=$(G);var A=G.getElementsByTagName("input");if(!C&&!D){return $A(A).map(Element.extend);}for(var E=0,H=[],F=A.length;E<F;E++){var B=A[E];if((C&&B.type!=C)||(D&&B.name!=D)){continue;}H.push(Element.extend(B));}return H;},disable:function(A){A=$(A);Form.getElements(A).invoke("disable");return A;},enable:function(A){A=$(A);Form.getElements(A).invoke("enable");return A;},findFirstElement:function(B){var C=$(B).getElements().findAll(function(D){return"hidden"!=D.type&&!D.disabled;});var A=C.findAll(function(D){return D.hasAttribute("tabIndex")&&D.tabIndex>=0;}).sortBy(function(D){return D.tabIndex;}).first();return A?A:C.find(function(D){return["input","select","textarea"].include(D.tagName.toLowerCase());});},focusFirstElement:function(A){A=$(A);A.findFirstElement().activate();return A;},request:function(B,A){B=$(B),A=Object.clone(A||{});var D=A.parameters,C=B.readAttribute("action")||"";if(C.blank()){C=window.location.href;}A.parameters=B.serialize(true);if(D){if(Object.isString(D)){D=D.toQueryParams();}Object.extend(A.parameters,D);}if(B.hasAttribute("method")&&!A.method){A.method=B.method;}return new Ajax.Request(C,A);}};Form.Element={focus:function(A){$(A).focus();return A;},select:function(A){$(A).select();return A;}};Form.Element.Methods={serialize:function(A){A=$(A);if(!A.disabled&&A.name){var B=A.getValue();if(B!=undefined){var C={};C[A.name]=B;return Object.toQueryString(C);}}return"";},getValue:function(A){A=$(A);var B=A.tagName.toLowerCase();return Form.Element.Serializers[B](A);},setValue:function(A,B){A=$(A);var C=A.tagName.toLowerCase();Form.Element.Serializers[C](A,B);return A;},clear:function(A){$(A).value="";return A;},present:function(A){return $(A).value!="";},activate:function(A){A=$(A);try{A.focus();if(A.select&&(A.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(A.type))){A.select();}}catch(B){}return A;},disable:function(A){A=$(A);A.blur();A.disabled=true;return A;},enable:function(A){A=$(A);A.disabled=false;return A;}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(A,B){switch(A.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(A,B);default:return Form.Element.Serializers.textarea(A,B);}},inputSelector:function(A,B){if(B===undefined){return A.checked?A.value:null;}else{A.checked=!!B;}},textarea:function(A,B){if(B===undefined){return A.value;}else{A.value=B;}},select:function(D,A){if(A===undefined){return this[D.type=="select-one"?"selectOne":"selectMany"](D);}else{var C,F,G=!Object.isArray(A);for(var B=0,E=D.length;B<E;B++){C=D.options[B];F=this.optionValue(C);if(G){if(F==A){C.selected=true;return ;}}else{C.selected=A.include(F);}}}},selectOne:function(B){var A=B.selectedIndex;return A>=0?this.optionValue(B.options[A]):null;},selectMany:function(D){var A,E=D.length;if(!E){return null;}for(var C=0,A=[];C<E;C++){var B=D.options[C];if(B.selected){A.push(this.optionValue(B));}}return A;},optionValue:function(A){return Element.extend(A).hasAttribute("value")?A.value:A.text;}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,A,B,C){$super(C,B);this.element=$(A);this.lastValue=this.getValue();},execute:function(){var A=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(A)?this.lastValue!=A:String(this.lastValue)!=String(A)){this.callback(this.element,A);this.lastValue=A;}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element);}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element);}});Abstract.EventObserver=Class.create({initialize:function(A,B){this.element=$(A);this.callback=B;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks();}else{this.registerCallback(this.element);}},onElementEvent:function(){var A=this.getValue();if(this.lastValue!=A){this.callback(this.element,A);this.lastValue=A;}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this);},registerCallback:function(A){if(A.type){switch(A.type.toLowerCase()){case"checkbox":case"radio":Event.observe(A,"click",this.onElementEvent.bind(this));break;default:Event.observe(A,"change",this.onElementEvent.bind(this));break;}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element);}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element);}});if(!window.Event){var Event={};}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(B){var A;switch(B.type){case"mouseover":A=B.fromElement;break;case"mouseout":A=B.toElement;break;default:return null;}return Element.extend(A);}});Event.Methods=(function(){var A;if(Prototype.Browser.IE){var B={0:1,1:4,2:2};A=function(D,C){return D.button==B[C];};}else{if(Prototype.Browser.WebKit){A=function(D,C){switch(C){case 0:return D.which==1&&!D.metaKey;case 1:return D.which==1&&D.metaKey;default:return false;}};}else{A=function(D,C){return D.which?(D.which===C+1):(D.button===C);};}}return{isLeftClick:function(C){return A(C,0);},isMiddleClick:function(C){return A(C,1);},isRightClick:function(C){return A(C,2);},element:function(D){var C=Event.extend(D).target;return Element.extend(C.nodeType==Node.TEXT_NODE?C.parentNode:C);},findElement:function(D,E){var C=Event.element(D);return C.match(E)?C:C.up(E);},pointer:function(C){return{x:C.pageX||(C.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),y:C.pageY||(C.clientY+(document.documentElement.scrollTop||document.body.scrollTop))};},pointerX:function(C){return Event.pointer(C).x;},pointerY:function(C){return Event.pointer(C).y;},stop:function(C){Event.extend(C);C.preventDefault();C.stopPropagation();C.stopped=true;}};})();Event.extend=(function(){var A=Object.keys(Event.Methods).inject({},function(B,C){B[C]=Event.Methods[C].methodize();return B;});if(Prototype.Browser.IE){Object.extend(A,{stopPropagation:function(){this.cancelBubble=true;},preventDefault:function(){this.returnValue=false;},inspect:function(){return"[object Event]";}});return function(B){if(!B){return false;}if(B._extendedByPrototype){return B;}B._extendedByPrototype=Prototype.emptyFunction;var C=Event.pointer(B);Object.extend(B,{target:B.srcElement,relatedTarget:Event.relatedTarget(B),pageX:C.x,pageY:C.y});return Object.extend(B,A);};}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(Event.prototype,A);return Prototype.K;}})();Object.extend(Event,(function(){var B=Event.cache;function C(J){if(J._eventID){return J._eventID;}arguments.callee.id=arguments.callee.id||1;return J._eventID=++arguments.callee.id;}function G(J){if(J&&J.include(":")){return"dataavailable";}return J;}function A(J){return B[J]=B[J]||{};}function F(L,J){var K=A(L);return K[J]=K[J]||[];}function H(K,J,L){var O=C(K);var N=F(O,J);if(N.pluck("handler").include(L)){return false;}var M=function(P){if(!Event||!Event.extend||(P.eventName&&P.eventName!=J)){return false;}Event.extend(P);L.call(K,P);};M.handler=L;N.push(M);return M;}function I(M,J,K){var L=F(M,J);return L.find(function(N){return N.handler==K;});}function D(M,J,K){var L=A(M);if(!L[J]){return false;}L[J]=L[J].without(I(M,J,K));}function E(){for(var K in B){for(var J in B[K]){B[K][J]=null;}}}if(window.attachEvent){window.attachEvent("onunload",E);}return{observe:function(L,J,M){L=$(L);var K=G(J);var N=H(L,J,M);if(!N){return L;}if(L.addEventListener){L.addEventListener(K,N,false);}else{L.attachEvent("on"+K,N);}return L;},stopObserving:function(L,J,M){L=$(L);var O=C(L),K=G(J);if(!M&&J){F(O,J).each(function(P){L.stopObserving(J,P.handler);});return L;}else{if(!J){Object.keys(A(O)).each(function(P){L.stopObserving(P);});return L;}}var N=I(O,J,M);if(!N){return L;}if(L.removeEventListener){L.removeEventListener(K,N,false);}else{L.detachEvent("on"+K,N);}D(O,J,M);return L;},fire:function(L,K,J){L=$(L);if(L==document&&document.createEvent&&!L.dispatchEvent){L=document.documentElement;}if(document.createEvent){var M=document.createEvent("HTMLEvents");M.initEvent("dataavailable",true,true);}else{var M=document.createEventObject();M.eventType="ondataavailable";}M.eventName=K;M.memo=J||{};if(document.createEvent){L.dispatchEvent(M);}else{L.fireEvent(M.eventType,M);}return M;}};})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize()});(function(){var C,B=false;function A(){if(B){return ;}if(C){window.clearInterval(C);}document.fire("dom:loaded");B=true;}if(document.addEventListener){if(Prototype.Browser.WebKit){C=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){A();}},0);Event.observe(window,"load",A);}else{document.addEventListener("DOMContentLoaded",A,false);}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;A();}};}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(A,B){return Element.insert(A,{before:B});},Top:function(A,B){return Element.insert(A,{top:B});},Bottom:function(A,B){return Element.insert(A,{bottom:B});},After:function(A,B){return Element.insert(A,{after:B});}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;},within:function(B,A,C){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(B,A,C);}this.xcomp=A;this.ycomp=C;this.offset=Element.cumulativeOffset(B);return(C>=this.offset[1]&&C<this.offset[1]+B.offsetHeight&&A>=this.offset[0]&&A<this.offset[0]+B.offsetWidth);},withinIncludingScrolloffsets:function(B,A,D){var C=Element.cumulativeScrollOffset(B);this.xcomp=A+C[0]-this.deltaX;this.ycomp=D+C[1]-this.deltaY;this.offset=Element.cumulativeOffset(B);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+B.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+B.offsetWidth);},overlap:function(B,A){if(!B){return 0;}if(B=="vertical"){return((this.offset[1]+A.offsetHeight)-this.ycomp)/A.offsetHeight;}if(B=="horizontal"){return((this.offset[0]+A.offsetWidth)-this.xcomp)/A.offsetWidth;}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(A){Position.prepare();return Element.absolutize(A);},relativize:function(A){Position.prepare();return Element.relativize(A);},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(B,C,A){A=A||{};return Element.clonePosition(C,B,A);}};if(!document.getElementsByClassName){document.getElementsByClassName=function(B){function A(C){return C.blank()?null:"[contains(concat(' ', @class, ' '), ' "+C+" ')]";}B.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(C,E){E=E.toString().strip();var D=/\s/.test(E)?$w(E).map(A).join(""):A(E);return D?document._getElementsByXPath(".//*"+D,C):[];}:function(E,F){F=F.toString().strip();var G=[],H=(/\s/.test(F)?$w(F):null);if(!H&&!F){return G;}var C=$(E).getElementsByTagName("*");F=" "+F+" ";for(var D=0,J,I;J=C[D];D++){if(J.className&&(I=" "+J.className+" ")&&(I.include(F)||(H&&H.all(function(K){return !K.toString().blank()&&I.include(" "+K+" ");})))){G.push(Element.extend(J));}}return G;};return function(D,C){return $(C||document.body).getElementsByClassName(D);};}(Element.Methods);}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(A){this.element=$(A);},_each:function(A){this.element.className.split(/\s+/).select(function(B){return B.length>0;})._each(A);},set:function(A){this.element.className=A;},add:function(A){if(this.include(A)){return ;}this.set($A(this).concat(A).join(" "));},remove:function(A){if(!this.include(A)){return ;}this.set($A(this).without(A).join(" "));},toString:function(){return $A(this).join(" ");}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods(); diff --git a/src/nhttpd/web/scripts/Makefile.am b/src/nhttpd/web/scripts/Makefile.am index c145441da..03c546fd9 100644 --- a/src/nhttpd/web/scripts/Makefile.am +++ b/src/nhttpd/web/scripts/Makefile.am @@ -1,7 +1,7 @@ -installdir = $(DATADIR)/neutrino/httpd-y/scripts +installdir = $(DATADIR)/neutrino/httpd/scripts install_DATA= api.sh _Y_Globals.sh _Y_Library.sh Y_Live.sh Y_Plugins.sh Y_Tools.sh install-data-hook: - chmod 0755 $(DATADIR)/neutrino/httpd-y/scripts/api.sh - chmod 0755 $(DATADIR)/neutrino/httpd-y/scripts/Y_*.sh + chmod 0755 $(DATADIR)/neutrino/httpd/scripts/api.sh + chmod 0755 $(DATADIR)/neutrino/httpd/scripts/Y_*.sh diff --git a/src/nhttpd/web/scripts/Y_Live.sh b/src/nhttpd/web/scripts/Y_Live.sh index 1ba1dff5f..877dae864 100755 --- a/src/nhttpd/web/scripts/Y_Live.sh +++ b/src/nhttpd/web/scripts/Y_Live.sh @@ -1,8 +1,8 @@ #!/bin/sh # ----------------------------------------------------------- # Live (yjogol) -# $Date: 2007/02/21 17:41:04 $ -# $Revision: 1.2 $ +# $Date: 2007/11/26 20:54:55 $ +# $Revision: 1.3 $ # ----------------------------------------------------------- . ./_Y_Globals.sh @@ -87,15 +87,12 @@ case "$1" in ;; udp_stream) -echo "udp stream" if [ "$2" = "start" ] then shift 2 -echo "kill all streams" killall streamts killall streampes killall udpstreamts -echo "start udpstream" if [ -e /var/bin/udpstreamts ] then /var/bin/udpstreamts $* & diff --git a/src/nhttpd/web/scripts/Y_Plugins.sh b/src/nhttpd/web/scripts/Y_Plugins.sh index be1ae5584..be12c4c1f 100755 --- a/src/nhttpd/web/scripts/Y_Plugins.sh +++ b/src/nhttpd/web/scripts/Y_Plugins.sh @@ -1,8 +1,8 @@ #!/bin/sh # ----------------------------------------------------------- # Plugins (yjogol) -# $Date: 2006/09/16 14:52:23 $ -# $Revision: 1.1 $ +# $Date: 2007/11/26 20:54:55 $ +# $Revision: 1.2 $ # ----------------------------------------------------------- . ./_Y_Globals.sh diff --git a/src/nhttpd/web/scripts/Y_Tools.sh b/src/nhttpd/web/scripts/Y_Tools.sh index c43f76e79..bfcd1852e 100755 --- a/src/nhttpd/web/scripts/Y_Tools.sh +++ b/src/nhttpd/web/scripts/Y_Tools.sh @@ -1,8 +1,8 @@ #!/bin/sh # ----------------------------------------------------------- # Tools (yjogol) -# $Date: 2007/02/21 17:41:04 $ -# $Revision: 1.2 $ +# $Date: 2010/01/03 18:54:42 $ +# $Revision: 1.9 $ # ----------------------------------------------------------- . ./_Y_Globals.sh . ./_Y_Library.sh @@ -103,6 +103,7 @@ flash_mtd() msg_nmsg "Image%20%20flashing!" if [ "$simulate" = "false" ] then + umount /hdd #yet: fixed setting fcp -v "$y_upload_file" /dev/mtd/$1 >/tmp/e.txt else #simulation/DEMO i="0" @@ -112,7 +113,7 @@ flash_mtd() b=`expr $i \* 63` b=`expr $b / 10` echo -e "\rDEMO: Erasing blocks: $b/63 ($p%)" >>/tmp/e.txt - i=`expr $i + 1` + i=`expr $i + 1` sleep 1 done i="0" @@ -122,7 +123,7 @@ flash_mtd() b=`expr $i \* 8064` b=`expr $b / 20` echo -e "\rDEMO: Writing data: $b k/8064k ($p%)" >>/tmp/e.txt - i=`expr $i + 1` + i=`expr $i + 1` sleep 2 done i="0" @@ -132,7 +133,7 @@ flash_mtd() b=`expr $i \* 8064` b=`expr $b / 5` echo -e "\rDEMO: Verifying data: $b k/8064k ($p%)" >>/tmp/e.txt - i=`expr $i + 1` + i=`expr $i + 1` sleep 1 done fi @@ -140,7 +141,7 @@ flash_mtd() msg="flashing done ... please reboot box now ..." msg="$msg <script language='JavaScript' type='text/javascript'>window.setTimeout('parent.do_image_flash_ready()',1000)</script>" y_format_message_html - + if [ "$simulate" = "false" ] then busybox reboot -d10 @@ -235,7 +236,7 @@ do_mount() cmd="mount -t nfs $ip:$dir $local_dir -o $options1" ;; 1) - cmd="mount -t cifs //$ip/$dir $local_dir -o username=$username,password=$password,unc=//$ip/$dir,$options1"; + cmd="mount -t cifs $ip/$dir $local_dir -o username=$username,password=$password,unc=//$ip/$dir,$options1"; ;; 2) cmd="lufsd none $local_dir -o fs=ftpfs,username=$username,password=$password,host=$ip,root=/$dir,$options1"; @@ -248,8 +249,9 @@ do_mount() then cmd="$cmd,$options2" fi - res=`$cmd` + echo "$cmd" >/tmp/mount.log + echo "$res" >>/tmp/mount.log echo "$res" echo "view mounts" m=`mount` @@ -271,7 +273,7 @@ do_automount_list() { i="1" sel="checked='checked'" - cat $1|sed -n /-fstype/p|\ + cat $1|sed /#/d|sed -n /-fstype/p|\ while read mountname options share do mountvalue=`echo "$mountname"|sed -e "s/#/---/g"` @@ -360,12 +362,12 @@ do_installer() tar -xf "$y_upload_file" rm $y_upload_file if [ -s "$y_install" ] #look for install.sh - then + then chmod 755 $y_install o=`$y_install` # execute rm -f $y_install # clean up if [ -s "$y_out_html" ] #html - output? - then + then echo '<html><head><link rel="stylesheet" type="text/css" href="/Y_Main.css">' echo "<meta http-equiv='refresh' content='0; $y_out_html'></head>" echo "<body><a href='$y_out_html'>If automatic forwarding does not go.</a>" @@ -386,19 +388,22 @@ do_installer() y_format_message_html fi } + # ----------------------------------------------------------- # extention Installer $1=URL # ----------------------------------------------------------- do_ext_installer() { - rm $y_upload_file - wgetlog=`wget -O $y_upload_file $1 2>/tmp/err.log` + if [ -e $y_upload_file ]; then + rm $y_upload_file + fi + wgetlog=`wget -O $y_upload_file $1 2>&1` if [ -s "$y_upload_file" ];then cd $y_path_tmp tar -xf "$y_upload_file" rm $y_upload_file if [ -s "$y_install" ] #look for install.sh - then + then chmod 755 $y_install o=`$y_install` # execute rm -f $y_install # clean up @@ -409,6 +414,14 @@ do_ext_installer() echo "error: $y_install not found. wget=$wgetlog $e" fi } +do_ext_uninstaller() +{ + uinst="/var/tuxbox/config/ext/uninstall.sh" + if [ -e "$uinst" ]; then + chmod 755 "$uinst" + `$uinst $1_uninstall.inc` + fi +} # ----------------------------------------------------------- # view /proc/$1 Informations # ----------------------------------------------------------- @@ -428,14 +441,46 @@ wol() y_format_message_html } # ----------------------------------------------------------- +# lcd shot +# $1= optionen | leer # ----------------------------------------------------------- -dofbshot() +do_lcshot() { - rm -r /tmp/a.png - fbshot -q /tmp/a.png >/dev/null - msg="<img src='' name="fb" id="fb">" - msg="$msg <script language='JavaScript' type='text/javascript'>document.fb.src='/tmp/a.png?hash=' + Math.random();window.setTimeout('parent.do_ready()',1000)</script>" - y_format_message_html_plain + if [ -e "/var/bin/lcshot" ]; then + /var/bin/lcshot $* + else + /bin/lcshot $* + fi +} +# ----------------------------------------------------------- +# osd shot +# $1= fb | dbox bzw. leer +# ----------------------------------------------------------- +do_fbshot() +{ + if [ "$1" = "fb" ]; then + shift 1 + if [ -e "/var/bin/fbshot" ]; then + /var/bin/fbshot $* + else + fbshot $* + fi + else + shift 1 + if [ -e "/var/bin/dboxshot" ]; then + /var/bin/dboxshot $* + else + dboxshot $* + fi + fi +} +# ----------------------------------------------------------- +# delete fbshot created graphics +# ----------------------------------------------------------- +do_fbshot_clear() +{ + rm /tmp/*.bmp + rm /tmp/*.png } # ----------------------------------------------------------- @@ -468,11 +513,6 @@ do_settings_backup_restore() cp -rf ./config /var/tuxbox/ rm -r ./config msg="$msg ok" - y_format_message_html - sync - sync - umount -a - reboot -f else msg="$msg error: no upload file" fi @@ -480,6 +520,11 @@ do_settings_backup_restore() ;; esac } +restart_neutrino() +{ + echo "fixme" +# kill -HUP `pidof neutrino` +} # ----------------------------------------------------------- # Main # ----------------------------------------------------------- @@ -507,21 +552,26 @@ case "$1" in domount) shift 1; do_mount $* ;; dounmount) shift 1; do_unmount $* ;; cmd) shift 1; do_cmd $* ;; - installer) shift 1; do_installer $* ;; - ext_installer) shift 1; do_ext_installer $* ;; + installer) shift 1; do_installer $* 2>&1 ;; + ext_uninstaller) shift 1; do_ext_uninstaller $* 2>&1 ;; + ext_installer) shift 1; do_ext_installer $* 2>&1 ;; proc) shift 1; proc $* ;; wol) shift 1; wol $* ;; - dofbshot) dofbshot ;; - get_update_version) wget -O /tmp/version.txt "http://www.yjogol.de/download/Y_Version.txt" ;; + lcshot) shift 1; do_lcshot $* ;; + fbshot) shift 1; do_fbshot $* ;; + fbshot_clear) do_fbshot_clear ;; + get_update_version) wget -O /tmp/version.txt "http://www.yjogol.com/download/Y_Version.txt" ;; settings_backup_restore) shift 1; do_settings_backup_restore $* ;; exec_cmd) shift 1; $* ;; automount_list) shift 1; do_automount_list $* ;; automount_getline) shift 1; do_automount_getline $* ;; automount_setline) shift 1; do_automount_setline $* ;; - + restart_neutrino) restart_neutrino ;; + have_plugin_scripts) find /var/tuxbox/plugins -name '*.sh' ;; timer_get_tvinfo) shift 1 - res=`wget -O /tmp/tvinfo.xml "http://www.tvinfo.de/share/vidac/rec_info.php?username=$1&password=$2"` + rm -r /tmp/tvinfo.xml + res=`wget -O /tmp/tvinfo.xml "http://www.tvinfo.de/share/vidac/rec_info.php?username=$1&password=$2" 2>&1` if ! [ -s /tmp/tvinfo.xml ] then res="$res File empty!" @@ -533,18 +583,27 @@ case "$1" in config_open $y_config_Y_Web url=`config_get_value "klack_url"` klack_url=`echo "$url"|sed -e 's/;/\&/g'` - wget -O /tmp/klack.xml "$klack_url" ;; - + securitycode=`config_get_value "klack_securitycode"` + klack_url=`echo "$klack_url&secCode=$securitycode"` + wget -O /tmp/klack.xml "$klack_url" 2>&1 ;; + + restart_sectionsd) + killall sectionsd + sectionsd >/dev/null 2>&1 + msg="sectionsd reboot. ok." + y_format_message_html + ;; + get_synctimer_channels) if [ -e "$y_path_config/channels.txt" ] then - cat $y_path_config/channels.txt + cat $y_path_config/channels.txt else - cat $y_path_httpd/channels.txt + cat $y_path_httpd/channels.txt fi ;; - get_extention_list) + get_extension_list) if [ -e "$y_path_config/extentions.txt" ] then cat $y_path_config/extentions.txt @@ -553,14 +612,14 @@ case "$1" in fi ;; - write_extention_list) + write_extension_list) shift 1 echo "$*" >$y_path_config/extentions.txt ;; - + url_get) shift 1 - res=`wget -O /tmp/$2 "$1" >/tmp/url.log` + res=`wget -O /tmp/$2 "$1" >/tmp/url.log 2>&1` cat /tmp/$2 ;; @@ -573,7 +632,15 @@ case "$1" in echo "on" fi ;; - + var_space) + df /var|grep /var + ;; + tmp_space) + df /tmp|grep /tmp + ;; *) echo "[Y_Tools.sh] Parameter falsch: $*" ;; esac + + + diff --git a/src/nhttpd/web/scripts/_Y_Globals.sh b/src/nhttpd/web/scripts/_Y_Globals.sh index ac814a69c..ced16bbce 100755 --- a/src/nhttpd/web/scripts/_Y_Globals.sh +++ b/src/nhttpd/web/scripts/_Y_Globals.sh @@ -1,8 +1,8 @@ #!/bin/sh # ----------------------------------------------------------- # Y Globals (yjogol) -# $Date: 2006/09/16 14:52:23 $ -# $Revision: 1.1 $ +# $Date: 2007/11/26 20:54:55 $ +# $Revision: 1.2 $ # ----------------------------------------------------------- # ----------------------------------------------------------- diff --git a/src/nhttpd/web/scripts/_Y_Library.sh b/src/nhttpd/web/scripts/_Y_Library.sh index cb5fd8575..6cd00b956 100755 --- a/src/nhttpd/web/scripts/_Y_Library.sh +++ b/src/nhttpd/web/scripts/_Y_Library.sh @@ -1,8 +1,8 @@ #!/bin/sh # ----------------------------------------------------------- # Y Library (yjogol) -# $Date: 2006/09/16 14:52:23 $ -# $Revision: 1.1 $ +# $Date: 2007/11/26 20:54:55 $ +# $Revision: 1.2 $ # ----------------------------------------------------------- # ----------------------------------------------------------- @@ -10,7 +10,7 @@ # ----------------------------------------------------------- call_webserver() { - port=`sed -n /^Port=/p $y_config_nhttpd | sed -e s/^Port=//1` + port=`sed -n /^WebsiteMain.port=/p $y_config_nhttpd | sed -e s/^WebsiteMain.port=//1` tmp=`wget -O - -q "http://localhost:$port/$1"` echo "$tmp" } @@ -25,7 +25,7 @@ buildLocalIP() } # ----------------------------------------------------------- -# Streaming URL für sed +# Streaming URL f�r sed # ----------------------------------------------------------- buildStreamingURL() { @@ -46,7 +46,7 @@ buildStreamingRawURL() } # ----------------------------------------------------------- -# Audio: Streaming URL für sed +# Audio: Streaming URL f�r sed # ----------------------------------------------------------- buildStreamingAudioURL() { diff --git a/src/nhttpd/web/scripts/api.sh b/src/nhttpd/web/scripts/api.sh index f6f7aacc9..f7a6cb3d2 100755 --- a/src/nhttpd/web/scripts/api.sh +++ b/src/nhttpd/web/scripts/api.sh @@ -1,37 +1,57 @@ #!/bin/sh # ----------------------------------------------------------- # API Script (yjogol) -# $Date: 2007/02/21 17:41:04 $ -# $Revision: 1.1 $ +# for yWeb independent shell calls +# $Date: 2007/11/26 20:54:55 $ +# $Revision: 1.3 $ # ----------------------------------------------------------- +API_VERSION_MAJOR="1" +API_VERSION_MINOR="0" +API_VERSION_TEXT="$API_VERSION_MAJOR.$API_VERSION_MINOR" path_httpd=".." path_scripts="$path_httpd/scripts" path_usrbin="/var/bin" +path_sbin="/sbin" path_config="/var/tuxbox/config" path_tmp="/tmp" +streaming_client_status="$path_tmp/streaming_client" + # ----------------------------------------------------------- +# udp control for neutrinoTV and yWeb LiveTV do_udp_stream() { -echo "para: $*" up="no" - if [ -e /var/bin/udpstreamts ]; then - up="/var/bin/udpstreamts" + if [ -e $path_usrbin/udpstreamts ]; then + up="$path_usrbin/udpstreamts" else - up="udpstreamts" + if [ -e $path_sbin/udpstreamts ]; then + up="$path_sbin/udpstreamts" + fi fi + case "$1" in installed) - echo "$up" ;; + echo "$up" ;; start) shift 1 killall streamts - killall streampes killall udpstreamts + echo $* > $streaming_client_status trap "" 1;$up $* & ;; stop) - killall udpstreamts ;; + killall udpstreamts + rm $streaming_client_status + echo "ok" + ;; + kill_all_streams) + killall streamts + killall streampes + killall udpstreamts + rm $streaming_client_status + echo "ok" + ;; esac } # ----------------------------------------------------------- @@ -39,12 +59,29 @@ echo "para: $*" # ----------------------------------------------------------- case "$1" in version) - echo '$Revision: 1.1 $' ;; - + echo $API_VERSION_TEXT ;; + udp_stream) shift 1 do_udp_stream $* ;; + streaming_status) + if [ -e $streaming_client_status ]; then + cat $streaming_client_status + else + echo "Streams: " + ps | grep stream | grep -v grep | grep -v sh | cut -d " " -f 15 + fi + ;; + streaming_lock) + shift 1 + echo $* > $streaming_client_status # first parameter should always be the ip of the client + echo "ok" + ;; + streaming_unlock) + rm $streaming_client_status + echo "ok" + ;; *) echo "[api.sh] Parameter wrong: $*" ;; esac diff --git a/src/nhttpd/web/ywidget.css b/src/nhttpd/web/ywidget.css new file mode 100644 index 000000000..18d873b23 --- /dev/null +++ b/src/nhttpd/web/ywidget.css @@ -0,0 +1,69 @@ +/* Y.Menu */ +#yoverlay{ + position:absolute; + top:0; + left:0; + width:100%; + height:100%; + z-index:5000; + background-color:#000; + -moz-opacity: 0.2; + opacity:.20; + filter: alpha(opacity=20); +} +/* Y.Menu */ +.ycm { + position: absolute; + left: 150px; + top: 150px; + z-index: 9998; + margin:0 auto; + width:100px; + padding:0px; + text-align:left; + background-color:#fff; +} +.ycm ul{ + text-align:left; + margin:0px; + list-style:none; + text-indent: 0; + padding:0px; +} +.ycm ul a{ + border:1px solid #999; + background-color:#f5f5f5; + color:#444; + padding:1px; + margin:0 0 0px 0; + display:block; +} +.ycm ul a:hover{ + border:1px solid #2188e0; + background-color:#cceeff; + color:#2188e0; +} +/*dialogs*/ +.ydiag +{ + z-index: 9980; + position: absolute; + left: 100px; + top: 100px; + border: 1px solid #2188e0; + border-collapse: collapse; + background-color: white; + padding: 1em; +} +.ydiagfree +{ + z-index: 9980; + position: absolute; + left: 100px; + top: 100px; + /*border-collapse: collapse;*/ + background-color: white; + padding: 0; + margin: 0; +} + diff --git a/src/nhttpd/web/ywidget.js b/src/nhttpd/web/ywidget.js new file mode 100644 index 000000000..9c1141e60 --- /dev/null +++ b/src/nhttpd/web/ywidget.js @@ -0,0 +1,155 @@ +/* Y widget library + by yjogol 2007 +*/ + +// Y name space +if(typeof(Y) == "undefined") + Y = {}; + +/* Y.Base */ +Y.Base = {}; +Y.Base.Overlay = { + overlayname : 'yoverlay', + overlay: null, + isOverlay: false, + init: function() { + this.buildOverlay(); + }, + buildOverlay: function(){ + var bod = document.getElementsByTagName('body')[0]; + this.overlay = document.createElement('div'); + this.overlay.id = 'yoverlay'; + this.hideOverlay(); + bod.appendChild(this.overlay); + }, + showOverlay: function(){ + this.isOverlay = true; + this.overlay.show(); + }, + hideOverlay: function(){ + this.overlay.hide(); + this.isOverlay = false; + }, + showElement: function(e,x,y){ + if(typeof(x) != "undefined" && typeof(y) != "undefined") + $(e).setStyle({left: x+"px", top: y+"px"}); + $(e).show(); + }, + showOverlayedElement: function(e,x,y){ + this.showOverlay(); + this.showElement(e,x,y); + }, + hideElement: function(e){ + if(this.isOverlay) + this.hideOverlay(); + $(e).hide(); + } +}; +//Event.observe(window, 'load', function(e){Y.Base.Overlay.init();}, false); +/* END - Y.Base */ + +/* Y.Dialog */ +Y.Dialog = Class.create(); +Object.extend(Y.Dialog.prototype, { + el: null, + initialize: function(e){ + el=e; + }, + show: function(x,y){ + Y.Base.Overlay.showOverlayedElement(el,x,y); + }, + hide: function(){ + Y.Base.Overlay.hideElement(el); + } +}); + +/* Y.ContextMenu + Menu activation: Use Tag ycontextmenu=<id of ul od menu> +*/ +Y.ContextMenu = Class.create(); + +/* Meta Object */ +Object.extend(Y.ContextMenu, { + isMenu : false, + menu_list : new Array(), + selElement: null, + selTrigger: null, + init: function() { + this.buildMenus(); + if(this.menu_list.length >0) + this.attachEvents(); + }, + buildMenus: function() { + var menus = $$('[ycontextmenu]'); + menu_list=null; + for(i = 0; i < menus.length; i++) + this.menu_list.push(new Y.ContextMenu(menus[i],Element.readAttribute(menus[i],'ycontextmenu')) ); + }, + attachEvents: function() { + Event.observe(window, 'click', this.eventCheckOutsideClick.bindAsEventListener(this), false); + }, + eventCheckOutsideClick : function(e) { + if(this.isMenu){ + this.menu_list.each(function(s,e){ + if(s.active){ + s.hide(); + if(!Position.within(s.menu,Event.pointerX(e),Event.pointerY(e))) + Event.stop(e); + throw $break; + } + }); + } + } +}); + +/*ContextMenu items*/ +Object.extend(Y.ContextMenu.prototype, { + active: false, + menu: null, + trigger: null, + width:0, + height:0, + initialize: function(element,contextmenu){ + if(typeof(element) == "undefined") + return; + Event.observe(element, "click", this.eventClick.bindAsEventListener(this), false); + this.menu=$(contextmenu); + this.trigger=$(element); + var dimensions = this.menu.getDimensions(); + this.width = dimensions.width; + this.height = dimensions.height; + }, + eventClick: function(e) { + this.setPosition(Event.pointerX(e), Event.pointerY(e)); + Y.ContextMenu.selElement = Event.element(e); + Y.ContextMenu.selTrigger = this.trigger; + this.show(); + Event.stop(e); + }, + setPosition: function(x,y){/*mouse click coordinates*/ + var dist=20; + var winHeight = window.innerHeight || document.body.clientHeight; + var winWidth = window.innerWidth || document.body.clientWidth; + if(x+this.width>= winWidth-dist) + x=winWidth-dist-this.width; + if(y+this.height>= winHeight-dist) + y=winHeight-dist-this.height; + this.menu.setStyle({left: x+"px", top: y+"px"}); + }, + show: function(){ + this.active = true; + Y.Base.Overlay.showOverlayedElement(this.menu); + Y.ContextMenu.isMenu = true; + }, + hide: function(){ + this.active = false; + Y.Base.Overlay.hideElement(this.menu); + Y.ContextMenu.isMenu = false; + } +}); +/* init Context Menus*/ +//Event.observe(window, 'load', function(e){Y.ContextMenu.init();}, false); +//Event.observe(window, 'unload', Event.unloadCache, false); + +/* END - Context Menu */ + diff --git a/src/nhttpd/yconfig.h b/src/nhttpd/yconfig.h index b6e4d74e9..82397faa1 100644 --- a/src/nhttpd/yconfig.h +++ b/src/nhttpd/yconfig.h @@ -12,32 +12,23 @@ #include <map> #include <vector> -//----------------------------------------------------------------------------- -// TODO: comment it, if CVS checkin -//#define Y_UPDATE_BETA y -#ifdef Y_UPDATE_BETA -#warning "!!!! THIS IS BETA COMPILING. SWITCH OF (Y_UPDATE_BETA) FOR CVS" -#define Y_CONFIG_USE_WEBLOG y -#endif //----------------------------------------------------------------------------- // System Choice <configure!> ONE choice //----------------------------------------------------------------------------- #ifndef CONFIG_SYSTEM_BY_COMPILER // use Compiler directive to set CONFIG_SYSTEM -#define CONFIG_SYSTEM_TUXBOX y // Tuxbox dbox project -//#define CONFIG_SYSTEM_AVM y // AVM FritzBox -//#define CONFIG_SYSTEM_MSS y // Maxtor Shared Storage -//#define CONFIG_SYSTEM_LINUX y // Normal Linux PC -//#define CONFIG_SYSTEM_CYGWIN y // Windows (Cygwin) +//#define CONFIG_SYSTEM_TUXBOX y // Tuxbox dbox project +#define CONFIG_SYSTEM_TUXBOX_COOLSTREAM y // Tuxbox dbox project for coolstream #endif //----------------------------------------------------------------------------- // General central Definitions <configure!> //----------------------------------------------------------------------------- -#define HTTPD_VERSION "3.1.2" // Webserver version (can be overloaded) -#define YHTTPD_VERSION "1.2.0" // Webserver version (Version of yhttpd-core!) +#define HTTPD_VERSION "3.2.2" // Webserver version (can be overloaded) +#define YHTTPD_VERSION "1.3.0" // Webserver version (Version of yhttpd-core!) #define IADDR_LOCAL "127.0.0.1" // local IP #define HTTPD_NAME "yhttpd" // Webserver name (can be overloaded) #define YHTTPD_NAME "yhttpd_core" // Webserver name (Name of yhttpd-core!) #define AUTH_NAME_MSG "yhhtpd" // Name in Authentication Dialogue +#define CONF_VERSION 4 // Version of yhttpd-conf file #define HTTPD_KEEPALIVE_TIMEOUT 500000 // Timeout for Keep-Alive in mircoseconds //============================================================================= @@ -53,21 +44,19 @@ #define Y_CONFIG_USE_CACHE y // Add mod: Can cache production pages #define Y_CONFIG_USE_SENDFILE y // Add mod: can send static files (mandantory) //----------------------------------------------------------------------------- -// modules +// Features & Build //----------------------------------------------------------------------------- #define Y_CONFIG_FEATURE_CHECK_PORT_AUTORITY y // System: Port < 1024 need Admin-Privileges-Check #define Y_CONFIG_HAVE_SENDFILE y // System: Have *IX SendFile #define Y_CONFIG_FEATURE_UPLOAD y // Add Feature: File Upload POST Command #define Y_CONFIG_USE_HOSTEDWEB y // Add Feature: Use HOSTED Web #define Y_CONFIG_FEATURE_SHOW_SERVER_CONFIG y // Add Feature (in yParser): add /y/server-config -//#define Y_CONFIG_USE_OPEN_SSL y // Add Feature: use openSSL +//#define Y_CONFIG_USE_OPEN_SSL y // Add Feature: use openSSL //#define Y_CONFIG_FEATURE_KEEP_ALIVE y // Add Feature: Keep-alive //FIXME: does not work correctly now #define Y_CONFIG_FEATUE_SENDFILE_CAN_ACCESS_ALL y // Add Feature: every file can be accessed (use carefully: security!!) //#define Y_CONFIG_FEATURE_CHROOT y // Add Feature: Use Change Root for Security //#define Y_CONFIG_FEATURE_HTTPD_USER y // Add Feature: Set User for yhttpd-Process - -// TODO build error page function -//#define Y_CONFIG_HAVE_HTTPD_ERRORPAGE y // Have an HTTPD Error Page +#define Y_CONFIG_BUILD_AS_DAEMON y // Build as a Daemon //----------------------------------------------------------------------------- // Define/Undefine Features forced by CONFIG_SYSTEM_xxx @@ -77,11 +66,7 @@ #undef Y_CONFIG_HAVE_SENDFILE // Sendfile does not work for SSL #endif -#ifdef CONFIG_SYSTEM_CYGWIN -#undef Y_CONFIG_FEATURE_CHECK_PORT_AUTORITY -#undef Y_CONFIG_HAVE_SENDFILE // No Sendfile under cygwin -#endif -#ifdef CONFIG_SYSTEM_TUXBOX +#if defined(CONFIG_SYSTEM_TUXBOX) || defined(CONFIG_SYSTEM_TUXBOX_COOLSTREAM) #define Y_CONFIG_FEATURE_UPLOAD y #define Y_CONFIG_USE_YPARSER y #define Y_CONFIG_USE_AUTHHOOK y @@ -95,139 +80,47 @@ // Configurations for systems/OSs <configure!> //============================================================================= //----------------------------------------------------------------------------- -// Configurations for LINUX +// Configurations for LINUX (Tuxbox dbox2, coolstream) //----------------------------------------------------------------------------- -#ifdef CONFIG_SYSTEM_LINUX -#define HTTPD_STANDARD_PORT 8080 -#define HTTPD_MAX_CONNECTIONS 3 -#define HTTPD_CONFIGDIR "/home/y" -#define HTTPD_CONFIGFILE HTTPD_CONFIGDIR "/yhttpd.conf" -#define HTTPD_REQUEST_LOG "/tmp/httpd_log" //TODO: delete every occurence -#define HTTPD_ERRORPAGE "/Y_ErrorPage.yhtm" -#define HTTPD_SENDFILE_EXT "htm:text/html,html:text/html,xml:text/xml,txt:text/plain,jpg:image/jpeg,jpeg:image/jpeg,gif:image/gif,png:image/png,bmp:image/bmp,css:text/css,js:text/plain,img:application/octet-stream,ico:image/x-icon,m3u:application/octet-stream,tar:application/octet-stream" -#define AUTHUSER "test" -#define AUTHPASSWORD "test1" -#define PRIVATEDOCUMENTROOT "/home/y/nhttpd-y" -#define PUBLICDOCUMENTROOT "/var/httpd" -#define HOSTEDDOCUMENTROOT "/mnt/hosted" - -#define SSL_PEMFILE HTTPD_CONFIGDIR "/server.pem" -#define SSL_CA_FILE HTTPD_CONFIGDIR "/cacert.pem" - -#define UPLOAD_TMP_FILE "/tmp/upload.tmp" -#define CACHE_DIR "/tmp/.cache" -#endif -//----------------------------------------------------------------------------- -// Configurations for WINDOWS (Cygwin) -//----------------------------------------------------------------------------- -#ifdef CONFIG_SYSTEM_CYGWIN -#define HTTPD_STANDARD_PORT 80 -#define HTTPD_MAX_CONNECTIONS 32 -#define HTTPD_CONFIGDIR "/usr/local/yweb" -#define HTTPD_CONFIGFILE HTTPD_CONFIGDIR "/yhttpd.conf" -#define HTTPD_REQUEST_LOG "/tmp/httpd_log" -#define HTTPD_ERRORPAGE "/Y_ErrorPage.yhtm" -#define HTTPD_SENDFILE_EXT "htm:text/html,html:text/html,xml:text/xml,txt:text/plain,jpg:image/jpeg,jpeg:image/jpeg,gif:image/gif,png:image/png,bmp:image/bmp,css:text/css,js:text/plain" - -#define AUTHUSER "test" -#define AUTHPASSWORD "test1" -#define PRIVATEDOCUMENTROOT "/cygdrive/d/Work/y/ws/nhttpd30/web" -#define PUBLICDOCUMENTROOT "/var/httpd" -#define HOSTEDDOCUMENTROOT "/mnt/hosted" - -#define SSL_PEMFILE HTTPD_CONFIGDIR "/server.pem" -#define SSL_CA_FILE HTTPD_CONFIGDIR "/cacert.pem" - -#define LOG_FILE "./yhhtpd.log" -#define LOG_FORMAT "CLF" - -#define UPLOAD_TMP_FILE "/tmp/upload.tmp" -#define CACHE_DIR "/tmp/.cache" -#endif -//----------------------------------------------------------------------------- -// Configurations for LINUX (Tuxbox dbox2) -//----------------------------------------------------------------------------- -#ifdef CONFIG_SYSTEM_TUXBOX #undef HTTPD_NAME #define HTTPD_NAME "nhttpd" #define HTTPD_STANDARD_PORT 80 #define HTTPD_MAX_CONNECTIONS 10 +#define HTTPD_REQUEST_LOG "/tmp/httpd_log" +#define SSL_PEMFILE HTTPD_CONFIGDIR "/server.pem" +#define SSL_CA_FILE HTTPD_CONFIGDIR "/cacert.pem" +#define LOG_FILE "/tmp/yhhtpd.log" +#define LOG_FORMAT "" +#define UPLOAD_TMP_FILE "/tmp/upload.tmp" +#define CACHE_DIR "/tmp/.cache" +#define HTTPD_ERRORPAGE "/Y_ErrorPage.yhtm" +#define HTTPD_SENDFILE_EXT "htm:text/html,html:text/html,xml:text/xml,txt:text/plain,jpg:image/jpeg,jpeg:image/jpeg,gif:image/gif,png:image/png,bmp:image/bmp,css:text/css,js:text/plain,img:application/octet-stream,ico:image/x-icon,m3u:application/octet-stream,tar:application/octet-stream,gz:text/x-gzip" +#define HTTPD_SENDFILE_ALL "false" +#define HTTPD_LANGUAGEDIR "languages" +#define HTTPD_DEFAULT_LANGUAGE "English" +#define AUTHUSER "root" + #define HTTPD_CONFIGDIR "/var/tuxbox/config" #define HTTPD_CONFIGFILE HTTPD_CONFIGDIR "/nhttpd.conf" -#define HTTPD_REQUEST_LOG "/tmp/httpd_log" -#define HTTPD_ERRORPAGE "/Y_ErrorPage.yhtm" -#define HTTPD_SENDFILE_EXT "htm:text/html,html:text/html,xml:text/xml,txt:text/plain,jpg:image/jpeg,jpeg:image/jpeg,gif:image/gif,png:image/png,bmp:image/bmp,css:text/css,js:text/plain,img:application/octet-stream,ico:image/x-icon,m3u:application/octet-stream" - -#define AUTHUSER "root" -#define AUTHPASSWORD "dbox2" -#define PRIVATEDOCUMENTROOT "/share/tuxbox/neutrino/httpd-y" #define PUBLICDOCUMENTROOT "/var/httpd" #define NEUTRINO_CONFIGFILE "/var/tuxbox/config/neutrino.conf" #define HOSTEDDOCUMENTROOT "/mnt/hosted" #define EXTRASDOCUMENTROOT "/mnt/hosted/extras" #define EXTRASDOCUMENTURL "/hosted/extras" #define ZAPITXMLPATH "/var/tuxbox/config/zapit" +#define TUXBOX_LOGOS_URL "" -#define SSL_PEMFILE HTTPD_CONFIGDIR "/server.pem" -#define SSL_CA_FILE HTTPD_CONFIGDIR "/cacert.pem" - -#define LOG_FILE "/tmp/yhhtpd.log" -#define LOG_FORMAT "" - -#define UPLOAD_TMP_FILE "/tmp/upload.tmp" -#define CACHE_DIR "/tmp/.cache" -#endif -//----------------------------------------------------------------------------- -// Configurations for AVM FritzBox -//----------------------------------------------------------------------------- -#ifdef CONFIG_SYSTEM_AVM -#define HTTPD_STANDARD_PORT 81 -#define HTTPD_MAX_CONNECTIONS 3 -#define HTTPD_CONFIGDIR "/tmp" -#define HTTPD_CONFIGFILE HTTPD_CONFIGDIR "/yhttpd.conf" -#define HTTPD_REQUEST_LOG "/tmp/httpd_log" -#define HTTPD_ERRORPAGE "/Y_ErrorPage.yhtm" -#define HTTPD_SENDFILE_EXT "htm:text/html,html:text/html,xml:text/xml,txt:text/plain,jpg:image/jpeg,jpeg:image/jpeg,gif:image/gif,png:image/png,bmp:image/bmp,css:text/css,js:text/plain" - -#define AUTHUSER "root" -#define AUTHPASSWORD "oxmox" -#define PRIVATEDOCUMENTROOT "/tmp/web" //FIXME: Test -#define PUBLICDOCUMENTROOT "/var/httpd" -#define HOSTEDDOCUMENTROOT "/mnt/hosted" - -#define SSL_PEMFILE HTTPD_CONFIGDIR "/server.pem" -#define SSL_CA_FILE HTTPD_CONFIGDIR "/cacert.pem" - -#define UPLOAD_TMP_FILE "/tmp/upload.tmp" -#define CACHE_DIR "/tmp/.cache" +// switch for Box differences +#ifdef CONFIG_SYSTEM_TUXBOX +#define AUTHPASSWORD "dbox2" +#define PRIVATEDOCUMENTROOT "/share/tuxbox/neutrino/httpd-y" #endif -//----------------------------------------------------------------------------- -// Configurations for Maxtor Shared Storage -//----------------------------------------------------------------------------- -#ifdef CONFIG_SYSTEM_MSS -#define HTTPD_STANDARD_PORT 81 -#define HTTPD_MAX_CONNECTIONS 3 -#define HTTPD_CONFIGDIR "/tmp" -#define HTTPD_CONFIGFILE HTTPD_CONFIGDIR "/yhttpd.conf" -#define HTTPD_REQUEST_LOG "/tmp/httpd_log" -#define HTTPD_ERRORPAGE "/Y_ErrorPage.yhtm" -#define HTTPD_SENDFILE_EXT "htm:text/html,html:text/html,xml:text/xml,txt:text/plain,jpg:image/jpeg,jpeg:image/jpeg,gif:image/gif,png:image/png,bmp:image/bmp,css:text/css,js:text/plain" - -#define AUTHUSER "root" -#define AUTHPASSWORD "oxmox" -#define PRIVATEDOCUMENTROOT "/shares/mss-hdd/Install/web" -#define PUBLICDOCUMENTROOT "/var/httpd" -#define HOSTEDDOCUMENTROOT "/mnt/hosted" - -#define SSL_PEMFILE HTTPD_CONFIGDIR "/server.pem" -#define SSL_CA_FILE HTTPD_CONFIGDIR "/cacert.pem" - -#define UPLOAD_TMP_FILE "/tmp/upload.tmp" -#define CACHE_DIR "/tmp/.cache" +#ifdef CONFIG_SYSTEM_TUXBOX_COOLSTREAM +#define AUTHPASSWORD "coolstream" +#define PRIVATEDOCUMENTROOT "/share/tuxbox/neutrino/httpd" +#undef Y_CONFIG_BUILD_AS_DAEMON // No Daemon #endif - - //----------------------------------------------------------------------------- // Aggregated definitions //----------------------------------------------------------------------------- diff --git a/src/nhttpd/yhttpd.cpp b/src/nhttpd/yhttpd.cpp index 8336c201d..3adf7489a 100644 --- a/src/nhttpd/yhttpd.cpp +++ b/src/nhttpd/yhttpd.cpp @@ -6,7 +6,6 @@ // system #include <csignal> #include <unistd.h> -#include <cstdio> #include <cstdlib> #include <pwd.h> #include <grp.h> @@ -15,6 +14,7 @@ // yhttpd #include "yconfig.h" #include "ylogging.h" +#include "ylanguage.h" #include "yhook.h" #ifdef Y_CONFIG_USE_YPARSER @@ -37,11 +37,6 @@ CStringList Cyhttpd::ConfigList; static CmAuth *auth = NULL; #endif -#ifdef Y_CONFIG_USE_TESTHOOK -#include "mod_testhook.h" -static CTesthook *testhook = NULL; -#endif - #ifdef Y_CONFIG_USE_WEBLOG #include "mod_weblog.h" static CmWebLog *weblog = NULL; @@ -58,7 +53,7 @@ static CmodCache mod_cache; // static instance #endif //----------------------------------------------------------------------------- -#ifdef CONFIG_SYSTEM_TUXBOX +#if defined(CONFIG_SYSTEM_TUXBOX) || defined(CONFIG_SYSTEM_TUXBOX_COOLSTREAM) #include "neutrinoapi.h" static CNeutrinoAPI *NeutrinoAPI; #endif @@ -67,10 +62,10 @@ static CNeutrinoAPI *NeutrinoAPI; // Main: Main Entry, Command line passing, Webserver Instance creation & Loop //============================================================================= volatile sig_atomic_t Cyhttpd::sig_do_shutdown = 0; -#if 0 //----------------------------------------------------------------------------- // Signal Handling //----------------------------------------------------------------------------- +#ifdef Y_CONFIG_BUILD_AS_DAEMON static void sig_catch(int msignal) { aprintf("!!! SIGNAL !!! :%d!\n",msignal); @@ -100,6 +95,7 @@ static void sig_catch(int msignal) } #endif +//----------------------------------------------------------------------------- void yhttpd_reload_config() { if (yhttpd) @@ -108,18 +104,12 @@ void yhttpd_reload_config() //----------------------------------------------------------------------------- // Main Entry //----------------------------------------------------------------------------- -//int main(int argc, char **argv) -void * nhttpd_main_thread(void */*data*/) +#ifndef Y_CONFIG_BUILD_AS_DAEMON +void * nhttpd_main_thread(void *) { - //int argc = 1; - //char **argv; - //bool do_fork = false; - pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0); - aprintf("Webserver %s tid %ld\n", WEBSERVERNAME, syscall(__NR_gettid)); yhttpd = new Cyhttpd(); - //CLogging::getInstance()->setDebug(true); //CLogging::getInstance()->LogLevel = 9; if(!yhttpd) @@ -128,52 +118,6 @@ void * nhttpd_main_thread(void */*data*/) return (void *) EXIT_FAILURE; } yhttpd->flag_threading_off = true; -#if 0 - for (int i = 1; i < argc; i++) - { - if ((!strncmp(argv[i], "-d", 2)) || (!strncmp(argv[i], "--debug", 7))) - { - CLogging::getInstance()->setDebug(true); - do_fork = false; - } - else if ((!strncmp(argv[i], "-f", 2)) || (!strncmp(argv[i], "--fork", 6)) || (!strncmp(argv[i], "-nf", 3))) - { - do_fork = false; - } - else if ((!strncmp(argv[i], "-h", 2)) || (!strncmp(argv[i], "--help", 6))) - { - yhttpd->usage(stdout); - return (void *) EXIT_SUCCESS; - } - else if ((!strncmp(argv[i], "-v", 2)) || (!strncmp(argv[i],"--version", 9))) - { - yhttpd->version(stdout); - return (void *) EXIT_SUCCESS; - } - else if ((!strncmp(argv[i], "-t", 2)) || (!strncmp(argv[i],"--thread-off", 12))) - { - yhttpd->flag_threading_off = true; - } - else if ((!strncmp(argv[i], "-l", 2)) ) - { - if(argv[i][2] >= '0' && argv[i][2] <= '9') - CLogging::getInstance()->LogLevel = (argv[i][2]-'0'); - } - else - { - yhttpd->usage(stderr); - return (void *) EXIT_FAILURE; - } - } - // setup signal catching (subscribing) - //signal(SIGPIPE, sig_catch); - //signal(SIGINT, sig_catch); - //signal(SIGHUP, sig_catch); - //signal(SIGUSR1, sig_catch); - //signal(SIGTERM, sig_catch); - //signal(SIGCLD, SIG_IGN); -// signal(SIGALRM, sig_catch); -#endif yhttpd->hooks_attach(); yhttpd->ReadConfig(); @@ -190,7 +134,98 @@ void * nhttpd_main_thread(void */*data*/) aprintf("Main end\n"); return (void *) EXIT_SUCCESS; } +#endif +#ifdef Y_CONFIG_BUILD_AS_DAEMON +int main(int argc, char **argv) +{ + aprintf("Webserver %s\n", WEBSERVERNAME); + bool do_fork = true; + yhttpd = new Cyhttpd(); + if(!yhttpd) + { + aprintf("Error initializing WebServer\n"); + return EXIT_FAILURE; + } + for (int i = 1; i < argc; i++) + { + if ((!strncmp(argv[i], "-d", 2)) || (!strncmp(argv[i], "--debug", 7))) + { + CLogging::getInstance()->setDebug(true); + do_fork = false; + } + else if ((!strncmp(argv[i], "-f", 2)) || (!strncmp(argv[i], "--fork", 6))) + { + do_fork = false; + } + else if ((!strncmp(argv[i], "-h", 2)) || (!strncmp(argv[i], "--help", 6))) + { + yhttpd->usage(stdout); + return EXIT_SUCCESS; + } + else if ((!strncmp(argv[i], "-v", 2)) || (!strncmp(argv[i],"--version", 9))) + { + yhttpd->version(stdout); + return EXIT_SUCCESS; + } + else if ((!strncmp(argv[i], "-t", 2)) || (!strncmp(argv[i],"--thread-off", 12))) + { + yhttpd->flag_threading_off = true; + } + else if ((!strncmp(argv[i], "-l", 2)) ) + { + if(argv[i][2] >= '0' && argv[i][2] <= '9') + CLogging::getInstance()->LogLevel = (argv[i][2]-'0'); + } + else + { + yhttpd->usage(stderr); + return EXIT_FAILURE; + } + } + // setup signal catching (subscribing) + signal(SIGPIPE, sig_catch); + signal(SIGINT, sig_catch); + signal(SIGHUP, sig_catch); + signal(SIGUSR1, sig_catch); + signal(SIGTERM, sig_catch); + signal(SIGCLD, SIG_IGN); +// signal(SIGALRM, sig_catch); + yhttpd->hooks_attach(); + yhttpd->ReadConfig(); + if(yhttpd->Configure()) + { + // Start Webserver: fork ist if not in debug mode + aprintf("Webserver starting...\n"); + if (do_fork) + { + log_level_printf(9,"do fork\n"); + switch (fork()) { + case -1: + dperror("fork"); + return -1; + case 0: + break; + default: + return EXIT_SUCCESS; + } + + if (setsid() == -1) + { + dperror("Error setsid"); + return EXIT_FAILURE; + } + } + dprintf("Start in Debug-Mode\n"); // non forked debugging loop + + yhttpd->run(); + } + delete yhttpd; + + aprintf("Main end\n"); + return EXIT_SUCCESS; +} +#endif //============================================================================= // Class yhttpd //============================================================================= @@ -348,7 +383,7 @@ void Cyhttpd::hooks_attach() CyhookHandler::attach(testhook); #endif -#ifdef CONFIG_SYSTEM_TUXBOX +#if defined(CONFIG_SYSTEM_TUXBOX) || defined(CONFIG_SYSTEM_TUXBOX_COOLSTREAM) NeutrinoAPI = new CNeutrinoAPI(); CyhookHandler::attach(NeutrinoAPI->NeutrinoYParser); CyhookHandler::attach(NeutrinoAPI->ControlAPI); @@ -387,7 +422,7 @@ void Cyhttpd::hooks_detach() delete testhook; #endif -#ifdef CONFIG_SYSTEM_TUXBOX +#if defined(CONFIG_SYSTEM_TUXBOX) || defined(CONFIG_SYSTEM_TUXBOX_COOLSTREAM) CyhookHandler::detach(NeutrinoAPI->NeutrinoYParser); #else #ifdef Y_CONFIG_USE_YPARSER @@ -423,13 +458,14 @@ void Cyhttpd::ReadConfig(void) Config->loadConfig(HTTPD_CONFIGFILE); // convert old config files if(have_config) - if(Config->getInt32("Port", 0) != 0) + { + if(Config->getInt32("configfile.version",0) == 0) { CConfigFile OrgConfig = *Config; Config->clear(); Config->setInt32("server.log.loglevel", OrgConfig.getInt32("LogLevel", 0)); - Config->setString("configfile.version", "1"); + Config->setInt32("configfile.version", CONF_VERSION); Config->setString("webserver.websites", "WebsiteMain"); Config->setBool("webserver.threading", OrgConfig.getBool("THREADS", true)); Config->setInt32("WebsiteMain.port",OrgConfig.getInt32("Port", HTTPD_STANDARD_PORT)); @@ -451,6 +487,21 @@ void Cyhttpd::ReadConfig(void) Config->saveConfig(HTTPD_CONFIGFILE); } + if (Config->getInt32("configfile.version") < 2) + { + Config->setString("mod_sendfile.mime_types", HTTPD_SENDFILE_EXT); + Config->setInt32("configfile.version", CONF_VERSION); + Config->setString("mod_sendfile.sendAll","false"); + Config->saveConfig(HTTPD_CONFIGFILE); + } + if (Config->getInt32("configfile.version") < 4) + { + Config->setInt32("configfile.version", CONF_VERSION); + Config->setString("Language.selected", HTTPD_DEFAULT_LANGUAGE); + Config->setString("Language.directory", HTTPD_LANGUAGEDIR); + Config->saveConfig(HTTPD_CONFIGFILE); + } + } // configure debugging & logging if(CLogging::getInstance()->LogLevel == 0) CLogging::getInstance()->LogLevel = Config->getInt32("server.log.loglevel", 0); @@ -460,7 +511,7 @@ void Cyhttpd::ReadConfig(void) // informational use ConfigList["WebsiteMain.port"]= itoa(Config->getInt32("WebsiteMain.port", HTTPD_STANDARD_PORT)); ConfigList["webserver.threading"]= Config->getString("webserver.threading", "true"); - ConfigList["configfile.version"]= Config->getString("configfile.version", "1"); + ConfigList["configfile.version"]= Config->getInt32("configfile.version", CONF_VERSION); ConfigList["server.log.loglevel"]= itoa(Config->getInt32("server.log.loglevel", 0)); ConfigList["server.no_keep-alive_ips"]= Config->getString("server.no_keep-alive_ips", ""); webserver->conf_no_keep_alive_ips = Config->getStringVector("server.no_keep-alive_ips"); @@ -483,6 +534,10 @@ void Cyhttpd::ReadConfig(void) ConfigList["server.group_name"]= Config->getString("server.group_name", ""); ConfigList["server.chroot"]= Config->getString("server.chroot", ""); + // language + ConfigList["Language.directory"]=Config->getString("Language.directory", HTTPD_LANGUAGEDIR); + ConfigList["Language.selected"]=Config->getString("Language.selected", HTTPD_DEFAULT_LANGUAGE); + yhttpd->ReadLanguage(); // Read App specifig settings by Hook CyhookHandler::Hooks_ReadConfig(Config, ConfigList); @@ -493,3 +548,13 @@ void Cyhttpd::ReadConfig(void) log_level_printf(3,"ReadConfig End\n"); delete Config; } +//----------------------------------------------------------------------------- +// Read Webserver Configurationfile for languages +//----------------------------------------------------------------------------- +void Cyhttpd::ReadLanguage(void) +{ + // Init Class vars + CLanguage *lang = CLanguage::getInstance(); + log_level_printf(3,"ReadLanguage:%s\n",ConfigList["Language.selected"].c_str()); + lang->setLanguage(ConfigList["Language.selected"]); +} diff --git a/src/nhttpd/yhttpd.h b/src/nhttpd/yhttpd.h index 507ad259c..c4b31414a 100644 --- a/src/nhttpd/yhttpd.h +++ b/src/nhttpd/yhttpd.h @@ -12,6 +12,7 @@ #define __yhttpd_h__ // system #include <signal.h> +#include <stdlib.h> // yhttpd #include "yconfig.h" #include "ytypes_globals.h" @@ -22,7 +23,7 @@ class Cyhttpd { private: - CWebserver *webserver; // Aggregation of Webserver (now: only one) + CWebserver *webserver; // Aggregation of Webserver (now: only one) public: bool flag_threading_off; // switch of Connection Threading @@ -45,6 +46,7 @@ public: void hooks_attach(); // Add a Hook-Class to HookList void hooks_detach(); // Remove a Hook-Class from HookList void ReadConfig(void); // Read the config file for the webserver + void ReadLanguage(void); // Read Language Files }; #endif // __yhttpd_h__ diff --git a/src/nhttpd/yhttpd_core/Makefile.am b/src/nhttpd/yhttpd_core/Makefile.am index 1cd16c57f..3655b0394 100644 --- a/src/nhttpd/yhttpd_core/Makefile.am +++ b/src/nhttpd/yhttpd_core/Makefile.am @@ -13,6 +13,6 @@ AM_CPPFLAGS = -fno-rtti -fno-exceptions noinst_LIBRARIES = libyhttpd.a libyhttpd_a_SOURCES = \ - ylogging.cpp helper.cpp \ + ylogging.cpp helper.cpp ylanguage.cpp\ ywebserver.cpp yconnection.cpp yrequest.cpp yresponse.cpp yhook.cpp ysocket.cpp diff --git a/src/nhttpd/yhttpd_core/helper.cpp b/src/nhttpd/yhttpd_core/helper.cpp index 940b4d84f..e4f7df37b 100644 --- a/src/nhttpd/yhttpd_core/helper.cpp +++ b/src/nhttpd/yhttpd_core/helper.cpp @@ -73,7 +73,7 @@ std::string timeString(time_t time) return std::string("??:??"); } //------------------------------------------------------------------------- -// Printf and return formatet String. Buffer-save! +// Printf and return formatet String. Buffer-save! // max length up to bufferlen -> then snip //------------------------------------------------------------------------- #define bufferlen 4*1024 @@ -82,7 +82,7 @@ std::string string_printf(const char *fmt, ...) char buffer[bufferlen]; va_list arglist; va_start( arglist, fmt ); - // if(arglist) + if(arglist) vsnprintf( buffer, bufferlen, fmt, arglist ); va_end(arglist); return std::string(buffer); @@ -93,7 +93,7 @@ std::string string_printf(const char *fmt, ...) //------------------------------------------------------------------------- bool ySplitString(std::string str, std::string delimiter, std::string& left, std::string& right) { - unsigned int pos; + std::string::size_type pos; if ((pos = str.find_first_of(delimiter)) != std::string::npos) { left = str.substr(0, pos); @@ -112,7 +112,7 @@ bool ySplitString(std::string str, std::string delimiter, std::string& left, std //------------------------------------------------------------------------- bool ySplitStringExact(std::string str, std::string delimiter, std::string& left, std::string& right) { - unsigned int pos; + std::string::size_type pos; if ((pos = str.find(delimiter)) != std::string::npos) { left = str.substr(0, pos); @@ -131,7 +131,7 @@ bool ySplitStringExact(std::string str, std::string delimiter, std::string& left //------------------------------------------------------------------------- bool ySplitStringLast(std::string str, std::string delimiter, std::string& left, std::string& right) { - unsigned int pos; + std::string::size_type pos; if ((pos = str.find_last_of(delimiter)) != std::string::npos) { left = str.substr(0, pos); @@ -165,7 +165,7 @@ CStringArray ySplitStringVector(std::string str, std::string delimiter) //------------------------------------------------------------------------- // trim whitespaces //------------------------------------------------------------------------- -std::string trim(std::string const& source, char const* delims) +std::string trim(std::string const& source, char const* delims) { std::string result(source); std::string::size_type index = result.find_last_not_of(delims); @@ -180,6 +180,19 @@ std::string trim(std::string const& source, char const* delims) return result; } //------------------------------------------------------------------------- +// replace all occurrences find_what +//------------------------------------------------------------------------- +void replace(std::string &str, const std::string &find_what, const std::string &replace_with) +{ + std::string::size_type pos=0; + while((pos=str.find(find_what, pos))!=std::string::npos) + { + str.erase(pos, find_what.length()); + str.insert(pos, replace_with); + pos+=replace_with.length(); + } +} +//------------------------------------------------------------------------- // equal-function for case insensitive compare //------------------------------------------------------------------------- bool nocase_compare (char c1, char c2) @@ -228,7 +241,7 @@ std::string decodeString(std::string encodedString) std::string encodeString(std::string decodedString) { unsigned int len = sizeof(char) * decodedString.length()*5 + 1; - std::string result( len, '\0' ); + std::string result( len, '\0' ); char *newString = (char *)result.c_str(); char *dstring = (char *)decodedString.c_str(); char one_char; @@ -236,9 +249,9 @@ std::string encodeString(std::string decodedString) { while((one_char = *dstring++)) /* use the null character as a loop terminator */ { - if(isalnum(one_char)) + if(isalnum(one_char)) *newString++ = one_char; - else + else newString += sprintf(newString, "&#%d;", (unsigned char) one_char); } diff --git a/src/nhttpd/yhttpd_core/helper.h b/src/nhttpd/yhttpd_core/helper.h index d7e68efd9..30f44a210 100644 --- a/src/nhttpd/yhttpd_core/helper.h +++ b/src/nhttpd/yhttpd_core/helper.h @@ -30,6 +30,7 @@ std::string string_tolower(std::string str); // String Helpers //----------------------------------------------------------------------------- std::string trim(std::string const& source, char const* delims = " \t\r\n"); +void replace(std::string &str, const std::string &find_what, const std::string &replace_with); std::string string_printf(const char *fmt, ...); bool ySplitString(std::string str, std::string delimiter, std::string& left, std::string& right); bool ySplitStringExact(std::string str, std::string delimiter, std::string& left, std::string& right); diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index a49ba0222..94fa92d01 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -6,6 +6,7 @@ #include <cstdarg> #include <cstdio> #include <cstring> +#include <strings.h> // yhttpd #include "yhook.h" @@ -18,7 +19,7 @@ THookList CyhookHandler::HookList; //============================================================================= -// Hook Handling +// Hook Handling //============================================================================= //----------------------------------------------------------------------------- // Hook Dispatcher for Session Hooks @@ -65,8 +66,8 @@ THandleStatus CyhookHandler::Hooks_PrepareResponse() log_level_printf(8,"PrepareResponse Hook-List Result:\n%s\n", yresult.c_str()); status = _status; return _status; -} - +} + //----------------------------------------------------------------------------- // Hook Dispatcher for Server based Hooks // Execute every Hook in HookList until State change != HANDLED_NONE and @@ -88,7 +89,7 @@ THandleStatus CyhookHandler::Hooks_ReadConfig(CConfigFile *Config, CStringList & } log_level_printf(4,"ReadConfig Hook-List End\n"); return _status; -} +} //----------------------------------------------------------------------------- // Hook Dispatcher for EndConnection //----------------------------------------------------------------------------- @@ -156,7 +157,7 @@ THandleStatus CyhookHandler::Hooks_UploadReady(const std::string& Filename) //============================================================================= // Output helpers //============================================================================= -void CyhookHandler::session_init(CStringList _ParamList, CStringList _UrlData, CStringList _HeaderList, +void CyhookHandler::session_init(CStringList _ParamList, CStringList _UrlData, CStringList _HeaderList, CStringList& _ConfigList, THttp_Method _Method, bool _keep_alive) { ParamList = _ParamList; @@ -210,7 +211,7 @@ void CyhookHandler::session_init(CStringList _ParamList, CStringList _UrlData, C // | Server ; implemented // | Vary ; not implemented // | WWW-Authenticate ; implemented (by mod_auth and SendHeader) -// +// // entity-header = Allow ; not implemented // | Content-Encoding ; not implemented // | Content-Language ; not implemented @@ -223,12 +224,12 @@ void CyhookHandler::session_init(CStringList _ParamList, CStringList _UrlData, C // | Last-Modified ; implemented for static files // | extension-header // -// extension-header = message-header +// extension-header = message-header //============================================================================= std::string CyhookHandler::BuildHeader(bool cache) { std::string result=""; - + const char *responseString = ""; const char *infoString = 0; @@ -256,7 +257,7 @@ std::string CyhookHandler::BuildHeader(bool cache) // Status HTTP_*_TEMPORARILY (redirection) result += string_printf("Location: %s\r\n",NewURL.c_str()); // NO break HERE !!! - + default: time_t timer = time(0); char timeStr[80]; @@ -285,26 +286,29 @@ std::string CyhookHandler::BuildHeader(bool cache) #else result += "Connection: close\r\n"; #endif + // gzipped ? + if(UrlData["fileext"] == "gz") + result += "Content-Encoding: gzip\r\n"; // content-len, last-modified if(httpStatus == HTTP_NOT_MODIFIED ||httpStatus == HTTP_NOT_FOUND) result += "Content-Length: 0\r\n"; else if(GetContentLength() >0) - { + { time_t mod_time = time(NULL); if(LastModified != (time_t)-1) mod_time = LastModified; - + strftime(timeStr, sizeof(timeStr), RFC1123FMT, gmtime(&mod_time)); result += string_printf("Last-Modified: %s\r\nContent-Length: %ld\r\n", timeStr, GetContentLength()); - } + } result += "\r\n"; // End of Header break; } // Body if (Method != M_HEAD) - switch (httpStatus) - { + switch (httpStatus) + { case HTTP_OK: case HTTP_NOT_MODIFIED: case HTTP_CONTINUE: @@ -317,13 +321,13 @@ std::string CyhookHandler::BuildHeader(bool cache) case HTTP_MOVED_TEMPORARILY: case HTTP_MOVED_PERMANENTLY: result += "<html><head><title>Object moved</title></head><body>"; - result += string_printf("302 : Object moved.<br/>If you dont get redirected click <a href=\"%s\">here</a></body></html>\n",NewURL.c_str()); - break; + result += string_printf("302 : Object moved.<br/>If you dont get redirected click <a href=\"%s\">here</a></body></html>\n",NewURL.c_str()); + break; default: // Error pages - break; - } + break; + } return result; } diff --git a/src/nhttpd/yhttpd_core/yhook.h b/src/nhttpd/yhttpd_core/yhook.h index 1ee4302b3..e40d1d562 100644 --- a/src/nhttpd/yhttpd_core/yhook.h +++ b/src/nhttpd/yhttpd_core/yhook.h @@ -94,13 +94,13 @@ public: virtual std::string getHookVersion(void) {return std::string("0.0.0");} virtual std::string getHookName(void) {return std::string("Abstract Hook Class");} // CWebserverConnection based hooks - virtual THandleStatus Hook_PrepareResponse(CyhookHandler */*hh*/){return HANDLED_NONE;}; - virtual THandleStatus Hook_SendResponse(CyhookHandler */*hh*/){return HANDLED_NONE;}; - virtual THandleStatus Hook_EndConnection(CyhookHandler */*hh*/){return HANDLED_NONE;} - virtual THandleStatus Hook_UploadSetFilename(CyhookHandler */*hh*/, std::string &/*Filename*/){return HANDLED_NONE;} - virtual THandleStatus Hook_UploadReady(CyhookHandler */*hh*/, std::string /*Filename*/){return HANDLED_NONE;} + virtual THandleStatus Hook_PrepareResponse(CyhookHandler *){return HANDLED_NONE;}; + virtual THandleStatus Hook_SendResponse(CyhookHandler *){return HANDLED_NONE;}; + virtual THandleStatus Hook_EndConnection(CyhookHandler *){return HANDLED_NONE;} + virtual THandleStatus Hook_UploadSetFilename(CyhookHandler *, std::string &){return HANDLED_NONE;} + virtual THandleStatus Hook_UploadReady(CyhookHandler *, std::string){return HANDLED_NONE;} // Cyhttpd based hooks - virtual THandleStatus Hook_ReadConfig(CConfigFile */*Config*/, CStringList &/*ConfigList*/){return HANDLED_NONE;}; + virtual THandleStatus Hook_ReadConfig(CConfigFile *, CStringList &){return HANDLED_NONE;}; }; //----------------------------------------------------------------------------- diff --git a/src/nhttpd/yhttpd_core/ylanguage.cpp b/src/nhttpd/yhttpd_core/ylanguage.cpp new file mode 100644 index 000000000..2f2faf328 --- /dev/null +++ b/src/nhttpd/yhttpd_core/ylanguage.cpp @@ -0,0 +1,92 @@ +//============================================================================= +// YHTTPD +// Language +//============================================================================= + +// c +#include <cstdarg> +#include <cstdio> +#include <cstdlib> + +// yhttpd +#include "yconfig.h" +#include "yhttpd.h" +#include "ytypes_globals.h" +#include "ylanguage.h" +#include "yconnection.h" +//============================================================================= +// Instance Handling - like Singelton Pattern +//============================================================================= +//----------------------------------------------------------------------------- +// Init as Singelton +//----------------------------------------------------------------------------- +CLanguage* CLanguage::instance = NULL; +CConfigFile* CLanguage::DefaultLanguage = NULL; +CConfigFile* CLanguage::ConfigLanguage = NULL; +std::string CLanguage::language = ""; +std::string CLanguage::language_dir = ""; +//----------------------------------------------------------------------------- +// There is only one Instance +//----------------------------------------------------------------------------- +CLanguage *CLanguage::getInstance(void){ + if (!instance) + instance = new CLanguage(); + return instance; +} + +//----------------------------------------------------------------------------- +void CLanguage::deleteInstance(void){ + if (instance) + delete instance; + instance = NULL; +} + +//----------------------------------------------------------------------------- +// Constructor +//----------------------------------------------------------------------------- +CLanguage::CLanguage(void) +{ + DefaultLanguage = new CConfigFile(','); + ConfigLanguage = new CConfigFile(','); + language = ""; + language_dir =getLanguageDir(); +} + +//----------------------------------------------------------------------------- +CLanguage::~CLanguage(void) +{ + delete DefaultLanguage; + delete ConfigLanguage; +} + +//============================================================================= + +//----------------------------------------------------------------------------- +void CLanguage::setLanguage(std::string _language){ + language=_language; + ConfigLanguage->loadConfig(language_dir + "/" + _language); + DefaultLanguage->loadConfig(language_dir + "/" + HTTPD_DEFAULT_LANGUAGE); +} + +//----------------------------------------------------------------------------- +// return translation for "id" if not found use default language +//----------------------------------------------------------------------------- +std::string CLanguage::getTranslation(std::string id){ + std::string trans=ConfigLanguage->getString(id,""); + if(trans=="") + trans=DefaultLanguage->getString(id,""); + return trans; +} +//----------------------------------------------------------------------------- +// Find language directory +//----------------------------------------------------------------------------- +std::string CLanguage::getLanguageDir(void){ + std::string tmpfilename = "/"+Cyhttpd::ConfigList["Language.directory"],dir=""; + + if( access(std::string(Cyhttpd::ConfigList["PublicDocumentRoot"] + tmpfilename).c_str(),4) == 0) + dir = Cyhttpd::ConfigList["PublicDocumentRoot"] + tmpfilename; + else if(access(std::string(Cyhttpd::ConfigList["PrivatDocumentRoot"] + tmpfilename).c_str(),4) == 0) + dir = Cyhttpd::ConfigList["PrivatDocumentRoot"] + tmpfilename; + return dir; +} + diff --git a/src/nhttpd/yhttpd_core/ylanguage.h b/src/nhttpd/yhttpd_core/ylanguage.h new file mode 100644 index 000000000..3ba368f7c --- /dev/null +++ b/src/nhttpd/yhttpd_core/ylanguage.h @@ -0,0 +1,44 @@ +//============================================================================= +// YHTTPD +// Language +//============================================================================= +#ifndef __yhttpd_language_h__ +#define __yhttpd_language_h__ + +#include <stdlib.h> +#include <configfile.h> +// yhttpd +#include "yconfig.h" +#include "ytypes_globals.h" +#include "ywebserver.h" + +// forward declaration +class CWebserverConnection; + +class CLanguage +{ + protected: + static CLanguage *instance; + CLanguage(void); + ~CLanguage(void); + + static CConfigFile *DefaultLanguage; + static CConfigFile *ConfigLanguage; + + public: + // Instance Handling + static CLanguage *getInstance(void); + static void deleteInstance(void); + + // Language + static std::string language; + static std::string language_dir; + + void setLanguage(std::string _language); + std::string getLanguage(void) {return language;}; + std::string getLanguageDir(void); + + std::string getTranslation(std::string id); +}; + +#endif /* __yttpd_language_h__ */ diff --git a/src/nhttpd/yhttpd_core/ylogging.cpp b/src/nhttpd/yhttpd_core/ylogging.cpp index d88d98311..eab5a352c 100644 --- a/src/nhttpd/yhttpd_core/ylogging.cpp +++ b/src/nhttpd/yhttpd_core/ylogging.cpp @@ -81,14 +81,15 @@ void CLogging::printf ( const char *fmt, ... ) va_list arglist; va_start( arglist, fmt ); - // if(arglist) + if(arglist) vsnprintf( buffer, bufferlen, fmt, arglist ); va_end(arglist); pthread_mutex_lock( &Log_mutex ); ::printf(buffer); - if(LogToFile) - usleep(0); //FIXME Logging to File + if(LogToFile) { + ; //FIXME Logging to File + } pthread_mutex_unlock( &Log_mutex ); } diff --git a/src/nhttpd/yhttpd_core/yrequest.cpp b/src/nhttpd/yhttpd_core/yrequest.cpp index aae302ccf..a95811ee7 100644 --- a/src/nhttpd/yhttpd_core/yrequest.cpp +++ b/src/nhttpd/yhttpd_core/yrequest.cpp @@ -18,7 +18,7 @@ // c++ #include <cstdarg> #include <cstdio> -#include <string.h> +#include <cstring> #include <cstdlib> #include <errno.h> // system @@ -40,7 +40,7 @@ CWebserverRequest::CWebserverRequest(CWebserver *pWebserver) } //============================================================================= -// Parsing Request +// Parsing Request //============================================================================= //----------------------------------------------------------------------------- // Main Request Parsing @@ -80,14 +80,14 @@ bool CWebserverRequest::HandleRequest(void) if(Connection->Method == M_GET || Connection->Method == M_HEAD) { std::string tmp_line; - //read header (speed up: read rest of request in blockmode) + //read header (speed up: read rest of request in blockmode) tmp_line = Connection->sock->ReceiveBlock(); if(!Connection->sock->isValid) { Connection->Response.SendError(HTTP_INTERNAL_SERVER_ERROR); return false; } - + if(tmp_line == "") { Connection->Response.SendError(HTTP_INTERNAL_SERVER_ERROR); @@ -97,12 +97,12 @@ bool CWebserverRequest::HandleRequest(void) } // Other Methods if(Connection->Method == M_DELETE || Connection->Method == M_PUT || Connection->Method == M_TRACE) - { + { //todo: implement aprintf("HTTP Method not implemented :%d\n",Connection->Method); Connection->Response.SendError(HTTP_NOT_IMPLEMENTED); return false; - } + } // handle POST (read header & body) if(Connection->Method == M_POST) { @@ -118,7 +118,7 @@ bool CWebserverRequest::HandleRequest(void) // Parse the start-line // from RFC2616 / 5.1 Request-Line (start-line): // Request-Line = Method SP Request-URI SP HTTP-Version CRLF (SP=Space) -// +// // Determine Reqest-Method, URL, HTTP-Version and Split Parameters // Split URL into path, filename, fileext .. UrlData[] //----------------------------------------------------------------------------- @@ -161,7 +161,7 @@ bool CWebserverRequest::ParseStartLine(std::string start_line) // attribute = token // value = token | quoted-string // -// If parameter attribute is multiple times given, the values are stored like this: +// If parameter attribute is multiple times given, the values are stored like this: // <attribute>=<value1>,<value2>,..,<value n> //----------------------------------------------------------------------------- bool CWebserverRequest::ParseParams(std::string param_string) @@ -175,7 +175,7 @@ bool CWebserverRequest::ParseParams(std::string param_string) ende = true; if(ySplitStringExact(param,"=",name,value)) { - value = trim(value); + value = trim(decodeString(value)); if(ParameterList[name].empty()) ParameterList[name] = value; else @@ -228,7 +228,7 @@ bool CWebserverRequest::ParseHeader(std::string header) void CWebserverRequest::analyzeURL(std::string url) { ParameterList.clear(); - // URI decode + // URI decode url = decodeString(url); url = trim(url, "\r\n"); // non-HTTP-Standard: allow \r or \n in URL. Delete it. UrlData["fullurl"] = url; @@ -237,7 +237,7 @@ void CWebserverRequest::analyzeURL(std::string url) ParseParams(UrlData["paramstring"]); // split params to ParameterList else // No Params UrlData["url"] = url; - + if(!ySplitStringLast(UrlData["url"],"/",UrlData["path"],UrlData["filename"])) { UrlData["path"] = "/"; // Set "/" if not contained @@ -258,7 +258,7 @@ void CWebserverRequest::analyzeURL(std::string url) bool CWebserverRequest::HandlePost() { //read header: line by line - std::string raw_header, tmp_line; + std::string raw_header, tmp_line; do { tmp_line = Connection->sock->ReceiveLine(); @@ -306,11 +306,13 @@ bool CWebserverRequest::HandlePost() std::string post_header; // get message-body post_header = Connection->sock->ReceiveBlock(); - if(post_header.length() < content_len) + while(post_header.length() < content_len) { - aprintf("POST form less data then expected\n"); + post_header += Connection->sock->ReceiveBlock(); +/* aprintf("POST form less data then expected\n"); Connection->Response.SendError(HTTP_INTERNAL_SERVER_ERROR); return false; +*/ } // parse the params in post_header (message-body) an add them to ParameterList ParseParams(post_header); @@ -320,51 +322,51 @@ bool CWebserverRequest::HandlePost() //----------------------------------------------------------------------------- // POST multipart ! FILE UPLOAD! // -// No 'Content-type: multipart/mixed' now supported +// No 'Content-type: multipart/mixed' now supported // designed for recursion for different boundaries. // // from RFC 1867: // 2. HTML forms with file submission -// +// // The current HTML specification defines eight possible values for the // attribute TYPE of an INPUT element: CHECKBOX, HIDDEN, IMAGE, // PASSWORD, RADIO, RESET, SUBMIT, TEXT. -// +// // In addition, it defines the default ENCTYPE attribute of the FORM // element using the POST METHOD to have the default value // "application/x-www-form-urlencoded" // // 6. Examples -// +// // Suppose the server supplies the following HTML: -// +// // <FORM ACTION="http://server.dom/cgi/handle" // ENCTYPE="multipart/form-data" // METHOD=POST> // What is your name? <INPUT TYPE=TEXT NAME=submitter> // What files are you sending? <INPUT TYPE=FILE NAME=pics> // </FORM> -// +// // and the user types "Joe Blow" in the name field, and selects a text // file "file1.txt" for the answer to 'What files are you sending?' -// +// // The client might send back the following data: -// +// // Content-type: multipart/form-data, boundary=AaB03x -// +// // --AaB03x // content-disposition: form-data; name="field1" -// +// // Joe Blow // --AaB03x // content-disposition: form-data; name="pics"; filename="file1.txt" // Content-Type: text/plain -// +// // ... contents of file1.txt ... // --AaB03x-- // // 7. Registration of multipart/form-data -// +// // The media-type multipart/form-data follows the rules of all multipart // MIME data streams as outlined in RFC 1521. It is intended for use in // returning the data that comes about from filling out a form. In a @@ -372,7 +374,7 @@ bool CWebserverRequest::HandlePost() // are a series of fields to be supplied by the user who fills out the // form. Each field has a name. Within a given form, the names are // unique. -// +// // multipart/form-data contains a series of parts. Each part is expected // to contain a content-disposition header where the value is "form- // data" and a name attribute specifies the field name within the form, @@ -380,7 +382,7 @@ bool CWebserverRequest::HandlePost() // the field name corresponding to that field. Field names originally in // non-ASCII character sets may be encoded using the method outlined in // RFC 1522. -// +// // As with all multipart MIME types, each part has an optional Content- // Type which defaults to text/plain. If the contents of a file are // returned via filling out a form, then the file input is identified as @@ -388,11 +390,11 @@ bool CWebserverRequest::HandlePost() // multiple files are to be returned as the result of a single form // entry, they can be returned as multipart/mixed embedded within the // multipart/form-data. -// +// // Each part may be encoded and the "content-transfer-encoding" header // supplied if the value of that part does not conform to the default // encoding. -// +// // File inputs may also identify the file name. The file name may be // described using the 'filename' parameter of the "content-disposition" // header. This is not required, but is strongly recommended in any case @@ -417,7 +419,7 @@ unsigned int CWebserverRequest::HandlePostBoundary(std::string boundary, unsigne return 0; } log_level_printf(7,"<POST Boundary> Boundary START found\n"); - + // read content-disposition: ... tmp_line = Connection->sock->ReceiveLine(); content_len -= tmp_line.length(); @@ -455,7 +457,7 @@ unsigned int CWebserverRequest::HandlePostBoundary(std::string boundary, unsigne return 0; } var_value = trim(var_value); - ParameterList[var_name] = var_value; + ParameterList[var_name] = var_value; log_level_printf(7,"<POST Boundary> filename found. name:(%s) value:(%s)\n", var_name.c_str(), var_value.c_str()); //read 'Content-Type: <mime>' @@ -468,7 +470,7 @@ unsigned int CWebserverRequest::HandlePostBoundary(std::string boundary, unsigne return 0; } var_value = trim(right); - ParameterList[var_name+"_mime"] = var_value; + ParameterList[var_name+"_mime"] = var_value; log_level_printf(7,"<POST Boundary> Content-Type found. name:(%s_mime) value:(%s)\n", var_name.c_str(), var_value.c_str()); @@ -479,20 +481,20 @@ unsigned int CWebserverRequest::HandlePostBoundary(std::string boundary, unsigne { log_level_printf(7,"<POST Boundary> no empty line found. line:(%s)\n", tmp_line.c_str()); return 0; - + } log_level_printf(7,"<POST Boundary> read file Start\n"); - + std::string upload_filename; upload_filename = UPLOAD_TMP_FILE; // Hook for Filename naming Connection->HookHandler.Hooks_UploadSetFilename(upload_filename); // Set upload filename to ParameterList["<name>_upload_filename"]="<upload_filename>" - ParameterList[var_name+"_upload_filename"] = upload_filename; + ParameterList[var_name+"_upload_filename"] = upload_filename; // open file for write int fd = open(upload_filename.c_str(), O_WRONLY|O_CREAT|O_TRUNC); - if (fd<0) + if (fd<=0) { aprintf("cannot open file %s: ", upload_filename.c_str()); dperror(""); @@ -500,7 +502,7 @@ unsigned int CWebserverRequest::HandlePostBoundary(std::string boundary, unsigne } // ASSUMPTION: the complete multipart has no more then SEARCH_BOUNDARY_LEN bytes after the file. - // It only works, if no multipart/mixed is used (e.g. in file attachments). Not nessesary in embedded systems. + // It only works, if no multipart/mixed is used (e.g. in file attachments). Not nessesary in embedded systems. // To speed up uploading, read content_len - SEARCH_BOUNDARY_LEN bytes in blockmode. // To save memory, write them direct into the file. #define SEARCH_BOUNDARY_LEN 2*RECEIVE_BLOCK_LEN // >= RECEIVE_BLOCK_LEN in ySocket @@ -510,19 +512,19 @@ unsigned int CWebserverRequest::HandlePostBoundary(std::string boundary, unsigne _readbytes = Connection->sock->ReceiveFileGivenLength(fd, content_len - SEARCH_BOUNDARY_LEN); content_len -= _readbytes; log_level_printf(8,"<POST Boundary> read block (already:%d all:%d)\n", _readbytes, content_len); - } + } // read rest of file and check for boundary end _readbytes = 0; bool is_CRLF = false; - + bool found_end_boundary = false; do { // read line by line tmp_line = Connection->sock->ReceiveLine(); _readbytes += tmp_line.length(); - + // is this line a boundary? if(tmp_line.find(boundary) != std::string::npos) { @@ -533,21 +535,21 @@ unsigned int CWebserverRequest::HandlePostBoundary(std::string boundary, unsigne else // no Boundary: write CRFL if found in last line { if(is_CRLF) - if ((unsigned int)write(fd, "\r\n", 2) != 2) - { + if ((unsigned int)write(fd, "\r\n", 2) != 2) + { perror("write file failed\n"); - return 0; - } + return 0; + } } // normal line: write it to file // CRLF at end? Maybe CRLF before boundary. Can not decide yet is_CRLF = (tmp_line.length()>=2 && tmp_line[tmp_line.length()-2]=='\r' && tmp_line[tmp_line.length()-1]=='\n'); int write_len = is_CRLF ? tmp_line.length()-2 : tmp_line.length(); - if (write(fd, tmp_line.c_str(), write_len) != write_len) - { + if (write(fd, tmp_line.c_str(), write_len) != write_len) + { perror("write file failed\n"); - return 0; - } + return 0; + } log_level_printf(2,"<POST Boundary> read file (already:%d all:%d)\n", _readbytes, content_len); } while((_readbytes < content_len) && (tmp_line.length() != 0)); @@ -556,7 +558,7 @@ unsigned int CWebserverRequest::HandlePostBoundary(std::string boundary, unsigne log_level_printf(2,"<POST Boundary> read file End\n"); if(found_end_boundary) // upload ok? { - + Connection->HookHandler.Hooks_UploadReady(upload_filename); return 0; } @@ -577,7 +579,7 @@ unsigned int CWebserverRequest::HandlePostBoundary(std::string boundary, unsigne log_level_printf(7,"<POST Boundary> no var_name END found. line:(%s)\n", tmp_line.c_str()); return 0; } - + //read empty line as separator tmp_line = Connection->sock->ReceiveLine(); content_len -= tmp_line.length(); @@ -585,15 +587,15 @@ unsigned int CWebserverRequest::HandlePostBoundary(std::string boundary, unsigne { log_level_printf(7,"<POST Boundary> no empty line found. line:(%s)\n", tmp_line.c_str()); return 0; - + } //read var_value line // ASSUMPTION!!!! Only one Line for value, new line is a boundary again // ATTENTION!! var_name must not be unique. So Parameters are store by number too. var_value = Connection->sock->ReceiveLine(); content_len -= tmp_line.length(); - var_value = trim(var_value); - ParameterList[var_name] = var_value; + var_value = trim(decodeString(var_value)); + ParameterList[var_name] = var_value; log_level_printf(7,"<POST Boundary> Parameter found. name:(%s) value:(%s)\n", var_name.c_str(), var_value.c_str()); } } diff --git a/src/nhttpd/yhttpd_core/ysocket.h b/src/nhttpd/yhttpd_core/ysocket.h index 3db236a51..e6c924709 100644 --- a/src/nhttpd/yhttpd_core/ysocket.h +++ b/src/nhttpd/yhttpd_core/ysocket.h @@ -73,7 +73,7 @@ public: // send & receive int SendFile(int filed); // Send a File std::string ReceiveBlock(); // receive a Block. Look at length - unsigned int ReceiveFileGivenLength(int filed, unsigned int _length); // Receive File of given length + unsigned int ReceiveFileGivenLength(int filed, unsigned int _length); // Receive File of given length std::string ReceiveLine(); // receive until "\n" protected: diff --git a/src/nhttpd/yhttpd_core/ywebserver.cpp b/src/nhttpd/yhttpd_core/ywebserver.cpp index 3c0a38b27..60f3ef03a 100644 --- a/src/nhttpd/yhttpd_core/ywebserver.cpp +++ b/src/nhttpd/yhttpd_core/ywebserver.cpp @@ -5,7 +5,6 @@ // c++ #include <cerrno> #include <csignal> -#include <cstdio> // system #include <arpa/inet.h> @@ -49,8 +48,10 @@ CWebserver::CWebserver() FD_ZERO(&read_fds); fdmax = 0; open_connections = 0; - //pthread_attr_init(&attr); - //pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); +#ifdef Y_CONFIG_BUILD_AS_DAEMON + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); +#endif port=80; @@ -128,7 +129,7 @@ bool CWebserver::run(void) // initialize values for select int listener = listenSocket.get_socket();// Open Listener - struct timeval tv; // timeout struct + struct timeval tv; // timeout struct FD_SET(listener, &master); // add the listener to the master set fdmax = listener; // init max fd fcntl(listener, F_SETFD , O_NONBLOCK); // listener master socket non-blocking @@ -157,8 +158,8 @@ bool CWebserver::run(void) // Socket Error? if(fd == -1 && errno != EINTR) { - perror("select"); - return false; + perror("select"); + return false; } // Socket Timeout? @@ -419,11 +420,14 @@ bool CWebserver::handle_connection(CySocket *newSock) newConn->ySock = newSock; newConn->ySock->handling = true; newConn->WebserverBackref = this; - //newConn->is_treaded = is_threading; +#ifdef Y_CONFIG_BUILD_AS_DAEMON + newConn->is_treaded = is_threading; +#else newConn->is_treaded = false; - +#endif int index = -1; - if(0) /*if(is_threading) FIXME not work */ +#ifdef Y_CONFIG_BUILD_AS_DAEMON + if(is_threading) { pthread_mutex_lock( &mutex ); // look for free Thread slot @@ -449,6 +453,7 @@ bool CWebserver::handle_connection(CySocket *newSock) dperror("Could not create Connection-Thread\n"); } else // non threaded +#endif WebThread((void *)newConn); return ((index != -1) || !is_threading); } diff --git a/src/nhttpd/yhttpd_mods/mod_auth.h b/src/nhttpd/yhttpd_mods/mod_auth.h index a010dba63..7be42b528 100644 --- a/src/nhttpd/yhttpd_mods/mod_auth.h +++ b/src/nhttpd/yhttpd_mods/mod_auth.h @@ -17,7 +17,7 @@ public: // Hooks virtual THandleStatus Hook_PrepareResponse(CyhookHandler *hh); virtual std::string getHookName(void) {return std::string("mod_auth");} - virtual std::string getHookVersion(void) {return std::string("$Revision: 1.2 $");} + virtual std::string getHookVersion(void) {return std::string("$Revision: 1.3 $");} virtual THandleStatus Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList); protected: bool CheckAuth(CyhookHandler *hh); diff --git a/src/nhttpd/yhttpd_mods/mod_cache.cpp b/src/nhttpd/yhttpd_mods/mod_cache.cpp index fac706d02..07c2b1be8 100644 --- a/src/nhttpd/yhttpd_mods/mod_cache.cpp +++ b/src/nhttpd/yhttpd_mods/mod_cache.cpp @@ -4,7 +4,6 @@ //============================================================================= // system -#include <cstdio> #include <pthread.h> #include <sys/stat.h> // yhttpd @@ -118,7 +117,7 @@ THandleStatus CmodCache::Hook_ReadConfig(CConfigFile *Config, CStringList &Confi //------------------------------------------------------------------------- // Build and Add a cache item //------------------------------------------------------------------------- -void CmodCache::AddToCache(CyhookHandler */*hh*/, std::string url, std::string content, std::string mime_type, std::string category) +void CmodCache::AddToCache(CyhookHandler *, std::string url, std::string content, std::string mime_type, std::string category) { FILE *fd = NULL; pthread_mutex_lock(&mutex); diff --git a/src/nhttpd/yhttpd_mods/mod_cache.h b/src/nhttpd/yhttpd_mods/mod_cache.h index c953163d6..56e8d67ce 100644 --- a/src/nhttpd/yhttpd_mods/mod_cache.h +++ b/src/nhttpd/yhttpd_mods/mod_cache.h @@ -39,18 +39,18 @@ public: CmodCache(){}; ~CmodCache(void){}; - + void AddToCache(CyhookHandler *hh, std::string url, std::string content, std::string mime_type, std::string cartegory="none"); static void RemoveURLFromCache(std::string url); static void RemoveCategoryFromCache(std::string category); static void DeleteCache(void); // Hooks - virtual THandleStatus Hook_PrepareResponse(CyhookHandler *hh); - virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); - virtual std::string getHookVersion(void) {return std::string("$Revision: 1.1 $");} + virtual THandleStatus Hook_PrepareResponse(CyhookHandler *hh); + virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); + virtual std::string getHookVersion(void) {return std::string("$Revision: 1.2 $");} virtual std::string getHookName(void) {return std::string("mod_cache");} - virtual THandleStatus Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList); + virtual THandleStatus Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList); }; #endif /* __yhttpd_mod_cache_h__ */ diff --git a/src/nhttpd/yhttpd_mods/mod_sendfile.cpp b/src/nhttpd/yhttpd_mods/mod_sendfile.cpp index 897b3678e..52d612560 100644 --- a/src/nhttpd/yhttpd_mods/mod_sendfile.cpp +++ b/src/nhttpd/yhttpd_mods/mod_sendfile.cpp @@ -71,7 +71,7 @@ THandleStatus CmodSendfile::Hook_PrepareResponse(CyhookHandler *hh) int filed; log_level_printf(4,"mod_sendfile prepare hook start url:%s\n",hh->UrlData["fullurl"].c_str()); std::string mime = sendfileTypes[hh->UrlData["fileext"]]; - if(mime != "") + if(((mime != "") || (hh->WebserverConfigList["mod_sendfile.sendAll"] == "true")) && (hh->UrlData["fileext"] != "yhtm")) { //TODO: Check allowed directories / actually in GetFileName // build filename @@ -136,6 +136,7 @@ THandleStatus CmodSendfile::Hook_ReadConfig(CConfigFile *Config, CStringList &Co { std::string exttypes = Config->getString("mod_sendfile.mime_types", HTTPD_SENDFILE_EXT); ConfigList["mod_sendfile.mime_types"] = exttypes; + ConfigList["mod_sendfile.sendAll"] = Config->getString("mod_sendfile.sendAll", HTTPD_SENDFILE_ALL); bool ende = false; std::string item, ext, mime; @@ -167,8 +168,12 @@ std::string CmodSendfile::GetFileName(CyhookHandler *hh, std::string path, std:: if( access(std::string(hh->WebserverConfigList["PublicDocumentRoot"] + tmpfilename).c_str(),4) == 0) tmpfilename = hh->WebserverConfigList["PublicDocumentRoot"] + tmpfilename; + else if( access(std::string(hh->WebserverConfigList["PublicDocumentRoot"] + tmpfilename + ".gz").c_str(),4) == 0) + tmpfilename = hh->WebserverConfigList["PublicDocumentRoot"] + tmpfilename + ".gz"; else if(access(std::string(hh->WebserverConfigList["PrivatDocumentRoot"] + tmpfilename).c_str(),4) == 0) tmpfilename = hh->WebserverConfigList["PrivatDocumentRoot"] + tmpfilename; + else if(access(std::string(hh->WebserverConfigList["PrivatDocumentRoot"] + tmpfilename + ".gz").c_str(),4) == 0) + tmpfilename = hh->WebserverConfigList["PrivatDocumentRoot"] + tmpfilename + ".gz"; #ifdef Y_CONFIG_FEATUE_SENDFILE_CAN_ACCESS_ALL else if(access(tmpfilename.c_str(),4) == 0) ; @@ -182,7 +187,7 @@ std::string CmodSendfile::GetFileName(CyhookHandler *hh, std::string path, std:: //----------------------------------------------------------------------------- // Send File: Open File and check file type //----------------------------------------------------------------------------- -int CmodSendfile::OpenFile(CyhookHandler */*hh*/, std::string fullfilename) +int CmodSendfile::OpenFile(CyhookHandler *, std::string fullfilename) { int fd= -1; std::string tmpstring; diff --git a/src/nhttpd/yhttpd_mods/mod_sendfile.h b/src/nhttpd/yhttpd_mods/mod_sendfile.h index 1a2773856..422ca8699 100644 --- a/src/nhttpd/yhttpd_mods/mod_sendfile.h +++ b/src/nhttpd/yhttpd_mods/mod_sendfile.h @@ -29,11 +29,11 @@ public: ~CmodSendfile(void){}; // Hooks - virtual THandleStatus Hook_PrepareResponse(CyhookHandler *hh); -// virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); + virtual THandleStatus Hook_PrepareResponse(CyhookHandler *hh); +// virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); virtual std::string getHookName(void) {return std::string("mod_sendfile");} - virtual std::string getHookVersion(void) {return std::string("$Revision: 1.1 $");} - virtual THandleStatus Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList); + virtual std::string getHookVersion(void) {return std::string("$Revision: 1.2 $");} + virtual THandleStatus Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList); }; #endif /* __yhttpd_mod_sendfile_h__ */ diff --git a/src/nhttpd/yhttpd_mods/mod_weblog.cpp b/src/nhttpd/yhttpd_mods/mod_weblog.cpp index 58f696ed8..0ccb7cba1 100644 --- a/src/nhttpd/yhttpd_mods/mod_weblog.cpp +++ b/src/nhttpd/yhttpd_mods/mod_weblog.cpp @@ -5,9 +5,8 @@ // Normally //============================================================================= #include <cstdarg> -#include <cstdio> -#include <cstdlib> #include <cstring> +#include <cstdlib> #include "mod_weblog.h" #include "helper.h" @@ -57,7 +56,7 @@ THandleStatus CmWebLog::Hook_EndConnection(CyhookHandler *hh) // HOOK: Hook_ReadConfig // This hook ist called from ReadConfig //----------------------------------------------------------------------------- -THandleStatus CmWebLog::Hook_ReadConfig(CConfigFile *Config, CStringList &/*ConfigList*/) +THandleStatus CmWebLog::Hook_ReadConfig(CConfigFile *Config, CStringList &) { LogFormat = Config->getString("mod_weblog.log_format", LOG_FORMAT); WebLogFilename = Config->getString("mod_weblog.logfile", LOG_FILE); @@ -112,8 +111,7 @@ bool CmWebLog::printf(const char *fmt, ...) pthread_mutex_lock(&WebLog_mutex); // yeah, its mine va_list arglist; va_start( arglist, fmt ); - // if(arglist) - vsnprintf( buffer, bufferlen, fmt, arglist ); + vsnprintf( buffer, bufferlen, fmt, arglist ); va_end(arglist); unsigned int len = strlen(buffer); success = (fwrite(buffer, len, 1, WebLogFile) == len); diff --git a/src/nhttpd/yhttpd_mods/mod_weblog.h b/src/nhttpd/yhttpd_mods/mod_weblog.h index b7a659678..235f55ad7 100644 --- a/src/nhttpd/yhttpd_mods/mod_weblog.h +++ b/src/nhttpd/yhttpd_mods/mod_weblog.h @@ -22,7 +22,7 @@ class CmWebLog : public Cyhook static std::string WebLogFilename; static int RefCounter; // Count Instances static std::string LogFormat; - + public: CmWebLog(); ~CmWebLog(); @@ -32,12 +32,12 @@ public: void AddLogEntry_CLF(CyhookHandler *hh); void AddLogEntry_ELF(CyhookHandler *hh); bool printf(const char *fmt, ...); - + // Hooks - virtual THandleStatus Hook_EndConnection(CyhookHandler *hh); + virtual THandleStatus Hook_EndConnection(CyhookHandler *hh); virtual std::string getHookName(void) {return std::string("mod_weblog");} - virtual std::string getHookVersion(void) {return std::string("$Revision: 1.2 $");} - virtual THandleStatus Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList); + virtual std::string getHookVersion(void) {return std::string("$Revision: 1.3 $");} + virtual THandleStatus Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList); }; #endif // __yhttpd_mod_weblog_h__ diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.cpp b/src/nhttpd/yhttpd_mods/mod_yparser.cpp index 5a3ff4e1c..cf1f3abfb 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.cpp +++ b/src/nhttpd/yhttpd_mods/mod_yparser.cpp @@ -23,6 +23,7 @@ #include "helper.h" #include "ylogging.h" #include "mod_yparser.h" +#include "ylanguage.h" //============================================================================= // Initialization of static variables @@ -80,7 +81,7 @@ THandleStatus CyParser::Hook_SendResponse(CyhookHandler *hh) { hh->status = HANDLED_NONE; -// log_level_printf(4,"yparser hook start url:%s\n",hh->UrlData["url"].c_str()); + log_level_printf(4,"yparser hook start url:%s\n",hh->UrlData["url"].c_str()); init(hh); CyParser *yP = new CyParser(); // create a Session @@ -317,7 +318,8 @@ std::string CyParser::cgi_file_parsing(CyhookHandler *hh, std::string htmlfilena //----------------------------------------------------------------------------- std::string CyParser::cgi_cmd_parsing(CyhookHandler *hh, std::string html_template, bool ydebug) { - unsigned int start, end, esc_len = strlen(YPARSER_ESCAPE_START); + std::string::size_type start, end; + unsigned int esc_len = strlen(YPARSER_ESCAPE_START); bool is_cmd; std::string ycmd,yresult; @@ -367,6 +369,8 @@ std::string CyParser::cgi_cmd_parsing(CyhookHandler *hh, std::string html_templ // var-set:<varname>=<varvalue> // global-var-get:<varname> // global-var-set:<varname>=<varvalue> +// file-action:<filename>;<action=add|addend|delete>[;<content>] +// L:<translation-id> //----------------------------------------------------------------------------- std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd) @@ -375,7 +379,9 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd) if (ySplitString(ycmd,":",ycmd_type,ycmd_name)) { - if(ycmd_type == "script") + if(ycmd_type == "L") + yresult = CLanguage::getInstance()->getTranslation(ycmd_name); + else if(ycmd_type == "script") yresult = YexecuteScript(hh, ycmd_name); else if(ycmd_type == "if-empty") { @@ -502,16 +508,17 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd) if (ySplitString(ycmd_name,";",filename,tmp)) { ySplitString(tmp,";",actionname, content); + replace(content, "\r\n", "\n"); if(actionname == "add") { - std::fstream fout(filename.c_str(), std::fstream::out ); + std::fstream fout(filename.c_str(), std::fstream::out|std::fstream::binary); fout << content; fout.close(); } else if(actionname == "append") { - std::fstream fout(filename.c_str(), std::fstream::app ); + std::fstream fout(filename.c_str(), std::fstream::app|std::fstream::binary ); fout << content; fout.close(); } @@ -526,7 +533,12 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd) yresult = "ycgi-type unknown"; } else if (hh->ParamList[ycmd] != "") - yresult = hh->ParamList[ycmd]; + { + if((hh->ParamList[ycmd]).find("script") == std::string::npos) + yresult = hh->ParamList[ycmd]; + else + yresult = "<!--Not Allowed script in "+ycmd+" -->"; + } return yresult; } @@ -535,7 +547,7 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd) // Get Value from ini/conf-file (filename) for var (varname) // yaccess = open | cache //------------------------------------------------------------------------- -std::string CyParser::YWeb_cgi_get_ini(CyhookHandler */*hh*/, std::string filename, std::string varname, std::string yaccess) +std::string CyParser::YWeb_cgi_get_ini(CyhookHandler *, std::string filename, std::string varname, std::string yaccess) { std::string result; if((yaccess == "open") || (yaccess == "")) @@ -551,7 +563,7 @@ std::string CyParser::YWeb_cgi_get_ini(CyhookHandler */*hh*/, std::string filen // set Value from ini/conf-file (filename) for var (varname) // yaccess = open | cache | save //------------------------------------------------------------------------- -void CyParser::YWeb_cgi_set_ini(CyhookHandler */*hh*/, std::string filename, std::string varname, std::string varvalue, std::string yaccess) +void CyParser::YWeb_cgi_set_ini(CyhookHandler *, std::string filename, std::string varname, std::string varvalue, std::string yaccess) { std::string result; if((yaccess == "open") || (yaccess == "")) @@ -610,7 +622,7 @@ std::string CyParser::YWeb_cgi_include_block(std::string filename, std::string if(yfile.length() != 0) { std::string t = "start-block~"+blockname; - unsigned int start, end; + std::string::size_type start, end; if((start = yfile.find(t)) != std::string::npos) { if((end = yfile.find("end-block~"+blockname, start+t.length())) != std::string::npos) @@ -632,7 +644,7 @@ std::string CyParser::YWeb_cgi_include_block(std::string filename, std::string //------------------------------------------------------------------------- -std::string CyParser::YexecuteScript(CyhookHandler */*hh*/, std::string cmd) +std::string CyParser::YexecuteScript(CyhookHandler *, std::string cmd) { std::string script, para, result; bool found = false; @@ -699,6 +711,8 @@ const CyParser::TyFuncCall CyParser::yFuncCallList[]= {"get_config_data", &CyParser::func_get_config_data}, {"do_reload_httpd_config", &CyParser::func_do_reload_httpd_config}, {"httpd_change", &CyParser::func_change_httpd}, + {"get_languages_as_dropdown", &CyParser::func_get_languages_as_dropdown}, + {"set_language", &CyParser::func_set_language}, }; //------------------------------------------------------------------------- @@ -754,8 +768,7 @@ std::string CyParser::func_get_config_data(CyhookHandler *hh, std::string para) // y-func : Reload the httpd.conf //------------------------------------------------------------------------- extern void yhttpd_reload_config(); - -std::string CyParser::func_do_reload_httpd_config(CyhookHandler */*hh*/, std::string /*para*/) +std::string CyParser::func_do_reload_httpd_config(CyhookHandler *, std::string ) { log_level_printf(1,"func_do_reload_httpd_config: raise USR1 !!!\n"); //raise(SIGUSR1); // Send HUP-Signal to Reload Settings @@ -777,3 +790,42 @@ std::string CyParser::func_change_httpd(CyhookHandler *hh, std::string para) else return "ERROR [change_httpd]: para has not path to a file"; } +//------------------------------------------------------------------------- +// y-func : get_header_data +//------------------------------------------------------------------------- +std::string CyParser::func_get_languages_as_dropdown(CyhookHandler *, std::string) +{ + std::string yresult, sel; + DIR *d; + struct dirent *dir; + + std::string act_language = CLanguage::getInstance()->language; + d = opendir( (CLanguage::getInstance()->language_dir).c_str() ); + if( d != NULL ) { + while( ( dir = readdir( d ) ) ) { + if( strcmp( dir->d_name, "." ) == 0 || strcmp( dir->d_name, ".." ) == 0 ) + continue; + if( dir->d_type != DT_DIR ) { + sel=(act_language==std::string(dir->d_name)) ? "selected=\"selected\"" : ""; + yresult += string_printf("<option value=%s %s>%s</option>\n", + dir->d_name, sel.c_str(), (encodeString(std::string(dir->d_name))).c_str()); + } + } + closedir( d ); + } + return yresult; +} +//------------------------------------------------------------------------- +// y-func : get_header_data +//------------------------------------------------------------------------- +std::string CyParser::func_set_language(CyhookHandler *, std::string para) +{ + if(para != ""){ + CConfigFile *Config = new CConfigFile(','); + Config->loadConfig(HTTPD_CONFIGFILE); + Config->setString("Language.selected", para); + Config->saveConfig(HTTPD_CONFIGFILE); + yhttpd_reload_config(); + } + return ""; +} diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.h b/src/nhttpd/yhttpd_mods/mod_yparser.h index 3265dff09..852a95b99 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.h +++ b/src/nhttpd/yhttpd_mods/mod_yparser.h @@ -67,7 +67,7 @@ private: // local Session vars CStringList ycgi_vars; //ycgi session vars CConfigFile *yConfig; - + // mutex for vars and caching (yCached_*) static pthread_mutex_t yParser_mutex; // ycgi globals @@ -88,6 +88,8 @@ private: std::string func_get_config_data(CyhookHandler *hh, std::string para); std::string func_do_reload_httpd_config(CyhookHandler *hh, std::string para); std::string func_change_httpd(CyhookHandler *hh, std::string para); + std::string func_get_languages_as_dropdown(CyhookHandler *hh, std::string para); + std::string func_set_language(CyhookHandler *, std::string para); // helpers std::string YWeb_cgi_get_ini(CyhookHandler *hh, std::string filename, std::string varname, std::string yaccess); @@ -109,13 +111,13 @@ public: // constructor & deconstructor CyParser(); ~CyParser(void); - + // virtual functions for BaseClass virtual std::string YWeb_cgi_func(CyhookHandler *hh, std::string ycmd); // virtual functions for HookHandler/Hook - virtual std::string getHookVersion(void) {return std::string("$Revision: 1.2 $");} + virtual std::string getHookVersion(void) {return std::string("$Revision: 1.4 $");} virtual std::string getHookName(void) {return "mod_yparser";} - virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); + virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); }; #endif /* __yhttpd_yparser_h__ */