# HG changeset patch
# User grandjoncl
# Date 1360340487 -3600
# Node ID 9a75d5046c35ed3584c701d2e68d4399189ff510
# Parent 1ae23cea5c58980fb66fc21f3e696beec986eed4
change on the embed popup configuration to have a checkbox autostart
diff -r 1ae23cea5c58 -r 9a75d5046c35 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html Fri Feb 08 16:44:17 2013 +0100
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html Fri Feb 08 17:21:27 2013 +0100
@@ -70,7 +70,7 @@
},
{% endif %}
height: '{{ player_height }}',
- autostart: true
+ autostart: {% if autostart %} true {% else %} false {% endif %}
} {% if polemic == 'all' or polemic == 'tweet' %},
{
type: "Polemic",
diff -r 1ae23cea5c58 -r 9a75d5046c35 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_popup.html
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_popup.html Fri Feb 08 16:44:17 2013 +0100
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_popup.html Fri Feb 08 17:21:27 2013 +0100
@@ -111,6 +111,9 @@
{% trans 'Create your own configuration' %}
+
+
Autostart
+
CreateAnnotation
diff -r 1ae23cea5c58 -r 9a75d5046c35 src/ldt/ldt/ldt_utils/views/workspace.py
--- a/src/ldt/ldt/ldt_utils/views/workspace.py Fri Feb 08 16:44:17 2013 +0100
+++ b/src/ldt/ldt/ldt_utils/views/workspace.py Fri Feb 08 17:21:27 2013 +0100
@@ -163,7 +163,10 @@
else:
rend_dict["polemic_qColor"] = "036aae"
-
+ if request.GET.has_key("autostart"):
+ rend_dict["autostart"] = {'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("autostart").lower())
+ else :
+ rend_dict["autostart"] = True
if request.GET.has_key("createannotation"):
rend_dict["createannotation"] = {'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("createannotation").lower())
if request.GET.has_key("show_mic_record"):
diff -r 1ae23cea5c58 -r 9a75d5046c35 src/ldt/ldt/static/ldt/js/embed_popup.js
--- a/src/ldt/ldt/static/ldt/js/embed_popup.js Fri Feb 08 16:44:17 2013 +0100
+++ b/src/ldt/ldt/static/ldt/js/embed_popup.js Fri Feb 08 17:21:27 2013 +0100
@@ -40,6 +40,8 @@
$j("#sparkline_fill_color").val("#aeaeb8");
var type_embed=document.getElementById("type_embed_div");
type_embed.checked=true;
+ var autostart_val = document.getElementById("autostart_checkbox");
+ autostart_val.checked = true;
$j("#createannotation_options").toggle(false);
mode1();
@@ -194,6 +196,7 @@
function generate_widget_code(){
var annotationslist_val=document.getElementById('annotations_list_checkbox');
+ var autostart_val = document.getElementById('autostart_checkbox');
var slideshare_val=document.getElementById('slideshare_checkbox');
var social_val=document.getElementById('social_checkbox');
var annotation_val=document.getElementById('annotation_checkbox');
@@ -225,9 +228,17 @@
}
widget_code+='\
- height: '+player_height_val+',\n\
+ height: '+player_height_val+',\n';
+ if (autostart_val.checked){
+ widget_code+='\
autostart: true\n\
}';
+ }
+ else{
+ widget_code+='\
+ autostart: false\n\
+ }';
+ }
if (polemic_val.checked){
defaultcolor= $j("#polemic_default_color").val();
foundcolor=$j("#polemic_found_color").val();
@@ -640,6 +651,7 @@
function generate_iframeUrl(){
var createannotation_val=document.getElementById('createannotation_checkbox');
+ var autostart_val = document.getElementById('autostart_checkbox');
var annotationslist_val=document.getElementById('annotations_list_checkbox');
var slideshare_val=document.getElementById('slideshare_checkbox');
var social_val=document.getElementById('social_checkbox');
@@ -655,7 +667,9 @@
iframeUrl+="&player_height="+$j("#player_height").val();
if ($j("#player_width").val()!=550)
iframeUrl+="&player_width="+$j("#player_width").val();
-
+ if(!autostart_val.checked){
+ iframeUrl+="&autostart=False";
+ }
if(createannotation_val.checked){
iframeUrl+="&createannotation=True";
var show_mic_record_val = document.getElementById('show_mic_record_checkbox');