Merge with e107b22256805bd992817fc0161f0611235eff51
authorgrandjoncl
Mon, 12 Nov 2012 16:17:22 +0100
changeset 931 cc5442349bdd
parent 925 fd2d4a7a5de6 (current diff)
parent 930 e107b2225680 (diff)
child 932 170da3907040
Merge with e107b22256805bd992817fc0161f0611235eff51
src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html
src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_popup.html
src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html
src/ldt/ldt/ldt_utils/views/workspace.py
src/ldt/ldt/locale/fr/LC_MESSAGES/django.mo
src/ldt/ldt/locale/fr/LC_MESSAGES/django.po
src/ldt/ldt/static/ldt/js/embed_popup.js
src/ldt/ldt/static/ldt/js/projectscontents.js
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html	Mon Nov 12 13:28:31 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html	Mon Nov 12 16:17:22 2012 +0100
@@ -1,4 +1,5 @@
 {% load i18n %}
+{% load thumbnail %}
 {% load analytics %}
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
@@ -11,14 +12,201 @@
 		<meta http-equiv="Cache" content="no store" />
 		<meta http-equiv="Expires" content="-1" />
 		<title>Ligne de Temps - IRI - Metadata Player</title>
+		<script type="text/javascript">
+			{% if tag_titles %}
+				tag_string= '{{ tag_titles }}';
+				tag_titles_array=tag_string.split(",");
+			{% endif %}
+		</script>
 	</head>
 	<body id="init_embed_popup">
 		<div style="float:left; width:550px;" id="wrapper_{{player_id}}">
-		{% include "ldt/ldt_utils/partial/embed_player.html" %}  
+		
+		<div>
+			<div id="{{ player_id }}_embed" class="iri_player_embed"></div>
+			<script type="text/javascript" src="{{WEB_URL}}{{LDT_MEDIA_PREFIX}}metadataplayer/LdtPlayer-core.js"></script>
+			<script type="text/javascript">
+			
+			if (typeof jQuery == "undefined") {
+				jQuery = IriSP.jQuery;
+			}
+				var metadatas = {metadata: {url: '{{json_url}}'}};
+				var metadata_key = "metadata";
+			
+			IriSP.libFiles.defaultDir = "{{WEB_URL}}{{LDT_MEDIA_PREFIX}}js/";
+			IriSP.libFiles.locations.jwPlayerSWF = "{{WEB_URL}}{{LDT_MEDIA_PREFIX}}swf/player.swf";
+			IriSP.libFiles.locations.recordMicSwf = "{{WEB_URL}}{{LDT_MEDIA_PREFIX}}swf/record_mic.swf";
+			IriSP.libFiles.locations.zeroClipboardSwf = "{{WEB_URL}}{{LDT_MEDIA_PREFIX}}swf/ZeroClipboard10.swf";
+			IriSP.libFiles.locations.cssjQueryUI = "{{WEB_URL}}{{LDT_MEDIA_PREFIX}}css/jq-css/themes/base/jquery-ui.css"
+			IriSP.language = '{{LANGUAGE_CODE}}';
+			
+			IriSP.widgetsDir = "{{WEB_URL}}{{LDT_MEDIA_PREFIX}}metadataplayer";
+			var _metadata = {
+			    url: metadatas[metadata_key].url + '?callback=?',
+			    format: 'ldt'
+			};
+			var _config = {
+			    width: '{{ player_width }}',
+			    container: '{{ player_id }}_embed',
+			    css: '{{WEB_URL}}{{LDT_MEDIA_PREFIX}}metadataplayer/LdtPlayer-core.css',
+			    default_options: {
+			        metadata: _metadata
+			    },
+			    widgets: [
+			        {
+			        	type: "AutoPlayer",
+			            {% if external_url %}
+			                    video: "{{ external_url }}",
+			            {% else %}
+			                    streamer: function(_url) {
+			                        var _matches = _url.match(/^[^\/]+\/\/[^\/]+\/[^\/]+\//);
+			                        if (_matches) {
+			                            return _matches[0];
+			                        } else {
+			                            return _url;
+			                        }
+			                    },
+			            {% endif %}
+			            height: '{{ player_height }}',
+			            autostart: true
+			        }  {% if polemic == 'all' or polemic == 'tweet' %},
+			        {
+			            type: "Polemic",
+			            {% if polemic == 'all' %}
+			            	annotation_type: false,
+			            {% endif %}
+			            {% if polemic == 'tweet' %}
+		            		annotation_type: "tweet",
+		           		{% endif %}
+			            defaultcolor: "#{{ polemic_defaultColor }}",
+						foundcolor: "#{{ polemic_foundColor }}",
+						
+						polemics : [
+							            {
+							                "name" : "OK",
+							                "keywords" : [ "++" ],
+							                "color" : "#{{ polemic_okColor }}"
+							            },
+							            {
+							                "name" : "KO",
+							                "keywords" : [ "--" ],
+							                "color" : "#{{ polemic_koColor }}"
+							            },
+							            {
+							                "name" : "REF",
+							                "keywords" : [ "==", "http://" ],
+							                "color" : "#{{ polemic_refColor }}"  
+							            },
+							            {
+							                "name" : "Q",
+							                "keywords" : [ "?" ],
+							                "color" : "#{{ polemic_qColor }}"
+							            }
+							        ]
+			        }
+			    {% endif %}
+			    {% if sparkline %}
+			        ,{
+			            type: "Sparkline",
+			            lineColor: "#{{ sparkline_lineColor }}",
+						fillColor: "#{{ sparkline_fillColor }}",
+			        }
+			    {% endif %}
+			        ,{
+			            type: "Slider"
+			        }
+			        
+			        {% if annotations_list %},{
+			            type: "AnnotationsList",
+			            container: "AnnotationsList_ext",
+			            ajax_url: "{{WEB_URL}}{% url segment_api_empty resource_name='segments' api_name='1.0' %}{% templatetag openvariable %}media{% templatetag closevariable %}/{% templatetag openvariable %}begin{% templatetag closevariable %}/{% templatetag openvariable %}end{% templatetag closevariable %}",
+			            ajax_granularity : 300000,
+			            default_thumbnail : "{{WEB_URL}}{{LDT_MEDIA_PREFIX}}css/imgs/video_sequence.png",
+			            show_audio: true,
+			            rtmp_streamer: "rtmp://media.iri.centrepompidou.fr/ddc_micro_record/"
+			        }{% endif %},{
+			            type: "Controller"
+			        }
+			        {% if segments %},{
+			            type: "Segments",
+			            annotation_type: ["chap","découpage"]
+			        }
+			        {% endif %}
+			        {% if annotation %},{
+			            type: "Annotation",
+			            start_minimized: true,
+			            site_name : "Lignes de Temps",
+			            annotation_type: ["chap","découpage"]
+			        }
+			        {% endif %}
+			        {% if tweet %},{
+			            type: "Tweet",
+			            hide_timeout: 5000
+			        }
+			        {% endif %}
+			        
+			        {% if createannotation %},{
+			            type: "CreateAnnotation",
+			            api_endpoint_template: "{{WEB_URL}}{% url api_dispatch_list resource_name='annotations' api_name='1.0' %}",
+			            api_method: "PUT",
+			            after_send_timeout: 8000,
+			            {% if tag_titles %}
+			           		tag_titles : tag_titles_array,
+			           	{% else %}
+			            	tag_titles : false,
+			           	{% endif %}
+			            show_mic_record: {% if show_mic_record %}true{% else %}false{% endif %},
+			            close_after_send: false,
+			            slice_annotation_type: ["chap","découpage"],
+			            creator_name: '{{request.user.username}}',
+			            creator_avatar: '{% thumbnail request.user.get_profile.image "48x48" format="PNG" crop="center" as im %}{{WEB_URL}}{{ im.url }}{% endthumbnail %}' || "https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png"
+			        }{% endif %}
+			        {% if slideshare %},{
+			            type: "Slideshare",
+			            container: "Slideshare_ext",
+			            embed_width: 400,
+			            embed_height: 334,
+			            annotation_type: "slide"
+			        }
+			        {% endif %},{
+			            type: "Mediafragment"
+			        }
+			        {% if social %},{
+			            type: "Social",
+			            container: "Social_ext",
+			            show_url: {% if show_url %}true{% else %}false{% endif %},
+			            show_twitter: {% if show_twitter %}true{% else %}false{% endif %},
+			            show_fb: {% if show_fb %}true{% else %}false{% endif %},
+			            show_gplus: {% if show_gplus %}true{% else %}false{% endif %},
+			            show_mail: {% if show_mail %}true{% else %}false{% endif %},
+			            url: document.location.href.replace(/#.*$/,""),
+			            text: document.title
+			        }
+			       {% endif %}
+			       
+			       {% if tagcloud %},{
+						type: "Tagcloud"
+					}
+			       {% endif %}
+			    ]
+			};
+			
+			_myPlayer = new IriSP.Metadataplayer(_config);
+			</script>
+			</div>
 		</div>
+		{% if social %}
+		<div id="Social_ext" class="Ldt-TraceMe Ldt-Widget" style="float:right; width:400px; height:24px;" widget-type="Social">
+		</div>
+		{% endif %}
+		{% if slideshare %}
+        <div id="Slideshare_ext" class="ext_widget Ldt-TraceMe Ldt-Widget" style="float:left; width:400px;" widget-type="Slideshare">
+   		 </div>
+        {% endif %}
 		{% if annotations_list %}
         <div style="float:left; width:400px;" id="AnnotationsList_ext"></div>
         {% endif %}
+        
 {% analytics %}
 	</body>
 </html>
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_popup.html	Mon Nov 12 13:28:31 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_popup.html	Mon Nov 12 16:17:22 2012 +0100
@@ -1,77 +1,219 @@
+{% extends "ldt/ldt_utils/workspace_base.html" %}
 {% load i18n %}
+{% load front_tags %}
 {% load analytics %}
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{LANGUAGE_CODE}}" lang="{{LANGUAGE_CODE}}">
-	<head>
-		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-		<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
-		<meta http-equiv="Pragma" content="no-cache" />
-		<meta http-equiv="Cache" content="no store" />
-		<meta http-equiv="Expires" content="-1" />
-		<title>Ligne de Temps - IRI</title>
+	{% block js_import %}
+		{{ block.super }}
 		<script type="text/javascript" src="{{LDT_MEDIA_PREFIX}}js/jquery.min.js"></script>
 		<script type="text/javascript" src="{{LDT_MEDIA_PREFIX}}js/jquery.qtip.min.js"></script>
+		<script type="text/javascript" src="{{LDT_MEDIA_PREFIX}}js/embed_popup.js"></script>
+		<script type="text/javascript" src="{{LDT_MEDIA_PREFIX}}js/jscolor/jscolor.js"></script>
+		{{ content_form.media.js }}
+	{% endblock %}
+		
+	{% block js_declaration %}
 		<script type="text/javascript">
 			var $j = jQuery.noConflict();
 			var iframe_url='{{iframe_url}}';
+			var external_url='{{external_url}}';
         	var polemic='{{polemic}}';
         	var show_mic_record='{{show_mic_record}}';
         	var annotations_list='{{annotations_list}}';
         	var player_id='{{player_id}}';
         	var translate_show="{% trans 'Show Player' %}";
         	var translate_hide="{% trans 'Hide Player' %}";
+        	var WEB_URL='{{WEB_URL}}';
+        	var LDT_MEDIA_PREFIX='{{LDT_MEDIA_PREFIX}}';
+        	var LANGUAGE_CODE='{{LANGUAGE_CODE}}';
+        	var json_url='{{json_url}}';
+        	var player_id='{{player_id}}';
+        	var segment_api='{% url segment_api_empty resource_name="segments" api_name="1.0" %}';
+        	var creator_name='{{request.user.username}}';
         	$j(document).ready(function(){
         		init_events();
         	});
         	
 		</script>
-		<script type="text/javascript" src="{{LDT_MEDIA_PREFIX}}js/embed_popup.js"></script>
-		
+	{% endblock %}
+	{% block css_import %}
+		{{ block.super }}
+		{{ content_form.media.css }}
+		<link rel="stylesheet" href="{{LDT_MEDIA_PREFIX}}css/style.css" />
 		<link rel="stylesheet" href="{{LDT_MEDIA_PREFIX}}css/workspace.css" type="text/css"/>
 		<link rel="stylesheet" href="{{LDT_MEDIA_PREFIX}}css/embed_popup.css" type="text/css"/>
 		<link rel="stylesheet" href="{{LDT_MEDIA_PREFIX}}css/jq-css/jquery.qtip.css" type="text/css"/>
-		<link rel="stylesheet" href="{{LDT_MEDIA_PREFIX}}css/style.css" type="text/css"/>
 		
+	{% endblock %}
 		
-	</head>
 
-	<body id="init_embed_popup">
-		<textarea id="embed_code_var" readonly="readonly" class="ldt_player_code" style="display:none">{{ embed_rendered.player }}</textarea>
+	{% block content %}
 		<div id='ldt_id'>
 			<div id='ldt_id_title'>{% trans 'project id' %} <span id="project_id_select">({% trans 'Select' %})</span> : <input id="project_id_input" value="{{ldt_id}}"/></div>
         </div>
-    
-        <a id="displayPlayer" href="javascript:toggle();">{% trans 'Show Player' %}</a>
-		<div class="ldt_player" id="wrapper_{{player_id}}" style="display:none">
-		</div>
+		<br>
 		<div id="button_row">
 		    <div id="display_select">
-		    	<input type="button" value="{% trans 'popup_player'%}" id="player_button"/><input id="seo_body_button" type="button" value="{% trans 'popup_seo_body' %}"/><input id="seo_meta_button" type="button" value="{% trans 'popup_seo_meta' %}"/><input id="links_button" type="button" value="{% trans 'popup_links' %}"/>
+		    	<input id="player_button" type="button" class="code_button" value="{% trans 'popup_player'%}"/>
+		    	<input id="seo_body_button" type="button" class="code_button" value="{% trans 'popup_seo_body' %}"/>
+		    	<input id="seo_meta_button" type="button" class="code_button" value="{% trans 'popup_seo_meta' %}"/>
+		    	<input id="links_button" type="button" class="code_button" value="{% trans 'popup_links' %}"/>
 		    </div>
 		</div>
 		
-		<div>
-				<br></br>
-				<code id ="code_{{player_id}}" >		
-					<div  id="player_code">
-						<br><div id="embed_options"><br> {% trans 'Integration mode' %} 
+		
+		<div style="float: left;">
+			<div id="links_code" class="ldt_player_code">{% include "ldt/ldt_utils/partial/embed_links.html" %}</div>
+			
+			<div id="seo_body_code">
+				<textarea id="seo_body_id_code" readonly="readonly" class="ldt_player_code" >{{ embed_rendered.seo_body }}</textarea>
+			</div>
+			<div id="seo_meta_code">
+				<textarea id="seo_meta_id_code" readonly="readonly" class="ldt_player_code">{{ embed_rendered.seo_meta }}</textarea>
+			</div>
+			
+			<div  id="player_code">
+				<div class="configuration">
+					<br><div id="embed_options"><br> {% trans 'Integration mode' %} 
 							<input type="radio" id="type_embed_div" name="player_code_type" value="div" checked onClick="div_event()" > {% trans 'div' %} </input>
 							<input type="radio" id="type_embed_iframe" name="player_code_type" value="iframe" onClick="iframe_event()">  {% trans 'iframe' %} </input><br>
-						</div></br>
-						<textarea id="player_id_code" readonly="readonly" class="ldt_player_code">{{ embed_rendered.player }}</textarea>
-					</div>
-					<div id="seo_body_code"><textarea id="seo_body_id_code" readonly="readonly" class="ldt_player_code" >{{ embed_rendered.seo_body }}</textarea></div>
-					<div id="seo_meta_code"><textarea id="seo_meta_id_code" readonly="readonly" class="ldt_player_code">{{ embed_rendered.seo_meta }}</textarea></div>		
-				</code>
-				<br>
-				<div id="links_code" class="ldt_player_code">{% include "ldt/ldt_utils/partial/embed_links.html" %}</div>
-				</br>
+						</div>	
+						<div id="player_size">
+							{% trans 'Player Size : ' %}
+							<input type="text" class="number_area" id="player_width" onchange="put_new_code();"></input> x 
+							<input type="text" class="number_area" id="player_height" onchange="put_new_code();"></input>
+						</div>
+						<a id="displayPreMode" class="OptionsEmbedDisplay">
+							<span id= "preModeExpArrow" class="expArrow"></span>
+							<span id= "preModeCollArrow" class="collArrow"></span>
+							<span class="title">{% trans 'Preset Modes' %}</span>
+						</a><br>
+							<div id="iframe_div_premode" class="embedPersonnalisation">
+								<input type="radio" id="mode_1" name="embed_mode" value="mode1" checked onClick="mode1()" > {% trans 'Basic configuration' %} </input><br>
+								<input type="radio" id="mode_2" name="embed_mode" value="mode2" onClick="mode2()">  {% trans 'Polemic configuration' %} </input><br>
+								<input type="radio" id="mode_3" name="embed_mode" value="mode3" onClick="mode3()">  {% trans 'Polemic configuration with tagcloud, annotationsList and Social widgets' %} </input><br>
+								<br>
+							</div>
+	
+						<a id="displayEmbedOptions" class="OptionsEmbedDisplay">
+							<span id= "optionsExpArrow" class="expArrow"></span>
+							<span id= "optionsCollArrow" class="collArrow"></span>
+							<span class="title">{% trans 'Create your own configuration' %}</span>
+						</a><br>
+							<div id="embed_personnalisation" class="embedPersonnalisation">
+								<div id="createannotation_block">
+									<input type="checkbox" id="createannotation_checkbox" value="createannotation" onClick="put_new_code(); display_createannotation();" > 
+										<span class="infostooltip title" data-title="createAnnotation" data-desc="{% trans 'Displays a form to create a new annotation' %}">CreateAnnotation</span>
+									</input><br>
+									<div id="createannotation_options" class="embedPersonnalisationSecondLevel">
+										<input type="checkbox" id="show_mic_record_checkbox" value="{% trans 'audio annotation' %}" onClick="put_new_code()" > 
+											<span class="infostooltip title" data-title="{% trans 'Audio annotation' %}" data-desc="{% trans 'Allows the user to record an annotation' %}">{% trans 'Audio annotation' %}</span>	
+										 </input><br>
+										 <input type="radio" name="annotation_tag" id="default_tags" checked onClick="put_new_code();">{% trans 'Use most used tags  ' %}</input>
+										 <input type="radio" name="annotation_tag" id="set_tags">
+										 	<span class="infostooltip title" data-title="{%trans 'Set your own tags : ' %}" data-desc="{% trans 'Write your tags separeted by a comma' %}">{%trans 'Set your own tags : ' %}</span>
+										 	<input type="text" id="tag_list" class="tags_area" onChange="put_new_code()"></input>
+										 </input>
+									</div>
+								</div>
+								<input type="checkbox" id="segments_checkbox" value="segments" onClick="put_new_code()" >
+									<span class="infostooltip title" data-title="Segments" data-desc="{% trans 'Displays segments of a media as rectangles on an horizontal line' %}">Segments</span>	
+								</input><br>
+								<input type="checkbox" id="annotations_list_checkbox" value="annotationslist" onClick="put_new_code()">
+									<span class="infostooltip title" data-title="Annotationlist" data-desc="{% trans 'Show a list of annotations' %}">AnnotationsList</span>	
+								</input><br>
+								<div id='polemic_bloc'>
+									<input type="checkbox" id="polemic_checkbox" value="polemic" onClick="put_new_code(); display_polemic();"> 
+										<span class="infostooltip title" data-title="Polemic" data-desc="{% trans 'Shows the polemical timeline, i.e. tweets colored according to the polemical syntax' %}">Polemic</span>
+									</input><br>
+										<div id="polemic_options" class="embedPersonnalisationSecondLevel">
+											<div id="displayPolemicOptions">{% trans 'Display in the polemic timeline : ' %}
+												<input type="radio" id="tweet_polemic" name="polemic_annotation_type" checked onClick="put_new_code()">{% trans 'only tweets' %} </input>
+												<input type="radio" id="all_polemic" name="polemic_annotation_type" onClick="put_new_code()">{% trans 'all annotations' %} </input><br>
+												<a id="displayPolemicColorOptions" class="AdvancedOptionsDisplay">
+													<span class="title">{% trans "Personalize tweet's color" %}</span>
+												</a>
+											</div>
+											<div id="polemic_color_options" class="embedPersonnalisation">
+												<div id="color_default_options">
+													<span class="title">{% trans "Default color" %} </span>
+													<input id="polemic_default_color" class="codeColor_text color {hash:true,caps:false}" onchange="put_new_code();" type="text" maxlength="8"></input>
+												</div>
+												<div id="polemics_colors">
+													<span class="title">{% trans "Polemic's color : ++ : " %} </span>
+													<input id="polemic_ok_color" class="codeColor_text color {hash:true,caps:false}" onchange="put_new_code();" type="text" maxlength="8"></input>
+													<span class="title">	-- :	</span>
+													<input id="polemic_ko_color" class="codeColor_text color {hash:true,caps:false}" onchange="put_new_code();" type="text" maxlength="8"></input>
+													<span class="title">	== :	</span>
+													<input id="polemic_ref_color" class="codeColor_text color {hash:true,caps:false}" onchange="put_new_code();" type="text" maxlength="8"></input>
+													<span class="title">	? :	</span>
+													<input id="polemic_q_color" class="codeColor_text color {hash:true,caps:false}" onchange="put_new_code();" type="text" maxlength="8"></input>
+												</div>
+												<div id="color_found_options">
+													<span class="title">{% trans "Found color" %}</span>
+													<input id="polemic_found_color" class="codeColor_text color {hash:true,caps:false}" onchange="put_new_code();" type="text" maxlength="8"></input>
+												</div>
+											</div>
+										</div>
+								</div>
+								<div>
+									<input type="checkbox" id="sparkline_checkbox" value="sparkline" onClick="put_new_code(); display_sparkline();">
+										<span class="infostooltip title" data-title="Sparkline" data-desc="{% trans 'Displays a curve showing the volume of tweets across time' %}">Sparkline</span>
+									</input><br>
+									<div id="sparkline_options" class="embedPersonnalisationSecondLevel">
+										<a id="displaySparklineOptions" class="AdvancedOptionsDisplay">
+											<span class="title">{% trans "personalize sparkline's color" %}</span>
+										</a>
+										<div id="sparkline_color_options" class="embedPersonnalisation">
+											<div id="color_line_options">
+												<span class="title">{% trans 'line color' %} </span>
+												<input id="sparkline_line_color" class="codeColor_text color {hash:true,caps:false}" onchange='put_new_code();' type="text" maxlength="7"></input>
+											</div>
+			
+											<div id="fill_color_options">
+													<span class="title">{% trans 'fill color' %} </span>
+													<input id="sparkline_fill_color" class="codeColor_text color {hash:true,caps:false}" onchange='put_new_code();' type="text"  maxlength="7"></input>
+											</div>
+										</div>
+									</div>
+								</div>
+								<input type="checkbox" id="slideshare_checkbox" value="slideshare" onClick="put_new_code()">
+									<span class="infostooltip title" data-title="Slideshare" data-desc="{% trans 'Displays a div in order to watch the slides displayed in the media' %}">Slideshare</span>
+								</input><br>
+								<div>
+								<input type="checkbox" id="social_checkbox" value="social" onClick="put_new_code(); display_social();"> 
+									<span class="infostooltip title" data-title="Social" data-desc="{% trans ' Adds buttons to share an URL on social networks' %}">Social</span>
+								</input><br>
+								<div id="social_options" class="embedPersonnalisation">
+									 <input type="checkbox" id="show_url_checkbox" value="show_url" checked onClick="put_new_code()"> Url </input>
+									 <input type="checkbox" id="show_twitter_checkbox" value="show_twitter" checked onClick="put_new_code()"> Twitter </input>
+									 <input type="checkbox" id="show_fb_checkbox" value="show_fb" checked onClick="put_new_code()"> Facebook </input>
+									 <input type="checkbox" id="show_gplus_checkbox" value="show_gplus" checked onClick="put_new_code()"> Google Plus </input>
+									 <input type="checkbox" id="show_mail_checkbox" value="show_mail" checked onClick="put_new_code()"> {% trans 'share with email' %} </input><br>
+								</div>
+								</div>
+								<input type="checkbox" id="annotation_checkbox" value="annotation" onClick="put_new_code()">
+									<span class="infostooltip title" data-title="Annotation" data-desc="{% trans ' Displays information relative to a single segment/annotation while it is being played' %}">Annotation</span>
+								</input><br>
+								<input type="checkbox" id="tweet_checkbox" value="tweet" onClick="put_new_code()">
+									<span class="infostooltip title" data-title="Tweet" data-desc="{% trans 'Show the contents on a tweet when clicked (in Polemic Widget)' %}">Tweet</span>
+								</input><br>
+								<input type="checkbox" id="tagcloud_checkbox" value="tagcloud" onClick="put_new_code()">
+										<span class="infostooltip title" data-title="Tagcloud" data-desc="{% trans 'Shows a tag cloud' %}">Tagcloud</span>
+								</input><br>
+							</div>
+					<textarea id="player_id_code" readonly="readonly" class="ldt_player_code" onClick="select_code();"></textarea>
+				</div>
 				
 		</div>
+		 <a id="displayPlayer" href="javascript:toggle();">{% trans 'Show Player' %}</a>
+        <div id="player_div" style="display:none">
+	  		<button type="button" class="refresh_button" id="refresh_player_button" title="Rafraichir le player" >
+			<img src="{{LDT_MEDIA_PREFIX}}img/arrow_refresh.png" id="refresh_player" ></img>
+			</button>
+			<div class="ldt_player" id="wrapper_{{player_id}}"></div>
+		</div>
+	{% endblock %}
 			
 	{% analytics %}		
-	</body>
-</html>
+	
 
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html	Mon Nov 12 13:28:31 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html	Mon Nov 12 16:17:22 2012 +0100
@@ -84,7 +84,7 @@
         },{
             type: "Tweet",
             hide_timeout: 5000
-        },{% if annotation_block %}{
+        },{
             type: "CreateAnnotation",
             api_endpoint_template: "{{WEB_URL}}{% url api_dispatch_list resource_name='annotations' api_name='1.0' %}",
             after_send_timeout: 8000,
@@ -93,7 +93,7 @@
             slice_annotation_type: ["chap","découpage"],
             creator_name: '{{request.user.username}}',
             creator_avatar: '{% thumbnail request.user.get_profile.image "48x48" format="PNG" crop="center" as im %}{{WEB_URL}}{{ im.url }}{% endthumbnail %}' || "https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png"
-        },{% endif %}{
+        },{
             type: "Slideshare",
             container: "Slideshare_ext",
             embed_width: 400,
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/projectslist.html	Mon Nov 12 13:28:31 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/projectslist.html	Mon Nov 12 16:17:22 2012 +0100
@@ -38,7 +38,11 @@
         {% endif %}
         
         <td class="cellimg"><div class="cellimgdiv"><img src="{{LDT_MEDIA_PREFIX}}img/page_copy.png" href="{% url ldt.ldt_utils.views.project.copy_project project.ldt_id group_id %}" class="ldt_link_copy_project" alt="{% trans 'copy project' %}" title="{% trans 'copy project' %}"/></div></td>
-        <td class="cellimg"><div class="cellimgdiv"><img src="{{LDT_MEDIA_PREFIX}}img/plugin.png" href="{{WEB_URL}}{{json_url_id}}" id="player_project_{{project.ldt_id}}" class="ldt_link_embed" alt="{% trans 'link json by id' %}" title="{% trans 'link json by id' %}"/></div></td>
+        <td class="cellimg"><div class="cellimgdiv">
+        <a href='{% url ldt.ldt_utils.views.workspace.popup_embed %}?json_url={{WEB_URL}}{{json_url_id}}&player_id=player_project_{{project.ldt_id}}&ldt_id={{project.ldt_id}}'>
+        <img src="{{LDT_MEDIA_PREFIX}}img/plugin.png" id="player_project_{{project.ldt_id}}" class="ldt_link_embed" alt="{% trans 'link json by id' %}" title="{% trans 'link json by id' %}"/></div>
+        </a>
+        </td>
         <td class="cellimg">
         {% ifequal project.state 2 %}
         <img src="{{LDT_MEDIA_PREFIX}}img/icon-yes.gif" {% if project.change %} alt="{% trans 'Project published, click to unpublish' %}" title="{% trans 'Project published, click to unpublish' %}" class="publishedproject qtiplink" {% else %} class="qtiplink" title="{% trans "You are not allowed to change this project" %}"{% endif %} id="project_{{project.ldt_id}}" /></div>
--- a/src/ldt/ldt/ldt_utils/views/workspace.py	Mon Nov 12 13:28:31 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/views/workspace.py	Mon Nov 12 16:17:22 2012 +0100
@@ -23,7 +23,6 @@
 import django.core.urlresolvers
 import ldt.auth as ldt_auth
 from django.utils.safestring import mark_safe
-import logging
 
 
 
@@ -99,9 +98,10 @@
     
     embed_rendered = dict((typestr,
                            (lambda s:escape(render_to_string("ldt/ldt_utils/partial/embed_%s.html" % (s), rend_dict, context_instance=RequestContext(request))))(typestr))
-                           for typestr in ('player', 'seo_body', 'seo_meta', 'links'))
+                           for typestr in ('seo_body', 'seo_meta', 'links'))
 
     rend_dict['embed_rendered'] = embed_rendered
