From 411caa63bbf57ed045b333f1be85aa11e6ad77e4 Mon Sep 17 00:00:00 2001 From: Dongsheng Cai Date: Tue, 2 Mar 2010 02:28:11 +0000 Subject: [PATCH] "MDL-21240, fixed variable namespace, credits to Nicolas Rod " --- repository/filepicker.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/repository/filepicker.js b/repository/filepicker.js index b329803cc7a..a22f7f50cd0 100644 --- a/repository/filepicker.js +++ b/repository/filepicker.js @@ -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 += ''; str += ''; str += ''; +<<<<<<< filepicker.js + str += '
'; +======= str += ''; +>>>>>>> 1.9 str += ''; str += ''; 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 = ' '+M.str.repository.search+''; + var html = ' '+M.str.repository.search+''; 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