"MDL-21240, fixed variable namespace, credits to Nicolas Rod <[email protected]>"

This commit is contained in:
Dongsheng Cai
2010-03-02 02:28:11 +00:00
parent bb45919150
commit 411caa63bb
+19 -3
View File
@@ -40,6 +40,11 @@
M.core_filepicker = M.core_filepicker || {};
<<<<<<< filepicker.js
YUI.add('core_filepicker', function(Y) {
function core_filepicker (args) {
core_filepicker.superclass.constructor.apply(this, arguments);
=======
/**
* instances of file pickers used on page
*/
@@ -61,6 +66,7 @@ M.core_filepicker.show = function(Y, options) {
M.core_filepicker.init = function(Y, options) {
var FilePickerHelper = function(options) {
FilePickerHelper.superclass.constructor.apply(this, arguments);
>>>>>>> 1.9
}
FilePickerHelper.NAME = "FilePickerHelper";
@@ -376,7 +382,8 @@ M.core_filepicker.init = function(Y, options) {
scope.hide();
obj.client_id = client_id;
var formcallback_scope = null;
if (scope.options.magicscope) {
// XXX: magic here, to let filepicker use filemanager scope
if (args.scope.options.magicscope) {
formcallback_scope = args.scope.options.magicscope;
} else {
formcallback_scope = args.scope;
@@ -786,7 +793,11 @@ M.core_filepicker.init = function(Y, options) {
str += '<label for="'+id+'_file">'+data.upload.label+': </label>';
str += '<input type="file" id="'+id+'_file" name="repo_upload_file" />';
str += '<input type="hidden" name="itemid" value="'+this.options.itemid+'" />';
<<<<<<< filepicker.js
str += '<div class="fp-upload-btn"><button click="return false" id="'+id+'_action" href="###" >'+mstr.repository.upload+'</button></div>';
=======
str += '<div class="fp-upload-btn"><a id="'+id+'_action" href="###" >'+M.str.repository.upload+'...</a></div>';
>>>>>>> 1.9
str += '</form>';
str += '</div>';
var upload_form = Y.Node.create(str);
@@ -798,7 +809,7 @@ M.core_filepicker.init = function(Y, options) {
scope: scope,
action:'upload',
client_id: client_id,
params: {'savepath':'/'},
params: {'savepath':scope.options.savepath},
repository_id: scope.active_repo.id,
form: {id: id, upload:true},
callback: function(id, o, args) {
@@ -839,7 +850,7 @@ M.core_filepicker.init = function(Y, options) {
var toolbar = Y.one('#repo-tb-'+client_id);
if(!r.nosearch) {
var html = '<a href="###"><img src="'+this.M.util.image_url('a/search')+'" /> '+M.str.repository.search+'</a>';
var html = '<a href="###"><img src="'+M.util.image_url('a/search')+'" /> '+M.str.repository.search+'</a>';
var search = Y.Node.create(html);
search.on('click', function() {
scope.request({
@@ -1094,6 +1105,11 @@ M.core_filepicker.init = function(Y, options) {
this.render();
}
});
<<<<<<< filepicker.js
Y.filepicker = core_filepicker;
}, '3.0.1', {requires: ['base', 'io', 'node', 'json']});
=======
M.core_filepicker.instances[options.client_id] = new FilePickerHelper(options);
};
>>>>>>> 1.9