[xiph-commits] r3219 - in arkaiv/trunk: . arkaiv/controllers
arkaiv/model arkaiv/templates data/templates
dcrowdy at svn.annodex.net
dcrowdy at svn.annodex.net
Mon Sep 3 05:55:46 PDT 2007
Author: dcrowdy
Date: 2007-09-03 05:55:46 -0700 (Mon, 03 Sep 2007)
New Revision: 3219
Modified:
arkaiv/trunk/TODO
arkaiv/trunk/arkaiv/controllers/page.py
arkaiv/trunk/arkaiv/controllers/page.pyc
arkaiv/trunk/arkaiv/model/__init__.py
arkaiv/trunk/arkaiv/model/__init__.pyc
arkaiv/trunk/arkaiv/model/cmmlparser.py
arkaiv/trunk/arkaiv/model/cmmlparser.pyc
arkaiv/trunk/arkaiv/templates/displayitem.mak
arkaiv/trunk/data/templates/autohandler.py
arkaiv/trunk/data/templates/autohandler.pyc
arkaiv/trunk/data/templates/displayitem.mak.py
arkaiv/trunk/data/templates/displayitem.mak.pyc
Log:
Implemented meta tag removal
Modified: arkaiv/trunk/TODO
===================================================================
--- arkaiv/trunk/TODO 2007-09-03 06:42:52 UTC (rev 3218)
+++ arkaiv/trunk/TODO 2007-09-03 12:55:46 UTC (rev 3219)
@@ -1,5 +1,7 @@
TODO
+Implement addition of ogg file tag information.
+
Implement removal of meta tags from the head.
When going to an item from a clip link on the search results page, any
Modified: arkaiv/trunk/arkaiv/controllers/page.py
===================================================================
--- arkaiv/trunk/arkaiv/controllers/page.py 2007-09-03 06:42:52 UTC (rev 3218)
+++ arkaiv/trunk/arkaiv/controllers/page.py 2007-09-03 12:55:46 UTC (rev 3219)
@@ -356,7 +356,9 @@
print cliplist
# Extract meta info from the head and add to database
- metalist = parser.getheadinfofromcmml(newcmmlname)
+ parser = cmmlParser()
+ parser.setcmmlfilename(newcmmlname)
+ metalist = parser.getheadinfofromcmml()
for metadict in metalist:
metadict['headindex'] = headid
metadict['itemid'] = newitemid
@@ -484,7 +486,9 @@
model.addclip(clipdict)
# Extract meta info from the head and add to database
- metalist = parser.getheadinfofromcmml(newcmmlname)
+ parser = cmmlParser()
+ parser.setcmmlfilename(newcmmlname)
+ metalist = parser.getheadinfofromcmml()
for metadict in metalist:
metadict['headindex'] = headid
metadict['itemid'] = newitemid
@@ -534,4 +538,21 @@
def displayhelp(self):
return render('/help.mak')
+ def deletemeta(self):
+ metaid = request.params['metaid']
+ itemid = request.params['itemid']
+ headid = request.params['headid']
+ print "itemid is" + str(itemid)
+ model.deletemeta(metaid)
+ # easier to read meta info and add all in one go?
+ metalist = model.getmetasforhead(headid)
+ print metalist
+ # now write these back to the cmml file
+# parser = ...
+ cmmlfile = model.getitemcmmlfile(itemid)
+ parser = cmmlParser()
+ parser.setcmmlfilename(cmmlfile)
+ parser.syncheadmetas(metalist)
+ redirect_to(action='displayitem', id=itemid, edit="yes")
+
Modified: arkaiv/trunk/arkaiv/controllers/page.pyc
===================================================================
(Binary files differ)
Modified: arkaiv/trunk/arkaiv/model/__init__.py
===================================================================
--- arkaiv/trunk/arkaiv/model/__init__.py 2007-09-03 06:42:52 UTC (rev 3218)
+++ arkaiv/trunk/arkaiv/model/__init__.py 2007-09-03 12:55:46 UTC (rev 3219)
@@ -610,3 +610,10 @@
return resultsdict
+def deletemeta(metaid):
+ meta_q = sac.query(Meta)
+ m = meta_q.get_by(ixm=metaid)
+ sac.session.delete(m)
+ sac.session.flush()
+ return
+
Modified: arkaiv/trunk/arkaiv/model/__init__.pyc
===================================================================
(Binary files differ)
Modified: arkaiv/trunk/arkaiv/model/cmmlparser.py
===================================================================
--- arkaiv/trunk/arkaiv/model/cmmlparser.py 2007-09-03 06:42:52 UTC (rev 3218)
+++ arkaiv/trunk/arkaiv/model/cmmlparser.py 2007-09-03 12:55:46 UTC (rev 3219)
@@ -108,10 +108,13 @@
return cliplist
def getheadinfofromcmml(self, cmmlfilename):
- Etree = ElementTree
- doc = Etree.parse(cmmlfilename)
- root = doc.getroot()
- head = root.getiterator('head')
+ """ given a cmmlfile, returns a list of the meta tags in the head
+
+ """
+ #Etree = ElementTree
+ #doc = Etree.parse(cmmlfilename)
+ #root = doc.getroot()
+ head = self.root.getiterator('head')
metalist = []
for h in head:
mlist = h.findall('meta')
@@ -211,3 +214,13 @@
elementiterator = root.getiterator(element)
return
+# def addheadmetas(metalist):
+# root = self.doc.getroot()
+# head = root.getiterator('head')
+# for h in head:
+# mlist = h.findall('meta')
+# for m in mlist:
+# h.remove(m)
+
+
+
Modified: arkaiv/trunk/arkaiv/model/cmmlparser.pyc
===================================================================
(Binary files differ)
Modified: arkaiv/trunk/arkaiv/templates/displayitem.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/displayitem.mak 2007-09-03 06:42:52 UTC (rev 3218)
+++ arkaiv/trunk/arkaiv/templates/displayitem.mak 2007-09-03 12:55:46 UTC (rev 3219)
@@ -77,6 +77,15 @@
new Ajax.InPlaceEditor('editmetacontent', '/page/editheadmetaname', { callback: function(form, value) { return 'id=${metainfo['id']}&field=content&itemid=${c.itemid}&myparam=' + escape(value) }});
</script>
</td>
+<td>
+${ h.form(h.url(action='deletemeta'), multipart=True) }
+${ h.submit('Delete') }
+${ h.hidden_field('metaid', value=metainfo['ixm']) }
+${ h.hidden_field('itemid', value=c.itemid) }
+${ h.hidden_field('headid', value=c.headdict['ixh']) }
+${ h.end_form() }
+
+</td>
</tr>
% endfor
</table>
@@ -91,7 +100,7 @@
</tr>
<tr>
- <td> ${ h.text_field('metaid', size=5) }</td>
+ <td>${ h.text_field('metaid', size=5) }</td>
<td>${ h.text_field('metaname') }</td>
<td>${ h.text_field('metacontent') }</td>
</tr>
@@ -175,7 +184,9 @@
<tr>
<td>Start</td>
<td>${ h.text_field('starttime', size=5) }</td>
- <td>Desc</td>
+</tr>
+<tr>
+<td>Desc</td>
<td>
<input type="text" name="desc" size="20" onfocus="disableShortcuts()" onblur="enableShortcuts()" id="desc" />
<!--${ h.text_field('desc') }--></td>
@@ -183,6 +194,8 @@
<tr>
<td>a_text</td>
<td>${ h.text_field('a_text') }</td>
+</tr>
+<tr>
<td>a_href</td>
<td>${ h.text_field('a_href') }</td>
</tr>
Modified: arkaiv/trunk/data/templates/autohandler.py
===================================================================
--- arkaiv/trunk/data/templates/autohandler.py 2007-09-03 06:42:52 UTC (rev 3218)
+++ arkaiv/trunk/data/templates/autohandler.py 2007-09-03 12:55:46 UTC (rev 3219)
@@ -1,7 +1,7 @@
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
_magic_number = 2
-_modified_time = 1188622693.3342869
+_modified_time = 1188780210.5353839
_template_filename=u'/home/dcrowdy/src/working/test/arkaiv/trunk/arkaiv/templates/autohandler'
_template_uri=u'/autohandler'
_template_cache=cache.Cache(__name__, _modified_time)
@@ -19,7 +19,7 @@
context.write(u'<html>\n <head>\n <title>Arkaiv</title>\n <link rel="stylesheet" href="/quick.css"></link>\n')
# SOURCE LINE 5
context.write(unicode( h.javascript_include_tag('/javascripts/effects.js', builtins=True) ))
- context.write(u' \n\n </head>\n <body>\n<p class="header">\n<h1>Arkaiv</h1>\n<div id="navcontainer">\n<ul id="navlist">\n <li>')
+ context.write(u' \n\n </head>\n <body onkeypress=\'keyPressed(event)\'>\n<p class="header">\n<h1>Arkaiv</h1>\n<div id="navcontainer">\n<ul id="navlist">\n <li>')
# SOURCE LINE 13
context.write(unicode( h.link_to("All Items", h.url(action="mainpage")) ))
context.write(u'</li>\n <li>')
@@ -27,18 +27,21 @@
context.write(unicode( h.link_to("Collections", h.url(action="collections")) ))
context.write(u'</li>\n <li>')
# SOURCE LINE 15
- context.write(unicode( h.link_to("Add annodex media", h.url(action="addannodexform")) ))
+ context.write(unicode( h.link_to("Add media", h.url(action="addannodexform")) ))
+ context.write(u'</li>\n <li>')
+ # SOURCE LINE 16
+ context.write(unicode( h.link_to("Help", h.url(action="displayhelp")) ))
context.write(u'</li>\n <li><span class="searchpadding">\n')
- # SOURCE LINE 17
+ # SOURCE LINE 18
context.write(unicode( h.form(h.url(action='search'), multipart=True) ))
context.write(u'\n')
- # SOURCE LINE 18
+ # SOURCE LINE 19
context.write(unicode( h.text_field('searchterms', value="Search") ))
context.write(u' \n')
- # SOURCE LINE 19
+ # SOURCE LINE 20
context.write(unicode( h.end_form() ))
context.write(u' \n </span>\n </li>\n</ul>\n</div>\n</p>\n\n <!--div class="content"-->\n')
- # SOURCE LINE 27
+ # SOURCE LINE 28
context.write(unicode(next.body()))
context.write(u'\n <p class="footer">\n </p>\n <!--/div-->\n </body>\n</html>\n\n')
return ''
Modified: arkaiv/trunk/data/templates/autohandler.pyc
===================================================================
(Binary files differ)
Modified: arkaiv/trunk/data/templates/displayitem.mak.py
===================================================================
--- arkaiv/trunk/data/templates/displayitem.mak.py 2007-09-03 06:42:52 UTC (rev 3218)
+++ arkaiv/trunk/data/templates/displayitem.mak.py 2007-09-03 12:55:46 UTC (rev 3219)
@@ -1,7 +1,7 @@
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
_magic_number = 2
-_modified_time = 1188629045.8835859
+_modified_time = 1188822727.9317019
_template_filename='/home/dcrowdy/src/working/test/arkaiv/trunk/arkaiv/templates/displayitem.mak'
_template_uri='/displayitem.mak'
_template_cache=cache.Cache(__name__, _modified_time)
@@ -27,124 +27,142 @@
h = context.get('h', UNDEFINED)
c = context.get('c', UNDEFINED)
# SOURCE LINE 1
- context.write(u' \n<div id="video">\n<p id="edititemname">')
- # SOURCE LINE 3
+ context.write(u' \n<div id="video">\n\n<p id="edititemname">')
+ # SOURCE LINE 4
context.write(unicode(c.itemname))
context.write(u'</p>\n<script type="text/javascript">\n new Ajax.InPlaceEditor(\'edititemname\', \'/page/edititemname\', { callback: function(form, value) { return \'itemid=')
- # SOURCE LINE 5
+ # SOURCE LINE 6
context.write(unicode(c.itemid))
context.write(u"&myparam=' + escape(value) }});\n</script>\n\n\n")
- # SOURCE LINE 9
+ # SOURCE LINE 10
context.write(unicode( h.form(h.url(action='deleteitem'), multipart=True) ))
context.write(u'\n')
- # SOURCE LINE 10
+ # SOURCE LINE 11
context.write(unicode( h.submit('Delete') ))
context.write(u' \n')
- # SOURCE LINE 11
+ # SOURCE LINE 12
context.write(unicode( h.hidden_field('itemid', value=c.itemid) ))
context.write(u'\n')
- # SOURCE LINE 12
+ # SOURCE LINE 13
context.write(unicode( h.end_form() ))
context.write(u' \n \n <embed type="application/liboggplay"\n src="')
- # SOURCE LINE 15
+ # SOURCE LINE 16
context.write(unicode(c.sourcedict['urlpath']))
context.write(unicode(c.sourcedict['clipdetail']))
- context.write(u'"\n width="320" height="240"/>\n<form name="api">\n<table style="font-size:small">\n<tr>\n<td><input type="button" value="<<" onclick=\'skip(-1)\'/></td>\n<td><input type="button" value="Play" onclick=\'Play()\'/></td>\n<td><input type="button" value="Pause" onclick=\'Pause()\'/></td>\n<td><input type="button" value=">>" onclick=\'skip(1)\'/></td>\n</tr>\n<tr>\n<td><input type="button" value="Get position" onclick=\'GetPlayPosition()\'/></td>\n<td><input type="button" value="Go to pos" onclick=\'GotoPosition()\'/></td>\n<td><input type="text" name="gotofield" size="5"/></td>\n<td>(secs)</td>\n</tr>\n</table>\n<table style="font-size:small">\n<tr>\n<td>Output:</td>\n<td><textarea name="ofield" cols="40" rows="2"></textarea></td>\n</tr>\n<tr>\n<td>Amount to move << and >> (msecs):</td>\n<td><input type="text" name="ifield" size="20"/></td>\n</tr>\n</table>\n</form>\n\n<hr>\nHead:\n')
- # SOURCE LINE 46
+ context.write(u'"\n width="320" height="240"/>\n<form name="api">\n<table style="font-size:small">\n<tr>\n<td><input type="button" value="<<" onclick=\'skip(-1)\'/></td>\n<td><input type="button" value="Play" onclick=\'Play()\'/></td>\n<td><input type="button" value="Pause" onclick=\'Pause()\'/></td>\n<td><input type="button" value=">>" onclick=\'skip(1)\'/></td>\n</tr>\n<tr>\n<td><input type="button" value="Get position" onclick=\'GetPlayPosition()\'/></td>\n<td><input type="button" value="Go to pos" onclick=\'GotoPosition()\'/></td>\n<td><input type="text" name="gotofield" size="5"/></td>\n<td>(secs)</td>\n<td>Disable key shortcuts:</td>\n<td><input type="checkbox" name="shortcuts" value="toggle" onchange="toggleShortcuts()"></td>\n</tr>\n</table>\n<table style="font-size:small">\n<tr>\n<td>Output:</td>\n<td><textarea name="ofield" cols="40" rows="2"></textarea></td>\n</tr>\n<tr>\n<td>Amount to move << and >> (msecs):</td>\n<td><input type="text" name="ifiel
d" size="20"/></td>\n</tr>\n</table>\n</form>\n\n<hr>\nHead:\n')
+ # SOURCE LINE 49
context.write(unicode( h.form(h.url(action='editheadinfo'), multipart=True) ))
context.write(u'\nid:\n')
- # SOURCE LINE 48
+ # SOURCE LINE 51
context.write(unicode( h.text_field('headid', value=c.headdict['id']) ))
context.write(u'\nTitle:\n')
- # SOURCE LINE 50
+ # SOURCE LINE 53
context.write(unicode( h.text_field('headtitle', value=c.headdict['title']) ))
context.write(u'\n')
- # SOURCE LINE 51
+ # SOURCE LINE 54
context.write(unicode( h.hidden_field('itemid', value=c.itemid) ))
context.write(u'\n\n')
- # SOURCE LINE 53
+ # SOURCE LINE 56
context.write(unicode( h.submit('Edit') ))
context.write(u' \n')
- # SOURCE LINE 54
+ # SOURCE LINE 57
context.write(unicode( h.end_form() ))
context.write(u' \n<br />\n<hr>\nMeta information:<br />\n<table style="font-size:small">\n<tr>\n <td>Name</td>\n <td>Content</td>\n</tr>\n')
- # SOURCE LINE 63
+ # SOURCE LINE 66
for metainfo in c.metalist:
- # SOURCE LINE 64
+ # SOURCE LINE 67
context.write(u'<tr>\n<td>\n<p id="editmetaname">')
- # SOURCE LINE 66
+ # SOURCE LINE 69
context.write(unicode(metainfo['name']))
context.write(u'</p>\n<script type="text/javascript">\n new Ajax.InPlaceEditor(\'editmetaname\', \'/page/editheadmetaname\', { callback: function(form, value) { return \'id=')
- # SOURCE LINE 68
+ # SOURCE LINE 71
context.write(unicode(metainfo['id']))
context.write(u'&field=name&itemid=')
context.write(unicode(c.itemid))
context.write(u'&myparam=\' + escape(value) }});\n</script>\n</td>\n<td>\n<p id="editmetacontent">')
- # SOURCE LINE 72
+ # SOURCE LINE 75
context.write(unicode(metainfo['content']))
context.write(u'</p>\n<script type="text/javascript">\n new Ajax.InPlaceEditor(\'editmetacontent\', \'/page/editheadmetaname\', { callback: function(form, value) { return \'id=')
- # SOURCE LINE 74
+ # SOURCE LINE 77
context.write(unicode(metainfo['id']))
context.write(u'&field=content&itemid=')
context.write(unicode(c.itemid))
- context.write(u"&myparam=' + escape(value) }});\n</script>\n</td>\n</tr> \n")
- # SOURCE LINE 79
+ context.write(u"&myparam=' + escape(value) }});\n</script>\n</td>\n<td>\n")
+ # SOURCE LINE 81
+ context.write(unicode( h.form(h.url(action='deletemeta'), multipart=True) ))
+ context.write(u'\n')
+ # SOURCE LINE 82
+ context.write(unicode( h.submit('Delete') ))
+ context.write(u'\n')
+ # SOURCE LINE 83
+ context.write(unicode( h.hidden_field('metaid', value=metainfo['ixm']) ))
+ context.write(u'\n')
+ # SOURCE LINE 84
+ context.write(unicode( h.hidden_field('itemid', value=c.itemid) ))
+ context.write(u'\n')
+ # SOURCE LINE 85
+ context.write(unicode( h.hidden_field('headid', value=c.headdict['ixh']) ))
+ context.write(u'\n')
+ # SOURCE LINE 86
+ context.write(unicode( h.end_form() ))
+ context.write(u' \n\n</td>\n</tr> \n')
+ # SOURCE LINE 91
context.write(u'</table>\n<hr>\nAdd new meta tag:\n')
- # SOURCE LINE 82
+ # SOURCE LINE 94
context.write(unicode( h.form(h.url(action='addmetainfo'), multipart=True) ))
- context.write(u'\n<table style="font-size:small">\n<tr>\n <td>Id</td>\n <td>Name</td>\n <td>Content</td>\n</tr>\n\n<tr>\n <td> ')
- # SOURCE LINE 91
+ context.write(u'\n<table style="font-size:small">\n<tr>\n <td>Id</td>\n <td>Name</td>\n <td>Content</td>\n</tr>\n\n<tr>\n <td>')
+ # SOURCE LINE 103
context.write(unicode( h.text_field('metaid', size=5) ))
context.write(u'</td>\n <td>')
- # SOURCE LINE 92
+ # SOURCE LINE 104
context.write(unicode( h.text_field('metaname') ))
context.write(u'</td>\n <td>')
- # SOURCE LINE 93
+ # SOURCE LINE 105
context.write(unicode( h.text_field('metacontent') ))
context.write(u'</td>\n</tr>\n</table>\n')
- # SOURCE LINE 96
+ # SOURCE LINE 108
context.write(unicode( h.hidden_field('metascheme') ))
context.write(u'\n')
- # SOURCE LINE 97
+ # SOURCE LINE 109
context.write(unicode( h.hidden_field('headindex', value = c.headdict['ixh']) ))
context.write(u'\n')
- # SOURCE LINE 98
+ # SOURCE LINE 110
context.write(unicode( h.hidden_field('itemid', value=c.itemid) ))
context.write(u'\n\n')
- # SOURCE LINE 100
+ # SOURCE LINE 112
context.write(unicode( h.submit('Add') ))
context.write(u' \n')
- # SOURCE LINE 101
+ # SOURCE LINE 113
context.write(unicode( h.end_form() ))
context.write(u' \n\n<hr>\n\n\n<!--div class="sourceinfo"-->\n<table style="font-size:small">\n<tr>\n<td>Duration:</td><td> ')
- # SOURCE LINE 109
+ # SOURCE LINE 121
context.write(unicode(c.sourcedict['duration']))
context.write(u'</td>\n</tr>\n<tr>\n<td>Bitrate: </td><td>')
- # SOURCE LINE 112
+ # SOURCE LINE 124
context.write(unicode(c.sourcedict['bitrate']))
context.write(u'</td>\n</tr>\n<tr>\n<td>Resolution: </td><td>')
- # SOURCE LINE 115
+ # SOURCE LINE 127
context.write(unicode(c.sourcedict['resolution']))
context.write(u'</td>\n</tr>\n<tr>\n<td>Framerate: </td><td>')
- # SOURCE LINE 118
+ # SOURCE LINE 130
context.write(unicode(c.sourcedict['framerate']))
context.write(u'</td>\n</tr>\n<tr>\n<td>Audio: </td><td>')
- # SOURCE LINE 121
+ # SOURCE LINE 133
context.write(unicode(c.sourcedict['audio']))
context.write(u'</td>\n</tr>\n<tr>\n<td>Has video: </td><td>')
- # SOURCE LINE 124
+ # SOURCE LINE 136
context.write(unicode(c.sourcedict['has_video']))
context.write(u'</td>\n</tr>\n<tr>\n<td>Has audio: </td><td>')
- # SOURCE LINE 127
+ # SOURCE LINE 139
context.write(unicode(c.sourcedict['has_audio']))
context.write(u'</td>\n</tr>\n</table>\n\n<!--/div!-->\n</div>\n\n<div id="clips">\nClips:\n<br />\n<table style="font-size:small">\n<tr>\n <td></td>\n <td>Time</td>\n <td></td>\n <td></td> \n</tr>\n')
- # SOURCE LINE 144
+ # SOURCE LINE 156
for clipinfo in c.cliplist:
- # SOURCE LINE 145
+ # SOURCE LINE 157
context.write(u'<tr>\n')
- # SOURCE LINE 146
+ # SOURCE LINE 158
if c.sourcedict['has_video'] == "Yes":
- # SOURCE LINE 147
+ # SOURCE LINE 159
context.write(u' <td><a onclick="javascript:SetLocation(\'')
context.write(unicode(c.sourcedict['urlpath']))
context.write(u'?id=')
@@ -153,77 +171,71 @@
context.write(unicode(c.sourcedict['clipimageurl']))
context.write(unicode(clipinfo['img_src']))
context.write(u'"></a></td>\n')
- # SOURCE LINE 149
+ # SOURCE LINE 161
if c.sourcedict['has_video'] == "No":
- # SOURCE LINE 150
+ # SOURCE LINE 162
context.write(u' <td><a onclick="javascript:SetLocation(\'')
context.write(unicode(c.sourcedict['urlpath']))
context.write(u'?id=')
context.write(unicode(clipinfo['id']))
context.write(u'\')"><img src="/images/blank.png"></a></td>\n')
- # SOURCE LINE 152
+ # SOURCE LINE 164
context.write(u' <td>')
context.write(unicode(clipinfo['start_time']))
context.write(u'</td>\n <td>')
- # SOURCE LINE 153
+ # SOURCE LINE 165
context.write(unicode(clipinfo['desc']))
context.write(u'</td>\n <td>')
- # SOURCE LINE 154
+ # SOURCE LINE 166
context.write(unicode(clipinfo['a_href']))
context.write(u'</td>\n\n\n')
- # SOURCE LINE 157
+ # SOURCE LINE 169
context.write(unicode( h.form(h.url(action='deleteclip'), multipart=True) ))
context.write(u'\n<td>')
- # SOURCE LINE 158
+ # SOURCE LINE 170
context.write(unicode( h.submit('Delete') ))
context.write(u' </td>\n')
- # SOURCE LINE 159
+ # SOURCE LINE 171
context.write(unicode( h.hidden_field('clipid', value=clipinfo['ixc']) ))
context.write(u'\n')
- # SOURCE LINE 160
+ # SOURCE LINE 172
context.write(unicode( h.hidden_field('itemid', value=c.itemid) ))
context.write(u'\n')
- # SOURCE LINE 161
+ # SOURCE LINE 173
context.write(unicode( h.end_form() ))
context.write(u' \n\n\n</tr> \n')
- # SOURCE LINE 166
- context.write(u'</table>\n\nAdd new clip:\n')
- # SOURCE LINE 169
+ # SOURCE LINE 178
+ context.write(u'</table>\n\nAdd new clip:\n<!--')
+ # SOURCE LINE 181
context.write(unicode( h.form(h.url(action='addclip'), multipart=True) ))
- context.write(u'\n<table style="font-size:small">\n<tr>\n <td>Start time</td>\n <td>')
- # SOURCE LINE 173
+ context.write(u'-->\n<form name="addaclip" action="addclip" >\n<table style="font-size:small">\n<tr>\n <td>Start</td>\n <td>')
+ # SOURCE LINE 186
context.write(unicode( h.text_field('starttime', size=5) ))
- context.write(u'</td>\n <td>a_text</td>\n <td>')
- # SOURCE LINE 175
+ context.write(u'</td>\n</tr>\n<tr>\n<td>Desc</td>\n <td>\n <input type="text" name="desc" size="20" onfocus="disableShortcuts()" onblur="enableShortcuts()" id="desc" />\n <!--')
+ # SOURCE LINE 192
+ context.write(unicode( h.text_field('desc') ))
+ context.write(u'--></td>\n</tr>\n<tr>\n <td>a_text</td>\n <td>')
+ # SOURCE LINE 196
context.write(unicode( h.text_field('a_text') ))
- context.write(u'</td>\n</tr>\n<tr>\n <td>Id</td>\n <td>')
- # SOURCE LINE 179
- context.write(unicode( h.text_field('id', size=5) ))
- context.write(u'</td>\n <td>a_href</td>\n <td>')
- # SOURCE LINE 181
+ context.write(u'</td>\n</tr>\n<tr>\n <td>a_href</td>\n <td>')
+ # SOURCE LINE 200
context.write(unicode( h.text_field('a_href') ))
- context.write(u'</td>\n</tr>\n<tr>\n <td>img_src</td>\n <td>')
- # SOURCE LINE 185
- context.write(unicode( h.text_field('img_src', size=5) ))
- context.write(u'</td>\n <td>desc</td>\n <td>')
- # SOURCE LINE 187
- context.write(unicode( h.text_field('desc') ))
context.write(u'</td>\n</tr>\n</table>\n')
- # SOURCE LINE 190
+ # SOURCE LINE 203
context.write(unicode( h.hidden_field('headindex', value = c.headdict['ixh']) ))
context.write(u'\n')
- # SOURCE LINE 191
+ # SOURCE LINE 204
context.write(unicode( h.hidden_field('itemid', value=c.itemid) ))
context.write(u'\n')
- # SOURCE LINE 192
+ # SOURCE LINE 205
context.write(unicode( h.hidden_field('hasvideo', value=c.sourcedict['has_video']) ))
- context.write(u'\n\n')
- # SOURCE LINE 194
+ context.write(u'\n')
+ # SOURCE LINE 206
context.write(unicode( h.submit('Add') ))
context.write(u' \n')
- # SOURCE LINE 195
+ # SOURCE LINE 207
context.write(unicode( h.end_form() ))
- context.write(u' \n</div>\n<script>\nvar plugin = document.embeds[0];\nvar input = document.api.ifield;\nvar goto = document.api.gotofield;\nvar output = document.api.ofield;\n\nfunction Play() {\n plugin.play();\n addOutput("Play!");\n}\n\nfunction Pause() {\n plugin.pause();\n addOutput("Pause!");\n}\n\nfunction SetLocation(location) {\n// plugin.setPlayPosition(location);\n plugin.setCurrentMovie(location);\n addOutput("Current movie: " + plugin.getCurrentMovie());\n addOutput("setting a location: " + location + " ms");\n}\n\nfunction GetPlayPosition() {\n addOutput("Play position: " + plugin.getPlayPosition() + " ms");\n}\n\nfunction skip(dir) {\n// addOutput("we get here")\n i = getInput();\n addOutput("i is " + i);\n if (i <= 0) i = 1000;\n addOutput("dir is " + dir);\n t = plugin.getPlayPosition() + (i * dir);\n addOutput("t is " + t);\n addOutput("Skipping by " + i + " to " + t + " ms - " +\n (plugin.setPlayPositi
on(t) ? "succeeded" : "failed"));\n}\n\nfunction getInput() {\n i = parseInt(input.value);\n return isNaN(i) ? 0 : i;\n}\n\nfunction getGoto() {\n i = parseInt(goto.value);\n return isNaN(i) ? 0 : i;\n}\n\n\nfunction GotoPosition() {\n i = getGoto();\n i = i * 1000;\n plugin.setPlayPosition(i);\n}\n\nvar outLines = 0;\n\nfunction addOutput(str) {\n if (outLines == 0) {\n output.value = str;\n } else {\n output.value = str + "\\n" + output.value;\n }\n outLines++;\n if (outLines == 11) {\n i = output.value.lastIndexOf("\\n");\n output.value = output.value.substr(0, i);\n outLines--;\n }\n}\n</script>\n\n')
+ context.write(u' \n\n<script>\nvar plugin = document.embeds[0];\nvar input = document.api.ifield;\nvar clipstart = document.addaclip.starttime;\nvar goto = document.api.gotofield;\nvar output = document.api.ofield;\nvar focusid = "enable";\nvar shortcuts = document.api.shortcuts;\n\nfunction Play() {\n plugin.play();\n addOutput("Play");\n}\n\nfunction Pause() {\n plugin.pause();\n addOutput("Pause");\n}\n\nfunction SetLocation(location) {\n// plugin.setPlayPosition(location);\n plugin.setCurrentMovie(location);\n addOutput("Current movie: " + plugin.getCurrentMovie());\n addOutput("setting a location: " + location + " ms");\n}\n\nfunction GetPlayPosition() {\n addOutput("Play position: " + plugin.getPlayPosition() + " ms");\n}\n\nfunction PauseOrPlay(){\n\taddOutput("current state: " + plugin.getCurrentState());\n\tif (plugin.getCurrentState()==0) {Play();}\n\telse {\n\tif (plugin.getCurrentState()==1) Pause();}\n}\n\nfunction skip(dir) {\n// addOutput
("we get here")\n i = getInput();\n addOutput("i is " + i);\n if (i <= 0) i = 1000;\n addOutput("dir is " + dir);\n t = plugin.getPlayPosition() + (i * dir);\n addOutput("t is " + t);\n addOutput("Skipping by " + i + " to " + t + " ms - " +\n (plugin.setPlayPosition(t) ? "succeeded" : "failed"));\n}\n\nfunction getInput() {\n i = parseInt(input.value);\n return isNaN(i) ? 0 : i;\n}\n\nfunction getGoto() {\n i = parseInt(goto.value);\n return isNaN(i) ? 0 : i;\n}\n\n\nfunction GotoPosition() {\n i = getGoto();\n i = i * 1000;\n plugin.setPlayPosition(i);\n}\n\nvar outLines = 0;\n\nfunction addOutput(str) {\n if (outLines == 0) {\n output.value = str;\n } else {\n output.value = str + "\\n" + output.value;\n }\n outLines++;\n if (outLines == 11) {\n i = output.value.lastIndexOf("\\n");\n output.value = output.value.substr(0, i);\n outLines--;\n }\n\n}\n\nfunction addClipStarttime() {\n clipstart.value = plugin.getPla
yPosition()/1000;\n}\n\nfunction keyPressed(e) {\n if (focusid=="disable") {return;}\n else {\n switch (String.fromCharCode(e.which)) {\n \tcase "t": GetPlayPosition(); break;\n \tcase "s": addClipStarttime(); break;\n \tcase "p": PauseOrPlay(); break;\n }\n focusid="enable";\n }\n}\nfunction disableShortcuts() {\n focusid="disable";\n addOutput("Shortcuts: " + focusid);\n }\n\nfunction enableShortcuts() {\n focusid="enable";\n addOutput("Shortcuts: " + focusid);\n }\n\nfunction toggleShortcuts() {\n if (focusid=="enable") {focusid="disable";}\n else {\n if (focusid=="disable") {focusid="enable";}\n }\n\n}\n\n</script>\n\n\n')
return ''
finally:
context.caller_stack.pop_frame()
Modified: arkaiv/trunk/data/templates/displayitem.mak.pyc
===================================================================
(Binary files differ)
More information about the commits
mailing list