Skip to content

Commit

Permalink
MDL-34741 use 2in3 in tags
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Aug 11, 2012
1 parent 1a59e71 commit 1126380
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
5 changes: 0 additions & 5 deletions tag/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@
$PAGE->set_blocks_editing_capability('moodle/tag:editblocks');
$PAGE->set_pagelayout('base');

$PAGE->requires->yui2_lib('connection');
$PAGE->requires->yui2_lib('animation');
$PAGE->requires->yui2_lib('datasource');
$PAGE->requires->yui2_lib('autocomplete');

$tagname = tag_display_name($tag);

// set the relatedtags field of the $tag object that will be passed to the form
Expand Down
14 changes: 8 additions & 6 deletions tag/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ var coursetagdivs = null;
var coursetag_tags = new Array();

function init_tag_autocomplete() {

var myDataSource = new YAHOO.util.XHRDataSource("./tag_autocomplete.php");
myDataSource.responseType = YAHOO.util.XHRDataSource.TYPE_TEXT;
YUI().use('yui2-autocomplete', 'yui2-datasource', 'yui2-animation', 'yui2-connection', function(Y) {
var myDataSource = new Y.YUI2.util.XHRDataSource("./tag_autocomplete.php");
myDataSource.responseType = Y.YUI2.util.XHRDataSource.TYPE_TEXT;
myDataSource.responseSchema = {
recordDelim: "\n",
fieldDelim: "\t"
Expand All @@ -13,7 +13,7 @@ function init_tag_autocomplete() {
myDataSource.minQueryLength = 3;

// Instantiate the AutoComplete
var myAutoComp = new YAHOO.widget.AutoComplete("id_relatedtags", "relatedtags-autocomplete", myDataSource);
var myAutoComp = new Y.YUI2.widget.AutoComplete("id_relatedtags", "relatedtags-autocomplete", myDataSource);
document.getElementById('id_relatedtags').style.width = '30%';
myAutoComp.allowBrowserAutocomplete = false;
myAutoComp.maxResultsDisplayed = 20;
Expand All @@ -26,7 +26,7 @@ function init_tag_autocomplete() {
myDataSource: myDataSource,
myAutoComp: myAutoComp
};

});
}

function ctags_checkinput(val) {
Expand Down Expand Up @@ -63,7 +63,9 @@ function add_tag_footer_link(eid, ltitle, laction, ltext) {
var callback = function () {
ctags_show_div(laction);
};
YAHOO.util.Event.addListener(link, 'click', callback);
YUI().use('yui2-event', function(Y) {
Y.YUI2.util.Event.addListener(link, 'click', callback);
});
if (e.childNodes.length > 0) {
e.appendChild(document.createTextNode(' | '));
} else {
Expand Down

0 comments on commit 1126380

Please sign in to comment.