web/static/ldt/js/projectscontents.js
author cavaliet
Mon, 09 May 2011 18:57:23 +0200
changeset 103 5578dcb54f4d
parent 71 8a881c9593d0
permissions -rw-r--r--
merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
     1
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
$.fn.realVal = function() {
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
     3
    var obj = $(this[0]);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
     4
    if(obj.val) {
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
     5
        if(obj.val() === obj.attr('defaultText')) {
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
     6
            return '';
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
     7
        }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
     8
        else {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
     9
            return obj.val();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    10
        }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    11
    }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    12
    else {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    13
        return null;
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    14
    }
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
};
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
24
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    17
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
function init_events_base(base_node, embed_url) {
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    19
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    20
    $('.ldt_link_embed',base_node).click(function(e) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    21
        e.preventDefault();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    22
        var link = $(e.target);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    23
        var json_url = link.attr("href");
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    24
        var player_id = link.attr("id");
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    25
        var ldt_id = player_id.substring(15);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    26
        $('<a />', {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    27
            href: embed_url+'?json_url='+escape(json_url)+'&player_id='+escape(player_id)+'&ldt_id='+escape(ldt_id),
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    28
            target: "_blank"
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    29
        }).nyroModal({
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    30
            filters: ['iframe'],
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    31
            sizes: {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    32
                minW: '750',
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    33
                minH: '662'
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    34
            },
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    35
            callbacks: {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    36
                afterShowCont: function(nm) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    37
                    nm.store.iframe.height(662);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    38
                    nm.store.iframe.width(750);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    39
                }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    40
            }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    41
            }).trigger('nyroModal');
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    42
        return false;
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    43
    });
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    46
    $('.imageline',base_node).each(function(i) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    47
        var tr = $(this);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    48
        tr.mouseover(function() {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    49
            $('.cellimgdiv',this).css('visibility', 'visible');
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    50
        }); 
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    51
        tr.mouseout(function() {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    52
            $('.cellimgdiv',this).css('visibility', 'hidden');
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    53
        });
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    54
    });
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    55
    
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    56
    $('.cellimgdiv img').qtip({ 
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    57
        style: { 
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    58
            'name': 'dark',
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    59
            'filter':'alpha(opacity=70)',
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    60
            '-moz-opacity':'0.7',
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    61
            '-khtml-opacity': '0.7',
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    62
            'opacity': '0.7',
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    63
            'border': {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    64
                'width' : '0',
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    65
                'color': '#505050'
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    66
            }, 
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    67
            'tip': true
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    68
        } 
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    69
    });
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
    70
}
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
33
3dd37cc8d8b3 small rename
ymh <ymh.work@gmail.com>
parents: 32
diff changeset
    72
function testAndClose(close_fn) {
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    73
	
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    74
	return function(force) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    75
	    // Here we ask LDT if the current work is modified and if the user want to save it.
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    76
	    var ldtSwf =  $('#ldtInitSwf',$.nmTop().store.iframe.contents()).get(0);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    77
	    // In the ldt_link_create case, the modal page can be the form, or the ldt swf. So we have to test.
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
    78
	    if (!force && ldtSwf && ldtSwf.name==="ldtInitSwf" && ldtSwf.isModified()==="true") {
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    79
	        ldtSwf.askSave();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    80
	    }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    81
	    else {
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
    82
            close_fn.apply(this);
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    83
	    }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    84
	};
31
0d829ac13c4b Update modal behavior, to test if LDT swf has a still not saved work. Update language files too.
Cavalie Thibaut <thibaut.cavalie@centrepompidou.fr>
parents: 24
diff changeset
    85
}
0d829ac13c4b Update modal behavior, to test if LDT swf has a still not saved work. Update language files too.
Cavalie Thibaut <thibaut.cavalie@centrepompidou.fr>
parents: 24
diff changeset
    86
103
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
    87
