[ Index ] |
PHP Cross Reference of moodle-2.8 |
[Summary view] [Print] [Text view]
1 /** 2 * Javascript to insert the field tags into the textarea. 3 * Used when editing a data template 4 */ 5 function insert_field_tags(selectlist) { 6 var value = selectlist.options[selectlist.selectedIndex].value; 7 var editorname = 'template'; 8 if (typeof tinyMCE == 'undefined') { 9 var element = document.getElementsByName(editorname)[0]; 10 // For inserting when in normal textareas 11 insertAtCursor(element, value); 12 } else { 13 tinyMCE.execInstanceCommand(editorname, 'mceInsertContent', false, value); 14 } 15 } 16 17 /** 18 * javascript for hiding/displaying advanced search form when viewing 19 */ 20 function showHideAdvSearch(checked) { 21 var divs = document.getElementsByTagName('div'); 22 for(i=0;i<divs.length;i++) { 23 if(divs[i].id.match('data_adv_form')) { 24 if(checked) { 25 divs[i].style.display = 'inline'; 26 } 27 else { 28 divs[i].style.display = 'none'; 29 } 30 } 31 else if (divs[i].id.match('reg_search')) { 32 if (!checked) { 33 divs[i].style.display = 'inline'; 34 } 35 else { 36 divs[i].style.display = 'none'; 37 } 38 } 39 } 40 } 41 42 M.data_urlpicker = {}; 43 44 M.data_urlpicker.init = function(Y, options) { 45 options.formcallback = M.data_urlpicker.callback; 46 if (!M.core_filepicker.instances[options.client_id]) { 47 M.core_filepicker.init(Y, options); 48 } 49 Y.on('click', function(e, client_id) { 50 e.preventDefault(); 51 M.core_filepicker.instances[client_id].show(); 52 }, '#filepicker-button-'+options.client_id, null, options.client_id); 53 54 }; 55 56 M.data_urlpicker.callback = function (params) { 57 document.getElementById('field_url_'+params.client_id).value = params.url; 58 };
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:29:05 2014 | Cross-referenced by PHPXref 0.7.1 |