Skip to content

Instantly share code, notes, and snippets.

View pnomolos's full-sized avatar

Phil Schalm pnomolos

  • Jane.app
  • British Columbia, BC
  • 15:49 (UTC -12:00)
  • X @pnomolos
View GitHub Profile
$.fn.sortOptions = function(ascending)
{
var _sortFunc;
if ( typeof(ascending) == "function") {
_sortFunc = ascending;
} else if (!!ascending) {
_sortFunc = function(a,b) {
return a.text < b.text ? -1 : 1;
}
} else {
/*
*
* Copyright (c) 2006-2009 Sam Collett (http://www.texotela.co.uk)
* Modified by Phil Schalm to allow custom sorting via a passed in function
*
*/
$.fn.sortOptions = function(ascending)
{
// get selected values first
<!-- The cheater way -->
<a href="javascript:window.history.go(-2);">Go back 2 history</a>
<!-- The more correct way -->
<span id="go-back">Go back</span>
<script type="text/javascript">
document.getElementById('go-back').onclick = function() {
window.history.go(-2);
}
</script>
window.addEvent('domready',function(){
if ($('section-menu')) {
$('section-menu').getElements('a.menuitem').each(function(n){
n.addEvent('click',function(ev){
new Event(ev).preventDefault();
})
})
var accordion = new Accordion('a.menuitem', 'ul.submenu', {
opacity: false,
onActive: function(toggler, element){
module Packs
module Admin
class Grade < Grade
# Stub class extending from the real definition
end
end # Admin
end # Packs