From 4b844d63efd124df0a5bb6d5d005d60289a955c0 Mon Sep 17 00:00:00 2001 From: dongsheng Date: Tue, 5 Aug 2008 05:49:33 +0000 Subject: [PATCH] MDL-13766, more changes to mulit-filepicker in one page. --- lib/editor/tinymce.js.php | 3 +- lib/weblib.php | 2 +- repository/lib.php | 73 ++++++++++++++++++++------------------- 3 files changed, 40 insertions(+), 38 deletions(-) diff --git a/lib/editor/tinymce.js.php b/lib/editor/tinymce.js.php index 8684d2a005..6650b48a30 100644 --- a/lib/editor/tinymce.js.php +++ b/lib/editor/tinymce.js.php @@ -185,7 +185,7 @@ $output = << - #list{line-height: 1.5em} - #list a{ padding: 3px } - #list li a:hover{ background: gray; color:white; } - #paging{margin:10px 5px; clear:both} - #paging a{padding: 4px; border: 1px solid gray} - #panel{padding:0;margin:0; text-align:left;} + #list-$suffix{line-height: 1.5em} + #list-$suffix a{ padding: 3px } + #list-$suffix li a:hover{ background: gray; color:white; } + #paging-$suffix{margin:10px 5px; clear:both} + #paging-$suffix a{padding: 4px; border: 1px solid gray} + #panel-$suffix{padding:0;margin:0; text-align:left;} .file_name{color:green;} .file_date{color:blue} .file_size{color:gray} @@ -444,17 +444,17 @@ function get_repository_client(){ // construct code section { panel.setHeader('$strtitle'); - panel.setBody('
'); + panel.setBody('
'); panel.beforeRenderEvent.subscribe(function() { - Event.onAvailable('layout', function() { - layout = new YAHOO.widget.Layout('layout', { + Event.onAvailable('layout-$suffix', function() { + layout = new YAHOO.widget.Layout('layout-$suffix', { height: 400, width: 490, units: [ {position: 'top', height: 32, resize: false, - body:'
', gutter: '2'}, + body:'
', gutter: '2'}, {position: 'left', width: 150, resize: true, - body:'', gutter: '0 5 0 2', minWidth: 150, maxWidth: 300 }, - {position: 'center', body: '
', + body:'', gutter: '0 5 0 2', minWidth: 150, maxWidth: 300 }, + {position: 'center', body: '
', scroll: true, gutter: '0 2 0 0' } ] }); @@ -484,10 +484,10 @@ function get_repository_client(){ }, panel, true); _client.viewbar = new YAHOO.widget.ButtonGroup({ - id: 'btngroup', + id: 'btngroup-$suffix', name: 'buttons', disabled: true, - container: 'repo-viewbar' + container: 'repo-viewbar-$suffix' }); } // public method @@ -499,26 +499,26 @@ function get_repository_client(){ panel.render(); _client.viewbar.addButtons([btn_list, btn_thumb]); // init repository list - list = new YAHOO.util.Element('repo-list'); + list = new YAHOO.util.Element('repo-list-$suffix'); list.on('contentReady', function(e){ for(var i=0; i<_client.repos.length; i++) { var repo = _client.repos[i]; li = document.createElement('ul'); - li.innerHTML = ''+ + li.innerHTML = ''+ repo.repositoryname+'
'; li.innerHTML += '$strsearch'; - li.innerHTML += '$strlogout'; - li.id = 'repo-'+repo.id; + li.innerHTML += '$strlogout'; + li.id = 'repo-$suffix-'+repo.id; this.appendChild(li); - var e = new YAHOO.util.Element('repo-call-'+repo.id); + var e = new YAHOO.util.Element('repo-call-$suffix-'+repo.id); e.on('click', function(e){ - var re = /repo-call-(\d+)/i; + var re = /repo-call-$suffix-(\d+)/i; var id = this.get('id').match(re); repository_client_$suffix.req(id[1], 1, 0); }); - e = new YAHOO.util.Element('repo-logout-'+repo.id); + e = new YAHOO.util.Element('repo-logout-$suffix-'+repo.id); e.on('click', function(e){ - var re = /repo-logout-(\d+)/i; + var re = /repo-logout-$suffix-(\d+)/i; var id = this.get('id').match(re); repository_client_$suffix.req(id[1], 1, 1); }); @@ -550,24 +550,24 @@ function get_repository_client(){ return str; } _client.loading = function(){ - var panel = new YAHOO.util.Element('panel'); + var panel = new YAHOO.util.Element('panel-$suffix'); panel.get('element').innerHTML = '$strloading'; } _client.rename = function(oldname, url){ - var panel = new YAHOO.util.Element('panel'); + var panel = new YAHOO.util.Element('panel-$suffix'); var html = '
'; html += ''; - html += '
'; + html += '
'; html += ''; - html += '
'; - html += ''; + html += '
'; + html += ''; html += ''; html += '$strback'; html += '
'; panel.get('element').innerHTML = html; } _client.print_login = function(){ - var panel = new YAHOO.util.Element('panel'); + var panel = new YAHOO.util.Element('panel-$suffix'); var data = _client.datasource.l; var str = ''; for(var k in data){ @@ -601,7 +601,7 @@ function get_repository_client(){ } _client.viewthumb = function(){ - var panel = new YAHOO.util.Element('panel'); + var panel = new YAHOO.util.Element('panel-$suffix'); _client.viewbar.check(1); obj = _client.datasource.list; var str = ''; @@ -623,7 +623,7 @@ function get_repository_client(){ } _client.viewlist = function(){ - var panel = new YAHOO.util.Element('panel'); + var panel = new YAHOO.util.Element('panel-$suffix'); var str = ''; _client.viewbar.check(0); obj = _client.datasource.list; @@ -650,7 +650,7 @@ function get_repository_client(){ _client.makepage = function(){ var str = ''; if(_client.datasource.pages){ - str += '