summaryrefslogtreecommitdiff
path: root/lib/scripts
diff options
context:
space:
mode:
authorKate Arzamastseva <pshns@ukr.net>2011-08-21 02:16:39 +0300
committerKate Arzamastseva <pshns@ukr.net>2011-08-21 02:16:39 +0300
commit9de3b5710719658ef75740c0bd930423cc7c209c (patch)
treedabecdaa9dc3ed32babcf4623032e0a5e530b0db /lib/scripts
parent10799f9c522a9847ebf5f2f7c91d4af7f160e4b8 (diff)
downloadrpg-9de3b5710719658ef75740c0bd930423cc7c209c.tar.gz
rpg-9de3b5710719658ef75740c0bd930423cc7c209c.tar.bz2
issue #44 uploader fixes, #45 browser testing
Diffstat (limited to 'lib/scripts')
-rw-r--r--lib/scripts/cookie.js2
-rw-r--r--lib/scripts/fileuploaderextended.js20
-rw-r--r--lib/scripts/media.js37
3 files changed, 34 insertions, 25 deletions
diff --git a/lib/scripts/cookie.js b/lib/scripts/cookie.js
index f7d9b5ffb..e7ba620c7 100644
--- a/lib/scripts/cookie.js
+++ b/lib/scripts/cookie.js
@@ -72,7 +72,7 @@ DokuCookie = {
expires: expires_,
path: path_,
domain: domain_,
- secure: secure_,
+ secure: secure_
};
jQuery.cookie(name, value, params);
diff --git a/lib/scripts/fileuploaderextended.js b/lib/scripts/fileuploaderextended.js
index 005268bbb..ed631a9ea 100644
--- a/lib/scripts/fileuploaderextended.js
+++ b/lib/scripts/fileuploaderextended.js
@@ -80,7 +80,7 @@ qq.FileUploaderExtended = function(o){
'<div class="qq-upload-button">' + LANG.media_select + '</div>' +
'<div class="qq-upload-list"></div>' +
'<div><input class="button" type="submit" value="' + LANG.media_upload_btn + '" id="mediamanager__upload_button">' +
- '<label class="check" for="dw__ow"><input id="dw__ow" type="checkbox" value="1" name="ow"><span>' + LANG.media_overwrt + '</span></label>' +
+ '<label class="check"><input class="dw__ow" type="checkbox" value="1" name="ow"><span>' + LANG.media_overwrt + '</span></label>' +
'</div>' +
'</div>',
@@ -163,7 +163,7 @@ qq.extend(qq.FileUploaderExtended.prototype, {
qq.removeClass(fileElement, 'qq-upload-file-hidden');
qq.remove(nameInput);
jQuery('.qq-upload-button, #mediamanager__upload_button').remove();
- jQuery('#dw__ow').parent().hide();
+ jQuery('.dw__ow').parent().hide();
jQuery('.qq-upload-drop-area').remove();
if (result.success){
@@ -178,8 +178,12 @@ qq.extend(qq.FileUploaderExtended.prototype, {
}
if (document.getElementById('media__content') && !document.getElementById('mediamanager__done_form')) {
- var button = '<form method="post" action="' + document.location +'" id="mediamanager__done_form"><div>';
- button += '<input class="button" type="submit" value="' + LANG.media_done_btn + '"></div></form>'
+ var action = document.location.href;
+ var i = action.indexOf('?');
+ if (i) action = action.substr(0, i);
+ var button = '<form method="post" action="' + action + '" id="mediamanager__done_form"><div>';
+ button += '<input type="hidden" value="' + result.ns + '" name="ns">';
+ button += '<input class="button" type="submit" value="' + LANG.media_done_btn + '"></div></form>';
jQuery('#mediamanager__uploader').append(button);
}
}
@@ -232,8 +236,10 @@ qq.extend(qq.UploadHandlerForm.prototype, {
var nameInput = qq.toElement('<input name="mediaid" value="' + fileName + '" type="text">');
form.appendChild(nameInput);
- var owCheckbox = document.getElementById('dw__ow').cloneNode(true);
- form.appendChild(owCheckbox);
+ var checked = jQuery('.dw__ow').attr('checked');
+ var owCheckbox = jQuery('.dw__ow').clone();
+ owCheckbox.attr('checked', checked);
+ jQuery(form).append(owCheckbox);
var self = this;
this._attachLoadEvent(iframe, function(){
@@ -311,7 +317,7 @@ qq.extend(qq.UploadHandlerXhr.prototype, {
// build query string
params = params || {};
params['qqfile'] = name;
- params['ow'] = document.getElementById('dw__ow').checked;
+ params['ow'] = jQuery('.dw__ow').attr('checked');
var queryString = qq.obj2url(params, this._options.action);
xhr.open("POST", queryString, true);
diff --git a/lib/scripts/media.js b/lib/scripts/media.js
index 997321a65..f345c3786 100644
--- a/lib/scripts/media.js
+++ b/lib/scripts/media.js
@@ -274,8 +274,6 @@ var dw_mediamanager = {
if (document.getElementById('media__content')) {
//popup
$content = jQuery('#media__content');
- $content.html('<img src="' + DOKU_BASE + 'lib/images/loading.gif" alt="..." class="load" />');
-
} else {
//fullscreen media manager
$content = jQuery('#mediamanager__layout_list');
@@ -288,8 +286,6 @@ var dw_mediamanager = {
});
$link.addClass('selected');
}
-
- jQuery('.scroll-container', $content).html('<img src="' + DOKU_BASE + 'lib/images/loading.gif" alt="..." class="load" />');
}
params = '';
@@ -309,6 +305,14 @@ var dw_mediamanager = {
// fetch the subtree
dw_mediamanager.update_content($content, params);
+ if (document.getElementById('media__content')) {
+ //popup
+ $content = jQuery('#media__content');
+ $content.html('<img src="' + DOKU_BASE + 'lib/images/loading.gif" alt="..." class="load" />');
+ } else {
+ //fullscreen media manager
+ jQuery('.scroll-container', $content).html('<img src="' + DOKU_BASE + 'lib/images/loading.gif" alt="..." class="load" />');
+ }
},
/**
@@ -381,12 +385,6 @@ var dw_mediamanager = {
if ($link[0].id == 'mediamanager__btn_restore' && !confirm(LANG['restore_confirm'])) return false;
$content = jQuery('#mediamanager__layout_detail');
- if (jQuery('.scroll-container', $content).length) {
- jQuery('.scroll-container', $content).html('<img src="' + DOKU_BASE + 'lib/images/loading.gif" alt="..." class="load" />');
- } else {
- jQuery($content).html('<img src="' + DOKU_BASE + 'lib/images/loading.gif" alt="..." class="load" />');
- }
-
params = '';
if ($link[0].search) {
@@ -399,6 +397,12 @@ var dw_mediamanager = {
update_list = ($link[0].id == 'mediamanager__btn_delete' || $link[0].id == 'mediamanager__btn_restore');
dw_mediamanager.update_content($content, params, update_list);
+
+ if (jQuery('.scroll-container', $content).length) {
+ jQuery('.scroll-container', $content).html('<img src="' + DOKU_BASE + 'lib/images/loading.gif" alt="..." class="load" />');
+ } else {
+ jQuery($content).html('<img src="' + DOKU_BASE + 'lib/images/loading.gif" alt="..." class="load" />');
+ }
},
update_content: function ($content, params, update_list) {
@@ -427,9 +431,8 @@ var dw_mediamanager = {
$link1 = jQuery('a.files');
params1 = $link1[0].search.substr(1)+'&call=medialist';
$content1 = jQuery('#mediamanager__layout_list');
- jQuery('.scroll-container', $content1).html('<img src="' + DOKU_BASE + 'lib/images/loading.gif" alt="..." class="load" />');
-
dw_mediamanager.update_content($content1, params1);
+ jQuery('.scroll-container', $content1).html('<img src="' + DOKU_BASE + 'lib/images/loading.gif" alt="..." class="load" />');
}
},
'html'
@@ -552,11 +555,11 @@ var dw_mediamanager = {
$label.append($select);
$form.append($label);
- // for IE
- var select = document.getElementById('mediamanager__difftype');
- select.options[0].text = LANG.media_diff_both;
- select.options[1].text = LANG.media_diff_opacity;
- select.options[2].text = LANG.media_diff_portions;
+ // for IE
+ var select = document.getElementById('mediamanager__difftype');
+ select.options[0].text = LANG.media_diff_both;
+ select.options[1].text = LANG.media_diff_opacity;
+ select.options[2].text = LANG.media_diff_portions;
},
/**