diff --git a/data/javascript/jquery.flexbox.js b/data/javascript/jquery.flexbox.js
deleted file mode 100644
index a8c242709..000000000
--- a/data/javascript/jquery.flexbox.js
+++ /dev/null
@@ -1,859 +0,0 @@
-/*!
-* jQuery FlexBox $Version: 0.9.6 $
-*
-* Copyright (c) 2008-2010 Noah Heldman and Fairway Technologies (http://www.fairwaytech.com/flexbox)
-* Licensed under Ms-PL (http://www.codeplex.com/flexbox/license)
-*
-* $Date: 2010-11-24 01:02:00 PM $
-* $Rev: 0.9.6.1 $
-*/
-(function($) {
- $.flexbox = function(div, o) {
-
- // TODO: in straight type-ahead mode (showResults: false), if noMatchingResults, dropdown appears after new match
- // TODO: consider having options.mode (select, which replaces html select; combobox; suggest; others?)
- // TODO: on resize (at least when wrapping within a table), the arrow is pushed down to the next line
- // TODO: check for boundary/value problems (such as minChars of -1) and alert them
- // TODO: add options for advanced paging template
- // TODO: general cleanup and refactoring, commenting
- // TODO: detailed Exception handling, logging
- // TODO: FF2, up arrow from bottom has erratic scroll behavior (if multiple flexboxes on page)
- // TODO: FF2 (and maybe IE7): if maxVisibleRows == number of returned rows, height is a bit off (maybe set to auto?)
- // TODO: escape key only works from input box (this might be okay)
- // TODO: make .getJSON parameters (object and callback function) configurable (e.g. when calling yahoo image search)
- // TODO: escape key reverts to previous value (FF only?) (is this a good thing?)
-
- // TEST: highlightMatches uses the case of whatever you typed in to replace the match string, which can look funny
- // TEST: handle pageDown and pageUp keys when scrolling through results
- // TEST: allow client-side paging (return all data initially, set paging:{pageSize:#}, and ensure maxCacheBytes is > 0)
- // TEST: accept json object as first parameter to flexbox instead of page source, and have it work like a combobox
- // TEST: implement no results template
- // TEST: implement noResultsText and class
- // TEST: watermark color should be configurable (and so should default input color)
- // TEST: exception handling and alerts for common mistakes
- // TEST: first example should use defaults ONLY
- // TEST: add property initialValue, so you can set it when the flexbox loads
- // TEST: handle hidden input value for form submissions
- // TEST: how can we allow programmatically setting the field value (and therefore hidden value). add jquery function?
- // TEST: use pageSize parameter as threshold to switch from no paging to paging based on results
- // TEST: if you type in an input value that matches the html, it might display html code (try typing "class" in the input box)
- // TEST: don't require all paging subprops (let default override)
- // TEST: when tabbing from one ffb to another, the previous ffb results flash...
- // TEST: IE7: when two non-paging ffbs right after each other, with only a clear-both div between them, the bottom ffb jumps down when selecting a value, then jumps back up on mouseover
- // TEST: FF2, make sure we scroll to top before showing results (maxVisibleRows only)
- // TEST: if maxVisibleRows is hiding the value the user types in to the input, scroll to that value (is this even possible?)
- // TEST: make sure caching supports multiple ffbs uniquely
- // TEST: when entering a number in the paging input box, the results are displayed twice
-
- var timeout = false, // hold timeout ID for suggestion results to appear
- cache = [], // simple array with cacheData key values, MRU is the first element
- cacheData = [], // associative array holding actual cached data
- cacheSize = 0, // size of cache in bytes (cache up to o.maxCacheBytes bytes)
- delim = '\u25CA', // use an obscure unicode character (lozenge) as the cache key delimiter
- scrolling = false,
- pageSize = o.paging && o.paging.pageSize ? o.paging.pageSize : 0,
- retrievingRemoteData = false,
- $div = $(div).css('position', 'relative').css('z-index', 0);
-
- // The hiddenField MUST be appended to the div before the input, or IE7 does not shift the dropdown below the input field (it overlaps)
- var $hdn = $(' ')
- .attr('id', $div.attr('id') + '_hidden')
- .attr('name', $div.attr('id'))
- .val(o.initialId)
- .appendTo($div);
- var $input = $(' ')
- .attr('id', $div.attr('id') + '_input')
- .attr('autocomplete', 'off')
- .addClass(o.inputClass)
- .css('width', o.width + 'px')
- .appendTo($div)
- .click(function(e) {
- if (o.watermark !== '' && this.value === o.watermark)
- this.value = '';
- else
- this.select();
- })
- .focus(function(e) {
- $(this).removeClass('watermark');
- })
- .blur(function(e) {
- if (this.value === '') $hdn.val('');
- setTimeout(function() { if (!$input.data('active')) hideResults(); }, 200);
- })
- .keydown(processKeyDown);
-
- if (o.initialValue !== '')
- $input.val(o.initialValue).removeClass('watermark');
- else
- $input.val(o.watermark).addClass('watermark');
-
- var arrowWidth = 0;
- if (o.showArrow && o.showResults) {
- var arrowClick = function() {
- if ($ctr.is(':visible')) {
- hideResults();
- }
- else {
- $input.focus();
- if (o.watermark !== '' && $input.val() === o.watermark)
- $input.val('');
- else
- $input.select();
- if (timeout)
- clearTimeout(timeout);
- timeout = setTimeout(function() { flexbox(1, true, o.arrowQuery); }, o.queryDelay);
- }
- };
- var $arrow = $(' ')
- .attr('id', $div.attr('id') + '_arrow')
- .addClass(o.arrowClass)
- .addClass('out')
- .hover(function() {
- $(this).removeClass('out').addClass('over');
- }, function() {
- $(this).removeClass('over').addClass('out');
- })
- .mousedown(function() {
- $(this).removeClass('over').addClass('active');
- })
- .mouseup(function() {
- $(this).removeClass('active').addClass('over');
- })
- .click(arrowClick)
- .appendTo($div);
- arrowWidth = $arrow.width();
- $input.css('width', (o.width - arrowWidth) + 'px');
- }
- if (!o.allowInput) { o.selectFirstMatch = false; $input.click(arrowClick); } // simulate behavior
-
- // Handle presence of CSS Universal Selector (*) that defines padding by verifying what the browser thinks the outerHeight is.
- // In FF, the outerHeight() will not pick up the correct input field padding
- var inputPad = $input.outerHeight() - $input.height() - 2;
- var inputWidth = $input.outerWidth() - 2;
- var top = $input.outerHeight();
-
- if (inputPad === 0) {
- inputWidth += 4;
- top += 4;
- }
- else if (inputPad !== 4) {
- inputWidth += inputPad;
- top += inputPad;
- }
-
- var $ctr = $('
')
- .attr('id', $div.attr('id') + '_ctr')
- .css('width', inputWidth + arrowWidth)
- .css('top', top)
- .css('left', 0)
- .addClass(o.containerClass)
- .appendTo($div)
- .mousedown(function(e) {
- $input.data('active', true);
- })
- .hide();
-
- var $content = $('
')
- .addClass(o.contentClass)
- .appendTo($ctr)
- .scroll(function() {
- scrolling = true;
- });
-
- var $paging = $('
').appendTo($ctr);
- $div.css('height', $input.outerHeight());
-
- function processKeyDown(e) {
- // handle modifiers
- var mod = 0;
- if (typeof (e.ctrlKey) !== 'undefined') {
- if (e.ctrlKey) mod |= 1;
- if (e.shiftKey) mod |= 2;
- } else {
- if (e.modifiers & Event.CONTROL_MASK) mod |= 1;
- if (e.modifiers & Event.SHIFT_MASK) mod |= 2;
- }
- // if the keyCode is one of the modifiers, bail out (we'll catch it on the next keypress)
- if (/16$|17$/.test(e.keyCode)) return; // 16 = Shift, 17 = Ctrl
-
- var tab = e.keyCode === 9, esc = e.keyCode === 27;
- var tabWithModifiers = e.keyCode === 9 && mod > 0;
- var backspace = e.keyCode === 8; // we will end up extending the delay time for backspaces...
-
- // tab is a special case, since we want to bubble events...
- if (tab) if (getCurr()) selectCurr();
-
- // handling up/down/escape/right arrow/left arrow requires results to be visible
- // handling enter requires that AND a result to be selected
- if ((/27$|38$|33$|34$/.test(e.keyCode) && $ctr.is(':visible')) ||
- (/13$|40$/.test(e.keyCode)) || !o.allowInput) {
-
- if (e.preventDefault) e.preventDefault();
- if (e.stopPropagation) e.stopPropagation();
-
- e.cancelBubble = true;
- e.returnValue = false;
-
- switch (e.keyCode) {
- case 38: // up arrow
- prevResult();
- break;
- case 40: // down arrow
- if ($ctr.is(':visible')) nextResult();
- else flexboxDelay(true);
- break;
- case 13: // enter
- if (getCurr()) selectCurr();
- else flexboxDelay(true);
- break;
- case 27: // escape
- hideResults();
- break;
- case 34: // page down
- if (!retrievingRemoteData) {
- if (o.paging) $('#' + $div.attr('id') + 'n').click();
- else nextPage();
- }
- break;
- case 33: // page up
- if (!retrievingRemoteData) {
- if (o.paging) $('#' + $div.attr('id') + 'p').click();
- else prevPage();
- }
- break;
- default:
- if (!o.allowInput) { return; }
- }
- } else if (!esc && !tab && !tabWithModifiers) { // skip esc and tab key and any modifiers
- flexboxDelay(false, backspace);
- }
- }
-
- function flexboxDelay(simulateArrowClick, increaseDelay) {
- if (timeout) clearTimeout(timeout);
- var delay = increaseDelay ? o.queryDelay * 5 : o.queryDelay;
- timeout = setTimeout(function() { flexbox(1, simulateArrowClick, ''); }, delay);
- }
-
- function flexbox(p, arrowOrPagingClicked, prevQuery) {
- if (arrowOrPagingClicked) prevQuery = '';
- var q = prevQuery && prevQuery.length > 0 ? prevQuery : $.trim($input.val());
-
- if (q.length >= o.minChars || arrowOrPagingClicked) {
- // If we are getting data from the server, set the height of the content box so it doesn't shrink when navigating between pages, due to the $content.html('') below...
- if ($content.outerHeight() > 0)
- $content.css('height', $content.outerHeight());
- $content.html('').attr('scrollTop', 0);
-
- var cached = checkCache(q, p);
- if (cached) {
- $content.css('height', 'auto');
- displayItems(cached.data, q);
- showPaging(p, cached.t);
- }
- else {
- var params = { q: q, p: p, s: pageSize, contentType: 'application/json; charset=utf-8' };
- var callback = function(data, overrideQuery) {
- if (overrideQuery === true) q = overrideQuery; // must compare to boolean because by default, the string value "success" is passed when the jQuery $.getJSON method's callback is called
- var totalResults = parseInt(data[o.totalProperty]);
-
- // Handle client-side paging, if any paging configuration options were specified
- if (isNaN(totalResults) && o.paging) {
- if (o.maxCacheBytes <= 0) alert('The "maxCacheBytes" configuration option must be greater\nthan zero when implementing client-side paging.');
- totalResults = data[o.resultsProperty].length;
-
- var pages = totalResults / pageSize;
- if (totalResults % pageSize > 0) pages = parseInt(++pages);
-
- for (var i = 1; i <= pages; i++) {
- var pageData = {};
- pageData[o.totalProperty] = totalResults;
- pageData[o.resultsProperty] = data[o.resultsProperty].splice(0, pageSize);
- if (i === 1) totalSize = displayItems(pageData, q);
- updateCache(q, i, pageSize, totalResults, pageData, totalSize);
- }
- }
- else {
- var totalSize = displayItems(data, q);
- updateCache(q, p, pageSize, totalResults, data, totalSize);
- }
- showPaging(p, totalResults);
- $content.css('height', 'auto');
- retrievingRemoteData = false;
- };
- if (typeof (o.source) === 'object') {
- if (o.allowInput) callback(filter(o.source, params));
- else callback(o.source);
- }
- else {
- retrievingRemoteData = true;
- if (o.method.toUpperCase() == 'POST') $.post(o.source, params, callback, 'json');
- else $.getJSON(o.source, params, callback);
- }
- }
- } else
- hideResults();
- }
-
- function filter(data, params) {
- var filtered = {};
- filtered[o.resultsProperty] = [];
- filtered[o.totalProperty] = 0;
- var index = 0;
-
- for (var i=0; i < data[o.resultsProperty].length; i++) {
- var indexOfMatch = data[o.resultsProperty][i][o.displayValue].toLowerCase().indexOf(params.q.toLowerCase());
- if ((o.matchAny && indexOfMatch !== -1) || (!o.matchAny && indexOfMatch === 0)) {
- filtered[o.resultsProperty][index++] = data[o.resultsProperty][i];
- filtered[o.totalProperty] += 1;
- }
- }
- if (o.paging) {
- var start = (params.p - 1) * params.s;
- var howMany = (start + params.s) > filtered[o.totalProperty] ? filtered[o.totalProperty] - start : params.s;
- filtered[o.resultsProperty] = filtered[o.resultsProperty].splice(start, howMany);
- }
- return filtered;
- }
-
- function showPaging(p, totalResults) {
- $paging.html('').removeClass(o.paging.cssClass); // clear out for threshold scenarios
- if (o.showResults && o.paging && totalResults > pageSize) {
- var pages = totalResults / pageSize;
- if (totalResults % pageSize > 0) pages = parseInt(++pages);
- outputPagingLinks(pages, p, totalResults);
- }
- }
-
- function handleKeyPress(e, page, totalPages) {
- if (/^13$|^39$|^37$/.test(e.keyCode)) {
- if (e.preventDefault)
- e.preventDefault();
- if (e.stopPropagation)
- e.stopPropagation();
-
- e.cancelBubble = true;
- e.returnValue = false;
-
- switch (e.keyCode) {
- case 13: // Enter
- if (/^\d+$/.test(page) && page > 0 && page <= totalPages)
- flexbox(page, true);
- else
- alert('Please enter a page number between 1 and ' + totalPages);
- // TODO: make this alert a function call, and a customizable parameter
- break;
- case 39: // right arrow
- $('#' + $div.attr('id') + 'n').click();
- break;
- case 37: // left arrow
- $('#' + $div.attr('id') + 'p').click();
- break;
- }
- }
- }
-
- function handlePagingClick(e) {
- flexbox(parseInt($(this).attr('page')), true, $input.attr('pq')); // pq == previous query
- return false;
- }
-
- function outputPagingLinks(totalPages, currentPage, totalResults) {
- // TODO: make these configurable images
- var first = '<<',
- prev = '<',
- next = '>',
- last = '>>',
- more = '...';
-
- $paging.addClass(o.paging.cssClass);
-
- // set up our base page link element
- var $link = $(' ')
- .attr('href', '#')
- .addClass('page')
- .click(handlePagingClick),
- $span = $(' ').addClass('page'),
- divId = $div.attr('id');
-
- // show first page
- if (currentPage > 1) {
- $link.clone(true).attr('id', divId + 'f').attr('page', 1).html(first).appendTo($paging);
- $link.clone(true).attr('id', divId + 'p').attr('page', currentPage - 1).html(prev).appendTo($paging);
- }
- else {
- $span.clone(true).html(first).appendTo($paging);
- $span.clone(true).html(prev).appendTo($paging);
- }
-
- if (o.paging.style === 'links') {
- var maxPageLinks = o.paging.maxPageLinks;
- // show page numbers
- if (totalPages <= maxPageLinks) {
- for (var i = 1; i <= totalPages; i++) {
- if (i === currentPage) {
- $span.clone(true).html(currentPage).appendTo($paging);
- }
- else {
- $link.clone(true).attr('page', i).html(i).appendTo($paging);
- }
- }
- }
- else {
- if ((currentPage + parseInt(maxPageLinks / 2)) > totalPages) {
- startPage = totalPages - maxPageLinks + 1;
- }
- else {
- startPage = currentPage - parseInt(maxPageLinks / 2);
- }
-
- if (startPage > 1) {
- $link.clone(true).attr('page', startPage - 1).html(more).appendTo($paging);
- }
- else {
- startPage = 1;
- }
-
- for (var i = startPage; i < startPage + maxPageLinks; i++) {
- if (i === currentPage) {
- $span.clone(true).html(i).appendTo($paging);
- }
- else {
- $link.clone(true).attr('page', i).html(i).appendTo($paging);
- }
- }
-
- if (totalPages > (startPage + maxPageLinks)) {
- $link.clone(true).attr('page', i).html(more).appendTo($paging);
- }
- }
- }
- else if (o.paging.style === 'input') {
- var $pagingBox = $(' ')
- .addClass('box')
- .click(function(e) {
- this.select();
- })
- .keypress(function(e) {
- return handleKeyPress(e, this.value, totalPages);
- })
- .val(currentPage)
- .appendTo($paging);
- }
-
- if (currentPage < totalPages) {
- $link.clone(true).attr('id', divId + 'n').attr('page', +currentPage + 1).html(next).appendTo($paging);
- $link.clone(true).attr('id', divId + 'l').attr('page', totalPages).html(last).appendTo($paging);
- }
- else {
- $span.clone(true).html(next).appendTo($paging);
- $span.clone(true).html(last).appendTo($paging);
- }
- var startingResult = (currentPage - 1) * pageSize + 1;
- var endingResult = (startingResult > (totalResults - pageSize)) ? totalResults : startingResult + pageSize - 1;
-
- if (o.paging.showSummary) {
- var summaryData = {
- "start": startingResult,
- "end": endingResult,
- "total": totalResults,
- "page": currentPage,
- "pages": totalPages
- };
- var html = o.paging.summaryTemplate.applyTemplate(summaryData);
- $(' ').appendTo($paging);
- $(' ')
- .addClass(o.paging.summaryClass)
- .html(html)
- .appendTo($paging);
- }
- }
-
- function checkCache(q, p) {
- var key = q + delim + p; // use null character as delimiter
- if (cacheData[key]) {
- for (var i = 0; i < cache.length; i++) { // TODO: is it possible to not loop here?
- if (cache[i] === key) {
- // pull out the matching element (splice), and add it to the beginning of the array (unshift)
- cache.unshift(cache.splice(i, 1)[0]);
- return cacheData[key];
- }
- }
- }
- return false;
- }
-
- function updateCache(q, p, s, t, data, size) {
- if (o.maxCacheBytes > 0) {
- while (cache.length && (cacheSize + size > o.maxCacheBytes)) {
- var cached = cache.pop();
- cacheSize -= cached.size;
- }
- var key = q + delim + p; // use null character as delimiter
- cacheData[key] = {
- q: q,
- p: p,
- s: s,
- t: t,
- size: size,
- data: data
- }; // add the data to the cache at the hash key location
- cache.push(key); // add the key to the MRU list
- cacheSize += size;
- }
- }
-
- function displayItems(d, q) {
- var totalSize = 0, itemCount = 0;
-
- if (!d)
- return;
-
- $hdn.val($input.val());
- if (parseInt(d[o.totalProperty]) === 0 && o.noResultsText && o.noResultsText.length > 0) {
- $content.addClass(o.noResultsClass).html(o.noResultsText);
- $ctr.show();
- return;
- } else $content.removeClass(o.noResultsClass);
-
- for (var i = 0; i < d[o.resultsProperty].length; i++) {
- var data = d[o.resultsProperty][i],
- result = o.resultTemplate.applyTemplate(data),
- exactMatch = q === result,
- selectedMatch = false,
- hasHtmlTags = false,
- match = data[o.displayValue];
-
- if (!exactMatch && o.highlightMatches && q !== '') {
- var pattern = q,
- highlightStart = match.toLowerCase().indexOf(q.toLowerCase()),
- replaceString = '' + match.substr(highlightStart,q.length) + ' ';
- if (result.match('<(.|\n)*?>')) { // see if the content contains html tags
- hasHtmlTags = true;
- pattern = '(>)([^<]*?)(' + q + ')((.|\n)*?)(<)'; // TODO: look for a better way
- replaceString = '$1$2$3 $4$6';
- }
- result = result.replace(new RegExp(pattern.replace("[", "\\["), o.highlightMatchesRegExModifier), replaceString);
- }
-
- // write the value of the first match to the input box, and select the remainder,
- // but only if autoCompleteFirstMatch is set, and there are no html tags in the response
- if (o.autoCompleteFirstMatch && !hasHtmlTags && i === 0) {
- if (q.length > 0 && match.toLowerCase().indexOf(q.toLowerCase()) === 0) {
- $input.attr('pq', q); // pq == previous query
- $hdn.val(data[o.hiddenValue]);
- $input.val(data[o.displayValue]);
- selectedMatch = selectRange(q.length, $input.val().length);
- }
- }
-
- if (!o.showResults) return;
-
- $row = $('
')
- .attr('id', data[o.hiddenValue])
- .attr('val', data[o.displayValue])
- .addClass('row')
- .html(result)
- .appendTo($content);
-
- if (exactMatch || (++itemCount == 1 && o.selectFirstMatch) || selectedMatch) {
- $row.addClass(o.selectClass);
- }
- totalSize += result.length;
- }
-
- if (totalSize === 0) {
- hideResults();
- return;
- }
-
- $ctr.parent().css('z-index', 11000);
- $ctr.show();
-
- $content
- .children('div')
- .mouseover(function() {
- $content.children('div').removeClass(o.selectClass);
- $(this).addClass(o.selectClass);
- })
- .mouseup(function(e) {
- e.preventDefault();
- e.stopPropagation();
- selectCurr();
- });
-
- if (o.maxVisibleRows > 0) {
- var maxHeight = $row.outerHeight() * o.maxVisibleRows;
- $content.css('max-height', maxHeight);
- }
-
- return totalSize;
- }
-
- function selectRange(s, l) {
- var tb = $input[0];
- if (tb.createTextRange) {
- var r = tb.createTextRange();
- r.moveStart('character', s);
- r.moveEnd('character', l - tb.value.length);
- r.select();
- } else if (tb.setSelectionRange) {
- tb.setSelectionRange(s, l);
- }
- tb.focus();
- return true;
- }
-
- String.prototype.applyTemplate = function(d) {
- try {
- if (d === '') return this;
- return this.replace(/{([^{}]*)}/g,
- function(a, b) {
- var r;
- if (b.indexOf('.') !== -1) { // handle dot notation in {}, such as {Thumbnail.Url}
- var ary = b.split('.');
- var obj = d;
- for (var i = 0; i < ary.length; i++)
- obj = obj[ary[i]];
- r = obj;
- }
- else
- r = d[b];
- if (typeof r === 'string' || typeof r === 'number') return r; else throw (a);
- }
- );
- } catch (ex) {
- alert('Invalid JSON property ' + ex + ' found when trying to apply resultTemplate or paging.summaryTemplate.\nPlease check your spelling and try again.');
- }
- };
-
- function hideResults() {
- $input.data('active', false); // for input blur
- $div.css('z-index', 0);
- $ctr.hide();
- }
-
- function getCurr() {
- if (!$ctr.is(':visible'))
- return false;
-
- var $curr = $content.children('div.' + o.selectClass);
-
- if (!$curr.length)
- $curr = false;
-
- return $curr;
- }
-
- function selectCurr() {
- $curr = getCurr();
-
- if ($curr) {
- $hdn.val($curr.attr('id'));
- $input.val($curr.attr('val')).focus();
- hideResults();
-
- if (o.onSelect) {
- o.onSelect.apply($input[0]);
- }
- }
- }
-
- function supportsGetBoxObjectFor() {
- try {
- document.getBoxObjectFor(document.body);
- return true;
- }
- catch (e) {
- return false;
- }
- }
-
- function supportsGetBoundingClientRect() {
- try {
- document.body.getBoundingClientRect();
- return true;
- }
- catch (e) {
- return false;
- }
- }
-
- function nextPage() {
- $curr = getCurr();
-
- if ($curr && $curr.next().length > 0) {
- $curr.removeClass(o.selectClass);
-
- for (var i = 0; i < o.maxVisibleRows; i++) {
- if ($curr.next().length > 0) {
- $curr = $curr.next();
- }
- }
-
- $curr.addClass(o.selectClass);
- var scrollPos = $content.attr('scrollTop');
- $content.attr('scrollTop', scrollPos + $content.height());
- }
- else if (!$curr)
- $content.children('div:first-child').addClass(o.selectClass);
- }
-
- function prevPage() {
- $curr = getCurr();
-
- if ($curr && $curr.prev().length > 0) {
- $curr.removeClass(o.selectClass);
-
- for (var i = 0; i < o.maxVisibleRows; i++) {
- if ($curr.prev().length > 0) {
- $curr = $curr.prev();
- }
- }
-
- $curr.addClass(o.selectClass);
- var scrollPos = $content.attr('scrollTop');
- $content.attr('scrollTop', scrollPos - $content.height());
- }
- else if (!$curr)
- $content.children('div:last-child').addClass(o.selectClass);
- }
-
- function nextResult() {
- $curr = getCurr();
-
- if ($curr && $curr.next().length > 0) {
- $curr.removeClass(o.selectClass).next().addClass(o.selectClass);
- var scrollPos = $content.attr('scrollTop'),
- curr = $curr[0], parentBottom, bottom, height;
- if (supportsGetBoxObjectFor()) {
- parentBottom = document.getBoxObjectFor($content[0]).y + $content.attr('offsetHeight');
- bottom = document.getBoxObjectFor(curr).y + $curr.attr('offsetHeight');
- height = document.getBoxObjectFor(curr).height;
- }
- else if (supportsGetBoundingClientRect()) {
- parentBottom = $content[0].getBoundingClientRect().bottom;
- var rect = curr.getBoundingClientRect();
- bottom = rect.bottom;
- height = bottom - rect.top;
- }
- if (bottom >= parentBottom)
- $content.attr('scrollTop', scrollPos + height);
- }
- else if (!$curr)
- $content.children('div:first-child').addClass(o.selectClass);
- }
-
- function prevResult() {
- $curr = getCurr();
-
- if ($curr && $curr.prev().length > 0) {
- $curr.removeClass(o.selectClass).prev().addClass(o.selectClass);
- var scrollPos = $content.attr('scrollTop'),
- curr = $curr[0],
- parent = $curr.parent()[0],
- parentTop, top, height;
- if (supportsGetBoxObjectFor()) {
- height = document.getBoxObjectFor(curr).height;
- parentTop = document.getBoxObjectFor($content[0]).y - (height * 2); // TODO: this is not working when i add another control...
- top = document.getBoxObjectFor(curr).y - document.getBoxObjectFor($content[0]).y;
- }
- else if (supportsGetBoundingClientRect()) {
- parentTop = parent.getBoundingClientRect().top;
- var rect = curr.getBoundingClientRect();
- top = rect.top;
- height = rect.bottom - top;
- }
- if (top <= parentTop)
- $content.attr('scrollTop', scrollPos - height);
- }
- else if (!$curr)
- $content.children('div:last-child').addClass(o.selectClass);
- }
- };
-
- $.fn.flexbox = function(source, options) {
- if (!source)
- return;
-
- try {
- var defaults = $.fn.flexbox.defaults;
- var o = $.extend({}, defaults, options);
-
- for (var prop in o) {
- if (defaults[prop] === undefined) throw ('Invalid option specified: ' + prop + '\nPlease check your spelling and try again.');
- }
- o.source = source;
-
- if (options) {
- o.paging = (options.paging || options.paging == null) ? $.extend({}, defaults.paging, options.paging) : false;
-
- for (var prop in o.paging) {
- if (defaults.paging[prop] === undefined) throw ('Invalid option specified: ' + prop + '\nPlease check your spelling and try again.');
- }
-
- if (options.displayValue && !options.hiddenValue) {
- o.hiddenValue = options.displayValue;
- }
- }
-
- this.each(function() {
- new $.flexbox(this, o);
- });
-
- return this;
- } catch (ex) {
- if (typeof ex === 'object') alert(ex.message); else alert(ex);
- }
- };
-
- // plugin defaults - added as a property on our plugin function so they can be set independently
- $.fn.flexbox.defaults = {
- method: 'GET', // One of 'GET' or 'POST'
- queryDelay: 100, // num of milliseconds before query is run.
- allowInput: true, // set to false to disallow the user from typing in queries
- containerClass: 'ffb',
- contentClass: 'content',
- selectClass: 'ffb-sel',
- inputClass: 'ffb-input',
- arrowClass: 'ffb-arrow',
- matchClass: 'ffb-match',
- noResultsText: 'No matching results', // text to show when no results match the query
- noResultsClass: 'ffb-no-results', // class to apply to noResultsText
- showResults: true, // whether to show results at all, or just typeahead
- selectFirstMatch: true, // whether to highlight the first matching value
- autoCompleteFirstMatch: false, // whether to complete the first matching value in the input box
- highlightMatches: true, // whether all matches within the string should be highlighted with matchClass
- highlightMatchesRegExModifier: 'i', // 'i' for case-insensitive, 'g' for global (all occurrences), or combine
- matchAny: true, // for client-side filtering ONLY, match any occurrence of the search term in the result (e.g. "ar" would find "area" and "cart")
- minChars: 1, // the minimum number of characters the user must enter before a search is executed
- showArrow: true, // set to false to simulate google suggest
- arrowQuery: '', // the query to run when the arrow is clicked
- onSelect: false, // function to run when a result is selected
- maxCacheBytes: 32768, // in bytes, 0 means caching is disabled
- resultTemplate: '{name}', // html template for each row (put json properties in curly braces)
- displayValue: 'name', // json element whose value is displayed on select
- hiddenValue: 'id', // json element whose value is submitted when form is submitted
- initialValue: '', // what should the value of the input field be when the form is loaded?
- initialId: '', // what should the value of the hidden field be when the form is loaded?
- watermark: '', // text that appears when flexbox is loaded, if no initialValue is specified. style with css class '.ffb-input.watermark'
- width: 200, // total width of flexbox. auto-adjusts based on showArrow value
- resultsProperty: 'results', // json property in response that references array of results
- totalProperty: 'total', // json property in response that references the total results (for paging)
- maxVisibleRows: 0, // default is 0, which means it is ignored. use either this, or paging.pageSize
- paging: {
- style: 'input', // or 'links'
- cssClass: 'paging', // prefix with containerClass (e.g. .ffb .paging)
- pageSize: 10, // acts as a threshold. if <= pageSize results, paging doesn't appear
- maxPageLinks: 5, // used only if style is 'links'
- showSummary: true, // whether to show 'displaying 1-10 of 200 results' text
- summaryClass: 'summary', // class for 'displaying 1-10 of 200 results', prefix with containerClass
- summaryTemplate: 'Displaying {start}-{end} of {total} results' // can use {page} and {pages} as well
- }
- };
-
- $.fn.setValue = function(val) {
- var id = '#' + this.attr('id');
- $(id + '_hidden,' + id + '_input').val(val).removeClass('watermark');
- };
-})(jQuery);
\ No newline at end of file
diff --git a/data/javascript/jquery.flexbox.min.js b/data/javascript/jquery.flexbox.min.js
deleted file mode 100644
index f17e96e0e..000000000
--- a/data/javascript/jquery.flexbox.min.js
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
-* jQuery FlexBox $Version: 0.9.6 $
-*
-* Copyright (c) 2008-2010 Noah Heldman and Fairway Technologies (http://www.fairwaytech.com/flexbox)
-* Licensed under Ms-PL (http://www.codeplex.com/flexbox/license)
-*
-* $Date: 2010-11-24 01:02:00 PM $
-* $Rev: 0.9.6.1 $
-*/
-(function(a){a.flexbox=function(N,I){var K=false,p=[],J=[],f=0,l="\u25CA",Q=false,x=I.paging&&I.paging.pageSize?I.paging.pageSize:0,F=false,D=a(N).css("position","relative").css("z-index",0);var P=a(' ').attr("id",D.attr("id")+"_hidden").attr("name",D.attr("id")).val(I.initialId).appendTo(D);var z=a(" ").attr("id",D.attr("id")+"_input").attr("autocomplete","off").addClass(I.inputClass).css("width",I.width+"px").appendTo(D).click(function(o){if(I.watermark!==""&&this.value===I.watermark){this.value=""}else{this.select()}}).focus(function(o){a(this).removeClass("watermark")}).blur(function(o){if(this.value===""){P.val("")}setTimeout(function(){if(!z.data("active")){b()}},200)}).keydown(L);if(I.initialValue!==""){z.val(I.initialValue).removeClass("watermark")}else{z.val(I.watermark).addClass("watermark")}var g=0;if(I.showArrow&&I.showResults){var E=function(){if(q.is(":visible")){b()}else{z.focus();if(I.watermark!==""&&z.val()===I.watermark){z.val("")}else{z.select()}if(K){clearTimeout(K)}K=setTimeout(function(){G(1,true,I.arrowQuery)},I.queryDelay)}};var i=a(" ").attr("id",D.attr("id")+"_arrow").addClass(I.arrowClass).addClass("out").hover(function(){a(this).removeClass("out").addClass("over")},function(){a(this).removeClass("over").addClass("out")}).mousedown(function(){a(this).removeClass("over").addClass("active")}).mouseup(function(){a(this).removeClass("active").addClass("over")}).click(E).appendTo(D);g=i.width();z.css("width",(I.width-g)+"px")}if(!I.allowInput){I.selectFirstMatch=false;z.click(E)}var O=z.outerHeight()-z.height()-2;var s=z.outerWidth()-2;var j=z.outerHeight();if(O===0){s+=4;j+=4}else{if(O!==4){s+=O;j+=O}}var q=a("
").attr("id",D.attr("id")+"_ctr").css("width",s+g).css("top",j).css("left",0).addClass(I.containerClass).appendTo(D).mousedown(function(o){z.data("active",true)}).hide();var c=a("
").addClass(I.contentClass).appendTo(q).scroll(function(){Q=true});var u=a("
").appendTo(q);D.css("height",z.outerHeight());function L(X){var V=0;if(typeof(X.ctrlKey)!=="undefined"){if(X.ctrlKey){V|=1}if(X.shiftKey){V|=2}}else{if(X.modifiers&Event.CONTROL_MASK){V|=1}if(X.modifiers&Event.SHIFT_MASK){V|=2}}if(/16$|17$/.test(X.keyCode)){return}var W=X.keyCode===9,U=X.keyCode===27;var T=X.keyCode===9&&V>0;var o=X.keyCode===8;if(W){if(k()){w()}}if((/27$|38$|33$|34$/.test(X.keyCode)&&q.is(":visible"))||(/13$|40$/.test(X.keyCode))||!I.allowInput){if(X.preventDefault){X.preventDefault()}if(X.stopPropagation){X.stopPropagation()}X.cancelBubble=true;X.returnValue=false;switch(X.keyCode){case 38:M();break;case 40:if(q.is(":visible")){t()}else{v(true)}break;case 13:if(k()){w()}else{v(true)}break;case 27:b();break;case 34:if(!F){if(I.paging){a("#"+D.attr("id")+"n").click()}else{R()}}break;case 33:if(!F){if(I.paging){a("#"+D.attr("id")+"p").click()}else{H()}}break;default:if(!I.allowInput){return}}}else{if(!U&&!W&&!T){v(false,o)}}}function v(o,U){if(K){clearTimeout(K)}var T=U?I.queryDelay*5:I.queryDelay;K=setTimeout(function(){G(1,o,"")},T)}function G(W,T,V){if(T){V=""}var U=V&&V.length>0?V:a.trim(z.val());if(U.length>=I.minChars||T){if(c.outerHeight()>0){c.css("height",c.outerHeight())}c.html("").attr("scrollTop",0);var o=n(U,W);if(o){c.css("height","auto");A(o.data,U);e(W,o.t)}else{var X={q:U,p:W,s:x,contentType:"application/json; charset=utf-8"};var Y=function(af,ac){if(ac===true){U=ac}var aa=parseInt(af[I.totalProperty]);if(isNaN(aa)&&I.paging){if(I.maxCacheBytes<=0){alert('The "maxCacheBytes" configuration option must be greater\nthan zero when implementing client-side paging.')}aa=af[I.resultsProperty].length;var Z=aa/x;if(aa%x>0){Z=parseInt(++Z)}for(var ae=1;ae<=Z;ae++){var ad={};ad[I.totalProperty]=aa;ad[I.resultsProperty]=af[I.resultsProperty].splice(0,x);if(ae===1){ab=A(ad,U)}S(U,ae,x,aa,ad,ab)}}else{var ab=A(af,U);S(U,W,x,aa,af,ab)}e(W,aa);c.css("height","auto");F=false};if(typeof(I.source)==="object"){if(I.allowInput){Y(B(I.source,X))}else{Y(I.source)}}else{F=true;if(I.method.toUpperCase()=="POST"){a.post(I.source,X,Y,"json")}else{a.getJSON(I.source,X,Y)}}}}else{b()}}function B(X,Y){var T={};T[I.resultsProperty]=[];T[I.totalProperty]=0;var o=0;for(var V=0;VT[I.totalProperty]?T[I.totalProperty]-Z:Y.s;T[I.resultsProperty]=T[I.resultsProperty].splice(Z,U)}return T}function e(U,T){u.html("").removeClass(I.paging.cssClass);if(I.showResults&&I.paging&&T>x){var o=T/x;if(T%x>0){o=parseInt(++o)}h(o,U,T)}}function r(U,T,o){if(/^13$|^39$|^37$/.test(U.keyCode)){if(U.preventDefault){U.preventDefault()}if(U.stopPropagation){U.stopPropagation()}U.cancelBubble=true;U.returnValue=false;switch(U.keyCode){case 13:if(/^\d+$/.test(T)&&T>0&&T<=o){G(T,true)}else{alert("Please enter a page number between 1 and "+o)}break;case 39:a("#"+D.attr("id")+"n").click();break;case 37:a("#"+D.attr("id")+"p").click();break}}}function y(o){G(parseInt(a(this).attr("page")),true,z.attr("pq"));return false}function h(aj,af,X){var U="<<",ac="<",ad=">",W=">>",T="...";u.addClass(I.paging.cssClass);var aa=a(" ").attr("href","#").addClass("page").click(y),ai=a(" ").addClass("page"),V=D.attr("id");if(af>1){aa.clone(true).attr("id",V+"f").attr("page",1).html(U).appendTo(u);aa.clone(true).attr("id",V+"p").attr("page",af-1).html(ac).appendTo(u)}else{ai.clone(true).html(U).appendTo(u);ai.clone(true).html(ac).appendTo(u)}if(I.paging.style==="links"){var o=I.paging.maxPageLinks;if(aj<=o){for(var ag=1;ag<=aj;ag++){if(ag===af){ai.clone(true).html(af).appendTo(u)}else{aa.clone(true).attr("page",ag).html(ag).appendTo(u)}}}else{if((af+parseInt(o/2))>aj){startPage=aj-o+1}else{startPage=af-parseInt(o/2)}if(startPage>1){aa.clone(true).attr("page",startPage-1).html(T).appendTo(u)}else{startPage=1}for(var ag=startPage;ag(startPage+o)){aa.clone(true).attr("page",ag).html(T).appendTo(u)}}}else{if(I.paging.style==="input"){var ae=a(" ").addClass("box").click(function(ak){this.select()}).keypress(function(ak){return r(ak,this.value,aj)}).val(af).appendTo(u)}}if(af(X-x))?X:Z+x-1;if(I.paging.showSummary){var ah={start:Z,end:ab,total:X,page:af,pages:aj};var Y=I.paging.summaryTemplate.applyTemplate(ah);a(" ").appendTo(u);a(" ").addClass(I.paging.summaryClass).html(Y).appendTo(u)}}function n(U,V){var T=U+l+V;if(J[T]){for(var o=0;o0){while(p.length&&(f+T>I.maxCacheBytes)){var V=p.pop();f-=V.size}var o=Y+l+Z;J[o]={q:Y,p:Z,s:W,t:U,size:T,data:X};p.push(o);f+=T}}function A(ab,T){var ad=0,o=0;if(!ab){return}P.val(z.val());if(parseInt(ab[I.totalProperty])===0&&I.noResultsText&&I.noResultsText.length>0){c.addClass(I.noResultsClass).html(I.noResultsText);q.show();return}else{c.removeClass(I.noResultsClass)}for(var X=0;X'+Y.substr(ac,T.length)+"";if(ag.match("<(.|\n)*?>")){af=true;aa="(>)([^<]*?)("+T+")((.|\n)*?)(<)";Z='$1$2$3 $4$6'}ag=ag.replace(new RegExp(aa.replace("[", "\\["),I.highlightMatchesRegExModifier),Z)}if(I.autoCompleteFirstMatch&&!af&&X===0){if(T.length>0&&Y.toLowerCase().indexOf(T.toLowerCase())===0){z.attr("pq",T);P.val(V[I.hiddenValue]);z.val(V[I.displayValue]);U=m(T.length,z.val().length)}}if(!I.showResults){return}$row=a("
").attr("id",V[I.hiddenValue]).attr("val",V[I.displayValue]).addClass("row").html(ag).appendTo(c);if(W||(++o==1&&I.selectFirstMatch)||U){$row.addClass(I.selectClass)}ad+=ag.length}if(ad===0){b();return}q.parent().css("z-index",11000);q.show();c.children("div").mouseover(function(){c.children("div").removeClass(I.selectClass);a(this).addClass(I.selectClass)}).mouseup(function(ah){ah.preventDefault();ah.stopPropagation();w()});if(I.maxVisibleRows>0){var ae=$row.outerHeight()*I.maxVisibleRows;c.css("max-height",ae)}return ad}function m(U,T){var o=z[0];if(o.createTextRange){var V=o.createTextRange();V.moveStart("character",U);V.moveEnd("character",T-o.value.length);V.select()}else{if(o.setSelectionRange){o.setSelectionRange(U,T)}}o.focus();return true}String.prototype.applyTemplate=function(T){try{if(T===""){return this}return this.replace(/{([^{}]*)}/g,function(V,U){var Y;if(U.indexOf(".")!==-1){var X=U.split(".");var Z=T;for(var W=0;W0){$curr.removeClass(I.selectClass);for(var o=0;o0){$curr=$curr.next()}}$curr.addClass(I.selectClass);var T=c.attr("scrollTop");c.attr("scrollTop",T+c.height())}else{if(!$curr){c.children("div:first-child").addClass(I.selectClass)}}}function H(){$curr=k();if($curr&&$curr.prev().length>0){$curr.removeClass(I.selectClass);for(var o=0;o0){$curr=$curr.prev()}}$curr.addClass(I.selectClass);var T=c.attr("scrollTop");c.attr("scrollTop",T-c.height())}else{if(!$curr){c.children("div:last-child").addClass(I.selectClass)}}}function t(){$curr=k();if($curr&&$curr.next().length>0){$curr.removeClass(I.selectClass).next().addClass(I.selectClass);var X=c.attr("scrollTop"),W=$curr[0],V,T,o;if(C()){V=document.getBoxObjectFor(c[0]).y+c.attr("offsetHeight");T=document.getBoxObjectFor(W).y+$curr.attr("offsetHeight");o=document.getBoxObjectFor(W).height}else{if(d()){V=c[0].getBoundingClientRect().bottom;var U=W.getBoundingClientRect();T=U.bottom;o=T-U.top}}if(T>=V){c.attr("scrollTop",X+o)}}else{if(!$curr){c.children("div:first-child").addClass(I.selectClass)}}}function M(){$curr=k();if($curr&&$curr.prev().length>0){$curr.removeClass(I.selectClass).prev().addClass(I.selectClass);var Y=c.attr("scrollTop"),X=$curr[0],T=$curr.parent()[0],V,W,o;if(C()){o=document.getBoxObjectFor(X).height;V=document.getBoxObjectFor(c[0]).y-(o*2);W=document.getBoxObjectFor(X).y-document.getBoxObjectFor(c[0]).y}else{if(d()){V=T.getBoundingClientRect().top;var U=X.getBoundingClientRect();W=U.top;o=U.bottom-W}}if(W<=V){c.attr("scrollTop",Y-o)}}else{if(!$curr){c.children("div:last-child").addClass(I.selectClass)}}}};a.fn.flexbox=function(d,b){if(!d){return}try{var e=a.fn.flexbox.defaults;var f=a.extend({},e,b);for(var g in f){if(e[g]===undefined){throw ("Invalid option specified: "+g+"\nPlease check your spelling and try again.")}}f.source=d;if(b){f.paging=(b.paging||b.paging==null)?a.extend({},e.paging,b.paging):false;for(var g in f.paging){if(e.paging[g]===undefined){throw ("Invalid option specified: "+g+"\nPlease check your spelling and try again.")}}if(b.displayValue&&!b.hiddenValue){f.hiddenValue=b.displayValue}}this.each(function(){new a.flexbox(this,f)});return this}catch(c){if(typeof c==="object"){alert(c.message)}else{alert(c)}}};a.fn.flexbox.defaults={method:"GET",queryDelay:100,allowInput:true,containerClass:"ffb",contentClass:"content",selectClass:"ffb-sel",inputClass:"ffb-input",arrowClass:"ffb-arrow",matchClass:"ffb-match",noResultsText:"No matching results",noResultsClass:"ffb-no-results",showResults:true,selectFirstMatch:true,autoCompleteFirstMatch:false,highlightMatches:true,highlightMatchesRegExModifier:"i",matchAny:true,minChars:1,showArrow:true,arrowQuery:"",onSelect:false,maxCacheBytes:32768,resultTemplate:"{name}",displayValue:"name",hiddenValue:"id",initialValue:"",initialId:"",watermark:"",width:200,resultsProperty:"results",totalProperty:"total",maxVisibleRows:0,paging:{style:"input",cssClass:"paging",pageSize:10,maxPageLinks:5,showSummary:true,summaryClass:"summary",summaryTemplate:"Displaying {start}-{end} of {total} results"}};a.fn.setValue=function(b){var c="#"+this.attr("id");a(c+"_hidden,"+c+"_input").val(b).removeClass("watermark")}})(jQuery);
\ No newline at end of file
diff --git a/setup.py b/setup.py
index 87a34aad4..8411139af 100755
--- a/setup.py
+++ b/setup.py
@@ -407,7 +407,6 @@ GRAMPS_FILES = glob.glob(os.path.join('example', 'gramps', '*.*'))
IMAGE_WEB = glob.glob(os.path.join('images', 'webstuff', '*.png'))
IMAGE_WEB.extend(glob.glob(os.path.join('images', 'webstuff','*.ico')))
IMAGE_WEB.extend(glob.glob(os.path.join('images', 'webstuff', '*.gif')))
-JS_FILES = glob.glob(os.path.join('data', 'javascript', '*.js'))
CSS_FILES = glob.glob(os.path.join('data', 'css', '*.css'))
SWANKY_PURSE = glob.glob(os.path.join('data', 'css', 'swanky-purse', '*.css'))
SWANKY_IMG = glob.glob(os.path.join('data', 'css', 'swanky-purse', 'images', '*.png'))