function testCreateAndClose(nm, close_fn) {
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
    88
	
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
    89
	return function(force) {
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
    90
	    // We get the frames vars
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
    91
        f = window.frames[0];
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
    92
        form_status =  $('#content_form_status',$.nmTop().store.iframe.contents()).val();
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
    93
	    // If form_status is "saved", we don't have to test anything, the form was was normally submitted.
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
    94
        // If was status is "empty" AND an upload from local was done
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
    95
        if(form_status!="saved" && f.upload_from_local_done==true && f.remove_temp_file_url){
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
    96
            // ERASE FILE
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
    97
            //alert("testCreateAndClose : " + "f = " + f + ", status = " + form_status + ", u = " + f.upload_from_local_done + ", s = " + f.submit_asked + ", url = " + f.remove_temp_file_url);
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
    98
            $.ajax({
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
    99
                type: "GET",
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   100
                url: f.remove_temp_file_url,
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   101
                data: "filename="+ $('#id_media-local_file_name',$.nmTop().store.iframe.contents()).val(),
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   102
                cache: false,
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   103
                success: function(data, status, request){
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   104
                    //alert("remove success");
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   105
                }
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   106
            });
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   107
        }
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   108
        close_fn.apply(this);
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   109
	};
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   110
}
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   111
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   112
function searchCallback(target, container_selector, url, timeout) {
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   113
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   114
    timeout = typeof(timeout) !== 'undefined' ? timeout : 0;
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   115
    target = $(target);
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   116
    
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   117
    // remove all qtip
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   118
    $(".qtip").remove();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   119
    
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   120
    if(target.realVal().length > 0) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   121
        target.nextAll(".searchclear").show();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   122
    }
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   123
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   124
    if(target.attr('timer')) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   125
        clearTimeout(target.attr('timer'));
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   126
    }
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   127
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   128
    target.attr(
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   129
        'timer',
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   130
        setTimeout(function() {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   131
            target.next(".searchajaxloader").show();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   132
            target.nextAll(".searchclear").hide();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   133
            var filterVal = "_" + escape(target.realVal());
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   134
            url = url.replace('__FILTER__',filterVal);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   135
            $.ajax({
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   136
                url: url,
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   137
                cache: false,
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   138
                success: function(data, status, request) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   139
                    $(container_selector).html(data);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   140
                    target.next(".searchajaxloader").hide();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   141
                    if(target.realVal().length > 0) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   142
                        target.nextAll(".searchclear").show();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   143
                    }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   144
                    init_events($(container_selector));
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   145
                    target.removeAttr('timer');
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   146
                }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   147
            });    
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   148
        },
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   149
        300)
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   150
    );
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   151
}
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   152
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   153
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   154
function init_events_contents(base_node, embed_url, content_filter_url) {
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   155
    
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   156
    init_events_base(base_node, embed_url);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   157
    
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   158
    $('.content_link_create').each(function(i){
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   159
        $(this).attr("target","_blank");
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   160
    });
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   161
    $('.content_link_create').nyroModal({
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   162
        filters: ['iframe'],
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   163
        sizes: {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   164
            minW: 770,
46
ba02faf089df Update media adding, to allow youtube import, and display the thumbnail when we paste the youtube url.
cavaliet
parents: 38
diff changeset
   165
            minH: 550
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   166
        },
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   167
        callbacks: {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   168
            afterClose: function(nm) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   169
                searchCallback($('#searchprojectsinput'), "#contentslistcontainer", content_filter_url);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   170
            },
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   171
            afterShowCont: function(nm) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   172
                nm.store.iframe.width(770);
46
ba02faf089df Update media adding, to allow youtube import, and display the thumbnail when we paste the youtube url.
cavaliet
parents: 38
diff changeset
   173
                nm.store.iframe.height(550);
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   174
                nm.store.iframe.load(function() {
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   175
                    var form_status = $(this).contents().find("#content_form_status").val(); 
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   176
                    if(form_status === 'saved' || form_status === 'deleted' ) {
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   177
                        $.nmTop().close();
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   178
                    }
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   179
                });
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   180
            }
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   181
        }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   182
    });
