Skip to content
Browse files

Cleaning up Javascripts and adding Merge script

  • Loading branch information...
1 parent ed78201 commit 00b45fdaa24e3c9dfbd70773b8c7d1ea52c4d753 @jcnetdev jcnetdev committed Aug 8, 2008
View
320 public/javascripts/jquery.ext/dimensions.js
@@ -1,320 +0,0 @@
-/*
- * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
- * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
- *
- * $LastChangedDate: 2007-03-27 23:29:43 +0200 (Di, 27 Mrz 2007) $
- * $Rev: 1601 $
- */
-
-jQuery.fn._height = jQuery.fn.height;
-jQuery.fn._width = jQuery.fn.width;
-
-/**
- * If used on document, returns the document's height (innerHeight)
- * If used on window, returns the viewport's (window) height
- * See core docs on height() to see what happens when used on an element.
- *
- * @example $("#testdiv").height()
- * @result 200
- *
- * @example $(document).height()
- * @result 800
- *
- * @example $(window).height()
- * @result 400
- *
- * @name height
- * @type Object
- * @cat Plugins/Dimensions
- */
-jQuery.fn.height = function() {
- if ( this[0] == window )
- return self.innerHeight ||
- jQuery.boxModel && document.documentElement.clientHeight ||
- document.body.clientHeight;
-
- if ( this[0] == document )
- return Math.max( document.body.scrollHeight, document.body.offsetHeight );
-
- return this._height(arguments[0]);
-};
-
-/**
- * If used on document, returns the document's width (innerWidth)
- * If used on window, returns the viewport's (window) width
- * See core docs on height() to see what happens when used on an element.
- *
- * @example $("#testdiv").width()
- * @result 200
- *
- * @example $(document).width()
- * @result 800
- *
- * @example $(window).width()
- * @result 400
- *
- * @name width
- * @type Object
- * @cat Plugins/Dimensions
- */
-jQuery.fn.width = function() {
- if ( this[0] == window )
- return self.innerWidth ||
- jQuery.boxModel && document.documentElement.clientWidth ||
- document.body.clientWidth;
-
- if ( this[0] == document )
- return Math.max( document.body.scrollWidth, document.body.offsetWidth );
-
- return this._width(arguments[0]);
-};
-
-/**
- * Returns the inner height value (without border) for the first matched element.
- * If used on document, returns the document's height (innerHeight)
- * If used on window, returns the viewport's (window) height
- *
- * @example $("#testdiv").innerHeight()
- * @result 800
- *
- * @name innerHeight
- * @type Number
- * @cat Plugins/Dimensions
- */
-jQuery.fn.innerHeight = function() {
- return this[0] == window || this[0] == document ?
- this.height() :
- this.css('display') != 'none' ?
- this[0].offsetHeight - (parseInt(this.css("borderTopWidth")) || 0) - (parseInt(this.css("borderBottomWidth")) || 0) :
- this.height() + (parseInt(this.css("paddingTop")) || 0) + (parseInt(this.css("paddingBottom")) || 0);
-};
-
-/**
- * Returns the inner width value (without border) for the first matched element.
- * If used on document, returns the document's Width (innerWidth)
- * If used on window, returns the viewport's (window) width
- *
- * @example $("#testdiv").innerWidth()
- * @result 1000
- *
- * @name innerWidth
- * @type Number
- * @cat Plugins/Dimensions
- */
-jQuery.fn.innerWidth = function() {
- return this[0] == window || this[0] == document ?
- this.width() :
- this.css('display') != 'none' ?
- this[0].offsetWidth - (parseInt(this.css("borderLeftWidth")) || 0) - (parseInt(this.css("borderRightWidth")) || 0) :
- this.height() + (parseInt(this.css("paddingLeft")) || 0) + (parseInt(this.css("paddingRight")) || 0);
-};
-
-/**
- * Returns the outer height value (including border) for the first matched element.
- * Cannot be used on document or window.
- *
- * @example $("#testdiv").outerHeight()
- * @result 1000
- *
- * @name outerHeight
- * @type Number
- * @cat Plugins/Dimensions
- */
-jQuery.fn.outerHeight = function() {
- return this[0] == window || this[0] == document ?
- this.height() :
- this.css('display') != 'none' ?
- this[0].offsetHeight :
- this.height() + (parseInt(this.css("borderTopWidth")) || 0) + (parseInt(this.css("borderBottomWidth")) || 0)
- + (parseInt(this.css("paddingTop")) || 0) + (parseInt(this.css("paddingBottom")) || 0);
-};
-
-/**
- * Returns the outer width value (including border) for the first matched element.
- * Cannot be used on document or window.
- *
- * @example $("#testdiv").outerWidth()
- * @result 1000
- *
- * @name outerWidth
- * @type Number
- * @cat Plugins/Dimensions
- */
-jQuery.fn.outerWidth = function() {
- return this[0] == window || this[0] == document ?
- this.width() :
- this.css('display') != 'none' ?
- this[0].offsetWidth :
- this.height() + (parseInt(this.css("borderLeftWidth")) || 0) + (parseInt(this.css("borderRightWidth")) || 0)
- + (parseInt(this.css("paddingLeft")) || 0) + (parseInt(this.css("paddingRight")) || 0);
-};
-
-/**
- * Returns how many pixels the user has scrolled to the right (scrollLeft).
- * Works on containers with overflow: auto and window/document.
- *
- * @example $("#testdiv").scrollLeft()
- * @result 100
- *
- * @name scrollLeft
- * @type Number
- * @cat Plugins/Dimensions
- */
-jQuery.fn.scrollLeft = function() {
- if ( this[0] == window || this[0] == document )
- return self.pageXOffset ||
- jQuery.boxModel && document.documentElement.scrollLeft ||
- document.body.scrollLeft;
-
- return this[0].scrollLeft;
-};
-
-/**
- * Returns how many pixels the user has scrolled to the bottom (scrollTop).
- * Works on containers with overflow: auto and window/document.
- *
- * @example $("#testdiv").scrollTop()
- * @result 100
- *
- * @name scrollTop
- * @type Number
- * @cat Plugins/Dimensions
- */
-jQuery.fn.scrollTop = function() {
- if ( this[0] == window || this[0] == document )
- return self.pageYOffset ||
- jQuery.boxModel && document.documentElement.scrollTop ||
- document.body.scrollTop;
-
- return this[0].scrollTop;
-};
-
-/**
- * Returns the location of the element in pixels from the top left corner of the viewport.
- *
- * For accurate readings make sure to use pixel values for margins, borders and padding.
- *
- * @example $("#testdiv").offset()
- * @result { top: 100, left: 100, scrollTop: 10, scrollLeft: 10 }
- *
- * @example $("#testdiv").offset({ scroll: false })
- * @result { top: 90, left: 90 }
- *
- * @example var offset = {}
- * $("#testdiv").offset({ scroll: false }, offset)
- * @result offset = { top: 90, left: 90 }
- *
- * @name offset
- * @param Object options A hash of options describing what should be included in the final calculations of the offset.
- * The options include:
- * margin: Should the margin of the element be included in the calculations? True by default.
- * If set to false the margin of the element is subtracted from the total offset.
- * border: Should the border of the element be included in the calculations? True by default.
- * If set to false the border of the element is subtracted from the total offset.
- * padding: Should the padding of the element be included in the calculations? False by default.
- * If set to true the padding of the element is added to the total offset.
- * scroll: Should the scroll offsets of the parent elements be included in the calculations?
- * True by default. When true, it adds the total scroll offsets of all parents to the
- * total offset and also adds two properties to the returned object, scrollTop and
- * scrollLeft. If set to false the scroll offsets of parent elements are ignored.
- * If scroll offsets are not needed, set to false to get a performance boost.
- * @param Object returnObject An object to store the return value in, so as not to break the chain. If passed in the
- * chain will not be broken and the result will be assigned to this object.
- * @type Object
- * @cat Plugins/Dimensions
- * @author Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
- */
-jQuery.fn.offset = function(options, returnObject) {
- var x = 0, y = 0, elem = this[0], parent = this[0], absparent=false, relparent=false, op, sl = 0, st = 0, options = jQuery.extend({ margin: true, border: true, padding: false, scroll: true }, options || {});
- do {
- x += parent.offsetLeft || 0;
- y += parent.offsetTop || 0;
-
- // Mozilla and IE do not add the border
- if (jQuery.browser.mozilla || jQuery.browser.msie) {
- // get borders
- var bt = parseInt(jQuery.css(parent, 'borderTopWidth')) || 0;
- var bl = parseInt(jQuery.css(parent, 'borderLeftWidth')) || 0;
-
- // add borders to offset
- x += bl;
- y += bt;
-
- // Mozilla removes the border if the parent has overflow property other than visible
- if (jQuery.browser.mozilla && parent != elem && jQuery.css(parent, 'overflow') != 'visible') {
- x += bl;
- y += bt;
- }
-
- // Mozilla does not include the border on body if an element isn't positioned absolute and is without an absolute parent
- if (jQuery.css(parent, 'position') == 'absolute') absparent = true;
- // IE does not include the border on the body if an element is position static and without an absolute or relative parent
- if (jQuery.css(parent, 'position') == 'relative') relparent = true;
- }
-
- if (options.scroll) {
- // Need to get scroll offsets in-between offsetParents
- op = parent.offsetParent;
- do {
- sl += parent.scrollLeft || 0;
- st += parent.scrollTop || 0;
-
- parent = parent.parentNode;
-
- // Mozilla removes the border if the parent has overflow property other than visible
- if (jQuery.browser.mozilla && parent != elem && parent != op && jQuery.css(parent, 'overflow') != 'visible') {
- x += parseInt(jQuery.css(parent, 'borderLeftWidth')) || 0;
- y += parseInt(jQuery.css(parent, 'borderTopWidth')) || 0;
- }
- } while (op && parent != op);
- } else
- parent = parent.offsetParent;
-
- if (parent && (parent.tagName.toLowerCase() == 'body' || parent.tagName.toLowerCase() == 'html')) {
- // Safari and IE Standards Mode doesn't add the body margin for elments positioned with static or relative
- if ((jQuery.browser.safari || (jQuery.browser.msie && jQuery.boxModel)) && jQuery.css(elem, 'position') != 'absolute') {
- x += parseInt(jQuery.css(parent, 'marginLeft')) || 0;
- y += parseInt(jQuery.css(parent, 'marginTop')) || 0;
- }
- // Mozilla does not include the border on body if an element isn't positioned absolute and is without an absolute parent
- // IE does not include the border on the body if an element is positioned static and without an absolute or relative parent
- if ( (jQuery.browser.mozilla && !absparent) ||
- (jQuery.browser.msie && jQuery.css(elem, 'position') == 'static' && (!relparent || !absparent)) ) {
- x += parseInt(jQuery.css(parent, 'borderLeftWidth')) || 0;
- y += parseInt(jQuery.css(parent, 'borderTopWidth')) || 0;
- }
- break; // Exit the loop
- }
- } while (parent);
-
- if ( !options.margin) {
- x -= parseInt(jQuery.css(elem, 'marginLeft')) || 0;
- y -= parseInt(jQuery.css(elem, 'marginTop')) || 0;
- }
-
- // Safari and Opera do not add the border for the element
- if ( options.border && (jQuery.browser.safari || jQuery.browser.opera) ) {
- x += parseInt(jQuery.css(elem, 'borderLeftWidth')) || 0;
- y += parseInt(jQuery.css(elem, 'borderTopWidth')) || 0;
- } else if ( !options.border && !(jQuery.browser.safari || jQuery.browser.opera) ) {
- x -= parseInt(jQuery.css(elem, 'borderLeftWidth')) || 0;
- y -= parseInt(jQuery.css(elem, 'borderTopWidth')) || 0;
- }
-
- if ( options.padding ) {
- x += parseInt(jQuery.css(elem, 'paddingLeft')) || 0;
- y += parseInt(jQuery.css(elem, 'paddingTop')) || 0;
- }
-
- // Opera thinks offset is scroll offset for display: inline elements
- if (options.scroll && jQuery.browser.opera && jQuery.css(elem, 'display') == 'inline') {
- sl -= elem.scrollLeft || 0;
- st -= elem.scrollTop || 0;
- }
-
- var returnValue = options.scroll ? { top: y - st, left: x - sl, scrollTop: st, scrollLeft: sl }
- : { top: y, left: x };
-
- if (returnObject) { jQuery.extend(returnObject, returnValue); return this; }
- else { return returnValue; }
-};
View
656 public/javascripts/jquery.ext/jquery.autocomplete.js
@@ -1,656 +0,0 @@
-/*
- * Autocomplete - jQuery plugin 1.0 Alpha
- *
- * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer
- *
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- *
- * Revision: $Id: jquery.autocomplete.js 1729 2007-04-17 20:04:10Z joern $
- *
- */
-
-/*
-TODO
-- add a callback to allow decoding the response
-- fix mustMatch
-- add scrollbars and page down/up, option for height or number of items to be visible without scrolling
-- allow modification of not-last value in multiple-fields
-@option TODO Number size Limit the number of items to show at once. Default:
-*/
-
-/**
- * Provide autocomplete for text-inputs or textareas.
- *
- * Depends on dimensions plugin's offset method for correct positioning of the select box and bgiframe plugin
- * to fix IE's problem with selects.
- *
- * @example $j("#input_box").autocomplete("my_autocomplete_backend.php");
- * @before <input id="input_box" />
- * @desc Autocomplete a text-input with remote data. For small to giant datasets.
- *
- * When the user starts typing, a request is send to the specified backend ("my_autocomplete_backend.php"),
- * with a GET parameter named q that contains the current value of the input box and a paremeter "limit" with
- * the value specified for the max option.
- *
- * A value of "foo" would result in this request url: my_autocomplete_backend.php?q=foo&limit=10
- *
- * The result must return with one value on each line. The result is presented in the order
- * the backend sends it.
- *
- * @example $j("#input_box").autocomplete(["Cologne", "Berlin", "Munich"]);
- * @before <input id="input_box" />
- * @desc Autcomplete a text-input with local data. For small datasets.
- *
- * @example $.getJSON("my_backend.php", function(data) {
- * $j("#input_box").autocomplete(data);
- * });
- * @before <input id="input_box" />
- * @desc Autcomplete a text-input with data received via AJAX. For small to medium sized datasets.
- *
- * @example $j("#mytextarea").autocomplete(["Cologne", "Berlin", "Munich"], {
- * multiple: true
- * });
- * @before <textarea id="mytextarea" />
- * @desc Autcomplete a textarea with local data (for small datasets). Once the user chooses one
- * value, a separator is appended (by default a comma, see multipleSeparator option) and more values
- * are autocompleted.
- *
- * @name autocomplete
- * @cat Plugins/Autocomplete
- * @type jQuery
- * @param String|Array urlOrData Pass either an URL for remote-autocompletion or an array of data for local auto-completion
- * @param Map options Optional settings
- * @option String inputClass This class will be added to the input box. Default: "ac_input"
- * @option String resultsClass The class for the UL that will contain the result items (result items are LI elements). Default: "ac_results"
- * @option String loadingClass The class for the input box while results are being fetched from the server. Default: "ac_loading"
- * @option Number minChars The minimum number of characters a user has to type before the autocompleter activates. Default: 1
- * @option Number delay The delay in milliseconds the autocompleter waits after a keystroke to activate itself. Default: 400 for remote, 10 for local
- * @option Number cacheLength The number of backend query results to store in cache. If set to 1 (the current result), no caching will happen. Do not set below 1. Default: 10
- * @option Boolean matchSubset Whether or not the autocompleter can use a cache for more specific queries. This means that all matches of "foot" are a subset of all matches for "foo". Usually this is true, and using this options decreases server load and increases performance. Only useful with cacheLength settings bigger then one, like 10. Default: true
- * @option Boolean matchCase Whether or not the comparison is case sensitive. Only important only if you use caching. Default: false
- * @option Boolean matchContains Whether or not the comparison looks inside (i.e. does "ba" match "foo bar") the search results. Only important if you use caching. Don't mix with autofill. Default: false
- * @option Booolean mustMatch If set to true, the autocompleter will only allow results that are presented by the backend. Note that illegal values result in an empty input box. Default: false
- * @option Object extraParams Extra parameters for the backend. If you were to specify { bar:4 }, the autocompleter would call my_autocomplete_backend.php?q=foo&bar=4 (assuming the input box contains "foo"). Default: {}
- * @option Boolean selectFirst If this is set to true, the first autocomplete value will be automatically selected on tab/return, even if it has not been handpicked by keyboard or mouse action. If there is a handpicked (highlighted) result, that result will take precedence. Default: true
- * @option Function formatItem Provides advanced markup for an item. For each row of results, this function will be called. The returned value will be displayed inside an LI element in the results list. Autocompleter will provide 3 parameters: the results row, the position of the row in the list of results (starting at 1), and the number of items in the list of results. Default: none, assumes that a single row contains a single value.
- * @option Function formatResult Similar to formatResult, but provides the formatting for the value to be put into the input field. Again three arguments: Data, position (starting with one) and total number of data. Default: none, assumes either plain data to use as result or uses the same value as provided by formatItem.
- * @option Boolean multiple Whether to allow more then one autocomplted-value to enter. Default: false
- * @option String multipleSeparator Seperator to put between values when using multiple option. Default: ", "
- * @option Number width Specify a custom width for the select box. Default: width of the input element
- * @option Boolean autoFill Fill the textinput while still selecting a value, replacing the value if more is type or something else is selected. Default: false
- * @option Number max Limit the number of items in the select box. Is also send as a "limit" parameter with a remote request. Default: 10
- */
-
-/**
- * Handle the result of a search event. Is executed when the user selects a value or a
- * programmatic search event is triggered (see search()).
- *
- * You can add and remove (using unbind("result")) this event at any time.
- *
- * @example jQuery('input#suggest').result(function(event, data, formatted) {
- * jQuery("#result").html( !data ? "No match!" : "Selected: " + formatted);
- * });
- * @desc Bind a handler to the result event to display the selected value in a #result element.
- * The first argument is a generic event object, in this case with type "result".
- * The second argument refers to the selected data, which can be a plain string value or an array or object.
- * The third argument is the formatted value that is inserted into the input field.
- *
- * @param Function handler The event handler, gets a default event object as first and
- * the selected list item as second argument.
- * @name result
- * @cat Plugins/Autocomplete
- * @type jQuery
- */
-
-/**
- * Trigger a search event. See result(Function) for binding to that event.
- *
- * A search event mimics the same behaviour as when the user selects a value from
- * the list of autocomplete items. You can use it to execute anything that does something
- * with the selected value, beyond simply putting the value into the input and submitting it.
- *
- * @example jQuery('input#suggest').search();
- * @desc Triggers a search event.
- *
- * @name search
- * @cat Plugins/Autocomplete
- * @type jQuery
- */
-
-// * @option Function onSelectItem Called when an item is selected. The autocompleter will specify a single argument, being the LI element selected. This LI element will have an attribute "extra" that contains an array of all cells that the backend specified. Default: none
-
-jQuery.fn.extend({
- autocomplete: function(urlOrData, options) {
- var isUrl = typeof urlOrData == "string";
- options = jQuery.extend({}, jQuery.Autocompleter.defaults, {
- url: isUrl ? urlOrData : null,
- data: isUrl ? null : urlOrData,
- delay: isUrl ? jQuery.Autocompleter.defaults.delay : 10
- }, options);
- return this.each(function() {
- new jQuery.Autocompleter(this, options);
- });
- },
- result: function(handler) {
- return this.bind("result", handler);
- },
- search: function() {
- return this.trigger("search");
- }
-});
-
-jQuery.Autocompleter = function(input, options) {
-
- var KEY = {
- UP: 38,
- DOWN: 40,
- DEL: 46,
- TAB: 9,
- RETURN: 13,
- ESC: 27,
- COMMA: 188
- };
-
- // Create jQuery object for input element
- var $input = $j(input).attr("autocomplete", "off").addClass(options.inputClass);
-
- var timeout;
- var previousValue = "";
- var cache = jQuery.Autocompleter.Cache(options);
- var hasFocus = 0;
- var lastKeyPressCode;
- var select = jQuery.Autocompleter.Select(options, input, selectCurrent);
-
- $input.keydown(function(event) {
- // track last key pressed
- lastKeyPressCode = event.keyCode;
- switch(event.keyCode) {
-
- case KEY.UP:
- event.preventDefault();
- if ( select.visible() ) {
- select.prev();
- } else {
- onChange(0, true);
- }
- break;
-
- case KEY.DOWN:
- event.preventDefault();
- if ( select.visible() ) {
- select.next();
- } else {
- onChange(0, true);
- }
- break;
-
- // matches also semicolon
- case options.multiple && jQuery.trim(options.multipleSeparator) == "," && KEY.COMMA:
- case KEY.TAB:
- case KEY.RETURN:
- if( selectCurrent() ){
- // make sure to blur off the current field
- if( !options.multiple )
- $input.blur();
- event.preventDefault();
- }
- break;
-
- case KEY.ESC:
- select.hide();
- break;
-
- default:
- clearTimeout(timeout);
- timeout = setTimeout(onChange, options.delay);
- break;
- }
- }).keypress(function() {
- // having fun with opera - remove this binding and Opera submits the form when we select an entry via return
- }).focus(function(){
- // track whether the field has focus, we shouldn't process any
- // results if the field no longer has focus
- hasFocus++;
- }).blur(function() {
- hasFocus = 0;
- hideResults();
- }).click(function() {
- // show select when clicking in a focused field
- if ( hasFocus++ > 1 && !select.visible() ) {
- onChange(0, true);
- }
- }).bind("search", function() {
- function findValueCallback(q, data) {
- var result;
- if( data && data.length ) {
- for (var i=0; i < data.length; i++) {
- if( data[i].result.toLowerCase() == q.toLowerCase() ) {
- result = data[i];
- break;
- }
- }
- }
- $input.trigger("result", result && [result.data, result.value]);
- }
- jQuery.each(trimWords($input.val()), function(i, value) {
- request(value, findValueCallback, findValueCallback);
- });
- });
-
- hideResultsNow();
-
- function selectCurrent() {
- var selected = select.selected();
- if( !selected )
- return false;
-
- var v = selected.result;
- previousValue = v;
-
- if ( options.multiple ) {
- var words = trimWords($input.val());
- if ( words.length > 1 ) {
- v = words.slice(0, words.length - 1).join( options.multipleSeparator ) + options.multipleSeparator + v;
- }
- v += options.multipleSeparator;
- }
-
- $input.val(v);
- hideResultsNow();
- $input.trigger("result", [selected.data, selected.value]);
- return true;
- }
-
- function onChange(crap, skipPrevCheck) {
- if( lastKeyPressCode == KEY.DEL ) {
- select.hide();
- return;
- }
-
- var currentValue = $input.val();
-
- if ( !skipPrevCheck && currentValue == previousValue )
- return;
-
- previousValue = currentValue;
-
- currentValue = lastWord(currentValue);
- if ( currentValue.length >= options.minChars) {
- $input.addClass(options.loadingClass);
- if (!options.matchCase)
- currentValue = currentValue.toLowerCase();
- request(currentValue, receiveData, stopLoading);
- } else {
- stopLoading();
- select.hide();
- }
- };
-
- function trimWords(value) {
- if ( !value ) {
- return [""];
- }
- var words = value.split( jQuery.trim( options.multipleSeparator ) );
- var result = [];
- jQuery.each(words, function(i, value) {
- if ( jQuery.trim(value) )
- result[i] = jQuery.trim(value);
- });
- return result;
- }
-
- function lastWord(value) {
- if ( !options.multiple )
- return value;
- var words = trimWords(value);
- return words[words.length - 1];
- }
-
- // fills in the input box w/the first match (assumed to be the best match)
- function autoFill(q, sValue){
- // autofill in the complete box w/the first match as long as the user hasn't entered in more data
- // if the last user key pressed was backspace, don't autofill
- if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != 8 ) {
- // fill in the value (keep the case the user has typed)
- $input.val($input.val() + sValue.substring(lastWord(previousValue).length));
- // select the portion of the value not typed by the user (so the next character will erase)
- jQuery.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length);
- }
- };
-
- function hideResults() {
- clearTimeout(timeout);
- timeout = setTimeout(hideResultsNow, 200);
- };
-
- function hideResultsNow() {
- select.hide();
- clearTimeout(timeout);
- stopLoading();
- // TODO fix mustMatch...
- if (options.mustMatch) {
- if ($input.val() != previousValue) {
- //selectCurrent();
- }
- }
- };
-
- function receiveData(q, data) {
- if ( data && data.length && hasFocus ) {
- stopLoading();
- select.display(data, q);
- autoFill(q, data[0].value);
- select.show();
- } else {
- hideResultsNow();
- }
- };
-
- function request(term, success, failure) {
- if (!options.matchCase)
- term = term.toLowerCase();
- var data = cache.load(term);
- // recieve the cached data
- if (data && data.length) {
- success(term, data);
- // if an AJAX url has been supplied, try loading the data now
- } else if( (typeof options.url == "string") && (options.url.length > 0) ){
- jQuery.ajax({
- url: options.url,
- data: jQuery.extend({
- q: lastWord(term),
- limit: options.max
- }, options.extraParams),
- success: function(data) {
- var parsed = options.parse && options.parse(data) || parse(data);
- cache.add(term, parsed);
- success(term, parsed);
- }
- });
- } else {
- failure(term);
- }
- }
-
- function parse(data) {
- var parsed = [];
- var rows = data.split("\n");
- for (var i=0; i < rows.length; i++) {
- var row = jQuery.trim(rows[i]);
- if (row) {
- row = row.split("|");
- parsed[parsed.length] = {
- data: row,
- value: row[0],
- result: options.formatResult && options.formatResult(row) || row[0]
- };
- }
- }
- return parsed;
- }
-
- function stopLoading() {
- $input.removeClass(options.loadingClass);
- }
-
-}
-
-jQuery.Autocompleter.defaults = {
- inputClass: "ac_input",
- resultsClass: "ac_results",
- loadingClass: "ac_loading",
- minChars: 1,
- delay: 400,
- matchCase: false,
- matchSubset: true,
- matchContains: false,
- cacheLength: 10,
- mustMatch: false,
- extraParams: {},
- selectFirst: true,
- max: 10,
- //size: 10,
- autoFill: false,
- width: 0,
- multiple: false,
- multipleSeparator: ", "
-};
-
-jQuery.Autocompleter.Cache = function(options) {
-
- var data = {};
- var length = 0;
-
- function matchSubset(s, sub) {
- if (!options.matchCase)
- s = s.toLowerCase();
- var i = s.indexOf(sub);
- if (i == -1) return false;
- return i == 0 || options.matchContains;
- };
-
- function add(q, value) {
- if (length > options.cacheLength) {
- this.flush();
- }
- if (!data[q]) {
- length++;
- }
- data[q] = value;
- }
-
- // if there is a data array supplied
- if( options.data ){
- var stMatchSets = {},
- nullData = 0;
-
- // no url was specified, we need to adjust the cache length to make sure it fits the local data store
- if( !options.url ) options.cacheLength = 1;
-
- stMatchSets[""] = [];
-
- // loop through the array and create a lookup structure
- jQuery.each(options.data, function(i, rawValue) {
- // if row is a string, make an array otherwise just reference the array
-
-
- value = options.formatItem
- ? options.formatItem(rawValue, i+1, options.data.length)
- : rawValue;
- var firstChar = value.charAt(0).toLowerCase();
- // if no lookup array for this character exists, look it up now
- if( !stMatchSets[firstChar] )
- stMatchSets[firstChar] = [];
- // if the match is a string
- var row = {
- value: value,
- data: rawValue,
- result: options.formatResult && options.formatResult(rawValue) || value
- }
-
- stMatchSets[firstChar].push(row);
-
- if ( nullData++ < options.max ) {
- stMatchSets[""].push(row);
- }
-
- });
-
- // add the data items to the cache
- jQuery.each(stMatchSets, function(i, value) {
- // increase the cache size
- options.cacheLength++;
- // add to the cache
- add(i, value);
- });
- }
-
- return {
- flush: function() {
- data = {};
- length = 0;
- },
- add: add,
- load: function(q) {
- if (!options.cacheLength || !length)
- return null;
- if (data[q])
- return data[q];
- if (options.matchSubset) {
- for (var i = q.length - 1; i >= options.minChars; i--) {
- var c = data[q.substr(0, i)];
- if (c) {
- var csub = [];
- jQuery.each(c, function(i, x) {
- if (matchSubset(x.value, q)) {
- csub[csub.length] = x;
- }
- });
- return csub;
- }
- }
- }
- return null;
- }
- };
-};
-
-jQuery.Autocompleter.Select = function (options, input, select) {
- var CLASSES = {
- ACTIVE: "ac_over"
- };
-
- // Create results
- var element = jQuery("<div>")
- .hide()
- .addClass(options.resultsClass)
- .css("position", "absolute")
- .appendTo("body");
-
- var list = jQuery("<ul>").appendTo(element).mouseover( function(event) {
- active = jQuery("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
- jQuery(target(event)).addClass(CLASSES.ACTIVE);
- }).mouseout( function(event) {
- jQuery(target(event)).removeClass(CLASSES.ACTIVE);
- }).click(function(event) {
- jQuery(target(event)).addClass(CLASSES.ACTIVE);
- select();
- input.focus();
- return false;
- });
- var listItems,
- active = -1,
- data,
- term = "";
-
- if( options.width > 0 )
- element.css("width", options.width);
-
- function target(event) {
- var element = event.target;
- while(element.tagName != "LI")
- element = element.parentNode;
- return element;
- }
-
- function moveSelect(step) {
- active += step;
- wrapSelection();
- listItems.removeClass(CLASSES.ACTIVE).eq(active).addClass(CLASSES.ACTIVE);
- };
-
- function wrapSelection() {
- if (active < 0) {
- active = listItems.size() - 1;
- } else if (active >= listItems.size()) {
- active = 0;
- }
- }
-
- function limitNumberOfItems(available) {
- return (options.max > 0) && (options.max < available)
- ? options.max
- : available;
- }
-
- function dataToDom() {
- var num = limitNumberOfItems(data.length);
- for (var i=0; i < num; i++) {
- if (!data[i])
- continue;
- function highlight(value) {
- return value.replace(new RegExp("(" + term + ")", "gi"), "<strong>$1</strong>");
- }
- jQuery("<li>").html( options.formatItem
- ? highlight(options.formatItem(data[i].data, i+1, num))
- : highlight(data[i].value) ).appendTo(list);
- }
- listItems = list.find("li");
- if ( options.selectFirst ) {
- listItems.eq(0).addClass(CLASSES.ACTIVE);
- active = 0;
- }
- }
-
- return {
- display: function(d, q) {
- data = d;
- term = q;
- list.empty();
- dataToDom();
- list.bgiframe();
- },
- next: function() {
- moveSelect(1);
- },
- prev: function() {
- moveSelect(-1);
- },
- hide: function() {
- element.hide();
- active = -1;
- },
- visible : function() {
- return element.is(":visible");
- },
- current: function() {
- return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
- },
- show: function() {
- // get the position of the input field right now (in case the DOM is shifted)
- var offset = jQuery(input).offset({scroll: false, border: false});
- // either use the specified width, or autocalculate based on form element
- element.css({
- width: options.width > 0 ? options.width : jQuery(input).width(),
- //height: jQuery(listItems[0]).height() * options.size,
- top: offset.top + input.offsetHeight,
- left: offset.left
- }).show();
- //active = -1;
- //listItems.removeClass(CLASSES.ACTIVE);
- },
- selected: function() {
- return data && data[active];
- }
- };
-}
-
-jQuery.Autocompleter.Selection = function(field, start, end) {
- if( field.createTextRange ){
- var selRange = field.createTextRange();
- selRange.collapse(true);
- selRange.moveStart("character", start);
- selRange.moveEnd("character", end);
- selRange.select();
- } else if( field.setSelectionRange ){
- field.setSelectionRange(start, end);
- } else {
- if( field.selectionStart ){
- field.selectionStart = start;
- field.selectionEnd = end;
- }
- }
- field.focus();
-};
View
8 public/javascripts/jquery.ext/jquery.bgiframe.js
@@ -1,8 +0,0 @@
-/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
- * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
- * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
- *
- * $LastChangedDate: 2007-03-19 16:02:41 +0100 (Mo, 19 Mrz 2007) $
- * $Rev: 1546 $
- */
-(function($){$.fn.bgIframe=jQuery.fn.bgiframe=function(s){if(!($.browser.msie&&typeof XMLHttpRequest=='function'))return this;s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';"/>';return this.each(function(){if(!$('iframe.bgiframe',this)[0])this.insertBefore(document.createElement(html),this.firstChild);});};})(jQuery);
View
335 public/javascripts/jquery.ext/jquery.history.js
@@ -1,335 +0,0 @@
-/**
- * History/Remote - jQuery plugin for enabling history support and bookmarking
- * @requires jQuery v1.0.3
- *
- * http://stilbuero.de/jquery/history/
- *
- * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- *
- * Version: 0.2.3
- */
-
-(function($) { // block scope
-
-/**
- * Initialize the history manager. Subsequent calls will not result in additional history state change
- * listeners. Should be called soonest when the DOM is ready, because in IE an iframe needs to be added
- * to the body to enable history support.
- *
- * @example $.ajaxHistory.initialize();
- *
- * @param Function callback A single function that will be executed in case there is no fragment
- * identifier in the URL, for example after navigating back to the initial
- * state. Use to restore such an initial application state.
- * Optional. If specified it will overwrite the default action of
- * emptying all containers that are used to load content into.
- * @type undefined
- *
- * @name $.ajaxHistory.initialize()
- * @cat Plugins/History
- * @author Klaus Hartl/klaus.hartl@stilbuero.de
- */
-$.ajaxHistory = new function() {
-
- var RESET_EVENT = 'historyReset';
-
- var _currentHash = location.hash;
- var _intervalId = null;
- var _observeHistory; // define outside if/else required by Opera
-
- this.update = function() { }; // empty function body for graceful degradation
-
- // create custom event for state reset
- var _defaultReset = function() {
- $('.remote-output').empty();
- };
- $(document).bind(RESET_EVENT, _defaultReset);
-
- // TODO fix for Safari 3
- // if ($.browser.msie)
- // else if hash != _currentHash
- // else check history length
-
- if ($.browser.msie) {
-
- var _historyIframe, initialized = false; // for IE
-
- // add hidden iframe
- $(function() {
- _historyIframe = $('<iframe style="display: none;"></iframe>').appendTo(document.body).get(0);
- var iframe = _historyIframe.contentWindow.document;
- // create initial history entry
- iframe.open();
- iframe.close();
- if (_currentHash && _currentHash != '#') {
- iframe.location.hash = _currentHash.replace('#', '');
- }
- });
-
- this.update = function(hash) {
- _currentHash = hash;
- var iframe = _historyIframe.contentWindow.document;
- iframe.open();
- iframe.close();
- iframe.location.hash = hash.replace('#', '');
- };
-
- _observeHistory = function() {
- var iframe = _historyIframe.contentWindow.document;
- var iframeHash = iframe.location.hash;
- if (iframeHash != _currentHash) {
- _currentHash = iframeHash;
- if (iframeHash && iframeHash != '#') {
- // order does matter, set location.hash after triggering the click...
- $('a[@href$="' + iframeHash + '"]').click();
- location.hash = iframeHash;
- } else if (initialized) {
- location.hash = '';
- $(document).trigger(RESET_EVENT);
- }
- }
- initialized = true;
- };
-
- } else if ($.browser.mozilla || $.browser.opera) {
-
- this.update = function(hash) {
- _currentHash = hash;
- };
-
- _observeHistory = function() {
- if (location.hash) {
- if (_currentHash != location.hash) {
- _currentHash = location.hash;
- $('a[@href$="' + _currentHash + '"]').click();
- }
- } else if (_currentHash) {
- _currentHash = '';
- $(document).trigger(RESET_EVENT);
- }
- };
-
- } else if ($.browser.safari) {
-
- var _backStack, _forwardStack, _addHistory; // for Safari
-
- // etablish back/forward stacks
- $(function() {
- _backStack = [];
- _backStack.length = history.length;
- _forwardStack = [];
-
- });
- var isFirst = false, initialized = false;
- _addHistory = function(hash) {
- _backStack.push(hash);
- _forwardStack.length = 0; // clear forwardStack (true click occured)
- isFirst = false;
- };
-
- this.update = function(hash) {
- _currentHash = hash;
- _addHistory(_currentHash);
- };
-
- _observeHistory = function() {
- var historyDelta = history.length - _backStack.length;
- if (historyDelta) { // back or forward button has been pushed
- isFirst = false;
- if (historyDelta < 0) { // back button has been pushed
- // move items to forward stack
- for (var i = 0; i < Math.abs(historyDelta); i++) _forwardStack.unshift(_backStack.pop());
- } else { // forward button has been pushed
- // move items to back stack
- for (var i = 0; i < historyDelta; i++) _backStack.push(_forwardStack.shift());
- }
- var cachedHash = _backStack[_backStack.length - 1];
- $('a[@href$="' + cachedHash + '"]').click();
- _currentHash = location.hash;
- } else if (_backStack[_backStack.length - 1] == undefined && !isFirst) {
- // back button has been pushed to beginning and URL already pointed to hash (e.g. a bookmark)
- // document.URL doesn't change in Safari
- if (document.URL.indexOf('#') >= 0) {
- $('a[@href$="' + '#' + document.URL.split('#')[1] + '"]').click();
- } else if (initialized) {
- $(document).trigger(RESET_EVENT);
- }
- isFirst = true;
- }
- initialized = true;
- };
-
- }
-
- this.initialize = function(callback) {
- // custom callback to reset app state (no hash in url)
- if (typeof callback == 'function') {
- $(document).unbind(RESET_EVENT, _defaultReset).bind(RESET_EVENT, callback);
- }
- // look for hash in current URL (not Safari)
- if (location.hash && typeof _addHistory == 'undefined') {
- $('a[@href$="' + location.hash + '"]').trigger('click');
- }
- // start observer
- if (_observeHistory && _intervalId == null) {
- _intervalId = setInterval(_observeHistory, 200); // Safari needs at least 200 ms
- }
- };
-
-};
-
-/**
- * Implement Ajax driven links in a completely unobtrusive and accessible manner (also known as "Hijax")
- * with support for the browser's back/forward navigation buttons and bookmarking.
- *
- * The link's href attribute gets altered to a fragment identifier, such as "#remote-1", so that the browser's
- * URL gets updated on each click, whereas the former value of that attribute is used to load content via
- * XmlHttpRequest from and update the specified element. If no target element is found, a new div element will be
- * created and appended to the body to load the content into. The link informs the history manager of the
- * state change on click and adds an entry to the browser's history.
- *
- * jQuery's Ajax implementation adds a custom request header of the form "X-Requested-With: XmlHttpRequest"
- * to any Ajax request so that the called page can distinguish between a standard and an Ajax (XmlHttpRequest)
- * request.
- *
- * @example $('a.remote').remote('#output');
- * @before <a class="remote" href="/path/to/content.html">Update</a>
- * @result <a class="remote" href="#remote-1">Update</a>
- * @desc Alter a link of the class "remote" to an Ajax-enhanced link and let it load content from
- * "/path/to/content.html" via XmlHttpRequest into an element with the id "output".
- * @example $('a.remote').remote('#output', {hashPrefix: 'chapter'});
- * @before <a class="remote" href="/path/to/content.html">Update</a>
- * @result <a class="remote" href="#chapter-1">Update</a>
- * @desc Alter a link of the class "remote" to an Ajax-enhanced link and let it load content from
- * "/path/to/content.html" via XmlHttpRequest into an element with the id "output".
- *
- * @param String expr A string containing a CSS selector or basic XPath specifying the element to load
- * content into via XmlHttpRequest.
- * @param Object settings An object literal containing key/value pairs to provide optional settings.
- * @option String hashPrefix A String that is used for constructing the hash the link's href attribute
- * gets altered to, such as "#remote-1". Default value: "remote-".
- * @param Function callback A single function that will be executed when the request is complete.
- * @type jQuery
- *
- * @name remote
- * @cat Plugins/Remote
- * @author Klaus Hartl/klaus.hartl@stilbuero.de
- */
-
-/**
- * Implement Ajax driven links in a completely unobtrusive and accessible manner (also known as "Hijax")
- * with support for the browser's back/forward navigation buttons and bookmarking.
- *
- * The link's href attribute gets altered to a fragment identifier, such as "#remote-1", so that the browser's
- * URL gets updated on each click, whereas the former value of that attribute is used to load content via
- * XmlHttpRequest from and update the specified element. If no target element is found, a new div element will be
- * created and appended to the body to load the content into. The link informs the history manager of the
- * state change on click and adds an entry to the browser's history.
- *
- * jQuery's Ajax implementation adds a custom request header of the form "X-Requested-With: XmlHttpRequest"
- * to any Ajax request so that the called page can distinguish between a standard and an Ajax (XmlHttpRequest)
- * request.
- *
- * @example $('a.remote').remote( $('#output > div')[0] );
- * @before <a class="remote" href="/path/to/content.html">Update</a>
- * @result <a class="remote" href="#remote-1">Update</a>
- * @desc Alter a link of the class "remote" to an Ajax-enhanced link and let it load content from
- * "/path/to/content.html" via XmlHttpRequest into an element with the id "output".
- * @example $('a.remote').remote('#output', {hashPrefix: 'chapter'});
- * @before <a class="remote" href="/path/to/content.html">Update</a>
- * @result <a class="remote" href="#chapter-1">Update</a>
- * @desc Alter a link of the class "remote" to an Ajax-enhanced link and let it load content from
- * "/path/to/content.html" via XmlHttpRequest into an element with the id "output".
- *
- * @param Element elem A DOM element to load content into via XmlHttpRequest.
- * @param Object settings An object literal containing key/value pairs to provide optional settings.
- * @option String hashPrefix A String that is used for constructing the hash the link's href attribute
- * gets altered to, such as "#remote-1". Default value: "remote-".
- * @param Function callback A single function that will be executed when the request is complete.
- * @type jQuery
- *
- * @name remote
- * @cat Plugins/Remote
- * @author Klaus Hartl/klaus.hartl@stilbuero.de
- */
-$.fn.remote = function(output, settings, callback) {
-
- callback = callback || function() {};
- if (typeof settings == 'function') { // shift arguments
- callback = settings;
- }
-
- settings = $.extend({
- hashPrefix: 'remote-'
- }, settings || {});
-
- var target = $(output).size() && $(output) || $('<div></div>').appendTo('body');
- target.addClass('remote-output');
-
- return this.each(function(i) {
- var href = this.href, hash = '#' + (this.title && this.title.replace(/\s/g, '_') || settings.hashPrefix + (i + 1)),
- a = this;
- this.href = hash;
- $(this).click(function(e) {
- // lock target to prevent double loading in Firefox
- if (!target['locked']) {
- // add to history only if true click occured, not a triggered click
- if (e.clientX) {
- $.ajaxHistory.update(hash);
- }
- target.load(href, function() {
- target['locked'] = null;
- callback.apply(a);
- });
- }
- });
- });
-
-};
-
-/**
- * Provides the ability to use the back/forward navigation buttons in a DHTML application.
- * A change of the application state is reflected by a change of the URL fragment identifier.
- *
- * The link's href attribute needs to point to a fragment identifier within the same resource,
- * although that fragment id does not need to exist. On click the link changes the URL fragment
- * identifier, informs the history manager of the state change and adds an entry to the browser's
- * history.
- *
- * @param Function callback A single function that will be executed as the click handler of the
- * matched element. It will be executed on click (adding an entry to
- * the history) as well as in case the history manager needs to trigger
- * it depending on the value of the URL fragment identifier, e.g. if its
- * current value matches the href attribute of the matched element.
- *
- * @type jQuery
- *
- * @name history
- * @cat Plugins/History
- * @author Klaus Hartl/klaus.hartl@stilbuero.de
- */
-$.fn.history = function(callback) {
- return this.click(function(e) {
- // add to history only if true click occured, not a triggered click
- if (e.clientX) {
- $.ajaxHistory.update(this.hash);
- }
- typeof callback == 'function' && callback();
- });
-};
-
-})(jQuery);
-
-/*
-var logger;
-$(function() {
- logger = $('<div style="position: fixed; top: 0; overflow: hidden; border: 1px solid; padding: 3px; width: 120px; height: 150px; background: #fff; color: red;"></div>').appendTo(document.body);
-});
-function log(m) {
- logger.prepend(m + '<br />');
-};
-*/
-
View
4 public/javascripts/jquery.ext/jquery.onPage.js
@@ -2,8 +2,8 @@
// Returns whether or not a result set has results in it
jQuery.fn.onPage = function() {
return this.size() > 0;
-}
+};
jQuery.fn.notOnPage = function() {
return this.size() == 0;
-}
+};
View
33 public/javascripts/min/common.js
@@ -7,39 +7,6 @@
jobber_admin_url: "",
job_id: "",
- FixPng: function()
- {
- var arVersion = navigator.appVersion.split("MSIE");
- var version = parseFloat(arVersion[1]);
-
- if ((version >= 5.5) && (document.body.filters))
- {
- for(var i=0; i<document.images.length; i++)
- {
- var img = document.images[i];
- var imgName = img.src.toUpperCase();
-
- if (imgName == this.jobber_url.toUpperCase() + "IMG/BT-RSS.PNG")
- {
- var imgID = (img.id) ? "id='" + img.id + "' " : "";
- var imgClass = (img.className) ? "class='" + img.className + "' " : "";
- var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
- var imgStyle = "display:inline-block;" + img.style.cssText;
- if (img.align == "left") imgStyle = "float:left;" + imgStyle;
- if (img.align == "right") imgStyle = "float:right;" + imgStyle;
- if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
- var strNewHTML = "<span " + imgID + imgClass + imgTitle;
- strNewHTML += " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";";
- strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader";
- strNewHTML += "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
- img.outerHTML = strNewHTML;
- i = i - 1;
- }
- }
- }
-
- },
-
HandleLocationOutside: function()
{
if($("#outside_location").is(":visible"))
View
31 public/javascripts/min/components.js
@@ -22,6 +22,37 @@ $j(document).ready(function() {
});
+/* ---- Compressing ./public/javascripts/components/categories.js ----- */
+$j(document).ready(function() {
+ $j("div.categoryHandle").mousedown(function() {
+ $j(this).fadeTo(500, 0.4).addClass('draggingItem').get(0);
+ });
+ $j("div.categoryHandle").mouseup(function() {
+ $j(this).fadeTo(500,1).removeClass('draggingItem');
+ });
+});
+
+function showOverlay(element) {
+ var el = document.getElementById('overlay');
+ var elTo = document.getElementById(element);
+ if (!elTo) {
+ return;
+ }
+ var sz = elTo.positionedOffset(elTo);
+
+ if (element != "categoriesContainer") {
+ var tt = document.getElementById("categoriesContainer").positionedOffset(elTo);
+ el.style.top = tt.top + sz.top + 'px';
+ el.style.left = tt.left + sz.left + 'px';
+ } else {
+ el.style.top = sz.top + 'px';
+ el.style.left = sz.left + 'px';
+ }
+ el.style.width = elTo.offsetWidth + 'px';
+ el.style.height = elTo.offsetHeight + 'px';
+ el.style.display = 'block';
+}
+
/* ---- Compressing ./public/javascripts/components/flash.js ----- */
$j(document).ready(function() {
$j(".flash a.close-text").click(function() {
View
2,417 public/javascripts/min/jquery.ext.js
546 additions, 1,871 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
6 script/merge_assets
@@ -33,7 +33,7 @@ def package_js(path, min = true)
# --preserve-semi Preserve all semicolons
# --preserve-strings Do not merge concatenated string literals
puts "Packaging up #{path.upcase}"
- concat_path(path, "js", "javascripts")
+ concat_path(path, "js", "javascripts", ";")
if min
puts `java -jar ./script/jar/yuicompressor-2.2.4.jar --nomunge --preserve-semi --preserve-strings ./public/javascripts/min/#{path}.concat.js > ./public/javascripts/min/#{path}.js`
@@ -52,12 +52,12 @@ def package_css(path)
puts "========================="
end
-def concat_path(path, extension, output_folder)
+def concat_path(path, extension, output_folder, end_sep = nil)
file = File.open( "./public/#{output_folder}/min/#{path}.concat.#{extension}", "w+") do |f|
Dir["./public/#{output_folder}/#{path}/**/*.#{extension}"].each do |file|
f.puts "/* ---- Compressing #{file} ----- */\n"
f.puts File.open(file, "r").read
- f.puts "\n"
+ f.puts "\n#{end_sep}\n"
end
end
end

0 comments on commit 00b45fd

Please sign in to comment.
Something went wrong with that request. Please try again.