home *** CD-ROM | disk | FTP | other *** search
/ Chip 2006 June / CHIP 2006-06.2.iso / program / freeware / Democracy-0.8.2.exe / xulrunner / python / compiled_templates / feed_settings.py < prev    next >
Encoding:
Python Source  |  2006-04-10  |  30.8 KB  |  254 lines

  1. # This is a generated file. Do not edit.
  2. from template import Handle, fillAttr, quoteAndFillAttr, funcTable
  3. from IOBuffer import IOBuffer
  4. from xhtmltools import urlencode
  5. from templatehelper import quoteattr, escape, evalKey, toUni
  6. def fillTemplate(data, domHandler):
  7.     # Start of handle
  8.     handle = Handle(domHandler)
  9.  
  10.  
  11.     out = IOBuffer()
  12.     out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n")
  13.     out.write(u'<html dtvPlatform="')
  14.     out.write(quoteattr(urlencode(toUni(evalKey(u'dtvPlatform',data)))))
  15.     out.write(u'" eventCookie="')
  16.     out.write(quoteattr(urlencode(toUni(evalKey(u'eventCookie',data)))))
  17.     out.write(u'" xmlns:t=')
  18.     out.write(quoteAndFillAttr(u'http://www.participatorypolitics.org/',data))
  19.     out.write(u' xmlns=')
  20.     out.write(quoteAndFillAttr(u'http://www.w3.org/1999/xhtml',data))
  21.     out.write(u' xmlns:i18n=')
  22.     out.write(quoteAndFillAttr(u'http://www.participatoryculture.org/i18n',data))
  23.     out.write(u'>\n<head>\n<meta content=')
  24.     out.write(quoteAndFillAttr(u'text/html; charset=utf-8',data))
  25.     out.write(u' http-equiv=')
  26.     out.write(quoteAndFillAttr(u'content-type',data))
  27.     out.write(u'></meta>\n\n<link href=')
  28.     out.write(quoteAndFillAttr(u'resource:css/main.css',data))
  29.     out.write(u' type=')
  30.     out.write(quoteAndFillAttr(u'text/css',data))
  31.     out.write(u' rel=')
  32.     out.write(quoteAndFillAttr(u'stylesheet',data))
  33.     out.write(u'></link>\n<script type="text/javascript">\n<!-- // Protect from our XML parser, which doesn\'t know to protect <script>\n\n///////////////////////////////////////////////////////////////////////////////\n//// Machinery related to dynamic updates in full XUL mode                 ////\n///////////////////////////////////////////////////////////////////////////////\n\nfunction handleUpdate(event) {\n    r = event.target;\n    eval(r.responseText);\n}\n\nfunction beginUpdates() {\n    if (getDTVPlatform() == \'xul\') {\n        // Under XUL, open a \'push\' HTTP connection to the controller to\n        // receive updates. This avoids calling across the Python/XPCOM\n        // boundary, which causes deadlocks sometimes for poorly understood\n        // reasons.\n        //        port = getServerPort();\n        var cookie = getEventCookie();\n        //        url = "http://127.0.0.1:" + port + "/dtv/mutators/" + cookie;\n        var url = "/dtv/mutators/" + cookie;\n\n        var xr = new XMLHttpRequest();\n        /*\n        netscape.security.PrivilegeManager.\n            enablePrivilege("UniversalBrowserRead");\n        */\n        xr.multipart = true;\n        xr.open("GET", url, true);\n        xr.onload = handleUpdate;\n        xr.send(null);\n    }\n}\n     \n///////////////////////////////////////////////////////////////////////////////\n//// For use on your page                                                  ////\n///////////////////////////////////////////////////////////////////////////////\n\nfunction jsdump(str) {\n    Components.classes[\'@mozilla.org/consoleservice;1\']\n\t.getService(Components.interfaces.nsIConsoleService)\t\n\t.logStringMessage(str);\n}\n\nfunction getEventCookie() {\n    var elt = document.getElementsByTagName("html")[0];\n    return elt.getAttribute(\'eventCookie\');\n}\n\nfunction getDTVPlatform() {\n    var elt = document.getElementsByTagName("html")[0];\n    return elt.getAttribute(\'dtvPlatform\');\n}\n\n/*\n// NEEDS: eliminate! just use relative URLs\nfunction getServerPort() {\n    var elt = document.getElementsByTagName("html")[0];\n    return elt.getAttribute(\'serverPort\');\n}\n*/\n\n// For calling from page Javascript: Cause a URL to be loaded. The\n// assumption is that the application will notice, abort the load, and\n// take some action based on the URL.\nfunction eventURL(url) {\n    if (getDTVPlatform() == \'xul\') {\n    \t// XUL strategy: async HTTP request to our in-process HTTP\n        // server.  Since it falls under the "same origin" security\n        // model exemption, no need for complicated preferences\n        // shenanigans -- what a nice day!\n        //        url = "http://127.0.0.1:" + getServerPort() + "/dtv/action/" +\n        //            getEventCookie() + "?" + url; NEEDS: remove\n        url = "/dtv/action/" + getEventCookie() + "?" + url;\n    \tvar req = new XMLHttpRequest();\n        req.open("GET", url, true);\n        req.send(null);\n        // NEEDS: there is another copy of this in main.js.\n    }\n    else if (typeof(window.frontend) == \'undefined\') {\n\t// Generic strategy: trigger a load, and hope the application\n\t// catches it and cancels it without creating a race\n\t// condition.\n\tdocument.location.href = url;\n    } else {\n\t// OS X WebKit (KHTML) strategy: pass in an Objective C object\n\t// through the window object and call a method on it.\n\twindow.frontend.eventURL(url);\n    }\n\n    return false;\n}    \n\n// Open email client with email about selected video\n// All parameters come in URL encoded\nfunction recommendItem(title, url, feedURL) {\n    url = URLdecode(url);\n    feedURL = URLdecode(feedURL);\n    body = "You should check out this video:\\n";\n    body = body + url + "\\n\\n";\n    body = body + "I found it while using the Democracy Player, which you can download here:\\n";\n    body = body + "http://www.getdemocracy.com\\n\\n";\n    body = body + "The video was on this channel (click \'subscribe\' in Democracy and paste in this address):\\n"\n    body = body + feedURL + "\\n\\n"\n    \n    url = \'mailto:\';\n    url = url + "?subject=" + title;\n    url = url + "&body=" + URLencode(body);\n    eventURL(url);\n    \n    return false;\n}\n\n// Change a view\'s filter. The filter controls which records are\n// included and which are not. (You can only do this if, when the view\n// was declared in the page header, it was given an initial filter\n// with the t:filter tag.) viewName is the name of the view whose\n// filter should be changed, as declared in the t:view tag. fieldKey\n// is the property of the record that should be tested (eg, \'name\'.)\n// functionKey is the function that should be used to do the test (eg,\n// \'global filter substring\'.) parameter is an extra parameter to pass\n// to the test function (such as a search string). If invert is true,\n// the sense of the filter is reversed: only objects that don\'t match\n// it will be included. For convenience in \'onclick\' handlers, this\n// function returns false. param is a hack to include a static\n// parameter in addition to the dynamic one.\nfunction setViewFilter(viewName, fieldKey, functionKey, parameter, invert, param) {\n    url = \'action:setViewFilter?\';\n    url = url + \'viewName=\' + URLencode(viewName);\n    url = url + \'&fieldKey=\' + URLencode(fieldKey);\n    url = url + \'&functionKey=\' + URLencode(functionKey);\n    if (parameter)\n\turl = url + \'¶meter=\' + URLencode(param+\'|\'+parameter);\n    else\n\turl = url + \'¶meter=\'+ URLencode(param);\n    if (invert)\n\turl = url + \'&invert=true\';\n    else\n\turl = url + \'&invert=false\';\n    eventURL(url);\n    return false;\n}\n\n// Change a view\'s sort. The sort controls the order in which records\n// are displayed. (You can only do this if, when the view was declared\n// in the page header, it was given an initial sort with the t:sort\n// tag.)  viewName is the name of the view whose sort should be\n// changed, as declared in the t:view tag. fieldKey is the property of\n// the record to sort on (eg, \'name\'.) functionKey is the comparison\n// function for the sort (eg, \'global sort text\'.) If reverse is true,\n// the records will be shown in the opposite of their normal order as\n// defined by the other parameters. For convenience in \'onclick\'\n// handlers, this function returns false.\nfunction setViewSort(viewName, fieldKey, functionKey, reverse) {\n    url = \'action:setViewSort?\';\n    url = url + \'viewName=\' + URLencode(viewName);\n    url = url + \'&fieldKey=\' + URLencode(fieldKey);\n    url = url + \'&functionKey=\' + URLencode(functionKey);\n    if (reverse)\n\turl = url + \'&reverse=true\';\n    eventURL(url);\n    return false;\n}\n\n// Start the video player. The playlist will be the items in the view\n// named by viewName. If firstItemId is the id of an item in the view,\n// playback will start on that item; otherwise playback will start on\n// the first item.\nfunction playViewNamed(viewName, firstItemId) {\n    url = \'action:playViewNamed?\';\n    url = url + \'viewName=\' + URLencode(viewName);\n    url = url + \'&firstItemId=\' + URLencode(firstItemId);\n    eventURL(url);\n    return false;\n}\n\n// You can make \'incremental search\' text boxes on your page that\n// effectively tie the text box to the \'parameter\' argument of setViewFilter,\n// with the other argumens fixed. To do this, add these two attributes to\n// the text box:\n//   onfocus="startEditFilter(this, (viewName), (fieldKey),\n//            (functionKey), (invert), (param)"\n//   onblur="endEditFilter()"\n// replacing the arguments in parentheses with the desired strings.\n//\n// Note that params is a big hack to pass a static parameter in\n// addition to the dynamic one\n\nvar editFilterTimers = new Array();\nvar editFilterField = null;\nvar editFilterOldValue = \'\';\nvar editFilterCount = 0;\nvar editFilterViews = new Array();\nvar editFilterFieldKeys = new Array();\nvar editFilterFunctionKeys = new Array();\nvar editFilterInverts = new Array();\nvar editFilterParams = new Array();\nvar editCurView = 0;\n\nfunction startEditFilter(obj, views, fieldKeys, functionKeys, inverts, params) {\n  editFilterOldValue = obj.value;\n\n  editFilterField = obj;\n  editFilterViews = views;\n  editFilterFieldKeys = fieldKeys;\n  editFilterFunctionKeys = functionKeys;\n  editFilterInverts = inverts;\n  editFilterParams = params;\n  editCurView = 0;\n\n  editFilterTimerTick(editCurView);\n}\n\nfunction editFilterUpdate(viewName,functionName,fieldName,invert, param) {\n    value = editFilterField.value;\n    if (editFilterOldValue != value ||\n\teditFilterCount < editFilterViews.length) {\n\tif (editFilterOldValue != value) \n\t    editFilterCount = 0;\n\telse\n\t    editFilterCount++;\n\tsetViewFilter(viewName, fieldName,\n\t\t      functionName, value,\n\t\t      invert, param);\n\teditFilterOldValue = value;\n    }\n}\n\nfunction editFilterTimerTick(curView) {\n    editFilterUpdate(editFilterViews[editCurView],editFilterFunctionKeys[editCurView],editFilterFieldKeys[editCurView],editFilterInverts[editCurView], editFilterParams[editCurView]);\n    editCurView++;\n    if (editCurView >= editFilterViews.length) {\n\teditCurView = 0;\n    }\n  editFilterTimer = setTimeout(editFilterTimerTick, 50);\n}\n\nfunction endEditFilter() {\n  clearTimeout(editFilterTimer);\n  editFilterCount = 0;\n  editFilterUpdate();\n}\n\n// Internal use: \'URL encode\' the given string.\nfunction URLencode(str) {\n    return encodeURIComponent(str)\n}\n\nfunction URLdecode(str) {\n  return decodeURIComponent(str)\n}\n\n///////////////////////////////////////////////////////////////////////////////\n//// For calling by host templating code                                   ////\n///////////////////////////////////////////////////////////////////////////////\n\n// For calling by host templating code: Returns items that should\n// appear in the context click menu in the format url|description with\n// one item on each line. Blank lines are separators\nfunction getContextClickMenu(element) {\n    while (1) {\n\tif (element.nodeType == 1 && element.getAttribute(\'t:contextMenu\')) {\n\t    ret = element.getAttribute(\'t:contextMenu\');\n\t    ret = ret.replace(/\\\\n/g,"\\n");\n\t    ret = ret.replace(/\\\\\\\\/g,"\\\\");\n\t    return ret;\n\t}\n\tif (element.parentNode)\n\t    element = element.parentNode;\n\telse\n\t    return "";\n    }\n\n    // Satisfy Mozilla that the function always returns a\n    // value. Otherwise, we get an error if strict mode is enabled,\n    // ultimately preventing us from getting the state change event\n    // indicating that the load succeeded.\n    return "";\n}\n\n// For calling by host templating code: Set CSS styles on the item\n// with the given ID to make it disappear.\nfunction hideItem(id) {\n    elt = document.getElementById(id);\n    elt.style.display = \'none\';\n    forceRedisplay(elt);\n}\n\n// For calling by host templating code: Set CSS styles on the item\n// with the given ID to make it visible if it was previously hidden.\nfunction showItem(id) {\n    elt = document.getElementById(id);\n    elt.style.display = \'\';\n    forceRedisplay(elt);\n}\n\n// For calling by host templating code: Replace the item with the\n// given id with the element described by the proided XML.\nfunction changeItem(id, newXML) {\n    elt = document.getElementById(id);\n    r = document.createRange();\n    r.selectNode(elt);\n    frag = r.createContextualFragment(newXML);\n    elt.parentNode.replaceChild(frag, elt);\n}\n\n// For calling by host templating code: Parse the XML in newXML into a\n// new element, and insert the new element immediately before the item\n// with the given id, such that the newly inserted item has the same\n// parent.\nfunction addItemBefore(newXML, id) {\n    elt = document.getElementById(id);\n    r = document.createRange();\n    r.selectNode(elt);\n    frag = r.createContextualFragment(newXML);\n    elt.parentNode.insertBefore(frag, elt);\n}    \n\n// For calling by host templating code: Parse the XML in newXML into a\n// new element, and insert the new element as the final child of the\n// item with the given id.\nfunction addItemAtEnd(newXML, id) {\n    elt = document.getElementById(id);\n    r = document.createRange();\n    r.selectNode(elt);\n    frag = r.createContextualFragment(newXML);\n    elt.insertBefore(frag, null);\n}    \n\n// For calling by host templating code: Remove the item with the given\n// id.\nfunction removeItem(id) {\n    elt = document.getElementById(id);\n    elt.parentNode.removeChild(elt);\n}    \n\n// Internal use: Sometime if all you do is change the style on a node,\n// Safari doesn\'t update the view until your mouse is next over the\n// window. Force the issue by making a drastic change in the vicinity\n// of the given element and then reversing it.\nfunction forceRedisplay(elt) {\n    r = document.createRange();\n    r.selectNode(elt);\n    frag = r.extractContents();\n    r.insertNode(frag);\n}\n\n///////////////////////////////////////////////////////////////////////////////\n///////////////////////////////////////////////////////////////////////////////\n\n-->\n</script>\n\n<script type="text/javascript">\n    <!-- // Protect from our XML parser, which doesn\'t know to protect <script>\n\n    function setAutoDownloadableFeed()\n    {\n        var url = \'action:setAutoDownloadableFeed\';\n        url += \'?feed=\' + document.forms[\'setAuto\'][\'feed\'].value;\n        if (document.forms[\'setAuto\'].automatic.checked)\n            url += \'&automatic=1\';\n        else\n            url += \'&automatic=0\';\n        eventURL(url);\n    }\n\n    function setAutoDownloadGets()\n    {\n        var url = "action:setGetEverything";\n        var idx = document.forms[\'settings\'][\'autoDownloadGets\'].selectedIndex;\n        \n        url += \'?feed=\' + document.forms[\'setAuto\'][\'feed\'].value;\n        url += "&everything=" + document.forms[\'settings\'][\'autoDownloadGets\'].options[idx].value;\n\n        eventURL(url);\n    }\n\n    function setExpiration()\n    {\n        var url = "action:setExpiration";\n        var idx = document.forms[\'settings\'][\'expireAfter\'].selectedIndex;\n        var value = document.forms[\'settings\'][\'expireAfter\'].options[idx].value;\n\n        url += \'?feed=\' + document.forms[\'setAuto\'][\'feed\'].value;\n        if (value == \'system\' || value == \'never\')\n        {\n            url += "&type=" + value + "&time=0";\n        }\n        else\n        {\n            url += "&type=feed&time=" + value;\n        }\n\n        eventURL(url);\n    }\n\n    function setMaxNew()\n    {\n        var url = "action:setMaxNew";\n\n        url += \'?feed=\' + document.forms[\'setAuto\'][\'feed\'].value;\n        if (document.forms[\'settings\'][\'maxOutDownloads\'].checked)\n        {\n            document.forms[\'settings\'][\'maxNew\'].disabled = false;\n            url += \'&maxNew=\' + document.forms[\'settings\'][\'maxNew\'].value;\n        }\n        else\n        {\n            document.forms[\'settings\'][\'maxNew\'].disabled = true;\n            url += \'&maxNew=-1\';\n        }\n\n        eventURL(url);\n    }\n\n    -->\n</script>\n</head>\n\n<body>\n\n\n<div id=')
  34.     out.write(quoteAndFillAttr(u'main-titlebar',data))
  35.     out.write(u'>\n\t<div id=')
  36.     out.write(quoteAndFillAttr(u'main-titlebar-avatar',data))
  37.     out.write(u'><img src="')
  38.     out.write(quoteattr(toUni(evalKey(u'feed getThumbnail',data))))
  39.     out.write(u'" alt=')
  40.     out.write(quoteAndFillAttr(u'',data))
  41.     out.write(u'></img></div>\n\t<div id=')
  42.     out.write(quoteAndFillAttr(u'main-titlebar-channelname',data))
  43.     out.write(u'>\n\t\t<h1>')
  44.     out.write(toUni(evalKey(u'feed getTitle',data)))
  45.     out.write(u'</h1>\n\t\t<div id=')
  46.     out.write(quoteAndFillAttr(u'main-titlebar-autodownload',data))
  47.     out.write(u'>\n\t\t\t<form name=')
  48.     out.write(quoteAndFillAttr(u'setAuto',data))
  49.     out.write(u'>\n\t\t\t\t<input type=')
  50.     out.write(quoteAndFillAttr(u'hidden',data))
  51.     out.write(u' name=')
  52.     out.write(quoteAndFillAttr(u'feed',data))
  53.     out.write(u' value="')
  54.     out.write(quoteattr(urlencode(toUni(evalKey(u'feed getID',data)))))
  55.     out.write(u'"></input>\n\t\t\t\t')
  56.     if evalKey(u'global filter boolean', data)(evalKey(u'feed isAutoDownloadable', data), ''):
  57.         for (func, args) in [(0, u'<input checked='), (10, u'checked'), (0, u' name='), (10, u'automatic'), (0, u' value='), (10, u'1'), (0, u' onClick='), (10, u'javascript:setAutoDownloadableFeed()'), (0, u' type='), (10, u'checkbox'), (0, u'></input>')]:
  58.             out.write(funcTable[func](data,'',args))
  59.     out.write(u'\n\t\t\t\t')
  60.     if not evalKey(u'global filter boolean', data)(evalKey(u'feed isAutoDownloadable', data), ''):
  61.         for (func, args) in [(0, u'<input name='), (10, u'automatic'), (0, u' value='), (10, u'1'), (0, u' onClick='), (10, u'javascript:setAutoDownloadableFeed()'), (0, u' type='), (10, u'checkbox'), (0, u'></input>')]:
  62.             out.write(funcTable[func](data,'',args))
  63.     out.write(u'\n\t\t\t\t<span class=')
  64.     out.write(quoteAndFillAttr(u'auto_link',data))
  65.     out.write(u' i18n:translate=')
  66.     out.write(quoteAndFillAttr(u'',data))
  67.     out.write(u'>Auto Download</span>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n\t<div id=')
  68.     out.write(quoteAndFillAttr(u'main-titlebar-tasks',data))
  69.     out.write(u'>\n\t\t<div id=')
  70.     out.write(quoteAndFillAttr(u'main-titlebar-tasks-settings',data))
  71.     out.write(u'>\n\t\t\t<p><a href=')
  72.     out.write(quoteAndFillAttr(u'#',data))
  73.     out.write(u' onclick=')
  74.     out.write(quoteAndFillAttr(u"eventURL('template:feed-settings');",data))
  75.     out.write(u'>Settings</a></p>\n\t\t</div>\n\t\t<div id=')
  76.     out.write(quoteAndFillAttr(u'main-titlebar-tasks-recommend',data))
  77.     out.write(u'>\n\t\t    <p><a i18n:translate=')
  78.     out.write(quoteAndFillAttr(u'',data))
  79.     out.write(u' class=')
  80.     out.write(quoteAndFillAttr(u"recommend_link'; return false;",data))
  81.     out.write(u' onclick="document.location = \'mailto:?subject=')
  82.     out.write(quoteattr(urlencode(toUni(evalKey(u'feed getTitle',data)))))
  83.     out.write(u'&body=%0D%0A%0D%0AYou should check out the Internet TV channel "')
  84.     out.write(quoteattr(urlencode(toUni(evalKey(u'feed getTitle',data)))))
  85.     out.write(u"". If you don\\'t have the Democracy Player, you can get it here:%0D%0A%0D%0Ahttp://www.getdemocracy.com/%0D%0A%0D%0AAnd then subscribe to this channel:%0D%0A%0D%0A")
  86.     out.write(quoteattr(urlencode(toUni(evalKey(u'feed getURL',data)))))
  87.     out.write(u'">Recommend</a></p>\n\t\t</div>\n\t\t<div id=')
  88.     out.write(quoteAndFillAttr(u'main-titlebar-tasks-search',data))
  89.     out.write(u'>\n\t\t    <input disabled=')
  90.     out.write(quoteAndFillAttr(u'1',data))
  91.     out.write(u' placeholder=')
  92.     out.write(quoteAndFillAttr(u'Search Channel',data))
  93.     out.write(u' type=')
  94.     out.write(quoteAndFillAttr(u'search',data))
  95.     out.write(u' class=')
  96.     out.write(quoteAndFillAttr(u'main-titlebar-tasks-search',data))
  97.     out.write(u'></input>\n\t\t</div>\n\t</div>\n</div>\n\n\n<div id=')
  98.     out.write(quoteAndFillAttr(u'main-container',data))
  99.     out.write(u'>\n\n<form action=')
  100.     out.write(quoteAndFillAttr(u'action:changeFeedSettings',data))
  101.     out.write(u' method=')
  102.     out.write(quoteAndFillAttr(u'GET',data))
  103.     out.write(u' name=')
  104.     out.write(quoteAndFillAttr(u'settings',data))
  105.     out.write(u'>\n\t<input type=')
  106.     out.write(quoteAndFillAttr(u'hidden',data))
  107.     out.write(u' name=')
  108.     out.write(quoteAndFillAttr(u'feed',data))
  109.     out.write(u' value="')
  110.     out.write(quoteattr(urlencode(toUni(evalKey(u'feed getID',data)))))
  111.     out.write(u'"></input>\n\t\n\t<div style=')
  112.     out.write(quoteAndFillAttr(u'text-align:center; margin-left:-40px;',data))
  113.     out.write(u' class=')
  114.     out.write(quoteAndFillAttr(u'main-content',data))
  115.     out.write(u'>\n\t\t<h3><a href=')
  116.     out.write(quoteAndFillAttr(u'#',data))
  117.     out.write(u' onclick=')
  118.     out.write(quoteAndFillAttr(u"eventURL('template:channel');",data))
  119.     out.write(u'>Back to Channel</a></h3>\n\t</div>\n\n\t<div id=')
  120.     out.write(quoteAndFillAttr(u'main-channelbar',data))
  121.     out.write(u' class=')
  122.     out.write(quoteAndFillAttr(u'main-channelbar',data))
  123.     out.write(u'>\n\t\t<h1>Channel Settings</h1>\n\t</div>\n\n\t<div style=')
  124.     out.write(quoteAndFillAttr(u'float:left; margin:20px 10px;',data))
  125.     out.write(u'>\n\t\t<div style=')
  126.     out.write(quoteAndFillAttr(u'float:left; display:inline; width:150px;',data))
  127.     out.write(u'>\n\t\t\tVideos expire after:\n\t\t</div>\n\t\t<div style=')
  128.     out.write(quoteAndFillAttr(u'float:left; display:inline; width:300px;',data))
  129.     out.write(u'>\t\t\t\n\t\t\t<select onChange=')
  130.     out.write(quoteAndFillAttr(u'javascript:setExpiration();',data))
  131.     out.write(u' name=')
  132.     out.write(quoteAndFillAttr(u'expireAfter',data))
  133.     out.write(u'>\n\t\t\t\t')
  134.     if evalKey(u'global filter equal', data)(evalKey(u'feed getExpirationType', data), u'system'):
  135.         for (func, args) in [(0, u'<option selected='), (10, u'1'), (0, u' value='), (10, u'system'), (0, u'>Default (<span>'), (4, u'feed getFormattedDefaultExpiration'), (0, u'</span>)</option>')]:
  136.             out.write(funcTable[func](data,'',args))
  137.     out.write(u'\n\t\t\t\t')
  138.     if not evalKey(u'global filter equal', data)(evalKey(u'feed getExpirationType', data), u'system'):
  139.         for (func, args) in [(0, u'<option value='), (10, u'system'), (0, u'>Default (<span>'), (4, u'feed getFormattedDefaultExpiration'), (0, u'</span>)</option>')]:
  140.             out.write(funcTable[func](data,'',args))
  141.     out.write(u'\n\t\t\t\t')
  142.     if evalKey(u'global filter equal', data)(evalKey(u'feed getExpirationTime', data), u'3'):
  143.         for (func, args) in [(0, u'<option selected='), (10, u'1'), (0, u' value='), (10, u'3'), (0, u'>3 hours</option>')]:
  144.             out.write(funcTable[func](data,'',args))
  145.     out.write(u'\n\t\t\t\t')
  146.     if not evalKey(u'global filter equal', data)(evalKey(u'feed getExpirationTime', data), u'3'):
  147.         for (func, args) in [(0, u'<option value='), (10, u'3'), (0, u'>3 hours</option>')]:
  148.             out.write(funcTable[func](data,'',args))
  149.     out.write(u'\n\t\t\t\t')
  150.     if evalKey(u'global filter equal', data)(evalKey(u'feed getExpirationTime', data), u'24'):
  151.         for (func, args) in [(0, u'<option selected='), (10, u'1'), (0, u' value='), (10, u'24'), (0, u'>1 day</option>')]:
  152.             out.write(funcTable[func](data,'',args))
  153.     out.write(u'\n\t\t\t\t')
  154.     if not evalKey(u'global filter equal', data)(evalKey(u'feed getExpirationTime', data), u'24'):
  155.         for (func, args) in [(0, u'<option value='), (10, u'24'), (0, u'>1 day</option>')]:
  156.             out.write(funcTable[func](data,'',args))
  157.     out.write(u'\n\t\t\t\t')
  158.     if evalKey(u'global filter equal', data)(evalKey(u'feed getExpirationTime', data), u'72'):
  159.         for (func, args) in [(0, u'<option selected='), (10, u'1'), (0, u' value='), (10, u'72'), (0, u'>3 days</option>')]:
  160.             out.write(funcTable[func](data,'',args))
  161.     out.write(u'\n\t\t\t\t')
  162.     if not evalKey(u'global filter equal', data)(evalKey(u'feed getExpirationTime', data), u'72'):
  163.         for (func, args) in [(0, u'<option value='), (10, u'72'), (0, u'>3 days</option>')]:
  164.             out.write(funcTable[func](data,'',args))
  165.     out.write(u'\n\t\t\t\t')
  166.     if evalKey(u'global filter equal', data)(evalKey(u'feed getExpirationTime', data), u'144'):
  167.         for (func, args) in [(0, u'<option selected='), (10, u'1'), (0, u' value='), (10, u'144'), (0, u'>6 days</option>')]:
  168.             out.write(funcTable[func](data,'',args))
  169.     out.write(u'\n\t\t\t\t')
  170.     if not evalKey(u'global filter equal', data)(evalKey(u'feed getExpirationTime', data), u'144'):
  171.         for (func, args) in [(0, u'<option value='), (10, u'144'), (0, u'>6 days</option>')]:
  172.             out.write(funcTable[func](data,'',args))
  173.     out.write(u'\n\t\t\t\t')
  174.     if evalKey(u'global filter equal', data)(evalKey(u'feed getExpirationTime', data), u'240'):
  175.         for (func, args) in [(0, u'<option selected='), (10, u'1'), (0, u' value='), (10, u'240'), (0, u'>10 days</option>')]:
  176.             out.write(funcTable[func](data,'',args))
  177.     out.write(u'\n\t\t\t\t')
  178.     if not evalKey(u'global filter equal', data)(evalKey(u'feed getExpirationTime', data), u'240'):
  179.         for (func, args) in [(0, u'<option value='), (10, u'240'), (0, u'>10 days</option>')]:
  180.             out.write(funcTable[func](data,'',args))
  181.     out.write(u'\n\t\t\t\t')
  182.     if evalKey(u'global filter equal', data)(evalKey(u'feed getExpirationTime', data), u'720'):
  183.         for (func, args) in [(0, u'<option selected='), (10, u'1'), (0, u' value='), (10, u'720'), (0, u'>1 month</option>')]:
  184.             out.write(funcTable[func](data,'',args))
  185.     out.write(u'\n\t\t\t\t')
  186.     if not evalKey(u'global filter equal', data)(evalKey(u'feed getExpirationTime', data), u'720'):
  187.         for (func, args) in [(0, u'<option value='), (10, u'720'), (0, u'>1 month</option>')]:
  188.             out.write(funcTable[func](data,'',args))
  189.     out.write(u'\n\t\t\t\t')
  190.     if evalKey(u'global filter equal', data)(evalKey(u'feed getExpirationType', data), u'never'):
  191.         for (func, args) in [(0, u'<option selected='), (10, u'1'), (0, u' value='), (10, u'never'), (0, u'>Never</option>')]:
  192.             out.write(funcTable[func](data,'',args))
  193.     out.write(u'\n\t\t\t\t')
  194.     if not evalKey(u'global filter equal', data)(evalKey(u'feed getExpirationType', data), u'never'):
  195.         for (func, args) in [(0, u'<option value='), (10, u'never'), (0, u'>Never</option>')]:
  196.             out.write(funcTable[func](data,'',args))
  197.     out.write(u'\n\t\t\t</select>\n\t\t</div>\t\t\n\t</div>\n\n\t<div style=')
  198.     out.write(quoteAndFillAttr(u'float:left; margin:0px 10px 20px 10px;',data))
  199.     out.write(u'>\n\t\t<div style=')
  200.     out.write(quoteAndFillAttr(u'float:left; display:inline; width:150px;',data))
  201.     out.write(u'>\n\t\t\tAuto download should:\n\t\t</div>\n\t\t<div style=')
  202.     out.write(quoteAndFillAttr(u'float:left; display:inline; width:300px;',data))
  203.     out.write(u'>\t\t\t\n\t\t\t<select onChange=')
  204.     out.write(quoteAndFillAttr(u'javascript:setAutoDownloadGets();',data))
  205.     out.write(u' name=')
  206.     out.write(quoteAndFillAttr(u'autoDownloadGets',data))
  207.     out.write(u'>\n\t\t\t\t')
  208.     if not evalKey(u'global filter boolean', data)(evalKey(u'feed getEverything', data), ''):
  209.         for (func, args) in [(0, u'<option selected='), (10, u'1'), (0, u' value='), (10, u'False'), (0, u'>Download new videos only</option>')]:
  210.             out.write(funcTable[func](data,'',args))
  211.     out.write(u'\n\t\t\t\t')
  212.     if evalKey(u'global filter boolean', data)(evalKey(u'feed getEverything', data), ''):
  213.         for (func, args) in [(0, u'<option value='), (10, u'False'), (0, u'>Download new videos only</option>')]:
  214.             out.write(funcTable[func](data,'',args))
  215.     out.write(u'\n\t\t\t\t')
  216.     if evalKey(u'global filter boolean', data)(evalKey(u'feed getEverything', data), ''):
  217.         for (func, args) in [(0, u'<option value='), (10, u'True'), (0, u' selected='), (10, u'1'), (0, u'>Download all videos</option>')]:
  218.             out.write(funcTable[func](data,'',args))
  219.     out.write(u'\n\t\t\t\t')
  220.     if not evalKey(u'global filter boolean', data)(evalKey(u'feed getEverything', data), ''):
  221.         for (func, args) in [(0, u'<option value='), (10, u'True'), (0, u'>Download all videos</option>')]:
  222.             out.write(funcTable[func](data,'',args))
  223.     out.write(u'\n\t\t\t</select>\n\t\t</div>\t\t\t\t\n\t</div>\n\n\t<div style=')
  224.     out.write(quoteAndFillAttr(u'clear:left; margin:0px 10px;',data))
  225.     out.write(u'>\n\t\t')
  226.     if not evalKey(u'global filter equal', data)(evalKey(u'feed getMaxNew', data), u'unlimited'):
  227.         for (func, args) in [(0, u'<input checked='), (10, u'checked'), (0, u' name='), (10, u'maxOutDownloads'), (0, u' onClick='), (10, u'javascript:setMaxNew();'), (0, u' type='), (10, u'checkbox'), (0, u'></input>')]:
  228.             out.write(funcTable[func](data,'',args))
  229.     out.write(u'\n\t\t')
  230.     if evalKey(u'global filter equal', data)(evalKey(u'feed getMaxNew', data), u'unlimited'):
  231.         for (func, args) in [(0, u'<input name='), (10, u'maxOutDownloads'), (0, u' onClick='), (10, u'javascript:setMaxNew();'), (0, u' type='), (10, u'checkbox'), (0, u'></input>')]:
  232.             out.write(funcTable[func](data,'',args))
  233.     out.write(u'\n\t\tIf I have\n\t\t')
  234.     if evalKey(u'global filter equal', data)(evalKey(u'feed getMaxNew', data), u'unlimited'):
  235.         for (func, args) in [(0, u'<input onBlur='), (10, u'javascript:setMaxNew();'), (0, u' name='), (10, u'maxNew'), (0, u' value='), (10, u'0'), (0, u' disabled='), (10, u'1'), (0, u' type='), (10, u'text'), (0, u' size='), (10, u'4'), (0, u'></input>')]:
  236.             out.write(funcTable[func](data,'',args))
  237.     out.write(u'\n\t\t')
  238.     if not evalKey(u'global filter equal', data)(evalKey(u'feed getMaxNew', data), u'unlimited'):
  239.         for (func, args) in [(0, u'<input onBlur='), (10, u'javascript:setMaxNew();'), (0, u' name='), (10, u'maxNew'), (0, u' value="'), (2, u'feed getMaxNew'), (0, u'" type='), (10, u'text'), (0, u' size='), (10, u'4'), (0, u'></input>')]:
  240.             out.write(funcTable[func](data,'',args))
  241.     out.write(u"\n\t\tvideos waiting, don't auto download more.<br></br>\n\t\t<span style=")
  242.     out.write(quoteAndFillAttr(u'font-size:90%; color:#666666;',data))
  243.     out.write(u'>(Keeps channel from hogging disk space)</span>\n\t</div>\n\n    <div style=')
  244.     out.write(quoteAndFillAttr(u'position: absolute; bottom:0%; margin:0px 10px 10px 10px;',data))
  245.     out.write(u'>\n        Channel URL: <span class=')
  246.     out.write(quoteAndFillAttr(u'selectable',data))
  247.     out.write('>')
  248.     out.write(escape(evalKey(u'feed getURL',data)))
  249.     out.write(u'</span>\n    </div>\n\n</form>\n\t\n</div>\n\n</body>\n</html>')
  250.     out.close()
  251.  
  252.  
  253.     return (out, handle)
  254.