103
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   183
    $('.content_link_create',base_node).each(function(i, e) {
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   184
        nm = $(e).data('nmObj');
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   185
        $(e).data('nmObj', $.extend(true, nm, {
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   186
            close: testCreateAndClose(nm, nm.close)
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   187
        }));
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   188
    });  
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   189
    
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   190
    $('.contenttitlelink').each(function(i){
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   191
        $(this).attr("target","_blank");
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   192
    });
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   193
    $('.contenttitlelink').nyroModal({
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   194
        filters: ['iframe'],
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   195
        sizes: {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   196
            minW: 770,
46
ba02faf089df Update media adding, to allow youtube import, and display the thumbnail when we paste the youtube url.
cavaliet
parents: 38
diff changeset
   197
            minH: 550
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   198
        },
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   199
        callbacks: {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   200
            afterClose: function(nm) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   201
                searchCallback($("#searchcontentsinput"),"#contentslistcontainer",content_filter_url,0);    
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   202
            },
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   203
            afterShowCont: function(nm) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   204
                nm.store.iframe.width(770);
46
ba02faf089df Update media adding, to allow youtube import, and display the thumbnail when we paste the youtube url.
cavaliet
parents: 38
diff changeset
   205
                nm.store.iframe.height(550);
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   206
                nm.store.iframe.load(function() {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   207
                      var form_status = $(this).contents().find("#content_form_status").val(); 
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   208
                      if(form_status === 'saved' || form_status === 'deleted') {
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   209
                          $.nmTop().close();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   210
                      }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   211
                  });
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   212
            }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   213
        }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   214
    });
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   215
    
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   216
}
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   217
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   218
function init_events_base_projects(base_node, embed_url, searchprojectfilterurl, publishprojecturl, unpublishprojecturl) {
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   219
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   220
    // These are the functions called when we display a project in an LDT modal window
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   221
    $('.ldt_link',base_node).each(function(i){
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   222
        $(this).attr("target","_iri");
31
0d829ac13c4b Update modal behavior, to test if LDT swf has a still not saved work. Update language files too.
Cavalie Thibaut <thibaut.cavalie@centrepompidou.fr>
parents: 24
diff changeset
   223
    });
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   224
    $('.ldt_link',base_node).nyroModal({
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   225
        filters: ['iriIframe'],
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   226
        sizes: {
38
457d4ab675df debug modal for chrome, ie7. For firefox, links are not modal anymore.
cavaliet
parents: 37
diff changeset
   227
            minW: '1025',
457d4ab675df debug modal for chrome, ie7. For firefox, links are not modal anymore.
cavaliet
parents: 37
diff changeset
   228
            minH: '665'
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   229
        },
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   230
        showCloseButton: true,
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   231
        closeOnEscape:false,
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   232
        closeOnClick:false,
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   233
        callbacks: {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   234
            afterShowCont: function(nm) {
38
457d4ab675df debug modal for chrome, ie7. For firefox, links are not modal anymore.
cavaliet
parents: 37
diff changeset
   235
                nm.store.iframe.width(1025);
457d4ab675df debug modal for chrome, ie7. For firefox, links are not modal anymore.
cavaliet
parents: 37
diff changeset
   236
                nm.store.iframe.height(665);
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   237
            },
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   238
            close: function(nm) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   239
                // We don't do anything here, we hack the callback directly from the close function.
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   240
            },
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   241
            afterClose: function(nm) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   242
                // Can't do that because searchprojectfilterurl is not defined in init_events_base params
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   243
                searchCallback($('#searchprojectsinput'), "#projectslistcontainer", searchprojectfilterurl, 0);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   244
            }
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   245
        }
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   246
    });
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   247
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   248
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   249
    $('.ldt_link',base_node).each(function(i, e) {
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   250
        nm = $(e).data('nmObj');
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   251
        $(e).data('nmObj', $.extend(true, nm, {
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   252
            close: testAndClose(nm.close)
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   253
        }));
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   254
    });    
