Commit f674282c authored by Richard Mansfield's avatar Richard Mansfield
Browse files

My files contextual help

parent 6d5111eb
......@@ -39,8 +39,10 @@ function FileBrowser(element, source, statevars, changedircallback, actionname,
this.lastcolumnfunc = function (r) {
var editb = INPUT({'type':'button', 'class':'button', 'value':get_string('edit')});
editb.onclick = function () { self.openeditform(r); };
var edith = SPAN(null);
edith.innerHTML = get_string('edit.help');
if (r.childcount > 0) {
return TD(null, editb);
return TD(null, editb, edith);
}
var deleteb = INPUT({'type':'button', 'class':'button', 'value':get_string('delete')});
deleteb.onclick = function () {
......@@ -51,7 +53,9 @@ function FileBrowser(element, source, statevars, changedircallback, actionname,
}
}
};
return TD(null, editb, deleteb);
var deleteh = SPAN(null);
deleteh.innerHTML = get_string('delete.help');
return TD(null, editb, edith, deleteb, deleteh);
}
}
......@@ -64,7 +68,9 @@ function FileBrowser(element, source, statevars, changedircallback, actionname,
hideElement(self.createfolderbutton);
showElement(self.createfolderform);
}});
self.createfolderbutton = button;
var help = SPAN(null);
help.innerHTML = get_string('createfolder.help');
self.createfolderbutton = SPAN(null, button, help);
self.createfolderform = self.initcreatefolderform();
insertSiblingNodesBefore(self.element, self.createfolderbutton, self.createfolderform);
}
......@@ -203,6 +209,9 @@ function FileBrowser(element, source, statevars, changedircallback, actionname,
cancelcreateform();
}
}});
var namehelp = SPAN(null); namehelp.innerHTML = get_string('name.help');
var deschelp = SPAN(null); deschelp.innerHTML = get_string('folderdescription.help');
var cancelhelp = SPAN(null); cancelhelp.innerHTML = get_string('cancelfolder.help');
return FORM({'method':'post', 'id':formid, 'style':'display: none;'},
TABLE(null,
TBODY(null,
......@@ -211,14 +220,14 @@ function FileBrowser(element, source, statevars, changedircallback, actionname,
TD(null, SPAN({'id':'createdest'},self.generatePath(self.currentDirectory)))),
TR(null,TH(null,LABEL(get_string('name'))),
TD(null,INPUT({'type':'text','class':'text','name':'name','value':'',
'size':40}))),
'size':40}), namehelp)),
TR(null,TH(null,LABEL(get_string('description'))),
TD(null,INPUT({'type':'text','class':'text','name':'description',
'value':'','size':40}))),
'value':'','size':40}), deschelp)),
TR(null, TH(null, LABEL(null, get_string('tags'))),
TD(null, create_tags_control('tags'))),
TR(null,TD({'colspan':2},SPAN({'id':formid+'message'}))),
TR(null,TD({'colspan':2},createbutton,replacebutton,cancelbutton)))));
TR(null,TD({'colspan':2},createbutton,replacebutton,cancelbutton,cancelhelp)))));
};
this.showsize = function(bytes) {
......@@ -345,7 +354,9 @@ function FileUploader(element, uploadscript, statevars, foldername, folderid, up
showElement(self.form);
keepElementInViewport(self.form);
}});
self.openbutton = button;
var uploadhelp = SPAN(null);
uploadhelp.innerHTML = get_string('uploadfile.help');
self.openbutton = SPAN(null, button, uploadhelp);
appendChildNodes(self.element, self.form, self.openbutton);
}
......@@ -368,7 +379,10 @@ function FileUploader(element, uploadscript, statevars, foldername, folderid, up
showElement(self.openbutton);
};
var notice = SPAN(null);
notice.innerHTML = copyrightnotice;
notice.innerHTML = copyrightnotice + get_string('notice.help');
var titlehelp = SPAN(null); titlehelp.innerHTML = get_string('title.help');
var deschelp = SPAN(null); deschelp.innerHTML = get_string('description.help');
var cancelhelp = SPAN(null); cancelhelp.innerHTML = get_string('cancel.help');
var destinationattributes = (self.folderid === false) ? {'style':'display: none;'} : null;
appendChildNodes(form,
TABLE(null,
......@@ -383,9 +397,9 @@ function FileUploader(element, uploadscript, statevars, foldername, folderid, up
self.form.title.value = basename(self.form.userfile.value);
}}))),
TR(null, TH(null, LABEL(null, get_string('title'))),
TD(null, INPUT({'type':'text', 'class':'text', 'name':'title', 'size':40}))),
TD(null, INPUT({'type':'text', 'class':'text', 'name':'title', 'size':40}), titlehelp)),
TR(null, TH(null, LABEL(null, get_string('description'))),
TD(null, INPUT({'type':'text', 'class':'text', 'name':'description', 'size':40}))),
TD(null, INPUT({'type':'text', 'class':'text', 'name':'description', 'size':40}), deschelp)),
TR(null, TH(null, LABEL(null, get_string('tags'))),
TD(null, create_tags_control('tags'))),
TR(null,TD({'colspan':2, 'id':'uploadformmessage'})),
......@@ -397,7 +411,7 @@ function FileUploader(element, uploadscript, statevars, foldername, folderid, up
'value':get_string('overwrite'),
'onclick':function () { if (self.sendform(true)) { cancelform(); } }}),
INPUT({'type':'button','class':'button','value':get_string('cancel'),
'onclick':cancelform}))))));
'onclick':cancelform}), cancelhelp)))));
hideElement(form.replace);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment