]> git.parisson.com Git - telemeta.git/commitdiff
add TIMESIDE_AUTO_ZOOM in settings to auto toggle the player in zooming mode
authorGuillaume Pellerin <yomguy@parisson.com>
Tue, 21 Jan 2014 12:31:08 +0000 (13:31 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Tue, 21 Jan 2014 12:31:08 +0000 (13:31 +0100)
example/sandbox/settings.py
telemeta/templates/telemeta/mediaitem_detail.html
telemeta/views/item.py

index d50072f8dcf669aabcc47a8ef116bb6031437f51..7af4de45500a6ee62888dff4c34952795ff99f1c 100644 (file)
@@ -158,6 +158,7 @@ TELEMETA_PUBLIC_ACCESS_PERIOD = 51
 TELEMETA_DEFAULT_WAVEFORM_SIZES = ['360x130', '640x130']
 
 TIMESIDE_DEFAULT_GRAPHER_ID = 'waveform_centroid'
+TIMESIDE_AUTO_ZOOM = True
 
 AUTH_PROFILE_MODULE = 'telemeta.userprofile'
 SESSION_EXPIRE_AT_BROWSER_CLOSE = False
index b232e3e785252408d6d1a2ef8686143c209aee5d..a08aa8c4922e135fa3c912900a6c782b04abf6dc 100644 (file)
@@ -333,8 +333,13 @@ Item : <a href="{% url telemeta-item-detail item.public_id %}">{{ item }}</a>
 </div>
 {% endif %}
 
-{% endblock %}
+{% if auto_zoom %}
+<script type="text/javascript">
+ togglePlayerMaximization();
+</script>
+{% endif %}
 
+{% endblock %}
 
 {% block delete %}
 <a href="{% url telemeta-item-dublincore item.public_id %}" style="float:left;margin-top:0.5em;margin-bottom:1em" class="component_icon button icon_dublin_core">Dublin Core</a>
index 0ae7e9c0fffc51029938c97121103808665c3483..cc5660feba7b798ff3a0113e4d277fe60be6dfa8 100644 (file)
@@ -52,6 +52,7 @@ class ItemView(object):
     export_enabled = getattr(settings, 'TELEMETA_DOWNLOAD_ENABLED', True)
     export_formats = getattr(settings, 'TELEMETA_DOWNLOAD_FORMATS', ('mp3', 'wav'))
     default_grapher = getattr(settings, 'TIMESIDE_DEFAULT_GRAPHER_ID', ('waveform_simple'))
+    auto_zoom = getattr(settings, 'TIMESIDE_AUTO_ZOOM', False)
 
     def get_export_formats(self):
         formats = []
@@ -148,7 +149,7 @@ class ItemView(object):
 
         return render(request, template,
                     {'item': item, 'export_formats': self.get_export_formats(),
-                    'visualizers': self.get_graphers(),
+                    'visualizers': self.get_graphers(), 'auto_zoom': self.auto_zoom,
                     'audio_export_enabled': self.export_enabled,
                     'previous' : previous, 'next' : next, 'marker': marker_id, 'playlists' : playlists,
                     'access': access, 'width': width, 'height': height,