31
0d829ac13c4b Update modal behavior, to test if LDT swf has a still not saved work. Update language files too.
Cavalie Thibaut <thibaut.cavalie@centrepompidou.fr>
parents: 24
diff changeset
   255
0d829ac13c4b Update modal behavior, to test if LDT swf has a still not saved work. Update language files too.
Cavalie Thibaut <thibaut.cavalie@centrepompidou.fr>
parents: 24
diff changeset
   256
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   257
    $('.ldt_link_create',base_node).each(function(i){
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   258
        $(this).attr("target","_iri");
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   259
    });
66
8a7530e28185 Add token authentification to un/publish request. Update jquery.min.js and twitter auth keys.
cavaliet
parents: 46
diff changeset
   260
    $('.ldt_link_create',base_node).nyroModal({
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   261
         
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   262
        filters: ['iriIframe'],
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   263
        sizes: {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   264
            minW: '600',
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   265
            minH: '500'
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   266
        },
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   267
        showCloseButton:true,
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   268
        closeOnEscape:false,
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   269
        closeOnClick:false,
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   270
        callbacks: {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   271
            afterShowCont: function(nm) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   272
                nm.store.iframe.width(600);
46
ba02faf089df Update media adding, to allow youtube import, and display the thumbnail when we paste the youtube url.
cavaliet
parents: 38
diff changeset
   273
                nm.store.iframe.height(600);
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   274
                var iframe = nm.store.iframe;
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   275
                iframe.load(function(){
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   276
                    var form_status = $(this).contents().find("#project_form_status").val(); 
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   277
                    if(form_status === 'saved' || form_status === 'deleted' ) {
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   278
                        $.nmTop().close();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   279
                    }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   280
                    var swfobject = $(this).contents().find("#ldtInitSwf"); 
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   281
                    if (swfobject.length) {
38
457d4ab675df debug modal for chrome, ie7. For firefox, links are not modal anymore.
cavaliet
parents: 37
diff changeset
   282
                        nm['sizes']['initW'] = 1025;
457d4ab675df debug modal for chrome, ie7. For firefox, links are not modal anymore.
cavaliet
parents: 37
diff changeset
   283
                        nm['sizes']['initH'] = 665;
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   284
                        nm.resize();
38
457d4ab675df debug modal for chrome, ie7. For firefox, links are not modal anymore.
cavaliet
parents: 37
diff changeset
   285
                        nm.store.iframe.width(1025);
457d4ab675df debug modal for chrome, ie7. For firefox, links are not modal anymore.
cavaliet
parents: 37
diff changeset
   286
                        nm.store.iframe.height(665);
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   287
                    }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   288
                });
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   289
            },
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   290
            afterClose: function(nm) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   291
                searchCallback($('#searchprojectsinput'), "#projectslistcontainer", searchprojectfilterurl, 0);
103
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   292
            }
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   293
        }        
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   294
    });
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   295
    $('.ldt_link_create',base_node).each(function(i, e) {
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   296
        nm = $(e).data('nmObj');
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   297
        $(e).data('nmObj', $.extend(true, nm, {
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   298
            close: testAndClose(nm.close)
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   299
        }));
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   300
    });
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   301
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   302
    
