Skip to content

Commit

Permalink
Merge branch 'MDL-35934' of git://github.com/rwijaya/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Aug 12, 2013
2 parents 88ce8a1 + 1b25169 commit 8e9709f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion files/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function render_form_filemanager($fm) {
array('invalidjson', 'repository'), array('popupblockeddownload', 'repository'),
array('unknownoriginal', 'repository'), array('confirmdeletefolder', 'repository'),
array('confirmdeletefilewithhref', 'repository'), array('confirmrenamefolder', 'repository'),
array('confirmrenamefile', 'repository'), array('newfolder', 'repository')
array('confirmrenamefile', 'repository'), array('newfolder', 'repository'), array('edit', 'moodle')
)
);
if (empty($filemanagertemplateloaded)) {
Expand Down
15 changes: 15 additions & 0 deletions lib/form/filemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ M.form_filemanager.init = function(Y, options) {
}
// initialize 'select file' panel
this.selectnode = Y.Node.createWithFilesSkin(M.form_filemanager.templates.fileselectlayout);
this.selectnode.setAttribute('aria-live', 'assertive');
this.selectnode.setAttribute('role', 'dialog');
this.selectnode.generateID();

var labelid = 'fm-dialog-label_'+ this.selectnode.get('id');
this.selectui = new Y.Panel({
headerContent: '<span id="' + labelid +'">' + M.str.moodle.edit + '</span>',
srcNode : this.selectnode,
zIndex : 7600,
centered : true,
Expand All @@ -114,6 +119,7 @@ M.form_filemanager.init = function(Y, options) {
render : true
});
this.selectui.plug(Y.Plugin.Drag,{handles:['#'+this.selectnode.get('id')+' .yui3-widget-hd']});
Y.one('#'+this.selectnode.get('id')).setAttribute('aria-labelledby', labelid);
this.selectui.hide();
this.setup_select_file();
// setup buttons onclick events
Expand Down Expand Up @@ -1011,8 +1017,17 @@ M.form_filemanager.init = function(Y, options) {
}
}, false);
}
// update dialog header
var nodename = node.fullname;
// Limit the string length so it fits nicely on mobile devices
var namelength = 50;
if (nodename.length > namelength) {
nodename = nodename.substring(0, namelength) + '...';
}
Y.one('#fm-dialog-label_'+selectnode.get('id')).setContent(Y.Escape.html(M.str.moodle.edit+' '+nodename));
// show panel
this.selectui.show();
Y.one('#'+selectnode.get('id')).focus();
},
render: function() {
this.print_path();
Expand Down
2 changes: 1 addition & 1 deletion mod/data/field/file/field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function display_add_field($recordid=0) {
array('invalidjson', 'repository'), array('popupblockeddownload', 'repository'),
array('unknownoriginal', 'repository'), array('confirmdeletefolder', 'repository'),
array('confirmdeletefilewithhref', 'repository'), array('confirmrenamefolder', 'repository'),
array('confirmrenamefile', 'repository')
array('confirmrenamefile', 'repository'), array('edit', 'moodle')
)
);

Expand Down
2 changes: 1 addition & 1 deletion mod/data/field/picture/field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function display_add_field($recordid=0) {
array('invalidjson', 'repository'), array('popupblockeddownload', 'repository'),
array('unknownoriginal', 'repository'), array('confirmdeletefolder', 'repository'),
array('confirmdeletefilewithhref', 'repository'), array('confirmrenamefolder', 'repository'),
array('confirmrenamefile', 'repository')
array('confirmrenamefile', 'repository'), array('edit', 'moodle')
)
);

Expand Down

0 comments on commit 8e9709f

Please sign in to comment.