//jquery.form
(function ($) { $.fn.ajaxSubmit = function (y) { if (!this.length) { log('ajaxSubmit: skipping submit process - no element selected'); return this } var z, action, url, $form = this; if (typeof y == 'function') { y = { success: y} } z = this.attr('method'); action = this.attr('action'); url = (typeof action === 'string') ? $.trim(action) : ''; url = url || window.location.href || ''; if (url) { url = (url.match(/^([^#]+)/) || [])[1] } y = $.extend(true, { url: url, success: $.ajaxSettings.success, type: z || 'GET', iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' }, y); var A = {}; this.trigger('form-pre-serialize', [this, y, A]); if (A.veto) { log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); return this } if (y.beforeSerialize && y.beforeSerialize(this, y) === false) { log('ajaxSubmit: submit aborted via beforeSerialize callback'); return this } var B = y.traditional; if (B === undefined) { B = $.ajaxSettings.traditional } var C, n, v, a = this.formToArray(y.semantic); if (y.data) { y.extraData = y.data; C = $.param(y.data, B) } if (y.beforeSubmit && y.beforeSubmit(a, this, y) === false) { log('ajaxSubmit: submit aborted via beforeSubmit callback'); return this } this.trigger('form-submit-validate', [a, this, y, A]); if (A.veto) { log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); return this } var q = $.param(a, B); if (C) { q = (q ? (q + '&' + C) : C) } if (y.type.toUpperCase() == 'GET') { y.url += (y.url.indexOf('?') >= 0 ? '&' : '?') + q; y.data = null } else { y.data = q } var D = []; if (y.resetForm) { D.push(function () { $form.resetForm() }) } if (y.clearForm) { D.push(function () { $form.clearForm(y.includeHidden) }) } if (!y.dataType && y.target) { var E = y.success || function () { }; D.push(function (a) { var b = y.replaceTarget ? 'replaceWith' : 'html'; $(y.target)[b](a).each(E, arguments) }) } else if (y.success) { D.push(y.success) } y.success = function (a, b, c) { var d = y.context || y; for (var i = 0, max = D.length; i < max; i++) { D[i].apply(d, [a, b, c || $form, $form]) } }; var F = $('input:file:enabled[value]', this); var G = F.length > 0; var H = 'multipart/form-data'; var I = ($form.attr('enctype') == H || $form.attr('encoding') == H); var J = !!(G && F.get(0).files && window.FormData); log("fileAPI :" + J); var K = (G || I) && !J; if (y.iframe !== false && (y.iframe || K)) { if (y.closeKeepAlive) { $.get(y.closeKeepAlive, function () { fileUploadIframe(a) }) } else { fileUploadIframe(a) } } else if ((G || I) && J) { y.progress = y.progress || $.noop; fileUploadXhr(a) } else { $.ajax(y) } this.trigger('form-submit-notify', [this, y]); return this; function fileUploadXhr(a) { var c = new FormData(); for (var i = 0; i < a.length; i++) { if (a[i].type == 'file') continue; c.append(a[i].name, a[i].value) } $form.find('input:file:enabled').each(function () { var a = $(this).attr('name'), files = this.files; if (a) { for (var i = 0; i < files.length; i++) c.append(a, files[i]) } }); if (y.extraData) { for (var k in y.extraData) c.append(k, y.extraData[k]) } y.data = null; var s = $.extend(true, {}, $.ajaxSettings, y, { contentType: false, processData: false, cache: false, type: 'POST' }); s.context = s.context || s; s.data = null; var d = s.beforeSend; s.beforeSend = function (b, o) { o.data = c; if (b.upload) { b.upload.onprogress = function (a) { o.progress(a.position, a.total) } } if (d) d.call(o, b, y) }; $.ajax(s) } function fileUploadIframe(a) { var l = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle; var m = !!$.fn.prop; if (a) { if (m) { for (i = 0; i < a.length; i++) { el = $(l[a[i].name]); el.prop('disabled', false) } } else { for (i = 0; i < a.length; i++) { el = $(l[a[i].name]); el.removeAttr('disabled') } } } if ($(':input[name=submit],:input[id=submit]', l).length) { alert('Error: Form elements must not have name or id of "submit".'); return } s = $.extend(true, {}, $.ajaxSettings, y); s.context = s.context || s; id = 'jqFormIO' + (new Date().getTime()); if (s.iframeTarget) { $io = $(s.iframeTarget); n = $io.attr('name'); if (n == null) $io.attr('name', id); else id = n } else { $io = $('<iframe name="' + id + '" src="' + s.iframeSrc + '" />'); $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' }) } io = $io[0]; xhr = { aborted: 0, responseText: null, responseXML: null, status: 0, statusText: 'n/a', getAllResponseHeaders: function () { }, getResponseHeader: function () { }, setRequestHeader: function () { }, abort: function (a) { var e = (a === 'timeout' ? 'timeout' : 'aborted'); log('aborting upload... ' + e); this.aborted = 1; $io.attr('src', s.iframeSrc); xhr.error = e; s.error && s.error.call(s.context, xhr, e, a); g && $.event.trigger("ajaxError", [xhr, s, e]); s.complete && s.complete.call(s.context, xhr, e) } }; g = s.global; if (g && !$.active++) { $.event.trigger("ajaxStart") } if (g) { $.event.trigger("ajaxSend", [xhr, s]) } if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) { if (s.global) { $.active-- } return } if (xhr.aborted) { return } sub = l.clk; if (sub) { n = sub.name; if (n && !sub.disabled) { s.extraData = s.extraData || {}; s.extraData[n] = sub.value; if (sub.type == "image") { s.extraData[n + '.x'] = l.clk_x; s.extraData[n + '.y'] = l.clk_y } } } var o = 1; var p = 2; function getDoc(a) { var b = a.contentWindow ? a.contentWindow.document : a.contentDocument ? a.contentDocument : a.document; return b } var q = $('meta[name=csrf-token]').attr('content'); var r = $('meta[name=csrf-param]').attr('content'); if (r && q) { s.extraData = s.extraData || {}; s.extraData[r] = q } function doSubmit() { var t = $form.attr('target'), a = $form.attr('action'); l.setAttribute('target', id); if (!z) { l.setAttribute('method', 'POST') } if (a != s.url) { l.setAttribute('action', s.url) } if (!s.skipEncodingOverride && (!z || /post/i.test(z))) { $form.attr({ encoding: 'multipart/form-data', enctype: 'multipart/form-data' }) } if (s.timeout) { timeoutHandle = setTimeout(function () { timedOut = true; cb(o) }, s.timeout) } function checkState() { try { var a = getDoc(io).readyState; log('state = ' + a); if (a.toLowerCase() == 'uninitialized') setTimeout(checkState, 50) } catch (e) { log('Server abort: ', e, ' (', e.name, ')'); cb(p); timeoutHandle && clearTimeout(timeoutHandle); timeoutHandle = undefined } } var b = []; try { if (s.extraData) { for (var n in s.extraData) { b.push($('<input type="hidden" name="' + n + '">').attr('value', s.extraData[n]).appendTo(l)[0]) } } if (!s.iframeTarget) { $io.appendTo('body'); io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false) } setTimeout(checkState, 15); l.submit() } finally { l.setAttribute('action', a); if (t) { l.setAttribute('target', t) } else { $form.removeAttr('target') } $(b).remove() } } if (s.forceSync) { doSubmit() } else { setTimeout(doSubmit, 10) } var u, doc, domCheckCount = 50, callbackProcessed; function cb(e) { if (xhr.aborted || callbackProcessed) { return } try { doc = getDoc(io) } catch (ex) { log('cannot access response document: ', ex); e = p } if (e === o && xhr) { xhr.abort('timeout'); return } else if (e == p && xhr) { xhr.abort('server abort'); return } if (!doc || doc.location.href == s.iframeSrc) { if (!timedOut) return } io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false); var c = 'success', errMsg; try { if (timedOut) { throw 'timeout'; } var d = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc); log('isXml=' + d); if (!d && window.opera && (doc.body == null || doc.body.innerHTML == '')) { if (--domCheckCount) { log('requeing onLoad callback, DOM not available'); setTimeout(cb, 250); return } } var f = doc.body ? doc.body : doc.documentElement; xhr.responseText = f ? f.innerHTML : null; xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc; if (d) s.dataType = 'xml'; xhr.getResponseHeader = function (a) { var b = { 'content-type': s.dataType }; return b[a] }; if (f) { xhr.status = Number(f.getAttribute('status')) || xhr.status; xhr.statusText = f.getAttribute('statusText') || xhr.statusText } var h = (s.dataType || '').toLowerCase(); var i = /(json|script|text)/.test(h); if (i || s.textarea) { var j = doc.getElementsByTagName('textarea')[0]; if (j) { xhr.responseText = j.value; xhr.status = Number(j.getAttribute('status')) || xhr.status; xhr.statusText = j.getAttribute('statusText') || xhr.statusText } else if (i) { var k = doc.getElementsByTagName('pre')[0]; var b = doc.getElementsByTagName('body')[0]; if (k) { xhr.responseText = k.textContent ? k.textContent : k.innerText } else if (b) { xhr.responseText = b.textContent ? b.textContent : b.innerText } } } else if (h == 'xml' && !xhr.responseXML && xhr.responseText != null) { xhr.responseXML = v(xhr.responseText) } try { u = x(xhr, h, s) } catch (e) { c = 'parsererror'; xhr.error = errMsg = (e || c) } } catch (e) { log('error caught: ', e); c = 'error'; xhr.error = errMsg = (e || c) } if (xhr.aborted) { log('upload aborted'); c = null } if (xhr.status) { c = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error' } if (c === 'success') { s.success && s.success.call(s.context, u, 'success', xhr); g && $.event.trigger("ajaxSuccess", [xhr, s]) } else if (c) { if (errMsg == undefined) errMsg = xhr.statusText; s.error && s.error.call(s.context, xhr, c, errMsg); g && $.event.trigger("ajaxError", [xhr, s, errMsg]) } g && $.event.trigger("ajaxComplete", [xhr, s]); if (g && ! --$.active) { $.event.trigger("ajaxStop") } s.complete && s.complete.call(s.context, xhr, c); callbackProcessed = true; if (s.timeout) clearTimeout(timeoutHandle); setTimeout(function () { if (!s.iframeTarget) $io.remove(); xhr.responseXML = null }, 100) } var v = $.parseXML || function (s, a) { if (window.ActiveXObject) { a = new ActiveXObject('Microsoft.XMLDOM'); a.async = 'false'; a.loadXML(s) } else { a = (new DOMParser()).parseFromString(s, 'text/xml') } return (a && a.documentElement && a.documentElement.nodeName != 'parsererror') ? a : null }; var w = $.parseJSON || function (s) { return window['eval']('(' + s + ')') }; var x = function (a, b, s) { var c = a.getResponseHeader('content-type') || '', xml = b === 'xml' || !b && c.indexOf('xml') >= 0, u = xml ? a.responseXML : a.responseText; if (xml && u.documentElement.nodeName === 'parsererror') { $.error && $.error('parsererror') } if (s && s.dataFilter) { u = s.dataFilter(u, b) } if (typeof u === 'string') { if (b === 'json' || !b && c.indexOf('json') >= 0) { u = w(u) } else if (b === "script" || !b && c.indexOf("javascript") >= 0) { $.globalEval(u) } } return u } } }; $.fn.ajaxForm = function (f) { if (this.length === 0) { var o = { s: this.selector, c: this.context }; if (!$.isReady && o.s) { log('DOM not ready, queuing ajaxForm'); $(function () { $(o.s, o.c).ajaxForm(f) }); return this } log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)')); return this } return this.ajaxFormUnbind().bind('submit.form-plugin', function (e) { if (!e.isDefaultPrevented()) { e.preventDefault(); $(this).ajaxSubmit(f) } }).bind('click.form-plugin', function (e) { var a = e.target; var b = $(a); if (!(b.is(":submit,input:image"))) { var t = b.closest(':submit'); if (t.length == 0) { return } a = t[0] } var c = this; c.clk = a; if (a.type == 'image') { if (e.offsetX != undefined) { c.clk_x = e.offsetX; c.clk_y = e.offsetY } else if (typeof $.fn.offset == 'function') { var d = b.offset(); c.clk_x = e.pageX - d.left; c.clk_y = e.pageY - d.top } else { c.clk_x = e.pageX - a.offsetLeft; c.clk_y = e.pageY - a.offsetTop } } setTimeout(function () { c.clk = c.clk_x = c.clk_y = null }, 100) }) }; $.fn.ajaxFormUnbind = function () { return this.unbind('submit.form-plugin click.form-plugin') }; $.fn.formToArray = function (b) { var a = []; if (this.length === 0) { return a } var c = this[0]; var d = b ? c.getElementsByTagName('*') : c.elements; if (!d) { return a } var i, j, n, v, el, max, jmax; for (i = 0, max = d.length; i < max; i++) { el = d[i]; n = el.name; if (!n) { continue } if (b && c.clk && el.type == "image") { if (!el.disabled && c.clk == el) { a.push({ name: n, value: $(el).val(), type: el.type }); a.push({ name: n + '.x', value: c.clk_x }, { name: n + '.y', value: c.clk_y }) } continue } v = $.fieldValue(el, true); if (v && v.constructor == Array) { for (j = 0, jmax = v.length; j < jmax; j++) { a.push({ name: n, value: v[j] }) } } else if (v !== null && typeof v != 'undefined') { a.push({ name: n, value: v, type: el.type }) } } if (!b && c.clk) { var e = $(c.clk), input = e[0]; n = input.name; if (n && !input.disabled && input.type == 'image') { a.push({ name: n, value: e.val() }); a.push({ name: n + '.x', value: c.clk_x }, { name: n + '.y', value: c.clk_y }) } } return a }; $.fn.formSerialize = function (a) { return $.param(this.formToArray(a)) }; $.fn.fieldSerialize = function (b) { var a = []; this.each(function () { var n = this.name; if (!n) { return } var v = $.fieldValue(this, b); if (v && v.constructor == Array) { for (var i = 0, max = v.length; i < max; i++) { a.push({ name: n, value: v[i] }) } } else if (v !== null && typeof v != 'undefined') { a.push({ name: this.name, value: v }) } }); return $.param(a) }; $.fn.fieldValue = function (a) { for (var b = [], i = 0, max = this.length; i < max; i++) { var c = this[i]; var v = $.fieldValue(c, a); if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) { continue } v.constructor == Array ? $.merge(b, v) : b.push(v) } return b }; $.fieldValue = function (b, c) { var n = b.name, t = b.type, tag = b.tagName.toLowerCase(); if (c === undefined) { c = true } if (c && (!n || b.disabled || t == 'reset' || t == 'button' || (t == 'checkbox' || t == 'radio') && !b.checked || (t == 'submit' || t == 'image') && b.form && b.form.clk != b || tag == 'select' && b.selectedIndex == -1)) { return null } if (tag == 'select') { var d = b.selectedIndex; if (d < 0) { return null } var a = [], ops = b.options; var e = (t == 'select-one'); var f = (e ? d + 1 : ops.length); for (var i = (e ? d : 0); i < f; i++) { var g = ops[i]; if (g.selected) { var v = g.value; if (!v) { v = (g.attributes && g.attributes['value'] && !(g.attributes['value'].specified)) ? g.text : g.value } if (e) { return v } a.push(v) } } return a } return $(b).val() }; $.fn.clearForm = function (a) { return this.each(function () { $('input,select,textarea', this).clearFields(a) }) }; $.fn.clearFields = $.fn.clearInputs = function (a) { var b = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; return this.each(function () { var t = this.type, tag = this.tagName.toLowerCase(); if (b.test(t) || tag == 'textarea' || (a && /hidden/.test(t))) { this.value = '' } else if (t == 'checkbox' || t == 'radio') { this.checked = false } else if (tag == 'select') { this.selectedIndex = -1 } }) }; $.fn.resetForm = function () { return this.each(function () { if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) { this.reset() } }) }; $.fn.enable = function (b) { if (b === undefined) { b = true } return this.each(function () { this.disabled = !b }) }; $.fn.selected = function (b) { if (b === undefined) { b = true } return this.each(function () { var t = this.type; if (t == 'checkbox' || t == 'radio') { this.checked = b } else if (this.tagName.toLowerCase() == 'option') { var a = $(this).parent('select'); if (b && a[0] && a[0].type == 'select-one') { a.find('option').selected(false) } this.selected = b } }) }; $.fn.ajaxSubmit.debug = false; function log() { if (!$.fn.ajaxSubmit.debug) return; var a = '[jquery.form] ' + Array.prototype.join.call(arguments, ''); if (window.console && window.console.log) { window.console.log(a) } else if (window.opera && window.opera.postError) { window.opera.postError(a) } } })(jQuery);
//jquery.link
(function($) { $.fn.link = function(options) { var opts = jQuery.extend({}, jQuery.fn.link.defaults, options); return this.each(function() { var $this = $(this); var o = $.meta ? $.extend({}, opts, $this.data()) : opts; var linkText = $this.text(); var link = $('<a title="' + o.title + '" href="' + o.url + '"></a>').text(linkText); $this.html(link) }) }; $.fn.link.defaults = { url: '', title: ''} })(jQuery);
//jquery.showhide
(function($) { $.fn.showHide = function(h) { var i = jQuery.extend({}, jQuery.fn.showHide.defaults, h); var j = true; return this.each(function() { var a = $(this); var o = $.meta ? $.extend({}, i, a.data()) : i; var b = (o.appliesTo.toLowerCase() == 'for') ? a.attr('for') : (o.appliesTo.toLowerCase() == 'siblings') ? a.parent().attr('id') : o.appliesTo; var c = $('<div id="' + b + '_wrapper"></div>'); var d; var e; if (o.appliesTo == 'siblings') { d = a.nextAll(); e = a.parent() } else { d = $('#' + b); e = d.parent() } c.append(d); e.append(c); if (o.display == 'first') { if (j === true) { j = false } else { c.hide() } } else if (o.display == 'none') { c.hide() } var f = a.html(); var g = $('<a class="' + o.linkClass + '" href="#">' + f + '</a>').click(function() { c.toggle(); return false }); a.html(g) }) }; $.fn.showHide.defaults = { appliesTo: 'for', linkClass: 'showhide', display: 'all' }; $.fn.fieldDisplay = function(b) { var c = jQuery.extend({}, jQuery.fn.fieldDisplay.defaults, b); return this.each(function() { var a = $(this); var o = $.meta ? $.extend({}, c, a.data()) : c; $('#' + o.controlField).click(function() { if ($('#' + o.controlField + ':checked').val()) { a.hide() } else { a.show() } }); if (!$('#' + o.controlField + ':checked').val()) { a.show() } }) }; $.fn.fieldDisplay.defaults = { controlField: ''} })(jQuery);
//jquery.tag
(function($) { var o = []; window.setGlobalTags = function(a) { o = getTags(a) }; function getTags(a) { var b, i, goodTags = []; for (i = 0; i < a.length; i++) { b = a[i]; if (typeof a[i] == 'object') { b = a[i].tag } goodTags.push(b.toLowerCase()) } return goodTags } $.fn.tagSuggest = function(l) { var n = { 'matchClass': 'tagMatches', 'tagContainer': 'span', 'childClass': '', 'tagWrap': 'span', 'sort': true, 'tags': null, 'url': null, 'delay': 0, 'separator': ' ' }; var i, tag, userTags = [], settings = $.extend({}, n, l); if (settings.tags) { userTags = getTags(settings.tags) } else { userTags = o } return this.each(function() { var d = $(this); var e = this; var f, fromTab = false; var g = false; var h = []; var j = { "position": 0, tag: "" }; var k = document.createElement(settings.tagContainer); function showSuggestionsDelayed(a, b) { if (settings.delay) { if (e.timer) clearTimeout(e.timer); e.timer = setTimeout(function() { showSuggestions(a, b) }, settings.delay) } else { showSuggestions(a, b) } } function showSuggestions(a, b) { h = a.value.split(settings.separator); f = []; var i, html = '', chosenTags = {}, tagSelected = false; j = { position: currentTags.length - 1, tag: '' }; for (i = 0; i < currentTags.length && i < h.length; i++) { if (!tagSelected && currentTags[i].toLowerCase() != h[i].toLowerCase()) { j = { position: i, tag: h[i].toLowerCase() }; tagSelected = true } chosenTags[currentTags[i].toLowerCase()] = true } if (j.tag) { if (settings.url) { $.ajax({ 'url': settings.url, 'dataType': 'json', 'data': { 'tag': j.tag }, 'async': false, 'success': function(m) { f = m } }) } else { for (i = 0; i < userTags.length; i++) { if (userTags[i].indexOf(j.tag) === 0) { f.push(userTags[i]) } } } f = $.grep(f, function(v, i) { return !chosenTags[v.toLowerCase()] }); if (settings.sort) { f = f.sort() } for (i = 0; i < f.length; i++) { html += '<' + settings.tagWrap + ' class="_tag_suggestion">' + f[i] + '</' + settings.tagWrap + '>' } k.html(html); if (settings.childClass) { k.children(settings.tagWrap).addClass(settings.childClass) } g = !!(f.length) } else { hideSuggestions() } } function hideSuggestions() { k.empty(); f = []; g = false } function setSelection() { var v = d.val(); if (v == d.attr('title') && d.is('.hint')) v = ''; currentTags = v.split(settings.separator); hideSuggestions() } function chooseTag(a) { var i, index; for (i = 0; i < currentTags.length; i++) { if (currentTags[i].toLowerCase() != h[i].toLowerCase()) { index = i; break } } if (index == h.length - 1) a = a + settings.separator; h[i] = a; d.val(h.join(settings.separator)); d.blur().focus(); setSelection() } function handleKeys(a) { fromTab = false; var b = a.type; var c = false; switch (a.keyCode) { case 37: case 38: case 39: case 40: { hideSuggestions(); return true } case 224: case 17: case 16: case 18: { return true } case 8: { if (this.value == '') { hideSuggestions(); setSelection(); return true } else { b = 'keyup'; c = true; showSuggestionsDelayed(this) } break } case 9: case 13: { if (g) { chooseTag(f[0]); fromTab = true; return false } else { return true } } case 27: { hideSuggestions(); setSelection(); return true } case 32: { setSelection(); return true } } if (b == 'keyup') { switch (a.charCode) { case 9: case 13: { return true } } if (c) { setSelection() } showSuggestionsDelayed(this, a.charCode) } } d.after(k).keypress(handleKeys).keyup(handleKeys).blur(function() { if (fromTab == true || g) { fromTab = false; d.focus() } }); k = $(k).click(function(a) { if (a.target.nodeName == settings.tagWrap.toUpperCase() && $(a.target).is('._tag_suggestion')) { chooseTag(a.target.innerHTML) } }).addClass(settings.matchClass); setSelection() }) } })(jQuery);
//jquery.ui.accordionmap
(function($) { $.fn.accordionmap = function(d) { var f = jQuery.extend({}, jQuery.fn.accordionmap.defaults, d); return this.each(function() { var b = $(this); var o = $.meta ? $.extend({}, f, b.data()) : f; var c = b.attr('id'); b.children('li').filter(function() { return $(this).children('ul').length === 0 }).append('<ul><li class="' + o.placeHolderClass + '">&nbsp;</li></ul>'); b.children('li').children('div').addClass('ui-state-default'); b.children('li').children('ul').addClass(o.parentClass).sortable({ connectWith: '.' + o.parentClass, receive: function(e, a) { $(this).children('li.' + o.placeHolderClass).remove() }, remove: function(e, a) { if ($(this).children('li').length === 0) { $(this).append('<li class="' + o.placeHolderClass + '">&nbsp;</li>') } }, update: function(e, a) { if (!a.sender && $.isFunction(o.updateChild)) { o.updateChild.call(this, e, a) } } }); b.sortable({ handle: ' > div', update: function(e, a) { if ($.isFunction(o.updateParent)) { o.updateParent.call(this, e, a) } } }) }) }; $.fn.accordionmap.defaults = { parentClass: 'sortparent', placeHolderClass: 'placeholder', updateChild: null, updateParent: null} })(jQuery);
//jquery.ui.sitemap
(function($) { $.fn.sitemap = function(k) { var l = jQuery.extend({}, jQuery.fn.sitemap.defaults, k); return this.each(function() { var g = $(this); var o = $.meta ? $.extend({}, l, g.data()) : l; var h = g.attr('id'); g.find('div').addClass(o.dropZoneParentClass + ' ui-state-default'); var i = $('#' + h + ' li'); var j = i.first().height(); i.find('div').prepend('<a class="ui-icon ' + o.collapseIconClass + '">&nbsp;</a>'); i.prepend('<div class="' + o.dropZoneClass + '"></div>'); $('#' + h + ' li:last-child').append('<div class="' + o.dropZoneAfterClass + '"></div>'); i.draggable({ handle: ' > div', opacity: 0.35, cursor: 'move', addClasses: false, helper: 'clone', zIndex: 100 }); g.find('.' + o.dropZoneParentClass + ', .' + o.dropZoneClass + ', .' + o.dropZoneAfterClass).droppable({ accept: '#' + h + ' li', tolerance: 'pointer', over: function() { var a = $(this); if (a.hasClass(o.dropZoneClass) || a.hasClass(o.dropZoneAfterClass)) { a.addClass(o.dropZoneHoverClass).height(j) } else { a.addClass('ui-state-hover') } }, out: function() { var a = $(this); if (a.hasClass(o.dropZoneClass) || a.hasClass(o.dropZoneAfterClass)) { a.removeClass(o.dropZoneHoverClass).css('height', '') } else { a.removeClass('ui-state-hover') } }, drop: function(e, a) { var b = $(this); var c = b.parent(); e.result = c.attr('id'); if (a.draggable.children('div.' + o.dropZoneAfterClass).length !== 0) { if (a.draggable.prev('li').length !== 0) { a.draggable.prev('li').append(a.draggable.children('div.' + o.dropZoneAfterClass)) } else { a.draggable.children('div').remove('.' + o.dropZoneAfterClass) } } var d = 'child'; if (b.hasClass(o.dropZoneParentClass)) { if (c.children('ul').length === 0) { var f = '<ul/>'; if (b.children('a.' + o.expandIconClass).length !== 0) { f = '<ul class="ui-helper-hidden" />' } if (c.children('div.' + o.dropZoneAfterClass).length !== 0) { c.children('div.' + o.dropZoneAfterClass).before(f) } else { c.append(f) } } else { c.children('ul').children('li').children('div').remove('.' + o.dropZoneAfterClass) } a.draggable.append('<div class="' + o.dropZoneAfterClass + '"></div>'); c.removeClass('ui-helper-hidden').children('ul').append(a.draggable) } else if (b.hasClass(o.dropZoneClass)) { d = 'prev'; c.before(a.draggable) } else { d = 'next'; c.after(a.draggable); a.draggable.append(b) } b.removeClass(o.dropZoneHoverClass).css('height', ''); if ($.isFunction(o.drop)) { e.type = d; o.drop.call(this, e, a) } } }); $('.ui-icon').css('float', 'left').live('click', function() { $(this).toggleClass(o.expandIconClass).toggleClass(o.collapseIconClass); $(this).parent().parent().find('ul').toggleClass('ui-helper-hidden'); return false }) }) }; $.fn.sitemap.defaults = { dropZoneClass: 'dropzone', dropZoneAfterClass: 'dropzoneafter', dropZoneParentClass: 'dropzoneparent', dropZoneHoverClass: 'ui-state-hover', expandIconClass: 'ui-icon-plus', collapseIconClass: 'ui-icon-minus', drop: null} })(jQuery);
//jquery.ui.modal
(function($){$.fn.modalPhoto=function(e){var f=jQuery.extend({},jQuery.fn.modalPhoto.defaults,e,sharedDefaults());return this.each(function(){var c=$(this);var o=$.meta?$.extend({},f,c.data()):f,title=(o.title.toLowerCase()=='title'&&c.attr('title'))?c.attr('title'):o.title,href=(o.href.toLowerCase()=='href'&&c.attr('href'))?c.attr('href'):o.href,oL,$loading;if(o.loading){oL=jQuery.extend({},loadingOptions(o.loadingClass));$loading=dialogElement(o.dialogLoad,o.loadingClass)}var d=dialogElement(o.dialogName);$('.ui-widget-overlay').live('click',function(){d.dialog("close")});c.click(function(){o.title=title;if(o.loading){o.open=function(){$loading.dialog('close')}}var b;if($('#'+o.img).length>0){b=$('#'+o.img)}else{b=$('<img id="'+o.img+'" />')}if(b.attr('src')==href){d.dialog('open')}else{if(o.loading){$loading.html(o.loadingText).dialog('option',oL).dialog('open')}b=$('<img id="'+o.img+'" />').attr('src',href).load(function(){d.html(b);var a=d.getHiddenDimensions(true),windowWidth=$(window).width()*0.7;if(a.width>windowWidth){b.attr('width',windowWidth);b.removeAttr('height')}d.dialog('option',o).dialog('open')})}return false})})};$.fn.modalPhoto.defaults={resizable:false,draggable:false,width:'auto',img:'mainDialogImg'};$.fn.modalForm=function(d){var e=jQuery.extend({},jQuery.fn.modalForm.defaults,d,sharedDefaults());return this.each(function(){var b=$(this);var o=$.meta?$.extend({},e,b.data()):e,title=(o.title.toLowerCase()=='title'&&b.attr('title'))?b.attr('title'):o.title,href=(o.href.toLowerCase()=='href'&&b.attr('href'))?b.attr('href'):o.href,oL,$loading;if(o.loading){oL=jQuery.extend({},loadingOptions(o.loadingClass));$loading=dialogElement(o.dialogLoad,o.loadingClass)}var c=dialogElement(o.dialogName);b.click(function(){o.title=title;if(o.loading){o.open=function(){$loading.dialog('close')}}o.buttons={};var a=$(window).width()*0.7;if(a<o.width){o.width=a}if(o.loading){$loading.html(o.loadingText).dialog('option',oL).dialog('open')}c.dialog('option',o).load(href,function(){c.dialog('open')});return false})})};$.fn.modalForm.defaults={width:400};$.fn.modalDialog=function(e){var f=jQuery.extend({},jQuery.fn.modalDialog.defaults,e,sharedDefaults());return this.each(function(){var c=$(this);var o=$.meta?$.extend({},f,c.data()):f,title=(o.title.toLowerCase()=='title'&&c.attr('title'))?c.attr('title'):o.title,content=(o.content.toLowerCase()=='title'&&c.attr('title'))?c.attr('title'):o.content,callback=o.callback,href=c.attr('href');if(callback!==null&&callback.toLowerCase()=='href'){callback=href;c.attr('href','#')}var d=dialogElement(o.dialogName);c.click(function(){var a={};if(callback!==null){a[o.cancelButton]=function(){$(this).dialog('close')};a[o.okButton]=function(){eval(callback);$(this).dialog('close')}}else{a[o.okButton]=function(){$(this).dialog('close')}}var b={title:title,buttons:a};if(content.toLowerCase()=='href'){d.dialog('option',b).load(href,{},function(){$(this).dialog('open')})}else{d.dialog('option',b).html(content).dialog('open')}return false})})};$.fn.modalDialog.defaults={content:'',callback:null,okButton:'OK',cancelButton:'Cancel'};$.fn.getHiddenDimensions=function(c){var d=this,props={position:'absolute',visibility:'hidden',display:'block'},dim={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},$hiddenParents=d.parents().andSelf().not(':visible'),c=(c==null)?false:c;var e=[];$hiddenParents.each(function(){var a={};for(var b in props){a[b]=this.style[b];this.style[b]=props[b]}e.push(a)});dim.width=d.width();dim.outerWidth=d.outerWidth(c);dim.innerWidth=d.innerWidth();dim.height=d.height();dim.innerHeight=d.innerHeight();dim.outerHeight=d.outerHeight(c);$hiddenParents.each(function(i){var a=e[i];for(var b in props){this.style[b]=a[b]}});return dim};function sharedDefaults(){return{dialogLoad:'mainLoading',dialogName:'mainDialog',title:'title',href:'href',modal:true,loading:true,loadingText:'Loading...',loadingClass:'loadingScreen'}};function loadingOptions(a){return{dialogClass:a,closeOnEscape:false,draggable:false,width:460,minHeight:50,buttons:{},resizable:false}};function dialogElement(a,b){var c;if($('#'+a).length>0){c=$('#'+a)}else{c=$('<div id="'+a+'" style="display: none;" />');if(b){c.addClass(b)}c.appendTo('body').dialog({autoOpen:false})}return c}})(jQuery);
//jquery.functions
(function($) { var e = { navType: 0, navUrl: '', navEl: 'navcontent', msgUrl: '', msgDisplay: false, msgEl: 'messagecontent', notifyEl: 'notification' }; $.Exedra = { setDefaults: function(a) { $.extend(e, a) }, loadNav: function() { $('#' + e.navEl).load(e.navUrl, {}, function() { $.Exedra.configureNav() }) }, configureNav: function() { $('#' + e.navEl + ' a.modalform').modalForm(); $('#' + e.navEl + ' a.dataform').modalForm({ width: 500 }); switch (e.navType) { case '0': $('#' + e.navEl + ' > div').addClass('ui-widget-content ui-corner-all'); break; case '1': $('#' + e.navEl).accordion('destroy').accordion({ header: '.head', navigation: true }); break; case '2': var a = $('#' + e.navEl + ' > div'); a.addClass('ui-widget-content ui-corner-all').children('ul').menutree({ navigation: true }); break } $.Exedra.loadMessage(0) }, loadMessage: function(b) { if (e.msgDisplay) { var c = e.msgUrl + '?lastid=' + b; $.getJSON(c, function(a) { messageResponse(a) }) } }, ajaxDelete: function(b, c, d) { $.getJSON(b, function(a) { if (typeof (a.success) != 'undefined') { if (a.success == 'True') { $('#' + c).remove(); d() } else { $('#' + e.notifyEl).jGrowl('Delete failed - ' + a.msg, { themeState: 'error' }) } } else { $('#' + e.notifyEl).jGrowl('Delete failed - undefined', { themeState: 'error' }) } }) }, ajaxSort: function(b, c) { $.getJSON(b, function(a) { if (typeof (a.success) != 'undefined') { if (a.success == 'True') { c() } else { $('#' + e.notifyEl).jGrowl('Sort failed - ' + a.msg, { themeState: 'error' }) } } else { $('#' + e.notifyEl).jGrowl('Sort failed - undefined', { themeState: 'error' }) } }) } }; function messageResponse(a) { if (typeof (a.success) != 'undefined') { if (a.success == 'true') { var b = parseInt(a.duration, 10); var c = parseInt(a.currentid, 10); $('#' + e.msgEl).html(a.message).fadeIn('slow').animate({ opacity: 1.0 }, b).fadeOut('slow', function() { $.Exedra.loadMessage(c) }) } } return } })(jQuery);
//jquery.menutree
(function ($) { $.fn.menutree = function (e) { var f = jQuery.extend({}, jQuery.fn.menutree.defaults, e); return this.each(function () { var a = $(this); var o = $.meta ? $.extend({}, f, a.data()) : f; var b = a.find('li').filter(function () { return $(this).children('ul').length !== 0 }); a.find('li').filter(function () { return $(this).children('ul').length === 0 }).prepend('<span class="ui-icon ui-icon-triangle-1-e">&nbsp;</span>').css('float', 'left'); b.prepend('<a class="ui-icon ' + o.expandIconClass + '">&nbsp;</a>'); b.find('ul').addClass('ui-helper-hidden'); a.find('span.ui-icon').css('float', 'left'); a.find('a.ui-icon').css('float', 'left').live('click', function () { $(this).toggleClass(o.expandIconClass).toggleClass(o.collapseIconClass); $(this).siblings('ul').toggleClass('ui-helper-hidden'); return false }); if (o.navigation) { var c = $(this).find("a").filter(o.navigationFilter); if (c.length) { var d = c.closest('ul'); while (d.length) { if (d.hasClass('ui-helper-hidden')) { d.siblings('a.ui-icon').toggleClass(o.expandIconClass).toggleClass(o.collapseIconClass); d.toggleClass('ui-helper-hidden') } d = d.parent().closest('ul') } } } }) }; $.fn.menutree.defaults = { expandIconClass: 'ui-icon-plus', collapseIconClass: 'ui-icon-minus', navigation: false, navigationFilter: function () { return this.href.toLowerCase() == location.href.toLowerCase() } } })(jQuery);
//jquery.jgrowl
(function ($) { $.jGrowl = function (m, o) { if ($('#jGrowl').size() == 0) $('<div id="jGrowl"></div>').addClass((o && o.position) ? o.position : $.jGrowl.defaults.position).appendTo('body'); $('#jGrowl').jGrowl(m, o) }; $.fn.jGrowl = function (m, o) { if ($.isFunction(this.each)) { var b = arguments; return this.each(function () { var a = this; if ($(this).data('jGrowl.instance') == undefined) { $(this).data('jGrowl.instance', $.extend(new $.fn.jGrowl(), { notifications: [], element: null, interval: null })); $(this).data('jGrowl.instance').startup(this) } if ($.isFunction($(this).data('jGrowl.instance')[m])) { $(this).data('jGrowl.instance')[m].apply($(this).data('jGrowl.instance'), $.makeArray(b).slice(1)) } else { $(this).data('jGrowl.instance').create(m, o) } }) } }; $.extend($.fn.jGrowl.prototype, { defaults: { pool: 0, header: '', group: '', sticky: false, position: 'top-right', glue: 'after', theme: 'default', themeState: 'highlight', corners: '10px', check: 250, life: 3000, closeDuration: 'normal', openDuration: 'normal', easing: 'swing', closer: true, closeTemplate: '&times;', closerTemplate: '<div>[ close all ]</div>', log: function (e, m, o) { }, beforeOpen: function (e, m, o) { }, afterOpen: function (e, m, o) { }, open: function (e, m, o) { }, beforeClose: function (e, m, o) { }, close: function (e, m, o) { }, animateOpen: { opacity: 'show' }, animateClose: { opacity: 'hide'} }, notifications: [], element: null, interval: null, create: function (a, o) { var o = $.extend({}, this.defaults, o); if (typeof o.speed !== 'undefined') { o.openDuration = o.speed; o.closeDuration = o.speed } this.notifications.push({ message: a, options: o }); o.log.apply(this.element, [this.element, a, o]) }, render: function (a) { var b = this; var c = a.message; var o = a.options; o.themeState = (o.themeState == '') ? '' : 'ui-state-' + o.themeState; var a = $('<div class="jGrowl-notification ' + o.themeState + ' ui-corner-all' + ((o.group != undefined && o.group != '') ? ' ' + o.group : '') + '">' + '<div class="jGrowl-close">' + o.closeTemplate + '</div>' + '<div class="jGrowl-header">' + o.header + '</div>' + '<div class="jGrowl-message">' + c + '</div></div>').data("jGrowl", o).addClass(o.theme).children('div.jGrowl-close').bind("click.jGrowl", function () { $(this).parent().trigger('jGrowl.close') }).parent(); $(a).bind("mouseover.jGrowl", function () { $('div.jGrowl-notification', b.element).data("jGrowl.pause", true) }).bind("mouseout.jGrowl", function () { $('div.jGrowl-notification', b.element).data("jGrowl.pause", false) }).bind('jGrowl.beforeOpen', function () { if (o.beforeOpen.apply(a, [a, c, o, b.element]) != false) { $(this).trigger('jGrowl.open') } }).bind('jGrowl.open', function () { if (o.open.apply(a, [a, c, o, b.element]) != false) { if (o.glue == 'after') { $('div.jGrowl-notification:last', b.element).after(a) } else { $('div.jGrowl-notification:first', b.element).before(a) } $(this).animate(o.animateOpen, o.openDuration, o.easing, function () { if ($.browser.msie && (parseInt($(this).css('opacity'), 10) === 1 || parseInt($(this).css('opacity'), 10) === 0)) this.style.removeAttribute('filter'); if ($(this).data("jGrowl") != null) $(this).data("jGrowl").created = new Date(); $(this).trigger('jGrowl.afterOpen') }) } }).bind('jGrowl.afterOpen', function () { o.afterOpen.apply(a, [a, c, o, b.element]) }).bind('jGrowl.beforeClose', function () { if (o.beforeClose.apply(a, [a, c, o, b.element]) != false) $(this).trigger('jGrowl.close') }).bind('jGrowl.close', function () { $(this).data('jGrowl.pause', true); $(this).animate(o.animateClose, o.closeDuration, o.easing, function () { if ($.isFunction(o.close)) { if (o.close.apply(a, [a, c, o, b.element]) !== false) $(this).remove() } else { $(this).remove() } }) }).trigger('jGrowl.beforeOpen'); if (o.corners != '' && $.fn.corner != undefined) $(a).corner(o.corners); if ($('div.jGrowl-notification:parent', b.element).size() > 1 && $('div.jGrowl-closer', b.element).size() == 0 && this.defaults.closer != false) { $(this.defaults.closerTemplate).addClass('jGrowl-closer ' + this.defaults.themeState + ' ui-corner-all').addClass(this.defaults.theme).appendTo(b.element).animate(this.defaults.animateOpen, this.defaults.speed, this.defaults.easing).bind("click.jGrowl", function () { $(this).siblings().trigger("jGrowl.beforeClose"); if ($.isFunction(b.defaults.closer)) { b.defaults.closer.apply($(this).parent()[0], [$(this).parent()[0]]) } }) } }, update: function () { $(this.element).find('div.jGrowl-notification:parent').each(function () { if ($(this).data("jGrowl") != undefined && $(this).data("jGrowl").created != undefined && ($(this).data("jGrowl").created.getTime() + parseInt($(this).data("jGrowl").life)) < (new Date()).getTime() && $(this).data("jGrowl").sticky != true && ($(this).data("jGrowl.pause") == undefined || $(this).data("jGrowl.pause") != true)) { $(this).trigger('jGrowl.beforeClose') } }); if (this.notifications.length > 0 && (this.defaults.pool == 0 || $(this.element).find('div.jGrowl-notification:parent').size() < this.defaults.pool)) this.render(this.notifications.shift()); if ($(this.element).find('div.jGrowl-notification:parent').size() < 2) { $(this.element).find('div.jGrowl-closer').animate(this.defaults.animateClose, this.defaults.speed, this.defaults.easing, function () { $(this).remove() }) } }, startup: function (e) { this.element = $(e).addClass('jGrowl').append('<div class="jGrowl-notification"></div>'); this.interval = setInterval(function () { $(e).data('jGrowl.instance').update() }, parseInt(this.defaults.check)); if ($.browser.msie && parseInt($.browser.version) < 7 && !window["XMLHttpRequest"]) { $(this.element).addClass('ie6') } }, shutdown: function () { $(this.element).removeClass('jGrowl').find('div.jGrowl-notification').remove(); clearInterval(this.interval) }, close: function () { $(this.element).find('div.jGrowl-notification').each(function () { $(this).trigger('jGrowl.beforeClose') }) } }); $.jGrowl.defaults = $.fn.jGrowl.prototype.defaults })(jQuery);