66
8a7530e28185 Add token authentification to un/publish request. Update jquery.min.js and twitter auth keys.
cavaliet
parents: 46
diff changeset
   303
    $('.publishedproject', base_node).click(function(e) {
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   304
        e.preventDefault();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   305
        var target = $(e.target);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   306
        var project_id = target.attr('id').replace('project_','');
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   307
        var url = unpublishprojecturl.replace('__PROJECT_ID__', project_id);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   308
        $.ajax({
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   309
            url: url,
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   310
            type: 'POST',
66
8a7530e28185 Add token authentification to un/publish request. Update jquery.min.js and twitter auth keys.
cavaliet
parents: 46
diff changeset
   311
            data: {csrfmiddlewaretoken:global_csrf_token},
8a7530e28185 Add token authentification to un/publish request. Update jquery.min.js and twitter auth keys.
cavaliet
parents: 46
diff changeset
   312
            // bug with jquery >= 1.5, "json" adds a callback so we don't specify dataType
8a7530e28185 Add token authentification to un/publish request. Update jquery.min.js and twitter auth keys.
cavaliet
parents: 46
diff changeset
   313
            //dataType: 'json',
8a7530e28185 Add token authentification to un/publish request. Update jquery.min.js and twitter auth keys.
cavaliet
parents: 46
diff changeset
   314
            success: function(json, textStatus, XMLHttpRequest) {
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   315
                if(json.res) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   316
                    searchCallback($('#searchprojectsinput'), "#projectslistcontainer", searchprojectfilterurl, 0);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   317
                }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   318
            }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   319
        });
24
57a2650a7f87 update nyromodal
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   320
    });
66
8a7530e28185 Add token authentification to un/publish request. Update jquery.min.js and twitter auth keys.
cavaliet
parents: 46
diff changeset
   321
    
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   322
    $('.unpublishedproject', base_node).click(function(e) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   323
        e.preventDefault();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   324
        var target = $(e.target);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   325
        var project_id = target.attr('id').replace('project_','');
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   326
        var url = publishprojecturl.replace('__PROJECT_ID__', project_id);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   327
        $.ajax({
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   328
            url: url,
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   329
            type: 'POST',
66
8a7530e28185 Add token authentification to un/publish request. Update jquery.min.js and twitter auth keys.
cavaliet
parents: 46
diff changeset
   330
            data: {csrfmiddlewaretoken:global_csrf_token},
8a7530e28185 Add token authentification to un/publish request. Update jquery.min.js and twitter auth keys.
cavaliet
parents: 46
diff changeset
   331
            // bug with jquery >= 1.5, "json" adds a callback so we don't specify dataType
8a7530e28185 Add token authentification to un/publish request. Update jquery.min.js and twitter auth keys.
cavaliet
parents: 46
diff changeset
   332
            //dataType: 'json',
8a7530e28185 Add token authentification to un/publish request. Update jquery.min.js and twitter auth keys.
cavaliet
parents: 46
diff changeset
   333
            success: function(json, textStatus, XMLHttpRequest) {
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   334
                if(json.res) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   335
                    searchCallback($('#searchprojectsinput'), "#projectslistcontainer", searchprojectfilterurl, 0);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   336
                }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   337
            }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   338
        });
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   339
    });
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   340
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   341
    $('.projecttitlelink').each(function(i){
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   342
        $(this).attr("target","_blank");
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   343
    });
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   344
    $('.projecttitlelink').nyroModal({
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   345
        filters: ['iframe'],
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   346
        sizes: {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   347
            minH:680, 
46
ba02faf089df Update media adding, to allow youtube import, and display the thumbnail when we paste the youtube url.
cavaliet
parents: 38
diff changeset
   348
            minW:600
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   349
        },
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   350
        callbacks: {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   351
            afterClose: function(nm) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   352
                searchCallback($('#searchprojectsinput'), "#projectslistcontainer", searchprojectfilterurl, 0);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   353
            },
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   354
            afterShowCont: function(nm) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   355
                nm.store.iframe.height(680);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   356
                nm.store.iframe.width(600);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   357
                var iframe = nm.store.iframe;
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   358
                iframe.load(function(){
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   359
                      var form_status = $(this).contents().find("#project_form_status").val(); 
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   360
                      if(form_status === 'saved' || form_status === 'deleted') {
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   361
                          $.nmTop().close();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   362
                      }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   363
                  });
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   364
            }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   365
        }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   366
    });
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   367
    
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   368
}
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   369
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   370
function init_events_projects(base_node, embed_url, searchprojectfilterurl, publishprojecturl, unpublishprojecturl) {
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   371
    init_events_base(base_node, embed_url);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   372
    init_events_base_projects(base_node, embed_url, searchprojectfilterurl, publishprojecturl, unpublishprojecturl);
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   373
}
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   374
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   375
function init_events_all(base_node, embed_url, searchcontentfilterurl, searchprojectfilterurl, publishprojecturl, unpublishprojecturl) {
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   376
    init_events_contents(base_node, embed_url, searchcontentfilterurl);
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   377
    init_events_base_projects(base_node, embed_url, searchprojectfilterurl, publishprojecturl, unpublishprojecturl);
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   378
}
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   379
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   380
function searchFieldInit(input_list_init) {
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   381
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   382
    $(".searchfieldinputbase").keydown(function (e) {
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   383
         if(e.which === 27) {
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   384
              $(e.target).blur();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   385
              $(e.target).next(".searchajaxloader").hide();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   386
         }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   387
    });        
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   388
     
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   389
    $('.searchfieldinput').each(function(i) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   390
         var sbox = $(this);
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   391
         if(sbox.val() !== '') {
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   392
             sbox.attr('defaultText', sbox.val());
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   393
         }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   394
    
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   395
         sbox.focus(function() {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   396
             box = $(this);
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   397
             if(box.val() === box.attr('defaultText')) {
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   398
                 box.val('');
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   399
                 box.toggleClass("searchfieldinput");
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   400
             }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   401
         });
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   402
    
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   403
         sbox.blur(function() {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   404
             var box = $(this);
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   405
             if(box.val() === '' && box.attr('defaultText')) {
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   406
                 box.val(box.attr('defaultText'));
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   407
                 box.toggleClass("searchfieldinput");
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   408
             }
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   409
         });
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   410
                  
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   411
    });
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   412
32
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   413
    $.each(input_list_init, function(index, value) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   414
        $(value['input_selector']).keyup(function (e) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   415
            searchCallback(e.target, value['container_selector'], value['url']);
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   416
        });
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   417
    });
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   418
    
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   419
    $('.searchclear').click(function(e) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   420
        var box = $(e.target).parent().find("input");
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   421
        box.val(box.attr('defaultText'));
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   422
        box.addClass("searchfieldinput");
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   423
        box.blur();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   424
        box.keyup();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   425
    });
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   426
    
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   427
    $('.searchclear').each(function(i) {
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   428
        $(this).hide();
7bb37c869d0d upgrade close
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
   429
    });
