function clg(obj) { if(typeof console != 'undefined') console.log(obj); } function cld(obj) { if(typeof console != 'undefined') console.dir(obj); } $(function() { $("#code_search").bind("focus", function() { if(this.value == default_search_text) { this.value = ''; } }).bind("blur", function() { if(this.value == '') { this.value = default_search_text; } }); }); /** * jQuery.noticeAdd() and jQuery.noticeRemove() * These functions create and remove growl-like notices * * Copyright (c) 2009 Tim Benniks * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * @author Tim Benniks * @copyright 2009 timbenniks.com * @version $Id: jquery.notice.js 1 2009-01-24 12:24:18Z timbenniks $ **/ (function(jQuery) { jQuery.extend({ noticeAdd: function(options) { var defaults = { inEffect: {opacity: 'show'}, // in effect inEffectDuration: 600, // in effect duration in miliseconds stayTime: 3000, // time in miliseconds before the item has to disappear text: '', // content of the item stay: false, // should the notice item stay or not? type: 'notice' // could also be error, succes } // declare varaibles var options, noticeWrapAll, noticeItemOuter, noticeItemInner, noticeItemClose; options = jQuery.extend({}, defaults, options); noticeWrapAll = (!jQuery('.notice-wrap').length) ? jQuery('
').addClass('notice-wrap').appendTo('body') : jQuery('.notice-wrap'); noticeItemOuter = jQuery('
').addClass('notice-item-wrapper'); noticeItemInner = jQuery('
').hide().addClass('notice-item ' + options.type).appendTo(noticeWrapAll).html('

'+options.text+'

').animate(options.inEffect, options.inEffectDuration).wrap(noticeItemOuter); noticeItemClose = jQuery('
').addClass('notice-item-close').prependTo(noticeItemInner).html('x').click(function() { jQuery.noticeRemove(noticeItemInner) }); // hmmmz, zucht if(navigator.userAgent.match(/MSIE 6/i)) { noticeWrapAll.css({top: document.documentElement.scrollTop}); } if(!options.stay) { setTimeout(function() { jQuery.noticeRemove(noticeItemInner); }, options.stayTime); } }, noticeRemove: function(obj) { obj.animate({opacity: '0'}, 600, function() { obj.parent().animate({height: '0px'}, 300, function() { obj.parent().remove(); }); }); } }); })(jQuery); /* jQuery List DragSort v0.3.10 Website: http://dragsort.codeplex.com/ License: http://dragsort.codeplex.com/license */ (function($) { $.fn.dragsort = function(options) { var opts = $.extend({}, $.fn.dragsort.defaults, options); var lists = new Array(); var list = null, lastPos = null; if (this.selector) $("head").append(""); this.each(function(i, cont) { if ($(cont).is("table") && $(cont).children().size() == 1 && $(cont).children().is("tbody")) cont = $(cont).children().get(0); var newList = { draggedItem: null, placeHolderItem: null, pos: null, offset: null, offsetLimit: null, container: cont, init: function() { $(this.container).attr("listIdx", i).mousedown(this.grabItem).find(opts.dragSelector).css("cursor", "pointer"); }, grabItem: function(e) { if (e.button == 2 || $(e.target).is(opts.dragSelectorExclude)) return; var elm = e.target; while (!$(elm).is("[listIdx=" + $(this).attr("listIdx") + "] " + opts.dragSelector)) { if (elm == this) return; elm = elm.parentNode; } if (list != null && list.draggedItem != null) list.dropItem(); $(e.target).css("cursor", "move"); list = lists[$(this).attr("listIdx")]; list.draggedItem = $(elm).closest(opts.itemSelector); var mt = parseInt(list.draggedItem.css("marginTop")); var ml = parseInt(list.draggedItem.css("marginLeft")); list.offset = list.draggedItem.offset(); list.offset.top = e.pageY - list.offset.top + (isNaN(mt) ? 0 : mt) - 1; list.offset.left = e.pageX - list.offset.left + (isNaN(ml) ? 0 : ml) - 1; if (!opts.dragBetween) { var containerHeight = $(list.container).outerHeight() == 0 ? Math.max(1, Math.round(0.5 + $(list.container).children(opts.itemSelector).size() * list.draggedItem.outerWidth() / $(list.container).outerWidth())) * list.draggedItem.outerHeight() : $(list.container).outerHeight(); list.offsetLimit = $(list.container).offset(); list.offsetLimit.right = list.offsetLimit.left + $(list.container).outerWidth() - list.draggedItem.outerWidth(); list.offsetLimit.bottom = list.offsetLimit.top + containerHeight - list.draggedItem.outerHeight(); } list.draggedItem.css({ position: "absolute", opacity: 0.8, "z-index": 999 }).after(opts.placeHolderTemplate); list.placeHolderItem = list.draggedItem.next().css("height", list.draggedItem.height()).attr("placeHolder", true); $(lists).each(function(i, l) { l.ensureNotEmpty(); l.buildPositionTable(); }); list.setPos(e.pageX, e.pageY); $(document).bind("selectstart", list.stopBubble); //stop ie text selection $(document).bind("mousemove", list.swapItems); $(document).bind("mouseup", list.dropItem); return false; //stop moz text selection }, setPos: function(x, y) { var top = y - this.offset.top; var left = x - this.offset.left; if (!opts.dragBetween) { top = Math.min(this.offsetLimit.bottom, Math.max(top, this.offsetLimit.top)); left = Math.min(this.offsetLimit.right, Math.max(left, this.offsetLimit.left)); } this.draggedItem.parents().each(function() { if ($(this).css("position") != "static" && (!$.browser.mozilla || $(this).css("display") != "table")) { var offset = $(this).offset(); top -= offset.top; left -= offset.left; return false; } }); this.draggedItem.css({ top: top, left: left }); }, buildPositionTable: function() { var item = this.draggedItem == null ? null : this.draggedItem.get(0); var pos = new Array(); $(this.container).children(opts.itemSelector).each(function(i, elm) { if (elm != item) { var loc = $(elm).offset(); loc.right = loc.left + $(elm).width(); loc.bottom = loc.top + $(elm).height(); loc.elm = elm; pos.push(loc); } }); this.pos = pos; }, dropItem: function() { if (list.draggedItem == null) return; $(list.container).find(opts.dragSelector).css("cursor", "pointer"); list.placeHolderItem.before(list.draggedItem); list.draggedItem.css({ position: "", top: "", left: "", opacity: "", "z-index": "" }); list.placeHolderItem.remove(); $("*[emptyPlaceHolder]").remove(); opts.dragEnd.apply(list.draggedItem); list.draggedItem = null; $(document).unbind("selectstart", list.stopBubble); $(document).unbind("mousemove", list.swapItems); $(document).unbind("mouseup", list.dropItem); return false; }, stopBubble: function() { return false; }, swapItems: function(e) { if (list.draggedItem == null) return false; list.setPos(e.pageX, e.pageY); var ei = list.findPos(e.pageX, e.pageY); var nlist = list; for (var i = 0; ei == -1 && opts.dragBetween && i < lists.length; i++) { ei = lists[i].findPos(e.pageX, e.pageY); nlist = lists[i]; } if (ei == -1 || $(nlist.pos[ei].elm).attr("placeHolder")) return false; if (lastPos == null || lastPos.top > list.draggedItem.offset().top || lastPos.left > list.draggedItem.offset().left) $(nlist.pos[ei].elm).before(list.placeHolderItem); else $(nlist.pos[ei].elm).after(list.placeHolderItem); $(lists).each(function(i, l) { l.ensureNotEmpty(); l.buildPositionTable(); }); lastPos = list.draggedItem.offset(); return false; }, findPos: function(x, y) { for (var i = 0; i < this.pos.length; i++) { if (this.pos[i].left < x && this.pos[i].right > x && this.pos[i].top < y && this.pos[i].bottom > y) return i; } return -1; }, ensureNotEmpty: function() { if (!opts.dragBetween) return; var item = this.draggedItem == null ? null : this.draggedItem.get(0); var emptyPH = null, empty = true; $(this.container).children(opts.itemSelector).each(function(i, elm) { if ($(elm).attr("emptyPlaceHolder")) emptyPH = elm; else if (elm != item) empty = false; }); if (empty && emptyPH == null) $(this.container).append(opts.placeHolderTemplate).children(":last").attr("emptyPlaceHolder", true); else if (!empty && emptyPH != null) $(emptyPH).remove(); } }; newList.init(); lists.push(newList); }); return this; }; $.fn.dragsort.defaults = { itemSelector: "li", dragSelector: "li", dragSelectorExclude: "input, a[href]", dragEnd: function() { }, dragBetween: false, placeHolderTemplate: "
  •  
  • " }; })(jQuery); /********************* //* jQuery Multi Level CSS Menu #2- By Dynamic Drive: http://www.dynamicdrive.com/ //* Last update: Nov 7th, 08': Limit # of queued animations to minmize animation stuttering //* Menu avaiable at DD CSS Library: http://www.dynamicdrive.com/style/ *********************/ //Specify full URL to down and right arrow images (23 is padding-right to add to top level LIs with drop downs): var arrowimages={down:['downarrowclass', '/images/down.gif', 23], right:['rightarrowclass', '/images/right.gif']} var jqueryslidemenu={ animateduration: {over: 500, out: 300}, //duration of slide in/ out animation, in milliseconds buildmenu:function(menuid, arrowsvar){ jQuery(document).ready(function($){ var $mainmenu=$("#"+menuid+">ul") var $headers=$mainmenu.find("ul").parent() $headers.each(function(i){ var $curobj=$(this) var $subul=$(this).find('ul:eq(0)') this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()} this.istopheader=$curobj.parents("ul").length==1? true : false $subul.css({top:this.istopheader? this._dimensions.h+"px" : 0}) $curobj.children("a:eq(0)").append( '' ) $curobj.hover( function(e){ var $targetul=$(this).children("ul:eq(0)"); this._offsets={left:$(this).offset().left, top:$(this).offset().top} var menuleft= this.istopheader? 191 : this._dimensions.w; menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft; if ($targetul.queue().length<=1) //if 1 or less queued animations $targetul.css({left:menuleft+"px", top:0, width:this._dimensions.subulw+'px'}).fadeIn(jqueryslidemenu.animateduration.over); }, function(e){ var $targetul=$(this).children("ul:eq(0)"); $targetul.fadeOut(jqueryslidemenu.animateduration.out); } ) //end hover }) //end $headers.each() $mainmenu.find("ul").css({display:'none', visibility:'visible'}); }) //end document.ready } } //build menu with ID="adminmenu" on page: jqueryslidemenu.buildmenu("adminmenu", arrowimages); /* (c) 2008, Joern Schou-Rode This work ‘as-is’ we provide. No warranty, express or implied. We’ve done our best, to debug and test. Liability for damages denied. Permission is granted hereby, to copy, share, and modify. Use as is fit, free or for profit. On this notice these rights rely. */ (function($) { // Extend all jQuery objects with the filterable method. $.fn.filterable = function(options) { var o = $.extend({}, $.fn.filterable.defaults, options); return this.each(function() { var target = $(this); // Create the query div, and insert it into the DOM. var div = $('
    '); switch (o.queryPosition) { case 'before': div.insertBefore(target); break; case 'after': div.insertAfter(target); break; } // Create the query input field, possibly with a label in front if it. var txt = $('').appendTo(div); if (o.queryLabel) div.prepend(''); // Define the filtering function. var fn = function() { var query = txt.val().toLowerCase(); target.find(o.affects).each(function() { var item = $(this); if (item.text().toLowerCase().indexOf(query) >= 0) item.show(); else item.hide(); }); }; // Attach the function to the input text field (onKeyUp) or to a button (onClick). if (o.queryButton) $('').appendTo(div).click(fn); else txt.keyup(fn); }); }; // Declare default options. $.fn.filterable.defaults = { affects: '> *', queryLabel: '', queryButton: '', queryPosition: 'before', queryCss: 'ui-filterable-query' }; })(jQuery); (function($) { $.extend({ tablesorterPager: new function() { function updatePageDisplay(c) { var s = $(c.cssPageDisplay,c.container).val((c.page+1) + c.seperator + c.totalPages); } function setPageSize(table,size) { var c = table.config; c.size = size; c.totalPages = Math.ceil(c.totalRows / c.size); c.pagerPositionSet = false; moveToPage(table); fixPosition(table); } function fixPosition(table) { var c = table.config; if(!c.pagerPositionSet && c.positionFixed) { var c = table.config, o = $(table); if(o.offset) { c.container.css({ top: o.offset().top + o.height() + 'px' }); } c.pagerPositionSet = true; } } function moveToFirstPage(table) { var c = table.config; c.page = 0; moveToPage(table); } function moveToLastPage(table) { var c = table.config; c.page = (c.totalPages-1); moveToPage(table); } function moveToNextPage(table) { var c = table.config; c.page++; if(c.page >= (c.totalPages-1)) { c.page = (c.totalPages-1); } moveToPage(table); } function moveToPrevPage(table) { var c = table.config; c.page--; if(c.page <= 0) { c.page = 0; } moveToPage(table); } function moveToPage(table) { var c = table.config; if(c.page < 0 || c.page > (c.totalPages-1)) { c.page = 0; } renderTable(table,c.rowsCopy); } function renderTable(table,rows) { var c = table.config; var l = rows.length; var s = (c.page * c.size); var e = (s + c.size); if(e > rows.length ) { e = rows.length; } var tableBody = $(table.tBodies[0]); // clear the table body $.tablesorter.clearTableBody(table); for(var i = s; i < e; i++) { //tableBody.append(rows[i]); var o = rows[i]; var l = o.length; for(var j=0; j < l; j++) { tableBody[0].appendChild(o[j]); } } fixPosition(table,tableBody); $(table).trigger("applyWidgets"); if( c.page >= c.totalPages ) { moveToLastPage(table); } updatePageDisplay(c); } this.appender = function(table,rows) { var c = table.config; c.rowsCopy = rows; c.totalRows = rows.length; c.totalPages = Math.ceil(c.totalRows / c.size); renderTable(table,rows); }; this.defaults = { size: 10, offset: 0, page: 0, totalRows: 0, totalPages: 0, container: null, cssNext: '.next', cssPrev: '.prev', cssFirst: '.first', cssLast: '.last', cssPageDisplay: '.pagedisplay', cssPageSize: '.pagesize', seperator: "/", positionFixed: true, appender: this.appender }; this.construct = function(settings) { return this.each(function() { config = $.extend(this.config, $.tablesorterPager.defaults, settings); var table = this, pager = config.container; $(this).trigger("appendCache"); config.size = parseInt($(".pagesize",pager).val()); $(config.cssFirst,pager).click(function() { moveToFirstPage(table); return false; }); $(config.cssNext,pager).click(function() { moveToNextPage(table); return false; }); $(config.cssPrev,pager).click(function() { moveToPrevPage(table); return false; }); $(config.cssLast,pager).click(function() { moveToLastPage(table); return false; }); $(config.cssPageSize,pager).change(function() { setPageSize(table,parseInt($(this).val())); return false; }); }); }; } }); // extend plugin scope $.fn.extend({ tablesorterPager: $.tablesorterPager.construct }); })(jQuery); (function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'.',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}var rows=table.tBodies[0].rows;if(table.tBodies[0].rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;ib)?1:0));};function sortTextDesc(a,b){return((ba)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){$this.trigger("sortStart");var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){var $cell=$(this);var i=this.column;this.order=this.count++%2;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i