moodle/mod/data/data.js
Sara Arjona 61e8b806ec MDL-75289 mod_data: Implement prototyped tertiary nav
On the Database page:
- The List/single view is displayed in the right.
- The buttons Import entries, export entries and Export to portfolio
have been moved to the Actions menu.
- The List/Single view headings have been removed.
- The "Save settings" secondary button is hidden when advanced search
is enabled.
- The result (Found X out of Y entries, No records found) are not
displayed as notifications anymore.

On the Presets page:
- The buttons (Import, Export and Save as preset) have been moved to an
actions menu to the tertiary navigation. Some of these options have been
renamed.
- Remove the Action column heading from the table.

On the Presets preview page:
- Move the preset name to the heading in the tertiary navigation (Preview
of xxxxx), and remove the current preset name from the page.
- Align the List/single template to the right in the tertiary navigation.
- Make primary the "Use this preset" button.

On the Fields page:
- Remove the "Manage fields" menu.
- Remove the Export and Save as preset from the tertiary navigation.
- Align Create a field to the right in the tertiary navigation.
- Add a description at the top of the page.
- Remove the Action column heading from the table.
- Move field actions (Edit and Delete) to ellipsis.

On the Templates page:
- Move Export and Save as preset to the Actions menu.
- Move the templates list to a tertiary navigation selector and remove
the template heading.
- Reorder the templates list (Add entry template should be displayed
at the begining, instead of List template).
- Rename "Enable editor" to "Enable code editor".
2022-10-31 15:24:13 +01:00

66 lines
2.1 KiB
JavaScript

/**
* Javascript to insert the field tags into the textarea.
* Used when editing a data template
*/
function insert_field_tags(selectlist) {
var value = selectlist.options[selectlist.selectedIndex].value;
var editorname = 'template';
if (typeof tinyMCE == 'undefined') {
if (document.execCommand('insertText')) {
document.execCommand('insertText', false, value);
} else {
var element = document.getElementsByName(editorname)[0];
// For inserting when in normal textareas
insertAtCursor(element, value);
}
} else {
tinyMCE.execInstanceCommand(editorname, 'mceInsertContent', false, value);
}
}
/**
* javascript for hiding/displaying advanced search form when viewing
*/
function showHideAdvSearch(checked) {
var divs = document.getElementsByTagName('div');
for (var i = 0; i < divs.length; i++) {
if(divs[i].id.match('data_adv_form')) {
if(checked) {
divs[i].style.display = 'inline';
} else {
divs[i].style.display = 'none';
}
} else if (divs[i].id.match('reg_search')) {
if (!checked) {
divs[i].style.display = 'inline';
} else {
divs[i].style.display = 'none';
}
} else if (divs[i].id.match('advsearch-save-sec')) {
if (!checked) {
divs[i].style.display = 'inline';
} else {
divs[i].style.display = 'none';
}
}
}
}
M.data_urlpicker = {};
M.data_urlpicker.init = function(Y, options) {
options.formcallback = M.data_urlpicker.callback;
if (!M.core_filepicker.instances[options.client_id]) {
M.core_filepicker.init(Y, options);
}
Y.on('click', function(e, client_id) {
e.preventDefault();
M.core_filepicker.instances[client_id].show();
}, '#filepicker-button-'+options.client_id, null, options.client_id);
};
M.data_urlpicker.callback = function (params) {
document.getElementById('field_url_'+params.client_id).value = params.url;
};