first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,81 @@
YUI.add('moodle-mod_assign-history', function (Y, NAME) {
// Define a function that will run in the context of a
// Node instance:
var CSS = {
LINK: 'mod-assign-history-link',
OPEN: 'mod-assign-history-link-open',
CLOSED: 'mod-assign-history-link-closed',
PANEL: 'mod-assign-history-panel'
},
COUNT = 0,
TOGGLE = function() {
var id = this.get('for'),
panel = Y.one('#' + id);
if (this.hasClass(CSS.OPEN)) {
this.removeClass(CSS.OPEN);
this.addClass(CSS.CLOSED);
this.setStyle('overflow', 'hidden');
panel.hide();
} else {
this.removeClass(CSS.CLOSED);
this.addClass(CSS.OPEN);
panel.show();
}
},
HISTORY = function() {
var link = null,
panel = null,
wrapper = null,
container = this;
// Loop through all the children of this container and turn
// every odd node to a link to open/close the following panel.
this.get('children').each(function() {
if (link) {
COUNT++;
// First convert the link to an anchor.
wrapper = Y.Node.create('<a/>');
panel = this;
container.insertBefore(wrapper, link);
link.remove(false);
wrapper.appendChild(link);
// Add a for attribute to the link to link to the id of the panel.
if (!panel.get('id')) {
panel.set('id', CSS.PANEL + COUNT);
}
wrapper.set('for', panel.get('id'));
// Add an aria attribute for the live region.
panel.set('aria-live', 'polite');
wrapper.addClass(CSS.LINK);
if (COUNT == 1) {
wrapper.addClass(CSS.OPEN);
} else {
wrapper.addClass(CSS.CLOSED);
}
panel.addClass(CSS.PANEL);
if (COUNT == 1) {
panel.show();
} else {
panel.hide();
}
link = null;
} else {
link = this;
}
});
// Setup event listeners.
this.delegate('click', TOGGLE, '.' + CSS.LINK);
};
// Use addMethod to add history to the Node prototype:
Y.Node.addMethod("history", HISTORY);
// Extend this functionality to NodeLists.
Y.NodeList.importMethod(Y.Node.prototype, "history");
}, '@VERSION@', {"requires": ["node", "transition"]});
@@ -0,0 +1 @@
YUI.add("moodle-mod_assign-history",function(o,s){var d={LINK:"mod-assign-history-link",OPEN:"mod-assign-history-link-open",CLOSED:"mod-assign-history-link-closed",PANEL:"mod-assign-history-panel"},a=0,h=function(){var s=this.get("for"),s=o.one("#"+s);this.hasClass(d.OPEN)?(this.removeClass(d.OPEN),this.addClass(d.CLOSED),this.setStyle("overflow","hidden"),s.hide()):(this.removeClass(d.CLOSED),this.addClass(d.OPEN),s.show())};o.Node.addMethod("history",function(){var s,i=null,e=null,t=this;this.get("children").each(function(){i=i?(a++,e=o.Node.create("<a/>"),s=this,t.insertBefore(e,i),i.remove(!1),e.appendChild(i),s.get("id")||s.set("id",d.PANEL+a),e.set("for",s.get("id")),s.set("aria-live","polite"),e.addClass(d.LINK),1==a?e.addClass(d.OPEN):e.addClass(d.CLOSED),s.addClass(d.PANEL),1==a?s.show():s.hide(),null):this}),this.delegate("click",h,"."+d.LINK)}),o.NodeList.importMethod(o.Node.prototype,"history")},"@VERSION@",{requires:["node","transition"]});
@@ -0,0 +1,81 @@
YUI.add('moodle-mod_assign-history', function (Y, NAME) {
// Define a function that will run in the context of a
// Node instance:
var CSS = {
LINK: 'mod-assign-history-link',
OPEN: 'mod-assign-history-link-open',
CLOSED: 'mod-assign-history-link-closed',
PANEL: 'mod-assign-history-panel'
},
COUNT = 0,
TOGGLE = function() {
var id = this.get('for'),
panel = Y.one('#' + id);
if (this.hasClass(CSS.OPEN)) {
this.removeClass(CSS.OPEN);
this.addClass(CSS.CLOSED);
this.setStyle('overflow', 'hidden');
panel.hide();
} else {
this.removeClass(CSS.CLOSED);
this.addClass(CSS.OPEN);
panel.show();
}
},
HISTORY = function() {
var link = null,
panel = null,
wrapper = null,
container = this;
// Loop through all the children of this container and turn
// every odd node to a link to open/close the following panel.
this.get('children').each(function() {
if (link) {
COUNT++;
// First convert the link to an anchor.
wrapper = Y.Node.create('<a/>');
panel = this;
container.insertBefore(wrapper, link);
link.remove(false);
wrapper.appendChild(link);
// Add a for attribute to the link to link to the id of the panel.
if (!panel.get('id')) {
panel.set('id', CSS.PANEL + COUNT);
}
wrapper.set('for', panel.get('id'));
// Add an aria attribute for the live region.
panel.set('aria-live', 'polite');
wrapper.addClass(CSS.LINK);
if (COUNT == 1) {
wrapper.addClass(CSS.OPEN);
} else {
wrapper.addClass(CSS.CLOSED);
}
panel.addClass(CSS.PANEL);
if (COUNT == 1) {
panel.show();
} else {
panel.hide();
}
link = null;
} else {
link = this;
}
});
// Setup event listeners.
this.delegate('click', TOGGLE, '.' + CSS.LINK);
};
// Use addMethod to add history to the Node prototype:
Y.Node.addMethod("history", HISTORY);
// Extend this functionality to NodeLists.
Y.NodeList.importMethod(Y.Node.prototype, "history");
}, '@VERSION@', {"requires": ["node", "transition"]});
+10
View File
@@ -0,0 +1,10 @@
{
"name": "moodle-mod_assign-history",
"builds": {
"moodle-mod_assign-history": {
"jsfiles": [
"history.js"
]
}
}
}
+76
View File
@@ -0,0 +1,76 @@
// Define a function that will run in the context of a
// Node instance:
var CSS = {
LINK: 'mod-assign-history-link',
OPEN: 'mod-assign-history-link-open',
CLOSED: 'mod-assign-history-link-closed',
PANEL: 'mod-assign-history-panel'
},
COUNT = 0,
TOGGLE = function() {
var id = this.get('for'),
panel = Y.one('#' + id);
if (this.hasClass(CSS.OPEN)) {
this.removeClass(CSS.OPEN);
this.addClass(CSS.CLOSED);
this.setStyle('overflow', 'hidden');
panel.hide();
} else {
this.removeClass(CSS.CLOSED);
this.addClass(CSS.OPEN);
panel.show();
}
},
HISTORY = function() {
var link = null,
panel = null,
wrapper = null,
container = this;
// Loop through all the children of this container and turn
// every odd node to a link to open/close the following panel.
this.get('children').each(function() {
if (link) {
COUNT++;
// First convert the link to an anchor.
wrapper = Y.Node.create('<a/>');
panel = this;
container.insertBefore(wrapper, link);
link.remove(false);
wrapper.appendChild(link);
// Add a for attribute to the link to link to the id of the panel.
if (!panel.get('id')) {
panel.set('id', CSS.PANEL + COUNT);
}
wrapper.set('for', panel.get('id'));
// Add an aria attribute for the live region.
panel.set('aria-live', 'polite');
wrapper.addClass(CSS.LINK);
if (COUNT == 1) {
wrapper.addClass(CSS.OPEN);
} else {
wrapper.addClass(CSS.CLOSED);
}
panel.addClass(CSS.PANEL);
if (COUNT == 1) {
panel.show();
} else {
panel.hide();
}
link = null;
} else {
link = this;
}
});
// Setup event listeners.
this.delegate('click', TOGGLE, '.' + CSS.LINK);
};
// Use addMethod to add history to the Node prototype:
Y.Node.addMethod("history", HISTORY);
// Extend this functionality to NodeLists.
Y.NodeList.importMethod(Y.Node.prototype, "history");
@@ -0,0 +1,8 @@
{
"moodle-mod_assign-history": {
"requires": [
"node",
"transition"
]
}
}