37
3586af4092f3 update projectscontents.js to avoid reload on modal resize.
cavaliet
parents: 33
diff changeset
   430
    
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   431
}
71
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   432
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   433
//
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   434
// Functions used in the create content view.
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   435
//
103
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   436
function onCreateContentReady(url_upload, media_prefix, post_added_params, btn_label, success_label, wait_label, cancel_label, remove_url) {
71
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   437
	
103
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   438
    window.upload_from_local_done = false;
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   439
    window.submit_asked = false;
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   440
    window.remove_temp_file_url = remove_url;
71
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   441
    
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   442
    $("#close_button").click(function (e) {
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   443
        e.preventDefault();
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   444
        parent.$.nmTop().close();
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   445
    });
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   446
    $("#submit_button_write").click(function(e) {
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   447
        $(".submitcontent-loader-content").show();
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   448
    });
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   449
    $(".media_fields").hide();
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   450
    $("#media_field_"+$("#id_content-media_input_type").val()).show();
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   451
    $("#id_content-media_input_type").change(function(e) {
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   452
        $(".media_fields").hide();
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   453
        $("#media_field_"+$(e.target).val()).show();
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   454
    });
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   455
    // The textinput's id for external url is id_media-src
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   456
    $('#id_media-src').bind('textchange', function(e) { testUrlValue(e); });
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   457
    
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   458
    // We disable the default submit
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   459
    $('#my_form').submit(function() {
103
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   460
        window.submit_asked = true;
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   461
        if($('#id_content-media_input_type').val()=="upload"){
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   462
            if(window.upload_from_local_done==false){
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   463
                // The form has sent but the uploading has not ended.
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   464
                if($('#upload_progress_info').children().size()>0){
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   465
                    $('#progress_info').remove();
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   466
                }
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   467
                $('#upload_progress_info').append('<p id="progress_info"><font color="red"><strong>' + wait_label + '.</strong></font></p>');
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   468
                return false;
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   469
            }
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   470
            else{
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   471
                return true;
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   472
            }
71
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   473
        }
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   474
        else{
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   475
            //alert("2. " + $('#id_content-media_input_type').val());
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   476
            return true;
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   477
        }
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   478
    });
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   479
    
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   480
    $("#upload_progress_bar").css({ width:"90%", height:"10" });
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   481
    
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   482
    $('#media_fields_div').height(80);
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   483
    
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   484
    // We init the swfupload object
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   485
    swfupload = new SWFUpload({
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   486
        debug: false,
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   487
        
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   488
        upload_url: url_upload,
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   489
        flash_url: media_prefix+"swf/swfupload.swf",
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   490
        
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   491
        post_params: post_added_params,
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   492
        
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   493
        button_placeholder_id: "upload_btn",
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   494
        button_width: "60",
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   495
        button_height: "16",
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   496
        button_cursor: SWFUpload.CURSOR.HAND,
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   497
        button_text : '<span class="btnText">' + btn_label + '</span>',
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   498
        button_text_style : ".btnText { font-size: 12; font-family: Arial; }",
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   499
        
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   500
        file_types : "*.flv;*.f4v;*.mp4;*.mov;*.mp3",
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   501
        file_types_description : "Media Files (flv, f4v, mov H264, mp4, mp3)",
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   502
        file_upload_limit : "1",
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   503
        file_queue_limit : "1",
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   504
        
103
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   505
        upload_error_handler : uploadError,
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   506
        upload_start_handler : function(file) {
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   507
            try {
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   508
                if($('#upload_progress_info').children().size()>0){
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   509
                    $('#progress_info').remove();
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   510
                }
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   511
                $('#upload_progress_info').append('<p id="progress_info"><a href="javascript:cancelSwfUpload()">' + cancel_label + '.</a></p>');
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   512
            }
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   513
            catch (ex) {
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   514
                //this.debug(ex);
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   515
            }
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   516
        },
71
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   517
        upload_progress_handler : uploadProgress,
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   518
        upload_success_handler : function() {
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   519
                try {
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   520
                    if($('#upload_progress_info').children().size()>0){
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   521
                        $('#progress_info').remove();
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   522
                    }
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   523
                    $('#upload_progress_info').append('<p id="progress_info">' + success_label + '.</p>');
103
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   524
                    $("#upload_progress_bar > div").css({ 'background': '#90ffa8' });
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   525
                    window.upload_from_local_done = true;
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   526
                    // Now that the file is uploaded, we submit the form if asked
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   527
                    if(window.submit_asked==true){
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   528
                        $('#my_form').submit();
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   529
                    }
71
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   530
                }
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   531
                catch (ex) {
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   532
                    //this.debug(ex);
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   533
                }
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   534
            },
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   535
        file_queued_handler : displayUploadPath,
103
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   536
        file_dialog_complete_handler: function() { this.startUpload(); },
71
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   537
        //upload_complete_handler: function() { this.startUpload(); },
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   538
    });
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   539
}
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   540
function displayUploadPath(file) {
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   541
    try {
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   542
        $('#id_media-local_file_name').val(file.name);
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   543
    }
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   544
    catch (ex) {
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   545
        //this.debug(ex);
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   546
    }
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   547
}
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   548
function startLocalUpload(){
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   549
    swfupload.startUpload();
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   550
}
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   551
function uploadProgress(file, bytesLoaded, bytesTotal) {
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   552
    try {
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   553
        var percent = Math.ceil((bytesLoaded / bytesTotal) * 100);
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   554
        $("#upload_progress_bar").progressbar({ value: percent });
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   555
    }
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   556
    catch (ex) {
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   557
        //this.debug(ex);
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   558
    }
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   559
}
103
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   560
function cancelSwfUpload(){
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   561
    swfupload.cancelUpload();
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   562
    if($('#media_field_upload').has($('#cancelupload')).length==0){
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 71
diff changeset
   563
        $('#cancelupload').remove();
71
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   564
    }
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   565
}
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   566
function uploadError(file, errorCode, message) {
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   567
    try {
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   568
        if($('#upload_progress_info').children().size()>0){
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   569
            $('#progress_info').remove();
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   570
        }
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   571
        switch (errorCode) {
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   572
        case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   573
            $('#upload_progress_info').append('<p id="progress_info">' + "Error Code: HTTP Error, File name: " + file.name + ", Message: " + message + '</p>');
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   574
            break;
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   575
        case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   576
            $('#upload_progress_info').append('<p id="progress_info">' + "Error Code: Upload Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message + '</p>');
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   577
            break;
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   578
        case SWFUpload.UPLOAD_ERROR.IO_ERROR:
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   579
            $('#upload_progress_info').append('<p id="progress_info">' + "Error Code: IO Error, File name: " + file.name + ", Message: " + message + '</p>');
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   580
            break;
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   581
        case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   582
            $('#upload_progress_info').append('<p id="progress_info">' + "Error Code: Security Error, File name: " + file.name + ", Message: " + message + '</p>');
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   583
            break;
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   584
        case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   585
            $('#upload_progress_info').append('<p id="progress_info">' + "Error Code: Upload Limit Exceeded, File name: " + file.name + ", File size: " + file.size + ", Message: " + message + '</p>');
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   586
            break;
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   587
        case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   588
            $('#upload_progress_info').append('<p id="progress_info">' + "Error Code: File Validation Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message + '</p>');
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   589
            break;
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   590
        case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   591
            $('#upload_progress_info').append('<p id="progress_info">' + "Error Code: FILE_CANCELLED" + '</p>');
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   592
            break;
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   593
        case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   594
            $('#upload_progress_info').append('<p id="progress_info">' + "STOPPED" + '</p>');
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   595
            break;
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   596
        default:
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   597
            $('#upload_progress_info').append('<p id="progress_info">' + "unhandled error: File name: " + file.name + ", File size: " + file.size + ", Message: " + message + '</p>');
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   598
            break;
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   599
        }
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   600
    } catch (ex) {
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   601
        //this.debug(ex);
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   602
    }
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   603
}
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   604
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   605
// Test the value of the URL from the form to load a picture in case it is a youtube video
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   606
function testUrlValue(e){
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   607
    // First, we remove the current thumbnail if there is one.
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   608
    if($('#media_field_create').children().size()>2){
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   609
        $('#external_thumbnail').remove();
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   610
        $('#media_fields_div').height(80);
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   611
    }
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   612
    // If the pasted text is a youtube url, we get the default thumbnail of the video and display it.
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   613
    url = $('#id_media-src').val();
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   614
    if(url.match("youtube") && url.match("[\\?&]v=([^&#]*)")){
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   615
        results = url.match("[\\?&]v=([^&#]*)");
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   616
        vid = ( results === null ) ? url : results[1].substring(0,11);
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   617
        if(vid.length===11){
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   618
            //$('#id_content-description').val($('#media_field_create') + '<img src="http://img.youtube.com/vi/'+vid+'/default.jpg" alt="Youtube Thumbnail"/>');
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   619
            $('#media_field_create').append('<img id="external_thumbnail" src="http://img.youtube.com/vi/'+vid+'/default.jpg" alt="Youtube Thumbnail"/>');
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   620
            $('#media_fields_div').height(150);
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   621
        }
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   622
    }
8a881c9593d0 Add swfupload for local upload to create content view, with progress bar and error management.
cavaliet
parents: 66
diff changeset
   623
}