src/ldt/ldt/static/ldt/js/embed/v2/embed.js
author ymh <ymh.work@gmail.com>
Thu, 09 Apr 2015 00:06:16 +0200
changeset 1355 f50a9939e35a
parent 1354 01b0a1f96285
child 1447 470130d647cb
permissions -rw-r--r--
add streamer and url_transform to autoplayer
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
     1
"use strict";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
     2
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
     3
var display_state = "player";
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
     4
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
     5
function toggle_display() {
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
     6
    $j.each(["player","ldt_iframe","seo_body","seo_meta","links"], function(i,display_str) {
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
     7
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
     8
        var div_selector = "#"+display_str+"_code";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
     9
        if(display_str === display_state) {
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    10
            $j(div_selector).show();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    11
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    12
        else {
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    13
            $j(div_selector).hide();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    14
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    15
    });
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
    16
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
    17
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
    18
function init_events(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    19
    toggle_display();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    20
    $j("#iframe_div_premode").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    21
    $j("#embed_personnalisation").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    22
    $j("#player_width").val(550);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    23
    $j("#player_height").val(300);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    24
    $j("#optionsExpArrow").toggle(true);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    25
    $j("#optionsCollArrow").toggle(false);	
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    26
    $j("#preModeExpArrow").toggle(true);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    27
    $j("#preModeCollArrow").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    28
    $j("#createannotation_block").toggle(true);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    29
    $j("#player_id_code").select();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    30
    $j("#polemic_color_options").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    31
    $j("#sparkline_color_options").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    32
    $j("#social_options").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    33
    $j("#displaySegmentsOptions").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    34
    $j("#displayPolemicOptions").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    35
    $j("#displaySparklineOptions").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    36
    $j("#polemic_default_color").val("#585858");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    37
    $j("#polemic_found_color").val("#fc00ff");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    38
    $j("#polemic_ok_color").val("#1d973d");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    39
    $j("#polemic_ko_color").val("#ce0a15");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    40
    $j("#polemic_ref_color").val("#c5a62d");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    41
    $j("#polemic_q_color").val("#036aae");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    42
    $j("#sparkline_line_color").val("#7492b4");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    43
    $j("#sparkline_fill_color").val("#aeaeb8");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    44
    var type_embed=document.getElementById("type_embed_div");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    45
    type_embed.checked=true;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    46
    $j("#createannotation_options").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    47
    mode1();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    48
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    49
    $j(".click_to_select").click(function(){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    50
        var i = $j(this).parent().find("input");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    51
        i.select();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    52
    });
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    53
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    54
    $j('.ldt_json_link').click(function(e) {
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    55
        e.preventDefault();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    56
        link = $j(e.target);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    57
        $j("#res_link_{{player_id}}").load(link.attr("href"));
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    58
        $j("#res_link_{{player_id}}").show();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    59
        return false;
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
    60
    });
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
    61
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
    62
    $j('#player_button').click(function(e) {
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    63
        display_state = "player";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    64
        toggle_display();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    65
        $j("#player_id_code").select();
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
    66
    });
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
    67
    $j('#ldt_iframe_button').click(function(e) {
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    68
        display_state = "ldt_iframe";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    69
        toggle_display();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    70
        $j("#ldt_iframe_id_code").select();
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
    71
    });
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
    72
    $j('#seo_body_button').click(function(e) {
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    73
        display_state = "seo_body";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    74
        toggle_display();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    75
        $j("#seo_body_id_code").select();
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
    76
    });
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
    77
    $j('#seo_meta_button').click(function(e) {
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    78
        display_state = "seo_meta";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    79
        toggle_display();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    80
        $j("#seo_meta_id_code").select();
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
    81
    });
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
    82
    $j('#links_button').click(function(e) {
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    83
        display_state = "links";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    84
        toggle_display();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    85
    });
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    86
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    87
    $j("#copy_button").click(function(e) {
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    88
        alert($j("#"+display_state+"_code").html());
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    89
    });
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    90
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    91
    $j("#refresh_player_button").click(function(e){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    92
        refresh_player();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    93
        $j("#player_id_code").select();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    94
    });
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    95
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    96
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    97
    $j('#links_button').click(function() {
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    98
        var range = document.createRange();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
    99
        range.selectNode(document.getElementById('links_code'));
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   100
        window.getSelection().addRange(range);
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   101
    });
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   102
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   103
    $j('#displayPreMode').click(function(){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   104
        $j("#iframe_div_premode").slideToggle("fast");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   105
        $j("#preModeExpArrow").toggle();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   106
        $j("#preModeCollArrow").toggle();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   107
    });
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   108
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   109
    $j("#displayEmbedOptions").click(function(){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   110
        $j("#embed_personnalisation").slideToggle("fast");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   111
        $j("#optionsExpArrow").toggle();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   112
        $j("#optionsCollArrow").toggle();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   113
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   114
    });
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   115
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   116
    $j("#displayPolemicColorOptions").click(function(){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   117
        $j("#polemic_color_options").slideToggle("fast");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   118
    });
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   119
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   120
    $j("#displaySparklineOptions").click(function(){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   121
        $j("#sparkline_color_options").slideToggle("fast");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   122
    });
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   123
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   124
    $('.infostooltip').each( function () {
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   125
        var desc = $(this).attr('data-desc');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   126
        if (desc == 'None') {
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   127
            desc = '';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   128
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   129
        $(this).qtip({ 
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   130
            content : {
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   131
                text: '<b>' + $(this).attr('data-title') + '</b><br />' + desc
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   132
            },
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   133
            style: {
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   134
                classes: 'ui-tooltip-dark ui-tooltip-rounded qtipldt'
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   135
            },
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   136
            border: {
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   137
                'width': 0,
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   138
                'color': '#505050'
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   139
            },
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   140
            position: {
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   141
                my: 'top left',
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   142
                at: 'bottom left'
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   143
            }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   144
        });
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   145
    });
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   146
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   147
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   148
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   149
function generate_base_embed_code(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   150
    var concatenate_projects_val = document.getElementById("concatenate_projects_checkbox");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   151
    var player_width_val=$j("#player_width").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   152
    var json_url_embed;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   153
    if (concatenate_projects_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   154
        json_url_embed=json_url_concatenate;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   155
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   156
    else {
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   157
        json_url_embed=json_url;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   158
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   159
    return '\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   160
        <div> \n \
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   161
        <div id="'+player_id+'_embed" style="float:left; width:'+player_width_val+';" class="iri_player_embed">\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   162
        </div>\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   163
        <script type="text/javascript" src="'+LdtPlayer_core+'"></script>\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   164
        <script type="text/javascript">\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   165
        if (typeof jQuery == "undefined") {\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   166
        jQuery = IriSP.jQuery;\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   167
        }\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   168
        var metadatas = {metadata: {url: "'+json_url_embed+'"}};\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   169
        var metadata_key = "metadata";\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   170
        IriSP.libFiles.defaultDir = "'+defaultDir+'";\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   171
        IriSP.libFiles.locations.jwPlayerSWF = "'+jwPlayerSWF+'";\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   172
        IriSP.libFiles.locations.recordMicSwf = "'+recordMicSwf+'";\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   173
        IriSP.libFiles.locations.zeroClipboardSwf = "'+zeroClipboardSwf+'";\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   174
        IriSP.libFiles.locations.cssjQueryUI = "'+cssjQueryUI+'";\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   175
        IriSP.language = "'+LANGUAGE_CODE+'";\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   176
        \n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   177
        IriSP.widgetsDir = "'+widgetsDir+'";\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   178
        var _metadata = {\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   179
        url: metadatas[metadata_key].url,\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   180
        format: "ldt"\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   181
        };\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   182
        var _config = {\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   183
        width: "'+player_width_val+'",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   184
        container: "'+player_id+'_embed",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   185
        css: "'+configCss+'",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   186
        default_options: {\n\
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   187
        metadata: _metadata\n\
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   188
        },\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   189
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   190
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   191
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   192
function generate_widget_code(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   193
    var annotationslist_val=document.getElementById('annotations_list_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   194
    var slideshare_val=document.getElementById('slideshare_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   195
    var social_val=document.getElementById('social_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   196
    var annotation_val=document.getElementById('annotation_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   197
    var tweet_val=document.getElementById('tweet_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   198
    var segments_val=document.getElementById('segments_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   199
    var multisegments_val=document.getElementById('multisegments_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   200
    var polemic_val=document.getElementById('polemic_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   201
    var sparkline_val=document.getElementById('sparkline_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   202
    var tagcloud_val=document.getElementById('tagcloud_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   203
    var player_height_val=$j('#player_height').val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   204
    var autostart_val=document.getElementById('autostart_checkbox');
1352
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   205
    var createannotation_val=document.getElementById('createannotation_checkbox');
1355
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   206
    var widget_code=
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   207
        '  widgets: [\n' +
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   208
        '  {\n' +
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   209
        '    type: "AutoPlayer",\n' +
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   210
        '    streamer: function(_url) {\n' +
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   211
        '      var _matches = _url.match(/^[^\\/]+\\/\\/[^\\/]+\\/[^\\/]+\\//);\n' +
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   212
        '      if (_matches) {\n' +
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   213
        '        return _matches[0];\n' +
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   214
        '      } else {\n' +
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   215
        '        return _url;\n' +
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   216
        '      }\n' +
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   217
        '    },\n' +
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   218
        '    url_transform: function(url) {\n' +
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   219
        '      // Adaptation to jwplayer 6\n' +
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   220
        '      if (url.substr(url.length - 4).toLowerCase()===\'.flv\'){\n' +
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   221
        '        return url.replace(\'/ddc_player/video/\',\'/ddc_player/flv:video/\');\n' +
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   222
        '      }\n' +
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   223
        '      return url.replace(\'/ddc_player/video/\',\'/ddc_player/mp4:video/\');\n' +
f50a9939e35a add streamer and url_transform to autoplayer
ymh <ymh.work@gmail.com>
parents: 1354
diff changeset
   224
        '    },\n';
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   225
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   226
    if (external_url!='None'){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   227
        widget_code+='video: "'+external_url+'",\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   228
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   229
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   230
    widget_code+='height: '+player_height_val+',\n'  
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   231
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   232
    if (autostart_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   233
        widget_code+='autostart: true\n\}';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   234
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   235
    else {
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   236
        widget_code+='autostart: false\n\}';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   237
    }
1352
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   238
    
1354
01b0a1f96285 add absolute path for embed resources + correctly reorder slider and controller
ymh <ymh.work@gmail.com>
parents: 1352
diff changeset
   239
    widget_code += ',{\n' +
01b0a1f96285 add absolute path for embed resources + correctly reorder slider and controller
ymh <ymh.work@gmail.com>
parents: 1352
diff changeset
   240
        'type: "Slider"\n' +
01b0a1f96285 add absolute path for embed resources + correctly reorder slider and controller
ymh <ymh.work@gmail.com>
parents: 1352
diff changeset
   241
        '},{\n' +
01b0a1f96285 add absolute path for embed resources + correctly reorder slider and controller
ymh <ymh.work@gmail.com>
parents: 1352
diff changeset
   242
        'type: "Controller"\n' +
01b0a1f96285 add absolute path for embed resources + correctly reorder slider and controller
ymh <ymh.work@gmail.com>
parents: 1352
diff changeset
   243
        '},{\n' +
01b0a1f96285 add absolute path for embed resources + correctly reorder slider and controller
ymh <ymh.work@gmail.com>
parents: 1352
diff changeset
   244
        'type: "Mediafragment"\n' +
01b0a1f96285 add absolute path for embed resources + correctly reorder slider and controller
ymh <ymh.work@gmail.com>
parents: 1352
diff changeset
   245
        '}\n';
1352
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   246
    
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   247
    if (polemic_val.checked){	
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   248
        defaultcolor= $j("#polemic_default_color").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   249
        foundcolor=$j("#polemic_found_color").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   250
        ok_color=$j("#polemic_ok_color").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   251
        ko_color=$j("#polemic_ko_color").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   252
        ref_color=$j("#polemic_ref_color").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   253
        q_color=$j("#polemic_q_color").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   254
        polemic_annotation_types_val=document.getElementById("polemic_annotation_types");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   255
        widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   256
            ,{\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   257
            type: "Polemic",\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   258
        if(polemic_annotation_types_val.value){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   259
            var polemic_annotation_types_array=polemic_annotation_types_val.value.split(",")
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   260
            widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   261
                annotation_type: [';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   262
            for (i=0; i<polemic_annotation_types_array.length; i++){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   263
                widget_code+='"'+polemic_annotation_types_array[i]+'"'
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   264
                if (i!=polemic_annotation_types_array.length-1){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   265
                    widget_code+=','
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   266
                }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   267
            }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   268
            widget_code+='],\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   269
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   270
        else{
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   271
            widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   272
                annotation_type: false,\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   273
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   274
        widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   275
            defaultcolor: "'+defaultcolor+'",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   276
            foundcolor: "'+foundcolor+'",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   277
            polemics : [\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   278
            {\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   279
            "name" : "OK",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   280
            "keywords" : [ "++" ],\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   281
            "color" : "'+ok_color+'"\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   282
            },\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   283
            {\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   284
            "name" : "KO",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   285
            "keywords" : [ "--" ],\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   286
            "color" : "'+ko_color+'"\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   287
            },\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   288
            {\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   289
            "name" : "REF",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   290
            "keywords" : [ "==" ],\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   291
            "color" : "'+ref_color+'"\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   292
            },\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   293
            {\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   294
            "name" : "Q",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   295
            "keywords" : [ "?" ],\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   296
            "color" : "'+q_color+'"\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   297
            },\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   298
            ]\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   299
            }';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   300
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   301
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   302
    if(sparkline_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   303
        linecolor=$j("#sparkline_line_color").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   304
        fillcolor=$j("#sparkline_fill_color").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   305
        widget_code+=',{\n\
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   306
            type: "Sparkline",\n\
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   307
            lineColor: "'+linecolor+'",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   308
            fillColor: "'+fillcolor+'"\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   309
            }';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   310
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   311
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   312
    if(segments_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   313
        widget_code+=',{\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   314
            type: "Segments",\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   315
        var segments_annotation_types_val=document.getElementById('segments_annotation_types');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   316
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   317
        if(segments_annotation_types_val.value){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   318
            var segments_annotation_types_array=segments_annotation_types_val.value.split(",")
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   319
            widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   320
                annotation_type: [';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   321
            for (var i=0; i<segments_annotation_types_array.length; i++){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   322
                widget_code+='"'+segments_annotation_types_array[i]+'"'
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   323
                if (i!=segments_annotation_types_array.length-1){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   324
                    widget_code+=','
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   325
                }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   326
            }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   327
            widget_code+='],\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   328
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   329
        else {
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   330
            widget_code+='annotation_type: false\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   331
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   332
        widget_code+='}';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   333
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   334
    if(multisegments_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   335
        widget_code+=',{\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   336
            type: "MultiSegments",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   337
            }';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   338
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   339
1352
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   340
    if(createannotation_val.checked) {
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   341
        
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   342
        var tag_titles = ($j('input[name=annotation_tag]:checked').attr('id') === 'set_tags') ? $j('#tag_list').val() : false;
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   343
        var show_mic_record = $j("#show_mic_record_checkbox").prop('checked');
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   344
        var createannotation_polemics = $j('#createannotation_polemics_checkbox').prop('checked');
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   345
        var createannotation_annotation_types = $j('#createannotation_annotation_types').val();
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   346
        
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   347
        widget_code +=
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   348
        ',\n{\n' +
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   349
        '  type: "CreateAnnotation",\n' +
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   350
        '  api_endpoint_template: "'+ annotation_api +'",\n' +
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   351
        '  after_send_timeout: 8000,\n' +
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   352
        '  tag_titles : ' + ( (tag_titles || tag_titles === "") ? JSON.stringify(tag_titles.split(',')) : 'false') + ',\n' + 
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   353
        '  show_mic_record : ' +  (show_mic_record ? 'true' : 'false') + ',\n' +
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   354
        '  close_after_send: false,\n' +
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   355
        '  slice_annotation_type: ' + (createannotation_annotation_types ? JSON.stringify(createannotation_annotation_types.split(',')) : '["chap","découpage"]') + ',\n' +
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   356
        '  creator_avatar: "https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png",\n' +
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   357
        ((!createannotation_polemics) ? '  polemics: []' : '') + '\n'
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   358
        + '}\n';
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   359
    }
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   360
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   361
    if(slideshare_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   362
        widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   363
            ,{\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   364
            type: "Slideshare",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   365
            container: "Slideshare_ext",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   366
            embed_width: 400,\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   367
            embed_height: 334,\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   368
            annotation_type: "slide"\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   369
            }';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   370
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   371
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   372
    if(social_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   373
        show_url=document.getElementById("show_url_checkbox");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   374
        show_twitter=document.getElementById("show_twitter_checkbox");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   375
        show_fb=document.getElementById("show_fb_checkbox");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   376
        show_gplus=document.getElementById("show_gplus_checkbox");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   377
        show_mail=document.getElementById("show_mail_checkbox");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   378
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   379
        widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   380
            ,{\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   381
            type: "Social",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   382
            container: "Social_ext",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   383
            url: document.location.href.replace(/#.*$/,""),\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   384
            text: document.title,\n';
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   385
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   386
        if(show_url.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   387
            widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   388
                show_url: true,\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   389
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   390
        else{
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   391
            widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   392
                show_url: false,\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   393
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   394
        if(show_twitter.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   395
            widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   396
                show_twitter: true,\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   397
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   398
        else{
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   399
            widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   400
                show_twitter: false,\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   401
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   402
        if(show_fb.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   403
            widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   404
                show_fb: true,\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   405
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   406
        else{
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   407
            widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   408
                show_fb: false,\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   409
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   410
        if(show_gplus.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   411
            widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   412
                show_gplus: true,\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   413
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   414
        else{
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   415
            widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   416
                show_gplus: false,\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   417
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   418
        if(show_mail.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   419
            widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   420
                show_mail: true\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   421
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   422
        else{
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   423
            widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   424
                show_mail: false\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   425
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   426
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   427
        widget_code+='}';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   428
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   429
    if(annotation_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   430
        widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   431
            ,{\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   432
            type: "Annotation",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   433
            start_minimized: true,\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   434
            site_name : "Lignes de Temps",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   435
            annotation_type: ["chap","découpage"]\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   436
            }';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   437
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   438
    if(tweet_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   439
        widget_code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   440
            ,{\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   441
            type: "Tweet",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   442
            hide_timeout: 5000\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   443
            }';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   444
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   445
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   446
    if(annotationslist_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   447
        widget_code+=',{\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   448
            type: "AnnotationsList",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   449
            ajax_url: "'+segment_api+'",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   450
            container: "AnnotationsList_ext",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   451
            ajax_granularity : 300000,\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   452
            default_thumbnail : "'+default_thumbnail+'",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   453
            show_audio: true,\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   454
            rtmp_streamer: "rtmp://media.iri.centrepompidou.fr/ddc_micro_record/"\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   455
            }';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   456
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   457
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   458
    if(tagcloud_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   459
        widget_code+=',{\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   460
            type: "Tagcloud",\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   461
            }';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   462
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   463
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   464
    widget_code+=']\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   465
        };\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   466
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   467
    return widget_code;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   468
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   469
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   470
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   471
function generate_div_code(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   472
    var annotationslist_val=document.getElementById('annotations_list_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   473
    var slideshare_val=document.getElementById('slideshare_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   474
    var social_val=document.getElementById('social_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   475
    var code = generate_base_embed_code();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   476
    code += generate_widget_code();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   477
    code += '\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   478
        _myPlayer = new IriSP.Metadataplayer(_config);\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   479
        </script>\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   480
    if(social_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   481
        code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   482
            <div id="Social_ext" class="Ldt-TraceMe Ldt-Widget" style="float:right; width:400px; height:24px;" widget-type="Social">\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   483
            </div>\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   484
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   485
    if(slideshare_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   486
        code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   487
            <div id="Slideshare_ext" class="ext_widget Ldt-TraceMe Ldt-Widget" style="float:left; width:400px;" widget-type="Slideshare">\n\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   488
            </div>\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   489
    }
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   490
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   491
    if(annotationslist_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   492
        code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   493
            <div id="AnnotationsList_ext" class="ext_widget Ldt-TraceMe Ldt-Widget" style="float:left; width:400px;" widget-type="AnnotationsList"></div>\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   494
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   495
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   496
    code+='\
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   497
        </div>\n';
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   498
    return code;	
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   499
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   500
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   501
function put_new_code(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   502
    var type_embed=document.getElementById("type_embed_div");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   503
    var wrapper = "wrapper_"+player_id;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   504
    var wrapper_id = "#"+wrapper;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   505
    var element = document.getElementById(wrapper);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   506
    var code_embed=document.getElementById("player_id_code");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   507
    if(type_embed.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   508
        var new_code=generate_div_code();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   509
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   510
    else{
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   511
        var new_code=generate_iframe_code();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   512
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   513
    code_embed.value= new_code;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   514
    $j("#player_id_code").select();	
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   515
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   516
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   517
function div_event(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   518
    //$j("#createannotation_block").toggle(true);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   519
    var wrapper="wrapper_"+player_id;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   520
    var element = document.getElementById(wrapper);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   521
    var createannotation_val=document.getElementById('createannotation_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   522
    createannotation_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   523
    $j("#createannotation_options").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   524
    $j("#multisegments_block").toggle(true);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   525
    put_new_code();
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   526
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   527
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   528
function toggle() {
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   529
    var wrapper="wrapper_"+player_id;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   530
    var wrapper_id="#"+wrapper;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   531
    var player_div = document.getElementById("player_div");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   532
    var element = document.getElementById(wrapper);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   533
    var text = document.getElementById("displayPlayer");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   534
    var type_embed=document.getElementById("type_embed_div");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   535
    var refresh_player_button = $j('#refresh_player_button');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   536
    if(player_div.style.display==="none") {
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   537
        if (type_embed.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   538
            var new_code=generate_div_code();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   539
            $j(wrapper_id).html(new_code);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   540
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   541
        else{
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   542
            display_iframe_player();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   543
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   544
        player_div.style.display="block";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   545
        refresh_player_button.show();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   546
        text.innerHTML = translate_hide;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   547
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   548
    else {
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   549
        $j(wrapper_id).html('');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   550
        player_div.style.display="none";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   551
        refresh_player_button.hide();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   552
        text.innerHTML = translate_show;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   553
    }
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   554
} 
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   555
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   556
function display_polemic(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   557
    $j("#displayPolemicOptions").slideToggle("fast");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   558
    $j("#polemic_color_options").toggle(false);
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   559
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   560
1346
033173b1de1e added annotation type config for polemic and segment widgets
ndurand
parents: 1345
diff changeset
   561
function display_segments(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   562
    $j("#displaySegmentsOptions").slideToggle("fast");
1346
033173b1de1e added annotation type config for polemic and segment widgets
ndurand
parents: 1345
diff changeset
   563
}
033173b1de1e added annotation type config for polemic and segment widgets
ndurand
parents: 1345
diff changeset
   564
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   565
function display_sparkline(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   566
    $j("#displaySparklineOptions").slideToggle("fast");		
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   567
    $j("#sparkline_color_options").toggle(false);
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   568
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   569
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   570
function display_social(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   571
    $j("#social_options").slideToggle("fast");
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   572
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   573
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   574
function display_createannotation(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   575
    $j("#createannotation_options").slideToggle("fast");
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   576
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   577
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   578
function mode1(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   579
    var annotationslist_val=document.getElementById('annotations_list_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   580
    var slideshare_val=document.getElementById('slideshare_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   581
    var social_val=document.getElementById('social_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   582
    var annotation_val=document.getElementById('annotation_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   583
    var tweet_val=document.getElementById('tweet_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   584
    var segments_val=document.getElementById('segments_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   585
    var multisegments_val=document.getElementById('multisegments_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   586
    var polemic_val=document.getElementById('polemic_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   587
    var sparkline_val=document.getElementById('sparkline_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   588
    var tagcloud_val=document.getElementById('tagcloud_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   589
    var createannotation_val=document.getElementById('createannotation_checkbox');
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   590
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   591
    var type_embed=document.getElementById("type_embed_div");
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   592
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   593
    if(type_embed.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   594
        createannotation_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   595
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   596
    else{
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   597
        $j("#createannotation_options").toggle(true);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   598
        createannotation_val.checked=true;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   599
        var show_mic_record_val = document.getElementById('show_mic_record_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   600
        show_mic_record_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   601
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   602
    $j("#displaySegmentsOptions").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   603
    $j("#displayPolemicOptions").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   604
    $j("#displaySparklineOptions").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   605
    $j("#social_options").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   606
    $j("#sparkline_color_options").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   607
    display_segments();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   608
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   609
    segments_val.checked=true;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   610
    multisegments_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   611
    polemic_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   612
    annotationslist_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   613
    slideshare_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   614
    social_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   615
    annotation_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   616
    tweet_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   617
    sparkline_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   618
    tagcloud_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   619
    put_new_code();
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   620
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   621
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   622
function mode2(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   623
    var annotationslist_val=document.getElementById('annotations_list_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   624
    var slideshare_val=document.getElementById('slideshare_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   625
    var social_val=document.getElementById('social_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   626
    var annotation_val=document.getElementById('annotation_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   627
    var tweet_val=document.getElementById('tweet_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   628
    var segments_val=document.getElementById('segments_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   629
    var multisegments_val=document.getElementById('multisegments_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   630
    var polemic_val=document.getElementById('polemic_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   631
    var sparkline_val=document.getElementById('sparkline_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   632
    var tagcloud_val=document.getElementById('tagcloud_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   633
    var createannotation_val=document.getElementById('createannotation_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   634
    var type_embed=document.getElementById("type_embed_div");	
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   635
    $j("#displaySegmentsOptions").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   636
    $j("#displayPolemicOptions").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   637
    $j("#displaySparklineOptions").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   638
    $j("#social_options").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   639
    $j("#sparkline_color_options").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   640
    display_segments();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   641
    display_polemic();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   642
    display_sparkline();
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   643
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   644
    if(type_embed.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   645
        createannotation_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   646
        multisegments_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   647
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   648
    else{
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   649
        $j("#createannotation_options").toggle(true);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   650
        createannotation_val.checked=true;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   651
        var show_mic_record_val = document.getElementById('show_mic_record_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   652
        show_mic_record_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   653
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   654
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   655
    polemic_val.checked=true;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   656
    segments_val.checked=true;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   657
    multisegments_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   658
    annotationslist_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   659
    slideshare_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   660
    social_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   661
    annotation_val.checked=true;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   662
    sparkline_val.checked=true;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   663
    tweet_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   664
    tagcloud_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   665
    put_new_code();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   666
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   667
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   668
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   669
function mode3(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   670
    var annotationslist_val=document.getElementById('annotations_list_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   671
    var slideshare_val=document.getElementById('slideshare_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   672
    var social_val=document.getElementById('social_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   673
    var annotation_val=document.getElementById('annotation_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   674
    var tweet_val=document.getElementById('tweet_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   675
    var segments_val=document.getElementById('segments_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   676
    var multisegments_val=document.getElementById('multisegments_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   677
    var polemic_val=document.getElementById('polemic_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   678
    var sparkline_val=document.getElementById('sparkline_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   679
    var tagcloud_val=document.getElementById('tagcloud_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   680
    var createannotation_val=document.getElementById('createannotation_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   681
    var type_embed=document.getElementById("type_embed_div");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   682
    $j("#displaySegmentsOptions").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   683
    $j("#displayPolemicOptions").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   684
    $j("#displaySparklineOptions").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   685
    $j("#social_options").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   686
    $j("#sparkline_color_options").toggle(false);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   687
    display_segments();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   688
    display_polemic();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   689
    display_social();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   690
    display_sparkline();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   691
    if(type_embed.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   692
        createannotation_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   693
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   694
    else{
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   695
        $j("#createannotation_options").toggle(true);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   696
        createannotation_val.checked=true;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   697
        var show_mic_record_val = document.getElementById('show_mic_record_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   698
        show_mic_record_val.checked=false;	
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   699
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   700
    polemic_val.checked=true;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   701
    segments_val.checked=true;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   702
    multisegments_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   703
    annotationslist_val.checked=true;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   704
    slideshare_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   705
    social_val.checked=true;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   706
    annotation_val.checked=true;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   707
    tweet_val.checked=false;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   708
    sparkline_val.checked=true;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   709
    tagcloud_val.checked=true;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   710
    put_new_code();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   711
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   712
}
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   713
function iframe_event() {
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   714
    var wrapper="wrapper_"+player_id;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   715
    $j("#createannotation_options").toggle(true);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   716
    var element = document.getElementById(wrapper);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   717
    var createannotation_val=document.getElementById('createannotation_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   718
    createannotation_val.checked=true;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   719
    if(element.style.display=="block"){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   720
        display_iframe_player();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   721
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   722
    var iframe_code=generate_iframe_code();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   723
    $j("#player_id_code").val(iframe_code);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   724
    $j("#player_id_code").select();
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   725
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   726
}	
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   727
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   728
function generate_iframeUrl(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   729
    var createannotation_val=document.getElementById('createannotation_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   730
    var annotationslist_val=document.getElementById('annotations_list_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   731
    var slideshare_val=document.getElementById('slideshare_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   732
    var social_val=document.getElementById('social_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   733
    var annotation_val=document.getElementById('annotation_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   734
    var tweet_val=document.getElementById('tweet_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   735
    var segments_val=document.getElementById('segments_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   736
    var multisegments_val=document.getElementById('multisegments_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   737
    var polemic_val=document.getElementById('polemic_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   738
    var sparkline_val=document.getElementById('sparkline_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   739
    var tagcloud_val=document.getElementById('tagcloud_checkbox');
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   740
    var createannotation_polemics_val=document.getElementById('createannotation_polemics_checkbox');
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   741
    var concatenate_projects_val=document.getElementById('concatenate_projects_checkbox');
1346
033173b1de1e added annotation type config for polemic and segment widgets
ndurand
parents: 1345
diff changeset
   742
    var autostart_val=document.getElementById('autostart_checkbox');
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   743
    var iframeUrl=iframe_url;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   744
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   745
    if($j("#player_height").val()!=300)
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   746
        iframeUrl+="&player_height="+$j("#player_height").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   747
    if ($j("#player_width").val()!=550)
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   748
        iframeUrl+="&player_width="+$j("#player_width").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   749
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   750
    if(createannotation_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   751
        iframeUrl+="&createannotation=True";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   752
        var show_mic_record_val = document.getElementById('show_mic_record_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   753
        var set_tags_val=document.getElementById('set_tags');
1352
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   754
        var createannotation_annotation_types = $j('#createannotation_annotation_types').val(); 
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   755
        if(show_mic_record_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   756
            iframeUrl+="&show_mic_record=True";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   757
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   758
        if(set_tags_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   759
            iframeUrl+="&tag_titles="+$j("#tag_list").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   760
        }
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   761
        if(!createannotation_polemics_val.checked){
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   762
            iframeUrl+="&createannotation_polemics=False";
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   763
        }
1352
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   764
        if(createannotation_annotation_types) {
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   765
            iframeUrl += "&createannotation_annotation_types="+createannotation_annotation_types;
ddcabeae57b5 really add annotation creation to div mode for embed
ymh <ymh.work@gmail.com>
parents: 1350
diff changeset
   766
        }
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   767
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   768
    if (polemic_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   769
        var polemic_annotation_types_val=document.getElementById("polemic_annotation_types");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   770
        if(polemic_annotation_types_val.value){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   771
            iframeUrl+="&polemic="+polemic_annotation_types_val.value;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   772
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   773
        else{
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   774
            iframeUrl+="&polemic=all";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   775
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   776
        polemic_defaultColor=$j("#polemic_default_color").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   777
        defaultColor_code_array= polemic_defaultColor.split("#");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   778
        defaultColor_code=defaultColor_code_array[1];
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   779
        polemic_foundColor=$j("#polemic_found_color").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   780
        foundColor_code_array = polemic_foundColor.split("#");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   781
        foundColor_code=foundColor_code_array[1];
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   782
        polemic_okColor =$j("#polemic_ok_color").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   783
        polemic_okColor_code_array=polemic_okColor.split("#");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   784
        okColor_code=polemic_okColor_code_array[1];
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   785
        polemic_koColor =$j("#polemic_ko_color").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   786
        polemic_koColor_code_array=polemic_koColor.split("#");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   787
        koColor_code=polemic_koColor_code_array[1];
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   788
        polemic_refColor =$j("#polemic_ref_color").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   789
        polemic_refColor_code_array=polemic_refColor.split("#");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   790
        refColor_code=polemic_refColor_code_array[1];
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   791
        polemic_qColor =$j("#polemic_q_color").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   792
        polemic_qColor_code_array=polemic_qColor.split("#");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   793
        qColor_code=polemic_qColor_code_array[1];
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   794
        if(defaultColor_code!="585858")
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   795
            iframeUrl+="&polemic_defaultColor="+defaultColor_code;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   796
        if(foundColor_code!="fc00ff")
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   797
            iframeUrl+="&polemic_foundColor="+foundColor_code;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   798
        if(okColor_code!="1d973d")
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   799
            iframeUrl+="&polemic_okColor="+okColor_code;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   800
        if(koColor_code!="ce0a15")
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   801
            iframeUrl+="&polemic_koColor="+koColor_code;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   802
        if(refColor_code!="c5a62d")
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   803
            iframeUrl+="&polemic_refColor="+refColor_code;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   804
        if(qColor_code!="036aae")
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   805
            iframeUrl+="&polemic_qColor="+qColor_code;
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   806
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   807
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   808
    if(annotationslist_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   809
        iframeUrl+="&annotations_list=True";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   810
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   811
    if(annotation_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   812
        iframeUrl+="&annotation=True";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   813
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   814
    if(slideshare_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   815
        iframeUrl+="&slideshare=True";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   816
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   817
    if(social_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   818
        show_url=document.getElementById("show_url_checkbox");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   819
        show_twitter=document.getElementById("show_twitter_checkbox");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   820
        show_fb=document.getElementById("show_fb_checkbox");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   821
        show_gplus=document.getElementById("show_gplus_checkbox");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   822
        show_mail=document.getElementById("show_mail_checkbox");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   823
        iframeUrl+="&social=True";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   824
        if(!show_url.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   825
            iframeUrl+="&show_url=False";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   826
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   827
        if(!show_twitter.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   828
            iframeUrl+="&show_twitter=False";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   829
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   830
        if(!show_fb.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   831
            iframeUrl+="&show_fb=False";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   832
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   833
        if(!show_gplus.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   834
            iframeUrl+="&show_gplus=False";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   835
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   836
        if(!show_mail.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   837
            iframeUrl+="&show_mail=False";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   838
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   839
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   840
    if(tweet_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   841
        iframeUrl+="&tweet=True";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   842
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   843
    if(!segments_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   844
        iframeUrl+="&segments=False";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   845
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   846
    else{
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   847
        var segments_annotation_types_val=document.getElementById("segments_annotation_types");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   848
        if (segments_annotation_types_val.value){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   849
            iframeUrl+="&segments_annotation_types="+segments_annotation_types_val.value
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   850
        }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   851
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   852
    if(multisegments_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   853
        iframeUrl+="&multisegments=True"
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   854
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   855
    if(sparkline_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   856
        iframeUrl+="&sparkline=True";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   857
        sparkline_lineColor=$j("#sparkline_line_color").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   858
        lineColor_code_array= sparkline_lineColor.split("#");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   859
        lineColor_code=lineColor_code_array[1];
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   860
        sparkline_fillColor=$j("#sparkline_fill_color").val();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   861
        fillColor_code_array = sparkline_fillColor.split("#");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   862
        fillColor_code=fillColor_code_array[1];
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   863
        if(lineColor_code!="7492b4")
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   864
            iframeUrl+="&sparkline_lineColor="+lineColor_code;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   865
        if(fillColor_code!="aeaeb8")
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   866
            iframeUrl+="&sparkline_fillColor="+fillColor_code;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   867
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   868
    if(tagcloud_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   869
        iframeUrl+="&tagcloud=True";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   870
    }
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   871
    if(concatenate_projects_val.checked){
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   872
        iframeUrl+="&concatenate_projects=True";
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   873
    }
1346
033173b1de1e added annotation type config for polemic and segment widgets
ndurand
parents: 1345
diff changeset
   874
    if(autostart_val.checked){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   875
        iframeUrl+="&autostart=True";
1346
033173b1de1e added annotation type config for polemic and segment widgets
ndurand
parents: 1345
diff changeset
   876
    }
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   877
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   878
    return iframeUrl;
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   879
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   880
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   881
function generate_iframe_code(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   882
    var createannotation_val=document.getElementById('createannotation_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   883
    var annotationslist_val=document.getElementById('annotations_list_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   884
    var polemic_val=document.getElementById('polemic_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   885
    var slideshare_val=document.getElementById('slideshare_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   886
    var show_mic_record_val = document.getElementById('show_mic_record_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   887
    var iframeUrl=generate_iframeUrl();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   888
    var player_width=parseInt($j("#player_width").val())+20;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   889
    var player_height=parseInt($j("#player_height").val())+130;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   890
    if (createannotation_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   891
        player_height+=281;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   892
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   893
    if(annotationslist_val.checked || slideshare_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   894
        player_width+=430;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   895
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   896
    if(polemic_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   897
        player_height+=100;
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   898
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   899
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   900
    if(show_mic_record_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   901
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   902
        player_height+=55;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   903
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   904
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   905
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   906
    return "<iframe src='"+iframeUrl+"' width='"+player_width+"' height='"+player_height+"' seamless='seamless'></iframe>";
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   907
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   908
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   909
function display_iframe_player(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   910
    var createannotation_val=document.getElementById('createannotation_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   911
    var annotationslist_val=document.getElementById('annotations_list_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   912
    var polemic_val=document.getElementById('polemic_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   913
    var slideshare_val=document.getElementById('slideshare_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   914
    var show_mic_record_val = document.getElementById('show_mic_record_checkbox');
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   915
    var code_embed=document.getElementById("player_id_code");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   916
    var wrapper = "wrapper_"+player_id;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   917
    var wrapper_id = "#"+wrapper;
1350
8aae48935689 correct javascript
ymh <ymh.work@gmail.com>
parents: 1347
diff changeset
   918
    var iframeUrl= generate_iframeUrl();
8aae48935689 correct javascript
ymh <ymh.work@gmail.com>
parents: 1347
diff changeset
   919
    var player_width=parseInt($j("#player_width").val())+20;
8aae48935689 correct javascript
ymh <ymh.work@gmail.com>
parents: 1347
diff changeset
   920
    var player_height=parseInt($j("#player_height").val())+130;
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   921
    if (createannotation_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   922
        player_height+=300;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   923
        player_width+=50;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   924
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   925
    if(annotationslist_val.checked || slideshare_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   926
        player_width+=430;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   927
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   928
    if(polemic_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   929
        player_height+=100;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   930
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   931
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   932
    if(show_mic_record_val.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   933
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   934
        player_height+=55;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   935
    }
1350
8aae48935689 correct javascript
ymh <ymh.work@gmail.com>
parents: 1347
diff changeset
   936
    var frame = document.createElement("iframe");
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   937
    frame.width = player_width;
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   938
    frame.height = player_height;
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   939
    frame.src = iframeUrl;
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   940
    frame.frameBorder = 0;
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   941
    frame.seamless = "seamless";
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   942
    $j(wrapper_id).html(frame);
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   943
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   944
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   945
function set_default_color(code){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   946
    $j("#polemic_default_color").val("#"+code);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   947
    put_new_code();
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   948
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   949
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   950
function set_found_color(code){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   951
    $j("#polemic_found_color").val("#"+code);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   952
    put_new_code();
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   953
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   954
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   955
function set_line_color(code){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   956
    $j("#sparkline_line_color").val("#"+code);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   957
    put_new_code();
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   958
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   959
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   960
function set_fill_color(code){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   961
    $j("#sparkline_fill_color").val("#"+code);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   962
    put_new_code();
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   963
}
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   964
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   965
function refresh_player(){
1347
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   966
    var wrapper = "wrapper_"+player_id;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   967
    var wrapper_id = "#"+wrapper;
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   968
    var type_embed=document.getElementById("type_embed_div");
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   969
    if (type_embed.checked){
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   970
        var new_code=generate_div_code();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   971
        $j(wrapper_id).html(new_code);
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   972
    }
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   973
    else{
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   974
        display_iframe_player();
c1eb7dda4fe4 slightly improve mdplayer config, some code cleaning + allor annotation for dic (becauce CORS has been activated)
ymh <ymh.work@gmail.com>
parents: 1346
diff changeset
   975
    }
1344
44949ddd7f78 Reworked mdplayer embed config (iframe and div) to allow for config versioning, added MultiSegment widget to config list
durandn
parents:
diff changeset
   976
}