+
     return render_to_response("ldt/ldt_utils/embed_popup.html", rend_dict, context_instance=RequestContext(request))
 
 
@@ -125,17 +125,52 @@
     rend_dict = get_datas_for_embed(request, json_url, player_id, ldt_id)
     
     # Manage iframe options
+    rend_dict["player_height"]=request.GET.get("player_height")
+    rend_dict["player_width"]=request.GET.get("player_width")
     if request.GET.has_key("polemic"):
         rend_dict["polemic"] = request.GET.get("polemic")
+        rend_dict["polemic_defaultColor"] = request.GET.get("polemic_defaultColor")
+        rend_dict["polemic_foundColor"] = request.GET.get("polemic_foundColor")
+        rend_dict["polemic_okColor"] = request.GET.get("polemic_okColor")
+        rend_dict["polemic_koColor"] = request.GET.get("polemic_koColor")
+        rend_dict["polemic_refColor"] = request.GET.get("polemic_refColor")
+        rend_dict["polemic_qColor"] = request.GET.get("polemic_qColor")
+
     if request.GET.has_key("show_mic_record"):
         rend_dict["show_mic_record"] = {'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("show_mic_record").lower())
     if request.GET.has_key("annotations_list"):
         rend_dict["annotations_list"] = {'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("annotations_list").lower())
         rend_dict["player_width"] = 550
-    
-    rend_dict["annotation_block"]= 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("tag_titles"):
+       rend_dict["tag_titles"] = request.GET.get("tag_titles") 
+    if request.GET.has_key("sparkline"):
+        rend_dict["sparkline"] = request.GET.get("sparkline")
+        rend_dict["sparkline_lineColor"] = request.GET.get("sparkline_lineColor")
+        rend_dict["sparkline_fillColor"] = request.GET.get("sparkline_fillColor")
+    if request.GET.has_key("slideshare"):
+        rend_dict["slideshare"] = {'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("slideshare").lower())
+    if request.GET.has_key("social"):
+        rend_dict["social"] = {'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("social").lower())     
+        if request.GET.has_key("show_url"):
+            rend_dict["show_url"] = {'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("show_url").lower())     
+        if request.GET.has_key("show_twitter"):
+            rend_dict["show_twitter"] = {'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("show_twitter").lower())     
+        if request.GET.has_key("show_fb"):
+            rend_dict["show_fb"] = {'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("show_fb").lower())     
+        if request.GET.has_key("show_gplus"):
+            rend_dict["show_gplus"] = {'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("show_gplus").lower())     
+        if request.GET.has_key("show_mail"):
+            rend_dict["show_mail"] = {'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("show_mail").lower())     
+    if request.GET.has_key("annotation"):
+        rend_dict["annotation"] = {'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("annotation").lower())
+    if request.GET.has_key("tweet"):
+        rend_dict["tweet"] ={'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("tweet").lower())
+    if request.GET.has_key("segments"):
+        rend_dict["segments"] = request.GET.get("segments")
+    if request.GET.has_key("tagcloud"):
+        rend_dict["tagcloud"] = {'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("tagcloud").lower())
     return render_to_response("ldt/ldt_utils/embed_iframe.html", rend_dict, context_instance=RequestContext(request))
 
 
@@ -155,21 +190,21 @@
     stream_mode = project.stream_mode
     if stream_mode != "video":
         stream_mode = 'radio'
-
-    player_width = 550
-    player_height = 380
     
     if stream_mode == 'radio':
         player_height = 1
         
     if not ldt_auth.check_access(request.user, project):
         return HttpResponseForbidden(_("You can not access this project"))
-
+    WEB_URL=settings.WEB_URL
+    LDT_MEDIA_PREFIX=settings.LDT_MEDIA_PREFIX
+    LANGUAGE_CODE=settings.LANGUAGE_CODE
     ps = ProjectJsonSerializer(project, from_contents=True, from_display=True)
     annotations = ps.get_annotations(first_cutting=True)
     rend_dict = {'json_url':json_url, 'player_id':player_id, 'annotations':annotations, 'ldt_id': ldt_id, 'stream_mode': stream_mode, 
-                 'player_width': player_width, 'player_height': player_height, 'external_url': external_url,
-                 'polemic':False, 'show_mic_record':False, 'annotations_list':False, 'iframe_url':iframe_url}
+                'external_url': external_url,
+                 'polemic':False, 'show_mic_record':False, 'annotations_list':False, 'iframe_url':iframe_url, 'WEB_URL':WEB_URL,
+                  'LDT_MEDIA_PREFIX':LDT_MEDIA_PREFIX, 'LANGUAGE_CODE':LANGUAGE_CODE}
     
     return rend_dict
 
Binary file src/ldt/ldt/locale/fr/LC_MESSAGES/django.mo has changed
--- a/src/ldt/ldt/locale/fr/LC_MESSAGES/django.po	Mon Nov 12 13:28:31 2012 +0100
+++ b/src/ldt/ldt/locale/fr/LC_MESSAGES/django.po	Mon Nov 12 16:17:22 2012 +0100
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-10-17 18:07+0200\n"
+"POT-Creation-Date: 2012-11-12 16:10+0100\n"
 "PO-Revision-Date: 2010-03-09 15:52+0100\n"
 "Last-Translator: Yves-Marie Haussonne <ymh.work@gmail.com>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -37,7 +37,7 @@
 msgid "all"
 msgstr "tous"
 
-#: .\ldt_utils\forms.py:33 .\ldt_utils\models.py:58
+#: .\ldt_utils\forms.py:33 .\ldt_utils\models.py:56
 #: .\ldt_utils\templates\ldt\ldt_utils\content_list.html.py:69
 msgid "title"
 msgstr "titre"
@@ -62,7 +62,7 @@
 msgid "Content Tag"
 msgstr "Catégorie de contenu"
 
-#: .\ldt_utils\forms.py:52 .\ldt_utils\models.py:160
+#: .\ldt_utils\forms.py:52 .\ldt_utils\models.py:157
 msgid "content.content_creation_date"
 msgstr "Date de création du contenu"
 
@@ -94,91 +94,91 @@
 msgid "content.front_project"
 msgstr "Choisir le front project"
 
-#: .\ldt_utils\forms.py:57 .\ldt_utils\models.py:159
+#: .\ldt_utils\forms.py:57 .\ldt_utils\models.py:156
 msgid "content.duration"
 msgstr "Durée"
 
-#: .\ldt_utils\models.py:47
+#: .\ldt_utils\models.py:45
 msgid "media.external_id"
 msgstr "id externe"
 
-#: .\ldt_utils\models.py:48
+#: .\ldt_utils\models.py:46
 msgid "media.external_permalink"
 msgstr "permalien externe"
 
-#: .\ldt_utils\models.py:49
+#: .\ldt_utils\models.py:47
 msgid "media.external_publication_url"
 msgstr "url de publication externe"
 
-#: .\ldt_utils\models.py:50
+#: .\ldt_utils\models.py:48
 msgid "media.external_src_url"
 msgstr "url source"
 
-#: .\ldt_utils\models.py:51
+#: .\ldt_utils\models.py:49
 msgid "media.creation_date"
 msgstr "Date de création"
 
-#: .\ldt_utils\models.py:52
+#: .\ldt_utils\models.py:50
 msgid "media.media_creation_date"
 msgstr "Date de création du média"
 
-#: .\ldt_utils\models.py:53
+#: .\ldt_utils\models.py:51
 msgid "media.update_date"
 msgstr "Date de maj"
 
-#: .\ldt_utils\models.py:54
+#: .\ldt_utils\models.py:52
 msgid "media.videopath"
 msgstr "videopath"
 
-#: .\ldt_utils\models.py:55
+#: .\ldt_utils\models.py:53
 msgid "media.duration"
 msgstr "Durée du contenu (ms)"
 
-#: .\ldt_utils\models.py:56
+#: .\ldt_utils\models.py:54
 msgid "media.creator"
 msgstr "Créateur"
 
-#: .\ldt_utils\models.py:57
+#: .\ldt_utils\models.py:55
 msgid "description"
 msgstr "description"
 
-#: .\ldt_utils\models.py:59
+#: .\ldt_utils\models.py:57
 msgid "media.src"
 msgstr "Sources"
 
-#: .\ldt_utils\models.py:61
+#: .\ldt_utils\models.py:58
 msgid "media.src_hash"
 msgstr "Hash de la source"
 
-#: .\ldt_utils\models.py:62
+#: .\ldt_utils\models.py:59
 msgid "media.mimetype"
 msgstr "mimetype"
 
-#: .\ldt_utils\models.py:152
+#: .\ldt_utils\models.py:149
 msgid "content.iri_id"
 msgstr "iri id"
 
-#: .\ldt_utils\models.py:153
+#: .\ldt_utils\models.py:150
 msgid "content.iriurl"
 msgstr "iri url"
 
-#: .\ldt_utils\models.py:154
+#: .\ldt_utils\models.py:151
 msgid "content.creation_date"
 msgstr "date de création"
 
-#: .\ldt_utils\models.py:155
+#: .\ldt_utils\models.py:152
 msgid "content.update_date"
 msgstr "Date de maj"
 
-#: .\ldt_utils\models.py:156
+#: .\ldt_utils\models.py:153
 msgid "content.title"
 msgstr "titre"
 
-#: .\ldt_utils\models.py:157
+#: .\ldt_utils\models.py:154
 msgid "content.description"
 msgstr "Description"
 
-#: .\ldt_utils\models.py:158
+#: .\ldt_utils\models.py:155
 msgid "content.authors"
 msgstr "Auteurs"
 
@@ -210,7 +210,7 @@
 msgid "changed by"
 msgstr "modifié par"
 
-#: .\ldt_utils\utils.py:203 .\ldt_utils\utils.py:386
+#: .\ldt_utils\utils.py:204 .\ldt_utils\utils.py:387
 msgid "Personal cutting"
 msgstr "Découpages personnels"
 
@@ -408,13 +408,13 @@
 msgstr "Toutes les annotations sur le média"
 
 #: .\ldt_utils\templates\front\front_search_results.html.py:6
-#: .\ldt_utils\templates\ldt\ldt_utils\groups.html.py:101
-#: .\ldt_utils\templates\ldt\ldt_utils\groups.html.py:113
+#: .\ldt_utils\templates\ldt\ldt_utils\groups.html.py:100
+#: .\ldt_utils\templates\ldt\ldt_utils\groups.html.py:112
 #: .\ldt_utils\templates\ldt\ldt_utils\ldt_list.html.py:80
 #: .\ldt_utils\templates\ldt\ldt_utils\published_projects.html.py:70
 #: .\ldt_utils\templates\ldt\ldt_utils\workspace_base.html.py:56
 #: .\ldt_utils\templates\ldt\ldt_utils\workspace_base.html.py:71
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:129
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:131
 #: .\templates\ldt\ldt_base.html.py:127
 msgid "search"
 msgstr "Recherche"
@@ -471,14 +471,6 @@
 msgid "duration"
 msgstr "durée"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\500.html.py:6
-msgid "Error 500"
-msgstr "Erreur 500"
-
-#: .\ldt_utils\templates\ldt\ldt_utils\500.html.py:10
-msgid "Internal server error"
-msgstr "Erreur interne du serveur"
-
 #: .\ldt_utils\templates\ldt\ldt_utils\content_list.html.py:55
 #: .\templates\admin\page_base.html.py:19
 #: .\user\templates\ldt\user\login_form.html.py:33
@@ -565,7 +557,7 @@
 msgstr "Le fichier média est en cours de traitement. Veuillez patienter."
 
 #: .\ldt_utils\templates\ldt\ldt_utils\create_content.html.py:145
-#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:101
+#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:77
 #: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:145
 #: .\ldt_utils\templates\ldt\ldt_utils\error_confirm.html.py:37
 #: .\ldt_utils\templates\ldt\ldt_utils\error_confirm_popup.html.py:53
@@ -582,36 +574,36 @@
 msgid "write"
 msgstr "Enregistrer"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:57
+#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:36
 msgid "Do you really want to delete this group ?"
 msgstr "Voulez-vous quitter ce groupe ?"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:78
+#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:54
 msgid "Update a group"
 msgstr "Mettre à jour votre groupe"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:78
+#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:54
 msgid "Create a group"
 msgstr "Créer un groupe"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:85
+#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:61
 #: .\user\templates\ldt\user\change_profile.html.py:62
 msgid "Name"
 msgstr "Nom"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:91
+#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:67
 msgid "Description"
 msgstr "Description"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:103
+#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:79
 msgid "update_group"
 msgstr "Mettre à jour le groupe"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:105
+#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:81
 msgid "delete_group"
 msgstr "Effacer le groupe"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:108
+#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:84
 msgid "create_group"
 msgstr "Créer un nouveau groupe"
 
@@ -663,7 +655,7 @@
 msgstr "Créer un nouveau projet Ligne de Temps"
 
 #: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:23
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:46
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:208
 msgid "Show Player"
 msgstr "Afficher le Lecteur métadata"
 
@@ -671,42 +663,174 @@
 msgid "Hide Player"
 msgstr "Masquer le Lecteur métadata "
 
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:43
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:51
 msgid "project id"
 msgstr "Identifiant du projet "
 
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:43
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:51
 msgid "Select"
 msgstr "Sélectionner"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:51
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:56
 msgid "popup_player"
 msgstr "Code Lecteur métadata"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:51
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:57
 msgid "popup_seo_body"
 msgstr "Code SEO"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:51
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:58
 msgid "popup_seo_meta"
 msgstr "Code balise meta en-tête"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:51
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:59
 msgid "popup_links"
 msgstr "Liste de liens"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:59
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:76
 msgid "Integration mode"
 msgstr "Utiliser le mode d'intégration "
 
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:60
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:77
 msgid "div"
 msgstr "div"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:61
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:78
 msgid "iframe"
 msgstr "iframe"
 
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:81
+msgid "Player Size : "
+msgstr "Taille de la vidéo : "
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:88
+msgid "Preset Modes"
+msgstr "Modes prédéfinis"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:91
+msgid "Basic configuration"
+msgstr "Confirmation de base"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:92
+msgid "Polemic configuration"
+msgstr "Configuration avec widget polemic"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:93
+msgid "Polemic configuration with tagcloud, annotationsList and Social widgets"
+msgstr "Configuration avec widget polemic, annotationsList, social et tagcloud"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:100
+msgid "Create your own configuration"
+msgstr "Personnaliser votre configuration"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:105
+msgid "Displays a form to create a new annotation"
+msgstr "Permet de créer une annotation en affichant un formulaire"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:108
+msgid "audio annotation"
+msgstr "Annotation audio"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:109
+msgid "Audio annotation"
+msgstr "Annotation audio"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:109
+msgid "Allows the user to record an annotation"
+msgstr "Permet à l'utilisateur d'enregistrer une annotation à l'aide d'un micro"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:111
+msgid "Use most used tags  "
+msgstr "Utiliser les tags les plus utilisés"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:113
+msgid "Set your own tags : "
+msgstr "Ajouter vos propres tags"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:113
+msgid "Write your tags separeted by a comma"
+msgstr "Ecrire la liste des tags séparés par une virgule"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:119
+msgid "Displays segments of a media as rectangles on an horizontal line"
+msgstr "Affiche le chapitrage du média, en horizontal"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:122
+msgid "Show a list of annotations"
+msgstr "Affiche une liste d’annotations "
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:126
+msgid "Shows the polemical timeline, i.e. tweets colored according to the polemical syntax"
+msgstr "Affiche la timeline polémique, c’est à dire les tweets colorés en fonction de la syntaxe polémique "
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:129
+msgid "Display in the polemic timeline : "
+msgstr "Afficher dans la timeline polemic : "
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:130
+msgid "only tweets"
+msgstr "seulement les annotations de type tweet"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:131
+msgid "all annotations"
+msgstr "toutes les annotations"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:133
+msgid "Personalize tweet's color"
+msgstr "Personnaliser les couleurs des tweets"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:138
+msgid "Default color"
+msgstr "Couleur des tweets sans annotation polémique : "
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:142
+msgid "Polemic's color : ++ : "
+msgstr "Couleur des tweets polémiques de type : ++ : "
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:152
+msgid "Found color"
+msgstr "Couleur d'affichage des tweets lors d'une recherche : "
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:160
+msgid "Displays a curve showing the volume of tweets across time"
+msgstr "Affiche une courbe indiquant l’évolution du volume d’annotations au cours du temps"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:164
+msgid "personalize sparkline's color"
+msgstr "Personnaliser les couleurs de la courbe"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:168
+msgid "line color"
+msgstr "Couleur de la courbe : "
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:173
+msgid "fill color"
+msgstr "Couleur sous la courbe : "
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:180
+msgid "Displays a div in order to watch the slides displayed in the media"
+msgstr "Permet d'afficher les slides d'un média"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:184
+msgid " Adds buttons to share an URL on social networks"
+msgstr "Affiche des boutons pour partager une URL sur les réseaux sociaux"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:191
+msgid "share with email"
+msgstr "Partager par email"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:195
+msgid "Displays information relative to a single segment/annotation while it is being played"
+msgstr "Affiche les informations relatives à une annotation au moment où celle-ci est jouée"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:198
+msgid "Show the contents on a tweet when clicked (in Polemic Widget)"
+msgstr "Affiche furtivement le contenu d’un tweet "
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:201
+msgid "Shows a tag cloud"
+msgstr "Affiche un nuage de mots-clés "
+
 #: .\ldt_utils\templates\ldt\ldt_utils\error_confirm.html.py:21
 #: .\ldt_utils\templates\ldt\ldt_utils\error_confirm_popup.html.py:34
 #: .\ldt_utils\templates\ldt\ldt_utils\reset_confirm.html.py:22
@@ -730,20 +854,20 @@
 msgid "close_error"
 msgstr "Fermer"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\groups.html.py:68
+#: .\ldt_utils\templates\ldt\ldt_utils\groups.html.py:67
 msgid "Do you want to leave this group ?"
 msgstr "Voulez-vous quitter ce groupe ?"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\groups.html.py:93
+#: .\ldt_utils\templates\ldt\ldt_utils\groups.html.py:92
 #: .\templates\ldt\ldt_base.html.py:115
 msgid "My groups"
 msgstr "Groupes"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\groups.html.py:95
+#: .\ldt_utils\templates\ldt\ldt_utils\groups.html.py:94
 msgid "Create group"
 msgstr "Créer un nouveau groupe"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\groups.html.py:111
+#: .\ldt_utils\templates\ldt\ldt_utils\groups.html.py:110
 msgid "The group's projects"
 msgstr "projets du groupe"
 
@@ -838,12 +962,12 @@
 
 #: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:52
 #: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:79
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:174
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:178
 msgid "share.eye"
 msgstr "Cet utilisateur ou ce groupe a le droit de voir cet élement"
 
 #: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:60
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:172
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:176
 msgid "share.pencil"
 msgstr "cet utilisateur ou ce groupe a le droit de modifier cet élement"
 
@@ -855,41 +979,41 @@
 msgid "publish for everyone"
 msgstr "publier pour tout le monde"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:124
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:125
 msgid "publish the title on the front"
 msgstr "publier le titre sur le front"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:127
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:129
 msgid "User and group list"
 msgstr "Liste des groupes et des utilisateurs"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:142
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:144
 msgid "select all displayed elements"
 msgstr "ajouter tous les élements affichés"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:147
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:149
 msgid "select users"
 msgstr "choisir des utilisateurs"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:148
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:150
 msgid "remove users"
 msgstr "enlever des utilisateurs"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:153
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:157
 msgid "Members list"
 msgstr "liste des membres"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:163
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:167
 #: .\ldt_utils\templates\ldt\ldt_utils\partial\sharewith.html.py:7
 msgid "user"
 msgstr "utilisateur"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:165
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:169
 #: .\ldt_utils\templates\ldt\ldt_utils\partial\sharewith.html.py:9
 msgid "group"
 msgstr "groupe"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:185
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:189
 msgid "remove all"
 msgstr "tout enlever"
 
@@ -912,22 +1036,22 @@
 msgid "copy project"
 msgstr "Copier votre projet"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\projectslist.html.py:41
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\projectslist.html.py:43
 #: .\ldt_utils\templates\ldt\ldt_utils\partial\publishedprojectslist.html.py:26
 msgid "link json by id"
 msgstr "Ouvrir le lecteur de métadata"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\projectslist.html.py:44
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\projectslist.html.py:48
 msgid "Project published, click to unpublish"
 msgstr "Projet publié, cliquer pour de-publier"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\projectslist.html.py:44
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\projectslist.html.py:46
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\projectslist.html.py:57
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\projectslist.html.py:48
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\projectslist.html.py:50
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\projectslist.html.py:61
 msgid "You are not allowed to change this project"
 msgstr "vous n'avez pas l'autorisation de modifier ce projet"
 
-#: .\ldt_utils\templates\ldt\ldt_utils\partial\projectslist.html.py:46
+#: .\ldt_utils\templates\ldt\ldt_utils\partial\projectslist.html.py:50
 msgid "Project not published, click to publish"
 msgstr "Projet non publié, cliquer pour publier"
 
@@ -939,71 +1063,63 @@
 msgid "Project published"
 msgstr "Projet publié"
 
-#: .\ldt_utils\views\content.py:189
+#: .\ldt_utils\views\content.py:114
 msgid "Problem when downloading file from url : "
 msgstr "Problème lors du téléchargement du fichier : "
 
-#: .\ldt_utils\views\content.py:192
+#: .\ldt_utils\views\content.py:117
 msgid "Problem when uploading file : "
 msgstr "Problème lors de l'upload du fichier : "
 
-#: .\ldt_utils\views\content.py:297
-msgid "Content creation failure"
-msgstr "Echec lors de la creation du contenu"
-
-#: .\ldt_utils\views\content.py:305
-msgid "Commit of the content creation failed"
-msgstr "Echec lors du commit de la creation du contenu"
-
-#: .\ldt_utils\views\content.py:319
+#: .\ldt_utils\views\content.py:334
 #, python-format
 msgid "There is %(count)d error when deleting content"
 msgid_plural "There are %(count)d errors when deleting content"
 msgstr[0] "Il y a %(count)d erreur lors de l'effacement du contenu"
 msgstr[1] "Il y a %(count)d erreurs lors de l'effacement du contenu"
 
-#: .\ldt_utils\views\content.py:320
+#: .\ldt_utils\views\content.py:335
 msgid "title error deleting content"
 msgstr "Erreur lors de l'effacement du contenu"
 
-#: .\ldt_utils\views\content.py:325
+#: .\ldt_utils\views\content.py:340
 #, python-format
 msgid "Confirm delete content %(titles)s"
 msgstr "Veuillez confirmer l'effacement du contenu %(titles)s"
 
-#: .\ldt_utils\views\content.py:326
+#: .\ldt_utils\views\content.py:341
 msgid "confirm delete content"
 msgstr "Confirmation effacement contenu"
 
-#: .\ldt_utils\views\content.py:337
+#: .\ldt_utils\views\content.py:352
 #, python-format
 msgid "Please unpublish the front project %(title)s"
 msgstr "Veuillez dépublier le projet : %(title)s"
 
-#: .\ldt_utils\views\content.py:338
+#: .\ldt_utils\views\content.py:353
 msgid "The front project is published"
 msgstr "Projet publié"
 
-#: .\ldt_utils\views\content.py:339 .\ldt_utils\views\content.py:342
+#: .\ldt_utils\views\content.py:354 .\ldt_utils\views\content.py:357
 #: .\ldt_utils\views\project.py:137
 msgid "confirm reset"
 msgstr "Confirmer la réinitialisation"
 
-#: .\ldt_utils\views\content.py:341 .\ldt_utils\views\project.py:136
+#: .\ldt_utils\views\content.py:356 .\ldt_utils\views\project.py:136
 #, python-format
 msgid "please confirm reseting project %(title)s"
 msgstr "Veuillez confirmer la réinitialisation du projet %(title)s"
 
-#: .\ldt_utils\views\content.py:369
+#: .\ldt_utils\views\content.py:384
 msgid "An error occurred - Please try again or contact webmaster"
 msgstr ""
 "Une erreur est apparue - Merci de réessayer ou de contacter le webmaster"
 
-#: .\ldt_utils\views\content.py:370
+#: .\ldt_utils\views\content.py:385
 msgid "Error"
 msgstr "Erreur"
 
-#: .\ldt_utils\views\content.py:413
+#: .\ldt_utils\views\content.py:428
 #, python-format
 msgid ""
 "Content '%(title)s' is referenced by this project : %(project_titles)s. "
@@ -1018,7 +1134,7 @@
 "Le contenu '%(title)s' est référencé par les projets suivants : '%"
 "(project_titles)s'.Veuillez les effacer préalablement."
 
-#: .\ldt_utils\views\content.py:416
+#: .\ldt_utils\views\content.py:431
 #, python-format
 msgid ""
 "The project '%(project_title)s' pointing on the content '%(title)s' has "
@@ -1028,16 +1144,16 @@
 "Le projet '%(project_title)s' référençant le contenu '%(title)s' comporte "
 "plusieurs annotations. Voulez vous quand même supprimer le contenu ?"
 
-#: .\ldt_utils\views\content.py:442
+#: .\ldt_utils\views\content.py:457
 msgid "Content deletion failure"
 msgstr "Echec lors de la suppression du contenu"
 
-#: .\ldt_utils\views\content.py:452
+#: .\ldt_utils\views\content.py:468
 msgid "Commit of the content deletion failed"
 msgstr "Echec lors du commit de la suppression du contenu"
 
-#: .\ldt_utils\views\json.py:40 .\ldt_utils\views\rdf.py:15
-#: .\ldt_utils\views\workspace.py:178
+#: .\ldt_utils\views\json.py:39 .\ldt_utils\views\rdf.py:15
+#: .\ldt_utils\views\workspace.py:198
 msgid "You can not access this project"
 msgstr "vous n'avez pas l'autorisation d'accéder à ce projet"
 
@@ -1073,12 +1189,12 @@
 msgid "confirm deletion"
 msgstr "Confirmation d'effacement"
 
-#: .\ldt_utils\views\workspace.py:128
+#: .\ldt_utils\views\workspace.py:116
 msgid ""
 "The content does not exists or you are not allowed to access this content"
 msgstr "Ce contenu n'existe pas, ou vous n'êtes pas autorisé a y acceder"
 
-#: .\ldt_utils\views\workspace.py:132
+#: .\ldt_utils\views\workspace.py:120
 msgid "Parameters project_id or content_id must be given in the url"
 msgstr "Les paramètres project_id et content_id doivent être passés dans l'URL"
 
@@ -1730,5 +1846,17 @@
 "Nous vous avons envoyé par courriel les instructions pour activer le compte "
 "à l'adresse que vous avez indiquée. Vous devriez le recevoir rapidement."
 
+#~ msgid "Content creation failure"
+#~ msgstr "Echec lors de la creation du contenu"
+
+#~ msgid "Commit of the content creation failed"
+#~ msgstr "Echec lors du commit de la creation du contenu"
+
+#~ msgid "Error 500"
+#~ msgstr "Erreur 500"
+
+#~ msgid "Internal server error"
+#~ msgstr "Erreur interne du serveur"
+
 #~ msgid "clik here to see the project content"
 #~ msgstr "cliquer ici pour voir le contenu du projet"
--- a/src/ldt/ldt/static/ldt/css/embed_popup.css	Mon Nov 12 13:28:31 2012 +0100
+++ b/src/ldt/ldt/static/ldt/css/embed_popup.css	Mon Nov 12 16:17:22 2012 +0100
@@ -6,12 +6,17 @@
 word-wrap: break-word; /* Internet Explorer 5.5+ */
 }
 
+
 input
 {
 	background: #ededed;
 }
-
-input[type="button"] {
+.embed_checkbox{
+	text-indent:25px;
+	
+}
+.code_button
+{
 	background-color: #656565;
 	color: white;
 	width: auto;
@@ -19,6 +24,47 @@
 	padding: 5px 10px;
 }
 
+.codeColor_text{
+	width: 50px;
+	text-align: center;
+    color: #949494;
+    font-size: 12px;
+    padding: 3px;	
+}
+
+.number_area{
+	width: 30px;
+	text-align: center;
+	padding: 3px;
+	font-size: 12px;
+	color: #7B8084;
+	border: 3px solid lightGrey;
+}
+
+.tags_area{
+	padding: 3px;
+	font-size: 12px;
+	color: #7B8084;
+	border: 3px solid lightGrey;
+}
+.refresh_button{
+	background-color:#fcfcfc;
+	-moz-border-radius:6px;
+	-webkit-border-radius:6px;
+	border-radius:6px;
+	border:1px solid #dcdcdc;
+	display:inline-block;
+	color:#777777;
+	padding:6px 6px;
+}
+.refresh_button:hover {
+	background-color:#fffaff;
+}
+
+.refresh_button:active {
+	position:relative;
+	top:1px;
+}
 #button_row input {
 	margin: 10px; 
 }
@@ -80,11 +126,87 @@
     margin-bottom: 5px;
 }
 
-#embed_options {
+.configuration {
+	color: #949494;
+	font-family: Arial, Helvetica, sans serif;
+	font-weight: lighter;
+	font-style: normal;
+	font-size: 12px;
+	text-align: left;
+}
+
+#embed_options .title {
+    font-weight: bold;
+    margin-right: 9px;
+}
+
+.OptionsEmbedDisplay {
+	color: #949494;
+	font-family: Arial, Helvetica, sans serif;
+	font-weight: lighter;
+	font-style: normal;
+	font-size: 12px;
+	text-align: left;
+	cursor: pointer;
+    font-weight: bold;
+    margin-right: 9px;
+    text-decoration: none;
+    line-height: 12px;
+    top: 10px;
+	vertical-align: top;
+    
+}
+
+.AdvancedOptionsDisplay{
 	color: #949494;
 	font-family: Arial, Helvetica, sans serif;
 	font-weight: lighter;
 	font-style: normal;
 	font-size: 12px;
 	text-align: left;
-}
\ No newline at end of file
+	cursor: pointer;
+    margin-right: 9px;
+    text-decoration: none;
+    line-height: 12px;
+    top: 10px;
+	vertical-align: top;
+}
+.embedPersonnalisation{
+	margin-left: 21px;
+}
+
+.embedPersonnalisationSecondLevel{
+	margin-left: 22px; 
+}
+
+.expArrow {
+	width:0px; 
+	height:0px; 
+	border-bottom:6px solid transparent;  /* left arrow slant */
+	border-top:6px solid transparent; /* right arrow slant */
+	border-left:6px solid #949494; /* bottom, add background color here */
+	font-size:0px;
+	line-height:12px;
+	margin-right: 8px;
+	position: relative;
+	top: 0px;
+	vertical-align: top;
+	display: inline-block;
+
+}
+
+.collArrow {
+	width:0px; 
+	height:0px; 
+	border-left:6px solid transparent;
+	border-right:6px solid transparent;
+	border-top:6px solid #949494;
+	font-size:0px;
+	line-height:12px;
+	margin-right: 8px;
+	position: relative;	
+	top: 5px;
+	vertical-align: top;
+	display: inline-block;
+}
+
Binary file src/ldt/ldt/static/ldt/img/arrow_refresh.png has changed
--- a/src/ldt/ldt/static/ldt/js/embed_popup.js	Mon Nov 12 13:28:31 2012 +0100
+++ b/src/ldt/ldt/static/ldt/js/embed_popup.js	Mon Nov 12 16:17:22 2012 +0100
@@ -4,7 +4,7 @@
 	$j.each(["player","seo_body","seo_meta","links"], function(i,display_str) {
 
 		var div_selector = "#"+display_str+"_code";
-		if(display_str == display_state) {
+		if(display_str === display_state) {
 			$j(div_selector).show();
 		}
 		else {
@@ -14,10 +14,33 @@
 }
 
 function init_events(){
-	
 	toggle_display();
+	$j("#iframe_div_premode").toggle(false);
+	$j("#embed_personnalisation").toggle(false);
+	$j("#player_width").val(550);
+	$j("#player_height").val(300);
+	$j("#optionsExpArrow").toggle(true);
+	$j("#optionsCollArrow").toggle(false);	
+	$j("#preModeExpArrow").toggle(true);
+	$j("#preModeCollArrow").toggle(false);
+	$j("#createannotation_block").toggle(false);
 	$j("#player_id_code").focus();
 	$j("#player_id_code").select();
+	$j("#polemic_color_options").toggle(false);
+	$j("#sparkline_color_options").toggle(false);
+	$j("#social_options").toggle(false);
+	$j("#displayPolemicOptions").toggle(false);
+	$j("#displaySparklineOptions").toggle(false);
+	$j("#polemic_default_color").val("#585858");
+	$j("#polemic_found_color").val("#fc00ff");
+	$j("#polemic_ok_color").val("#1d973d");
+	$j("#polemic_ko_color").val("#ce0a15");
+	$j("#polemic_ref_color").val("#c5a62d");
+	$j("#polemic_q_color").val("#036aae");
+	$j("#sparkline_line_color").val("#7492b4");
+	$j("#sparkline_fill_color").val("#aeaeb8");
+	$j("#createannotation_options").toggle(false);
+	mode1();
 	
     $j("#project_id_select").click(function(){
     	$j("#project_id_input").focus();
@@ -53,120 +76,782 @@
  	   alert($j("#"+display_state+"_code").html());
    });
    
+   $j("#refresh_player_button").click(function(e){
+	   refresh_player();
+   });
+   
+   $j("#refresh_player_button").click(function(){
+	   $j("#player_id_code").focus();
+	   $j("#player_id_code").select();
+   });
+   
    $j("#player_button").click(function(){
 	   $j("#player_id_code").focus();
 	   $j("#player_id_code").select();
    });
 	
    $j("#seo_body_button").click(function(){
+	   display_state = "seo_body";
+	   toggle_display();
 	   $j("#seo_body_id_code").focus();
-      	$j("#seo_body_id_code").select();
+	   $j("#seo_body_id_code").select();
+   
    });
    
    $j("#seo_meta_button").click(function(){
 	   $j("#seo_meta_id_code").focus();
       	$j("#seo_meta_id_code").select();
-   });
+   }); 
    
    $j('#links_button').click(function() {
 	   var range = document.createRange();
 	   range.selectNode(document.getElementById('links_code'));
 	   window.getSelection().addRange(range);
    });
+   
+   $j('#displayPreMode').click(function(){
+		$j("#iframe_div_premode").slideToggle("fast");
+		$j("#preModeExpArrow").toggle();
+		$j("#preModeCollArrow").toggle();
+	});
+   
+   $j("#displayEmbedOptions").click(function(){
+	   $j("#embed_personnalisation").slideToggle("fast");
+	   $j("#optionsExpArrow").toggle();
+	   $j("#optionsCollArrow").toggle();
+	   
+   });
+   
+   $j("#displayPolemicColorOptions").click(function(){
+	  $j("#polemic_color_options").slideToggle("fast");
+   });
     
+   $j("#displaySparklineOptions").click(function(){
+	   $j("#sparkline_color_options").slideToggle("fast");
+   });
+   
+   $('.infostooltip').each( function () {
+       var desc = $(this).attr('data-desc');
+       if (desc == 'None') {
+           desc = '';
+       }
+       $(this).qtip({ 
+           content : {
+               text: '<b>' + $(this).attr('data-title') + '</b><br />' + desc
+           },
+       	style: {
+       		classes: 'ui-tooltip-dark ui-tooltip-rounded qtipldt'
+       	},
+       	border: {
+       		'width': 0,
+       		'color': '#505050'
+       	},
+       	position: {
+       		my: 'top left',
+       		at: 'bottom left'
+       	}
+       });
+   });
+ 
+}
+
+function select_code(){
+	$j("#player_id_code").focus();
+	$j("#player_id_code").select();
+}
+
+function generate_base_embed_code(){
+	var player_width_val=$j("#player_width").val();
+	base='\
+<div> \n \
+		<div id="'+player_id+'_embed" style="float:left; width:'+player_width_val+';" class="iri_player_embed">\n\
+		</div>\n\
+<script type="text/javascript" src="'+WEB_URL+LDT_MEDIA_PREFIX+'metadataplayer/LdtPlayer-core.js"></script>\n\
+<script type="text/javascript">\n\
+	if (typeof jQuery == "undefined") {\n\
+		jQuery = IriSP.jQuery;\n\
+	}\n\
+	var metadatas = {metadata: {url: "'+json_url+'"}};\n\
+	var metadata_key = "metadata";\n\
+	IriSP.libFiles.defaultDir = "'+WEB_URL+LDT_MEDIA_PREFIX+'js/";\n\
+	IriSP.libFiles.locations.jwPlayerSWF = "'+WEB_URL+LDT_MEDIA_PREFIX+'swf/player.swf";\n\
+	IriSP.libFiles.locations.recordMicSwf = "'+WEB_URL+LDT_MEDIA_PREFIX+'swf/record_mic.swf";\n\
+	IriSP.libFiles.locations.zeroClipboardSwf = "'+WEB_URL+LDT_MEDIA_PREFIX+'swf/ZeroClipboard10.swf";\n\
+	IriSP.libFiles.locations.cssjQueryUI = "'+WEB_URL+LDT_MEDIA_PREFIX+'css/jq-css/themes/base/jquery-ui.css"\n\
+	IriSP.language = "'+LANGUAGE_CODE+'";\n\
+\n\
+	IriSP.widgetsDir = "'+WEB_URL+LDT_MEDIA_PREFIX+'metadataplayer";\n\
+	var _metadata = {\n\
+    	url: metadatas[metadata_key].url + "?callback=?",\n\
+    	format: "ldt"\n\
+	};\n\
+	var _config = {\n\
+    	width: "'+player_width_val+'",\n\
+    	container: "'+player_id+'_embed",\n\
+    	css: "'+WEB_URL+LDT_MEDIA_PREFIX+'metadataplayer/LdtPlayer-core.css",\n\
+    	default_options: {\n\
+        metadata: _metadata\n\
+    },\n';
+	
+	return base;
+   
+}
+
+function generate_widget_code(){
+	var annotationslist_val=document.getElementById('annotations_list_checkbox');
+	var slideshare_val=document.getElementById('slideshare_checkbox');
+	var social_val=document.getElementById('social_checkbox');
+	var annotation_val=document.getElementById('annotation_checkbox');
+	var tweet_val=document.getElementById('tweet_checkbox');
+	var segments_val=document.getElementById('segments_checkbox');
+	var polemic_val=document.getElementById('polemic_checkbox');
+	var sparkline_val=document.getElementById('sparkline_checkbox');
+	var tagcloud_val=document.getElementById('tagcloud_checkbox');
+	var player_height_val=$j('#player_height').val();
+	widget_code='\
+	widgets: [\n\
+		{\n\
+			type: "AutoPlayer",\n';
+	
+	if (external_url!='None'){
+		widget_code+='\
+			video: "'+external_url+'",\n';
+	}
+	else{	
+		widget_code+='\
+	        streamer: function(_url) {\n\
+	        var _matches = _url.match(/^[^\\/]+\\/\\/[^\\/]+\\/[^\\/]+\\//);\n\
+	        if (_matches) {\n\
+	                return _matches[0];\n\
+	        } else {\n\
+	                return _url;\n\
+	        }\n\
+	        },\n';
+	}
+	
+	widget_code+='\
+			height: '+player_height_val+',\n\
+	        autostart: true\n\
+	    }';
+	if (polemic_val.checked){	
+		defaultcolor= $j("#polemic_default_color").val();
+		foundcolor=$j("#polemic_found_color").val();
+		ok_color=$j("#polemic_ok_color").val();
+		ko_color=$j("#polemic_ko_color").val();
+		ref_color=$j("#polemic_ref_color").val();
+		q_color=$j("#polemic_q_color").val();
+		tweet_type=document.getElementById("tweet_polemic");
+		widget_code+='\
+	    ,{\n\
+	        type: "Polemic",\n';
+		if(tweet_type.checked){
+			widget_code+='\
+			annotation_type: "tweet",\n';
+		}
+		else{
+			widget_code+='\
+			annotation_type: false,\n';
+		}
+		widget_code+='\
+			defaultcolor: "'+defaultcolor+'",\n\
+			foundcolor: "'+foundcolor+'",\n\
+			polemics : [\n\
+			            {\n\
+			                "name" : "OK",\n\
+			                "keywords" : [ "++" ],\n\
+			                "color" : "'+ok_color+'"\n\
+			            },\n\
+			            {\n\
+			                "name" : "KO",\n\
+			                "keywords" : [ "--" ],\n\
+			                "color" : "'+ko_color+'"\n\
+			            },\n\
+			            {\n\
+			                "name" : "REF",\n\
+			                "keywords" : [ "==" ],\n\
+			                "color" : "'+ref_color+'"\n\
+			            },\n\
+			            {\n\
+			                "name" : "Q",\n\
+			                "keywords" : [ "?" ],\n\
+			                "color" : "'+q_color+'"\n\
+			            },\n\
+			        ]\n\
+		}';
+	}
+	
+	if(sparkline_val.checked){
+		linecolor=$j("#sparkline_line_color").val();
+		fillcolor=$j("#sparkline_fill_color").val();
+		widget_code+=',{\n\
+            type: "Sparkline",\n\
+			lineColor: "'+linecolor+'",\n\
+			fillColor: "'+fillcolor+'"\n\
+        }';
+	}
+	
+	if(segments_val.checked){
+		widget_code+=',{\n\
+	        type: "Segments",\n\
+	        annotation_type: ["chap","découpage"]\n\
+	    }';
+	}
+	widget_code+=',{\n\
+	        type: "Slider"\n\
+	    },{\n\
+	        type: "Controller"\n\
+	    },{\n\
+	        type: "Mediafragment"\n\
+	    }';
+	if(slideshare_val.checked){
+		widget_code+='\
+		,{\n\
+	        type: "Slideshare",\n\
+	        container: "Slideshare_ext",\n\
+	        embed_width: 400,\n\
+	        embed_height: 334,\n\
+	        annotation_type: "slide"\n\
+		}';
+	}
+	
+	if(social_val.checked){
+		show_url=document.getElementById("show_url_checkbox");
+		show_twitter=document.getElementById("show_twitter_checkbox");
+		show_fb=document.getElementById("show_fb_checkbox");
+		show_gplus=document.getElementById("show_gplus_checkbox");
+		show_mail=document.getElementById("show_mail_checkbox");
+
+		widget_code+='\
+		,{\n\
+	        type: "Social",\n\
+	        container: "Social_ext",\n\
+	        url: document.location.href.replace(/#.*$/,""),\n\
+	        text: document.title,\n';
+		
+		if(show_url.checked){
+			widget_code+='\
+			show_url: true,\n';
+		}
+		else{
+			widget_code+='\
+			show_url: false,\n';
+		}
+		if(show_twitter.checked){
+			widget_code+='\
+			show_twitter: true,\n';
+		}
+		else{
+			widget_code+='\
+			show_twitter: false,\n';
+		}
+		if(show_fb.checked){
+			widget_code+='\
+			show_fb: true,\n';
+		}
+		else{
+			widget_code+='\
+			show_fb: false,\n';
+		}
+		if(show_gplus.checked){
+			widget_code+='\
+			show_gplus: true,\n';
+		}
+		else{
+			widget_code+='\
+			show_gplus: false,\n';
+		}
+		if(show_mail.checked){
+			widget_code+='\
+			show_mail: true\n';
+		}
+		else{
+			widget_code+='\
+			show_mail: false\n';
+		}
+		
+		widget_code+='}';
+	}
+	if(annotation_val.checked){
+		widget_code+='\
+		,{\n\
+	        type: "Annotation",\n\
+	        start_minimized: true,\n\
+	        site_name : "Lignes de Temps",\n\
+	        annotation_type: ["chap","découpage"]\n\
+	    }';
+	}
+	if(tweet_val.checked){
+		widget_code+='\
+		,{\n\
+	        type: "Tweet",\n\
+	        hide_timeout: 5000\n\
+	    }';
+	}
+	
+	if(annotationslist_val.checked){
+		widget_code+=',{\n\
+	        type: "AnnotationsList",\n\
+	        container: "AnnotationsList_ext",\n\
+	        ajax_granularity : 300000,\n\
+	        default_thumbnail : "'+WEB_URL+LDT_MEDIA_PREFIX+'css/imgs/video_sequence.png",\n\
+	        show_audio: true,\n\
+	        rtmp_streamer: "rtmp://media.iri.centrepompidou.fr/ddc_micro_record/"\n\
+	    }';
+	}
+	
+	if(tagcloud_val.checked){
+		widget_code+=',{\n\
+			type: "Tagcloud",\n\
+		}';
+	}
+	
+	widget_code+=']\n\
+		};\n';
+        
+        return widget_code;
+		
+}
+
+function generate_div_code(){
+	var annotationslist_val=document.getElementById('annotations_list_checkbox');
+	var slideshare_val=document.getElementById('slideshare_checkbox');
+	var social_val=document.getElementById('social_checkbox');
+	code=generate_base_embed_code();
+	code+=generate_widget_code();
+	code+='\n\
+	_myPlayer = new IriSP.Metadataplayer(_config);\n\
+	</script>\n';
+	if(social_val.checked){
+		code+='\
+	<div id="Social_ext" class="Ldt-TraceMe Ldt-Widget" style="float:right; width:400px; height:24px;" widget-type="Social">\n\
+	</div>\n';
+	}
+	if(slideshare_val.checked){
+		code+='\
+	<div id="Slideshare_ext" class="ext_widget Ldt-TraceMe Ldt-Widget" style="float:left; width:400px;" widget-type="Slideshare">\n\
+    </div>\n';
+	}
+	
+	if(annotationslist_val.checked){
+		code+='\
+	<div id="AnnotationsList_ext" class="ext_widget Ldt-TraceMe Ldt-Widget" style="float:left; width:400px;" widget-type="AnnotationsList"></div>\n';
+	}
+
+	code+='\
+</div>\n';
+	return code;	
+}
+
+function put_new_code(){
+	var type_embed=document.getElementById("type_embed_div");
+	wrapper = "wrapper_"+player_id;
+	wrapper_id = "#"+wrapper;
+	var element = document.getElementById(wrapper);
+	var code_embed=document.getElementById("player_id_code");
+	if(type_embed.checked){
+		var new_code=generate_div_code();
+	}
+	else{
+		var new_code=generate_iframe_code();
+	}
+	code_embed.value= new_code;
+	$j("#player_id_code").focus();
+	$j("#player_id_code").select();	
+}
+
+function div_event(){
+	$j("#iframe_div_premode").toggle(false);
+	$j("#preModeExpArrow").toggle(true);
+	$j("#preModeCollArrow").toggle(false);
+	$j("#createannotation_block").toggle(false);
+	put_new_code();
 }
 
 function toggle() {
 	wrapper="wrapper_"+player_id;
 	wrapper_id="#"+wrapper;
+	var player_div = document.getElementById("player_div");
 	var element = document.getElementById(wrapper);
 	var text = document.getElementById("displayPlayer");
 	var type_embed=document.getElementById("type_embed_div");
-	if(element.style.display==="none") {
+	if(player_div.style.display==="none") {
 		if (type_embed.checked){
-			var new_code=document.getElementById("embed_code_var").value;
+			var new_code=generate_div_code();
 			$j(wrapper_id).html(new_code);
 		}
 		else{
-			wrapper = "#wrapper_"+player_id;
-			iframeUrl= iframe_url+"&polemic="+polemic+"&show_mic_record="+show_mic_record+"&annotations_list="+annotations_list+"";
-			player_width=570;
-			player_height=678;
-			if(annotations_list!='False'){
-				player_width+=430;
-			}
-			if(polemic!='False'){
-				player_height+=100;
-				
-			}
-			if(show_mic_record!='False'){
-				
-				player_height+=55;
-			}
-			frame = document.createElement("iframe");
-		    frame.width = player_width;
-		    frame.height = player_height;
-		    frame.src = iframeUrl;
-		    frame.frameBorder = 0;
-		   	frame.seamless = "seamless";
-		   	$j(wrapper).html(frame);
-			
+			display_iframe_player();
 		}
-    	element.style.display="block";
+		player_div.style.display="block";
 		text.innerHTML = translate_hide;
   	}
 	else {
 		$j(wrapper_id).html('');
-    	element.style.display="none";
+		player_div.style.display="none";
 		text.innerHTML = translate_show;
 	}
 } 
 
-function div_event(){
-	wrapper = "wrapper_"+player_id;
-	wrapper_id = "#"+wrapper;
+function display_polemic(){
+	$j("#displayPolemicOptions").slideToggle("fast");
+	$j("#polemic_color_options").toggle(false);
+}
+
+function display_sparkline(){
+	$j("#displaySparklineOptions").slideToggle("fast");		
+	$j("#sparkline_color_options").toggle(false);
+}
+
+function display_social(){
+	$j("#social_options").slideToggle("fast");
+}
+
+function display_createannotation(){
+	$j("#createannotation_options").slideToggle("fast");
+}
+
+function mode1(){
+	var annotationslist_val=document.getElementById('annotations_list_checkbox');
+	var slideshare_val=document.getElementById('slideshare_checkbox');
+	var social_val=document.getElementById('social_checkbox');
+	var annotation_val=document.getElementById('annotation_checkbox');
+	var tweet_val=document.getElementById('tweet_checkbox');
+	var segments_val=document.getElementById('segments_checkbox');
+	var polemic_val=document.getElementById('polemic_checkbox');
+	var sparkline_val=document.getElementById('sparkline_checkbox');
+	var tagcloud_val=document.getElementById('tagcloud_checkbox');
+	var createannotation_val=document.getElementById('createannotation_checkbox');
+
+	var type_embed=document.getElementById("type_embed_div");
+
+	if(type_embed.checked){
+		createannotation_val.checked=false;
+	}
+	else{
+		$j("#createannotation_options").toggle(true);
+		createannotation_val.checked=true;
+		var show_mic_record_val = document.getElementById('show_mic_record_checkbox');
+		show_mic_record_val.checked=false;
+	}
+	$j("#displayPolemicOptions").toggle(false);
+	$j("#displaySparklineOptions").toggle(false);
+	$j("#social_options").toggle(false);
+	$j("#sparkline_color_options").toggle(false);
+	polemic_val.checked=false;
+	segments_val.checked=true;
+	annotationslist_val.checked=false;
+	slideshare_val.checked=false;
+	social_val.checked=false;
+	annotation_val.checked=false;
+	tweet_val.checked=false;
+	sparkline_val.checked=false;
+	tagcloud_val.checked=false;
+	put_new_code();
+}
+
+function mode2(){
+	var annotationslist_val=document.getElementById('annotations_list_checkbox');
+	var slideshare_val=document.getElementById('slideshare_checkbox');
+	var social_val=document.getElementById('social_checkbox');
+	var annotation_val=document.getElementById('annotation_checkbox');
+	var tweet_val=document.getElementById('tweet_checkbox');
+	var segments_val=document.getElementById('segments_checkbox');
+	var polemic_val=document.getElementById('polemic_checkbox');
+	var sparkline_val=document.getElementById('sparkline_checkbox');
+	var tagcloud_val=document.getElementById('tagcloud_checkbox');
+	var createannotation_val=document.getElementById('createannotation_checkbox');
+	var type_embed=document.getElementById("type_embed_div");	
+	$j("#displayPolemicOptions").toggle(false);
+	$j("#displaySparklineOptions").toggle(false);
+	$j("#social_options").toggle(false);
+	$j("#sparkline_color_options").toggle(false);
+	display_polemic();
+	display_sparkline();
+
+	if(type_embed.checked){
+		createannotation_val.checked=false;
+	}
+	else{
+		$j("#createannotation_options").toggle(true);
+		createannotation_val.checked=true;
+		var show_mic_record_val = document.getElementById('show_mic_record_checkbox');
+		show_mic_record_val.checked=false;
+		
+	}
+	polemic_val.checked=true;
+	segments_val.checked=true;
+	annotationslist_val.checked=false;
+	slideshare_val.checked=false;
+	social_val.checked=false;
+	annotation_val.checked=true;
+	sparkline_val.checked=true;
+	tweet_val.checked=false;
+	tagcloud_val.checked=false;
+	put_new_code();
+	
+}
+
+function mode3(){
+	var annotationslist_val=document.getElementById('annotations_list_checkbox');
+	var slideshare_val=document.getElementById('slideshare_checkbox');
+	var social_val=document.getElementById('social_checkbox');
+	var annotation_val=document.getElementById('annotation_checkbox');
+	var tweet_val=document.getElementById('tweet_checkbox');
+	var segments_val=document.getElementById('segments_checkbox');
+	var polemic_val=document.getElementById('polemic_checkbox');
+	var sparkline_val=document.getElementById('sparkline_checkbox');
+	var tagcloud_val=document.getElementById('tagcloud_checkbox');
+	var createannotation_val=document.getElementById('createannotation_checkbox');
+	var type_embed=document.getElementById("type_embed_div");	
+	$j("#displayPolemicOptions").toggle(false);
+	$j("#displaySparklineOptions").toggle(false);
+	$j("#social_options").toggle(false);
+	$j("#sparkline_color_options").toggle(false);
+	display_polemic();
+	display_social();
+	display_sparkline();
+	if(type_embed.checked){
+		createannotation_val.checked=false;
+	}
+	else{
+		$j("#createannotation_options").toggle(true);
+		createannotation_val.checked=true;
+		var show_mic_record_val = document.getElementById('show_mic_record_checkbox');
+		show_mic_record_val.checked=false;	
+	}
+	polemic_val.checked=true;
+	segments_val.checked=true;
+	annotationslist_val.checked=true;
+	slideshare_val.checked=false;
+	social_val.checked=true;
+	annotation_val.checked=true;
+	tweet_val.checked=false;
+	sparkline_val.checked=true;
+	tagcloud_val.checked=true;
+	put_new_code();
+	
+}
+function iframe_event(){
+	$j("#createannotation_block").toggle(true);
+	$j("#createannotation_options").toggle(true);
 	var element = document.getElementById(wrapper);
-	var new_code=document.getElementById("embed_code_var").value;
-	var code_embed=document.getElementById("player_id_code");
+	var createannotation_val=document.getElementById('createannotation_checkbox');
+	createannotation_val.checked=true;
 	if(element.style.display=="block"){
-		$j(wrapper_id).html(new_code);
+		display_iframe_player();
 	}
-	code_embed.value= new_code;
+	iframe_code=generate_iframe_code();
+	$j("#player_id_code").val(iframe_code);
 	$j("#player_id_code").focus();
-	$j("#player_id_code").select();	
+	$j("#player_id_code").select();
+
 }	
 
-function iframe_event(){
+function generate_iframeUrl(){
+	var createannotation_val=document.getElementById('createannotation_checkbox');
+	var annotationslist_val=document.getElementById('annotations_list_checkbox');
+	var slideshare_val=document.getElementById('slideshare_checkbox');
+	var social_val=document.getElementById('social_checkbox');
+	var annotation_val=document.getElementById('annotation_checkbox');
+	var tweet_val=document.getElementById('tweet_checkbox');
+	var segments_val=document.getElementById('segments_checkbox');
+	var polemic_val=document.getElementById('polemic_checkbox');
+	var sparkline_val=document.getElementById('sparkline_checkbox');
+	var tagcloud_val=document.getElementById('tagcloud_checkbox');
+	iframeUrl= iframe_url;
+	iframeUrl+="&player_height="+$j("#player_height").val()+"&player_width="+$j("#player_width").val();
+	if(createannotation_val.checked){
+		iframeUrl+="&createannotation=True";
+		var show_mic_record_val = document.getElementById('show_mic_record_checkbox');
+		var set_tags_val=document.getElementById('set_tags');
+		if(show_mic_record_val.checked){
+			iframeUrl+="&show_mic_record=True";
+		}
+		if(set_tags_val.checked){
+			iframeUrl+="&tag_titles="+$j("#tag_list").val();
+		}
+	}
+	if (polemic_val.checked){
+		tweet_type=document.getElementById("tweet_polemic");
+		if(tweet_type.checked){
+			iframeUrl+="&polemic=tweet";
+		}
+		else{
+			iframeUrl+="&polemic=all";
+		}
+		polemic_defaultColor=$j("#polemic_default_color").val();
+		defaultColor_code_array= polemic_defaultColor.split("#");
+		defaultColor_code=defaultColor_code_array[1];
+		polemic_foundColor=$j("#polemic_found_color").val();
+		foundColor_code_array = polemic_foundColor.split("#");
+		foundColor_code=foundColor_code_array[1];
+		polemic_okColor =$j("#polemic_ok_color").val();
+		polemic_okColor_code_array=polemic_okColor.split("#");
+		okColor_code=polemic_okColor_code_array[1];
+		polemic_koColor =$j("#polemic_ko_color").val();
+		polemic_koColor_code_array=polemic_koColor.split("#");
+		koColor_code=polemic_koColor_code_array[1];
+		polemic_refColor =$j("#polemic_ref_color").val();
+		polemic_refColor_code_array=polemic_refColor.split("#");
+		refColor_code=polemic_refColor_code_array[1];
+		polemic_qColor =$j("#polemic_q_color").val();
+		polemic_qColor_code_array=polemic_qColor.split("#");
+		qColor_code=polemic_qColor_code_array[1];
+		iframeUrl+="&polemic_defaultColor="+defaultColor_code;
+		iframeUrl+="&polemic_foundColor="+foundColor_code;
+		iframeUrl+="&polemic_okColor="+okColor_code;
+		iframeUrl+="&polemic_koColor="+koColor_code;
+		iframeUrl+="&polemic_refColor="+refColor_code;
+		iframeUrl+="&polemic_qColor="+qColor_code;
+
+	}
+	else{
+		iframeUrl+="&polemic=False";
+	}
+	if(annotationslist_val.checked){
+		iframeUrl+="&annotations_list=True";
+	}
+	if(slideshare_val.checked){
+		iframeUrl+="&slideshare=True";
+	}
+	if(social_val.checked){
+		show_url=document.getElementById("show_url_checkbox");
+		show_twitter=document.getElementById("show_twitter_checkbox");
+		show_fb=document.getElementById("show_fb_checkbox");
+		show_gplus=document.getElementById("show_gplus_checkbox");
+		show_mail=document.getElementById("show_mail_checkbox");
+		iframeUrl+="&social=True";
+		if(show_url.checked){
+			iframeUrl+="&show_url=True";
+		}
+		if(show_twitter.checked){
+			iframeUrl+="&show_twitter=True";
+		}
+		if(show_fb.checked){
+			iframeUrl+="&show_fb=True";
+		}
+		if(show_gplus.checked){
+			iframeUrl+="&show_gplus=True";
+		}
+		if(show_mail.checked){
+			iframeUrl+="&show_mail=True";
+		}
+	}
+	if(tweet_val.checked){
+		iframeUrl+="&tweet=True";
+	}
+	if(segments_val.checked){
+		iframeUrl+="&segments=True";
+	}
+	if(sparkline_val.checked){
+		iframeUrl+="&sparkline=True";
+		sparkline_lineColor=$j("#sparkline_line_color").val();
+		lineColor_code_array= sparkline_lineColor.split("#");
+		lineColor_code=lineColor_code_array[1];
+		sparkline_fillColor=$j("#sparkline_fill_color").val();
+		fillColor_code_array = sparkline_fillColor.split("#");
+		fillColor_code=fillColor_code_array[1];
+		iframeUrl+="&sparkline_lineColor="+lineColor_code;
+		iframeUrl+="&sparkline_fillColor="+fillColor_code;
+	}
+	if(tagcloud_val.checked){
+		iframeUrl+="&tagcloud=True";
+	}
+
+  return iframeUrl;
+}
+
+function generate_iframe_code(){
+	var createannotation_val=document.getElementById('createannotation_checkbox');
+	var annotationslist_val=document.getElementById('annotations_list_checkbox');
+	var polemic_val=document.getElementById('polemic_checkbox');
+	var slideshare_val=document.getElementById('slideshare_checkbox');
+	var show_mic_record_val = document.getElementById('show_mic_record_checkbox');
+	iframeUrl=generate_iframeUrl();
+	player_width=parseInt($j("#player_width").val())+20;
+	player_height=parseInt($j("#player_height").val())+130;
+	if (createannotation_val.checked){
+		player_height+=281;
+	}
+	if(annotationslist_val.checked || slideshare_val.checked){
+		player_width+=430;
+	}
+	if(polemic_val.checked){
+		player_height+=100;
+		
+	}
+	if(show_mic_record_val.checked){
+		
+		player_height+=55;
+	}
+ 	iframe_code="<iframe src='"+iframeUrl+"' width='"+player_width+"' height='"+player_height+"' seamless='seamless'></iframe>";
+
+ 	return iframe_code;
+}
+
+function display_iframe_player(){
+	var createannotation_val=document.getElementById('createannotation_checkbox');
+	var annotationslist_val=document.getElementById('annotations_list_checkbox');
+	var polemic_val=document.getElementById('polemic_checkbox');
+	var slideshare_val=document.getElementById('slideshare_checkbox');
+	var show_mic_record_val = document.getElementById('show_mic_record_checkbox');
 	var code_embed=document.getElementById("player_id_code");
 	wrapper = "wrapper_"+player_id;
 	wrapper_id = "#"+wrapper;
-	var element = document.getElementById(wrapper);
-	iframeUrl= iframe_url+"&polemic="+polemic+"&show_mic_record="+show_mic_record+"&annotations_list="+annotations_list+"";
-	player_width=570;
-	player_height=678;
-	if(annotations_list!='False'){
+	iframeUrl= generate_iframeUrl();
+	player_width=parseInt($j("#player_width").val())+20;
+	player_height=parseInt($j("#player_height").val())+130;
+	if (createannotation_val.checked){
+		player_height+=300;
+		player_width+=50;
+	}
+	if(annotationslist_val.checked || slideshare_val.checked){
 		player_width+=430;
 	}
-	if(polemic!='False'){
+	if(polemic_val.checked){
 		player_height+=100;
 		
 	}
-	if(show_mic_record!='False'){
+	if(show_mic_record_val.checked){
 		
 		player_height+=55;
 	}
-	
-	if(element.style.display=="block"){
-		frame = document.createElement("iframe");
-	    frame.width = player_width;
-	    frame.height = player_height;
-	    frame.src = iframeUrl;
-	    frame.frameBorder = 0;
-	   	frame.seamless = "seamless";
-	   	$j(wrapper_id).html(frame);
+	frame = document.createElement("iframe");
+    frame.width = player_width;
+    frame.height = player_height;
+    frame.src = iframeUrl;
+    frame.frameBorder = 0;
+   	frame.seamless = "seamless";
+   	$j(wrapper_id).html(frame);
+}
+
+function set_default_color(code){
+	$j("#polemic_default_color").val("#"+code);
+	put_new_code();
+}
+
+function set_found_color(code){
+	$j("#polemic_found_color").val("#"+code);
+	put_new_code();
+}
+
+function set_line_color(code){
+	$j("#sparkline_line_color").val("#"+code);
+	put_new_code();
+}
+
+function set_fill_color(code){
+	$j("#sparkline_fill_color").val("#"+code);
+	put_new_code();
+}
+
+function refresh_player(){
+	var type_embed=document.getElementById("type_embed_div");
+	if (type_embed.checked){
+		var new_code=generate_div_code();
+		$j(wrapper_id).html(new_code);
 	}
-   	iframe_code="<iframe src='"+iframeUrl+"' width='"+player_width+"' height='"+player_height+"' seamless='seamless'></iframe>";
-	$j("#player_id_code").val(iframe_code);
-	$j("#player_id_code").focus();
-	$j("#player_id_code").select();
-}	
+	else{
+		display_iframe_player();
+	}
+}
Binary file src/ldt/ldt/static/ldt/js/jscolor/arrow.gif has changed
Binary file src/ldt/ldt/static/ldt/js/jscolor/cross.gif has changed
Binary file src/ldt/ldt/static/ldt/js/jscolor/hs.png has changed
Binary file src/ldt/ldt/static/ldt/js/jscolor/hv.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/ldt/ldt/static/ldt/js/jscolor/jscolor.js	Mon Nov 12 16:17:22 2012 +0100
@@ -0,0 +1,953 @@
+/**
+ * jscolor, JavaScript Color Picker
+ *
+ * @version 1.4.0
+ * @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
+ * @author  Jan Odvarko, http://odvarko.cz
+ * @created 2008-06-15
+ * @updated 2012-07-06
+ * @link    http://jscolor.com
+ */
+
+
+var jscolor = {
+
+
+	dir : '', // location of jscolor directory (leave empty to autodetect)
+	bindClass : 'color', // class name
+	binding : true, // automatic binding via <input class="...">
+	preloading : true, // use image preloading?
+
+
+	install : function() {
+		jscolor.addEvent(window, 'load', jscolor.init);
+	},
+
+
+	init : function() {
+		if(jscolor.binding) {
+			jscolor.bind();
+		}
+		if(jscolor.preloading) {
+			jscolor.preload();
+		}
+	},
+
+
+	getDir : function() {
+		if(!jscolor.dir) {
+			var detected = jscolor.detectDir();
+			jscolor.dir = detected!==false ? detected : 'jscolor/';
+		}
+		return jscolor.dir;
+	},
+
+
+	detectDir : function() {
+		var base = location.href;
+
+		var e = document.getElementsByTagName('base');
+		for(var i=0; i<e.length; i+=1) {
+			if(e[i].href) { base = e[i].href; }
+		}
+
+		var e = document.getElementsByTagName('script');
+		for(var i=0; i<e.length; i+=1) {
+			if(e[i].src && /(^|\/)jscolor\.js([?#].*)?$/i.test(e[i].src)) {
+				var src = new jscolor.URI(e[i].src);
+				var srcAbs = src.toAbsolute(base);
+				srcAbs.path = srcAbs.path.replace(/[^\/]+$/, ''); // remove filename
+				srcAbs.query = null;
+				srcAbs.fragment = null;
+				return srcAbs.toString();
+			}
+		}
+		return false;
+	},
+
+
+	bind : function() {
+		var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')\\s*(\\{[^}]*\\})?', 'i');
+		var e = document.getElementsByTagName('input');
+		for(var i=0; i<e.length; i+=1) {
+			var m;
+			if(!e[i].color && e[i].className && (m = e[i].className.match(matchClass))) {
+				var prop = {};
+				if(m[3]) {
+					try {
+						prop = (new Function ('return (' + m[3] + ')'))();
+					} catch(eInvalidProp) {}
+				}
+				e[i].color = new jscolor.color(e[i], prop);
+			}
+		}
+	},
+
+
+	preload : function() {
+		for(var fn in jscolor.imgRequire) {
+			if(jscolor.imgRequire.hasOwnProperty(fn)) {
+				jscolor.loadImage(fn);
+			}
+		}
+	},
+
+
+	images : {
+		pad : [ 181, 101 ],
+		sld : [ 16, 101 ],
+		cross : [ 15, 15 ],
+		arrow : [ 7, 11 ]
+	},
+
+
+	imgRequire : {},
+	imgLoaded : {},
+
+
+	requireImage : function(filename) {
+		jscolor.imgRequire[filename] = true;
+	},
+
+
+	loadImage : function(filename) {
+		if(!jscolor.imgLoaded[filename]) {
+			jscolor.imgLoaded[filename] = new Image();
+			jscolor.imgLoaded[filename].src = jscolor.getDir()+filename;
+		}
+	},
+
+
+	fetchElement : function(mixed) {
+		return typeof mixed === 'string' ? document.getElementById(mixed) : mixed;
+	},
+
+
+	addEvent : function(el, evnt, func) {
+		if(el.addEventListener) {
+			el.addEventListener(evnt, func, false);
+		} else if(el.attachEvent) {
+			el.attachEvent('on'+evnt, func);
+		}
+	},
+
+
+	fireEvent : function(el, evnt) {
+		if(!el) {
+			return;
+		}
+		if(document.createEvent) {
+			var ev = document.createEvent('HTMLEvents');
+			ev.initEvent(evnt, true, true);
+			el.dispatchEvent(ev);
+		} else if(document.createEventObject) {
+			var ev = document.createEventObject();
+			el.fireEvent('on'+evnt, ev);
+		} else if(el['on'+evnt]) { // alternatively use the traditional event model (IE5)
+			el['on'+evnt]();
+		}
+	},
+
+
+	getElementPos : function(e) {
+		var e1=e, e2=e;
+		var x=0, y=0;
+		if(e1.offsetParent) {
+			do {
+				x += e1.offsetLeft;
+				y += e1.offsetTop;
+			} while(e1 = e1.offsetParent);
+		}
+		while((e2 = e2.parentNode) && e2.nodeName.toUpperCase() !== 'BODY') {
+			x -= e2.scrollLeft;
+			y -= e2.scrollTop;
+		}
+		return [x, y];
+	},
+
+
+	getElementSize : function(e) {
+		return [e.offsetWidth, e.offsetHeight];
+	},
+
+
+	getRelMousePos : function(e) {
+		var x = 0, y = 0;
+		if (!e) { e = window.event; }
+		if (typeof e.offsetX === 'number') {
+			x = e.offsetX;
+			y = e.offsetY;
+		} else if (typeof e.layerX === 'number') {
+			x = e.layerX;
+			y = e.layerY;
+		}
+		return { x: x, y: y };
+	},
+
+
+	getViewPos : function() {
+		if(typeof window.pageYOffset === 'number') {
+			return [window.pageXOffset, window.pageYOffset];
+		} else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
+			return [document.body.scrollLeft, document.body.scrollTop];
+		} else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
+			return [document.documentElement.scrollLeft, document.documentElement.scrollTop];
+		} else {
+			return [0, 0];
+		}
+	},
+
+
+	getViewSize : function() {
+		if(typeof window.innerWidth === 'number') {
+			return [window.innerWidth, window.innerHeight];
+		} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
+			return [document.body.clientWidth, document.body.clientHeight];
+		} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
+			return [document.documentElement.clientWidth, document.documentElement.clientHeight];
+		} else {
+			return [0, 0];
+		}
+	},
+
+
+	URI : function(uri) { // See RFC3986
+
+		this.scheme = null;
+		this.authority = null;
+		this.path = '';
+		this.query = null;
+		this.fragment = null;
+
+		this.parse = function(uri) {
+			var m = uri.match(/^(([A-Za-z][0-9A-Za-z+.-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/);
+			this.scheme = m[3] ? m[2] : null;
+			this.authority = m[5] ? m[6] : null;
+			this.path = m[7];
+			this.query = m[9] ? m[10] : null;
+			this.fragment = m[12] ? m[13] : null;
+			return this;
+		};
+
+		this.toString = function() {
+			var result = '';
+			if(this.scheme !== null) { result = result + this.scheme + ':'; }
+			if(this.authority !== null) { result = result + '//' + this.authority; }
+			if(this.path !== null) { result = result + this.path; }
+			if(this.query !== null) { result = result + '?' + this.query; }
+			if(this.fragment !== null) { result = result + '#' + this.fragment; }
+			return result;
+		};
+
+		this.toAbsolute = function(base) {
+			var base = new jscolor.URI(base);
+			var r = this;
+			var t = new jscolor.URI;
+
+			if(base.scheme === null) { return false; }
+
+			if(r.scheme !== null && r.scheme.toLowerCase() === base.scheme.toLowerCase()) {
+				r.scheme = null;
+			}
+
+			if(r.scheme !== null) {
+				t.scheme = r.scheme;
+				t.authority = r.authority;
+				t.path = removeDotSegments(r.path);
+				t.query = r.query;
+			} else {
+				if(r.authority !== null) {
+					t.authority = r.authority;
+					t.path = removeDotSegments(r.path);
+					t.query = r.query;
+				} else {
+					if(r.path === '') {
+						t.path = base.path;
+						if(r.query !== null) {
+							t.query = r.query;
+						} else {
+							t.query = base.query;
+						}
+					} else {
+						if(r.path.substr(0,1) === '/') {
+							t.path = removeDotSegments(r.path);
+						} else {
+							if(base.authority !== null && base.path === '') {
+								t.path = '/'+r.path;
+							} else {
+								t.path = base.path.replace(/[^\/]+$/,'')+r.path;
+							}
+							t.path = removeDotSegments(t.path);
+						}
+						t.query = r.query;
+					}
+					t.authority = base.authority;
+				}
+				t.scheme = base.scheme;
+			}
+			t.fragment = r.fragment;
+
+			return t;
+		};
+
+		function removeDotSegments(path) {
+			var out = '';
+			while(path) {
+				if(path.substr(0,3)==='../' || path.substr(0,2)==='./') {
+					path = path.replace(/^\.+/,'').substr(1);
+				} else if(path.substr(0,3)==='/./' || path==='/.') {
+					path = '/'+path.substr(3);
+				} else if(path.substr(0,4)==='/../' || path==='/..') {
+					path = '/'+path.substr(4);
+					out = out.replace(/\/?[^\/]*$/, '');
+				} else if(path==='.' || path==='..') {
+					path = '';
+				} else {
+					var rm = path.match(/^\/?[^\/]*/)[0];
+					path = path.substr(rm.length);
+					out = out + rm;
+				}
+			}
+			return out;
+		}
+
+		if(uri) {
+			this.parse(uri);
+		}
+
+	},
+
+
+	/*
+	 * Usage example:
+	 * var myColor = new jscolor.color(myInputElement)
+	 */
+
+	color : function(target, prop) {
+
+
+		this.required = true; // refuse empty values?
+		this.adjust = true; // adjust value to uniform notation?
+		this.hash = false; // prefix color with # symbol?
+		this.caps = true; // uppercase?
+		this.slider = true; // show the value/saturation slider?
+		this.valueElement = target; // value holder
+		this.styleElement = target; // where to reflect current color
+		this.onImmediateChange = null; // onchange callback (can be either string or function)
+		this.hsv = [0, 0, 1]; // read-only  0-6, 0-1, 0-1
+		this.rgb = [1, 1, 1]; // read-only  0-1, 0-1, 0-1
+		this.minH = 0; // read-only  0-6
+		this.maxH = 6; // read-only  0-6
+		this.minS = 0; // read-only  0-1
+		this.maxS = 1; // read-only  0-1
+		this.minV = 0; // read-only  0-1
+		this.maxV = 1; // read-only  0-1
+
+		this.pickerOnfocus = true; // display picker on focus?
+		this.pickerMode = 'HSV'; // HSV | HVS
+		this.pickerPosition = 'bottom'; // left | right | top | bottom
+		this.pickerSmartPosition = true; // automatically adjust picker position when necessary
+		this.pickerButtonHeight = 20; // px
+		this.pickerClosable = false;
+		this.pickerCloseText = 'Close';
+		this.pickerButtonColor = 'ButtonText'; // px
+		this.pickerFace = 10; // px
+		this.pickerFaceColor = 'ThreeDFace'; // CSS color
+		this.pickerBorder = 1; // px
+		this.pickerBorderColor = 'ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight'; // CSS color
+		this.pickerInset = 1; // px
+		this.pickerInsetColor = 'ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow'; // CSS color
+		this.pickerZIndex = 10000;
+
+
+		for(var p in prop) {
+			if(prop.hasOwnProperty(p)) {
+				this[p] = prop[p];
+			}
+		}
+
+
+		this.hidePicker = function() {
+			if(isPickerOwner()) {
+				removePicker();
+			}
+		};
+
+
+		this.showPicker = function() {
+			if(!isPickerOwner()) {
+				var tp = jscolor.getElementPos(target); // target pos
+				var ts = jscolor.getElementSize(target); // target size
+				var vp = jscolor.getViewPos(); // view pos
+				var vs = jscolor.getViewSize(); // view size
+				var ps = getPickerDims(this); // picker size
+				var a, b, c;
+				switch(this.pickerPosition.toLowerCase()) {
+					case 'left': a=1; b=0; c=-1; break;
+					case 'right':a=1; b=0; c=1; break;
+					case 'top':  a=0; b=1; c=-1; break;
+					default:     a=0; b=1; c=1; break;
+				}
+				var l = (ts[b]+ps[b])/2;
+
+				// picker pos
+				if (!this.pickerSmartPosition) {
+					var pp = [
+						tp[a],
+						tp[b]+ts[b]-l+l*c
+					];
+				} else {
+					var pp = [
+						-vp[a]+tp[a]+ps[a] > vs[a] ?
+							(-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) :
+							tp[a],
+						-vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ?
+							(-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) :
+							(tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c)
+					];
+				}
+				drawPicker(pp[a], pp[b]);
+			}
+		};
+
+
+		this.importColor = function() {
+			if(!valueElement) {
+				this.exportColor();
+			} else {
+				if(!this.adjust) {
+					if(!this.fromString(valueElement.value, leaveValue)) {
+						styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage;
+						styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
+						styleElement.style.color = styleElement.jscStyle.color;
+						this.exportColor(leaveValue | leaveStyle);
+					}
+				} else if(!this.required && /^\s*$/.test(valueElement.value)) {
+					valueElement.value = '';
+					styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage;
+					styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
+					styleElement.style.color = styleElement.jscStyle.color;
+					this.exportColor(leaveValue | leaveStyle);
+
+				} else if(this.fromString(valueElement.value)) {
+					// OK
+				} else {
+					this.exportColor();
+				}
+			}
+		};
+
+
+		this.exportColor = function(flags) {
+			if(!(flags & leaveValue) && valueElement) {
+				var value = this.toString();
+				if(this.caps) { value = value.toUpperCase(); }
+				if(this.hash) { value = '#'+value; }
+				valueElement.value = value;
+			}
+			if(!(flags & leaveStyle) && styleElement) {
+				styleElement.style.backgroundImage = "none";
+				styleElement.style.backgroundColor =
+					'#'+this.toString();
+				styleElement.style.color =
+					0.213 * this.rgb[0] +
+					0.715 * this.rgb[1] +
+					0.072 * this.rgb[2]
+					< 0.5 ? '#FFF' : '#000';
+			}
+			if(!(flags & leavePad) && isPickerOwner()) {
+				redrawPad();
+			}
+			if(!(flags & leaveSld) && isPickerOwner()) {
+				redrawSld();
+			}
+		};
+
+
+		this.fromHSV = function(h, s, v, flags) { // null = don't change
+			if(h !== null) { h = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, h)); }
+			if(s !== null) { s = Math.max(0.0, this.minS, Math.min(1.0, this.maxS, s)); }
+			if(v !== null) { v = Math.max(0.0, this.minV, Math.min(1.0, this.maxV, v)); }
+
+			this.rgb = HSV_RGB(
+				h===null ? this.hsv[0] : (this.hsv[0]=h),
+				s===null ? this.hsv[1] : (this.hsv[1]=s),
+				v===null ? this.hsv[2] : (this.hsv[2]=v)
+			);
+
+			this.exportColor(flags);
+		};
+
+
+		this.fromRGB = function(r, g, b, flags) { // null = don't change
+			if(r !== null) { r = Math.max(0.0, Math.min(1.0, r)); }
+			if(g !== null) { g = Math.max(0.0, Math.min(1.0, g)); }
+			if(b !== null) { b = Math.max(0.0, Math.min(1.0, b)); }
+
+			var hsv = RGB_HSV(
+				r===null ? this.rgb[0] : r,
+				g===null ? this.rgb[1] : g,
+				b===null ? this.rgb[2] : b
+			);
+			if(hsv[0] !== null) {
+				this.hsv[0] = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, hsv[0]));
+			}
+			if(hsv[2] !== 0) {
+				this.hsv[1] = hsv[1]===null ? null : Math.max(0.0, this.minS, Math.min(1.0, this.maxS, hsv[1]));
+			}
+			this.hsv[2] = hsv[2]===null ? null : Math.max(0.0, this.minV, Math.min(1.0, this.maxV, hsv[2]));
+
+			// update RGB according to final HSV, as some values might be trimmed
+			var rgb = HSV_RGB(this.hsv[0], this.hsv[1], this.hsv[2]);
+			this.rgb[0] = rgb[0];
+			this.rgb[1] = rgb[1];
+			this.rgb[2] = rgb[2];
+
+			this.exportColor(flags);
+		};
+
+
+		this.fromString = function(hex, flags) {
+			var m = hex.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);
+			if(!m) {
+				return false;
+			} else {
+				if(m[1].length === 6) { // 6-char notation
+					this.fromRGB(
+						parseInt(m[1].substr(0,2),16) / 255,
+						parseInt(m[1].substr(2,2),16) / 255,
+						parseInt(m[1].substr(4,2),16) / 255,
+						flags
+					);
+				} else { // 3-char notation
+					this.fromRGB(
+						parseInt(m[1].charAt(0)+m[1].charAt(0),16) / 255,
+						parseInt(m[1].charAt(1)+m[1].charAt(1),16) / 255,
+						parseInt(m[1].charAt(2)+m[1].charAt(2),16) / 255,
+						flags
+					);
+				}
+				return true;
+			}
+		};
+
+
+		this.toString = function() {
+			return (
+				(0x100 | Math.round(255*this.rgb[0])).toString(16).substr(1) +
+				(0x100 | Math.round(255*this.rgb[1])).toString(16).substr(1) +
+				(0x100 | Math.round(255*this.rgb[2])).toString(16).substr(1)
+			);
+		};
+
+
+		function RGB_HSV(r, g, b) {
+			var n = Math.min(Math.min(r,g),b);
+			var v = Math.max(Math.max(r,g),b);
+			var m = v - n;
+			if(m === 0) { return [ null, 0, v ]; }
+			var h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m);
+			return [ h===6?0:h, m/v, v ];
+		}
+
+
+		function HSV_RGB(h, s, v) {
+			if(h === null) { return [ v, v, v ]; }
+			var i = Math.floor(h);
+			var f = i%2 ? h-i : 1-(h-i);
+			var m = v * (1 - s);
+			var n = v * (1 - s*f);
+			switch(i) {
+				case 6:
+				case 0: return [v,n,m];
+				case 1: return [n,v,m];
+				case 2: return [m,v,n];
+				case 3: return [m,n,v];
+				case 4: return [n,m,v];
+				case 5: return [v,m,n];
+			}
+		}
+
+
+		function removePicker() {
+			delete jscolor.picker.owner;
+			document.getElementsByTagName('body')[0].removeChild(jscolor.picker.boxB);
+		}
+
+
+		function drawPicker(x, y) {
+			if(!jscolor.picker) {
+				jscolor.picker = {
+					box : document.createElement('div'),
+					boxB : document.createElement('div'),
+					pad : document.createElement('div'),
+					padB : document.createElement('div'),
+					padM : document.createElement('div'),
+					sld : document.createElement('div'),
+					sldB : document.createElement('div'),
+					sldM : document.createElement('div'),
+					btn : document.createElement('div'),
+					btnS : document.createElement('span'),
+					btnT : document.createTextNode(THIS.pickerCloseText)
+				};
+				for(var i=0,segSize=4; i<jscolor.images.sld[1]; i+=segSize) {
+					var seg = document.createElement('div');
+					seg.style.height = segSize+'px';
+					seg.style.fontSize = '1px';
+					seg.style.lineHeight = '0';
+					jscolor.picker.sld.appendChild(seg);
+				}
+				jscolor.picker.sldB.appendChild(jscolor.picker.sld);
+				jscolor.picker.box.appendChild(jscolor.picker.sldB);
+				jscolor.picker.box.appendChild(jscolor.picker.sldM);
+				jscolor.picker.padB.appendChild(jscolor.picker.pad);
+				jscolor.picker.box.appendChild(jscolor.picker.padB);
+				jscolor.picker.box.appendChild(jscolor.picker.padM);
+				jscolor.picker.btnS.appendChild(jscolor.picker.btnT);
+				jscolor.picker.btn.appendChild(jscolor.picker.btnS);
+				jscolor.picker.box.appendChild(jscolor.picker.btn);
+				jscolor.picker.boxB.appendChild(jscolor.picker.box);
+			}
+
+			var p = jscolor.picker;
+
+			// controls interaction
+			p.box.onmouseup =
+			p.box.onmouseout = function() { target.focus(); };
+			p.box.onmousedown = function() { abortBlur=true; };
+			p.box.onmousemove = function(e) {
+				if (holdPad || holdSld) {
+					holdPad && setPad(e);
+					holdSld && setSld(e);
+					if (document.selection) {
+						document.selection.empty();
+					} else if (window.getSelection) {
+						window.getSelection().removeAllRanges();
+					}
+					dispatchImmediateChange();
+				}
+			};
+			p.padM.onmouseup =
+			p.padM.onmouseout = function() { if(holdPad) { holdPad=false; jscolor.fireEvent(valueElement,'change'); } };
+			p.padM.onmousedown = function(e) {
+				// if the slider is at the bottom, move it up
+				switch(modeID) {
+					case 0: if (THIS.hsv[2] === 0) { THIS.fromHSV(null, null, 1.0); }; break;
+					case 1: if (THIS.hsv[1] === 0) { THIS.fromHSV(null, 1.0, null); }; break;
+				}
+				holdPad=true;
+				setPad(e);
+				dispatchImmediateChange();
+			};
+			p.sldM.onmouseup =
+			p.sldM.onmouseout = function() { if(holdSld) { holdSld=false; jscolor.fireEvent(valueElement,'change'); } };
+			p.sldM.onmousedown = function(e) {
+				holdSld=true;
+				setSld(e);
+				dispatchImmediateChange();
+			};
+
+			// picker
+			var dims = getPickerDims(THIS);
+			p.box.style.width = dims[0] + 'px';
+			p.box.style.height = dims[1] + 'px';
+
+			// picker border
+			p.boxB.style.position = 'absolute';
+			p.boxB.style.clear = 'both';
+			p.boxB.style.left = x+'px';
+			p.boxB.style.top = y+'px';
+			p.boxB.style.zIndex = THIS.pickerZIndex;
+			p.boxB.style.border = THIS.pickerBorder+'px solid';
+			p.boxB.style.borderColor = THIS.pickerBorderColor;
+			p.boxB.style.background = THIS.pickerFaceColor;
+
+			// pad image
+			p.pad.style.width = jscolor.images.pad[0]+'px';
+			p.pad.style.height = jscolor.images.pad[1]+'px';
+
+			// pad border
+			p.padB.style.position = 'absolute';
+			p.padB.style.left = THIS.pickerFace+'px';
+			p.padB.style.top = THIS.pickerFace+'px';
+			p.padB.style.border = THIS.pickerInset+'px solid';
+			p.padB.style.borderColor = THIS.pickerInsetColor;
+
+			// pad mouse area
+			p.padM.style.position = 'absolute';
+			p.padM.style.left = '0';
+			p.padM.style.top = '0';
+			p.padM.style.width = THIS.pickerFace + 2*THIS.pickerInset + jscolor.images.pad[0] + jscolor.images.arrow[0] + 'px';
+			p.padM.style.height = p.box.style.height;
+			p.padM.style.cursor = 'crosshair';
+
+			// slider image
+			p.sld.style.overflow = 'hidden';
+			p.sld.style.width = jscolor.images.sld[0]+'px';
+			p.sld.style.height = jscolor.images.sld[1]+'px';
+
+			// slider border
+			p.sldB.style.display = THIS.slider ? 'block' : 'none';
+			p.sldB.style.position = 'absolute';
+			p.sldB.style.right = THIS.pickerFace+'px';
+			p.sldB.style.top = THIS.pickerFace+'px';
+			p.sldB.style.border = THIS.pickerInset+'px solid';
+			p.sldB.style.borderColor = THIS.pickerInsetColor;
+
+			// slider mouse area
+			p.sldM.style.display = THIS.slider ? 'block' : 'none';
+			p.sldM.style.position = 'absolute';
+			p.sldM.style.right = '0';
+			p.sldM.style.top = '0';
+			p.sldM.style.width = jscolor.images.sld[0] + jscolor.images.arrow[0] + THIS.pickerFace + 2*THIS.pickerInset + 'px';
+			p.sldM.style.height = p.box.style.height;
+			try {
+				p.sldM.style.cursor = 'pointer';
+			} catch(eOldIE) {
+				p.sldM.style.cursor = 'hand';
+			}
+
+			// "close" button
+			function setBtnBorder() {
+				var insetColors = THIS.pickerInsetColor.split(/\s+/);
+				var pickerOutsetColor = insetColors.length < 2 ? insetColors[0] : insetColors[1] + ' ' + insetColors[0] + ' ' + insetColors[0] + ' ' + insetColors[1];
+				p.btn.style.borderColor = pickerOutsetColor;
+			}
+			p.btn.style.display = THIS.pickerClosable ? 'block' : 'none';
+			p.btn.style.position = 'absolute';
+			p.btn.style.left = THIS.pickerFace + 'px';
+			p.btn.style.bottom = THIS.pickerFace + 'px';
+			p.btn.style.padding = '0 15px';
+			p.btn.style.height = '18px';
+			p.btn.style.border = THIS.pickerInset + 'px solid';
+			setBtnBorder();
+			p.btn.style.color = THIS.pickerButtonColor;
+			p.btn.style.font = '12px sans-serif';
+			p.btn.style.textAlign = 'center';
+			try {
+				p.btn.style.cursor = 'pointer';
+			} catch(eOldIE) {
+				p.btn.style.cursor = 'hand';
+			}
+			p.btn.onmousedown = function () {
+				THIS.hidePicker();
+			};
+			p.btnS.style.lineHeight = p.btn.style.height;
+
+			// load images in optimal order
+			switch(modeID) {
+				case 0: var padImg = 'hs.png'; break;
+				case 1: var padImg = 'hv.png'; break;
+			}
+			p.padM.style.backgroundImage = "url('"+jscolor.getDir()+"cross.gif')";
+			p.padM.style.backgroundRepeat = "no-repeat";
+			p.sldM.style.backgroundImage = "url('"+jscolor.getDir()+"arrow.gif')";
+			p.sldM.style.backgroundRepeat = "no-repeat";
+			p.pad.style.backgroundImage = "url('"+jscolor.getDir()+padImg+"')";
+			p.pad.style.backgroundRepeat = "no-repeat";
+			p.pad.style.backgroundPosition = "0 0";
+
+			// place pointers
+			redrawPad();
+			redrawSld();
+
+			jscolor.picker.owner = THIS;
+			document.getElementsByTagName('body')[0].appendChild(p.boxB);
+		}
+
+
+		function getPickerDims(o) {
+			var dims = [
+				2*o.pickerInset + 2*o.pickerFace + jscolor.images.pad[0] +
+					(o.slider ? 2*o.pickerInset + 2*jscolor.images.arrow[0] + jscolor.images.sld[0] : 0),
+				o.pickerClosable ?
+					4*o.pickerInset + 3*o.pickerFace + jscolor.images.pad[1] + o.pickerButtonHeight :
+					2*o.pickerInset + 2*o.pickerFace + jscolor.images.pad[1]
+			];
+			return dims;
+		}
+
+
+		function redrawPad() {
+			// redraw the pad pointer
+			switch(modeID) {
+				case 0: var yComponent = 1; break;
+				case 1: var yComponent = 2; break;
+			}
+			var x = Math.round((THIS.hsv[0]/6) * (jscolor.images.pad[0]-1));
+			var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.pad[1]-1));
+			jscolor.picker.padM.style.backgroundPosition =
+				(THIS.pickerFace+THIS.pickerInset+x - Math.floor(jscolor.images.cross[0]/2)) + 'px ' +
+				(THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.cross[1]/2)) + 'px';
+
+			// redraw the slider image
+			var seg = jscolor.picker.sld.childNodes;
+
+			switch(modeID) {
+				case 0:
+					var rgb = HSV_RGB(THIS.hsv[0], THIS.hsv[1], 1);
+					for(var i=0; i<seg.length; i+=1) {
+						seg[i].style.backgroundColor = 'rgb('+
+							(rgb[0]*(1-i/seg.length)*100)+'%,'+
+							(rgb[1]*(1-i/seg.length)*100)+'%,'+
+							(rgb[2]*(1-i/seg.length)*100)+'%)';
+					}
+					break;
+				case 1:
+					var rgb, s, c = [ THIS.hsv[2], 0, 0 ];
+					var i = Math.floor(THIS.hsv[0]);
+					var f = i%2 ? THIS.hsv[0]-i : 1-(THIS.hsv[0]-i);
+					switch(i) {
+						case 6:
+						case 0: rgb=[0,1,2]; break;
+						case 1: rgb=[1,0,2]; break;
+						case 2: rgb=[2,0,1]; break;
+						case 3: rgb=[2,1,0]; break;
+						case 4: rgb=[1,2,0]; break;
+						case 5: rgb=[0,2,1]; break;
+					}
+					for(var i=0; i<seg.length; i+=1) {
+						s = 1 - 1/(seg.length-1)*i;
+						c[1] = c[0] * (1 - s*f);
+						c[2] = c[0] * (1 - s);
+						seg[i].style.backgroundColor = 'rgb('+
+							(c[rgb[0]]*100)+'%,'+
+							(c[rgb[1]]*100)+'%,'+
+							(c[rgb[2]]*100)+'%)';
+					}
+					break;
+			}
+		}
+
+
+		function redrawSld() {
+			// redraw the slider pointer
+			switch(modeID) {
+				case 0: var yComponent = 2; break;
+				case 1: var yComponent = 1; break;
+			}
+			var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.sld[1]-1));
+			jscolor.picker.sldM.style.backgroundPosition =
+				'0 ' + (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.arrow[1]/2)) + 'px';
+		}
+
+
+		function isPickerOwner() {
+			return jscolor.picker && jscolor.picker.owner === THIS;
+		}
+
+
+		function blurTarget() {
+			if(valueElement === target) {
+				THIS.importColor();
+			}
+			if(THIS.pickerOnfocus) {
+				THIS.hidePicker();
+			}
+		}
+
+
+		function blurValue() {
+			if(valueElement !== target) {
+				THIS.importColor();
+			}
+		}
+
+
+		function setPad(e) {
+			var mpos = jscolor.getRelMousePos(e);
+			var x = mpos.x - THIS.pickerFace - THIS.pickerInset;
+			var y = mpos.y - THIS.pickerFace - THIS.pickerInset;
+			switch(modeID) {
+				case 0: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), 1 - y/(jscolor.images.pad[1]-1), null, leaveSld); break;
+				case 1: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), null, 1 - y/(jscolor.images.pad[1]-1), leaveSld); break;
+			}
+		}
+
+
+		function setSld(e) {
+			var mpos = jscolor.getRelMousePos(e);
+			var y = mpos.y - THIS.pickerFace - THIS.pickerInset;
+			switch(modeID) {
+				case 0: THIS.fromHSV(null, null, 1 - y/(jscolor.images.sld[1]-1), leavePad); break;
+				case 1: THIS.fromHSV(null, 1 - y/(jscolor.images.sld[1]-1), null, leavePad); break;
+			}
+		}
+
+
+		function dispatchImmediateChange() {
+			if (THIS.onImmediateChange) {
+				var callback;
+				if (typeof THIS.onImmediateChange === 'string') {
+					callback = new Function (THIS.onImmediateChange);
+				} else {
+					callback = THIS.onImmediateChange;
+				}
+				callback.call(THIS);
+			}
+		}
+
+
+		var THIS = this;
+		var modeID = this.pickerMode.toLowerCase()==='hvs' ? 1 : 0;
+		var abortBlur = false;
+		var
+			valueElement = jscolor.fetchElement(this.valueElement),
+			styleElement = jscolor.fetchElement(this.styleElement);
+		var
+			holdPad = false,
+			holdSld = false;
+		var
+			leaveValue = 1<<0,
+			leaveStyle = 1<<1,
+			leavePad = 1<<2,
+			leaveSld = 1<<3;
+
+		// target
+		jscolor.addEvent(target, 'focus', function() {
+			if(THIS.pickerOnfocus) { THIS.showPicker(); }
+		});
+		jscolor.addEvent(target, 'blur', function() {
+			if(!abortBlur) {
+				window.setTimeout(function(){ abortBlur || blurTarget(); abortBlur=false; }, 0);
+			} else {
+				abortBlur = false;
+			}
+		});
+
+		// valueElement
+		if(valueElement) {
+			var updateField = function() {
+				THIS.fromString(valueElement.value, leaveValue);
+				dispatchImmediateChange();
+			};
+			jscolor.addEvent(valueElement, 'keyup', updateField);
+			jscolor.addEvent(valueElement, 'input', updateField);
+			jscolor.addEvent(valueElement, 'blur', blurValue);
+			valueElement.setAttribute('autocomplete', 'off');
+		}
+
+		// styleElement
+		if(styleElement) {
+			styleElement.jscStyle = {
+				backgroundImage : styleElement.style.backgroundImage,
+				backgroundColor : styleElement.style.backgroundColor,
+				color : styleElement.style.color
+			};
+		}
+
+		// require images
+		switch(modeID) {
+			case 0: jscolor.requireImage('hs.png'); break;
+			case 1: jscolor.requireImage('hv.png'); break;
+		}
+		jscolor.requireImage('cross.gif');
+		jscolor.requireImage('arrow.gif');
+
+		this.importColor();
+	}
+
+};
+
+
+jscolor.install();
--- a/src/ldt/ldt/static/ldt/js/projectscontents.js	Mon Nov 12 13:28:31 2012 +0100
+++ b/src/ldt/ldt/static/ldt/js/projectscontents.js	Mon Nov 12 16:17:22 2012 +0100
@@ -1,32 +1,6 @@
 
 function init_events_base(base_node, embed_url) {
 
-    $('.ldt_link_embed',base_node).click(function(e) {
-        e.preventDefault();
-        var link = $(e.target);
-        var json_url = link.attr("href");
-        var player_id = link.attr("id");
-        var ldt_id = player_id.substring(15);
-        $('<a />', {
-            href: embed_url+'?json_url='+escape(json_url)+'&player_id='+escape(player_id)+'&ldt_id='+escape(ldt_id),
-            target: "_blank"
-        }).nyroModal({
-            filters: ['iframe'],
-            sizes: {
-                minW: '750',
-                minH: '662'
-            },
-            callbacks: {
-                afterShowCont: function(nm) {
-                    nm.store.iframe.height(662);
-                    nm.store.iframe.width(750);
-                }
-            }
-            }).trigger('nyroModal');
-        return false;
-    });
-
-
     $('.imageline',base_node).each(function(i) {
         var tr = $(this);
         tr.mouseover(function() {